Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.4
-
MOODLE_34_STABLE
-
MOODLE_32_STABLE, MOODLE_33_STABLE
-
m34_
MDL-59635_Properly_Escape_Column_Names_Reserved_Words_Proof -
-
Easy
-
Description
As described in https://moodle.org/mod/forum/discuss.php?d=354485 sometimes plug-in developers doesn't properly care about reserved words when they design their data models: it could happen that their choices conflict for one or more DB Servers among the ones supported by Moodle.
Unfortunately this local - i.e. the plug-in can't run when Moodle uses a specific DB server - issue can reflect in those Moodle tools that play with the database tables like the Replace Tool.
To replicate:
- Add a new column field (XMLDB_TYPE_CHAR or XMLDB_TYPE_TEXT) using a reserved word crossing the DBs like where in a core table e.g. In MySQL, by altering the scorm table w/ a new XMLDB_TYPE_CHAR field:
ALTER TABLE mdl_scorm ADD `where` VARCHAR(20) COLLATE utf8mb4_bin DEFAULT 'localhost';
- Try to use the Replace Tool e.g.
php admin/tool/replace/cli/replace.php --search=//oldsitehost --replace=//newsitehost
- Expected:
- The replace tool will complete successfully.
- Actual:
- An error is encountered.
Attachments
Issue Links
- has been marked as being related by
-
MDL-46269 Convert http embedded content to https on https sites where available
-
- Closed
-
- will be (partly) resolved by
-
MDLSITE-5170 (Pre)Check for DB reserved words
-
- Open
-