From e52f807c7df55d186657efc6fa58a8a75d8b48ed Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Tue, 26 Aug 2025 09:08:48 +0300 Subject: [PATCH] Fix: return NULL for rowid() when cursor's null flag is on Fixes TPC-H query 13 from returning an incorrect result. In this specific case, we were returning non-null `IdxRowid` values for the right-hand side table even when there was no match with the left-hand side table, meaning the join produced matches even in cases where there shouldn't have been any. Closes #2794 --- core/storage/btree.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/storage/btree.rs b/core/storage/btree.rs index b2c36a560..58be7a5e4 100644 --- a/core/storage/btree.rs +++ b/core/storage/btree.rs @@ -4320,6 +4320,9 @@ impl BTreeCursor { return Ok(IOResult::Done(None)); } } + if self.get_null_flag() { + return Ok(IOResult::Done(None)); + } if self.has_record.get() { let page = self.stack.top(); let page = page.get();