Skip to content

Commit afbb3c1

Browse files
committed
resolve conflicts caused by merge of branch 'master', improve tests for NOT operator
2 parents fa1429e + d586756 commit afbb3c1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

sql/pathman_basic.sql

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ SELECT count(*) FROM test.insert_into_select_copy;
101101
DROP TABLE test.insert_into_select_copy, test.insert_into_select CASCADE;
102102

103103

104-
/* test special case: ONLY statement with not-ONLY for partitioned table */
104+
/* Test special case: ONLY statement with not-ONLY for partitioned table */
105105
CREATE TABLE test.from_only_test(val INT NOT NULL);
106106
INSERT INTO test.from_only_test SELECT generate_series(1, 20);
107107
SELECT pathman.create_range_partitions('test.from_only_test', 'val', 1, 2);
@@ -469,6 +469,16 @@ SELECT drop_partitions('test.range_rel', TRUE);
469469
SELECT create_partitions_from_range('test.range_rel', 'dt', '2015-01-01'::date, '2015-12-01'::date, '1 month'::interval);
470470
EXPLAIN (COSTS OFF) SELECT * FROM test.range_rel WHERE dt = '2015-12-15';
471471

472+
/* Test NOT operator */
473+
CREATE TABLE bool_test(a INT NOT NULL, b BOOLEAN);
474+
SELECT create_hash_partitions('bool_test', 'a', 3);
475+
INSERT INTO bool_test SELECT g, (g % 4) = 0 FROM generate_series(1, 100) AS g;
476+
SELECT count(*) FROM bool_test;
477+
SELECT count(*) FROM bool_test WHERE (b = true AND b = false);
478+
SELECT count(*) FROM bool_test WHERE b = false; /* 75 values */
479+
SELECT count(*) FROM bool_test WHERE b = true; /* 25 values */
480+
DROP TABLE bool_test CASCADE;
481+
472482
/* Test foreign keys */
473483
CREATE TABLE test.messages(id SERIAL PRIMARY KEY, msg TEXT);
474484
CREATE TABLE test.replies(id SERIAL PRIMARY KEY, message_id INTEGER REFERENCES test.messages(id), msg TEXT);

0 commit comments

Comments
 (0)