[wp-trac] [WordPress Trac] #19748: dbDelta fails for capital prefixed tables

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 5 12:46:09 UTC 2012


#19748: dbDelta fails for capital prefixed tables
--------------------------+-----------------------------
 Reporter:  netweblogic   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.3.1
 Severity:  major         |   Keywords:
--------------------------+-----------------------------
 Probably a linux/Windows mysql version issue since not all sites do this,
 but on some instances if your tables are using capitals, mySQL will fail
 to recognize a create statement should be an update of a present table.

 Reason is because dbDelta checks lower cased names of the table to see if
 it should create or update a table.

 Offending line is /wp-admin/includes/upgrade.php line 1471

 Changing this

 {{{
 $cqueries[trim( strtolower($matches[1]), '`' )] = $qry;
 }}}


 to


 {{{
 $cqueries[trim($matches[1], '`' )] = $qry;
 }}}

 and it works. Is there a reason why dbDelta forces a lowercase lookup for
 present tables on the DB?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19748>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list