Bug #23282 ยป 15253.diff
class.ux_t3lib_sqlparser.php (working copy) | ||
---|---|---|
} else {
|
||
$output .= $v['calc_value'][1] . $this->compileAddslashes($v['calc_value'][0]) . $v['calc_value'][1];
|
||
}
|
||
} elseif (!($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8') && $v['comparator'] === 'LIKE' && $functionMapping)) {
|
||
} elseif (!($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8') && preg_match('/(NOT )?LIKE/', $v['comparator']) && $functionMapping)) {
|
||
$output .= trim(($v['table'] ? $v['table'] . '.' : '') . $v['field']);
|
||
}
|
||
}
|
||
... | ... | |
// Set comparator:
|
||
if ($v['comparator']) {
|
||
switch (TRUE) {
|
||
case ($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8') && $v['comparator'] === 'LIKE' && $functionMapping):
|
||
case ($GLOBALS['TYPO3_DB']->runningADOdbDriver('oci8') && preg_match('/(NOT )?LIKE/', $v['comparator']) && $functionMapping):
|
||
// Oracle cannot handle LIKE on CLOB fields - sigh
|
||
if (isset($v['value']['operator'])) {
|
||
$values = array();
|
||
... | ... | |
} else {
|
||
$compareValue = $v['value'][1] . $this->compileAddslashes(trim($v['value'][0], '%')) . $v['value'][1];
|
||
}
|
||
if (t3lib_div::isFirstPartOfStr($v['comparator'], 'NOT')) {
|
||
$output .= 'NOT ';
|
||
}
|
||
// To be on the safe side
|
||
$isLob = TRUE;
|
||
if ($v['table']) {
|
tests/dbOracleTest.php (working copy) | ||
---|---|---|
/**
|
||
* @test
|
||
* @see http://bugs.typo3.org/view.php?id=15253
|
||
*/
|
||
public function notLikeIsRemappedAccordingToFieldType() {
|
||
$select = $this->cleanSql($GLOBALS['TYPO3_DB']->SELECTquery(
|
||
'*',
|
||
'tt_content',
|
||
'tt_content.bodytext NOT LIKE \'foo%\''
|
||
));
|
||
$expected = 'SELECT * FROM "tt_content" WHERE NOT (dbms_lob.instr("tt_content"."bodytext", \'foo\',1,1) > 0)';
|
||
$this->assertEquals($expected, $select);
|
||
$select = $this->cleanSql($GLOBALS['TYPO3_DB']->SELECTquery(
|
||
'*',
|
||
'fe_users',
|
||
'fe_users.usergroup NOT LIKE \'2\''
|
||
));
|
||
$expected = 'SELECT * FROM "fe_users" WHERE NOT (instr("fe_users"."usergroup", \'2\',1,1) > 0)';
|
||
$this->assertEquals($expected, $select);
|
||
}
|
||
/**
|
||
* @test
|
||
* @see http://bugs.typo3.org/view.php?id=14479
|
||
*/
|
||
public function instrIsUsedForCEOnPages() {
|