minor refactor on src/test/modules/test_ddl_deparse/sql/alter_table.sql

Started by jian heover 1 year ago3 messageshackers
Jump to latest
#1jian he
jian.universality@gmail.com

hi.

in src/test/modules/test_ddl_deparse/sql/alter_table.sql:
----------------------------
ALTER TABLE parent ADD CONSTRAINT a_pos CHECK (a > 0);
CREATE TABLE part (
a int
) PARTITION BY RANGE (a);

CREATE TABLE part1 PARTITION OF part FOR VALUES FROM (1) to (100);
CREATE TABLE part2 (a int);
ALTER TABLE part ATTACH PARTITION part2 FOR VALUES FROM (101) to (200);
ALTER TABLE part DETACH PARTITION part2;
DROP TABLE part2;
ALTER TABLE part ADD PRIMARY KEY (a);
ALTER TABLE parent ALTER COLUMN a SET NOT NULL;

----
The test initially focuses on the "parent" table, then switches to the "part"
table, and goes back to the "parent" table.
This seems weird? so I slightly adjusted the order to cover the "parent"
table first, followed by the "part" table.

src/test/modules/test_ddl_deparse/sql/alter_table.sql
don't have ALTER TABLE ALTER COLUMN SET EXPRESSION,
so I added a test on it.

Attachments:

v1-0001-refactor-test_ddl_deparse-sql-alter_table.sql.patchtext/x-patch; charset=US-ASCII; name=v1-0001-refactor-test_ddl_deparse-sql-alter_table.sql.patchDownload+36-33
#2Chao Li
li.evan.chao@gmail.com
In reply to: jian he (#1)
Re: minor refactor on src/test/modules/test_ddl_deparse/sql/alter_table.sql

On Aug 25, 2025, at 08:00, jian he <jian.universality@gmail.com> wrote:

hi.

in src/test/modules/test_ddl_deparse/sql/alter_table.sql:

----
The test initially focuses on the "parent" table, then switches to the "part"
table, and goes back to the "parent" table.
This seems weird? so I slightly adjusted the order to cover the "parent"
table first, followed by the "part" table.

I think this change makes the test more organized.

src/test/modules/test_ddl_deparse/sql/alter_table.sql
don't have ALTER TABLE ALTER COLUMN SET EXPRESSION,
so I added a test on it.
<v1-0001-refactor-test_ddl_deparse-sql-alter_table.sql.patch>

I confirm “make check” passed with this patch.

--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

#3Heikki Linnakangas
hlinnaka@iki.fi
In reply to: Chao Li (#2)
Re: minor refactor on src/test/modules/test_ddl_deparse/sql/alter_table.sql

On 25/08/2025 04:05, Chao Li wrote:

On Aug 25, 2025, at 08:00, jian he <jian.universality@gmail.com> wrote:
in src/test/modules/test_ddl_deparse/sql/alter_table.sql:

----
The test initially focuses on the "parent" table, then switches to the
"part"
table, and goes back to the "parent" table.
This seems weird?  so I slightly adjusted the order to cover the "parent"
table first, followed by the "part" table.

I think this change makes the test more organized.

Agreed, it looks a bit weird.

src/test/modules/test_ddl_deparse/sql/alter_table.sql
don't have ALTER TABLE ALTER COLUMN SET EXPRESSION,
so I added a test on it.
<v1-0001-refactor-test_ddl_deparse-sql-alter_table.sql.patch>

I confirm “make check” passed with this patch.

Committed, thanks!

- Heikki