File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ PHP NEWS
6767- SPL:
6868 . Fixed bug #71028 (Undefined index with ArrayIterator). (Laruence)
6969
70+ - SQLite3:
71+ . Fixed bug #71049 (SQLite3Stmt::execute() releases bound parameter instead
72+ of internal buffer). (Laruence)
73+
7074- Standard:
7175 . Fixed bug #70999 (php_random_bytes: called object is not a function).
7276 (Scott)
Original file line number Diff line number Diff line change @@ -1536,8 +1536,7 @@ PHP_METHOD(sqlite3stmt, execute)
15361536 }
15371537 buffer = php_stream_copy_to_mem (stream , PHP_STREAM_COPY_ALL , 0 );
15381538 } else {
1539- convert_to_string (parameter );
1540- buffer = Z_STR_P (parameter );
1539+ buffer = zval_get_string (parameter );
15411540 }
15421541
15431542 if (buffer ) {
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Bug #71049 (SQLite3Stmt::execute() releases bound parameter instead of internal buffer)
3+ --SKIPIF--
4+ <?php
5+ if (!extension_loaded ('sqlite3 ' )) die ('skip ' ); ?>
6+ --FILE--
7+ <?php
8+
9+ require (__DIR__ . '/new_db.inc ' );
10+
11+ $ db ->exec ('CREATE TABLE test (age INTEGER, id STRING) ' );
12+
13+ $ stmt = $ db ->prepare ("SELECT * FROM test WHERE id = ? ORDER BY id ASC " );
14+ $ foo = "alive " . chr (33 );
15+ $ stmt ->bindParam (1 , $ foo , SQLITE3_BLOB );
16+ $ results = $ stmt ->execute ();
17+ var_dump ($ foo );
18+ $ db ->close ();
19+ ?>
20+ --EXPECT--
21+ string(6) "alive!"
You can’t perform that action at this time.
0 commit comments