Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5825

Catch type mismatch of DEFAULT values at DDL time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.9.1.0
    • None
    • SQL
    • Normal
    • Release Note Needed, Repro attached
    • Deviation from standard

    Description

      Derby postpones checking values in DEFAULT clauses to DML time, cf this example:

      create table t(c varchar(2) default 'foo')
      insert into t values default

      According to the standard [1], an error should result at create table time. Derby throws an error only at insert time above. Similarly for other types. Cf also discussion in DERBY-118.

      Cf also comments in ColumnDefinitionNode#defaultTypeIsValid:

      "We'll check this at insertion time; see Beetle 5585 regarding the
      need to move that check to here instead of waiting until insert
      time."

      We should implement correct type checking of the DEFAULT values given at DDL time.

      [1] https://issues.apache.org/jira/browse/DERBY-118?focusedCommentId=13397195&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13397195

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dagw Dag H. Wanvik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: