diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLEngine.java
@@ -471,6 +471,8 @@ public class OSQLEngine {
       pos = OStringSerializerHelper.getLowerIndexOf(candidate, pos + 1, " ", "\n", "\r", "\t", "(", "[");

       if (pos > -1) {

         commandName = candidate.substring(0, pos);

+        //remove double spaces

+        commandName = commandName.replaceAll("  ", " ");

         found = names.contains(commandName);

       } else {

         break;
Fix parsing problem for two spaces at the beginning of SQL statements

(old parser)

Resolves: #<I>