Skip to content

Commit

Permalink
Fix browser server (#621)
Browse files Browse the repository at this point in the history
* fix ha

* fix list

* fix list

* fix browser submodule
  • Loading branch information
lipanpan03 authored Aug 9, 2024
1 parent aceb40d commit 154afa1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/cypher/arithmetic/arithmetic_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1353,8 +1353,13 @@ cypher::FieldData BuiltinFunction::_ToList(RTContext *ctx, const Record &record,
auto ret = cypher::FieldData::Array(0);
for (auto &arg : args) {
auto r = arg.Evaluate(ctx, record);
CYPHER_THROW_ASSERT(r.IsScalar());
ret.array->emplace_back(r.constant.scalar);
if (r.IsScalar()) {
ret.array->emplace_back(r.constant.scalar);
} else if (r.IsArray()) {
ret.array->emplace_back(*r.constant.array);
} else if (r.IsMap()) {
ret.array->emplace_back(*r.constant.map);
}
}
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cypher/cypher_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ struct FieldData {

bool IsArray() const { return type == ARRAY; }

static FieldData Array(size_t n) { return FieldData(std::vector<::lgraph::FieldData>(n)); }
static FieldData Array(size_t n) { return FieldData(std::vector<cypher::FieldData>(n)); }

bool IsMap() const { return type == MAP; }

Expand Down
2 changes: 1 addition & 1 deletion src/cypher/procedure/procedure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void BuiltinProcedure::DbUpsertVertex(RTContext *ctx, const Record *record,
std::vector<size_t> field_ids;
std::vector<lgraph_api::FieldData> fds;
bool success = true;
if (line.IsMap()) {
if (!line.IsMap()) {
THROW_CODE(InputError, "The type of the elements in the list must be map");
}
for (auto& item : *line.map) {
Expand Down

0 comments on commit 154afa1

Please sign in to comment.