﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
12257	wpdb Scales Badly Due to Unnecessary Copies of All Query Results	miqrogroove	ryan	"While working on #11726, I encountered a reproducible crash in wpdb::query()

The following code causes memory exhaustion on large result sets:

{{{
while ( $row = @mysql_fetch_object($this->result) ) {
	$this->last_result[$num_rows] = $row;
	$num_rows++;
}
}}}

The memory exhaustion message is error-controlled, causing a white screen of death even in debug mode.

I searched wp-db.php for references to $this->last_result, and I found no justification for these object reference copies.  $this->last_result '''should''' be maintained as a MySQL resource and properly optimized using the MySQL client layer instead of this PHP nonsense.

Tagging for dev-feedback to discuss which Milestone is appropriate."	defect (bug)	reopened	normal	Future Release	Database		critical		3.2-early needs-refresh	mpretty@… WordPress@… joel@… kenton.jacobsen@…
