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

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

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.9.1
    • Fix Version/s: None
    • Component/s: sql
    • Labels:
      None
    • Ignite Flags:
      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

            • Assignee:
              Unassigned
              Reporter:
              lukas.eder Lukas Eder

              Dates

              • Created:
                Updated:

                Issue deployment