| 106 | } |
| 107 | |
| 108 | func TestSetOperation_SQL(t *testing.T) { |
| 109 | s := &SetOperation{ |
| 110 | Left: &SelectStatement{Columns: []Expression{&Identifier{Name: "a"}}, From: []TableReference{{Name: "t1"}}}, |
| 111 | Right: &SelectStatement{Columns: []Expression{&Identifier{Name: "b"}}, From: []TableReference{{Name: "t2"}}}, |
| 112 | Operator: "UNION", |
| 113 | All: true, |
| 114 | } |
| 115 | sql := s.SQL() |
| 116 | if !strings.Contains(sql, "UNION ALL") { |
| 117 | t.Errorf("missing UNION ALL in: %s", sql) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func TestValues_SQL(t *testing.T) { |
| 122 | v := &Values{ |