You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2017/10/02 21:00:02 UTC

[02/15] calcite git commit: Add test case for 'select * as x' parser bug

Add test case for 'select * as x' parser bug


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/43fa8e94
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/43fa8e94
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/43fa8e94

Branch: refs/heads/master
Commit: 43fa8e94249d796d0e42b366feb4a8c886994aa4
Parents: 7a98575
Author: Julian Hyde <jh...@apache.org>
Authored: Mon Sep 11 15:58:17 2017 -0700
Committer: Julian Hyde <jh...@apache.org>
Committed: Mon Oct 2 11:13:41 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/calcite/sql/parser/SqlParserTest.java     | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/43fa8e94/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
index e91a76c..117862e 100644
--- a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
+++ b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
@@ -699,6 +699,13 @@ public class SqlParserTest {
         "Lexical error at line 1, column 10\\.  Encountered: \"#\" \\(35\\), after : \"\"");
   }
 
+  // TODO: should fail in parser
+  @Test public void testStarAsFails() {
+    sql("select * as x from emp")
+        .ok("SELECT * AS `X`\n"
+            + "FROM `EMP`");
+  }
+
   @Test public void testDerivedColumnList() {
     check("select * from emp as e (empno, gender) where true",
         "SELECT *\n"