Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-14042

Explicit DEFAULT values are unsupported for INSERT despite what the documentation claims

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.9.1
    • None
    • sql
    • None
    • Docs Required, Release Notes Required

    Description

      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

       INSERT INTO tableName
        {[( columnName [,...])]
        {VALUES {({DEFAULT | expression} [,...])} [,...] | [DIRECT] [SORTED] select}}
        | {SET {columnName = {DEFAULT | expression}} [,...]}
      

      When I try this, it doesn't seem to work

       

      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
      

      I'm getting:

      SQL Error [1002] [0A000]: Explicit DEFAULT values are unsupported for INSERT.

      With the alternative MySQL style syntax that the documentation suggests to work:

      INSERT INTO t SET i = 2, j = DEFAULT;
      

      I'm getting this error, instead:

      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]

      Either the documentation or the implementation is wrong.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lukas.eder Lukas Eder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: