Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ordering issue with nested list type #11937

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/row_operations/row_radix_scatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void RadixScatterListVector(Vector &v, UnifiedVectorFormat &vdata, const Selecti
key_locations[i][0] = 1;
key_locations[i]++;
RowOperations::RadixScatter(child_vector, list_size, *FlatVector::IncrementalSelectionVector(), 1,
key_locations + i, false, true, false, prefix_len, width - 1,
key_locations + i, false, true, false, prefix_len, width - 2,
list_entry.offset);
} else {
// denote that the list is empty with a 0
Expand Down
21 changes: 21 additions & 0 deletions test/sql/order/issue_11936.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# name: test/sql/order/issue_11936.test
# description: Test order nested list
# group: [order]

statement ok
PRAGMA enable_verification

statement ok
CREATE TABLE test(col1 INT, col2 INT2[][][][][][]);

statement ok
INSERT INTO test VALUES(1000000000, null), (1000000001, [[[[[[]]]]]]), (null, [[[[[[]]]]]]), (null, [[[[[[]]]]]]), (1, [[[[[[]]]]]]);

query II
SELECT col1, col2 FROM test ORDER BY col1 NULLS LAST, col2;
----
1 [[[[[[]]]]]]
1000000000 NULL
1000000001 [[[[[[]]]]]]
NULL [[[[[[]]]]]]
NULL [[[[[[]]]]]]