[wp-trac] [WordPress Trac] #21663: Use PDO or mysqli for MySQL queries when available

WordPress Trac noreply at wordpress.org
Wed Nov 27 21:31:57 UTC 2013


#21663: Use PDO or mysqli for MySQL queries when available
--------------------------------------------------+------------------
 Reporter:  scottconnerly                         |       Owner:
     Type:  task (blessed)                        |      Status:  new
 Priority:  normal                                |   Milestone:  3.8
Component:  Database                              |     Version:  3.5
 Severity:  normal                                |  Resolution:
 Keywords:  dev-feedback has-patch needs-testing  |
--------------------------------------------------+------------------

Comment (by aaroncampbell):

 In [attachment:21663.6.diff]:

 * I removed the filter and opted to NOT introduce a new constant.
 Constants have been quite a pain for us in the not-too-distant past, and
 since this didn't seem necessary I thought we'd see if we came up with a
 better solution later instead of rushing to add it now.
 * The `mysqli_set_charset` call happens inside `if ( $this->has_cap(
 'collation' ) && ! empty( $charset ) )` so the cap check is still in
 place.
 * I had checked the flags too.  Seems OK. A bunch of the functions
 themselves took reversed arguments (handle first for mysqli), so I was
 worried...but it turned out OK.
 * I changed load_col_info to put the for loops in the if.  Definitely
 looks cleaner
 * Cleaned up the last_error logic.
 * I swapped out the WP_DEBUG and use_mysqli conditionals in `db_connect()`

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


More information about the wp-trac mailing list