mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-26 20:44:23 +01:00
Closes #3320 Closes #3286 In addition to the problem reported in the ticket, 2 more issues were identified: 1. Renaming a column for a table with a special character in its name failed with ``` turso> CREATE TABLE `t t`(a); turso> ALTER TABLE `t t` RENAME COLUMN a TO `a a`; thread 'main' panicked at core/vdbe/execute.rs:7870:14: table being renamed should be in schema ``` 2. The renamed table in the `sql` column of `sqlite_schema` was not reflected correctly after renaming: ``` turso> select * from sqlite_schema; ┌───────┬──────┬──────────┬──────────┬──────────────────────┐ │ type │ name │ tbl_name │ rootpage │ sql │ ├───────┼──────┼──────────┼──────────┼──────────────────────┤ │ table │ t t │ t t │ 2 │ CREATE TABLE t t (a) │ └───────┴──────┴──────────┴──────────┴──────────────────────┘ ``` 3. `sql` for indexes was not reflected correctly after renaming a column that contains special characters: ``` turso> ALTER TABLE `t t` RENAME COLUMN `a a` TO `b b`; turso> SELECT sql FROM sqlite_schema; ┌───────────────────────────────────┐ │ sql │ ├───────────────────────────────────┤ │ CREATE TABLE `t t` (`b b`) │ ├───────────────────────────────────┤ │ CREATE INDEX idx ON `t t` (`a a`) │ ├───────────────────────────────────┤ ``` Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #3322
Turso Testing
Testing Extensions
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.testas 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.