strongduanmu commented on code in PR #2985:
URL: https://github.com/apache/calcite/pull/2985#discussion_r1040253872
##########
testkit/src/main/java/org/apache/calcite/sql/parser/SqlParserTest.java:
##########
@@ -4585,6 +4585,23 @@ void checkPeriodPredicate(Checker checker) {
.ok(expected);
}
+ /** Tests VALUE, which is equivalent to VALUES but only supported in some
+ * conformance levels (e.g. MYSQL). */
+ @Test void testInsertValue() {
+ final String pattern =
+ "VALUE is not allowed under the current SQL conformance level";
+ final String sql = "insert into emps ^value^ (1, 'Fredkin')";
+ sql(sql)
+ .fails(pattern);
+
+ final String expected = "INSERT INTO `EMPS`\n"
+ + "VALUES (ROW(1, 'Fredkin'))";
+ sql(sql)
+ .withConformance(SqlConformanceEnum.MYSQL_5)
+ .ok(expected)
+ .node(not(isDdl()));
+ }
+
Review Comment:
Good suggestion, I will merge testInsertValue into testInsertValues and add
unit test for VALUE as a top-level query.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]