MySQL NOT operator support

- Suppot for NOT operator in MySQL, similarly as in PostgreSQL.
- Add test to verify NOT EXISTS query in MySQL
This commit is contained in:
Joonas Haapsaari 2020-07-29 16:37:55 +03:00
parent fdde2ab9b4
commit 9a3c29b504
3 changed files with 31 additions and 5 deletions

View file

@ -132,3 +132,25 @@ FROM db.table1
LOCK IN SHARE MODE;
`)
}
func TestSelect_NOT_EXISTS(t *testing.T) {
testutils.AssertStatementSql(t,
SELECT(table1ColInt).
FROM(table1).
WHERE(
NOT(EXISTS(
SELECT(table2ColInt).
FROM(table2).
WHERE(
table1ColInt.EQ(table2ColInt),
),
))), `
SELECT table1.col_int AS "table1.col_int"
FROM db.table1
WHERE (NOT (EXISTS (
SELECT table2.col_int AS "table2.col_int"
FROM db.table2
WHERE table1.col_int = table2.col_int
)));
`)
}