diff --git a/src/include/function/null/null_function_executor.h b/src/include/function/null/null_function_executor.h index 008ed41c2f..37f87a5449 100644 --- a/src/include/function/null/null_function_executor.h +++ b/src/include/function/null/null_function_executor.h @@ -13,8 +13,9 @@ struct NullOperationExecutor { auto resultValues = (uint8_t*)result.getData(); if (operand.state->isFlat()) { auto pos = operand.state->selVector->selectedPositions[0]; + auto resultPos = result.state->selVector->selectedPositions[0]; FUNC::operation( - operand.getValue(pos), (bool)operand.isNull(pos), resultValues[pos]); + operand.getValue(pos), (bool)operand.isNull(pos), resultValues[resultPos]); } else { if (operand.state->selVector->isUnfiltered()) { for (auto i = 0u; i < operand.state->selVector->selectedSize; i++) { diff --git a/test/test_files/tinysnb/function/null.test b/test/test_files/tinysnb/function/null.test index 28e7068c1f..8f68b4fcd8 100644 --- a/test/test_files/tinysnb/function/null.test +++ b/test/test_files/tinysnb/function/null.test @@ -1,9 +1,16 @@ -GROUP TinySnbReadTest --DATASET CSV EMPTY +-DATASET CSV tinysnb -- -CASE NullTest + +-STATEMENT MATCH (a)-[:knows]->(b:person) WHERE a.ID = 2 RETURN a.ID, a.name, a.name IS NULL; +---- 3 +2||True +2||True +2||True + -STATEMENT RETURN NULL IS NULL ---- 1 True