db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5157) Incomplete quoting of SQL identifiers in AlterTableConstantAction
Date Tue, 29 Mar 2011 00:04:06 GMT

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

Dag H. Wanvik commented on DERBY-5157:

Patch looks good. I verified that the new test cases fail without the patch. Well, actually
the first one did ("testDerby5157_addColumnWithDefaultValue"). The second one "testDerby5157_changeIncrement"
subsequently gave a lock timeout in the "CREATE SCHEMA".

With the patch the tests ran fine.


> Incomplete quoting of SQL identifiers in AlterTableConstantAction
> -----------------------------------------------------------------
>                 Key: DERBY-5157
>                 URL: https://issues.apache.org/jira/browse/DERBY-5157
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: derby-5157-1a.diff
> AlterTableConstantAction generates SQL statements various places. Identifiers (schema
names, table names, column names) are surrounded with double quotes in case they contain special
characters. This is not enough if the identifiers contain double quotes, as can be seen with
this example:
> ij> create table t(x int);
> 0 rows inserted/updated/deleted
> ij> alter table t add column """" int default 42;
> ERROR 42X01: Syntax error: Encountered "\"" at line 1, column 22.
> I've found three places where AlterTableConstantAction generates SQL statements: updateNewColumnToDefault(),
updateNewAutoincrementColumn(), getColumnMax(). All three places suffer from this problem.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message