summaryrefslogtreecommitdiffstats
path: root/system/database/DB_query_builder.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-09 10:34:01 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-09 10:34:01 +0200
commit7eaa14f144f9aeab8fc388b6bed3390e5f815508 (patch)
tree5800ca54726c8bec7babe3ae8992c205f660e3bd /system/database/DB_query_builder.php
parent624ccd5d0221e7c5da70f7a258c500f6d435d979 (diff)
Alter fix for issue #1257
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r--system/database/DB_query_builder.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 8bd2ab53c..c77648b38 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1522,6 +1522,23 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
// --------------------------------------------------------------------
/**
+ * FROM tables
+ *
+ * Groups tables in FROM clauses if needed, so there is no confusion
+ * about operator precedence.
+ *
+ * Note: This is only used (and overriden) by MySQL and CUBRID.
+ *
+ * @return string
+ */
+ protected function _from_tables()
+ {
+ return implode(', ', $this->qb_from);
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Get UPDATE query string
*
* Compiles an update query and returns the sql
@@ -2040,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 ".implode(', ', $this->qb_from);
+ $sql .= "\nFROM ".$this->from_tables();
}
// Write the "JOIN" portion of the query