Skip to content
Permalink
Browse files

Fixing case-sensitivity of AS in fields. Tests added. Fixes #1474

  • Loading branch information...
markstory committed Jan 27, 2011
1 parent d192ed3 commit 71d8e744f160c918e4a1b86dc32f9d3447145e12
@@ -562,7 +562,7 @@ function name($data) {
);
}
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(
__FUNCTION__, $cacheKey,
@@ -4077,10 +4077,14 @@ function testName() {
$result = $this->testDb->name(array('my-name', 'Foo-Model.*'));
$expected = array('`my-name`', '`Foo-Model`.*');
$this->assertEqual($result, $expected);
$result = $this->testDb->name(array('Team.P%', 'Team.G/G'));
$expected = array('`Team`.`P%`', '`Team`.`G/G`');
$this->assertEqual($result, $expected);
$result = $this->testDb->name('Model.name as y');
$expected = '`Model`.`name` AS `y`';
$this->assertEqual($result, $expected);
}
/**

0 comments on commit 71d8e74

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.