control sortmode rowsort

statement ok
drop table if exists kv

statement ok
CREATE TABLE kv (k INT PRIMARY KEY,  v INT)

statement ok
INSERT INTO kv VALUES (1, 2), (3, 4), (5, 6), (7, 8)

statement ok
drop table if exists kvString

statement ok
CREATE TABLE kvString (k STRING PRIMARY KEY,  v STRING)

statement ok
INSERT INTO kvString VALUES ('like1', 'hell%'), ('like2', 'worl%')

query II
SELECT * FROM kv WHERE True
----
1 2
3 4
5 6
7 8

statement ok
SELECT * FROM kv WHERE False

query II
SELECT * FROM kv WHERE k IN (1, 3)
----
1 2
3 4

query II
SELECT * FROM kv WHERE v IN (6)
----
5 6

query II
SELECT * FROM kv WHERE k IN (SELECT k FROM kv)
----
1 2
3 4
5 6
7 8

statement error 1065
SELECT * FROM kv WHERE (k,v) IN (SELECT * FROM kv)

query II
SELECT * FROM kv WHERE k IN (SELECT k FROM kv)
----
1 2
3 4
5 6
7 8

statement error
SELECT * FROM kv WHERE nonexistent = 1

query B
SELECT 'hello' LIKE v FROM kvString WHERE k LIKE 'like%' ORDER BY k
----
false
true

query II
SELECT * FROM kv WHERE k IN (1, 5.0, 9)
----
1 2
5 6

statement ok
drop table if exists ab

statement ok
CREATE TABLE ab (pk int primary key,a INT NULL, b INT NULL)

statement ok
INSERT INTO ab VALUES (0, 1, 10), (1, 2, 20), (2, 3, 30), (3, 4, NULL), (4, NULL, 50), (5, NULL, NULL)

query II
SELECT a, b FROM ab WHERE a IN (1, 3, 4)
----
1 10
3 30
4 null

query II
SELECT a, b FROM ab WHERE a IN (1, 3, 4, NULL)
----
1 10
3 30
4 null

query
SELECT a, b FROM ab WHERE (a, b) IN ((1, 10), (3, 30), (4, 40))
----
1 10
3 30

query
SELECT a, b FROM ab WHERE (a, b) IN ((1, 10), (4, NULL), (NULL, 50))
----
1 10
4 null
null 50
