#
# bug1025059: Non-unique sequence name error during alter
#
---
- CreateTable: parent (id INT NOT NULL PRIMARY KEY)
---
- CreateTable: first_child (id INT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, parent_id INT);
---
- CreateTable: second_child (id INT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, parent_id INT);
---
- Statement: ALTER GROUP ADD TABLE first_child (parent_id) TO parent;
---
- Statement: ALTER GROUP ADD TABLE second_child (parent_id) TO parent;

...

#
# bug1025059: Non-unique sequence name error during alter
#
---
- CreateTable: parent (id INT NOT NULL PRIMARY KEY)
---
- CreateTable: first_child (id INT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, parent_id INT)
---
- CreateTable: second_child (id INT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, parent_id INT)

# Original bug didn't have data, but no reason not to test it
---
- Statement: INSERT INTO first_child(parent_id) VALUES (1),(2),(10),(15)
---
- Statement: INSERT INTO parent VALUES (1),(10)
---
- Statement: INSERT INTO second_child(parent_id) VALUES (1),(1),(15),(15)
---
- Statement: SELECT * FROM parent
- output: [[1], [10]]
---
- Statement: SELECT * FROM first_child
- output: [[1,1], [2,2], [3,10], [4,15]]
---
- Statement: SELECT * FROM second_child
- output: [[1,1], [2,1], [3,15], [4,15]]

# Bug got unexpected error on second ALTER
---
- Statement: ALTER GROUP ADD TABLE first_child (parent_id) TO parent;
---
- Statement: ALTER GROUP ADD TABLE second_child (parent_id) TO parent;

# Double check all data
---
- Statement: SELECT * FROM parent
- output: [[1], [10]]
---
- Statement: SELECT * FROM first_child
- output: [[1,1], [2,2], [3,10], [4,15]]
---
- Statement: SELECT * FROM second_child
- output: [[1,1], [2,1], [3,15], [4,15]]

...

Enhance test with data and validation
Enhance test with data and validation