summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mssql/mssql_driver.php
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-02-05 00:20:34 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-02-05 00:20:34 +0100
commit9b3e7b5f2d4ec4feae793ef90454506addbb19e1 (patch)
tree866d6efe488c04a118cdb015991452e56d1722ec /system/database/drivers/mssql/mssql_driver.php
parent613c6f605666031aa5b60c2dca568ac2d3a3c264 (diff)
Added and documented Active Record caching.
Made AR fully database-prefix aware
Diffstat (limited to 'system/database/drivers/mssql/mssql_driver.php')
-rw-r--r--system/database/drivers/mssql/mssql_driver.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index ad747d4ad..ecd404b52 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -433,6 +433,13 @@ class CI_DB_mssql_driver extends CI_DB {
function _protect_identifiers($item, $affect_spaces = TRUE, $first_word_only = FALSE)
{
// MSSQL doesn't use backticks
+ if (strpos($item, '.') !== FALSE)
+ {
+ $aliased_tables = implode(".",$this->ar_aliased_tables).'.';
+ $table_name = substr($item, 0, strpos($item, '.')+1);
+ $item = (strpos($aliased_tables, $table_name) !== FALSE) ? $item = $item : $this->dbprefix.$item;
+ }
+
return $item;
}