Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#10892 closed defect (bug) (invalid)

msql query fails when running set names utf8

Reported by: digininja Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: General Keywords: reporter-feedback
Focuses: Cc:


There is code on line 367 of wordpress/wp-includes/wp-db.php which does a db query of SET NAMES 'utf8'. The code in query can't handle this correctly as it expects it to return a number of rows which it doesn't so the line

while ($i < @mysql_num_fields($this->result)) {

in the query function fails.

The easy fix for this is to add

} elseif ( preg_match("/
s*(set) /i",$query) ) {

return 0;

as part of the if statement around line 700.

Change History (2)

#1 @westi
9 years ago

  • Cc westi added
  • Keywords reporter-feedback added

This code already does return 0 rows affected in this case.

I cannot reproduce your bug can you provide more information.

#2 @scribu
8 years ago

  • Milestone Unassigned deleted
  • Resolution set to invalid
  • Status changed from new to closed

Closing pending feedback.

Note: See TracTickets for help on using tickets.