From 4b1a2a2766fe3cc25635a5d960621eee0fee2d28 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 7 Sep 2022 02:15:12 +0200 Subject: [PATCH 1/6] Add test that should fail --- localtests/enum-modified/create.sql | 26 ++++++++++++++++++++++++++ localtests/enum-modified/extra_args | 1 + 2 files changed, 27 insertions(+) create mode 100644 localtests/enum-modified/create.sql create mode 100644 localtests/enum-modified/extra_args diff --git a/localtests/enum-modified/create.sql b/localtests/enum-modified/create.sql new file mode 100644 index 000000000..0dbab17ed --- /dev/null +++ b/localtests/enum-modified/create.sql @@ -0,0 +1,26 @@ +drop table if exists gh_ost_test; +create table gh_ost_test ( + id int auto_increment, + i int not null, + e enum('red', 'green', 'blue', 'orange') null default null collate 'utf8_bin', + primary key(id) +) auto_increment=1; + +insert into gh_ost_test values (null, 7, 'red'); + +drop event if exists gh_ost_test; +delimiter ;; +create event gh_ost_test + on schedule every 1 second + starts current_timestamp + ends current_timestamp + interval 60 second + on completion not preserve + enable + do +begin + insert into gh_ost_test values (null, 11, 'red'); + insert into gh_ost_test values (null, 13, 'green'); + insert into gh_ost_test values (null, 17, 'blue'); + set @last_insert_id := last_insert_id(); + update gh_ost_test set e='orange' where id = @last_insert_id; +end ;; diff --git a/localtests/enum-modified/extra_args b/localtests/enum-modified/extra_args new file mode 100644 index 000000000..14436d965 --- /dev/null +++ b/localtests/enum-modified/extra_args @@ -0,0 +1 @@ +--alter="modify column e enum('brown', 'green', 'blue', 'orange') default null" From d4be7db424d1a85a36a0097201ab57814fe32d7b Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 7 Sep 2022 02:29:19 +0200 Subject: [PATCH 2/6] modify last value --- localtests/enum-modified/extra_args | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localtests/enum-modified/extra_args b/localtests/enum-modified/extra_args index 14436d965..37923cf89 100644 --- a/localtests/enum-modified/extra_args +++ b/localtests/enum-modified/extra_args @@ -1 +1 @@ ---alter="modify column e enum('brown', 'green', 'blue', 'orange') default null" +--alter="modify column e enum('red', 'green', 'blue', 'purple') default null" From 3d28b809f533d2443b43daeacd73a85af77e9260 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 7 Sep 2022 02:35:29 +0200 Subject: [PATCH 3/6] Not null --- localtests/enum-modified/create.sql | 2 +- localtests/enum-modified/extra_args | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/localtests/enum-modified/create.sql b/localtests/enum-modified/create.sql index 0dbab17ed..94ff43629 100644 --- a/localtests/enum-modified/create.sql +++ b/localtests/enum-modified/create.sql @@ -2,7 +2,7 @@ drop table if exists gh_ost_test; create table gh_ost_test ( id int auto_increment, i int not null, - e enum('red', 'green', 'blue', 'orange') null default null collate 'utf8_bin', + e enum('red', 'green', 'blue', 'orange') not null, primary key(id) ) auto_increment=1; diff --git a/localtests/enum-modified/extra_args b/localtests/enum-modified/extra_args index 37923cf89..3ecd6b50e 100644 --- a/localtests/enum-modified/extra_args +++ b/localtests/enum-modified/extra_args @@ -1 +1 @@ ---alter="modify column e enum('red', 'green', 'blue', 'purple') default null" +--alter="modify column e enum('red', 'green', 'blue', 'purple') not null" From d3dd6f1156e67316cd71f8db271cbfad4449eecb Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 7 Sep 2022 02:42:31 +0200 Subject: [PATCH 4/6] No binlog events --- localtests/enum-modified/create.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/localtests/enum-modified/create.sql b/localtests/enum-modified/create.sql index 94ff43629..d6a3f2d94 100644 --- a/localtests/enum-modified/create.sql +++ b/localtests/enum-modified/create.sql @@ -8,6 +8,7 @@ create table gh_ost_test ( insert into gh_ost_test values (null, 7, 'red'); +/* drop event if exists gh_ost_test; delimiter ;; create event gh_ost_test @@ -24,3 +25,4 @@ begin set @last_insert_id := last_insert_id(); update gh_ost_test set e='orange' where id = @last_insert_id; end ;; +*/ From 0141c2e265eb70c69ea508137231937c73ab0ef8 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 7 Sep 2022 02:52:27 +0200 Subject: [PATCH 5/6] Update scenario --- localtests/enum-modified/create.sql | 8 +++++--- localtests/enum-modified/extra_args | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/localtests/enum-modified/create.sql b/localtests/enum-modified/create.sql index d6a3f2d94..dd4b5d9bb 100644 --- a/localtests/enum-modified/create.sql +++ b/localtests/enum-modified/create.sql @@ -2,11 +2,13 @@ drop table if exists gh_ost_test; create table gh_ost_test ( id int auto_increment, i int not null, - e enum('red', 'green', 'blue', 'orange') not null, + result enum('Pass', 'Fail') not null, primary key(id) -) auto_increment=1; +) auto_increment=1 default charset=latin1; -insert into gh_ost_test values (null, 7, 'red'); +insert into gh_ost_test values (1, 7, 'Pass'); +insert into gh_ost_test values (2, 8, 'Fail'); +insert into gh_ost_test values (3, 19, 'Pass'); /* drop event if exists gh_ost_test; diff --git a/localtests/enum-modified/extra_args b/localtests/enum-modified/extra_args index 3ecd6b50e..305fc5aa6 100644 --- a/localtests/enum-modified/extra_args +++ b/localtests/enum-modified/extra_args @@ -1 +1 @@ ---alter="modify column e enum('red', 'green', 'blue', 'purple') not null" +--alter="modify column result enum('Pass', 'MostExcellent') not null" From b42a0a758949f12c8223f64b55b2775d01809ea3 Mon Sep 17 00:00:00 2001 From: Tim Vaillancourt Date: Wed, 7 Sep 2022 02:59:51 +0200 Subject: [PATCH 6/6] Re-enable event --- localtests/enum-modified/create.sql | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/localtests/enum-modified/create.sql b/localtests/enum-modified/create.sql index dd4b5d9bb..3c5582d68 100644 --- a/localtests/enum-modified/create.sql +++ b/localtests/enum-modified/create.sql @@ -10,7 +10,6 @@ insert into gh_ost_test values (1, 7, 'Pass'); insert into gh_ost_test values (2, 8, 'Fail'); insert into gh_ost_test values (3, 19, 'Pass'); -/* drop event if exists gh_ost_test; delimiter ;; create event gh_ost_test @@ -21,10 +20,6 @@ create event gh_ost_test enable do begin - insert into gh_ost_test values (null, 11, 'red'); - insert into gh_ost_test values (null, 13, 'green'); - insert into gh_ost_test values (null, 17, 'blue'); - set @last_insert_id := last_insert_id(); - update gh_ost_test set e='orange' where id = @last_insert_id; + insert into gh_ost_test (i, result) values(12345, 0); + insert into gh_ost_test (i, result) values(12345, 1); end ;; -*/