summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-03-06 16:51:55 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-03-06 16:51:55 +0100
commit8b2f19b7b2671526c8e5eca74251b6339932e5bf (patch)
tree9399c26b4771a4f4b00dd6f7373b489398047b20 /system
parent83811b1288b98678caca6d7a146aa466782a518d (diff)
change to the way AR handles aliased tables
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_active_rec.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index add0b8c94..bde43abf0 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1434,17 +1434,15 @@ class CI_DB_active_record extends CI_DB_driver {
*/
function _filter_table_aliases($statements)
{
+
foreach ($statements as $k => $v)
{
foreach ($this->ar_aliased_tables as $table)
{
- $statement = preg_replace('/(\w+\.\w+)/', $this->_protect_identifiers('$0'), $v); // makes `table.field`
- $statement = str_replace(array($this->dbprefix.$table, '.'), array($table, $this->_protect_identifiers('.')), $statement);
+ $statements[$k] = preg_replace('/(\w+\.\w+)/', $this->_protect_identifiers('$0'), $statements[$k]); // makes `table.field`
+ $statements[$k] = str_replace($this->dbprefix.$table.'.', $table.'.', $statements[$k]);
}
-
- $statements[$k] = $statement;
}
-
return $statements;
}