[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:39:09 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
Component:  Query                                |  Review
 Severity:  normal                               |     Version:  2.8
 Keywords:  has-patch needs-testing dev-         |  Resolution:
  feedback                                       |     Focuses:
-------------------------------------------------+-------------------------
Changes (by ericlewis):

 * keywords:   => has-patch needs-testing dev-feedback


Comment:

 In attachment:36649.diff, we can use `mysqli_set_charset()` so that
 `mysqli_real_escape_string()` is aware of the character set (see the
 Caution section in [http://php.net/manual/en/mysqli.real-escape-string.php
 the `mysqli_real_escape_string()` docs]), and then set the character set
 (again) but this time with the collation.

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


More information about the wp-trac mailing list