Opened 6 years ago
Last modified 22 months ago
#46146 new defect (bug)
dbDelta not parsing enum correctly
Reported by: | janjakes | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Database | Keywords: | |
Focuses: | Cc: |
Description
Given an enum definition such as:
enum('a', 'b')
The dbDelta function parses it as:
enum('a',
Which causes a change to be detected on every execution. I'm also afraid other cases with spaces (like strings with spaces in enum values, etc.) will cause similar problem since the regular expressions in the dbDelta function seem to cover only some particular cases.
Note: See
TracTickets for help on using
tickets.
I found that having spaces is no longer an issue in newer versions of WordPress, but there is still a parsing issue with ENUMs if there are new lines between the elements. For example:
This is a problem with WordPress 5.6.