Lately I received a database error while updating to 7.11.10. This is caused by the definition of “idx_user_name” in vardefs.php which contains column specifications ‘last_name (30)’ and ‘first_name (30)’. Partial indexes like this are specific to mysql and cause errors on other DBMS. Please remove this for future versions.
Speaking of mysql specifics, here are two more I came across:
In modules/Project/controller.php line 57 reads:
$query = "SELECT max(date_finish) + INTERVAL " . (30 - $duration) . " DAY FROM project_task WHERE project_id = '{$project->id}'";
Which causes an error on MSSQL. Since there is a DBMS abstraction class I think it should read:
$query = "SELECT ". $db->convert("max(date_finish)", "add_date", (30 - $duration), "DAY") . " FROM project_task WHERE project_id = '{$project->id}'";
In modules/InboundEmail/Save.php line 222 reads:
$foldersFound = $focus->db->query('SELECT id FROM folders WHERE folders.id LIKE "'.$focus->id.'"');
In MSSQL only single quotes are accepted as string delimiters. Since this is specified in the standard single quotes should be accepted by all other DBMS as well so I suggest changing that line to:
$foldersFound = $focus->db->query('SELECT id FROM folders WHERE folders.id LIKE \''.$focus->id.'\'');
Edit: Typo “max(date_finish” corrected.