Details
Description
According to SQL standard update statement also allows to specify DEFAULT in addition to an expression:
@Test public void testUpdateDefault() { sql("CREATE TABLE t (id INTEGER PRIMARY KEY, val INTEGER DEFAULT 42)"); sql("INSERT INTO t VALUES(1, 0)"); sql("UPDATE t SET val = DEFAULT WHERE id = 1");// should work }
But SQL parser can not parse such statement an returns an error:
Caused by: org.apache.ignite.sql.SqlException: IGN-SQL-5 TraceId:90bce644-7799-4b0e-b132-60b26e7ba2da Failed to parse query: Incorrect syntax near the keyword 'DEFAULT' at line 1, column 20
at org.apache.ignite.internal.sql.engine.sql.IgniteSqlParser.convertException(IgniteSqlParser.java:203)
at org.apache.ignite.internal.sql.engine.sql.IgniteSqlParser.parse(IgniteSqlParser.java:112)
at org.apache.ignite.internal.sql.engine.sql.IgniteSqlParser.parse(IgniteSqlParser.java:77)
at org.apache.ignite.internal.sql.engine.sql.ParserServiceImpl.parse(ParserServiceImpl.java:65)
at org.apache.ignite.internal.sql.engine.SqlQueryProcessor.lambda$querySingle0$10(SqlQueryProcessor.java:572)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
... 6 more
Attachments
Issue Links
- Discovered while testing
-
IGNITE-21974 Extend test coverage for SQL F221(Explicit defaults)
- Resolved
- duplicates
-
IGNITE-15616 Calcite. Failed to parse UPDATE query.
- Reopened