Skip to content

Commit caa9023

Browse files
committed
MDEV-19331 Merge new release of InnoDB 5.6.44 to 10.1
2 parents bb17094 + 1cd31bc commit caa9023

File tree

16 files changed

+188
-23
lines changed

16 files changed

+188
-23
lines changed

mysql-test/r/partition_innodb.result

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,3 +918,45 @@ ERROR HY000: CHECK OPTION failed 'test.v'
918918
SET GLOBAL innodb_stats_persistent= @save_isp;
919919
DROP view v;
920920
DROP TABLE t;
921+
#
922+
# Bug#28573894 ALTER PARTITIONED TABLE ADD AUTO_INCREMENT DIFF RESULT
923+
#
924+
CREATE TABLE t (a VARCHAR(10) NOT NULL,b INT,PRIMARY KEY (b)) ENGINE=INNODB
925+
PARTITION BY RANGE (b)
926+
(PARTITION pa VALUES LESS THAN (2),
927+
PARTITION pb VALUES LESS THAN (20),
928+
PARTITION pc VALUES LESS THAN (30),
929+
PARTITION pd VALUES LESS THAN (40));
930+
INSERT INTO t
931+
VALUES('A',0),('B',1),('C',2),('D',3),('E',4),('F',5),('G',25),('H',35);
932+
CREATE TABLE t_copy LIKE t;
933+
INSERT INTO t_copy SELECT * FROM t;
934+
ALTER TABLE t ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT,
935+
ADD UNIQUE KEY (r,b);
936+
affected rows: 0
937+
info: Records: 0 Duplicates: 0 Warnings: 0
938+
ALTER TABLE t_copy ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT,
939+
ADD UNIQUE KEY (r,b), ALGORITHM=COPY;
940+
affected rows: 8
941+
info: Records: 8 Duplicates: 0 Warnings: 0
942+
SELECT * FROM t;
943+
a b r
944+
A 0 1
945+
B 1 2
946+
C 2 3
947+
D 3 4
948+
E 4 5
949+
F 5 6
950+
G 25 7
951+
H 35 8
952+
SELECT * FROM t_copy;
953+
a b r
954+
A 0 1
955+
B 1 2
956+
C 2 3
957+
D 3 4
958+
E 4 5
959+
F 5 6
960+
G 25 7
961+
H 35 8
962+
DROP TABLE t,t_copy;

mysql-test/suite/innodb/r/innodb-index.result

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,3 +1213,30 @@ test.t1 check status OK
12131213
DROP TABLE t1;
12141214
SET GLOBAL innodb_file_format=@save_format;
12151215
SET GLOBAL innodb_large_prefix=@save_prefix;
1216+
#
1217+
# Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH
1218+
# IN I_S TABLES
1219+
#
1220+
CREATE TABLE t1(a INT, b INT) ENGINE=INNODB, STATS_PERSISTENT=1;
1221+
SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D,
1222+
cast(INDEX_LENGTH/@@innodb_page_size as int) I
1223+
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
1224+
D I
1225+
1 0
1226+
ALTER TABLE t1 ADD INDEX (a);
1227+
affected rows: 0
1228+
info: Records: 0 Duplicates: 0 Warnings: 0
1229+
SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D,
1230+
cast(INDEX_LENGTH/@@innodb_page_size as int) I
1231+
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
1232+
D I
1233+
1 1
1234+
ALTER TABLE t1 ADD INDEX (b);
1235+
affected rows: 0
1236+
info: Records: 0 Duplicates: 0 Warnings: 0
1237+
SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D,
1238+
cast(INDEX_LENGTH/@@innodb_page_size as int) I
1239+
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
1240+
D I
1241+
1 2
1242+
DROP TABLE t1;

mysql-test/suite/innodb/t/innodb-index.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,3 +593,23 @@ CHECK TABLE t1;
593593
DROP TABLE t1;
594594
SET GLOBAL innodb_file_format=@save_format;
595595
SET GLOBAL innodb_large_prefix=@save_prefix;
596+
597+
--echo #
598+
--echo # Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH
599+
--echo # IN I_S TABLES
600+
--echo #
601+
let $i_s_query=SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D,
602+
cast(INDEX_LENGTH/@@innodb_page_size as int) I
603+
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
604+
605+
CREATE TABLE t1(a INT, b INT) ENGINE=INNODB, STATS_PERSISTENT=1;
606+
eval $i_s_query;
607+
--enable_info
608+
ALTER TABLE t1 ADD INDEX (a);
609+
--disable_info
610+
eval $i_s_query;
611+
--enable_info
612+
ALTER TABLE t1 ADD INDEX (b);
613+
--disable_info
614+
eval $i_s_query;
615+
DROP TABLE t1;

mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@
12141214
COMMAND_LINE_ARGUMENT OPTIONAL
12151215
VARIABLE_NAME INNODB_VERSION
12161216
SESSION_VALUE NULL
1217-
-GLOBAL_VALUE 5.6.43
1217+
-GLOBAL_VALUE 5.6.44
12181218
+GLOBAL_VALUE 5.6.43-84.3
12191219
GLOBAL_VALUE_ORIGIN COMPILE-TIME
12201220
DEFAULT_VALUE NULL

mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@
684684
COMMAND_LINE_ARGUMENT OPTIONAL
685685
VARIABLE_NAME INNODB_VERSION
686686
SESSION_VALUE NULL
687-
-GLOBAL_VALUE 5.6.43
687+
-GLOBAL_VALUE 5.6.44
688688
+GLOBAL_VALUE 5.6.43-84.3
689689
GLOBAL_VALUE_ORIGIN COMPILE-TIME
690690
DEFAULT_VALUE NULL

mysql-test/suite/sys_vars/r/sysvars_innodb.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,7 @@ READ_ONLY NO
24012401
COMMAND_LINE_ARGUMENT OPTIONAL
24022402
VARIABLE_NAME INNODB_VERSION
24032403
SESSION_VALUE NULL
2404-
GLOBAL_VALUE 5.6.43
2404+
GLOBAL_VALUE 5.6.44
24052405
GLOBAL_VALUE_ORIGIN COMPILE-TIME
24062406
DEFAULT_VALUE NULL
24072407
VARIABLE_SCOPE GLOBAL

mysql-test/t/partition_innodb.test

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,3 +1028,27 @@ SET GLOBAL innodb_stats_persistent= @save_isp;
10281028
DROP view v;
10291029
DROP TABLE t;
10301030

1031+
--echo #
1032+
--echo # Bug#28573894 ALTER PARTITIONED TABLE ADD AUTO_INCREMENT DIFF RESULT
1033+
--echo #
1034+
CREATE TABLE t (a VARCHAR(10) NOT NULL,b INT,PRIMARY KEY (b)) ENGINE=INNODB
1035+
PARTITION BY RANGE (b)
1036+
(PARTITION pa VALUES LESS THAN (2),
1037+
PARTITION pb VALUES LESS THAN (20),
1038+
PARTITION pc VALUES LESS THAN (30),
1039+
PARTITION pd VALUES LESS THAN (40));
1040+
1041+
INSERT INTO t
1042+
VALUES('A',0),('B',1),('C',2),('D',3),('E',4),('F',5),('G',25),('H',35);
1043+
CREATE TABLE t_copy LIKE t;
1044+
INSERT INTO t_copy SELECT * FROM t;
1045+
1046+
--enable_info
1047+
ALTER TABLE t ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT,
1048+
ADD UNIQUE KEY (r,b);
1049+
ALTER TABLE t_copy ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT,
1050+
ADD UNIQUE KEY (r,b), ALGORITHM=COPY;
1051+
--disable_info
1052+
SELECT * FROM t;
1053+
SELECT * FROM t_copy;
1054+
DROP TABLE t,t_copy;

sql/ha_partition.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
3-
Copyright (c) 2009, 2017, MariaDB
2+
Copyright (c) 2005, 2019, Oracle and/or its affiliates.
3+
Copyright (c) 2009, 2019, MariaDB
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License as published by
@@ -8329,7 +8329,12 @@ bool ha_partition::inplace_alter_table(TABLE *altered_table,
83298329

83308330
for (index= 0; index < m_tot_parts && !error; index++)
83318331
{
8332-
ha_alter_info->handler_ctx= part_inplace_ctx->handler_ctx_array[index];
8332+
if ((ha_alter_info->handler_ctx=
8333+
part_inplace_ctx->handler_ctx_array[index]) != NULL
8334+
&& index != 0)
8335+
ha_alter_info->handler_ctx->set_shared_data
8336+
(*part_inplace_ctx->handler_ctx_array[index - 1]);
8337+
83338338
if (m_file[index]->ha_inplace_alter_table(altered_table,
83348339
ha_alter_info))
83358340
error= true;

sql/handler.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef HANDLER_INCLUDED
22
#define HANDLER_INCLUDED
33
/*
4-
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
5-
Copyright (c) 2009, 2018, MariaDB
4+
Copyright (c) 2000, 2019, Oracle and/or its affiliates.
5+
Copyright (c) 2009, 2019, MariaDB
66
77
This program is free software; you can redistribute it and/or
88
modify it under the terms of the GNU General Public License
@@ -1833,6 +1833,7 @@ class inplace_alter_handler_ctx : public Sql_alloc
18331833
inplace_alter_handler_ctx() {}
18341834

18351835
virtual ~inplace_alter_handler_ctx() {}
1836+
virtual void set_shared_data(const inplace_alter_handler_ctx& ctx) {}
18361837
};
18371838

18381839

storage/innobase/dict/dict0stats.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2009, 2016, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2009, 2019, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2015, 2017, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
@@ -2499,7 +2499,6 @@ dict_stats_report_error(
24992499
return (err);
25002500
}
25012501

2502-
25032502
/** Save the table's statistics into the persistent statistics storage.
25042503
@param[in] table_orig table whose stats to save
25052504
@param[in] only_for_index if this is non-NULL, then stats for indexes
@@ -3208,6 +3207,8 @@ dict_stats_update_for_index(
32083207
if (dict_stats_persistent_storage_check(false)) {
32093208
dict_table_stats_lock(index->table, RW_X_LATCH);
32103209
dict_stats_analyze_index(index);
3210+
index->table->stat_sum_of_other_index_sizes
3211+
+= index->stat_index_size;
32113212
dict_table_stats_unlock(index->table, RW_X_LATCH);
32123213
dict_stats_save(index->table, &index->id);
32133214
DBUG_VOID_RETURN;

0 commit comments

Comments
 (0)