php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56293 odbc code crashes php engine
Submitted: 2005-02-11 08:59 UTC Modified: 2005-02-13 02:06 UTC
From: gary dot doades at webroster dot net Assigned: wez (profile)
Status: Closed Package: PDO (PECL)
PHP Version: 5_1 CVS-2005-02-11 (dev) OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gary dot doades at webroster dot net
New email:
PHP Version: OS:

 

 [2005-02-11 08:59 UTC] gary dot doades at webroster dot net
Description:
------------
Certain pdo_odbc code completely crashes PHP engine (CGI/FastCGI)
 
This only happens if I use UID= & PWD = as part of the DSN AND I use parameters in the query. If I don't use parameters in the query it works OK.


Reproduce code:
---------------
$cn = new PDO('odbc:DSN=WEBROSTER000;UID=user1.drb2171;PWD=user1');
$dr = $cn->prepare('select * from vclient where client_id = :id order by sname,fname');
$dr->execute(array(':id' => '1234'));
$row = $dr->fetch(PDO_FETCH_ASSOC);


Expected result:
----------------
 Some data in the $row variable!

Actual result:
--------------
Being windows you get a "this program has had to close, do you want to send information to Microsoft" dialog.

AppName: php-cgi.exe	 AppVer: 5.1.0.0	 ModName: php_pdo.dll
ModVer: 5.1.0.0	 Offset: 000019a5

Exception code is: 5


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-11 09:09 UTC] gary dot doades at webroster dot net
This works:
$cn = new PDO('odbc:WEBROSTER001','user1.drb2171','user1');
$dr = $cn->prepare('select * from vclient where client_id = 1234 order by sname,fname');
$dr->execute();
$row = $dr->fetch(PDO_FETCH_ASSOC);


This crashes:
$cn = new PDO('odbc:WEBROSTER001','user1.drb2171','user1');
$dr = $cn->prepare('select * from vclient where client_id = :id order by sname,fname');
$dr->execute(array(':id' => 1234));
$row = $dr->fetch(PDO_FETCH_ASSOC);
 [2005-02-11 10:58 UTC] wez@php.net
Can you try this:

$cn = new PDO('odbc:WEBROSTER001','user1.drb2171','user1');
$dr = $cn->prepare('select * from vclient where client_id = ? order by
sname,fname');
$dr->execute(array(1234));
$row = $dr->fetch(PDO_FETCH_ASSOC);
 [2005-02-11 11:13 UTC] gary dot doades at webroster dot net
OK, that worked, but then I have different SQL/code for different databases (libraries).
 [2005-02-11 12:47 UTC] wez@php.net
Yeah, the named stuff *should* work too.
I'll look into fixing it tonight.
 [2005-02-13 02:06 UTC] wez@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/PDO

Fixed in PDO 0.2.3

Wait for the next stable snapshot build (approx 2.5 hours from now) for the windows DLLs to be built.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 03:01:29 2024 UTC