Bug #51999 [Opn->Bgs]: Code within sqlite_error_string cannot be reached
| From: | johannes@php.net | Date: | Sat, 05 Jun 2010 14:05:35 +0000 |
| Subject: | Bug #51999 [Opn->Bgs]: Code within sqlite_error_string cannot be reached | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4502@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51999&edit=1
ID: 51999
Updated by: johannes@php.net
Reported by: martin dot dekeijzer at gmail dot com
Summary: Code within sqlite_error_string cannot be reached
-Status: Open
+Status: Bogus
Type: Bug
Package: Documentation problem
Operating System: Linux / Debian
PHP Version: 5.3SVN-2010-06-05 (SVN)
New Comment:
If I get you right you ask for removing the else clause from
if (msg) {
RETURN_STRING((char*)msg, 1);
} else {
RETURN_NULL();
}
As it will never be hit. This won't be removed as we have no way to
guarantee this will be the always be the case, under all circumstances
with all SQLite versions.
Previous Comments:
------------------------------------------------------------------------
[2010-06-05 14:59:47] martin dot dekeijzer at gmail dot com
Description:
------------
When writing phpt tests I was trying to reach a part of the code where
the result
of sqlite_error_string would not return a message.
When passing 127 as an argument to sqlite_error_string I still get a
message
returned though. So this part of the code seems unreachable.
Looking in the function declaration of the extension source the default
value for
error codes is the "Unknown error" message, which also confirms what I
already
assumed.
Test script:
---------------
var_dump(sqlite_error_string( 127 ) );
Expected result:
----------------
NULL
Actual result:
--------------
string(13) "unknown error"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51999&edit=1