Alter fix for issue #1257
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 8bd2ab5..c77648b 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1522,6 +1522,23 @@
 	// --------------------------------------------------------------------
 
 	/**
+	 * 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 @@
 		// 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