#25917 [Opn->Fbk]: odbc_error() sometimes returns a bad string
| From: | kalowsky@php.net | Date: | Wed, 22 Oct 2003 23:49:27 +0000 |
| Subject: | #25917 [Opn->Fbk]: odbc_error() sometimes returns a bad string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-49373@lists.php.net to get a copy of this message | ||
ID: 25917
Updated by: kalowsky@php.net
Reported By: thorsten at rinne dot info
-Status: Open
+Status: Feedback
Bug Type: ODBC related
Operating System: Windows2000
PHP Version: 4CVS, 5CVS
New Comment:
can you please turn on the logging option in your client, and post the
relavent portions to this bug? Under windows it's in the ODBC
Administrator.
Previous Comments:
------------------------------------------------------------------------
[2003-10-22 08:32:47] thorsten at rinne dot info
This bug can also reproduced with PHP 4.3.4RC1 and 4.3.4RC2. This
happens with INSERTS, UPDATEs and DELETEs, too.
------------------------------------------------------------------------
[2003-10-20 03:49:22] thorsten at rinne dot info
Description:
------------
We use IBM DB2 databases on our Windows2000 systems. The bug occured
then writing a database class.
The odbc_error() function returns sometimes bad strings with special
characters. If a real error occurs, the function returns the correct
six-digit ODBC state. After that, the error code will not be removed
from memory and the error code will be returned on every query although
it is correct.
Note:
var_dump(odbc_error()) returns sometimes bad strings with special
characters, sometimes nothing.
Reproduce code:
---------------
function myquery($query) {
$result = odbc_exec($conn, $query);
if (odbc_error($conn)) {
print "SQLQuery: ".$query;
print "ErrorNum: ".odbc_error($conn));
print "ErrorMsg: ".odbc_errormsg($conn));
}
return $result;
}
Expected result:
----------------
The expected result should be empty when no error occured and the
six-digit ODBC state when an error occured. After every correct new
query, the result should be empty.
Actual result:
--------------
Here are some results, the queries are correct:
SQLQuery: SELECT * FROM SYSTEM
ErrorNum: 8¸ÌP·
ErrorMsg: Ìx¹Ì
or
SQLQuery: SELECT * FROM SYSTEM2
ErrorNum: àWPW
ErrorMsg:
or
SQLQuery: SELECT * FROM SYSTEM
ErrorNum:
ErrorMsg:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25917&edit=1