Index: TestGrammarCompiler.java
===================================================================
--- TestGrammarCompiler.java	(revision 44747)
+++ TestGrammarCompiler.java	(revision 44748)
@@ -187,7 +187,7 @@
         String id = "????????????????????????????????";
         String s = code.toString();
         s = s.substring(0, s.length()-id.length()-2)+id+s.substring(s.length()-2);
-        assertEquals("EXISTS(NULL, '????????????????????????????????')", s);
+        assertEquals("EXISTS(NULL, 'EXISTS????????????????????????????????')", s);
     }
 
     public void testExistsSelect1() {
@@ -204,7 +204,7 @@
         String id = "????????????????????????????????";
         String s = code.toString();
         s = s.substring(0, s.length()-id.length()-2)+id+s.substring(s.length()-2);
-        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:(\"countries\".\"LASTCENSUS\" > 0)), '????????????????????????????????')", s);
+        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:(\"countries\".\"LASTCENSUS\" > 0)), 'EXISTS????????????????????????????????')", s);
     }
 
     public void testExistsSelectLimit1() {
@@ -222,7 +222,7 @@
         String id = "????????????????????????????????";
         String s = code.toString();
         s = s.substring(0, s.length()-id.length()-2)+id+s.substring(s.length()-2);
-        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:(\"countries\".\"LASTCENSUS\" > 0), LIMIT:1), '????????????????????????????????')", s);
+        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:(\"countries\".\"LASTCENSUS\" > 0), LIMIT:1), 'EXISTS????????????????????????????????')", s);
     }
 
     public void testExistsSelectLimit2() {
@@ -245,7 +245,51 @@
         String id = "????????????????????????????????";
         String s = code.toString();
         s = s.substring(0, s.length()-id.length()-2)+id+s.substring(s.length()-2);
-        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:((\"continents\".\"NAME\" = \"countries\".\"CONTINENT\") AND (\"countries\".\"LASTCENSUS\" < 0)), LIMIT:1), '????????????????????????????????')", s);
+        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:((\"continents\".\"NAME\" = \"countries\".\"CONTINENT\") AND (\"countries\".\"LASTCENSUS\" < 0)), LIMIT:1), 'EXISTS????????????????????????????????')", s);
     }
 
+    public void testExistsSelectLimit3() {
+        // Sobre la tabla de continentes, para obtener la lista de continentes 
+        // que tienen paises sin censo.
+        // Filtramos continentes por un campo del pais.
+        StringBuilder source = new StringBuilder();
+        source.append("EXISTS(");
+        source.append(" SELECT 1 FROM countries");
+        source.append("   WHERE ");
+        source.append("     continents.NAME = countries.CONTINENT AND ");
+        source.append("     countries.LASTCENSUS < 0 ");
+        source.append("   LIMIT 1; ");
+        source.append(" ,");
+        source.append(" 'patata'");
+        source.append(")");
+
+        Compiler compiler = createCompiler();
+
+        Code code = compiler.compileExpression(source.toString());
+        link(code);
+        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:((\"continents\".\"NAME\" = \"countries\".\"CONTINENT\") AND (\"countries\".\"LASTCENSUS\" < 0)), LIMIT:1), 'patata')", code.toString());
+    }
+
+    public void testExistsSelectLimit4() {
+        StringBuilder source = new StringBuilder();
+        source.append("EXISTS(");
+        source.append(" SELECT(");
+        source.append("   TABLE:'countries', ");
+        source.append("   WHERE:(countries.LASTCENSUS > 0), ");
+        source.append("   LIMIT:1 ");
+        source.append("  ) ");
+        source.append(" , ");
+        source.append(" 'EXISTS1234567890ABCDEFGHHIJKLMNOPQRSTU' ");
+        source.append(") ");
+
+        Compiler compiler = createCompiler();
+
+        Code code = compiler.compileExpression(source.toString());
+        link(code);
+        String id = "????????????????????????????????";
+        String s = code.toString();
+        s = s.substring(0, s.length()-id.length()-2)+id+s.substring(s.length()-2);
+        assertEquals("EXISTS(SELECT(TABLE:'countries', WHERE:(\"countries\".\"LASTCENSUS\" > 0), LIMIT:1), 'EXISTS????????????????????????????????')", s);
+    }
+
 }
