summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-06-11 15:16:35 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-06-11 15:16:35 +0200
commit686ff126762c0923556036a3cf73abb9390a7e67 (patch)
treec0aedf7f9ce68ed3e5880f9f1ba14ddf03eb7083 /system/database/DB_driver.php
parent918eaef728eaf49387083b39add7106e029fcfb4 (diff)
parentcef5bda9765080b818898811023d9ab427b0faf2 (diff)
Fixed conflicts
Why were there conflicts merging into master?
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r--system/database/DB_driver.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 6161f149b..858ec356d 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1263,15 +1263,20 @@ class CI_DB_driver {
}
// Convert tabs or multiple spaces into single spaces
- $item = preg_replace('/[\t ]+/', ' ', $item);
+ $item = preg_replace('/\s+/', ' ', $item);
// If the item has an alias declaration we remove it and set it aside.
// Basically we remove everything to the right of the first space
- $alias = '';
- if (strpos($item, ' ') !== FALSE)
+ if (preg_match('/^([^\s]+) (AS )*(.+)$/i', $item, $matches))
{
- $alias = strstr($item, " ");
- $item = substr($item, 0, - strlen($alias));
+ $item = $matches[1];
+
+ // Escape the alias
+ $alias = ' '.$matches[2].$this->_escape_identifiers($matches[3]);
+ }
+ else
+ {
+ $alias = '';
}
// This is basically a bug fix for queries that use MAX, MIN, etc.
@@ -1387,7 +1392,7 @@ class CI_DB_driver {
return $item.$alias;
}
-
+
// --------------------------------------------------------------------
/**
@@ -1395,16 +1400,13 @@ class CI_DB_driver {
*
* This function is used extensively by every db driver.
*
- * @access private
* @return void
*/
protected function _reset_select()
{
-
}
}
-
/* End of file DB_driver.php */
-/* Location: ./system/database/DB_driver.php */
+/* Location: ./system/database/DB_driver.php */ \ No newline at end of file