Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210360228
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210360228
Commits
8b9cf0f5
Unverified
Commit
8b9cf0f5
authored
4 years ago
by
bright-starry-sky
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug for create tag|edge index (#296)
Co-authored-by:
dutor
<
440396+dutor@users.noreply.github.com
>
parent
8fc153c7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/planner/Maintain.h
+2
-2
2 additions, 2 deletions
src/planner/Maintain.h
src/validator/MaintainValidator.cpp
+16
-8
16 additions, 8 deletions
src/validator/MaintainValidator.cpp
src/validator/Validator.cpp
+2
-2
2 additions, 2 deletions
src/validator/Validator.cpp
with
20 additions
and
12 deletions
src/planner/Maintain.h
+
2
−
2
View file @
8b9cf0f5
...
...
@@ -434,7 +434,7 @@ private:
std
::
vector
<
std
::
string
>
fields
,
bool
ifNotExists
)
:
CreateIndexNode
(
id
,
input
,
Kind
::
kCreate
Edge
,
Kind
::
kCreate
TagIndex
,
std
::
move
(
tagName
),
std
::
move
(
indexName
),
std
::
move
(
fields
),
...
...
@@ -464,7 +464,7 @@ private:
std
::
vector
<
std
::
string
>
fields
,
bool
ifNotExists
)
:
CreateIndexNode
(
id
,
input
,
Kind
::
kCreateEdge
,
Kind
::
kCreateEdge
Index
,
std
::
move
(
edgeName
),
std
::
move
(
indexName
),
std
::
move
(
fields
),
...
...
This diff is collapsed.
Click to expand it.
src/validator/MaintainValidator.cpp
+
16
−
8
View file @
8b9cf0f5
...
...
@@ -321,10 +321,14 @@ Status CreateTagIndexValidator::validateImpl() {
auto
status
=
Status
::
OK
();
do
{
auto
schema
=
vctx_
->
getSchema
(
name_
);
if
(
schema
==
nullptr
)
{
status
=
Status
::
Error
(
"Tag %s not exist"
,
name_
.
c_str
());
break
;
auto
tagStatus
=
qctx_
->
schemaMng
()
->
toTagID
(
space_
.
id
,
name_
);
if
(
!
tagStatus
.
ok
())
{
return
tagStatus
.
status
();
}
auto
schema_
=
qctx_
->
schemaMng
()
->
getTagSchema
(
space_
.
id
,
tagStatus
.
value
());
if
(
schema_
==
nullptr
)
{
return
Status
::
Error
(
"No schema found for '%s'"
,
name_
.
c_str
());
}
status
=
IndexUtil
::
validateColumns
(
fields_
);
...
...
@@ -359,10 +363,14 @@ Status CreateEdgeIndexValidator::validateImpl() {
auto
status
=
Status
::
OK
();
do
{
auto
schema
=
vctx_
->
getSchema
(
name_
);
if
(
schema
==
nullptr
)
{
status
=
Status
::
Error
(
"Edge %s not exist"
,
name_
.
c_str
());
break
;
auto
edgeStatus
=
qctx_
->
schemaMng
()
->
toEdgeType
(
space_
.
id
,
name_
);
if
(
!
edgeStatus
.
ok
())
{
return
edgeStatus
.
status
();
}
auto
schema_
=
qctx_
->
schemaMng
()
->
getEdgeSchema
(
space_
.
id
,
edgeStatus
.
value
());
if
(
schema_
==
nullptr
)
{
return
Status
::
Error
(
"No schema found for '%s'"
,
name_
.
c_str
());
}
status
=
IndexUtil
::
validateColumns
(
fields_
);
...
...
This diff is collapsed.
Click to expand it.
src/validator/Validator.cpp
+
2
−
2
View file @
8b9cf0f5
...
...
@@ -164,8 +164,6 @@ std::unique_ptr<Validator> Validator::makeValidator(Sentence* sentence, QueryCon
return
std
::
make_unique
<
ShowConfigsValidator
>
(
sentence
,
context
);
case
Sentence
::
Kind
::
kFindPath
:
return
std
::
make_unique
<
FindPathValidator
>
(
sentence
,
context
);
case
Sentence
::
Kind
::
kMatch
:
case
Sentence
::
Kind
::
kUnknown
:
case
Sentence
::
Kind
::
kCreateTagIndex
:
return
std
::
make_unique
<
CreateTagIndexValidator
>
(
sentence
,
context
);
case
Sentence
::
Kind
::
kShowCreateTagIndex
:
...
...
@@ -190,6 +188,8 @@ std::unique_ptr<Validator> Validator::makeValidator(Sentence* sentence, QueryCon
return
std
::
make_unique
<
RebuildEdgeIndexValidator
>
(
sentence
,
context
);
case
Sentence
::
Kind
::
kDropEdgeIndex
:
return
std
::
make_unique
<
DropEdgeIndexValidator
>
(
sentence
,
context
);
case
Sentence
::
Kind
::
kMatch
:
case
Sentence
::
Kind
::
kUnknown
:
case
Sentence
::
Kind
::
kLookup
:
case
Sentence
::
Kind
::
kDownload
:
case
Sentence
::
Kind
::
kIngest
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment