Skip to content

Commit dcc8381

Browse files
committed
Merge branch '10.3' into bb-10.3-merge
2 parents b953d70 + 4e7ee16 commit dcc8381

File tree

13 files changed

+187
-39
lines changed

13 files changed

+187
-39
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ scripts/wsrep_sst_mysqldump
128128
scripts/wsrep_sst_rsync
129129
scripts/wsrep_sst_rsync_wan
130130
scripts/wsrep_sst_mariabackup
131+
scripts/wsrep_sst_xtrabackup
132+
scripts/wsrep_sst_xtrabackup-v2
131133
scripts/maria_add_gis_sp.sql
132134
scripts/maria_add_gis_sp_bootstrap.sql
133135
scripts/galera_new_cluster

BUILD/SETUP.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ get_make_parallel_flag
122122
# SSL library to use.--with-ssl will select our bundled yaSSL
123123
# implementation of SSL. --with-ssl=yes will first try system library
124124
# then the boundled one --with-ssl=system will use the system library.
125-
SSL_LIBRARY=--with-ssl=system
125+
# We use bundled by default as this is guaranteed to work with Galera
126+
SSL_LIBRARY=--with-ssl
126127

127128
if [ "x$warning_mode" = "xpedantic" ]; then
128129
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
@@ -194,6 +195,8 @@ base_configs="$base_configs --with-extra-charsets=complex "
194195
base_configs="$base_configs --enable-thread-safe-client "
195196
base_configs="$base_configs --with-big-tables $maintainer_mode"
196197
base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables"
198+
# Following is to get tokudb to work
199+
base_configs="$base_configs --with-jemalloc=NO"
197200

198201
if test -d "$path/../cmd-line-utils/readline"
199202
then

cmake/configure.pl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ sub check_compiler
145145
$cmakeargs = $cmakeargs." -DPLUGIN_".uc($1)."=".uc($2);
146146
next;
147147
}
148+
if($option =~ /without-wsrep/)
149+
{
150+
$cmakeargs = $cmakeargs." -DWITH_WSREP=OFF";
151+
next;
152+
}
148153
if($option =~ /with-zlib-dir=bundled/)
149154
{
150155
$cmakeargs = $cmakeargs." -DWITH_ZLIB=bundled";
@@ -185,6 +190,16 @@ sub check_compiler
185190
$cmakeargs = $cmakeargs." -DCMAKE_BUILD_TYPE=Debug -DSECURITY_HARDENED=OFF";
186191
next;
187192
}
193+
if($option =~ /with-(.*)=(.*)/)
194+
{
195+
$cmakeargs = $cmakeargs. " -DWITH_" . uc($1) . "=" . uc($2);
196+
next;
197+
}
198+
if($option =~ /without-(.*)=(.*)/)
199+
{
200+
$cmakeargs = $cmakeargs. " -DWITHOUT_" . uc($1) . "=" . uc($2);
201+
next;
202+
}
188203
if($option =~ /prefix=/)
189204
{
190205
$cmake_install_prefix= substr($option, 7);
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
set default_storage_engine=innodb;
2+
#
3+
# MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables
4+
#
5+
create table t2 (x int, z int default 41);
6+
alter table t2 discard tablespace;
7+
create table t1 (x int);
8+
insert into t1 values (1);
9+
alter table t1 add z int default 42, algorithm instant;
10+
select * from t1;
11+
x z
12+
1 42
13+
flush tables t1 for export;
14+
unlock tables;
15+
# The metadata has to be updated to instant ADD COLUMN.
16+
alter table t2 import tablespace;
17+
select * from t2;
18+
x z
19+
1 42
20+
insert into t2 set x=2;
21+
select * from t2;
22+
x z
23+
1 42
24+
2 41
25+
alter table t1 discard tablespace;
26+
flush tables t2 for export;
27+
unlock tables;
28+
# Both the metadata and the data file used instant ADD COLUMN.
29+
alter table t1 import tablespace;
30+
select * from t1;
31+
x z
32+
1 42
33+
2 41
34+
drop table t2;
35+
create table t2 select * from t1;
36+
alter table t1 discard tablespace;
37+
flush tables t2 for export;
38+
unlock tables;
39+
# The instant ADD COLUMN has to be removed from the metadata.
40+
alter table t1 import tablespace;
41+
select * from t1;
42+
x z
43+
1 42
44+
2 41
45+
drop table t2;
46+
drop table t1;
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--source include/have_innodb.inc
2+
set default_storage_engine=innodb;
3+
4+
--echo #
5+
--echo # MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables
6+
--echo #
7+
8+
create table t2 (x int, z int default 41);
9+
alter table t2 discard tablespace;
10+
11+
create table t1 (x int);
12+
insert into t1 values (1);
13+
alter table t1 add z int default 42, algorithm instant;
14+
select * from t1;
15+
flush tables t1 for export;
16+
--let $MYSQLD_DATADIR= `select @@datadir`
17+
--move_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
18+
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
19+
unlock tables;
20+
21+
--echo # The metadata has to be updated to instant ADD COLUMN.
22+
alter table t2 import tablespace;
23+
24+
select * from t2;
25+
insert into t2 set x=2;
26+
select * from t2;
27+
28+
alter table t1 discard tablespace;
29+
flush tables t2 for export;
30+
--move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_DATADIR/test/t1.cfg
31+
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
32+
unlock tables;
33+
34+
--echo # Both the metadata and the data file used instant ADD COLUMN.
35+
alter table t1 import tablespace;
36+
select * from t1;
37+
38+
drop table t2;
39+
create table t2 select * from t1;
40+
41+
alter table t1 discard tablespace;
42+
flush tables t2 for export;
43+
--move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_DATADIR/test/t1.cfg
44+
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
45+
unlock tables;
46+
47+
--echo # The instant ADD COLUMN has to be removed from the metadata.
48+
alter table t1 import tablespace;
49+
select * from t1;
50+
51+
drop table t2;
52+
drop table t1;

mysys/my_fopen.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,7 @@ int my_fclose(FILE *fd, myf MyFlags)
171171
my_file_info[file].type= UNOPEN;
172172
}
173173
#ifndef _WIN32
174-
do
175-
{
176-
err= fclose(fd);
177-
} while (err == -1 && errno == EINTR);
174+
err= fclose(fd);
178175
#else
179176
err= my_win_fclose(fd);
180177
#endif

plugin/user_variables/mysql-test/user_variables/basic.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PLUGIN_AUTHOR Sergey Vojtovich
77
PLUGIN_DESCRIPTION User-defined variables
88
PLUGIN_LICENSE GPL
99
LOAD_OPTION ON
10-
PLUGIN_MATURITYGamma
10+
PLUGIN_MATURITYStable
1111
SHOW CREATE TABLE INFORMATION_SCHEMA.USER_VARIABLES;
1212
Table Create Table
1313
user_variables CREATE TEMPORARY TABLE `user_variables` (

plugin/user_variables/user_variables.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,6 @@ maria_declare_plugin(user_variables)
135135
NULL,
136136
NULL,
137137
"1.0",
138-
MariaDB_PLUGIN_MATURITY_GAMMA
138+
MariaDB_PLUGIN_MATURITY_STABLE
139139
}
140140
maria_declare_plugin_end;

sql/ha_sequence.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,6 @@ maria_declare_plugin(sql_sequence)
443443
NULL, /* status variables */
444444
NULL, /* system variables */
445445
"1.0", /* string version */
446-
MariaDB_PLUGIN_MATURITY_ALPHA /* maturity */
446+
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
447447
}
448448
maria_declare_plugin_end;

storage/innobase/handler/ha_innodb.cc

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (c) 2000, 2018, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2008, 2009 Google Inc.
55
Copyright (c) 2009, Percona Inc.
66
Copyright (c) 2012, Facebook Inc.
7-
Copyright (c) 2013, 2018, MariaDB Corporation.
7+
Copyright (c) 2013, 2019, MariaDB Corporation.
88

99
Portions of this file contain modifications contributed and copyrighted by
1010
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -12700,22 +12700,19 @@ ha_innobase::discard_or_import_tablespace(
1270012700
DBUG_RETURN(HA_ERR_TABLE_READONLY);
1270112701
}
1270212702

12703-
dict_table_t* dict_table = m_prebuilt->table;
12704-
12705-
if (dict_table->is_temporary()) {
12706-
12703+
if (m_prebuilt->table->is_temporary()) {
1270712704
ib_senderrf(
1270812705
m_prebuilt->trx->mysql_thd, IB_LOG_LEVEL_ERROR,
1270912706
ER_CANNOT_DISCARD_TEMPORARY_TABLE);
1271012707

1271112708
DBUG_RETURN(HA_ERR_TABLE_NEEDS_UPGRADE);
1271212709
}
1271312710

12714-
if (dict_table->space == fil_system.sys_space) {
12711+
if (m_prebuilt->table->space == fil_system.sys_space) {
1271512712
ib_senderrf(
1271612713
m_prebuilt->trx->mysql_thd, IB_LOG_LEVEL_ERROR,
1271712714
ER_TABLE_IN_SYSTEM_TABLESPACE,
12718-
dict_table->name.m_name);
12715+
m_prebuilt->table->name.m_name);
1271912716

1272012717
DBUG_RETURN(HA_ERR_TABLE_NEEDS_UPGRADE);
1272112718
}
@@ -12724,7 +12721,7 @@ ha_innobase::discard_or_import_tablespace(
1272412721

1272512722
/* Obtain an exclusive lock on the table. */
1272612723
dberr_t err = row_mysql_lock_table(
12727-
m_prebuilt->trx, dict_table, LOCK_X,
12724+
m_prebuilt->trx, m_prebuilt->table, LOCK_X,
1272812725
discard ? "setting table lock for DISCARD TABLESPACE"
1272912726
: "setting table lock for IMPORT TABLESPACE");
1273012727

@@ -12737,32 +12734,32 @@ ha_innobase::discard_or_import_tablespace(
1273712734
user may want to set the DISCARD flag in order to IMPORT
1273812735
a new tablespace. */
1273912736

12740-
if (!dict_table->is_readable()) {
12737+
if (!m_prebuilt->table->is_readable()) {
1274112738
ib_senderrf(
1274212739
m_prebuilt->trx->mysql_thd,
1274312740
IB_LOG_LEVEL_WARN, ER_TABLESPACE_MISSING,
12744-
dict_table->name.m_name);
12741+
m_prebuilt->table->name.m_name);
1274512742
}
1274612743

1274712744
err = row_discard_tablespace_for_mysql(
12748-
dict_table->name.m_name, m_prebuilt->trx);
12745+
m_prebuilt->table->name.m_name, m_prebuilt->trx);
1274912746

12750-
} else if (dict_table->is_readable()) {
12747+
} else if (m_prebuilt->table->is_readable()) {
1275112748
/* Commit the transaction in order to
1275212749
release the table lock. */
1275312750
trx_commit_for_mysql(m_prebuilt->trx);
1275412751

1275512752
ib::error() << "Unable to import tablespace "
12756-
<< dict_table->name << " because it already"
12753+
<< m_prebuilt->table->name << " because it already"
1275712754
" exists. Please DISCARD the tablespace"
1275812755
" before IMPORT.";
1275912756
ib_senderrf(
1276012757
m_prebuilt->trx->mysql_thd, IB_LOG_LEVEL_ERROR,
12761-
ER_TABLESPACE_EXISTS, dict_table->name.m_name);
12758+
ER_TABLESPACE_EXISTS, m_prebuilt->table->name.m_name);
1276212759

1276312760
DBUG_RETURN(HA_ERR_TABLE_EXIST);
1276412761
} else {
12765-
err = row_import_for_mysql(dict_table, m_prebuilt);
12762+
err = row_import_for_mysql(m_prebuilt->table, m_prebuilt);
1276612763

1276712764
if (err == DB_SUCCESS) {
1276812765

@@ -12778,12 +12775,35 @@ ha_innobase::discard_or_import_tablespace(
1277812775
/* Commit the transaction in order to release the table lock. */
1277912776
trx_commit_for_mysql(m_prebuilt->trx);
1278012777

12781-
if (err == DB_SUCCESS && !discard
12782-
&& dict_stats_is_persistent_enabled(dict_table)) {
12778+
if (discard || err != DB_SUCCESS) {
12779+
DBUG_RETURN(convert_error_code_to_mysql(
12780+
err, m_prebuilt->table->flags, NULL));
12781+
}
12782+
12783+
/* Evict and reload the table definition in order to invoke
12784+
btr_cur_instant_init(). */
12785+
table_id_t id = m_prebuilt->table->id;
12786+
ut_ad(id);
12787+
mutex_enter(&dict_sys->mutex);
12788+
dict_table_close(m_prebuilt->table, TRUE, FALSE);
12789+
dict_table_remove_from_cache(m_prebuilt->table);
12790+
m_prebuilt->table = dict_table_open_on_id(id, TRUE,
12791+
DICT_TABLE_OP_NORMAL);
12792+
mutex_exit(&dict_sys->mutex);
12793+
if (!m_prebuilt->table) {
12794+
err = DB_TABLE_NOT_FOUND;
12795+
} else {
12796+
if (const Field* ai = table->found_next_number_field) {
12797+
initialize_auto_increment(m_prebuilt->table, ai);
12798+
}
12799+
dict_stats_init(m_prebuilt->table);
12800+
}
12801+
12802+
if (dict_stats_is_persistent_enabled(m_prebuilt->table)) {
1278312803
dberr_t ret;
1278412804

1278512805
/* Adjust the persistent statistics. */
12786-
ret = dict_stats_update(dict_table,
12806+
ret = dict_stats_update(m_prebuilt->table,
1278712807
DICT_STATS_RECALC_PERSISTENT);
1278812808

1278912809
if (ret != DB_SUCCESS) {
@@ -12793,11 +12813,12 @@ ha_innobase::discard_or_import_tablespace(
1279312813
ER_ALTER_INFO,
1279412814
"Error updating stats for table '%s'"
1279512815
" after table rebuild: %s",
12796-
dict_table->name.m_name, ut_strerr(ret));
12816+
m_prebuilt->table->name.m_name,
12817+
ut_strerr(ret));
1279712818
}
1279812819
}
1279912820

12800-
DBUG_RETURN(convert_error_code_to_mysql(err, dict_table->flags, NULL));
12821+
DBUG_RETURN(0);
1280112822
}
1280212823

1280312824
/**

0 commit comments

Comments
 (0)