[wp-trac] [WordPress Trac] #10404: dbDelta creates duplicate indexes when index definition contains spaces
WordPress Trac
noreply at wordpress.org
Tue Oct 30 15:00:42 UTC 2012
#10404: dbDelta creates duplicate indexes when index definition contains spaces
-------------------------------+-----------------------------
Reporter: Denis-de-Bernardy | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version: 2.8.1
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------------+-----------------------------
Changes (by jbutkus):
* cc: butkus.justas@… (added)
* keywords: => has-patch
Comment:
I get, that this ticket is rather old, but I had experienced the very same
issues with WP 3.4.2.
My patch is created against trunk version
(https://core.svn.wordpress.org/trunk).
In one place (matching columns) {{{preg_match}}} regexp is extended by
adding '{{{\s*}}}' instead of plain ' ' (single space - {{{0x20}}}).
For indexes - I provided a function, which attempts to normalize indexes,
by unifying various edge cases, namely: remove multiple whitespaces,
replace 'INDEX' for 'KEY' at the beginning of declaration, etc.
These are based on DB DDLs used by our plugin (All-in-One Event Calendar
by Timely). If someone encounters another edge case, which is not covered
by these modifications - I may pay time to fix for these as well.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10404#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list