#42443 [Opn->Ana]: PDO SQLite3 lacks integer type support
| From: | scottmac@php.net | Date: | Tue, 15 Jan 2008 15:30:21 +0000 |
| Subject: | #42443 [Opn->Ana]: PDO SQLite3 lacks integer type support | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121304@lists.php.net to get a copy of this message | ||
ID: 42443
Updated by: scottmac@php.net
Reported By: gwynne@php.net
-Status: Open
+Status: Analyzed
Bug Type: SQLite related
Operating System: *
PHP Version: 6CVS-2007-08-27 (CVS)
New Comment:
I have a patch to deal with both of these issues here, just waiting to
here back from Wez about adding it.
http://server.macvicar.net/patches/php-bug42443.patch
Previous Comments:
------------------------------------------------------------------------
[2008-01-14 22:27:08] lapo at lapo dot it
Even worse than the integer case (which leads to inefficience) is the
case of BLOBs, which leads to corruption of data: text values can't
contain \0, while blob data can.
E.g. from command line sqlite3:
sqlite> SELECT LENGTH(X'12000000');
4
sqlite> SELECT LENGTH(CAST(X'12000000' AS text));
1
Because "case PDO_PARAM_LOB" falls through to "case PDO_PARAM_STR",
which uses sqlite3_bind_text... using PDO is impossible to store BLOB
data in Sqlite3.
------------------------------------------------------------------------
[2007-08-27 10:42:16] gwynne@php.net
Description:
------------
PDO SQLite3 calls sqlite3_bind_text() for all non-blob and non-null
parameter types regardless of whether integer data is provided. Integer
data can be bound with sqlite3_bind_int(), which saves memory space and
improves efficiency, as well as storing the intended type in a database
which uses SQLite3's value typing. Patch is at:
http://news.php.net/php.internals/31935
Reproduce code:
---------------
Difficult to show reproduction.
Expected result:
----------------
Difficult to show reproduction.
Actual result:
--------------
Difficult to show reproduction.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42443&edit=1