- SQLite3:
. Unbundled libsqlite. (cmb)
. Lifted requirements to SQLite 3.5.0. (cmb)
+ . Added support for the SQLite @name notation. (cmb, BohwaZ)
- Standard:
. Fixed bug #74764 (Bindto IPv6 works with file_get_contents but fails with
- SQLite3:
. The bundled libsqlite has been removed. To build the SQLite3 and/or
PDO_SQLite extensions a system libsqlite3 ≥ 3.5.0 is now required.
+ . The @param notation can now also be used to denote SQL query parameters.
- Zip:
. The bundled libzip library has been removed. A system libzip >= 0.11 is now
/* We need a : prefix to resolve a name to a parameter number */
if (param->name) {
- if (ZSTR_VAL(param->name)[0] != ':') {
+ if (ZSTR_VAL(param->name)[0] != ':' && ZSTR_VAL(param->name)[0] != '@') {
/* pre-increment for character + 1 for null */
zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0);
ZSTR_VAL(temp)[0] = ':';
--- /dev/null
+--TEST--
+SQLite3::prepare Bound Value test
+--SKIPIF--
+<?php require_once(__DIR__ . '/skipif.inc'); ?>
+--FILE--
+<?php
+
+require_once(__DIR__ . '/new_db.inc');
+define('TIMENOW', time());
+
+echo "Creating Table\n";
+var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
+
+echo "INSERT into table\n";
+var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')"));
+var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
+
+echo "SELECTING results\n";
+$stmt = $db->prepare("SELECT * FROM test WHERE id = @id ORDER BY id ASC");
+$foo = 'a';
+echo "BINDING Value\n";
+var_dump($stmt->bindValue('@id', $foo, SQLITE3_TEXT));
+$results = $stmt->execute();
+while ($result = $results->fetchArray(SQLITE3_NUM))
+{
+ var_dump($result);
+}
+$results->finalize();
+
+echo "Closing database\n";
+var_dump($db->close());
+echo "Done\n";
+?>
+--EXPECTF--
+Creating Table
+bool(true)
+INSERT into table
+bool(true)
+bool(true)
+SELECTING results
+BINDING Value
+bool(true)
+array(2) {
+ [0]=>
+ int(%d)
+ [1]=>
+ string(1) "a"
+}
+Closing database
+bool(true)
+Done