summaryrefslogtreecommitdiff
path: root/mysql-test/main/alter_table.test
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2020-05-15 17:13:35 +0300
committerAleksey Midenkov <midenok@gmail.com>2020-05-15 17:13:35 +0300
commitf2a944516ea8fd3de1d79d46da5aa1c8a32cd78d (patch)
treea58d318446f4ac7fc199e53efa7e0029023cc3c6 /mysql-test/main/alter_table.test
parent3b251e24b6c8fe81bc5eeca086d9c1e57e6739d2 (diff)
parenta4996f951d731322acc63033646d950ddbb0f60c (diff)
downloadmariadb-git-f2a944516ea8fd3de1d79d46da5aa1c8a32cd78d.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'mysql-test/main/alter_table.test')
-rw-r--r--mysql-test/main/alter_table.test42
1 files changed, 38 insertions, 4 deletions
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 01ab0f99d45..8b794fcfc3e 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -2078,6 +2078,44 @@ drop view v1;
--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;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
+
+--echo #
--echo # MDEV-16290 ALTER TABLE ... RENAME COLUMN syntax
--echo #
SET @save_default_engine= @@DEFAULT_STORAGE_ENGINE;
@@ -2458,10 +2496,6 @@ order by k, c;
drop table t1;
--echo #
---echo # End of 10.5 tests
---echo #
-
---echo #
--echo # ALTER TABLE IF EXISTS
--echo #