#28537 [Fbk->Opn]: "SELECT rowid, * FROM <view>" crashes
| From: | bhoc at tiscali dot ch | Date: | Thu, 27 May 2004 10:25:58 +0000 |
| Subject: | #28537 [Fbk->Opn]: "SELECT rowid, * FROM <view>" crashes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-60067@lists.php.net to get a copy of this message | ||
ID: 28537
User updated by: bhoc at tiscali dot ch
Reported By: bhoc at tiscali dot ch
-Status: Feedback
+Status: Open
Bug Type: SQLite related
Operating System: any
PHP Version: 5.0.0RC2
New Comment:
My currently available environment does not support creating
backtraces, unfortunately.
But I have put a simple php applet in
http://download.pentagroup.ch/phpbug-28537.tar.gz.
It will create an
sqlite database, populate it, query it, roll over and die. Hope this
helps.
--
Ben
Previous Comments:
------------------------------------------------------------------------
[2004-05-27 08:35:48] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
------------------------------------------------------------------------
[2004-05-27 01:44:37] bhoc at tiscali dot ch
before someone asks: same behaviour with
http://snaps.php.net/win32/php5-win32-200405262230.zip
------------------------------------------------------------------------
[2004-05-27 01:10:36] bhoc at tiscali dot ch
Description:
------------
"select rowid, * from someview" will crash php.
"select rowid, * from sometable" runs fine.
Result -> cgi will crash, server will close the connection.
This was a bug (#364) in older sqlite versions:
http://www.sqlite.org/cvstrac/tktview?tn=364,16
It seems to have reappeared.
--
Ben
Reproduce code:
---------------
function DumpTable($dbname, $tablename) {
if ($db = sqlite_open($dbname)) {
$sql = "select rowid, * from $tablename";
$res = sqlite_query($db, $sql);
echo "<table border=\"1\">\n";
while ($row = sqlite_fetch_array($res)) {
$fieldnum = sqlite_num_fields($res);
echo " <tr>";
for ($i=0; $i<$fieldnum; $i++) {
echo "<td>$row[$i]</td>";
}
echo " </tr>\n";
}
echo "</table>\n";
sqlite_close($db);
}
}
Expected result:
----------------
Nicely formatted output. :)
Works fine with a plain table; will fail with a view.
Actual result:
--------------
<nothing>, cgi crashes, server closes connection.
Tested under Windows XP and Linux
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28537&edit=1