[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:


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:


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


More information about the HyperDB mailing list