From:             leon at lost dot co dot nz
Operating system: Linux (Debian Sarge)
PHP version:      5CVS-2005-07-26 (dev)
PHP Bug Type:     PDO related
Bug description:  Failed SQLite assertion when using SQL 'AS'

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 bug report at http://bugs.php.net/?id=33859&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33859&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33859&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33859&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33859&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33859&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33859&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33859&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33859&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33859&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33859&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33859&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33859&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33859&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33859&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33859&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33859&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33859&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33859&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33859&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33859&r=mysqlcfg

Reply via email to