mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 23:49:55 +00:00
Fixing case-sensitivity of AS in fields. Tests added. Fixes #1474
This commit is contained in:
parent
d192ed32f0
commit
71d8e744f1
2 changed files with 6 additions and 2 deletions
|
@ -562,7 +562,7 @@ class DboSource extends DataSource {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/', $data, $matches
|
preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/i', $data, $matches
|
||||||
)) {
|
)) {
|
||||||
return $this->cacheMethod(
|
return $this->cacheMethod(
|
||||||
__FUNCTION__, $cacheKey,
|
__FUNCTION__, $cacheKey,
|
||||||
|
|
|
@ -4077,10 +4077,14 @@ class DboSourceTest extends CakeTestCase {
|
||||||
$result = $this->testDb->name(array('my-name', 'Foo-Model.*'));
|
$result = $this->testDb->name(array('my-name', 'Foo-Model.*'));
|
||||||
$expected = array('`my-name`', '`Foo-Model`.*');
|
$expected = array('`my-name`', '`Foo-Model`.*');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
$result = $this->testDb->name(array('Team.P%', 'Team.G/G'));
|
$result = $this->testDb->name(array('Team.P%', 'Team.G/G'));
|
||||||
$expected = array('`Team`.`P%`', '`Team`.`G/G`');
|
$expected = array('`Team`.`P%`', '`Team`.`G/G`');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
$result = $this->testDb->name('Model.name as y');
|
||||||
|
$expected = '`Model`.`name` AS `y`';
|
||||||
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue