View Issue Details

IDProjectCategoryView StatusLast Update
0002361Composrcore_database_driverspublic2017-05-16 13:49
ReporterChris GrahamAssigned ToChris Graham 
SeverityFeature-request 
Status resolvedResolutionfixed 
Product Version 
Fixed in Version 
Summary0002361: Add support for abstracting some basic SQL functions
DescriptionSQL functions are ill-defined or not defined at all in SQL standards. Currently we sometimes add in a little extra functionality/performance for mysql-only, by using some functions behind guards. Here are the ones we may use...

CONCAT
REPLACE
REVERSE
SUBSTR
LENGTH
UNIX_TIMESTAMP
RAND
IFNULL
GREATEST
MOD

Allow us to do like...

$GLOBALS['SITE_DB']->query('SELECT * FROM foo WHERE ' . $GLOBALS['SITE_DB']->sql_cleanup('SUBSTR(bar,0,1)=\'something\''));

It's a bit ugly, but at least it then allows database drivers to override sql_cleanup and fix SQL that won't work on that driver.

An alternative would be to implement a full SQL parser, but that's a performance issue and a lot of overhead in the code.
TagsNo tags attached.
Time estimation (hours)3
Sponsorship open

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2016-03-30 14:07 Chris Graham New Issue
2017-05-15 00:01 Chris Graham Description Updated View Revisions
2017-05-16 13:49 Chris Graham Status non-assigned => resolved
2017-05-16 13:49 Chris Graham Resolution open => fixed
2017-05-16 13:49 Chris Graham Assigned To => Chris Graham