diff options
author | Александр Новожилов <mrlolthe1st@ydb.tech> | 2024-02-02 11:51:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-02 11:51:32 +0300 |
commit | 11954b0fc0321dad277b283821ddd7a0315f006e (patch) | |
tree | f5bbf461de4aa862291f370619391ff0f694a3c5 | |
parent | abde21bc9f55a6d7c1360979eabd07535dbfb7e6 (diff) | |
download | ydb-11954b0fc0321dad277b283821ddd7a0315f006e.tar.gz |
KIKIMR-20931: Fix set_config (#1521)
* KIKIMR-20931: Fix set_config
* typo
* add information_schema
-rw-r--r-- | ydb/library/yql/sql/pg/pg_sql.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ydb/library/yql/sql/pg/pg_sql.cpp b/ydb/library/yql/sql/pg/pg_sql.cpp index 723b77ab518..c7b5b8a2fc2 100644 --- a/ydb/library/yql/sql/pg/pg_sql.cpp +++ b/ydb/library/yql/sql/pg/pg_sql.cpp @@ -2091,8 +2091,8 @@ public: AddError(TStringBuilder() << "VariableSetStmt, set_config doesn't support that option:" << name); return nullptr; } - if (rawStr != "pg_catalog" && rawStr != "public") { - AddError(TStringBuilder() << "VariableSetStmt, search path supports only public and pg_catalogue, but got :" << rawStr); + if (rawStr != "pg_catalog" && rawStr != "public" && rawStr != "" && rawStr != "information_schema") { + AddError(TStringBuilder() << "VariableSetStmt, search path supports only 'information_schema', 'public', 'pg_catalog', '' but got: '" << rawStr << "'"); return nullptr; } if (Settings.GUCSettings) { @@ -2382,12 +2382,16 @@ public: case TRANS_STMT_COMMIT: Statements.push_back(L(A("let"), A("world"), L(A("CommitAll!"), A("world")))); - Settings.GUCSettings->Commit(); + if (Settings.GUCSettings) { + Settings.GUCSettings->Commit(); + } return true; case TRANS_STMT_ROLLBACK: Statements.push_back(L(A("let"), A("world"), L(A("CommitAll!"), A("world"), QL(QL(QA("mode"), QA("rollback")))))); - Settings.GUCSettings->RollBack(); + if (Settings.GUCSettings) { + Settings.GUCSettings->RollBack(); + } return true; default: AddError(TStringBuilder() << "TransactionStmt: kind is not supported: " << (int)value->kind); @@ -2526,7 +2530,7 @@ public: } if (schemaname == "" && Settings.GUCSettings) { auto search_path = Settings.GUCSettings->Get("search_path"); - if (!search_path || *search_path == "public") { + if (!search_path || *search_path == "public" || search_path->empty()) { return Settings.DefaultCluster; } return TString(*search_path); |