php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56288 PDO Sqlite paramater binding
Submitted: 2005-02-09 07:21 UTC Modified: 2005-02-09 09:33 UTC
From: Jared dot Williams1 at ntlworld dot com Assigned: wez (profile)
Status: Closed Package: PDO (PECL)
PHP Version: 5_0 CVS-2005-02-09 (dev) OS: Windows 2000/IIS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Jared dot Williams1 at ntlworld dot com
New email:
PHP Version: OS:

 

 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-09 09:26 UTC] Jared dot Williams1 at ntlworld dot com
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.
 [2005-02-09 09:33 UTC] wez@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Should really be fixed this time.
Next stable snaps are cooked in about 3 hours, so that's when this fix will be available.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 13:01:30 2024 UTC