db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4006) ALTER COLUMN ... WITH DEFAULT NULL does not change the default
Date Thu, 08 Jan 2009 15:30:59 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662003#action_12662003

Bryan Pendleton commented on DERBY-4006:

I think that "default NULL" is a very special case, and ModifyColumnNode is
having trouble distinguishing between the case where the user didn't
specify a default at all, versus the case where they explicitly specified a default
value of NULL.

I think that the easiest thing is probably to enhance ModifyColumnNode to
have a boolean which states whether the user did or did not explicitly
specify a default value, so that we can change line 346 of ModifyColumnNode from

  if (defaultNode == null)


  if (! statementExplicitlySpecifiedDefaultForColumn)

> ALTER COLUMN ... WITH DEFAULT NULL does not change the default
> --------------------------------------------------------------
>                 Key: DERBY-4006
>                 URL: https://issues.apache.org/jira/browse/DERBY-4006
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:,,,,,
>            Reporter: Knut Anders Hatlen
>            Assignee: Bryan Pendleton
> Reported on derby-user.
> http://mail-archives.apache.org/mod_mbox/db-derby-user/200901.mbox/%3c21349727.post@talk.nabble.com%3e
> ij> create table t (x varchar(5) default 'abc');
> 0 rows inserted/updated/deleted
> ij> alter table t alter column x with default null;
> 0 rows inserted/updated/deleted
> ij> insert into t values default;
> 1 row inserted/updated/deleted
> ij> select * from t;
> X    
> -----
> abc  
> 1 row selected

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message