File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
testing/runner/turso-tests Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -3082,6 +3082,10 @@ pub fn op_row_id(
30823082 . get_mut ( * cursor_id)
30833083 . expect ( "cursor_id should be valid" )
30843084 {
3085+ if btree_cursor. get_null_flag ( ) {
3086+ state. registers [ * dest] = Register :: Value ( Value :: Null ) ;
3087+ break ;
3088+ }
30853089 if let Some ( ref rowid) = return_if_io ! ( btree_cursor. rowid( ) ) {
30863090 state. registers [ * dest] . set_int ( * rowid) ;
30873091 } else {
Original file line number Diff line number Diff line change 1+ # Regression test for MVCC LEFT JOIN NullRow bug.
2+ # MvccLazyCursor::rowid() was not checking null_flag, so after NullRow
3+ # it returned the stale rowid of the last seeked row instead of NULL.
4+
5+ @database :memory:
6+
7+ test mvcc-left-join-null-row {
8+ CREATE TABLE t1(x INTEGER PRIMARY KEY);
9+ CREATE TABLE t2(x INTEGER PRIMARY KEY, v TEXT);
10+ INSERT INTO t1 VALUES (1);
11+ INSERT INTO t2 VALUES (1, 'hello');
12+ SELECT t1.x, t2.x FROM t1 LEFT JOIN t2 ON t1.x = t2.x AND t2.v = 'nonexistent';
13+ }
14+ expect {
15+ 1|
16+ }
You can’t perform that action at this time.
0 commit comments