Skip to content

Commit

Permalink
Fix issue 4042 (#4044)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU authored Aug 7, 2024
1 parent 7139a6a commit 8781c0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/function/list/list_contains_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ static std::unique_ptr<FunctionBindData> bindFunc(ScalarBindFuncInput input) {
scalarFunction->execFunc = ScalarFunction::BinaryExecListStructFunction<list_entry_t, T,
uint8_t, ListContains>;
});
return FunctionBindData::getSimpleBindData(input.arguments, LogicalType::BOOL());
auto& listType = input.arguments[0]->getDataType();
std::vector<LogicalType> paramTypes;
paramTypes.push_back(listType.copy());
paramTypes.push_back(ListType::getChildType(listType).copy());
return std::make_unique<FunctionBindData>(std::move(paramTypes), LogicalType::BOOL());
}

function_set ListContainsFunction::getFunctionSet() {
Expand Down
11 changes: 10 additions & 1 deletion test/test_files/function/list.test
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ ad
-LOG ListIn
-STATEMENT RETURN 1 IN [2,3,4], 2.0 IN [2,3,4], 3 IN [0,0,3]
---- 1
False|False|True
False|True|True
-STATEMENT RETURN [1+1] IN [[2], [3], [3,4,5]], "str" IN ["a", "Xiyang", "str"]
---- 1
True|True
Expand Down Expand Up @@ -2254,3 +2254,12 @@ a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11*a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12*a0eebc
-STATEMENT RETURN [[23, 432], [], [NULL]];
---- 1
[[23,432],[],[]]

-CASE listContainsCast
-STATEMENT CREATE NODE TABLE A(id SERIAL, primary key(id));
---- ok
-STATEMENT CREATE (:A), (:A);
---- ok
-STATEMENT MATCH (a:A) WHERE a.id IN [0] RETURN a.id;
---- 1
0

0 comments on commit 8781c0b

Please sign in to comment.