mirror of https://github.com/citusdata/citus.git
Adjust tests for 9.5
parent
52631ea0fc
commit
64a9baffbd
|
@ -18,6 +18,7 @@ SELECT stop_metadata_sync_to_node('localhost',:worker_2_port);
|
||||||
|
|
||||||
-- create a distributed table, drop a column and sync the metadata
|
-- create a distributed table, drop a column and sync the metadata
|
||||||
SET citus.shard_replication_factor TO 1;
|
SET citus.shard_replication_factor TO 1;
|
||||||
|
SET citus.replication_model TO streaming;
|
||||||
CREATE TABLE t1 (a int, b int, c int UNIQUE);
|
CREATE TABLE t1 (a int, b int, c int UNIQUE);
|
||||||
SELECT create_distributed_table('t1', 'c');
|
SELECT create_distributed_table('t1', 'c');
|
||||||
create_distributed_table
|
create_distributed_table
|
||||||
|
@ -196,13 +197,7 @@ NOTICE: executing the command locally: UPDATE local_shard_execution_dropped_col
|
||||||
-- has a dropped column but not the shard, via rebalance operation
|
-- has a dropped column but not the shard, via rebalance operation
|
||||||
SET search_path TO local_shard_execution_dropped_column;
|
SET search_path TO local_shard_execution_dropped_column;
|
||||||
ALTER TABLE t1 DROP COLUMN a;
|
ALTER TABLE t1 DROP COLUMN a;
|
||||||
SELECT citus_move_shard_placement(2460000, 'localhost', :worker_1_port, 'localhost', :worker_2_port);
|
\c - - - :worker_1_port
|
||||||
citus_move_shard_placement
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\c - - - :worker_2_port
|
|
||||||
SET search_path TO local_shard_execution_dropped_column;
|
SET search_path TO local_shard_execution_dropped_column;
|
||||||
-- show the dropped columns
|
-- show the dropped columns
|
||||||
SELECT attrelid::regclass, attname, attnum, attisdropped
|
SELECT attrelid::regclass, attname, attnum, attisdropped
|
||||||
|
@ -210,10 +205,12 @@ FROM pg_attribute WHERE attrelid IN ('t1'::regclass, 't1_2460000'::regclass) and
|
||||||
ORDER BY 1, 3, 2, 4;
|
ORDER BY 1, 3, 2, 4;
|
||||||
attrelid | attname | attnum | attisdropped
|
attrelid | attname | attnum | attisdropped
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
t1_2460000 | ........pg.dropped.1........ | 1 | t
|
||||||
|
t1_2460000 | ........pg.dropped.2........ | 2 | t
|
||||||
|
t1_2460000 | c | 3 | f
|
||||||
t1 | ........pg.dropped.1........ | 1 | t
|
t1 | ........pg.dropped.1........ | 1 | t
|
||||||
t1 | c | 2 | f
|
t1 | c | 2 | f
|
||||||
t1_2460000 | c | 1 | f
|
(5 rows)
|
||||||
(3 rows)
|
|
||||||
|
|
||||||
prepare p1(int) as insert into t1(c) VALUES ($1) ON CONFLICT (c) DO NOTHING;
|
prepare p1(int) as insert into t1(c) VALUES ($1) ON CONFLICT (c) DO NOTHING;
|
||||||
SET citus.log_remote_commands TO ON;
|
SET citus.log_remote_commands TO ON;
|
||||||
|
|
|
@ -12,12 +12,14 @@ SELECT stop_metadata_sync_to_node('localhost',:worker_2_port);
|
||||||
|
|
||||||
-- create a distributed table, drop a column and sync the metadata
|
-- create a distributed table, drop a column and sync the metadata
|
||||||
SET citus.shard_replication_factor TO 1;
|
SET citus.shard_replication_factor TO 1;
|
||||||
|
SET citus.replication_model TO streaming;
|
||||||
CREATE TABLE t1 (a int, b int, c int UNIQUE);
|
CREATE TABLE t1 (a int, b int, c int UNIQUE);
|
||||||
SELECT create_distributed_table('t1', 'c');
|
SELECT create_distributed_table('t1', 'c');
|
||||||
ALTER TABLE t1 DROP COLUMN b;
|
ALTER TABLE t1 DROP COLUMN b;
|
||||||
SELECT start_metadata_sync_to_node('localhost',:worker_1_port);
|
SELECT start_metadata_sync_to_node('localhost',:worker_1_port);
|
||||||
SELECT start_metadata_sync_to_node('localhost',:worker_2_port);
|
SELECT start_metadata_sync_to_node('localhost',:worker_2_port);
|
||||||
|
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
SET search_path TO local_shard_execution_dropped_column;
|
SET search_path TO local_shard_execution_dropped_column;
|
||||||
|
|
||||||
|
@ -84,9 +86,8 @@ execute p4(8);
|
||||||
SET search_path TO local_shard_execution_dropped_column;
|
SET search_path TO local_shard_execution_dropped_column;
|
||||||
ALTER TABLE t1 DROP COLUMN a;
|
ALTER TABLE t1 DROP COLUMN a;
|
||||||
|
|
||||||
SELECT citus_move_shard_placement(2460000, 'localhost', :worker_1_port, 'localhost', :worker_2_port);
|
|
||||||
|
|
||||||
\c - - - :worker_2_port
|
\c - - - :worker_1_port
|
||||||
SET search_path TO local_shard_execution_dropped_column;
|
SET search_path TO local_shard_execution_dropped_column;
|
||||||
|
|
||||||
-- show the dropped columns
|
-- show the dropped columns
|
||||||
|
|
Loading…
Reference in New Issue