php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56399 Invalid exception in PDO
Submitted: 2005-05-23 16:35 UTC Modified: 2005-07-08 19:13 UTC
From: gpd at gpdnet dot co dot uk Assigned:
Status: Closed Package: PDO (PECL)
PHP Version: 5_1 CVS-2005-05-23 (dev) OS: Windows XP
Private report: No CVE-ID: None
 [2005-05-23 16:35 UTC] gpd at gpdnet dot co dot uk
Description:
------------
pdo::execute gives the following message:

Fatal error: Exceptions must be valid objects derived from the Exception base class in c:\Inetpub\wwwroot\phptest\WRTest\wrclient.php on line 196

This seems to be a problem in the PDO ode itself

Turning off PDO_ERRMODE_EXCEPTION gives error (via errorInfo()) of:

[Sybase][ODBC Driver]Invalid cursor state (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:132)

But the code fetches the data and otherwise seems to execute OK.

Reproduce code:
---------------
$SQL = 'select * from vclient where client_id = 3196;
$cn = new PDO('odbc:DRIVER={Adaptive Server Anywhere 9.0};ENG=webroster;DBN=cct8740;CommLinks=TCP','dba','sql');
$cn->setAttribute(PDO_ATTR_CASE, PDO_CASE_LOWER);
$cn->setAttribute(PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION);
$dr = $cn->query($SQL);
$dr->execute();



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-10 02:03 UTC] wez@php.net
Very strange this one.
I've seen this tonight, and it appears to be Win32 specific.
 [2005-06-10 02:12 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.

Turned out to be a problem with the SPL extension not being initialized before PDO, leading to a corrupted PDOException class.

This is fixed in CVS; the next set of snaps will have the fix.
 [2005-06-11 12:10 UTC] gpd at gpdnet dot co dot uk
I can't seem to find the php_pdo_odbc.dll in the latest windows build as of the time of this message. Is it possible the build has failed after you fixed this problem?
 [2005-07-02 22:59 UTC] wez@php.net
Hmm, any chance that they're missing because they're now built-in to the main PHP DLL? (I can't check it right now because I'm stuck a 56k modem).
 [2005-07-03 05:16 UTC] gpd at gpdnet dot co dot uk
Well, my test code:
$cn = new PDO('odbc:WEBROSTER000','user1.drb2171','user1');

fails with:
Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in c:\Inetpub\wwwroot\phptest\dbtest0.php:27

If I try to load php_pdo_odbc, it can't find it.

Looking at the latest snapshot build log:

odbc_driver.c
ext\pdo_odbc\php_pdo_odbc_int.h(32) : fatal error C1083: Cannot open include file: 'sqlcli1.h': No such file or directory

And a few more.....

Of course, I could be doing something else wrong..
 [2005-07-08 13:11 UTC] wez@php.net
Should also be fixed in latest snap.
 [2005-07-08 19:13 UTC] gpd at gpdnet dot co dot uk
Verifed as fixed in the latest snapshot
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:28 2024 UTC