[wp-trac] [WordPress Trac] #36649: Right-hand CAST in a MySQL query produces DB error

WordPress Trac noreply at wordpress.org
Sat Apr 23 15:29:44 UTC 2016


#36649: Right-hand CAST in a MySQL query produces DB error
--------------------------+------------------------------
 Reporter:  ericlewis     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  2.8
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Changes (by ericlewis):

 * version:   => 2.8


Comment:

 Before r10597, the collation was always set and
 [https://github.com/WordPress/WordPress/blob/4.5/wp-includes/wp-
 db.php#L784-L787 still is] if `mysqli_set_charset()` is undefined or the
 version of MySQL is < 5.0.7.

 Setting charset via `mysql_set_charset()` has been preferred since r10597,
 presumably to make `mysql_real_escape_string()` aware of the MySQL
 connection charset for charset-specific escaping (see
 [https://core.trac.wordpress.org/ticket/5455#comment:20 #5455#comment:20])
 thus avoiding a security vulnerability. However, this does not set the
 MySQL connection's collation.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36649#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list