felipe Tue Aug 12 13:32:31 2008 UTC
Added files:
/php-src/ext/sqlite3/tests bug45798.phpt
Modified files:
/php-src/ext/sqlite3 sqlite3.c
Log:
- Fixed bug #45798 (sqlite3 doesn't notice if variable was bound)
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/sqlite3.c?r1=1.11&r2=1.12&diff_format=u
Index: php-src/ext/sqlite3/sqlite3.c
diff -u php-src/ext/sqlite3/sqlite3.c:1.11 php-src/ext/sqlite3/sqlite3.c:1.12
--- php-src/ext/sqlite3/sqlite3.c:1.11 Wed Aug 6 14:02:44 2008
+++ php-src/ext/sqlite3/sqlite3.c Tue Aug 12 13:32:30 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sqlite3.c,v 1.11 2008/08/06 14:02:44 scottmac Exp $ */
+/* $Id: sqlite3.c,v 1.12 2008/08/12 13:32:30 felipe Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1096,6 +1096,7 @@
/* If the ZVAL is null then it should be bound as that
*/
if (Z_TYPE_P(param->parameter) == IS_NULL) {
sqlite3_bind_null(stmt_obj->stmt,
param->param_number);
+ zend_hash_move_forward(stmt_obj->bound_params);
continue;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/bug45798.phpt?view=markup&rev=1.1
Index: php-src/ext/sqlite3/tests/bug45798.phpt
+++ php-src/ext/sqlite3/tests/bug45798.phpt
--TEST--
Bug #45798 (sqlite3 doesn't notice if variable was bound)
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
require_once(dirname(__FILE__) . '/new_db.inc');
$db->exec('CREATE TABLE test (time INTEGER, id STRING)');
$db->exec("INSERT INTO test (time, id) VALUES (" . time() . ", 'a')");
$db->exec("INSERT INTO test (time, id) VALUES (" . time() . ", 'b')");
$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC");
$stmt->bindParam(1, $foo, SQLITE3_TEXT);
$results = $stmt->execute();
while ($result = $results->fetchArray(SQLITE3_NUM)) {
var_dump($result);
}
$results->finalize();
$db->close();
print "done";
?>
--EXPECT--
done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php