Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#4900 closed defect (bug) (invalid)

nested queries break horribly

Reported by: andy's profile andy Owned by:
Milestone: Priority: highest omg bbq
Severity: critical Version:
Component: General Keywords:
Focuses: Cc:


This wasn't an issue before there was a 'query' filter in wpdb::query, but it's an issue now.

To see what I mean, do a SELECT query while filtering a SELECT query.

Here is what happens: Query A flushes $this->last_result. Query B flushes $this->last_result and then populates $this->last_result. Query A tries APPENDS ITS ROWS to $this->last_result. The first row returned by Query A's get_results or whatever is going to be the first row of Query B's results. Nasty!

It's just sloppy not to initialize an array immediately prior to use, when that array's scope is large enough to let it be modified elsewhere.

Patch attached. There went my weekend...

Attachments (1)

nest-queries.diff (741 bytes) - added by andy 17 years ago.

Download all attachments as: .zip

Change History (3)

17 years ago

#1 @andy
17 years ago

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

sorry, this issue belongs to hyper-db

#2 @foolswisdom
17 years ago

  • Milestone 2.3 deleted
  • Version 1.5 deleted
Note: See TracTickets for help on using tickets.