From 482cc7713ef1348849b0bd1dcb257a4eefac2a92 Mon Sep 17 00:00:00 2001 From: Vasilis Daloukas Date: Tue, 27 Jun 2017 10:23:22 +0300 Subject: [PATCH] Fix MariaDB compatibility --- CHANGES.md | 3 +++ db/upgrade.php | 10 +++++----- version.php | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7f0a364..70c99a2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,6 @@ +Changes in version 2017-06-27 (20170627) +- Fix conversation of columns (cols,rows) from string to int + Changes in version 2017-06-20 (20170620) - Fix conversation of columns (cols,rows) from string to int diff --git a/db/upgrade.php b/db/upgrade.php index c5b9e38..b046d7b 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -52,7 +52,7 @@ defined('MOODLE_INTERNAL') || die(); function mpgame_db_copy_string_to_int( $table, $from, $to) { global $CFG, $DB; - $sql = "SELECT id,$from,$to FROM {$CFG->prefix}$table"; + $sql = "SELECT * FROM {$CFG->prefix}$table"; $recs = $DB->get_records_sql( $sql); foreach ($recs as $rec) { $val = intval( $rec->$from); @@ -1581,7 +1581,7 @@ function xmldb_game_upgrade($oldversion) { $dbman->change_field_type($table, $field); } - if ($oldversion < ($ver = 2017062002)) { + if ($oldversion < ($ver = 2017062701)) { $table = new xmldb_table('game_cross'); $field = new xmldb_field('usedrows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); if (!$dbman->field_exists($table, $field)) { @@ -1597,7 +1597,7 @@ function xmldb_game_upgrade($oldversion) { } } - if ($oldversion < ($ver = 2017062002)) { + if ($oldversion < ($ver = 2017062701)) { $table = new xmldb_table('game_cross'); $field = new xmldb_field('usedcols', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); if (!$dbman->field_exists($table, $field)) { @@ -1613,7 +1613,7 @@ function xmldb_game_upgrade($oldversion) { } } - if ($oldversion < ($ver = 2017062002)) { + if ($oldversion < ($ver = 2017062701)) { $table = new xmldb_table('game_snakes_database'); $field = new xmldb_field('usedrows', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); if (!$dbman->field_exists($table, $field)) { @@ -1629,7 +1629,7 @@ function xmldb_game_upgrade($oldversion) { } } - if ($oldversion < ($ver = 2017062002)) { + if ($oldversion < ($ver = 2017062701)) { $table = new xmldb_table('game_snakes_database'); $field = new xmldb_field('usedcols', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, null, null, '0', 'id'); if (!$dbman->field_exists($table, $field)) { diff --git a/version.php b/version.php index ca6aa96..409aea6 100644 --- a/version.php +++ b/version.php @@ -35,7 +35,7 @@ if (!isset( $plugin)) { } $plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). -$plugin->version = 2017062002; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2017062701; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2010112400; // Requires Moodle 2.0. $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->release = '2017-06-20';