Skip to content

Commit

Permalink
Fix is null executor bug (#3197)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Apr 2, 2024
1 parent a95b29e commit 0ad815e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/include/function/null/null_function_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>(pos), (bool)operand.isNull(pos), resultValues[pos]);
operand.getValue<uint8_t>(pos), (bool)operand.isNull(pos), resultValues[resultPos]);
} else {
if (operand.state->selVector->isUnfiltered()) {
for (auto i = 0u; i < operand.state->selVector->selectedSize; i++) {
Expand Down
9 changes: 8 additions & 1 deletion test/test_files/tinysnb/function/null.test
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 0ad815e

Please sign in to comment.