diff options
Diffstat (limited to 'mysql-test/main/alter_table.test')
-rw-r--r-- | mysql-test/main/alter_table.test | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test index 36146195b67..ce461b2fe46 100644 --- a/mysql-test/main/alter_table.test +++ b/mysql-test/main/alter_table.test @@ -2090,3 +2090,47 @@ drop view v1; --echo # --echo # End of 10.3 tests --echo # + +--echo # +--echo # MDEV-22563 Segfault on duplicate free of Item_func_in::array +--echo # +create or replace table person_principal ( + person_id bigint not null, + insurant_id varchar(10) not null, + principal_id bigint not null, + principal_officer_id bigint not null, + nursing_degree tinyint null, + nursing_degree_valid_from date not null default cast(current_timestamp(6) as date), + carma_user_id bigint not null, + current_date_time timestamp(6) not null default current_timestamp(6) on update current_timestamp(6), + constraint pk_person_principal primary key (person_id asc), + constraint ck_person_principal_nursing_degree check (nursing_degree in (1,2,3,4,5))); + +create or replace table person_principal_hist ( + person_id bigint not null, + insurant_id varchar(10) not null, + principal_id bigint not null, + principal_officer_id bigint not null, + nursing_degree tinyint null, + nursing_degree_valid_from date not null default cast(now() as date), + carma_user_id bigint not null, + orig_date_time datetime(6) not null, + constraint pk_person_principal_hist primary key (person_id asc, orig_date_time asc), + constraint ck_person_principal_hist_nursing_degree check (nursing_degree in (1,2,3,4,5))); + +insert into person_principal (person_id, insurant_id, principal_id, principal_officer_id, nursing_degree, nursing_degree_valid_from, carma_user_id) +values (1, 'A123456789', 5, 1, 1, '2018-05-06', 1); +alter table person_principal add column if not exists date_mask tinyint null; +update person_principal set date_mask = 0; +alter table person_principal modify column date_mask tinyint not null; +drop tables person_principal_hist, person_principal; + +# +# The following ALTER TABLE caused crash in 10.4.13 (Reported on freenode) +# + +CREATE OR REPLACE TABLE `t1` ( `id` varchar(64) NOT NULL, `name` varchar(255) NOT NULL, `extra` text DEFAULT NULL, `password` varchar(128) DEFAULT NULL, `enabled` tinyint(1) DEFAULT NULL, `domain_id` varchar(64) NOT NULL, `default_project_id` varchar(64) DEFAULT NULL, PRIMARY KEY (`id`), CONSTRAINT `CONSTRAINT_1` CHECK (`enabled` in (0,1)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +insert into t1 (id,name,enabled,domain_id) values (1,"Monty",1,"domain_id"); +insert into t1 (id,name,enabled,domain_id) values (2,"Monty2",1,"domain_id2"); +ALTER TABLE t1 ADD CONSTRAINT ixu_user2_name_domain_id UNIQUE (domain_id, name); +DROP TABLE t1; |