diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-07-26 14:09:30 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-07-26 14:23:40 +0200 |
commit | d035bc2bfe10a299d94ea46305612e587231c563 (patch) | |
tree | ce1bfda89d4985b0ae4c151386224af2b291b562 /ext/sqlite3 | |
parent | ba8f0615e1fabf5f301e3cdb4ad80b0fc9c5645d (diff) | |
parent | ce66492a1353b2aab80529f7b3ca967694d83a7e (diff) | |
download | php-git-d035bc2bfe10a299d94ea46305612e587231c563.tar.gz |
Merge branch 'PHP-7.2'
* PHP-7.2:
Fix #76665: SQLite3Stmt::bindValue() with SQLITE3_FLOAT doesn't juggle
Diffstat (limited to 'ext/sqlite3')
-rw-r--r-- | ext/sqlite3/sqlite3.c | 2 | ||||
-rw-r--r-- | ext/sqlite3/tests/bug76665.phpt | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index ced363bc62..2c269fc337 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -1591,7 +1591,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=== |