Commit graph

23 commits

Author SHA1 Message Date
Anton Harniakou
f20e83eea1 Run tests in memory 2025-06-09 12:45:17 +03:00
Anton Harniakou
4b97d49f75 Rewrite tests using do_execsql_test_any_error
There's some kind of a bug unrelated to the feature
implemented,
which results in test different results between sqlite3 and limbo
if do_execsql_test_on_specific_db is used to get an error message content.

For example in limbo:
```sql
do_execsql_test_on_specific_db {:memory:} not_null_primary_key {
    CREATE TABLE t2 (y INT PRIMARY KEY NOT NULL);
    INSERT INTO t2 (y) VALUES (1);
    INSERT INTO t2 (y) VALUES (NULL);
    SELECT * FROM t2;
} {"Runtime error: NOT NULL constraint failed: t2.y (19)"
1} # notice the 1
```

And in sqlite3 we get
```sql
do_execsql_test_on_specific_db {:memory:} not_null_primary_key {
    CREATE TABLE t2 (y INT PRIMARY KEY NOT NULL);
    INSERT INTO t2 (y) VALUES (1);
    INSERT INTO t2 (y) VALUES (NULL);
    SELECT * FROM t2;
} {"Runtime error: NOT NULL constraint failed: t2.y (19)"} # notice the
absense of 1
```
therefore this commit rewrites tests to use do_execsql_test_any_error
instead.
2025-06-09 12:32:22 +03:00
Anton Harniakou
8d141e5e21 Another error message fix 2025-06-06 13:06:59 +03:00
Anton Harniakou
0e4007c941 Fix contents of the NOT NULL error in tests 2025-06-06 12:59:58 +03:00
Anton Harniakou
5cd0614ac2 Test INSERT INTO with SELECT and VALUES (...), (...) syntax 2025-06-06 11:43:33 +03:00
Anton Harniakou
32b6555c5d Add tests for not null constraint 2025-06-06 10:55:49 +03:00
Pere Diaz Bou
da4190a23e Convert u64 rowid to i64
Rowids can be negative, therefore let's swap to i64
2025-05-30 13:07:31 +02:00
Jussi Saurio
d18ab34193 Fix: dont pollute testing.db in insert tests 2025-05-29 20:51:29 +03:00
krishna sindhur
4b66bcb2a7 fix: stress test will ignore unique constraint violation 2025-05-29 15:11:43 +05:30
pedrocarlo
1410e57112 correct union result_row or yield emission + test 2025-05-26 01:06:26 -03:00
pedrocarlo
ee93316c46 fix num_values detection + emitting correct column for temp_table + tests 2025-05-25 19:15:28 -03:00
pedrocarlo
90e3c8483d tests with compound select 2025-05-25 19:15:28 -03:00
pedrocarlo
c86e7542ec simple smoke tests 2025-05-25 19:13:40 -03:00
pedrocarlo
c5f004c1d6 added test and adjustments 2025-05-14 11:34:39 -03:00
Jussi Saurio
44e282f630 Add multi-row insert regression test 2025-05-13 09:03:01 +03:00
Anton Harniakou
d907f95716 Add tests for INSERT with specified column-name list 2025-05-06 11:31:41 +03:00
Ihor Andrianov
ad91a2ae51
fix tests 2025-04-07 20:29:45 +03:00
Ihor Andrianov
3a97fd075f
add tests 2025-04-07 20:02:14 +03:00
psvri
845de125db Align MustBeInt logic with sqlite 2025-01-16 00:09:45 +05:30
psvri
9cc9577c91 Run all statements from sql argument in cli 2025-01-15 18:19:39 +05:30
krishvishal
7e2928a5f1 Feature: last_insert_rowid()
- Changed `Cursor` trait to be able to get access to `root_page`
- SQLite only updates last_insert_rowid for non-schema inserts. So we check if the `InsertAwait` is not for `root_page` before
  updating rowid
2024-12-09 22:48:42 +05:30
Kim Seon Woo
9d878fda55 Remove failing test for now 2024-08-18 21:05:01 +02:00
Kim Seon Woo
c6402aa341 Add tcl 2024-08-18 21:00:36 +02:00