Opened 9 years ago
Last modified 7 years ago
#40694 new defect (bug)
dbDelta uses suppressed errors to detect table absence
| Reported by: | andy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Database | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
In dbDelta, $tablefields is populated by the statement DESCRIBE {$table}. When the table does not exist, this statement fails with an error. This statement is executed with error suppression enabled.
Handling of suppressed errors is customizable in database drop-ins. In one large case, suppressed errors are logged for analysis. These suppressed DESCRIBE errors are considered a bug because it's possible to check for the presence of a table without errors by using a SHOW TABLES LIKE statement.
It would be preferable to leave error suppression out of dbDelta and use the SHOW TABLES LIKE statement, as in the attached patch.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This patch has been deployed on WordPress.com.