Skip to content

Commit

Permalink
[BACKPORT 2024.1][#23786] YSQL: add yb_make_next_ddl_statement_noninc…
Browse files Browse the repository at this point in the history
…rementing to YbDbAdminVariables

Summary:
The yb_make_next_ddl_statement_nonincrementing has PGC_SUSET and needs to be
added to YbDbAdminVariables in order for yb_db_admin role to set it. Otherwise,
we see permission denied error for yb_db_admin:

```
yugabyte=# set role yb_db_admin;
SET
yugabyte=> set yb_make_next_ddl_statement_nonincrementing to true;
ERROR:  permission denied to set parameter "yb_make_next_ddl_statement_nonincrementing"
```

I added yb_make_next_ddl_statement_nonincrementing to YbDbAdminVariables, and
the above error is gone

```
yugabyte=# set role yb_db_admin;
SET
yugabyte=> set yb_make_next_ddl_statement_nonincrementing to true;
SET
```
Jira: DB-12689

Original commit: 2beb872 / D38135

Test Plan: ./yb_build.sh --cxx-test pg_catalog_version-test --gtest_filter PgCatalogVersionTest.NonIncrementingDDLMode

Reviewers: kfranz

Reviewed By: kfranz

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D38174
  • Loading branch information
myang2021 committed Sep 19, 2024
1 parent fb1969b commit 3d96551
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/postgres/src/backend/utils/misc/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5537,6 +5537,7 @@ static const char *const map_old_guc_names[] = {
static const char *const YbDbAdminVariables[] = {
"session_replication_role",
"yb_make_next_ddl_statement_nonbreaking",
"yb_make_next_ddl_statement_nonincrementing",
};


Expand Down
1 change: 1 addition & 0 deletions src/yb/yql/pgwrapper/pg_catalog_version-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,7 @@ TEST_F(PgCatalogVersionTest, NonIncrementingDDLMode) {
const string kDatabaseName = "yugabyte";

auto conn = ASSERT_RESULT(ConnectToDB(kDatabaseName));
ASSERT_OK(conn.Execute("SET ROLE yb_db_admin"));
ASSERT_OK(conn.Execute("CREATE TABLE t1(a int)"));
auto version = ASSERT_RESULT(GetCatalogVersion(&conn));

Expand Down

0 comments on commit 3d96551

Please sign in to comment.