Bug #51999 [Bgs]: Code within sqlite_error_string cannot be reached
| From: | martin dot dekeijzer at gmail dot com | Date: | Sat, 05 Jun 2010 19:20:24 +0000 |
| Subject: | Bug #51999 [Bgs]: Code within sqlite_error_string cannot be reached | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4503@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
User updated by: martin dot dekeijzer at gmail dot com
Reported by: martin dot dekeijzer at gmail dot com
Summary: Code within sqlite_error_string cannot be reached
Status: Bogus
Type: Bug
Package: Documentation problem
Operating System: Linux / Debian
PHP Version: 5.3SVN-2010-06-05 (SVN)
New Comment:
Ok but the function declaration has a value (default) for all
unspecified
integers
Previous Comments:
------------------------------------------------------------------------
[2010-06-05 16:05:35] johannes@php.net
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.
------------------------------------------------------------------------
[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