#27928 [Opn->Csd]: SQLite gets confused when opening empty filename
| From: | iliaa@php.net | Date: | Fri, 09 Apr 2004 18:01:58 +0000 |
| Subject: | #27928 [Opn->Csd]: SQLite gets confused when opening empty filename | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-57880@lists.php.net to get a copy of this message | ||
ID: 27928
Updated by: iliaa@php.net
Reported By: adam at trachtenberg dot com
-Status: Open
+Status: Closed
Bug Type: SQLite related
Operating System: *
PHP Version: 5CVS-2004-04-09 (dev)
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2004-04-09 13:09:36] adam at trachtenberg dot com
Yea. Here's an updated version at the same URL.
http://www.trachtenberg.com/patches/sqlite_open.txt
------------------------------------------------------------------------
[2004-04-09 12:39:46] sniper@php.net
Can't you just test whether the filename_len is higher than 0 ??
------------------------------------------------------------------------
[2004-04-09 02:07:16] adam at trachtenberg dot com
Description:
------------
Telling SQLite to open a file of NULL or "" causes it to
think for a while and then report that the database is
locked.
The patch at:
http://www.trachtenberg.com/patches/sqlite_open.txt
Makes SQLite return false and provides an error message.
(BTW, is strcmp(filename, "") the best way to do this?
Reproduce code:
---------------
sqlite_open("");
sqlite_open(NULL);
Expected result:
----------------
Faster reply, better error message.
Actual result:
--------------
PHP Warning: sqlite_query(): database is locked
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27928&edit=1