Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 3.7.1
-
Component/s: Database SQL/XMLDB, Messages
-
Labels:
-
Testing Instructions:
-
Workaround:
-
Affected Branches:MOODLE_37_STABLE
-
Fixed Branches:MOODLE_36_STABLE, MOODLE_37_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-66110-master -
Pull Master Diff URL:
-
Story Points:2
-
Sprint:Sprint 4 - Road to Redemption
Description
When trying to upgrade from version 3.3 to 3.7.1, we get an error:
Default exception handler: Error reading from database Debug: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups g
ON mc.itemid = g.id
WHERE mc.compo' at line 3
SELECT mc.id
FROM message_conversations mc
LEFT JOIN groups g
ON mc.itemid = g.id
WHERE mc.component = ?
AND mc.itemtype = ?
AND g.id is NULL
[array (
0 => 'core_group',
1 => 'groups',
)]
Error code: dmlreadexception
- line 486 of \lib\dml\moodle_database.php: dml_read_exception thrown
- line 1245 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 2743 of \lib\db\upgrade.php: call to mysqli_native_moodle_database->get_records_sql()
- line 1809 of \lib\upgradelib.php: call to xmldb_main_upgrade()
- line 518 of \admin\index.php: call to upgrade_core()
Probable reason in the keyword "GROUPS" - from version MySQL 8.0.2 this word is reserved and forbidden by standard SQL as column or table names (https://dev.mysql.com/doc/refman/8.0/en/keywords.html)