Opened 17 years ago
Closed 15 years ago
#11372 closed defect (bug) (fixed)
wpdb::query returns FALSE on TRUNCATE
| Reported by: | marcis20 | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.2 |
| Component: | Database | Version: | 2.8.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
For insert|delete|update|replace statements, rows_affected is set correctly.
The problematic ones are DDL statements: CREATE, DROP, TRUNCATE, ALTER etc.