php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47141 SQLite3::lastErrorMsg, warning: object has not been correctly initialised
Submitted: 2009-01-17 21:19 UTC Modified: 2009-01-19 22:45 UTC
From: ladislav at marek dot su Assigned: scottmac (profile)
Status: Closed Package: SQLite related
PHP Version: 5.3CVS-2009-01-17 (snap) OS: *
Private report: No CVE-ID: None
 [2009-01-17 21:19 UTC] ladislav at marek dot su
Description:
------------
If SQlite3::__construct() fails (for example database file is not 
writeable), is not possible to get last error messages or code.

Reproduce code:
---------------
$sqlite = @new Sqlite3('/nonwriteablefile', SQLITE3_OPEN_CREATE);
echo $sqlite->lastErrorMsg();
echo $sqlite->lastErrorCode();

Expected result:
----------------
Unable to open database: unable to open database file
??error code??

Actual result:
--------------
Warning: SQLite3::lastErrorCode() [sqlite3.lasterrorcode]: The 
SQLite3 object has not been correctly initialised in %% on line %%

Warning: SQLite3::lastErrorCode() [sqlite3.lasterrorcode]: The 
SQLite3 object has not been correctly initialised in %% on line %%

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-19 22:45 UTC] scottmac@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 16:01:29 2024 UTC