[wp-trac] [WordPress Trac] #11372: wpdb::query returns FALSE on TRUNCATE

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 9 16:06:22 UTC 2009


#11372: wpdb::query returns FALSE on TRUNCATE
--------------------------+-------------------------------------------------
 Reporter:  marcis20      |       Owner:  ryan                     
     Type:  defect (bug)  |      Status:  new                      
 Priority:  normal        |   Milestone:  Unassigned               
Component:  Database      |     Version:  2.8.5                    
 Severity:  normal        |    Keywords:  database, query, truncate
--------------------------+-------------------------------------------------
 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).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11372>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list