Skip to content

Commit 936cafe

Browse files
committed
Merge branch 'PHP-5.6' into PHP-7.0
2 parents a1a5b52 + eb57029 commit 936cafe

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ PHP NEWS
3030
- SPL:
3131
. Fixed bug #73423 (Reproducible crash with GDB backtrace). (Laruence)
3232

33+
- SQLite3:
34+
. Fixed bug #73530 (Unsetting result set may reset other result set). (cmb)
35+
3336
- XML:
3437
. Fixed bug #72135 (malformed XML causes fault) (edgarsandi)
3538

ext/sqlite3/sqlite3.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,9 +2167,6 @@ static void php_sqlite3_result_object_free_storage(zend_object *object) /* {{{ *
21672167
}
21682168

21692169
if (!Z_ISNULL(intern->stmt_obj_zval)) {
2170-
if (intern->stmt_obj && intern->stmt_obj->initialised) {
2171-
sqlite3_reset(intern->stmt_obj->stmt);
2172-
}
21732170

21742171
zval_ptr_dtor(&intern->stmt_obj_zval);
21752172
}

ext/sqlite3/tests/bug73530.phpt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--TEST--
2+
Bug #73530 (Unsetting result set may reset other result set)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('sqlite3')) die('skip sqlite3 extension not available');
6+
?>
7+
--FILE--
8+
<?php
9+
$db = new SQLite3(':memory:');
10+
$db->exec("CREATE TABLE foo (num int)");
11+
$db->exec("INSERT INTO foo VALUES (0)");
12+
$db->exec("INSERT INTO foo VALUES (1)");
13+
$stmt = $db->prepare("SELECT * FROM foo WHERE NUM = ?");
14+
$stmt->bindValue(1, 0, SQLITE3_INTEGER);
15+
$res1 = $stmt->execute();
16+
$res1->finalize();
17+
$stmt->clear();
18+
$stmt->reset();
19+
$stmt->bindValue(1, 1, SQLITE3_INTEGER);
20+
$res2 = $stmt->execute();
21+
while ($row = $res2->fetchArray(SQLITE3_ASSOC)) {
22+
var_dump($row);
23+
unset($res1);
24+
}
25+
?>
26+
===DONE===
27+
--EXPECT--
28+
array(1) {
29+
["num"]=>
30+
int(1)
31+
}
32+
===DONE===

0 commit comments

Comments
 (0)