]> source.dussan.org Git - nextcloud-server.git/commitdiff
Implement ILIKE for sqlite
authorRobin Appelman <icewind@owncloud.com>
Wed, 17 Sep 2014 11:47:55 +0000 (13:47 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 17 Sep 2014 11:47:55 +0000 (13:47 +0200)
lib/private/db/adaptersqlite.php

index 06cdb7aab054319b7165fb4d5cc74c57f2dad3ac..3471fcf4042bd688a62d6724e4149cf246791543 100644 (file)
@@ -11,7 +11,7 @@ namespace OC\DB;
 
 class AdapterSqlite extends Adapter {
        public function fixupStatement($statement) {
-               $statement = str_replace(' ILIKE ', ' LIKE ', $statement);
+               $statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement);
                $statement = str_replace( '`', '"', $statement );
                $statement = str_ireplace( 'NOW()', 'datetime(\'now\')', $statement );
                $statement = str_ireplace( 'UNIX_TIMESTAMP()', 'strftime(\'%s\',\'now\')', $statement );