diff options
author | shumkovnd <shumkovnd@yandex-team.com> | 2023-08-25 20:30:39 +0300 |
---|---|---|
committer | shumkovnd <shumkovnd@yandex-team.com> | 2023-08-25 20:45:50 +0300 |
commit | f7392103ce7d08a8456a099117cc0b6d31a331e2 (patch) | |
tree | 0dd52e0b0e40424c001577c99541188742877ecc | |
parent | d783799fa58045a0040dfaf20cc7a8cc39036ba8 (diff) | |
download | ydb-f7392103ce7d08a8456a099117cc0b6d31a331e2.tar.gz |
KIKIMR-17960: Allow to create temp tables only by ddl
-rw-r--r-- | ydb/core/kqp/host/kqp_gateway_proxy.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ydb/core/kqp/host/kqp_gateway_proxy.cpp b/ydb/core/kqp/host/kqp_gateway_proxy.cpp index b1ede689f45..962c82ea2ff 100644 --- a/ydb/core/kqp/host/kqp_gateway_proxy.cpp +++ b/ydb/core/kqp/host/kqp_gateway_proxy.cpp @@ -432,7 +432,8 @@ public: auto sessionCtx = SessionCtx; auto profilesFuture = Gateway->GetTableProfiles(); auto tablePromise = NewPromise<TGenericResult>(); - profilesFuture.Subscribe([gateway, sessionCtx, metadata, tablePromise, pathPair, isPrepare] + auto temporary = metadata->Temporary; + profilesFuture.Subscribe([gateway, sessionCtx, metadata, tablePromise, pathPair, isPrepare, temporary] (const TFuture<IKqpGateway::TKqpTableProfilesResult>& future) mutable { auto profilesResult = future.GetValue(); if (!profilesResult.Success()) { @@ -512,6 +513,14 @@ public: result.SetSuccess(); tablePromise.SetValue(result); } else { + if (temporary) { + auto code = Ydb::StatusIds::BAD_REQUEST; + auto error = TStringBuilder() << "Not allowed to create temp table"; + IKqpGateway::TGenericResult errResult; + errResult.AddIssue(NYql::TIssue(error)); + errResult.SetStatus(NYql::YqlStatusFromYdbStatus(code)); + tablePromise.SetValue(errResult); + } gateway->ModifyScheme(std::move(schemeTx)).Subscribe([tablePromise, warnings] (const TFuture<TGenericResult>& future) mutable { auto result = future.GetValue(); |