Add support for UNION statements

This commit is contained in:
zer0sub 2019-05-01 14:42:46 +02:00
parent fef8f0ef83
commit 8a3521a016
8 changed files with 140 additions and 219 deletions

View file

@ -463,8 +463,8 @@ func (s *StmtSuite) TestUnionSelectWithMismatchedColumns(c *gc.C) {
q := Union(select_queries...)
q = q.Where(And(LtL(table1Col1, 1000), GtL(table1Col1, 15)))
q = q.OrderBy(Desc(table1Col4), Asc(table1Col3))
q = q.Limit(5)
q = q.ORDER_BY(Desc(table1Col4), Asc(table1Col3))
q = q.LIMIT(5)
_, err := q.String()
@ -502,8 +502,8 @@ func (s *StmtSuite) TestComplicatedUnionSelectWithWhereStatement(c *gc.C) {
q := Union(select_queries...)
q = q.Where(And(LtL(table1Col1, 1000), GtL(table1Col1, 15)))
q = q.OrderBy(Desc(table1Col4), Asc(table1Col3))
q = q.Limit(5)
q = q.ORDER_BY(Desc(table1Col4), Asc(table1Col3))
q = q.LIMIT(5)
q = q.GroupBy(table1Col4)
sql, err := q.String()