1

I'm currently debugging an php-application that depends on a sqlite3 database and is stopped working after upgrading from php-5.3.x to php-5.4.33.

This seems to work in both php-versions (so the sqlite3 connection seems to be OK):

$db = new PDO('sqlite:/path/to/the/file.sqlite3');
$result = $db->query('SELECT * FROM DocVerg')->fetchAll();

// outputs the same result in 5.3.x and 5.4.33
print_r($result);

When running the sql below, query() produces a "Fatal error: Maximum execution time of 60 seconds exceed" under php-5.4.33 and works instantly (without any problem) under php-5.3.x.

SELECT
    COUNT(*)
FROM DocVerg
INNER JOIN Documenten ON DocVerg.dvDocumentID = Documenten.dDocumentID
WHERE NOT(Documenten.dStatus & 752)
    AND CAST(strftime('%Y', DocVerg.dvDatum) AS INTEGER) >= 2000
    AND CAST(strftime('%Y%m%d', Documenten.dDatum2) AS INTEGER) <= 20150303
    AND Documenten.dDatum2 IS NOT NULL
    AND Documenten.dTitel LIKE '%raad%'
ORDER BY DocVerg.dvDatum DESC

Some extra info: We're using Sqlite-3.3.6.

I was struggling with the sql statement a bit but couldn't find out myself what is going wrong here. I'm wondering why this doesn't work anymore under php-5.4 (or higher).

Arek van Schaijk
  • 1,432
  • 11
  • 34
  • *Some extra info: We're using MySQL-5.5.* well thanks for the info, but how is that related to the question ? – SirDarius Mar 04 '15 at 09:06
  • Is by chance your execution timeout (in `php.ini`) different in the new version? Could it be that under PHP 5.3 you simply had a longer timeout which allowed the query to finish? – Karel Kubat Mar 04 '15 at 11:15
  • @KarelKubat no the query is executed instantly (there is no execution time at all). After testing it seems something to do with the php version in combination of the sql-library. If I have everything on a row I will update this issue. – Arek van Schaijk Mar 04 '15 at 11:19
  • have you tried to pick the query apart and could you locate the problematic part of the query? Or is every query a problem? – hakre Mar 28 '15 at 23:39
  • Sqlite was in someway downgraded to version 3.3.6. – Arek van Schaijk Apr 06 '15 at 00:45

0 Answers0