The stress test originally revealed 11 distinct issues in PizzaSQL. As of January 16, 2026, all major issues have been resolved. Current stress test status: 43/46 tests passing (93.5%), with only 1 minor issue remaining (large result set performance). This document tracks each issue and its resolution status.
Latest Update (Jan 16, 2026): Fixed concurrent query race condition by adding thread-safety to analyzer scope management.
Status: ✅ RESOLVED
Error: analysis error: column not found: count
Test Case:
SELECT status, COUNT(*) as count
FROM orders
GROUP BY status
ORDER BY count DESC
Expected: Column alias count should be usable in ORDER BY clause.
Root Cause: The analyzer doesn't recognize column aliases defined in the SELECT list when validating ORDER BY expressions.
Status: ✅ RESOLVED
Error: analysis error: column not found: order_count
Test Case:
SELECT user_id, COUNT(*) as order_count
FROM orders
GROUP BY user_id
HAVING COUNT(*) > 1
ORDER BY order_count DESC
Expected: Column alias should be usable in HAVING/ORDER BY, or at minimum the query should work when using the full expression.
Root Cause: Same as Issue 1 - alias resolution not working in HAVING clause.
Status: ✅ RESOLVED
Error: analysis error: column not found: oi.product_id
Test Case:
SELECT
o.id as order_id,
u.username,
p.name as product_name,
oi.quantity,
oi.price
FROM orders o
INNER JOIN users u ON o.user_id = u.id
INNER JOIN order_items oi ON o.id = oi.order_id
INNER JOIN products p ON oi.product_id = p.id
LIMIT 20
Expected: Table aliases (o, u, oi, p) should be resolved correctly across all JOINs.
Root Cause: The analyzer loses track of table aliases when processing multiple JOINs, particularly in ON conditions.
Status: ✅ RESOLVED
Error: Cannot read properties of null (reading 'length') (test error due to null result)
Test Case:
SELECT username,
(SELECT COUNT(*) FROM orders WHERE user_id = users.id) as order_count
FROM users
WHERE id <= 5
Expected: Scalar subquery should return the count of orders for each user.
Root Cause: Correlated subqueries may not be evaluating correctly, returning null instead of a value.
Status: ✅ RESOLVED
Error: Assertion failed: Age group should be valid
Test Case:
SELECT username,
CASE
WHEN age < 25 THEN 'young'
WHEN age < 40 THEN 'middle'
ELSE 'senior'
END as age_group
FROM users
LIMIT 10
Expected: Should return 'young', 'middle', or 'senior' based on age.
Root Cause: CASE expression evaluation may be returning null or incorrect values.
Status: ✅ RESOLVED
Error: COALESCE should return 0 for null: expected 0, got null
Test Case:
SELECT username, COALESCE(age, 0) as age
FROM users
WHERE username = 'nulltest'
Expected: When age is NULL, COALESCE should return 0.
Root Cause: COALESCE function not properly returning the first non-null argument.
Status: ✅ RESOLVED
Error: Cannot read properties of null (reading 'toUpperCase')
Test Case:
SELECT
UPPER(username) as upper_name,
LOWER(email) as lower_email,
LENGTH(username) as name_len
FROM users
WHERE id = 1
Expected: UPPER should return uppercase version of the string.
Root Cause: String functions may be returning null instead of the transformed string.
Status: ✅ RESOLVED
Error: no row context for column: balance
Test Case:
UPDATE users SET balance = balance + 100 WHERE id = 2
Expected: Should increment the current balance by 100.
Root Cause: When evaluating balance + 100, the executor doesn't have access to the current row's values.
Status: ✅ RESOLVED
Error: duplicate primary key: 1 on second run
Test Case:
DROP TABLE IF EXISTS users
Expected: Should drop the table if it exists, allowing clean re-creation.
Root Cause: Either DROP TABLE IF EXISTS doesn't actually drop the table, or AUTOINCREMENT counters persist after table drop.
Status: ✅ RESOLVED
Error: index already exists: idx_users_email
Test Case:
DROP INDEX IF EXISTS idx_users_email
Expected: Should drop the index if it exists.
Root Cause: Cleanup function doesn't drop indexes, or DROP INDEX IF EXISTS doesn't work.
Status: ✅ RESOLVED
Error: Should return users with order counts: expected 10, got 100
Test Case:
SELECT u.username, COUNT(o.id) as order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
GROUP BY u.id, u.username
LIMIT 10
Expected: Should return 10 rows (due to LIMIT).
Root Cause: LIMIT may not be applied correctly after GROUP BY, or the JOIN produces unexpected results.
Based on impact and dependencies:
| Issue | Status | Resolution Date | Notes |
|---|---|---|---|
| 1 | ✅ Resolved | Jan 16, 2026 | ORDER BY with aliases working in stress test |
| 2 | ✅ Resolved | Jan 16, 2026 | HAVING clause test passing |
| 3 | ✅ Resolved | Jan 16, 2026 | Complex JOIN test passing |
| 4 | ✅ Resolved | Jan 16, 2026 | Subquery tests passing |
| 5 | ✅ Resolved | Jan 16, 2026 | CASE expression test passing |
| 6 | ✅ Resolved | Jan 16, 2026 | NULL handling test passing |
| 7 | ✅ Resolved | Jan 16, 2026 | String functions test passing |
| 8 | ✅ Resolved | Jan 16, 2026 | UPDATE test passing |
| 9 | ✅ Resolved | Jan 16, 2026 | Stress test runs cleanly multiple times |
| 10 | ✅ Resolved | Jan 16, 2026 | Index creation/deletion tests passing |
| 11 | ✅ Resolved | Jan 16, 2026 | Pagination test passing (LIMIT with GROUP BY) |
Based on the latest stress test run (43/46 passing):
Status: ✅ RESOLVED (Jan 16, 2026)
Test: Concurrent queries
Error: fatal error: concurrent map writes in analyzer/scope.go
Root Cause: Analyzer's scope management was not thread-safe. Multiple goroutines modifying shared scope maps simultaneously.
Fix Applied: Added sync.RWMutex locks to both Scope and Catalog structs. All map access operations now use appropriate read/write locks:
DefineTable(), DefineSelectAlias(): Write locks (mu.Lock)LookupTable(), LookupColumn(), GetAllColumns(), GetTables(): Read locks (mu.RLock)CreateTable(), DropTable(): Write locks on CatalogGetTable(), GetTables(), TableExists(): Read locks on CatalogVerified with go test -race - no race conditions detected.
Status: 🟡 Minor Test: Large result set Error: Connection issues with very large result sets Root Cause: Possible timeout or memory issue with large data transfers Fix Required: Investigation needed - may be timeout configuration
Status: ✅ RESOLVED Test: Transaction rollback Note: Rollback is fully implemented with undo operations for INSERT/UPDATE/DELETE. Test passing. Implementation: Transaction log tracks all operations with old data, allowing complete rollback.