Req #74217 [Opn]: Allow creation of deterministic sqlite functions

From: Date: Fri, 10 Mar 2017 18:02:42 +0000
Subject: Req #74217 [Opn]: Allow creation of deterministic sqlite functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207774@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74217&edit=1

 ID:                 74217
 Updated by:         cmb@php.net
 Reported by:        remo dot laubacher at ortic dot com
 Summary:            Allow creation of deterministic sqlite functions
 Status:             Open
 Type:               Feature/Change Request
-Package:            PDO SQLite
+Package:            SQLite related
 Operating System:   any
 PHP Version:        7.1.3RC1
 Block user comment: N
 Private report:     N

 New Comment:

The PR targets PDO_sqlite as well as sqlite3, so I'm changing the
package back to "SQLite related".


Previous Comments:
------------------------------------------------------------------------
[2017-03-10 17:37:52] 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-07 14:19:58] remo dot laubacher at ortic dot com

Description:
------------
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:
https://www.sqlite.org/c3ref/create_function.html

From what my basic C skills tell me, it's currently hard-coded in PHP:
https://github.com/php/php-src/blob/master/ext/sqlite3/sqlite3.c#L933

Exposing the 4th parameter would give us this flexibility.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74217&edit=1


Thread (8 messages)

« previous php.bugs (#207774) next »