[wp-trac] [WordPress Trac] #13310: Extend option_name to varchar(255)
WordPress Trac
noreply at wordpress.org
Tue Aug 25 10:14:28 UTC 2015
#13310: Extend option_name to varchar(255)
-------------------------+-----------------------
Reporter: scribu | Owner: pento
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.4
Component: Database | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+-----------------------
Comment (by pento):
[attachment:13310.diff] fixes a bug in [attachment:13310-440.2.diff], the
prefix index can't be created until after `option_name` column has been
extended to be longer than the prefix.
This still isn't entirely correct, however. the `option_name` index is
`UNIQUE`, but because we're making it unique by prefix, it means this
query will fail, despite the two values being different:
`INSERT INTO wp_options (option_name)
VALUES(REPEAT('a',192)),(REPEAT('a',193));`
So, our options are to either make the `option_name` column 191 characters
long, so that we don't get bad query failures. The other option is to
accept that sometimes data will fail to insert, despite `SELECT * FROM
wp_options WHERE option_name='...'` showing that there's no clashing
`option_name`.
Both of these options kind of suck.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/13310#comment:70>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list