diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-09 12:36:31 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-09 12:36:31 +0200 |
commit | ea7a866f6107d4b50b4a7059f1373035aa12dd23 (patch) | |
tree | bf3c2d9f16d098358108f4ad609cf2b068c45ba6 /system/database/DB_query_builder.php | |
parent | 9ac557f2473844f3c2207189f371f827dbaddb71 (diff) | |
parent | 580fe8ec482f5df7ca5b91e11b13b72a8f3ed0b8 (diff) |
Merge changes from develop
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r-- | system/database/DB_query_builder.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 479b7f24a..54510ec2e 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -1522,19 +1522,18 @@ abstract class CI_DB_query_builder extends CI_DB_driver { // -------------------------------------------------------------------- /** - * From Tables + * FROM tables * - * This public function implicitly groups FROM tables so there is no confusion - * about operator precedence in harmony with SQL standards + * Groups tables in FROM clauses if needed, so there is no confusion + * about operator precedence. * - * @param array - * @return string + * Note: This is only used (and overriden) by MySQL and CUBRID. + * + * @return string */ - protected function _from_tables($tables) + protected function _from_tables() { - is_array($tables) OR $tables = array($tables); - - return (count($tables) === 1) ? $tables[0] : '('.implode(', ', $tables).')'; + return implode(', ', $this->qb_from); } // -------------------------------------------------------------------- @@ -2058,7 +2057,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { // Write the "FROM" portion of the query if (count($this->qb_from) > 0) { - $sql .= "\nFROM ".$this->_from_tables($this->qb_from); + $sql .= "\nFROM ".$this->_from_tables(); } // Write the "JOIN" portion of the query |