nested queries break horribly
|Reported by:||andy||Owned by:||anonymous|
|Priority:||highest omg bbq||Milestone:|
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...