mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
## Description Does solve #4154, but I don't want to close it with this PR, because it does not solve the Affinity issue. We can only use an index to iterate over if the column collation in the order by clause matches the index collation <!-- Please include a summary of the changes and the related issue. --> ## Motivation and context Fix a bug in the optimizer <!-- Please include relevant motivation and context. Link relevant issues here. --> ## Description of AI Usage Used AI to write tests, fuzzers, and help me understand the optimizer code. Test prompt: <details> can you write tests in tcl that test that the correct collation sequence is properly maintained. ``` CREATE TABLE "t1" ("c1" TEXT COLLATE RTRIM); INSERT INTO "t1" VALUES (' '); CREATE INDEX "i1" ON "t1" ("c1" COLLATE RTRIM DESC); INSERT INTO "t1" VALUES (1025.1655084065987); SELECT "c1", typeof(c1) FROM "t1" ORDER BY "c1" COLLATE BINARY DESC, rowid ASC; ``` this is an example of a query that returned incorrect results because of this </details> <!-- Please disclose how AI was used to help create this PR. For example, you can share prompts, specific tools, or ways of working that you took advantage of. You can also share whether the creation of the PR was mainly driven by AI, or whether it was used for assistance. This is a good way of sharing knowledge to other contributors about how we can work more efficiently with AI tools. Note that the use of AI is encouraged, but the committer is still fully responsible for understanding and reviewing the output. --> Reviewed-by: Pere Diaz Bou <pere-altea@homail.com> Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #4248 |
||
|---|---|---|
| .. | ||
| fuzz | ||
| integration | ||
| Cargo.toml | ||
| lib.rs | ||
| README.md | ||
Integration and regression test suite.
# run all tests
cargo test
# run individual test
cargo test test_sequential_write -- --nocapture