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

Sql. CREATE TABLE fails when a column with DEFAULT constraint NULL is present.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.0
    • sql

    Description

      Default constraint with value = NULL causes an error.

      CREATE TABLE tbl(id int PRIMARY KEY, val INTEGER DEFAULT NULL)
      
      Caused by: java.lang.ClassCastException: Cannot cast org.apache.calcite.rel.metadata.NullSentinel$1 to java.lang.Integer
      	at java.base/java.lang.Class.cast(Class.java:3605)
      	at org.apache.calcite.sql.SqlLiteral.getValueAs(SqlLiteral.java:288)
      	at org.apache.ignite.internal.sql.engine.prepare.ddl.DdlSqlToCommandConverter.fromLiteral(DdlSqlToCommandConverter.java:799)
      

      Attachments

        Issue Links

          Activity

            People

              mzhuravkov Maksim Zhuravkov
              mzhuravkov Maksim Zhuravkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m