mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
parent
0b508b887a
commit
002700071d
2 changed files with 11 additions and 1 deletions
|
@ -2574,7 +2574,11 @@ class DboSource extends DataSource {
|
|||
$value = $this->value($value, $type);
|
||||
|
||||
if (!$virtual && $key !== '?') {
|
||||
$isKey = (strpos($key, '(') !== false || strpos($key, ')') !== false);
|
||||
$isKey = (
|
||||
strpos($key, '(') !== false ||
|
||||
strpos($key, ')') !== false ||
|
||||
strpos($key, '|') !== false
|
||||
);
|
||||
$key = $isKey ? $this->_quoteFields($key) : $this->name($key);
|
||||
}
|
||||
|
||||
|
|
|
@ -2207,6 +2207,12 @@ class MysqlTest extends CakeTestCase {
|
|||
$expected = " WHERE `HardCandy`.`name` LIKE 'to be or%' AND `Candy`.`name` LIKE '%not to be%'";
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$result = $this->Dbo->conditions(array(
|
||||
"Person.name || ' ' || Person.surname ILIKE" => '%mark%'
|
||||
));
|
||||
$expected = " WHERE `Person`.`name` || ' ' || `Person`.`surname` ILIKE '%mark%'";
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$result = $this->Dbo->conditions(array('score BETWEEN ? AND ?' => array(90.1, 95.7)));
|
||||
$expected = " WHERE `score` BETWEEN 90.1 AND 95.7";
|
||||
$this->assertEquals($expected, $result);
|
||||
|
|
Loading…
Add table
Reference in a new issue