Fix #2353
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 04490c8..bbefbe5 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1706,7 +1706,10 @@
 		// If a parenthesis is found we know that we do not need to
 		// escape the data or add a prefix. There's probably a more graceful
 		// way to deal with this, but I'm not thinking of it -- Rick
-		if (strpos($item, '(') !== FALSE)
+		//
+		// Added exception for single quotes as well, we don't want to alter
+		// literal strings. -- Narf
+		if (strpos($item, '(') !== FALSE OR strpos($item, "'") !== FALSE)
 		{
 			return $item;
 		}