[wp-trac] [WordPress Trac] #11608: wpdb->prepare() is broken

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 25 13:16:03 UTC 2009


#11608: wpdb->prepare() is broken
--------------------------+-------------------------------------------------
 Reporter:  hakre         |       Owner:  ryan            
     Type:  defect (bug)  |      Status:  new             
 Priority:  normal        |   Milestone:  3.0             
Component:  Database      |     Version:  2.9             
 Severity:  normal        |    Keywords:  has-patch tested
--------------------------+-------------------------------------------------

Comment(by Denis-de-Bernardy):

 Replying to [comment:18 dd32]:
 > > Regarding the look for a "better" implemenation, maybe it should be
 considere to actually use prepared statements?
 > When WordPress utilises the MySQLi extension rather than the MySQL
 extension, then sure.

 I'd -1 that, personally, if we ever consider it. What's really needed is
 something equivalent to PDO::ATTR_EMULATE_PREPARES

 A true prepared statement would be very bad, because it would do a return
 trip to the server for every query, and the server would actually prepare
 the statement (in the SQL sense). That is, it would come up with a query
 plan that works with whichever unknown variables, rather than one that is
 perfectly optimized for the constant values we give it.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11608#comment:24>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list