jan created EMPIREDB-250:
----------------------------

             Summary: 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.6


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)

Reply via email to