|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-12 13:31 UTC] johannes@php.net
[2008-08-12 13:36 UTC] felipe@php.net
[2008-08-15 14:08 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 26 09:00:01 2025 UTC |
Description: ------------ If a prepared statement is executed while the bound variable doesn't exist, or is NULL, PHP freeze and wait. I tweaked the test also to use SQLITE3_NULL instead of SQLITE3_TEXT, and NULL or !isset($foo) also froze PHP. Reproduce code: --------------- <?php $db = new SQLite3(':memory:'); // cr?ation d'une table $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"); //$foo = 'a'; works OK //$foo = NULL; also freeze $stmt->bindParam(1, $foo, SQLITE3_TEXT); $results = $stmt->execute(); while ($result = $results->fetchArray(SQLITE3_NUM)) { var_dump($result); } $results->finalize(); $db->close(); ?> Expected result: ---------------- I would expect PHP to return from execute with an error. Actual result: -------------- PHP freeze, doing nothing.