Fixes the following problems with COLLATE:
- Fix: incorrectly used e.g. `x COLLATE NOCASE = 'fOo'` as index
constraint on an index whose column was not case-insensitively collated
- Fix: various ephemeral indexes (in GROUP BY, ORDER BY, DISTINCT) and
subqueries did not retain proper collation information of columns
- Fix: collation of a given expression was not determined properly
according to SQLite's rules
Adds TCL tests and fuzz test
Closes#3476Closes#1524Closes#3305
Reviewed-by: Preston Thorpe <preston@turso.tech>
Closes#3538
When adding tests for extensions, please follow these guidelines:
Tests that verify the internal logic or behavior of a particular extension should go into cli_tests/extensions.py.
Tests that verify how extensions interact with the database engine, such as virtual table handling, should be written
in TCL (see vtab.test as an example).
To check which extensions are available in TCL, or to add a new one, refer to the tester.tcl file and look at the extension_map.