[HyperDB] [Fwd: Hyper DB fix]

Andy Skelton skeltoac at gmail.com
Mon Nov 3 14:59:41 GMT 2008


On Sun, Nov 2, 2008 at 4:07 PM, Dan Milward <dan at instinct.co.nz> wrote:
> I added ". '|ALTER TABLE(?:\s+ADD)?'  " to the Big pattern in
> get_table_from_query to make sure it can get the table name out of SQL
> queries like the following:
>
> ALTER TABLE `wp_22_purchase_logs` ADD `find_us` varchar(255) NOT NULL

Hi Dan,

That's definitely a bug, but not the best patch. Here is the MySQL
manual on ALTER TABLE syntax:

http://dev.mysql.com/doc/refman/4.1/en/alter-table.html

The keyword "ADD" only appears after the table name, so it's not
needed. However, "IGNORE" is legal between ALTER and TABLE. I applied
the following patch to fix the "ALTER" pattern:

http://plugins.trac.wordpress.org/changeset/71913

Please pass that on and let me know if it's not a good fix.

Cheers,
Andy


More information about the HyperDB mailing list