You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Lukas Eder (Jira)" <ji...@apache.org> on 2021/01/23 10:32:00 UTC
[jira] [Created] (IGNITE-14042) Explicit DEFAULT values are
unsupported for INSERT.
Lukas Eder created IGNITE-14042:
-----------------------------------
Summary: Explicit DEFAULT values are unsupported for INSERT.
Key: IGNITE-14042
URL: https://issues.apache.org/jira/browse/IGNITE-14042
Project: Ignite
Issue Type: Bug
Components: sql
Affects Versions: 2.9.1
Reporter: Lukas Eder
The documentation claims I can use the DEFAULT keyword to explicitly insert default values in INSERT statements:
[https://ignite.apache.org/docs/latest/sql-reference/dml#insert]
{code:java}
INSERT INTO tableName
{[( columnName [,...])]
{VALUES {({DEFAULT | expression} [,...])} [,...] | [DIRECT] [SORTED] select}}
| {SET {columnName = {DEFAULT | expression}} [,...]}
{code}
When I try this, it doesn't seem to work
{code:java}
CREATE TABLE t (i int PRIMARY KEY, j int DEFAULT 1);
INSERT INTO t VALUES (1); -- works
INSERT INTO t (i, j) VALUES (2, DEFAULT); -- doesn't work
{code}
I'm getting:
{quote}SQL Error [1002] [0A000]: Explicit DEFAULT values are unsupported for INSERT.
{quote}
With the alternative MySQL style syntax that the documentation suggests to work:
{code:sql}
INSERT INTO t SET i = 2, j = DEFAULT;
{code}
I'm getting this error, instead:
{quote}SQL Error [1001] [42000]: Failed to parse query. Column "DEFAULT" not found; SQL statement:
SELECT
TABLE.I,
TABLE.J
FROM TABLE(I INTEGER=(2,), J INTEGER=(DEFAULT,)) [42122-197]{quote}
Either the documentation or the implementation is wrong.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)