Skip to content

Commit

Permalink
Add test for zero-shard SELECT queries
Browse files Browse the repository at this point in the history
Uses a query with clauses that are impossible to satisfy.
  • Loading branch information
jasonmp85 committed Feb 6, 2015
1 parent 4171ff6 commit d5e772d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions expected/queries.out
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ INSERT INTO articles VALUES (47, 7, 'abeyance', 1772);
INSERT INTO articles VALUES (48, 8, 'alkylic', 18610);
INSERT INTO articles VALUES (49, 9, 'anyone', 2681);
INSERT INTO articles VALUES (50, 10, 'anjanette', 19519);
-- first, test zero-shard query
SELECT COUNT(*) FROM articles WHERE author_id = 1 AND author_id = 2;
count
-------
0
(1 row)

-- single-shard tests
-- test simple select for a single row
SELECT * FROM articles WHERE author_id = 10 AND id = 50;
Expand Down
3 changes: 3 additions & 0 deletions sql/queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ INSERT INTO articles VALUES (48, 8, 'alkylic', 18610);
INSERT INTO articles VALUES (49, 9, 'anyone', 2681);
INSERT INTO articles VALUES (50, 10, 'anjanette', 19519);

-- first, test zero-shard query
SELECT COUNT(*) FROM articles WHERE author_id = 1 AND author_id = 2;

-- single-shard tests

-- test simple select for a single row
Expand Down

0 comments on commit d5e772d

Please sign in to comment.