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

ADBDEV-6834: Fix modified GUCs when starting a new slice #1149

Merged
merged 2 commits into from
Dec 12, 2024
Merged
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
8 changes: 7 additions & 1 deletion src/backend/utils/init/postinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,13 @@ process_startup_options(Port *port, bool am_superuser)
char *name = NULL;
char *val = NULL;
ParseLongOption(av[i], &name, &val);
SetConfigOption(name, val, gucctx, PGC_S_SESSION);
/*
* The PGC_S_TEST source is used to allow some GUCs, such as
* default_tablespace, temp_tablespaces, and
* temp_spill_files_tablespaces, to issue a notice instead of an
* error on invalid values ​​when starting a new slice.
*/
SetConfigOption(name, val, gucctx, PGC_S_TEST);
}
pfree(av);
}
Expand Down
8 changes: 8 additions & 0 deletions src/test/regress/input/default_tablespace.source
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,11 @@ drop database database_with_tablespace;

drop tablespace some_default_tablespace;
drop tablespace some_database_tablespace;

-- ensure modified GUCs when starting a new slice does not error
create tablespace some_default_tablespace location '@testtablespace@_default_tablespace';
set default_tablespace to some_default_tablespace;
drop tablespace some_default_tablespace;
create table table_under_database_with_default_tablespace (a int);
insert into table_under_database_with_default_tablespace select random() from generate_series(1, 10);
drop table table_under_database_with_default_tablespace;
7 changes: 7 additions & 0 deletions src/test/regress/output/default_tablespace.source
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,10 @@ drop database database_for_default_tablespace;
drop database database_with_tablespace;
drop tablespace some_default_tablespace;
drop tablespace some_database_tablespace;
-- ensure modified GUCs when starting a new slice does not error
create tablespace some_default_tablespace location '@testtablespace@_default_tablespace';
set default_tablespace to some_default_tablespace;
drop tablespace some_default_tablespace;
create table table_under_database_with_default_tablespace (a int);
insert into table_under_database_with_default_tablespace select random() from generate_series(1, 10);
drop table table_under_database_with_default_tablespace;
Loading