-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
A comprehensive regression smoke test suite was created to serve as the source of truth for feature correctness. Running cargo test --test regression_smoke_test reveals 13 failing tests out of 42 total.
Results: 29 passed, 13 failed
Critical Issues (6)
1. Binary Expressions Not Supported in UPDATE SET
Severity: Critical
Affected Tests: update_multiple_rows, insert_on_conflict_do_update, concurrent_writes_to_different_rows
-- Fails with: "expected literal expression, got BinaryOp"
UPDATE items SET value = value * 2 WHERE category = 'A';
UPDATE counters SET counter = counter + 1 WHERE id = 1;
INSERT INTO t ... ON CONFLICT DO UPDATE SET counter = counter + 1;Location: src/database/convert.rs:342
2. Subqueries Not Supported in UPDATE SET
Severity: Critical
Affected Tests: e_commerce_order_flow
-- Fails with: "expected literal expression, got Subquery"
UPDATE orders SET total_amount = (
SELECT SUM(quantity * unit_price) FROM order_items WHERE order_id = 1
) WHERE id = 1;Location: src/database/convert.rs:342
3. CHECK Constraints Not Enforced
Severity: Critical
Affected Tests: check_constraint_violation_returns_error
CREATE TABLE products (
id INTEGER PRIMARY KEY,
price REAL CHECK (price > 0)
);
INSERT INTO products (id, price) VALUES (1, -10.00); -- Should fail, but succeeds4. ALTER TABLE DROP COLUMN Corrupts Records
Severity: Critical
Affected Tests: alter_table_drop_column
CREATE TABLE test_alter (id INTEGER PRIMARY KEY, name TEXT, age INTEGER);
INSERT INTO test_alter VALUES (1, 'Alice', 30);
ALTER TABLE test_alter DROP COLUMN age;
SELECT * FROM test_alter; -- Fails: "unknown record format: header_len=0, record_len=33"Location: src/sql/decoder.rs:180
5. DISTINCT Returns Wrong Results
Severity: Critical
Affected Tests: select_distinct
INSERT INTO items VALUES (1, 'A'), (2, 'A'), (3, 'B'), (4, 'B'), (5, 'C');
SELECT DISTINCT category FROM items;
-- Expected: 3 rows (A, B, C)
-- Actual: 1 row6. ORDER BY Returns NULL Values
Severity: Critical
Affected Tests: select_with_order_by, select_with_limit_and_offset
INSERT INTO items VALUES (1, 10), (2, 30), (3, 20);
SELECT value FROM items ORDER BY value ASC;
-- Expected: [10, 20, 30]
-- Actual: [NULL, NULL, NULL] or wrong orderMajor Issues (3)
7. HAVING Clause Doesn't Filter Results
Severity: Major
Affected Tests: select_with_group_by_and_having, blog_platform_scenario
SELECT category, COUNT(*) as cnt FROM items GROUP BY category HAVING COUNT(*) >= 2;
-- Expected: 2 rows (categories with 2+ items)
-- Actual: 3 rows (all categories returned, HAVING ignored)8. IS NOT NULL Filter Returns Wrong Count
Severity: Major
Affected Tests: null_handling
INSERT INTO test VALUES (1, 'a'), (2, NULL), (3, 'c');
SELECT COUNT(*) FROM test WHERE value IS NOT NULL;
-- Expected: 2
-- Actual: 19. Complex WHERE Clause Returns No Rows
Severity: Major
Affected Tests: delete_with_complex_where_clause
DELETE FROM items WHERE category = 'A' AND value < 25;
-- Expected: Deletes matching rows
-- Actual: Deletes 0 rows (WHERE evaluation issue)Passing Features (29 tests) ✅
| Category | Working Features |
|---|---|
| DDL | CREATE TABLE, DROP TABLE, CREATE INDEX, DROP INDEX, ALTER TABLE ADD COLUMN |
| Constraints | PRIMARY KEY, UNIQUE, NOT NULL, FOREIGN KEY (insert/delete) |
| DML | INSERT, UPDATE (single row, literal values), DELETE (simple), bulk INSERT, ON CONFLICT DO NOTHING, RETURNING |
| Query | Simple WHERE, JOIN, subquery in WHERE, aggregate functions (SUM, COUNT, AVG, etc.) |
| Transaction | BEGIN, COMMIT, ROLLBACK, SAVEPOINT |
| Concurrent | Concurrent reads |
| Edge cases | Empty table operations, AUTO_INCREMENT, TRUNCATE |
Test File Location
tests/regression_smoke_test.rs (~1445 lines)
Reproduction
cargo test --test regression_smoke_testRecommended Priority
- P0 (Blocking): Binary expressions in UPDATE SET, CHECK constraints
- P1 (High): ORDER BY, DISTINCT, HAVING, ALTER TABLE DROP COLUMN
- P2 (Medium): IS NOT NULL filter, complex WHERE clause, subqueries in UPDATE
Related Issues
- bug: Prepared statement INSERT skips constraint validation (UNIQUE, PK, FK) #12 - Prepared statement missing constraint validation (separate issue)
Labels
bug, regression, sql-compliance