[wp-trac] [WordPress Trac] #20263: Backticks in dbDelta cause warning and actually causes a query to alter all columns and indexes to run even if none have changed

WordPress Trac noreply at wordpress.org
Thu May 26 20:06:26 UTC 2016


#20263: Backticks in dbDelta cause warning and actually causes a query to alter all
columns and indexes to run even if none have changed
--------------------------------------+------------------------
 Reporter:  Driskell                  |       Owner:  ocean90
     Type:  defect (bug)              |      Status:  reviewing
 Priority:  normal                    |   Milestone:  4.6
Component:  Database                  |     Version:  1.5
 Severity:  normal                    |  Resolution:
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+------------------------

Comment (by ocean90):

 In [attachment:20263.9.diff] I changed the regex to match a column/index
 name from `\w` to `(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+` which is
 also used by `wpdb::get_table_from_query()`.

 Technically, MySQL supports more characters. From the
 [http://dev.mysql.com/doc/refman/5.7/en/identifiers.html docs]:

 > Permitted characters in unquoted identifiers:
 > * ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar,
 underscore)
 > * Extended: U+0080 .. U+FFFF
 >
 > Permitted characters in quoted identifiers include the full Unicode
 Basic Multilingual Plane (BMP), except U+0000:
 > * ASCII: U+0001 .. U+007F
 > * Extended: U+0080 .. U+FFFF

 Should we support all characters?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/20263#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list