mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
## Description <!-- Please include a summary of the changes and the related issue. --> This PR fixes https://github.com/tursodatabase/turso/issues/4197 by collapsing `+` and `-` operators in unary expressions. ## Motivation and context <!-- Please include relevant motivation and context. Link relevant issues here. --> By collapsing `+` and `-` operators in unary expressions, we're able to prevent stack overflow in very long unary expressions. The following queries can be used to test this change: ```sql select +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++123; select - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -123; select +++++++++++++++++++++++++++++++++++++++++++++++++++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+123; ``` All of the queries above crashes with a stack overflow error prior to this fix. ## Description of AI Usage No AI was used in this PR. <!-- 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: Mikaël Francoeur (@LeMikaelF) Closes #4273 |
||
|---|---|---|
| .. | ||
| cli_tests | ||
| javascript | ||
| sqlancer | ||
| sqlite3 | ||
| sqlite_test_ext | ||
| test_files | ||
| unreliable-libc | ||
| wal | ||
| affinity.test | ||
| agg-functions.test | ||
| all-mvcc.test | ||
| all.test | ||
| alter_column.test | ||
| alter_table.test | ||
| analyze.test | ||
| attach.test | ||
| autoincr.test | ||
| boolean.test | ||
| changes.test | ||
| cmdlineshell.test | ||
| coalesce.test | ||
| collate.test | ||
| compare.test | ||
| concat.test | ||
| create_index.test | ||
| create_table.test | ||
| default_value.test | ||
| delete.test | ||
| drop_index.test | ||
| drop_table.test | ||
| foreign_keys.test | ||
| gen-bigass-database.py | ||
| gen-database.py | ||
| glob.test | ||
| groupby.test | ||
| insert.test | ||
| integrity_check.test | ||
| join.test | ||
| json.test | ||
| like.test | ||
| literal.test | ||
| materialized_views.test | ||
| math.test | ||
| null.test | ||
| offset.test | ||
| orderby.test | ||
| partial_idx.test | ||
| pragma.test | ||
| pyproject.toml | ||
| README.md | ||
| returning.test | ||
| rollback.test | ||
| scalar-functions-datetime.test | ||
| scalar-functions-printf.test | ||
| scalar-functions.test | ||
| select.test | ||
| subquery.test | ||
| tester.tcl | ||
| testing.db | ||
| testing_norowidalias.db | ||
| testing_small.db | ||
| testing_user_version_10.db | ||
| time.test | ||
| total-changes.test | ||
| transactions.test | ||
| trigger.test | ||
| update.test | ||
| upsert.test | ||
| values.test | ||
| vector.test | ||
| views.test | ||
| vtab.test | ||
| where.test | ||
| window.test | ||
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.