summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-13 17:03:30 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-13 17:03:30 +0200
commitb55050962bb731d1a99430cd37953e55434236a9 (patch)
tree2edd50a25a04fe00eb4d067b8790e12ba819fb71
parentd5e39ded4bbaaef528ebd0731c7c0a4968a8c438 (diff)
Revert from() alias escaping fix - it was breaking more stuff
-rw-r--r--system/database/DB_driver.php8
-rw-r--r--user_guide/changelog.html1
2 files changed, 3 insertions, 6 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 858ec356d..c71a6aa3a 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1267,12 +1267,10 @@ class CI_DB_driver {
// 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
- if (preg_match('/^([^\s]+) (AS )*(.+)$/i', $item, $matches))
+ if (strpos($item, ' ') !== FALSE)
{
- $item = $matches[1];
-
- // Escape the alias
- $alias = ' '.$matches[2].$this->_escape_identifiers($matches[3]);
+ $alias = strstr(' ', $item);
+ $item = substr($item, 0, - strlen($alias));
}
else
{
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index ce3f6b106..ccec890e0 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -91,7 +91,6 @@ Change Log
<li>Fixed a bug (#726) - PDO put a 'dbname' argument in it's connection string regardless of the database platform in use, which made it impossible to use SQLite.</li>
<li>Fixed a bug - CI_DB_pdo_result::num_rows() was not returning properly value with SELECT queries, cause it was relying on PDOStatement::rowCount().</li>
<li>Fixed a bug (#1059) - CI_Image_lib::clear() was not correctly clearing all necessary object properties, namely width and height.</li>
- <li>Fixed a bug (#1387) - Active Record's <samp>from()</samp> method didn't escape table aliases.</li>
</ul>