]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use ILIKE in cache search
authorRobin Appelman <icewind@owncloud.com>
Wed, 17 Sep 2014 14:12:54 +0000 (16:12 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 17 Sep 2014 14:12:54 +0000 (16:12 +0200)
lib/private/files/cache/cache.php

index cfa3e916185f78ace3a4af08e8ef990272afa987..7ea00325a1015d34bb51e9877d2422e66b69f76c 100644 (file)
@@ -464,19 +464,7 @@ class Cache {
                                `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`,
                                `unencrypted_size`, `etag`, `permissions`
                        FROM `*PREFIX*filecache`
-                       WHERE `storage` = ? AND ';
-               $dbtype = \OC_Config::getValue( 'dbtype', 'sqlite' );
-               if($dbtype === 'oci') {
-                       //remove starting and ending % from the pattern
-                       $pattern = '^'.str_replace('%', '.*', $pattern).'$';
-                       $sql .= 'REGEXP_LIKE(`name`, ?, \'i\')';
-               } else if($dbtype === 'pgsql') {
-                       $sql .= '`name` ILIKE ?';
-               } else if ($dbtype === 'mysql') {
-                       $sql .= '`name` COLLATE utf8_general_ci LIKE ?';
-               } else {
-                       $sql .= '`name` LIKE ?';
-               }
+                       WHERE `storage` = ? AND `name` ILIKE ?';
                $result = \OC_DB::executeAudited($sql,
                        array($this->getNumericStorageId(), $pattern)
                );