Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
caa9023c
Commit
caa9023c
authored
Apr 25, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
MDEV-19331 Merge new release of InnoDB 5.6.44 to 10.1
parents
bb17094b
1cd31bc1
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
188 additions
and
23 deletions
+188
-23
mysql-test/r/partition_innodb.result
mysql-test/r/partition_innodb.result
+42
-0
mysql-test/suite/innodb/r/innodb-index.result
mysql-test/suite/innodb/r/innodb-index.result
+27
-0
mysql-test/suite/innodb/t/innodb-index.test
mysql-test/suite/innodb/t/innodb-index.test
+20
-0
mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
...l-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
+1
-1
mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
+1
-1
mysql-test/suite/sys_vars/r/sysvars_innodb.result
mysql-test/suite/sys_vars/r/sysvars_innodb.result
+1
-1
mysql-test/t/partition_innodb.test
mysql-test/t/partition_innodb.test
+24
-0
sql/ha_partition.cc
sql/ha_partition.cc
+8
-3
sql/handler.h
sql/handler.h
+3
-2
storage/innobase/dict/dict0stats.cc
storage/innobase/dict/dict0stats.cc
+3
-2
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+19
-2
storage/innobase/include/handler0alter.h
storage/innobase/include/handler0alter.h
+8
-3
storage/innobase/include/univ.i
storage/innobase/include/univ.i
+1
-1
storage/xtradb/dict/dict0stats.cc
storage/xtradb/dict/dict0stats.cc
+3
-2
storage/xtradb/handler/handler0alter.cc
storage/xtradb/handler/handler0alter.cc
+19
-2
storage/xtradb/include/handler0alter.h
storage/xtradb/include/handler0alter.h
+8
-3
No files found.
mysql-test/r/partition_innodb.result
View file @
caa9023c
...
...
@@ -918,3 +918,45 @@ ERROR HY000: CHECK OPTION failed 'test.v'
SET GLOBAL innodb_stats_persistent= @save_isp;
DROP view v;
DROP TABLE t;
#
# Bug#28573894 ALTER PARTITIONED TABLE ADD AUTO_INCREMENT DIFF RESULT
#
CREATE TABLE t (a VARCHAR(10) NOT NULL,b INT,PRIMARY KEY (b)) ENGINE=INNODB
PARTITION BY RANGE (b)
(PARTITION pa VALUES LESS THAN (2),
PARTITION pb VALUES LESS THAN (20),
PARTITION pc VALUES LESS THAN (30),
PARTITION pd VALUES LESS THAN (40));
INSERT INTO t
VALUES('A',0),('B',1),('C',2),('D',3),('E',4),('F',5),('G',25),('H',35);
CREATE TABLE t_copy LIKE t;
INSERT INTO t_copy SELECT * FROM t;
ALTER TABLE t ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD UNIQUE KEY (r,b);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t_copy ADD COLUMN r INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD UNIQUE KEY (r,b), ALGORITHM=COPY;
affected rows: 8
info: Records: 8 Duplicates: 0 Warnings: 0
SELECT * FROM t;
a b r
A 0 1
B 1 2
C 2 3
D 3 4
E 4 5
F 5 6
G 25 7
H 35 8
SELECT * FROM t_copy;
a b r
A 0 1
B 1 2
C 2 3
D 3 4
E 4 5
F 5 6
G 25 7
H 35 8
DROP TABLE t,t_copy;
mysql-test/suite/innodb/r/innodb-index.result
View file @
caa9023c
...
...
@@ -1213,3 +1213,30 @@ test.t1 check status OK
DROP TABLE t1;
SET GLOBAL innodb_file_format=@save_format;
SET GLOBAL innodb_large_prefix=@save_prefix;
#
# Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH
# IN I_S TABLES
#
CREATE TABLE t1(a INT, b INT) ENGINE=INNODB, STATS_PERSISTENT=1;
SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D,
cast(INDEX_LENGTH/@@innodb_page_size as int) I
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
D I
1 0
ALTER TABLE t1 ADD INDEX (a);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D,
cast(INDEX_LENGTH/@@innodb_page_size as int) I
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
D I
1 1
ALTER TABLE t1 ADD INDEX (b);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D,
cast(INDEX_LENGTH/@@innodb_page_size as int) I
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test';
D I
1 2
DROP TABLE t1;
mysql-test/suite/innodb/t/innodb-index.test
View file @
caa9023c
...
...
@@ -593,3 +593,23 @@ CHECK TABLE t1;
DROP
TABLE
t1
;
SET
GLOBAL
innodb_file_format
=@
save_format
;
SET
GLOBAL
innodb_large_prefix
=@
save_prefix
;
--
echo
#
--
echo
# Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH
--
echo
# IN I_S TABLES
--
echo
#
let
$i_s_query
=
SELECT
cast
(
DATA_LENGTH
/@@
innodb_page_size
as
int
)
D
,
cast
(
INDEX_LENGTH
/@@
innodb_page_size
as
int
)
I
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_SCHEMA
=
'test'
;
CREATE
TABLE
t1
(
a
INT
,
b
INT
)
ENGINE
=
INNODB
,
STATS_PERSISTENT
=
1
;
eval
$i_s_query
;
--
enable_info
ALTER
TABLE
t1
ADD
INDEX
(
a
);
--
disable_info
eval
$i_s_query
;
--
enable_info
ALTER
TABLE
t1
ADD
INDEX
(
b
);
--
disable_info
eval
$i_s_query
;
DROP
TABLE
t1
;
mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
View file @
caa9023c
...
...
@@ -1214,7 +1214,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
-GLOBAL_VALUE 5.6.4
3
-GLOBAL_VALUE 5.6.4
4
+GLOBAL_VALUE 5.6.43-84.3
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
...
...
mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
View file @
caa9023c
...
...
@@ -684,7 +684,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
-GLOBAL_VALUE 5.6.4
3
-GLOBAL_VALUE 5.6.4
4
+GLOBAL_VALUE 5.6.43-84.3
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
...
...
mysql-test/suite/sys_vars/r/sysvars_innodb.result
View file @
caa9023c
...
...
@@ -2401,7 +2401,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
GLOBAL_VALUE 5.6.4
3
GLOBAL_VALUE 5.6.4
4
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
...
...
mysql-test/t/partition_innodb.test
View file @
caa9023c
...
...
@@ -1028,3 +1028,27 @@ SET GLOBAL innodb_stats_persistent= @save_isp;
DROP
view
v
;
DROP
TABLE
t
;
--
echo
#
--
echo
# Bug#28573894 ALTER PARTITIONED TABLE ADD AUTO_INCREMENT DIFF RESULT
--
echo
#
CREATE
TABLE
t
(
a
VARCHAR
(
10
)
NOT
NULL
,
b
INT
,
PRIMARY
KEY
(
b
))
ENGINE
=
INNODB
PARTITION
BY
RANGE
(
b
)
(
PARTITION
pa
VALUES
LESS
THAN
(
2
),
PARTITION
pb
VALUES
LESS
THAN
(
20
),
PARTITION
pc
VALUES
LESS
THAN
(
30
),
PARTITION
pd
VALUES
LESS
THAN
(
40
));
INSERT
INTO
t
VALUES
(
'A'
,
0
),(
'B'
,
1
),(
'C'
,
2
),(
'D'
,
3
),(
'E'
,
4
),(
'F'
,
5
),(
'G'
,
25
),(
'H'
,
35
);
CREATE
TABLE
t_copy
LIKE
t
;
INSERT
INTO
t_copy
SELECT
*
FROM
t
;
--
enable_info
ALTER
TABLE
t
ADD
COLUMN
r
INT
UNSIGNED
NOT
NULL
AUTO_INCREMENT
,
ADD
UNIQUE
KEY
(
r
,
b
);
ALTER
TABLE
t_copy
ADD
COLUMN
r
INT
UNSIGNED
NOT
NULL
AUTO_INCREMENT
,
ADD
UNIQUE
KEY
(
r
,
b
),
ALGORITHM
=
COPY
;
--
disable_info
SELECT
*
FROM
t
;
SELECT
*
FROM
t_copy
;
DROP
TABLE
t
,
t_copy
;
sql/ha_partition.cc
View file @
caa9023c
/*
Copyright (c) 2005, 201
7
, Oracle and/or its affiliates.
Copyright (c) 2009, 201
7
, MariaDB
Copyright (c) 2005, 201
9
, Oracle and/or its affiliates.
Copyright (c) 2009, 201
9
, MariaDB
This program is free software; you can redistribute it and/or modify
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,
for
(
index
=
0
;
index
<
m_tot_parts
&&
!
error
;
index
++
)
{
ha_alter_info
->
handler_ctx
=
part_inplace_ctx
->
handler_ctx_array
[
index
];
if
((
ha_alter_info
->
handler_ctx
=
part_inplace_ctx
->
handler_ctx_array
[
index
])
!=
NULL
&&
index
!=
0
)
ha_alter_info
->
handler_ctx
->
set_shared_data
(
*
part_inplace_ctx
->
handler_ctx_array
[
index
-
1
]);
if
(
m_file
[
index
]
->
ha_inplace_alter_table
(
altered_table
,
ha_alter_info
))
error
=
true
;
...
...
sql/handler.h
View file @
caa9023c
#ifndef HANDLER_INCLUDED
#define HANDLER_INCLUDED
/*
Copyright (c) 2000, 201
6
, Oracle and/or its affiliates.
Copyright (c) 2009, 201
8
, MariaDB
Copyright (c) 2000, 201
9
, Oracle and/or its affiliates.
Copyright (c) 2009, 201
9
, MariaDB
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
...
...
@@ -1833,6 +1833,7 @@ class inplace_alter_handler_ctx : public Sql_alloc
inplace_alter_handler_ctx
()
{}
virtual
~
inplace_alter_handler_ctx
()
{}
virtual
void
set_shared_data
(
const
inplace_alter_handler_ctx
&
ctx
)
{}
};
...
...
storage/innobase/dict/dict0stats.cc
View file @
caa9023c
/*****************************************************************************
Copyright (c) 2009, 201
6
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, 201
9
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
...
...
@@ -2499,7 +2499,6 @@ dict_stats_report_error(
return
(
err
);
}
/** Save the table's statistics into the persistent statistics storage.
@param[in] table_orig table whose stats to save
@param[in] only_for_index if this is non-NULL, then stats for indexes
...
...
@@ -3208,6 +3207,8 @@ dict_stats_update_for_index(
if
(
dict_stats_persistent_storage_check
(
false
))
{
dict_table_stats_lock
(
index
->
table
,
RW_X_LATCH
);
dict_stats_analyze_index
(
index
);
index
->
table
->
stat_sum_of_other_index_sizes
+=
index
->
stat_index_size
;
dict_table_stats_unlock
(
index
->
table
,
RW_X_LATCH
);
dict_stats_save
(
index
->
table
,
&
index
->
id
);
DBUG_VOID_RETURN
;
...
...
storage/innobase/handler/handler0alter.cc
View file @
caa9023c
/*****************************************************************************
Copyright (c) 2005, 201
8
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2005, 201
9
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
...
...
@@ -2178,6 +2178,23 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
@return whether the table will be rebuilt */
bool
need_rebuild
()
const
{
return
(
old_table
!=
new_table
);
}
/** Share context between partitions.
@param[in] ctx context from another partition of the table */
void
set_shared_data
(
const
inplace_alter_handler_ctx
&
ctx
)
{
if
(
add_autoinc
!=
ULINT_UNDEFINED
)
{
const
ha_innobase_inplace_ctx
&
ha_ctx
=
static_cast
<
const
ha_innobase_inplace_ctx
&>
(
ctx
);
/* When adding an AUTO_INCREMENT column to a
partitioned InnoDB table, we must share the
sequence for all partitions. */
ut_ad
(
ha_ctx
.
add_autoinc
==
add_autoinc
);
ut_ad
(
ha_ctx
.
sequence
.
last
());
sequence
=
ha_ctx
.
sequence
;
}
}
private:
// Disable copying
ha_innobase_inplace_ctx
(
const
ha_innobase_inplace_ctx
&
);
...
...
@@ -2721,7 +2738,7 @@ prepare_inplace_alter_table_dict(
(
ha_alter_info
->
handler_ctx
);
DBUG_ASSERT
((
ctx
->
add_autoinc
!=
ULINT_UNDEFINED
)
==
(
ctx
->
sequence
.
m
_max_value
>
0
));
==
(
ctx
->
sequence
.
m
ax_value
()
>
0
));
DBUG_ASSERT
(
!
ctx
->
num_to_drop_index
==
!
ctx
->
drop_index
);
DBUG_ASSERT
(
!
ctx
->
num_to_drop_fk
==
!
ctx
->
drop_fk
);
DBUG_ASSERT
(
!
add_fts_doc_id
||
add_fts_doc_id_idx
);
...
...
storage/innobase/include/handler0alter.h
View file @
caa9023c
/*****************************************************************************
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -96,9 +97,13 @@ struct ib_sequence_t {
return
(
m_next_value
);
}
/** Maximum calumn value if adding an AUTOINC column else 0. Once
we reach the end of the sequence it will be set to ~0. */
const
ulonglong
m_max_value
;
/** @return maximum column value
@retval 0 if not adding AUTO_INCREMENT column */
ulonglong
max_value
()
const
{
return
m_max_value
;
}
private:
/** Maximum value if adding an AUTO_INCREMENT column, else 0 */
ulonglong
m_max_value
;
/** Value of auto_increment_increment */
ulong
m_increment
;
...
...
storage/innobase/include/univ.i
View file @
caa9023c
...
...
@@ -45,7 +45,7 @@ Created 1/20/1994 Heikki Tuuri
#
define
INNODB_VERSION_MAJOR
5
#
define
INNODB_VERSION_MINOR
6
#
define
INNODB_VERSION_BUGFIX
4
3
#
define
INNODB_VERSION_BUGFIX
4
4
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
...
...
storage/xtradb/dict/dict0stats.cc
View file @
caa9023c
/*****************************************************************************
Copyright (c) 2009, 201
6
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, 201
9
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
...
...
@@ -3207,6 +3207,8 @@ dict_stats_update_for_index(
if
(
dict_stats_persistent_storage_check
(
false
))
{
dict_table_stats_lock
(
index
->
table
,
RW_X_LATCH
);
dict_stats_analyze_index
(
index
);
index
->
table
->
stat_sum_of_other_index_sizes
+=
index
->
stat_index_size
;
dict_table_stats_unlock
(
index
->
table
,
RW_X_LATCH
);
dict_stats_save
(
index
->
table
,
&
index
->
id
);
DBUG_VOID_RETURN
;
...
...
@@ -4006,7 +4008,6 @@ dict_stats_save_defrag_stats(
{
dberr_t
ret
;
if
(
index
->
is_readable
())
{
}
else
{
return
(
dict_stats_report_error
(
index
->
table
,
true
));
...
...
storage/xtradb/handler/handler0alter.cc
View file @
caa9023c
/*****************************************************************************
Copyright (c) 2005, 201
8
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2005, 201
9
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
...
...
@@ -2181,6 +2181,23 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx
@return whether the table will be rebuilt */
bool
need_rebuild
()
const
{
return
(
old_table
!=
new_table
);
}
/** Share context between partitions.
@param[in] ctx context from another partition of the table */
void
set_shared_data
(
const
inplace_alter_handler_ctx
&
ctx
)
{
if
(
add_autoinc
!=
ULINT_UNDEFINED
)
{
const
ha_innobase_inplace_ctx
&
ha_ctx
=
static_cast
<
const
ha_innobase_inplace_ctx
&>
(
ctx
);
/* When adding an AUTO_INCREMENT column to a
partitioned InnoDB table, we must share the
sequence for all partitions. */
ut_ad
(
ha_ctx
.
add_autoinc
==
add_autoinc
);
ut_ad
(
ha_ctx
.
sequence
.
last
());
sequence
=
ha_ctx
.
sequence
;
}
}
private:
// Disable copying
ha_innobase_inplace_ctx
(
const
ha_innobase_inplace_ctx
&
);
...
...
@@ -2727,7 +2744,7 @@ prepare_inplace_alter_table_dict(
(
ha_alter_info
->
handler_ctx
);
DBUG_ASSERT
((
ctx
->
add_autoinc
!=
ULINT_UNDEFINED
)
==
(
ctx
->
sequence
.
m
_max_value
>
0
));
==
(
ctx
->
sequence
.
m
ax_value
()
>
0
));
DBUG_ASSERT
(
!
ctx
->
num_to_drop_index
==
!
ctx
->
drop_index
);
DBUG_ASSERT
(
!
ctx
->
num_to_drop_fk
==
!
ctx
->
drop_fk
);
DBUG_ASSERT
(
!
add_fts_doc_id
||
add_fts_doc_id_idx
);
...
...
storage/xtradb/include/handler0alter.h
View file @
caa9023c
/*****************************************************************************
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -96,9 +97,13 @@ struct ib_sequence_t {
return
(
m_next_value
);
}
/** Maximum calumn value if adding an AUTOINC column else 0. Once
we reach the end of the sequence it will be set to ~0. */
const
ulonglong
m_max_value
;
/** @return maximum column value
@retval 0 if not adding AUTO_INCREMENT column */
ulonglong
max_value
()
const
{
return
m_max_value
;
}
private:
/** Maximum value if adding an AUTO_INCREMENT column, else 0 */
ulonglong
m_max_value
;
/** Value of auto_increment_increment */
ulong
m_increment
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment