php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27928 SQLite gets confused when opening empty filename
Submitted: 2004-04-09 02:07 UTC Modified: 2004-04-09 14:01 UTC
From: adam at trachtenberg dot com Assigned:
Status: Closed Package: SQLite related
PHP Version: 5CVS-2004-04-09 (dev) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: adam at trachtenberg dot com
New email:
PHP Version: OS:

 

 [2004-04-09 02:07 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-09 12:39 UTC] sniper@php.net
Can't you just test whether the filename_len is higher than 0 ??

 [2004-04-09 13:09 UTC] 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 14:01 UTC] iliaa@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-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 24 09:01:26 2019 UTC