Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #7091 issue #7641

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/backend/distributed/commands/utility_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,14 @@ citus_ProcessUtilityInternal(PlannedStmt *pstmt,
if (ops && ops->markDistributed)
{
List *addresses = GetObjectAddressListFromParseTree(parsetree, false, true);
ObjectAddress *address = NULL;
foreach_ptr(address, addresses)
if (!IsAnyObjectDistributed(addresses))
{
MarkObjectDistributed(address);
TrackPropagatedObject(address);
ObjectAddress *address = NULL;
foreach_ptr(address, addresses)
{
MarkObjectDistributed(address);
TrackPropagatedObject(address);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CREATE SCHEMA non_super_user_create_existing_extension;
SET search_path TO non_super_user_create_existing_extension;
SELECT CURRENT_USER;
current_user
---------------------------------------------------------------------
postgres
(1 row)

CREATE EXTENSION if not exists "uuid-ossp" SCHEMA public;
CREATE EXTENSION if not exists "uuid-ossp" SCHEMA public;
NOTICE: extension "uuid-ossp" already exists, skipping
CREATE USER non_super_user_ext;
SET ROLE non_super_user_ext;
SELECT CURRENT_USER;
current_user
---------------------------------------------------------------------
non_super_user_ext
(1 row)

CREATE EXTENSION if not exists "uuid-ossp" SCHEMA public;
NOTICE: extension "uuid-ossp" already exists, skipping
RESET ROLE;
SELECT CURRENT_USER;
current_user
---------------------------------------------------------------------
postgres
(1 row)

DROP USER non_super_user_ext;
DROP SCHEMA non_super_user_create_existing_extension CASCADE;
1 change: 1 addition & 0 deletions src/test/regress/multi_schedule
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ test: background_task_queue_monitor
test: other_databases grant_role_from_non_maindb role_operations_from_non_maindb seclabel_non_maindb
test: citus_internal_access
test: function_with_case_when
test: non_super_user_create_existing_extension

# Causal clock test
test: clock
Expand Down
14 changes: 14 additions & 0 deletions src/test/regress/sql/non_super_user_create_existing_extension.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE SCHEMA non_super_user_create_existing_extension;
SET search_path TO non_super_user_create_existing_extension;

SELECT CURRENT_USER;
CREATE EXTENSION if not exists "uuid-ossp" SCHEMA public;
CREATE EXTENSION if not exists "uuid-ossp" SCHEMA public;
CREATE USER non_super_user_ext;
SET ROLE non_super_user_ext;
SELECT CURRENT_USER;
CREATE EXTENSION if not exists "uuid-ossp" SCHEMA public;
RESET ROLE;
SELECT CURRENT_USER;
DROP USER non_super_user_ext;
DROP SCHEMA non_super_user_create_existing_extension CASCADE;
Loading