Index: java/engine/org/apache/derby/iapi/types/Like.java
===================================================================
--- java/engine/org/apache/derby/iapi/types/Like.java	(revision 482532)
+++ java/engine/org/apache/derby/iapi/types/Like.java	(working copy)
@@ -668,7 +668,7 @@
 
 	/**
 	 * Determine whether or not this LIKE can be transformed into optimizable
-	 * clauses.  It can if the pattern is non-null, of length > 0 and
+	 * clauses.  It can if the pattern is non-null and if the length == 0 or
 	 * the first character is not a wild card.
 	 *
 	 * @param pattern	The right side of the LIKE
@@ -678,11 +678,15 @@
 
 	public static boolean isOptimizable(String pattern)
 	{
-		if (pattern == null || (pattern.length() == 0))
+		if (pattern == null)
 		{
 			return false;
 		}
 
+        if (pattern.length() == 0) {
+            return true;
+        }
+
 		// if we have pattern matching at start of string, no optimization
 		char firstChar = pattern.charAt(0);
 
@@ -888,9 +892,8 @@
 		char	newLastChar;
 		final int escChar;
 
-		if (pattern.length() == 0)
+		if (pattern == null)
 		{
-			// pattern is ""
 			return null;
 		}
 
