Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikeW committed Oct 9, 2024
1 parent 6a30c9c commit 1215b9a
Showing 1 changed file with 78 additions and 50 deletions.
128 changes: 78 additions & 50 deletions e2e_test/source/cdc_inline/auto_schema_change_pg.slt
Original file line number Diff line number Diff line change
Expand Up @@ -35,89 +35,117 @@ 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


# 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;

0 comments on commit 1215b9a

Please sign in to comment.