Opened 14 years ago
Closed 12 years ago
#15948 closed defect (bug) (fixed)
dbDelta SET Default <literal> Comment <literal>
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | major | Version: | 3.1 |
Component: | Database | Keywords: | has-patch 3.2-early |
Focuses: | Cc: |
Description (last modified by )
When dbDelta from wp_admin/includes/upgrade.php is used with a query containing different DEFAULT values than the actual TABLE in the database, dbDelta tries to update this DEFAULT value by altering the table. The regex that is used to find the new DEFAULT value is incorrect.
Right now, the regex is:
| DEFAULT '(.*)'|i
but this should be:
| DEFAULT '([^']*)'|i
...since, in the case a COMMENT value is set in the new query, the COMMENT value is also surrounded by single quotes ' COMMENT 'literal is added to the new default value.
Attachments (1)
Change History (8)
#3
@
14 years ago
- Keywords has-patch 3.2-early added; sql regex removed
- Milestone changed from Awaiting Review to Future Release
Seems sane enough to me, We should ensure that it matches the command as best as possible.
Note: See
TracTickets for help on using
tickets.
The regex should be
| DEFAULT '([^']*)'|i
I didn't know about the WikiFormatting of
^
.