|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51733 SQLite3::exec() fails with disk I/O error
Submitted: 2010-05-03 22:02 UTC Modified: 2010-05-03 23:20 UTC
From: jay at splitstreams dot com Assigned:
Status: Not a bug Package: SQLite related
PHP Version: 5.3.2 OS: Ubuntu 10.04, FreeBSD 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
24 + 45 = ?
Subscribe to this entry?

 [2010-05-03 22:02 UTC] jay at splitstreams dot com
I've tested this problem and it is duplicable on Ubuntu 10.04 and FreeBSD 8, both with 5.3.2 installed (from apt-get/ports).  I also did a build of 5.3.2 from source to test this and it failed in the same way.

The problem comes when you try to create a table in a newly created database when using the SQLite3 class.  The empty db is created without error and when you then try to create a table, you get the following error:

PHP Warning:  SQLite3::exec(): disk I/O error in php shell code on line 1

This is the same error in all builds on all OSes.

Test script:
$ php -a

php > $s = new SQLite3('/home/jdeiman/tmp/php.db',  SQLITE3_OPEN_CREATE);
php > $ret = $s->exec('CREATE table testing (id integer)');
PHP Warning:  SQLite3::exec(): disk I/O error in php shell code on line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-03 23:20 UTC]
-Status: Open +Status: Bogus
 [2010-05-03 23:20 UTC]
You need to pass SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE to the ctor if you intend on writing to the database after creating it... or you can leave the flags parameter blank and it will default to that.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 31 04:03:39 2023 UTC