You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Shaun Forbes (JIRA)" <em...@incubator.apache.org> on 2014/08/20 13:19:26 UTC
[jira] [Created] (EMPIREDB-209) Using a reserved word as a column
alias in a select statement.
Shaun Forbes created EMPIREDB-209:
-------------------------------------
Summary: Using a reserved word as a column alias in a select statement.
Key: EMPIREDB-209
URL: https://issues.apache.org/jira/browse/EMPIREDB-209
Project: Empire-DB
Issue Type: New Feature
Components: Core
Affects Versions: empire-db-2.4.2
Reporter: Shaun Forbes
Priority: Minor
I believe it's possible in sql to use a reserved word as an alias in a select statement if it's correctly quoted (it is for the databases I've tested anyway).
Checking for and quoting reserved word aliases does not currently appear to be implemented.
To overcome this limitation I've added an method to the DBDatabaseDriver class to add the alias and perform any required quoting and altered the DBAliasExpr class to delegate the adding of the alias to the DBDatabaseDriver class.
The character I'm using for quoting is determined from the getIdentifierQuoteString() method of the database connection metadata class, and I've used the detectQuoteName(String name) method in DBDatabaseDriver to determine if the alias needs to be quoted.
Patches available if required.
--
This message was sent by Atlassian JIRA
(v6.2#6252)