diff --git a/src/function/list/list_contains_function.cpp b/src/function/list/list_contains_function.cpp index bbfc5d496a1..f96008933b0 100644 --- a/src/function/list/list_contains_function.cpp +++ b/src/function/list/list_contains_function.cpp @@ -26,7 +26,11 @@ static std::unique_ptr bindFunc(ScalarBindFuncInput input) { scalarFunction->execFunc = ScalarFunction::BinaryExecListStructFunction; }); - return FunctionBindData::getSimpleBindData(input.arguments, LogicalType::BOOL()); + auto& listType = input.arguments[0]->getDataType(); + std::vector paramTypes; + paramTypes.push_back(listType.copy()); + paramTypes.push_back(ListType::getChildType(listType).copy()); + return std::make_unique(std::move(paramTypes), LogicalType::BOOL()); } function_set ListContainsFunction::getFunctionSet() { diff --git a/test/test_files/function/list.test b/test/test_files/function/list.test index 3f8ba6d8420..cddc2a7eb8d 100644 --- a/test/test_files/function/list.test +++ b/test/test_files/function/list.test @@ -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 @@ -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