#4900 closed defect (bug) (invalid)
nested queries break horribly
Reported by: | andy | Owned by: | |
---|---|---|---|
Milestone: | Priority: | highest omg bbq | |
Severity: | critical | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
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)
Change History (3)
Note: See
TracTickets for help on using
tickets.
sorry, this issue belongs to hyper-db