Follow-up to changeset 42538: Take LIKE BINARY into account
authorXavier Perseguers <typo3@perseguers.ch>
Mon, 24 Jan 2011 15:04:19 +0000 (15:04 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Mon, 24 Jan 2011 15:04:19 +0000 (15:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@42538 735d13b6-9817-0410-8766-e36946ffe9aa

typo3/sysext/dbal/class.ux_t3lib_sqlparser.php

index 3f59f76..768d9f2 100644 (file)
@@ -608,10 +608,18 @@ class ux_t3lib_sqlparser extends t3lib_sqlparser {
                                                                                        $fieldType = $GLOBALS['TYPO3_DB']->sql_field_metatype($tableName, $fieldName);
                                                                                        $isLob = ($fieldType === 'B' || $fieldType === 'XL');
                                                                                }
-                                                                               if ($isLob) {
-                                                                                       $output .= '(dbms_lob.instr(LOWER(' . trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . '), ' . t3lib_div::strtolower($compareValue) . ',1,1) > 0)';
+                                                                               if (strtoupper(substr($v['comparator'], -6)) === 'BINARY') {
+                                                                                       if ($isLob) {
+                                                                                               $output .= '(dbms_lob.instr(' . trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . ', ' . $compareValue . ',1,1) > 0)';
+                                                                                       } else {
+                                                                                               $output .= '(instr(' . trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . ', ' . $compareValue . ',1,1) > 0)';
+                                                                                       }
                                                                                } else {
-                                                                                       $output .= '(instr(LOWER(' . trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . '), ' . t3lib_div::strtolower($compareValue) . ',1,1) > 0)';
+                                                                                       if ($isLob) {
+                                                                                               $output .= '(dbms_lob.instr(LOWER(' . trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . '), ' . t3lib_div::strtolower($compareValue) . ',1,1) > 0)';
+                                                                                       } else {
+                                                                                               $output .= '(instr(LOWER(' . trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']) . '), ' . t3lib_div::strtolower($compareValue) . ',1,1) > 0)';
+                                                                                       }
                                                                                }
                                                                                break;
                                                                        default: