-
Bug
-
Resolution: Fixed
-
Major
-
3.3.7, 3.4.4, 3.5.1, 3.6
-
MySQL, Microsoft SQL
-
MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
m36_
MDL-63319_MySQL_MSSQL_Rename_Field_Reserved_Word -
Easy
-
On reading CONTRIB-7420, where there was the need to rename a column named w/ a reserved word, I found that sql_generator::getRenameFieldSQL properly encodes the column name, while the overridden method in MySQL doesn't take care of it.
Same broken result when falling into the upgrade step coded for MDL-60793, as already described in the Community some time ago: https://moodle.org/mod/forum/discuss.php?d=373009.
Again, same end effect appears in MSSQL - there are no public posts about it -, here since the syntax of the stored procedure doesn't handle quotes as coded in getEncQuoted() for general usage.
Shortly:
- on MySQL, you cannot rename a field named with a reserved word; this is the major issue affecting the two examples above
- on MSSQL, you cannot rename a field into a reserved word, this is a minor/cosmetic issue; a peer review should discourage people from renaming a field from a valid name into a reserved word for at least one of the supported DB servers in Moodle
- on both PostgreSQL and Oracle Moodle DB API supports to go back and forth on renaming a field from/into a reserved word
- has been marked as being related by
-
MDL-59098 Compatibility with MySQL 8.0.x
-
- Closed
-
- will help resolve
-
MDL-60793 mod_chat breaks moodle installation on MySQL 8.0.3
-
- Closed
-
-
CONTRIB-7420 Error reading from database
-
- Closed
-