Ticket #5503 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

WP-DB Never do a "SET NAMES" Query

Reported by: g30rg3x Assigned to: anonymous
Priority: high Milestone: 2.5
Component: General Version: 2.3
Severity: critical Keywords: has-patch needs-testing
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

wpdb.diff (467 bytes) - added by darkdragon on 12/22/07 06:15:57.
Oops, spoke too soon, this should fix the problem.

Change History

12/22/07 04:29:04 changed by darkdragon

12/22/07 04:32:45 changed by darkdragon

  • 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.

12/22/07 05:54:26 changed by g30rg3x

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...

12/22/07 06:11:30 changed by darkdragon

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.

12/22/07 06:15:57 changed by darkdragon

  • attachment wpdb.diff added.

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

12/22/07 06:16:36 changed by darkdragon

  • keywords changed from needs-patch to has-patch needs-testing.

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

12/22/07 06:24:10 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

12/22/07 06:24:48 changed by ryan

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

12/22/07 06:26:44 changed by ryan

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.

12/22/07 07:01:40 changed by darkdragon

Nah, it is cool. Thanks.

12/22/07 18:02:13 changed by lloydbudd

  • description changed.