php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3667 odbc_execute() reports failure for SQL_SUCCESS_WITH_INFO
Submitted: 2000-02-29 10:49 UTC Modified: 2000-02-29 11:46 UTC
From: moregan at mcs dot net Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0 Beta 4 Patch Level 1 OS: NT4WS SP6a
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: moregan at mcs dot net
New email:
PHP Version: OS:

 

 [2000-02-29 10:49 UTC] moregan at mcs dot net
odbc_exec() and odbc_execute() return the failure condition if the statement being executed returns SQL_SUCCESS_WITH_INFO from the driver, which is not what I would expect.  E.g. the Microsoft SQL Server driver hitting an MSDE database with the statement odbc_exec( "USE MARC" ) returns SQL_SUCCESS_WITH_INFO, the message being basically "OK, I changed databases".  With odbc_exec() the return is false.  With odbc_execute() the return is false and the output page reports that the statement failed.

In php_odbc.c, odbc_execute() checks ( rc != SQL_SUCCESS ) with the return from SQLExecute(), which could be it.  Most--curiously not all--error code tests also check for SQL_SUCCESS_WITH_INFO in this module.

I didn't try PHP3, but the 3.0.15 source also has (rc!=SQL_SUCCESS).  Does the fact that such code is in production imply that there's instead something wrong with the driver?  (The only thing I can think of would be that SQL_SUCCESS_WITH_INFO might not be allowed from SQLExecute(), but I don't have the spec handy to check.)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-29 11:46 UTC] kara at cvs dot php dot net
odbc_do/odbc_exec will return 0 for your statement, since
there are no columns returned by your statement. The same 
applies for update, insert, delete statements.

odbc_execute() will indeed additionally error out since
it is not considering SQL_SUCCESS_WITH_INFO as success.
I don't think that the specs forbid SQL_SUCCESS_WITH_INFO.
To be consistent, odbc_execute should also allow
SQL_SUCCESS_WITH_INFO, as odbc_exec does.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 13:01:33 2025 UTC