penberg / limbo

Limbo is a work-in-progress, in-process OLTP database management system, compatible with SQLite.
MIT License
960 stars 53 forks source link

ORDER BY: support nullable sorting columns and qualified identifiers #215

Closed jussisaurio closed 1 month ago

jussisaurio commented 1 month ago

Using qualified identifiers together with ORDER BY was not possible

> select users.first_name from users order by null;
thread 'main' panicked at core/translate/mod.rs:248:21:
not yet implemented

Using a sort column that could be both non-null and null was not possible:

> select first_name, name from users left join products on users.id = products.id order by name limit 1;
thread 'main' panicked at core/types.rs:100:33:
called `Option::unwrap()` on a `None` value
jussisaurio commented 1 month ago

Getting different result from sqlite, will have to dig in a bit

jussisaurio commented 1 month ago

I didn't remember that ORDER BY 1 literally means "order by the first result column" even though I use it a lot at work :) changed to ORDER BY NULL for this test because "no sorting" was the intention

will open separate issue about ORDER BY 1 support