From 1215b9a6874dee3325be69d59f688ad996bc759f Mon Sep 17 00:00:00 2001 From: StrikeW Date: Wed, 9 Oct 2024 16:23:24 +0800 Subject: [PATCH] update --- .../cdc_inline/auto_schema_change_pg.slt | 128 +++++++++++------- 1 file changed, 78 insertions(+), 50 deletions(-) diff --git a/e2e_test/source/cdc_inline/auto_schema_change_pg.slt b/e2e_test/source/cdc_inline/auto_schema_change_pg.slt index c4315ca843c4c..54292f0aebdca 100644 --- a/e2e_test/source/cdc_inline/auto_schema_change_pg.slt +++ b/e2e_test/source/cdc_inline/auto_schema_change_pg.slt @@ -35,64 +35,94 @@ create source pg_source with ( ); statement ok -create table test_default (*) from pg_source table 'public.test_default'; +create table rw_test_default (*) from pg_source table 'public.test_default'; -sleep 3s - -statement ok -insert into test_default(id) values (4),(5); -statement ok -FLUSH; +# Name, Type, Is Hidden, Description +query TTTT +describe rw_test_default; +---- +id integer false NULL +name character varying false NULL +age integer false NULL +v1 real false NULL +v2 double precision false NULL +v3 numeric false NULL +v4 boolean false NULL +v5 date false NULL +v6 time without time zone false NULL +v7 timestamp without time zone false NULL +v8 timestamp with time zone false NULL +v9 interval false NULL +v10 jsonb false NULL +primary key id NULL NULL +distribution key id NULL NULL +table description rw_test_default NULL NULL + +sleep 2s query TTTTTTTTTTTTT -SELECT * from test_default order by id; +SELECT * from rw_test_default order by id; ---- 1 name1 20 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} 2 name2 21 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} 3 name3 22 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} -4 default_name 18 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} -5 default_name 18 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} +sleep 3s system ok psql -c " + BEGIN; ALTER TABLE test_default ADD COLUMN v11 varchar DEFAULT 'hello'; ALTER TABLE test_default ADD COLUMN v12 decimal DEFAULT '1.2345'; - INSER INTO test_default (id,name,age) values (11,'aaa', 11); + COMMIT; + INSERT INTO test_default (id,name,age) values (11,'aaa', 11); " sleep 3s - # Name, Type, Is Hidden, Description query TTTT -describe test_default; +describe rw_test_default; +---- +id integer false NULL +name character varying false NULL +age integer false NULL +v1 real false NULL +v2 double precision false NULL +v3 numeric false NULL +v4 boolean false NULL +v5 date false NULL +v6 time without time zone false NULL +v7 timestamp without time zone false NULL +v8 timestamp with time zone false NULL +v9 interval false NULL +v10 jsonb false NULL +v11 character varying false NULL +v12 numeric false NULL +primary key id NULL NULL +distribution key id NULL NULL +table description rw_test_default NULL NULL + + +query TTTTTTTTTTTTTTT +SELECT * from rw_test_default order by id; ---- - id integer false NULL - name character varying false NULL - age integer false NULL - v1 real false NULL - v2 double precision false NULL - v3 numeric false NULL - v4 boolean false NULL - v5 date false NULL - v6 time without time zone false NULL - v7 timestamp without time zone false NULL - v8 timestamp with time zone false NULL - v9 interval false NULL - v10 jsonb false NULL - v11 character varying false NULL - primary key id NULL NULL - distribution key id NULL NULL - table description test_default NULL NULL +1 name1 20 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} +2 name2 21 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} +3 name3 22 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} +11 aaa 11 1.1 2.2 3.3 f 2020-01-01 12:34:56 2020-01-01 12:34:56 2020-01-01 12:34:56+00:00 1 day {} hello 1.2345 system ok psql -c " ALTER TABLE test_default DROP COLUMN v1; ALTER TABLE test_default DROP COLUMN v2; - INSER INTO test_default (id,name,age) values (12,'bbb', 12); +" + +system ok +psql -c " + INSERT INTO test_default (id,name,age) values (12,'bbb', 12); " sleep 3s @@ -100,24 +130,22 @@ sleep 3s # Name, Type, Is Hidden, Description query TTTT -describe test_default; +describe rw_test_default; ---- - id integer false NULL - name character varying false NULL - age integer false NULL - v3 numeric false NULL - v4 boolean false NULL - v5 date false NULL - v6 time without time zone false NULL - v7 timestamp without time zone false NULL - v8 timestamp with time zone false NULL - v9 interval false NULL - v10 jsonb false NULL - v11 character varying false NULL - primary key id NULL NULL - distribution key id NULL NULL - table description test_default NULL NULL +id integer false NULL +name character varying false NULL +age integer false NULL +v3 numeric false NULL +v4 boolean false NULL +v5 date false NULL +v6 time without time zone false NULL +v7 timestamp without time zone false NULL +v8 timestamp with time zone false NULL +v9 interval false NULL +v10 jsonb false NULL +v11 character varying false NULL +v12 numeric false NULL +primary key id NULL NULL +distribution key id NULL NULL +table description rw_test_default NULL NULL - -statement ok -drop source pg_source cascade;