diff options
author | Derek Allard <derek.allard@ellislab.com> | 2008-03-06 16:51:55 +0100 |
---|---|---|
committer | Derek Allard <derek.allard@ellislab.com> | 2008-03-06 16:51:55 +0100 |
commit | 8b2f19b7b2671526c8e5eca74251b6339932e5bf (patch) | |
tree | 9399c26b4771a4f4b00dd6f7373b489398047b20 | |
parent | 83811b1288b98678caca6d7a146aa466782a518d (diff) |
change to the way AR handles aliased tables
-rw-r--r-- | system/database/DB_active_rec.php | 8 |
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;
}
|