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
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.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 21:01:32 2024 UTC