From ab6a9397929fb3ad127e7d6d8a642540d39f65eb Mon Sep 17 00:00:00 2001 From: tongheihei <47058798+tongheihei@users.noreply.github.com> Date: Wed, 23 Jun 2021 15:41:17 +0800 Subject: [PATCH] Fix the bug create space on group (#1149) * fix create space on group * fix bug create space on group * fix the bug create space on group v2 * fix the bug create space on group v3 --- src/parser/AdminSentences.h | 8 ++++---- src/validator/AdminValidator.cpp | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/parser/AdminSentences.h b/src/parser/AdminSentences.h index 5273c5387..606d7564c 100644 --- a/src/parser/AdminSentences.h +++ b/src/parser/AdminSentences.h @@ -325,6 +325,10 @@ class CreateSpaceSentence final : public CreateSentence { return spaceName_.get(); } + const std::string* groupName() const { + return groupName_.get(); + } + void setOpts(SpaceOptList* spaceOpts) { spaceOpts_.reset(spaceOpts); } @@ -333,10 +337,6 @@ class CreateSpaceSentence final : public CreateSentence { groupName_.reset(name); } - const std::string* groupName() const { - return groupName_.get(); - } - const SpaceOptList* spaceOpts() const { return spaceOpts_.get(); } diff --git a/src/validator/AdminValidator.cpp b/src/validator/AdminValidator.cpp index 76b34287b..ee4b77d38 100644 --- a/src/validator/AdminValidator.cpp +++ b/src/validator/AdminValidator.cpp @@ -24,6 +24,9 @@ Status CreateSpaceValidator::validateImpl() { ifNotExist_ = sentence->isIfNotExist(); auto status = Status::OK(); spaceDesc_.set_space_name(std::move(*(sentence->spaceName()))); + if (sentence->groupName()) { + spaceDesc_.set_group_name(std::move(*(sentence->groupName()))); + } StatusOr retStatusOr; std::string result; auto* charsetInfo = qctx_->getCharsetInfo();