Skip to content

Commit 11954b0

Browse files
authored
KIKIMR-20931: Fix set_config (#1521)
* KIKIMR-20931: Fix set_config * typo * add information_schema
1 parent abde21b commit 11954b0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ydb/library/yql/sql/pg/pg_sql.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,8 +2091,8 @@ class TConverter : public IPGParseEvents {
20912091
AddError(TStringBuilder() << "VariableSetStmt, set_config doesn't support that option:" << name);
20922092
return nullptr;
20932093
}
2094-
if (rawStr != "pg_catalog" && rawStr != "public") {
2095-
AddError(TStringBuilder() << "VariableSetStmt, search path supports only public and pg_catalogue, but got :" << rawStr);
2094+
if (rawStr != "pg_catalog" && rawStr != "public" && rawStr != "" && rawStr != "information_schema") {
2095+
AddError(TStringBuilder() << "VariableSetStmt, search path supports only 'information_schema', 'public', 'pg_catalog', '' but got: '" << rawStr << "'");
20962096
return nullptr;
20972097
}
20982098
if (Settings.GUCSettings) {
@@ -2382,12 +2382,16 @@ class TConverter : public IPGParseEvents {
23822382
case TRANS_STMT_COMMIT:
23832383
Statements.push_back(L(A("let"), A("world"), L(A("CommitAll!"),
23842384
A("world"))));
2385-
Settings.GUCSettings->Commit();
2385+
if (Settings.GUCSettings) {
2386+
Settings.GUCSettings->Commit();
2387+
}
23862388
return true;
23872389
case TRANS_STMT_ROLLBACK:
23882390
Statements.push_back(L(A("let"), A("world"), L(A("CommitAll!"),
23892391
A("world"), QL(QL(QA("mode"), QA("rollback"))))));
2390-
Settings.GUCSettings->RollBack();
2392+
if (Settings.GUCSettings) {
2393+
Settings.GUCSettings->RollBack();
2394+
}
23912395
return true;
23922396
default:
23932397
AddError(TStringBuilder() << "TransactionStmt: kind is not supported: " << (int)value->kind);
@@ -2526,7 +2530,7 @@ class TConverter : public IPGParseEvents {
25262530
}
25272531
if (schemaname == "" && Settings.GUCSettings) {
25282532
auto search_path = Settings.GUCSettings->Get("search_path");
2529-
if (!search_path || *search_path == "public") {
2533+
if (!search_path || *search_path == "public" || search_path->empty()) {
25302534
return Settings.DefaultCluster;
25312535
}
25322536
return TString(*search_path);

0 commit comments

Comments
 (0)