Project

General

Profile

Bug #21514 » 12535.diff

Administrator Admin, 2009-11-10 10:32

View differences:

class.ux_t3lib_sqlparser.php (working copy)
// Find "comparator":
$stack[$level][$pnt[$level]]['comparator'] = $this->nextPart($parseString, '^(<=|>=|<|>|=|!=|NOT[[:space:]]+IN|IN|NOT[[:space:]]+LIKE|LIKE|IS[[:space:]]+NOT|IS)');
if (strlen($stack[$level][$pnt[$level]]['comparator'])) {
if (in_array($stack[$level][$pnt[$level]]['comparator'], array('LIKE', 'NOT LIKE'))) {
// Remove the optional "BINARY" keyword that is unknown to DBAL
if (preg_match('/^BINARY[[:space:]]*/i', $parseString)) {
$this->nextPart($parseString, '^(BINARY)');
}
}
if (preg_match('/^CONCAT[[:space:]]*\(/i', $parseString)) {
$this->nextPart($parseString, '^(CONCAT[[:space:]]?[(])');
$values = array(
tests/db_general_testcase.php (working copy)
$expected = 'INSERT INTO tx_test_dbal ( foo, foobar ) VALUES ( \'99.12\', \'-120\' )';
$this->assertEquals($expected, $query);
}
/**
* @test
* @see http://bugs.typo3.org/view.php?id=12535
*/
public function likeBinaryOperatorIsRemoved() {
$query = $this->cleanSql($this->fixture->SELECTquery(
'*',
'tt_content',
'bodytext LIKE BINARY \'test\''
));
$expected = 'SELECT * FROM tt_content WHERE bodytext LIKE \'test\'';
$this->assertEquals($expected, $query);
}
}
?>
(1-1/4)