Opened 15 years ago
Closed 14 years ago
#11372 closed defect (bug) (fixed)
wpdb::query returns FALSE on TRUNCATE
Reported by: | marcis20 | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 2.8.5 |
Component: | Database | Keywords: | has-patch |
Focuses: | Cc: |
Description
When executing a "TRUNCATE" SQL query, wpdb returns FALSE (num_rows = 0) although it's succesfull.
Maybe it should be included in the "if" section of the method check:
if ( preg_match("/^\\s*(insert|delete|update|replace|alter) /i",$query) ) {
And returns the "$this->rows_affected" value (1).
Attachments (3)
Change History (12)
Note: See
TracTickets for help on using
tickets.
For insert|delete|update|replace statements, rows_affected is set correctly.
The problematic ones are DDL statements: CREATE, DROP, TRUNCATE, ALTER etc.