Files
ast-project/part1/results/3/bug_9f1cbf2e-9623-4405-a77a-5b1470fb4cde_logic.md
2026-06-24 13:47:14 +02:00

60 lines
1.4 KiB
Markdown

## Summary
<!--Explain briefly what goes wrong and explain why you believe this is a bug and not the intended behavior of SQLite (if it is not a crash).-->**No review yet**
## Minimized query
```sql
CREATE TABLE [T] (
A VARCHAR(20),
B VARCHAR(10),
C INTEGER,
PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p', -2147483648);
INSERT INTO T VALUES ('b', 'q', 100);
INSERT INTO T VALUES ('b', 'r', 200);
INSERT INTO T VALUES ('c', 's', 300);
INSERT INTO T VALUES ('d', 't', 2147483647);
INSERT INTO T VALUES ('b', 't', 50);
SELECT A, COUNT(*) AS D, SUM(C) AS E FROM T GROUP BY A HAVING COUNT(*) > 1;
INSERT INTO T DEFAULT VALUES;
INSERT INTO T DEFAULT VALUES;
WITH n AS NOT MATERIALIZED (SELECT * FROM T) SELECT * FROM n WHERE C > 0;
ALTER TABLE T RENAME TO T_r4652;
```
## Actual output
```sql
SQLite version 3.39.0 2022-05-10 23:28:12
Enter ".help" for usage hints.
sqlite> ...> ...> ...> ...> ...> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> b|3|350
sqlite> sqlite> sqlite> b|q|100
b|r|200
c|s|300
d|t|2147483647
b|t|50
sqlite> sqlite>
```
## Expectation
```sql
SQLite version 3.51.1 2025-11-28 17:28:25
Enter ".help" for usage hints.
sqlite> (x1...> (x1...> (x1...> (x1...> (x1...> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> sqlite> b|3|350
sqlite> sqlite> sqlite> b|q|100
b|r|200
c|s|300
d|t|2147483647
b|t|50
sqlite> sqlite>
```
## Flag
```
-interactive
```