From ddb9ea4f4caacb882c2b6f172cb88f43172f3ea3 Mon Sep 17 00:00:00 2001 From: "lionel.liu@vesoft.com" <52276794+liuyu85cn@users.noreply.github.com> Date: Fri, 26 Nov 2021 09:55:12 +0800 Subject: [PATCH] [fix] can't show edge after clone space (#3351) * fix a bug may stuck * update * create space as can't show edge * add tck test case * do fmt tck test --- src/meta/processors/parts/CreateSpaceAsProcessor.cpp | 2 +- tests/tck/features/schema/CreateSpaceAs.feature | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/meta/processors/parts/CreateSpaceAsProcessor.cpp b/src/meta/processors/parts/CreateSpaceAsProcessor.cpp index 1341868dfd3..f6b27138b82 100644 --- a/src/meta/processors/parts/CreateSpaceAsProcessor.cpp +++ b/src/meta/processors/parts/CreateSpaceAsProcessor.cpp @@ -182,7 +182,7 @@ ErrorOr> CreateSpaceAsProcesso auto edgeType = MetaKeyUtils::parseEdgeType(iter->key()); auto edgeNameLen = *reinterpret_cast(val.data()); auto edgeName = val.subpiece(sizeof(int32_t), edgeNameLen).str(); - data.emplace_back(MetaKeyUtils::indexTagKey(newSpaceId, edgeName), + data.emplace_back(MetaKeyUtils::indexEdgeKey(newSpaceId, edgeName), std::string(reinterpret_cast(&edgeType), sizeof(edgeType))); auto ver = MetaKeyUtils::parseEdgeVersion(iter->key()); diff --git a/tests/tck/features/schema/CreateSpaceAs.feature b/tests/tck/features/schema/CreateSpaceAs.feature index 9398dd86bc7..f5042a3833e 100644 --- a/tests/tck/features/schema/CreateSpaceAs.feature +++ b/tests/tck/features/schema/CreateSpaceAs.feature @@ -91,6 +91,13 @@ Feature: Create space as another space Then the result should be, in any order: | Name | | "e1" | + When executing query: + """ + show create edge e1; + """ + Then the result should be, in any order: + | Edge | Create Edge | + | "e1" | 'CREATE EDGE `e1` (\n `col1` int64 NULL\n) ttl_duration = 0, ttl_col = ""' | When executing query: """ show tag indexes;