From: simen at lunarlounge dot org
Operating system: Debian/GNU testing
PHP version: 5.0.0RC2
PHP Bug Type: SQLite related
Bug description: SQLite returns null error message when database file isn't writable
Description:
------------
The SQLite extension fail to detect when a database file isn't writable:
Warning: sqlite_query() [function.sqlite-query]: (null) in test.php on
line 12
Reproduce code:
---------------
# touch test.sqlite
# chmod 0600 sqlite
# sqlite test.sqlite
> CREATE TABLE store (id INTEGER PRIMARY KEY, doc TEXT);
$db = sqlite_open('test.sqlite');
$sql = "INSERT INTO store (id, doc) VALUES (1, 'foo')";
$result = sqlite_query($db, $sql);
Expected result:
----------------
Warning: sqlite_query() [function.sqlite-query]: attempt to write a
readonly database in test.php on line 12
Actual result:
--------------
Warning: sqlite_query() [function.sqlite-query]: (null) in test.php on
line 12
--
Edit bug report at http://bugs.php.net/?id=28235&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28235&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28235&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28235&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28235&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28235&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28235&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28235&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28235&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28235&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28235&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28235&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28235&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28235&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28235&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28235&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28235&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28235&r=float