A db columns in linkchecker module is named 'update'. I tried to rename this column to changed, but the ALTER in update.php fails every time.
db_change_field($ret, 'linkchecker_tasks', 'update', 'changed', array('type' => 'int', 'not null' => TRUE, 'default' => 0));
Error:
user warning: 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 'update `changed` INT NOT NULL DEFAULT 0' at line 1 query: ALTER TABLE linkchecker_tasks CHANGE update `changed` INT NOT NULL DEFAULT 0 in includes\database.mysql-common.inc on line 520.
So I've added curly quotes to the `update` column and executed it by hand what worked.
ALTER TABLE linkchecker_tasks CHANGE `update` `changed` INT NOT NULL DEFAULT 0
To get the module fixed I need to use the SQL statement and cannot use db_change_field(). I think core should also be able to handle reserved names.
Comments
Comment #1
Jorrit commentedThe original field name is not enclosed with backticks. The attached patch fixes this.
Comment #2
Jorrit commentedDuplicate of #315047: All schema API operations should be reserved-word safe.