ID: 29476
Comment by: loranger at free dot fr
Reported By: hugo_pl at users dot sourceforge dot net
Status: Open
Bug Type: SQLite related
Operating System: GNU/Linux, WindowsXP
PHP Version: 5.0.0
New Comment:
I've got the same annoying lock when I call this function in a loop (to
display my db schema). I'm using PHP 5.0.2 + SQLite 2.8.14 + Apache 2 on
Winxp sp2
Previous Comments:
------------------------------------------------------------------------
[2004-10-26 13:13:14] dennis at inmarket dot lviv dot ua
Yes, I have seen it myself, but didn't even think it was related to the
fetch_column_types. Thanks for the hint! Damn it really got on my
nerves! But in my case it locks only the table I have run the function
on.
------------------------------------------------------------------------
[2004-09-07 17:03:47] hugo_pl at users dot sourceforge dot net
I'm reopening this bug.
------------------------------------------------------------------------
[2004-09-07 17:02:43] hugo_pl at users dot sourceforge dot net
I'm reopening this bug.
------------------------------------------------------------------------
[2004-09-06 15:13:35] danhen at web dot de
I was able to reproduce the "database is locked"-message by using the
SQLite-OO-Interface as written (the code with try). Calling the
"normal" function sqlite_fetch_column_types() does not have this
message as result. Also the database isn't locked. Tested on W2k with
PHP 5.0.1 and Apache/1.3.29. Maybe that helps finding the reason for
that behavior.
------------------------------------------------------------------------
[2004-08-25 06:56:48] hugo_pl at users dot sourceforge dot net
Hi
I think that this is a PHP bug, I made a better exemple to
show this bug:
<pre>
<?php
try {
$db = new SQLiteDatabase('./test.db');
$db->busyTimeout(1000);
// table exists?
$exists = $db->singleQuery('SELECT count(*) FROM
sqlite_master WHERE tbl_name=\'bugtest\'');
if (!$exists)
$db->query('CREATE TABLE bugtest (a, b, c,
d);');
// Without this line all runs Ok.
$db->fetchColumnTypes('bugtest');
$db->query('INSERT INTO bugtest VALUES (1, 2, 3,
4)');
echo 'Res: <br>';
print_r( $db->arrayQuery('SELECT * FROM bugtest',
SQLITE_ASSOC) );
}
catch (Exception $e)
{
echo 'Exception: ', $e->getMessage();
}
?>
The first time you run this script all appear to be Ok...
the insert query is executed, etc... but the second time
is displayed a message:
Warning: SQLiteDatabase::query() [function.query]:
database is locked in /home/hugo/public_html/phpbug.php on
line 16
Nothing is wrong with the script, if this message appear
something is wrong with PHP.... on windows the same bug
occur, then it is not a problem from SQLite or Apache
compiled by me under linux.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/29476
--
Edit this bug report at http://bugs.php.net/?id=29476&edit=1