empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele (JIRA) <empire-db-...@incubator.apache.org>
Subject [jira] [Resolved] (EMPIREDB-216) reserved words as colum names not correctly escaped/quoted for derby
Date Wed, 19 Nov 2014 12:42:33 GMT

     [ https://issues.apache.org/jira/browse/EMPIREDB-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rainer Döbele resolved EMPIREDB-216.
------------------------------------
       Resolution: Fixed
    Fix Version/s: empire-db-2.4.4
         Assignee: Rainer Döbele

Databases behave different on this issue and I don't want to go so far to modify the general
behavior.

Also it won't help just to quote the column name in the dll statement. For all other sql-statements
the name must also be quoted. The correct way to do this is to add the corresponding names
to the reserved keyword list of the particular driver.

I have now added "count" and "year" to the list of reserved keywords for Derby (see Construtor
of DBDatabaseDriverDerby). That should do the job. If there are any more words to add please
let us know.

> reserved words as colum names not correctly escaped/quoted for derby
> --------------------------------------------------------------------
>
>                 Key: EMPIREDB-216
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-216
>             Project: Empire-DB
>          Issue Type: Bug
>    Affects Versions: empire-db-2.4.3
>            Reporter: Harald Kirsch
>            Assignee: Rainer Döbele
>             Fix For: empire-db-2.4.4
>
>
> Created from getCreateDDLScript() I get
>  CREATE TABLE DIM_date (
>     ID INT GENERATED ALWAYS AS IDENTITY NOT NULL,
>    ...
>     year SMALLINT NOT NULL,
>     ...
>  );
> I get
> 2014-11-14T13:01:14Z	ERROR	org.apache.empire.db.DBSQLScript	java.sql.SQLSyntaxErrorException:
Syntax error: Encountered "year" at line 6, column 4.
>  java.sql.SQLSyntaxErrorException: Syntax error: Encountered "year" at line 6, column
4.
>  	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
>  	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> I think all column names in generated scripts should be enclosed in double quotes to
shield against such misinterpretation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message