ID:               33859
 User updated by:  leon at lost dot co dot nz
 Reported By:      leon at lost dot co dot nz
-Status:           Bogus
+Status:           Open
 Bug Type:         PDO related
 Operating System: Linux (Debian Sarge)
 PHP Version:      5CVS-2005-07-26 (dev)
 New Comment:

You cannot mean to say that an SQL query should be allowed to CRASH a
scripting language like PHP, surely!  Even if the SQL were incorrect
(and mine wasn't) crashing PHP is not an option...

Prehaps I should have made myself more clear:

Triggering the assertion caused PHP to abort.  No page view, no HTML
error messages, nothing but a frustrated user and an error in Apache's
errorlog...

This is not a bogus bug report.


Previous Comments:
------------------------------------------------------------------------

[2005-07-26 09:28:30] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Ask for SQLite support here: http://sqlite.org

------------------------------------------------------------------------

[2005-07-26 05:36:59] leon at lost dot co dot nz

Description:
------------
Attached snippet triggers an assertion everytime:

$ php -v
PHP 5.1.0-dev (cli) (built: Jul 26 2005 15:26:09) (DEBUG)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0-dev, Copyright (c) 1998-2004 Zend Technologies

$ php bug3.php
php: /tmp/php5-200507260230/ext/pdo_sqlite/sqlite/src/auth.c:117:
sqlite3AuthRead: Assertion `pExpr->op==7' failed.
Aborted

Reproduce code:
---------------
<?php

// Setup sample database
$conn = new PDO('sqlite::memory:');
$conn->exec('CREATE TABLE barrel (docid INTEGER, wordid INTEGER,
position INTEGER)');
$conn->exec('CREATE TABLE documents (id INTEGER PRIMARY KEY, key TEXT
UNIQUE)');

// Run problem query
$sql = "SELECT count(*) AS count, key FROM ".
        "barrel, documents WHERE id == docid AND " .
        "wordid == 1 GROUP BY docid ORDER BY count DESC;";
$stmt = $conn->query($sql);
$result = $stmt->fetch();
print_r($result);

?>

Expected result:
----------------
Array
(
    [count] => 0
    [0] => 0
    [key] =>
    [1] =>
)


Actual result:
--------------
php: /tmp/php5-200507260230/ext/pdo_sqlite/sqlite/src/auth.c:117:
sqlite3AuthRead: Assertion `pExpr->op==7' failed.
Aborted



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33859&edit=1

Reply via email to