diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-07-26 13:19:10 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-07-26 13:26:58 +0200 |
commit | ce66492a1353b2aab80529f7b3ca967694d83a7e (patch) | |
tree | 4410f295796f764f1175acd3a1ab87cca9492212 | |
parent | a96ca139630d55eb2b37aa3a5daf9584042a0e4a (diff) | |
parent | ed7e3bc70a89a0838a5b7e44928cbd65aec50bb1 (diff) | |
download | php-git-ce66492a1353b2aab80529f7b3ca967694d83a7e.tar.gz |
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/sqlite3/sqlite3.c | 2 | ||||
-rw-r--r-- | ext/sqlite3/tests/bug76665.phpt | 19 |
3 files changed, 24 insertions, 1 deletions
@@ -13,6 +13,10 @@ PHP NEWS - PDO_Firebird: . Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis) +- SQLite3: + . Fixed #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle). + (cmb) + - Standard: . Fixed bug #73817 (Incorrect entries in get_html_translation_table). (cmb) . Fixed bug #68553 (array_column: null values in $index_key become incrementing diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 861d6dfc7a..5a0ee776b4 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1595,7 +1595,7 @@ PHP_METHOD(sqlite3stmt, execute) break; case SQLITE_FLOAT: - /* convert_to_double(parameter);*/ + convert_to_double(parameter); sqlite3_bind_double(stmt_obj->stmt, param->param_number, Z_DVAL_P(parameter)); break; diff --git a/ext/sqlite3/tests/bug76665.phpt b/ext/sqlite3/tests/bug76665.phpt new file mode 100644 index 0000000000..0e1de136f7 --- /dev/null +++ b/ext/sqlite3/tests/bug76665.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #76665 (SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle) +--SKIPIF-- +<?php +if (!extension_loaded('sqlite3')) die('skip sqlite3 extension not available'); +?> +--FILE-- +<?php +$db = new SQLite3(':memory:'); +$db->exec("CREATE TABLE foo (bar REAL)"); +$stmt = $db->prepare("INSERT INTO foo VALUES (:bar)"); +$stmt->bindValue(':bar', 17, SQLITE3_FLOAT); +$stmt->execute(); +var_dump($db->querySingle("SELECT bar FROM foo LIMIT 1")); +?> +===DONE=== +--EXPECT-- +float(17) +===DONE=== |