Skip to content

Commit

Permalink
a few changes from calling halt to haltmsg to prevent actual halting
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Aug 2, 2018
1 parent 3c005eb commit 2555dd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Mysqli/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ public function seek($pos = 0) {
} else {
$this->haltmsg("seek({$pos}) failed: result has ".$this->num_rows().' rows', __LINE__, __FILE__);
/* half assed attempt to save the day, but do not consider this documented or even desirable behaviour. */
@mysqli_data_seek($this->queryId, $this->num_rows());
$this->Row = $this->num_rows;
$rows = $this->num_rows();
@mysqli_data_seek($this->queryId, $rows);
$this->Row = $rows;
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion tests/Mysqli/DbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function testQuery() {
$this->db->next_record(MYSQLI_ASSOC);
$second_id = $this->db->Record['st_id'];
$this->assertNotEquals($first_id, $second_id);
$this->assertTrue($this->db->seek(100000));
$this->assertFalse($this->db->seek(100000));
$this->db->next_record(MYSQLI_ASSOC);
$second_id = $this->db->Record['st_id'];
$this->assertNotEquals($first_id, $second_id);
Expand Down

0 comments on commit 2555dd2

Please sign in to comment.