|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74217 Allow creation of deterministic sqlite functions
Submitted: 2017-03-07 14:19 UTC Modified: 2017-03-29 05:21 UTC
From: remo dot laubacher at ortic dot com Assigned: nikic (profile)
Status: Closed Package: SQLite related
PHP Version: 7.1.3RC1 OS: any
Private report: No CVE-ID: None
 [2017-03-07 14:19 UTC] remo dot laubacher at ortic dot com
SQLite has an option to define a custom function as deterministic, and by that allowing it to be indexed. This obviously has a huge impact on the performance.

Adding SQLITE_DETERMINISTIC (0x800) to the 4th parameter does the trick, check this for more information:

From what my basic C skills tell me, it's currently hard-coded in PHP:

Exposing the 4th parameter would give us this flexibility.


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-10 17:37 UTC] andrew dot nester dot dev at gmail dot com
thanks! I just added PR to added desired behaviour but suppose that it requires proper RFC.
 [2017-03-10 17:40 UTC]
-Package: SQLite related +Package: PDO SQLite
 [2017-03-10 18:02 UTC]
-Package: PDO SQLite +Package: SQLite related
 [2017-03-10 18:02 UTC]
The PR targets PDO_sqlite as well as sqlite3, so I'm changing the
package back to "SQLite related".
 [2017-03-12 17:30 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2017-03-12 17:30 UTC]
PR merged into 7.1.
 [2017-03-12 19:25 UTC] remo dot laubacher at ortic dot com
Thanks guys, I'm impressive about how smooth this went!
 [2017-03-17 14:08 UTC]
JFTR: documented with <>.
 [2017-03-29 05:21 UTC]
Notice SQLITE_DETERMINISTIC is only available in recent sqlite versions, so this change break build with system libsqlite (reproduced on RHEL/CentOS-7 which have sqlite 3.7.17

Patch ready (#ifdef), will apply after a set of tests
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 11 07:01:31 2023 UTC