Add test for public shard not found issue

pull/4866/head
Ahmet Gedemenli 2021-04-02 15:43:57 +03:00
parent d530d79d73
commit 48a6a5b128
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)
(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;
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;