Add test for public shard not found issue

(cherry picked from commit 48a6a5b128)
pull/5084/head
Ahmet Gedemenli 2021-04-02 15:43:57 +03:00
parent 88825b89a1
commit 2ea3618f22
2 changed files with 29 additions and 2 deletions

View File

@ -275,4 +275,22 @@ SELECT run_command_on_workers('SHOW enable_hashjoin');
(localhost,57638,t,on) (localhost,57638,t,on)
(2 rows) (2 rows)
DROP SCHEMA alter_role, ",CitUs,.TeeN!?" CASCADE; -- check altering search path won't cause public shards being not found
CREATE TABLE test_search_path(a int);
SELECT create_distributed_table('test_search_path', 'a');
create_distributed_table
---------------------------------------------------------------------
(1 row)
CREATE SCHEMA test_sp;
ALTER USER current_user SET search_path TO test_sp;
SELECT COUNT(*) FROM public.test_search_path;
count
---------------------------------------------------------------------
0
(1 row)
ALTER USER current_user RESET search_path;
DROP TABLE test_search_path;
DROP SCHEMA alter_role, ",CitUs,.TeeN!?", test_sp CASCADE;

View File

@ -90,4 +90,13 @@ SELECT run_command_on_workers('SHOW enable_hashjoin');
ALTER ROLE ALL RESET enable_hashjoin; ALTER ROLE ALL RESET enable_hashjoin;
SELECT run_command_on_workers('SHOW enable_hashjoin'); SELECT run_command_on_workers('SHOW enable_hashjoin');
DROP SCHEMA alter_role, ",CitUs,.TeeN!?" CASCADE; -- check altering search path won't cause public shards being not found
CREATE TABLE test_search_path(a int);
SELECT create_distributed_table('test_search_path', 'a');
CREATE SCHEMA test_sp;
ALTER USER current_user SET search_path TO test_sp;
SELECT COUNT(*) FROM public.test_search_path;
ALTER USER current_user RESET search_path;
DROP TABLE test_search_path;
DROP SCHEMA alter_role, ",CitUs,.TeeN!?", test_sp CASCADE;