PHP 4.0 Bug #3667: odbc_execute() reports failure for SQL_SUCCESS_WITH_INFO
| From: | moregan at mcs dot net | Date: | Tue, 29 Feb 2000 15:49:01 +0000 |
| Subject: | PHP 4.0 Bug #3667: odbc_execute() reports failure for SQL_SUCCESS_WITH_INFO | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16142@lists.php.net to get a copy of this message | ||
From: moregan@mcs.net
Operating system: NT4WS SP6a
PHP version: 4.0 Beta 4 Patch Level 1
PHP Bug Type: ODBC related
Bug description: odbc_execute() reports failure for SQL_SUCCESS_WITH_INFO
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.)