Move tests into existing schedule

pull/472/head
Brian Cloutier 2016-04-27 02:06:32 -07:00
parent 1d1d95f80f
commit 8b43ce8b7c
5 changed files with 11 additions and 55 deletions

View File

@ -1,30 +0,0 @@
CREATE TABLE modifications (
key VARCHAR,
counter INT,
time TIMESTAMPTZ
);
SELECT master_create_distributed_table('modifications', 'key', 'hash');
master_create_distributed_table
---------------------------------
(1 row)
SELECT master_create_worker_shards('modifications', 4, 1);
master_create_worker_shards
-----------------------------
(1 row)
INSERT INTO modifications VALUES ('one', 0, null);
UPDATE modifications SET counter = counter + 1;
ERROR: distributed modifications must target exactly one shard
UPDATE modifications SET counter = counter + 1 WHERE key = 'one';
UPDATE modifications SET time = now() WHERE key = 'one';
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
SELECT * FROM modifications;
key | counter | time
-----+---------+------
one | 1 |
(1 row)
DROP TABLE modifications;

View File

@ -317,6 +317,11 @@ WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
UPDATE limit_orders SET symbol = 'GM'; UPDATE limit_orders SET symbol = 'GM';
ERROR: cannot perform distributed planning for the given modification ERROR: cannot perform distributed planning for the given modification
DETAIL: Common table expressions are not supported in distributed modifications. DETAIL: Common table expressions are not supported in distributed modifications.
-- updates referencing a column are supported
UPDATE limit_orders SET bidder_id = bidder_id + 1 WHERE id = 246;
-- updates referencing an unpure function are unsupported
UPDATE limit_orders SET placed_at = now() WHERE id = 246;
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
-- cursors are not supported -- cursors are not supported
UPDATE limit_orders SET symbol = 'GM' WHERE CURRENT OF cursor_name; UPDATE limit_orders SET symbol = 'GM' WHERE CURRENT OF cursor_name;
ERROR: distributed modifications must target exactly one shard ERROR: distributed modifications must target exactly one shard

View File

@ -141,9 +141,3 @@ test: multi_large_shardid
# multi_drop_extension makes sure we can safely drop and recreate the extension # multi_drop_extension makes sure we can safely drop and recreate the extension
# ---------- # ----------
test: multi_drop_extension test: multi_drop_extension
# ----------
# multi_expanded_modifications includes some tests that we can reference columns in
# UPDATEs
# ----------
test: multi_expanded_modifications

View File

@ -1,19 +0,0 @@
CREATE TABLE modifications (
key VARCHAR,
counter INT,
time TIMESTAMPTZ
);
SELECT master_create_distributed_table('modifications', 'key', 'hash');
SELECT master_create_worker_shards('modifications', 4, 1);
INSERT INTO modifications VALUES ('one', 0, null);
UPDATE modifications SET counter = counter + 1;
UPDATE modifications SET counter = counter + 1 WHERE key = 'one';
UPDATE modifications SET time = now() WHERE key = 'one';
SELECT * FROM modifications;
DROP TABLE modifications;

View File

@ -235,5 +235,11 @@ UPDATE limit_orders SET symbol = 'GM' WHERE id = 246 RETURNING *;
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *) WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
UPDATE limit_orders SET symbol = 'GM'; UPDATE limit_orders SET symbol = 'GM';
-- updates referencing a column are supported
UPDATE limit_orders SET bidder_id = bidder_id + 1 WHERE id = 246;
-- updates referencing an unpure function are unsupported
UPDATE limit_orders SET placed_at = now() WHERE id = 246;
-- cursors are not supported -- cursors are not supported
UPDATE limit_orders SET symbol = 'GM' WHERE CURRENT OF cursor_name; UPDATE limit_orders SET symbol = 'GM' WHERE CURRENT OF cursor_name;