Skip to content

Commit 08ae84f

Browse files
committed
Call data_seek(0) only if we've used DB_result::*row*() methods
This should fix HHVM where it throws 'Unable to jump to row 0 on MySQL result index X' error messages for ext/mysqli
1 parent 2bbbd1a commit 08ae84f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/database/DB_result.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function custom_result_object($class_name)
203203
return $this->custom_result_object[$class_name];
204204
}
205205

206-
$this->data_seek(0);
206+
is_null($this->row_data) OR $this->data_seek(0);
207207
$this->custom_result_object[$class_name] = array();
208208

209209
while ($row = $this->_fetch_object($class_name))
@@ -246,7 +246,7 @@ public function result_object()
246246
return $this->result_object;
247247
}
248248

249-
$this->data_seek(0);
249+
is_null($this->row_data) OR $this->data_seek(0);
250250
while ($row = $this->_fetch_object())
251251
{
252252
$this->result_object[] = $row;
@@ -287,7 +287,7 @@ public function result_array()
287287
return $this->result_array;
288288
}
289289

290-
$this->data_seek(0);
290+
is_null($this->row_data) OR $this->data_seek(0);
291291
while ($row = $this->_fetch_assoc())
292292
{
293293
$this->result_array[] = $row;

0 commit comments

Comments
 (0)