Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#5503 closed defect (bug) (fixed)

WP-DB Never do a "SET NAMES" Query

Reported by: g30rg3x's profile g30rg3x Owned by:
Milestone: 2.5 Priority: high
Severity: critical Version: 2.3
Component: General Keywords: has-patch needs-testing
Focuses: Cc:

Description (last modified by lloydbudd)

Because when the set names query suppose to be executed the constructor its not properly completed.

Bug Introduced in the changeset [6458]

Attachments (1)

wpdb.diff (467 bytes) - added by darkdragon 18 years ago.
Oops, spoke too soon, this should fix the problem.

Download all attachments as: .zip

Change History (11)

#2 @darkdragon
18 years ago

  • Milestone changed from 2.3.2 to 2.4
  1. Do you have mysql version greater than 4.1.0? What is your MySQL version?
  2. Do you have charset set? If so, what value is charset set to?

Setting milestone to 2.4 since usually fixed on trunk, then back ported.

#3 @g30rg3x
18 years ago

Well you are misunderstanding the problem (i think)...
First Answering you...
1) Yes, 5.0.27
2) Yes, utf8

Second explaining a little further, when the database construct the object before it select the database the system uses a SET NAMES query, since the changeset 6458 the database object only executes querys if the constructor has been successfully builded...
And since by the time the constructor launches the SET NAMES query the constructor has not finished "building", the var ready its not set to true (by default $ready is set to false) the query method drops the execution and return false...

I hope this help you understanding the problem...

#4 @darkdragon
18 years ago

Okay, this makes sense. I know what the problem is and it has a pretty trivial solution, but I won't take ownership of this problem. I'm working on something else at the moment.

Since the problem has been clearly explained, I'm sure someone will come along and fix it before I could.

@darkdragon
18 years ago

Oops, spoke too soon, this should fix the problem.

#5 @darkdragon
18 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Ha ha, couldn't help myself. Can you test this to see if it fixes your issue?

#6 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6463]) Don't block SET NAMES query. Props g30rg3x for the find. fixes #5503 for 2.3

#7 @ryan
18 years ago

(In [6464]) Don't block SET NAMES query. Props g30rg3x for the find. fixes #5503 for 2.4

#8 @ryan
18 years ago

We crossed in the mail. My patch was slightly different since I wasn't sure of SET NAMES needed to run before we SELECTed the DB. Probably not, but I'd rather not change the order since it's been working.

#9 @darkdragon
18 years ago

Nah, it is cool. Thanks.

#10 @lloydbudd
18 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.