|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-02-09 07:21 UTC] Jared dot Williams1 at ntlworld dot com
Description: ------------ Follow on from http://pecl.php.net/bugs/bug.php?id=3391 Using php5.0-win32-200502090930 with stable versions of php_pdo.dll 09-Feb-2005 10:39 52k php_pdo_sqlite.dll 09-Feb-2005 10:39 216k breaks Null handling more, now get an access violation at any attempt to execute a statement that has NULL value. Reproduce code: --------------- <?php $pdo = new PDO('sqlite::memory:'); $pdo->exec('CREATE TABLE test(ID INT NOT NULL PRIMARY KEY, Field VARCHAR(12) NULL);'); $stmt = $pdo->prepare('INSERT INTO test(ID, Field) VALUES(?, ?)'); $one = 1; $two = 2; $null = NULL; // Try with PDO_PARAM_NULL $stmt->bindParam(1, $one, PDO_PARAM_INT); $stmt->bindParam(2, $null, PDO_PARAM_STR); assert($stmt->execute()); ?> Expected result: ---------------- A row inserted. Actual result: -------------- PHP has encountered an Access Violation at 017ED696 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 15:00:01 2025 UTC |
Seems its not limited to binding NULL parameters. $pdo = new PDO('sqlite::memory:'); $pdo->exec('CREATE TABLE test(ID INT NOT NULL PRIMARY KEY, Field VARCHAR(12) NULL);'); $stmt = $pdo->prepare('SELECT * FROM test WHERE ID = ?'); $one = 1; $stmt->bindParam(1, $one, PDO_PARAM_INT); assert($stmt->execute()); Also throws a Access Violation... Very broken.