db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4013) Allow standard SQL syntax: ALTER TABLE ALTER [COLUMN] <col> SET DEFAULT <default>
Date Fri, 09 Jan 2009 23:37:59 GMT

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

Knut Anders Hatlen commented on DERBY-4013:
-------------------------------------------

I haven't tested the patch, only taken a brief look at it, but it looks correct to me. Why
do you think it needs a release note?

Minor nits:
  - javadoc for the test class describes another test ("compressing tables" it says)
  - javadoc to explain tryAndExpect()'s parameters might be helpful
  - tryAndExpect() reinvents JDBC.assertSingleValueResultSet()

> Allow standard SQL syntax: ALTER TABLE ALTER [COLUMN] <col> SET DEFAULT <default>
> ---------------------------------------------------------------------------------
>
>                 Key: DERBY-4013
>                 URL: https://issues.apache.org/jira/browse/DERBY-4013
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0,
10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0
>            Reporter: Dag H. Wanvik
>            Assignee: Dag H. Wanvik
>            Priority: Minor
>         Attachments: derby-4013.diff, derby-4013.stat
>
>
> Presently, the Derby syntax is ALTER TABLE ALTER [COLUMN] <col> [WITH] DEFAULT
<default>.
> The "SET" keyword is not accepted, only an optional "WITH". It would be good to accept
the standard syntax here as well.
> Cf. SQL 2003, section 11.12 <alter column definition> and section 11.13 <set
column default clause>.
> Repro on trunk:
> $ java org.apache.derby.tools.ij
> ij version 10.5
> ij> connect 'jdbc:derby:wombat;create=true';
> ij> create table t(i int default 0, j int);
> 0 rows inserted/updated/deleted
> ij> alter table t alter column j with default 1;
> 0 rows inserted/updated/deleted
> ij> insert into t values (default, default);
> 1 row inserted/updated/deleted
> ij> select * from t;
> I          |J          
> -----------------------
> 0          |1          
> 1 row selected
> ij> alter table t alter column j default 2;
> 0 rows inserted/updated/deleted
> ij> insert into t values (default, default);
> 1 row inserted/updated/deleted
> ij> select * from t;
> I          |J          
> -----------------------
> 0          |1          
> 0          |2          
> 2 rows selected
> ij> alter table t alter column j set default 3;
> ERROR 42X01: Syntax error: Encountered "set" at line 1, column 30.

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


Mime
View raw message