Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tests/integration_tests/debezium_basic/data/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -118,22 +118,28 @@ create table tp_time
c_timestamp timestamp null,
c_time time null,
c_year year null,
c_varchar varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
constraint pk
primary key (id)
);

insert into tp_time()
values ();

insert into tp_time(c_date, c_datetime, c_timestamp, c_time, c_year)
values ('2020-02-20', '2020-02-20 02:20:20', '2020-02-20 02:20:20', '02:20:20', '2020');
insert into tp_time(c_date, c_datetime, c_timestamp, c_time, c_year, c_varchar)
values ('2020-02-20', '2020-02-20 02:20:20', '2020-02-20 02:20:20', '02:20:20', '2020','2020');

insert into tp_time(c_date, c_datetime, c_timestamp, c_time, c_year)
values ('2022-02-22', '2022-02-22 22:22:22', '2020-02-20 02:20:20', '02:20:20', '2021');
insert into tp_time(c_date, c_datetime, c_timestamp, c_time, c_year, c_varchar)
values ('2022-02-22', '2022-02-22 22:22:22', '2020-02-20 02:20:20', '02:20:20', '2021', '2021');

update tp_time set c_year = '2022' where c_year = '2020';
update tp_time set c_date = '2022-02-22' where c_datetime = '2020-02-20 02:20:20';

alter table tp_time add column c_newcol datetime default null;

insert into tp_time()
values ();
Comment on lines +138 to +141

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To ensure thorough test coverage for the newly added column c_newcol after the ALTER TABLE statement, consider inserting a row with a non-null value for c_newcol. Currently, the test only inserts a row with default values (where c_newcol is NULL), which does not verify if non-null values in the newly added column are correctly replicated and decoded under the Debezium protocol.

alter table tp_time add column c_newcol datetime default null;

insert into tp_time(c_date, c_datetime, c_timestamp, c_time, c_year, c_varchar, c_newcol)
values ('2022-02-22', '2022-02-22 22:22:22', '2020-02-20 02:20:20', '02:20:20', '2021', '2021', '2022-02-22 22:22:22');

insert into tp_time()
values ();


-- text
create table tp_text
(
Expand Down
Loading