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] [Updated] (EMPIREDB-250) DBDDLGenerator generates wrong SQL for Views with DBCombinedCmd
Date Tue, 17 Jan 2017 09:29:27 GMT

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

Rainer Döbele updated EMPIREDB-250:
-----------------------------------
    Fix Version/s:     (was: empire-db-2.4.6)
                   empire-db-2.4.7

> DBDDLGenerator generates wrong SQL for Views with DBCombinedCmd
> ---------------------------------------------------------------
>
>                 Key: EMPIREDB-250
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-250
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: empire-db-2.4.5
>            Reporter: jan
>            Assignee: jan
>            Priority: Critical
>             Fix For: empire-db-2.4.7
>
>
> When you declare a view like
> @Override
> public DBCommandExpr createCommand() {
> 	
> 	TTable1 T1 = db.T_ONE;
> 	TTable2 T2 = db.T_TWO;
> 	DBCommand c1 = db.createCommand();
> 	c1.select(T1.ID);
> 	DBCommand c2 = db.createCommand();
> 	c2.select(T2.ID);
> 	return t1.union(t2);
> 	
> }
> which results in
> CREATE VIEW v1 (ID)
> AS
> ((SELECT t3.ID
> FROM TABLE1 t3)
> UNION
> (SELECT t4.ID
> FROM TABLE2 t4));
> if you run this command on MySQL (or MariaDB) you get ERROR 1064, because its not valid.

> Whyever MySQL/MariaDB does not like the double (( )). Running that statement without
creating the view works.



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

Mime
View raw message