php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42147 Possible PDO issue with an SQLite expression
Submitted: 2007-07-30 15:16 UTC Modified: 2008-03-15 01:00 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: the at email dot address Assigned:
Status: No Feedback Package: SQLite related
PHP Version: 5.2.3 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-07-30 15:16 UTC] the at email dot address
Description:
------------
Using the IN() expression in a statement for SQLite causes a 'SQLSTATE[HY000]' error. I realise SQLite is probably not returning the right errorcode, but the important part is why an error occurs.

The same statement in the commandline tool for SQLite, and also works fine with mySQL. Changing the statement to do the same action without an IN() expression ( "WHERE (name='this' OR name='that')" ) causes no error.

Since as it's unlikely that the engine is different between the executable and the dll, I can only think of PDO mangling the statement somehow.. 

Reproduce code:
---------------
$q = $db->query( "SELECT * FROM thetable WHERE name IN('this','that')" );

Expected result:
----------------
Listing of all rows where the name matches 'this' or 'that'.

Actual result:
--------------
Throws an exception:
SQLSTATE[HY000]: General error: 14 unable to open database file

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-12 11:29 UTC] rose dot andrew at gmail dot com
Unable to replicate bug on PHP 5.2.5/Linux.
 [2008-03-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 02:01:30 2024 UTC