mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: mysql_fetch_row() expects resource, this will fatal if query was e.g. UPDATE when iterating a result because MySQLQuery::nextRecord() is used by Iterator::valid() and MySQLQuery:: is bool in this case
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@106938 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
34ec202c0d
commit
b5ad10bff1
@ -1082,7 +1082,7 @@ class MySQLQuery extends SS_Query {
|
||||
|
||||
public function nextRecord() {
|
||||
// Coalesce rather than replace common fields.
|
||||
if($data = mysql_fetch_row($this->handle)) {
|
||||
if(is_resource($this->handle) && $data = mysql_fetch_row($this->handle)) {
|
||||
foreach($data as $columnIdx => $value) {
|
||||
$columnName = mysql_field_name($this->handle, $columnIdx);
|
||||
// $value || !$ouput[$columnName] means that the *last* occurring value is shown
|
||||
|
Loading…
Reference in New Issue
Block a user