mirror of
https://github.com/MariaDB/server.git
synced 2025-12-07 17:42:39 +03:00
Merge 10.4 into 10.5
This commit is contained in:
@@ -6,11 +6,11 @@ SET debug_sync= "ib_open_after_dict_open SIGNAL delete_open WAIT_FOR another_ope
|
||||
DELETE FROM t1;
|
||||
connection default;
|
||||
SET debug_sync= "now WAIT_FOR delete_open";
|
||||
SET debug_sync= "ib_open_after_dict_open SIGNAL another_open";
|
||||
SELECT a FROM t1;
|
||||
a
|
||||
NULL
|
||||
NULL
|
||||
SET debug_sync= "now SIGNAL another_open";
|
||||
connection con1;
|
||||
disconnect con1;
|
||||
connection default;
|
||||
|
||||
@@ -269,3 +269,17 @@ ALTER TABLE t1 ADD COLUMN (b INT, c INT, d INT, e INT NOT NULL DEFAULT 0);
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX(e);
|
||||
ALTER TABLE t1 DROP b, DROP c, DROP d, DROP e;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-20565 Assertion on CHANGE COLUMN...SYSTEM VERSIONING
|
||||
#
|
||||
set @@system_versioning_alter_history = keep;
|
||||
CREATE TABLE t (a INT WITHOUT SYSTEM VERSIONING, b INT) ENGINE=InnoDB
|
||||
WITH SYSTEM VERSIONING;
|
||||
ALTER TABLE t CHANGE COLUMN a alpha INT WITH SYSTEM VERSIONING,
|
||||
ALGORITHM=INSTANT;
|
||||
DROP TABLE t;
|
||||
CREATE TABLE t (alpha INT, b INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
|
||||
ALTER TABLE t CHANGE COLUMN alpha a INT WITHOUT SYSTEM VERSIONING,
|
||||
ALGORITHM=INSTANT;
|
||||
DROP TABLE t;
|
||||
set @@system_versioning_alter_history = error;
|
||||
|
||||
@@ -112,7 +112,7 @@ count(*)
|
||||
drop table t1;
|
||||
drop procedure populate_t1;
|
||||
create temporary table t1 (t1_i int, t1_f float) engine = innodb;
|
||||
insert into t1 values (1, 1.1), (2, 2.2), (3, 2.2), (4, 4.4);
|
||||
insert into t1 values (1, 1.1), (2, 2.5), (3, 2.5), (4, 4.4);
|
||||
explain select * from t1 where t1_i = 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
|
||||
@@ -124,22 +124,22 @@ select * from t1 where t1_i = 1;
|
||||
t1_i t1_f
|
||||
1 1.1
|
||||
alter table t1 add unique index sec_index(t1_f);
|
||||
ERROR 23000: Duplicate entry '2.2' for key 'sec_index'
|
||||
ERROR 23000: Duplicate entry '2.5' for key 'sec_index'
|
||||
alter table t1 add index sec_index(t1_f);
|
||||
explain select * from t1 where t1_f > 2.2;
|
||||
explain select * from t1 where t1_f >= 2.5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL sec_index NULL NULL NULL 4 Using where
|
||||
select * from t1 where t1_f > 2.2;
|
||||
select * from t1 where t1_f >= 2.5;
|
||||
t1_i t1_f
|
||||
2 2.2
|
||||
3 2.2
|
||||
2 2.5
|
||||
3 2.5
|
||||
4 4.4
|
||||
alter table t1 add column (t1_c char(10));
|
||||
select * from t1;
|
||||
t1_i t1_f t1_c
|
||||
1 1.1 NULL
|
||||
2 2.2 NULL
|
||||
3 2.2 NULL
|
||||
2 2.5 NULL
|
||||
3 2.5 NULL
|
||||
4 4.4 NULL
|
||||
insert into t1 values (5, 5.5, 'krunal');
|
||||
alter table t1 drop column t1_f;
|
||||
@@ -150,7 +150,7 @@ t1 CREATE TEMPORARY TABLE `t1` (
|
||||
`t1_c` char(10) DEFAULT NULL,
|
||||
UNIQUE KEY `pri_index` (`t1_i`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
select * from t1 where t1_f > 2.2;
|
||||
select * from t1 where t1_f >= 2.5;
|
||||
ERROR 42S22: Unknown column 't1_f' in 'where clause'
|
||||
alter table t1 add index sec_index2(t1_c), algorithm=inplace;
|
||||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
|
||||
|
||||
@@ -15,8 +15,8 @@ SET debug_sync= "ib_open_after_dict_open SIGNAL delete_open WAIT_FOR another_ope
|
||||
DELETE FROM t1;
|
||||
--connection default
|
||||
SET debug_sync= "now WAIT_FOR delete_open";
|
||||
SET debug_sync= "ib_open_after_dict_open SIGNAL another_open";
|
||||
SELECT a FROM t1;
|
||||
SET debug_sync= "now SIGNAL another_open";
|
||||
--connection con1
|
||||
--reap
|
||||
|
||||
|
||||
@@ -277,3 +277,19 @@ ALTER TABLE t1 ADD COLUMN (b INT, c INT, d INT, e INT NOT NULL DEFAULT 0);
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX(e);
|
||||
ALTER TABLE t1 DROP b, DROP c, DROP d, DROP e;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-20565 Assertion on CHANGE COLUMN...SYSTEM VERSIONING
|
||||
--echo #
|
||||
set @@system_versioning_alter_history = keep;
|
||||
CREATE TABLE t (a INT WITHOUT SYSTEM VERSIONING, b INT) ENGINE=InnoDB
|
||||
WITH SYSTEM VERSIONING;
|
||||
ALTER TABLE t CHANGE COLUMN a alpha INT WITH SYSTEM VERSIONING,
|
||||
ALGORITHM=INSTANT;
|
||||
DROP TABLE t;
|
||||
|
||||
CREATE TABLE t (alpha INT, b INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
|
||||
ALTER TABLE t CHANGE COLUMN alpha a INT WITHOUT SYSTEM VERSIONING,
|
||||
ALGORITHM=INSTANT;
|
||||
DROP TABLE t;
|
||||
set @@system_versioning_alter_history = error;
|
||||
|
||||
@@ -100,7 +100,7 @@ drop procedure populate_t1;
|
||||
# 3. Alter of temp-table.
|
||||
#
|
||||
create temporary table t1 (t1_i int, t1_f float) engine = innodb;
|
||||
insert into t1 values (1, 1.1), (2, 2.2), (3, 2.2), (4, 4.4);
|
||||
insert into t1 values (1, 1.1), (2, 2.5), (3, 2.5), (4, 4.4);
|
||||
#
|
||||
explain select * from t1 where t1_i = 1;
|
||||
alter table t1 add unique index pri_index(t1_i);
|
||||
@@ -110,8 +110,8 @@ select * from t1 where t1_i = 1;
|
||||
--error ER_DUP_ENTRY
|
||||
alter table t1 add unique index sec_index(t1_f);
|
||||
alter table t1 add index sec_index(t1_f);
|
||||
explain select * from t1 where t1_f > 2.2;
|
||||
select * from t1 where t1_f > 2.2;
|
||||
explain select * from t1 where t1_f >= 2.5;
|
||||
select * from t1 where t1_f >= 2.5;
|
||||
#
|
||||
alter table t1 add column (t1_c char(10));
|
||||
select * from t1;
|
||||
@@ -120,7 +120,7 @@ insert into t1 values (5, 5.5, 'krunal');
|
||||
alter table t1 drop column t1_f;
|
||||
show create table t1;
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
select * from t1 where t1_f > 2.2;
|
||||
select * from t1 where t1_f >= 2.5;
|
||||
#
|
||||
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
||||
alter table t1 add index sec_index2(t1_c), algorithm=inplace;
|
||||
|
||||
Reference in New Issue
Block a user