Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11017 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55166 invoked by uid 1010); 9 Jul 2004 07:06:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55042 invoked from network); 9 Jul 2004 07:06:35 -0000 Received: from unknown (HELO jdi.jdimedia.nl) (212.204.192.51) by pb1.pair.com with SMTP; 9 Jul 2004 07:06:35 -0000 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.11/8.12.11) with ESMTP id i6976ZB5016609 for ; Fri, 9 Jul 2004 09:06:35 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.11/8.12.11) with ESMTP id i6976U1t016595; Fri, 9 Jul 2004 09:06:30 +0200 Date: Fri, 9 Jul 2004 09:06:30 +0200 (CEST) X-X-Sender: derick@localhost To: PHP Developers Mailing List cc: Ilia Alshanetsky In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdimedia.nl Subject: Re: [PHP-DEV] SQLite weirdness From: derick@php.net (Derick Rethans) On Thu, 8 Jul 2004, Derick Rethans wrote: > After some investigation I found that if I removed the "$ret = " before > the query() call, then all queries are run just fine, and throw also a > warning when I put back in the typoes. I did some more investigations and it seems that as soon you try to assign the result of sqlite_query() to a variable it always only execute the first query in a multi-query query-string. Not only for CREATE as I wrote before but it's also a problem for multiple INSERTs, or a mixed INSERT/SELECT. In the code it's the difference between sqlite_compile (sqlite.c:1472) (used when there is no assignment) and sqlite_exec (sqlite.c:1559) when there is an assignment. A slightly modified "expected" list: > > I would have expected something else though: > 1. Without the "$ret = " it should throw a PHP warning for each broken > query. (That's current what it's doing). > 2. With the "$ret = " it should NOT throw any warnings, and set the > $db->lastError() value accordingly whether there were errors > (with the last query) or not. IMO this should be fixed ASAP, I can perhaps try to come up with a patch myself too. regards, Derick