#39618 [Opn->Bgs]: Inconsistent row count totals being returned with sqlite2 and sqlite3 PDO
| From: | tony2001@php.net | Date: | Tue, 28 Nov 2006 11:07:12 +0000 |
| Subject: | #39618 [Opn->Bgs]: Inconsistent row count totals being returned with sqlite2 and sqlite3 PDO | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105536@lists.php.net to get a copy of this message | ||
ID: 39618
Updated by: tony2001@php.net
Reported By: randy at rcs-comp dot com
-Status: Open
+Status: Bogus
Bug Type: PDO related
Operating System: Windows XP
PHP Version: 5.2.0
New Comment:
See http://www.sqlite.org/cvstrac/tktview?tn=383
"The sqlite_changes API function returns the number of rows that have
been inserted, deleted, or modified since the database was last
quiescent. A "quiescent" database is one in which there are no
outstanding calls to sqlite_exec and no VMs created by sqlite_compile
that have not been finalized by sqlite_finalize."
This is how it is supposed to work in Sqlite2, but Sqlite3 seems to
work differently.
Previous Comments:
------------------------------------------------------------------------
[2006-11-24 14:56:53] randy at rcs-comp dot com
Description:
------------
After using prepare() & execute() to retrieve a PDO Statement from a
PDO Sqlite2 connection, subsequent calls to exec() return a "rows
affected" value that appears to sum the previous calls to exec()
together.
Reproduce code:
---------------
http://www.rcs-comp.com/phpcode/simple_pdo_test3.php.txt
Expected result:
----------------
>php simple_pdo_test3.php
rows updated w/ exec() (some): 2 2
rows updated w/ exec() (all): 3 3
statement preped and all records retrieved
rows updated w/ exec() (some): 2 2
rows updated w/ exec() (all): 3 3
rows updated w/ exec() (some): 2 2
rows updated w/ prep & execute() (all): 3 3
Actual result:
--------------
>php simple_pdo_test3.php
rows updated w/ exec() (some): 2 2
rows updated w/ exec() (all): 3 3
statement preped and all records retrieved
rows updated w/ exec() (some): 2 2
rows updated w/ exec() (all): 3 5 <-- notice the addition from the
prev. row
rows updated w/ exec() (some): 2 7 <-- notice the addition from the
prev. row
rows updated w/ prep & execute() (all): 3 3 <-- problem disappears
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39618&edit=1