Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
database system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2009 at 08:11 UTC
Updated:
18 Jan 2010 at 06:30 UTC
db_change_column does this:
$ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $column TO ". $column ."_old");
I can't find that syntax in the mysql documentation, http://dev.mysql.com/doc/refman/5.1/en/alter-table.html
And it fails on my server, with an error like
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 'TO mail_old' at line 1 query: ALTER TABLE users RENAME mail TO mail_old in /srv/http/teaserstallion.com/work/ep/htdocs/update.php on line 125.
Comments
Comment #1
sivaji_ganesh_jojodae commentedIndeed its a bug. The correct syntax for MySQL is as follow
The statements that causes this warning message is in update.php line no 125
First line in the above code is wrong it suppose to be
Comment #2
damien tournoud commenteddb_change_column() is deprecated. Use db_change_field().
Comment #3
damien tournoud commentedFrom the documentation of db_change_column():
We need to remove that from D7.
Comment #4
turadg commentedIs db_change_column() deprecated as of D6 or D7?
If it is deprecated in D6, and since it can't be removed, can the documentation be updated to indicate that it is deprecated?
http://api.drupal.org/api/function/db_change_column/6
Perhaps also it could log to watchdog that a deprecated function was called.
Comment #5
Crell commentedThere is no db_change_column() function in D7 HEAD right now, so I'm going to assume this was fixed along the way somewhere. :-)