Fix issue #1546
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 739b251..380bbc3 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -970,6 +970,11 @@
 
 			return $item;
 		}
+		// Avoid breaking functions inside queries
+		elseif (strpos($item, '(') !== FALSE)
+		{
+			return $item;
+		}
 
 		static $preg_ec = array();