summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKentoku SHIBA <kentokushiba@gmail.com>2019-04-12 22:47:29 +0900
committerGitHub <noreply@github.com>2019-04-12 22:47:29 +0900
commitdf2d376eca665e26845d8e6c636bf9f6c1714b1b (patch)
tree77472ce6fdb212e7cadb9fe1ccd351bab193797a
parentf0509afa1b635cd7c091f349a3b8dd72b4b92b94 (diff)
parent7896503686477cce55d058d071d2858a8abf4b04 (diff)
downloadmariadb-git-bb-10.4-MDEV-16530.tar.gz
Merge branch '10.4' into bb-10.4-MDEV-16530bb-10.4-MDEV-16530
-rw-r--r--VERSION2
-rw-r--r--cmake/build_depends.cmake5
-rw-r--r--cmake/cpack_rpm.cmake2
-rw-r--r--extra/mariabackup/xtrabackup.cc47
-rw-r--r--include/mysql/service_wsrep.h5
-rw-r--r--mysql-test/main/alter_table_errors.result2
-rw-r--r--mysql-test/main/check_constraint_innodb.result2
-rw-r--r--mysql-test/main/cte_nonrecursive.result14
-rw-r--r--mysql-test/main/cte_nonrecursive.test12
-rw-r--r--mysql-test/main/having_cond_pushdown.result32
-rw-r--r--mysql-test/main/having_cond_pushdown.test39
-rw-r--r--mysql-test/main/rowid_filter.result25
-rw-r--r--mysql-test/main/rowid_filter.test25
-rw-r--r--mysql-test/main/rowid_filter_innodb.result25
-rw-r--r--mysql-test/suite/galera/r/MW-86.result78
-rw-r--r--mysql-test/suite/galera/r/galera_sp_bf_abort.result356
-rw-r--r--mysql-test/suite/galera/r/galera_sp_insert_parallel.result41
-rw-r--r--mysql-test/suite/galera/r/mysql-wsrep#216.result11
-rw-r--r--mysql-test/suite/galera/t/GCF-1081.test4
-rw-r--r--mysql-test/suite/galera/t/galera_sp_insert_parallel.test55
-rw-r--r--mysql-test/suite/galera_3nodes_sr/r/GCF-832.result4
-rw-r--r--mysql-test/suite/galera_3nodes_sr/t/GCF-810A.test12
-rw-r--r--mysql-test/suite/galera_3nodes_sr/t/GCF-810B.test4
-rw-r--r--mysql-test/suite/galera_3nodes_sr/t/GCF-810C.test8
-rw-r--r--mysql-test/suite/galera_3nodes_sr/t/GCF-832.test2
-rw-r--r--mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result8
-rw-r--r--mysql-test/suite/galera_sr/t/mysql-wsrep-features#35.test4
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-timestamp.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5980-alter.result2
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result6
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff2
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_charset.result226
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff2
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_extend.resultbin8753 -> 8745 bytes
-rw-r--r--mysql-test/suite/innodb/t/drop_table_background.test6
-rw-r--r--mysql-test/suite/innodb/t/undo_truncate_recover.test8
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_install.result2
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_load.result2
-rw-r--r--mysql-test/suite/plugins/r/feedback_plugin_send.result3
-rw-r--r--mysql-test/suite/storage_engine/alter_table_online.result2
-rw-r--r--mysys/mf_tempfile.c6
-rw-r--r--sql/field.cc290
-rw-r--r--sql/field.h3
-rw-r--r--sql/item.cc5
-rw-r--r--sql/item.h1
-rw-r--r--sql/item_func.h2
-rw-r--r--sql/share/errmsg-utf8.txt2
-rw-r--r--sql/sp_head.cc61
-rw-r--r--sql/sql_base.cc25
-rw-r--r--sql/sql_class.cc9
-rw-r--r--sql/sql_cte.cc1
-rw-r--r--sql/sql_parse.cc15
-rw-r--r--sql/sql_plugin_services.ic3
-rw-r--r--sql/sql_select.cc16
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/wsrep_client_service.cc36
-rw-r--r--sql/wsrep_dummy.cc3
-rw-r--r--sql/wsrep_high_priority_service.cc83
-rw-r--r--sql/wsrep_high_priority_service.h3
-rw-r--r--sql/wsrep_trans_observer.h7
-rw-r--r--storage/innobase/btr/btr0btr.cc221
-rw-r--r--storage/innobase/btr/btr0bulk.cc12
-rw-r--r--storage/innobase/btr/btr0cur.cc10
-rw-r--r--storage/innobase/buf/buf0buf.cc14
-rw-r--r--storage/innobase/buf/buf0rea.cc2
-rw-r--r--storage/innobase/dict/dict0load.cc9
-rw-r--r--storage/innobase/fil/fil0fil.cc31
-rw-r--r--storage/innobase/fsp/fsp0fsp.cc186
-rw-r--r--storage/innobase/handler/ha_innodb.cc6
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc3
-rw-r--r--storage/innobase/include/btr0btr.h32
-rw-r--r--storage/innobase/include/dict0types.h5
-rw-r--r--storage/innobase/include/fil0fil.h25
-rw-r--r--storage/innobase/include/fsp0fsp.h71
-rw-r--r--storage/innobase/include/log0log.h25
-rw-r--r--storage/innobase/include/log0recv.h13
-rw-r--r--storage/innobase/include/mem0mem.h8
-rw-r--r--storage/innobase/include/os0proc.h8
-rw-r--r--storage/innobase/include/page0zip.h18
-rw-r--r--storage/innobase/include/row0merge.h8
-rw-r--r--storage/innobase/include/ut0ut.h14
-rw-r--r--storage/innobase/log/log0log.cc29
-rw-r--r--storage/innobase/log/log0recv.cc331
-rw-r--r--storage/innobase/os/os0proc.cc36
-rw-r--r--storage/innobase/page/page0zip.cc35
-rw-r--r--storage/innobase/row/row0ftsort.cc4
-rw-r--r--storage/innobase/row/row0merge.cc18
-rw-r--r--storage/innobase/row/row0mysql.cc2
-rw-r--r--storage/innobase/trx/trx0undo.cc31
-rw-r--r--storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff2
-rw-r--r--storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff2
-rw-r--r--storage/rocksdb/CMakeLists.txt4
-rw-r--r--storage/spider/spd_db_mysql.cc3
-rw-r--r--storage/spider/spd_environ.h1
m---------wsrep-lib0
96 files changed, 1651 insertions, 1232 deletions
diff --git a/VERSION b/VERSION
index a8d6fcacd72..da1fcc97f1d 100644
--- a/VERSION
+++ b/VERSION
@@ -1,4 +1,4 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=4
-MYSQL_VERSION_PATCH=4
+MYSQL_VERSION_PATCH=5
SERVER_MATURITY=gamma
diff --git a/cmake/build_depends.cmake b/cmake/build_depends.cmake
index 0d17c22cf98..333df580200 100644
--- a/cmake/build_depends.cmake
+++ b/cmake/build_depends.cmake
@@ -16,6 +16,11 @@ IF(RPM)
ENDIF()
ENDMACRO()
+ # FindBoost.cmake doesn't leave any trace, do it here
+ IF (Boost_INCLUDE_DIR)
+ FIND_FILE(Boost_config_hpp boost/config.hpp PATHS ${Boost_INCLUDE_DIR})
+ ENDIF()
+
GET_CMAKE_PROPERTY(ALL_VARS CACHE_VARIABLES)
FOREACH (V ${ALL_VARS})
GET_PROPERTY(H CACHE ${V} PROPERTY HELPSTRING)
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 87c5518de6b..db377184499 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -277,7 +277,6 @@ IF(CMAKE_VERSION VERSION_GREATER "3.9.99")
SET(CPACK_SOURCE_GENERATOR "RPM")
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS
- "-DBUILD_CONFIG=mysql_release"
"-DRPM=${RPM}"
"-DCPACK_RPM_BUILD_SOURCE_DIRS_PREFIX=/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${VERSION}"
)
@@ -288,6 +287,7 @@ MACRO(ADDIF var)
ENDIF()
ENDMACRO()
+ADDIF(CMAKE_BUILD_TYPE)
ADDIF(BUILD_CONFIG)
ADDIF(WITH_SSL)
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 0bf027cf243..35b69beea94 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -221,8 +221,6 @@ const char *defaults_group = "mysqld";
#define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */
#define HA_INNOBASE_RANGE_COUNT 100
-ulong innobase_large_page_size = 0;
-
/* The default values for the following, type long or longlong, start-up
parameters are declared in mysqld.cc: */
@@ -242,7 +240,6 @@ char* innobase_data_home_dir;
char* innobase_data_file_path;
my_bool innobase_use_doublewrite;
-my_bool innobase_use_large_pages;
my_bool innobase_file_per_table;
my_bool innobase_locks_unsafe_for_binlog;
my_bool innobase_rollback_on_timeout;
@@ -1917,8 +1914,6 @@ static bool innodb_init_param()
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
- os_use_large_pages = (ibool) innobase_use_large_pages;
- os_large_page_size = (ulint) innobase_large_page_size;
row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout;
srv_file_per_table = (my_bool) innobase_file_per_table;
@@ -2752,8 +2747,13 @@ static bool xtrabackup_copy_logfile(bool last = false)
my_sleep(1000);
}
- start_lsn = (lsn == start_lsn)
- ? 0 : xtrabackup_copy_log(start_lsn, lsn, last);
+ if (lsn == start_lsn) {
+ start_lsn = 0;
+ } else {
+ mutex_enter(&recv_sys->mutex);
+ start_lsn = xtrabackup_copy_log(start_lsn, lsn, last);
+ mutex_exit(&recv_sys->mutex);
+ }
log_mutex_exit();
@@ -3994,9 +3994,7 @@ static bool xtrabackup_backup_low()
/** Implement --backup
@return whether the operation succeeded */
-static
-bool
-xtrabackup_backup_func()
+static bool xtrabackup_backup_func()
{
MY_STAT stat_info;
uint i;
@@ -4129,38 +4127,25 @@ fail:
log_mutex_enter();
+reread_log_header:
dberr_t err = recv_find_max_checkpoint(&max_cp_field);
if (err != DB_SUCCESS) {
-log_fail:
+ msg("Error: cannot read redo log header");
log_mutex_exit();
goto fail;
}
if (log_sys.log.format == 0) {
-old_format:
- msg("Error: cannot process redo log"
- " before MariaDB 10.2.2");
+ msg("Error: cannot process redo log before MariaDB 10.2.2");
log_mutex_exit();
- goto log_fail;
+ goto fail;
}
const byte* buf = log_sys.checkpoint_buf;
-
-reread_log_header:
- checkpoint_lsn_start = log_sys.log.lsn;
+ checkpoint_lsn_start = log_sys.log.get_lsn();
checkpoint_no_start = log_sys.next_checkpoint_no;
- err = recv_find_max_checkpoint(&max_cp_field);
-
- if (err != DB_SUCCESS) {
- goto log_fail;
- }
-
- if (log_sys.log.format == 0) {
- goto old_format;
- }
-
log_header_read(max_cp_field);
if (checkpoint_no_start != mach_read_from_8(buf + LOG_CHECKPOINT_NO)) {
@@ -4206,6 +4191,12 @@ reread_log_header:
mach_write_to_8(log_hdr + LOG_CHECKPOINT_OFFSET,
(checkpoint_lsn_start & (OS_FILE_LOG_BLOCK_SIZE - 1))
| LOG_FILE_HDR_SIZE);
+ /* The least significant bits of LOG_CHECKPOINT_OFFSET must be
+ stored correctly in the copy of the ib_logfile. The most significant
+ bits, which identify the start offset of the log block in the file,
+ we did choose freely, as LOG_FILE_HDR_SIZE. */
+ ut_ad(!((log_sys.log.get_lsn() ^ checkpoint_lsn_start)
+ & (OS_FILE_LOG_BLOCK_SIZE - 1)));
log_block_set_checksum(log_hdr,
log_block_calc_checksum_crc32(log_hdr));
/* Write checkpoint page 1 and two empty log pages before the
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h
index 8424689a219..d76643364b3 100644
--- a/include/mysql/service_wsrep.h
+++ b/include/mysql/service_wsrep.h
@@ -83,6 +83,7 @@ extern struct wsrep_service_st {
const char* (*wsrep_get_sr_table_name_func)();
my_bool (*wsrep_get_debug_func)();
void (*wsrep_commit_ordered_func)(MYSQL_THD thd);
+ my_bool (*wsrep_thd_is_applying_func)(const MYSQL_THD thd);
} *wsrep_service;
#define MYSQL_SERVICE_WSREP_INCLUDED
@@ -121,7 +122,8 @@ extern struct wsrep_service_st {
#define wsrep_thd_skip_locking(T) wsrep_service->wsrep_thd_skip_locking_func(T)
#define wsrep_get_sr_table_name() wsrep_service->wsrep_get_sr_table_name_func()
#define wsrep_get_debug() wsrep_service->wsrep_get_debug_func()
-#define wsrep_commit_ordered(T) wsrep_service->wsrep_commit_ordered(T)
+#define wsrep_commit_ordered(T) wsrep_service->wsrep_commit_ordered_func(T)
+#define wsrep_thd_is_applying(T) wsrep_service->wsrep_thd_is_applying_func(T)
#else
@@ -213,6 +215,7 @@ extern "C" const char* wsrep_get_sr_table_name();
extern "C" my_bool wsrep_get_debug();
extern "C" void wsrep_commit_ordered(MYSQL_THD thd);
+extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd);
#endif
#endif /* MYSQL_SERVICE_WSREP_INCLUDED */
diff --git a/mysql-test/main/alter_table_errors.result b/mysql-test/main/alter_table_errors.result
index 1e2a8100e84..5a3ecb6727d 100644
--- a/mysql-test/main/alter_table_errors.result
+++ b/mysql-test/main/alter_table_errors.result
@@ -1,6 +1,6 @@
create table t (a int, v int as (a)) engine=innodb;
alter table t change column a b tinyint, algorithm=inplace;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
show create table t;
Table Create Table
t CREATE TABLE `t` (
diff --git a/mysql-test/main/check_constraint_innodb.result b/mysql-test/main/check_constraint_innodb.result
index 45af3f512b7..4b412491204 100644
--- a/mysql-test/main/check_constraint_innodb.result
+++ b/mysql-test/main/check_constraint_innodb.result
@@ -2,7 +2,7 @@ create table t1 (a int, b smallint) engine=innodb;
connect con1,localhost,root,,test;
alter table t1 add constraint check (b < 8);
alter table t1 modify column b int, algorithm=inplace;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
connection default;
alter table t1 add primary key (a);
drop table t1;
diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result
index eeae6d02476..4fea05f79b4 100644
--- a/mysql-test/main/cte_nonrecursive.result
+++ b/mysql-test/main/cte_nonrecursive.result
@@ -1659,3 +1659,17 @@ a
2
drop view v1;
drop table t1,t2;
+#
+# MDEV-19112: CTE usage when information_schema is set as default db
+#
+with t as (select 1 as t ) select * from t;
+t
+1
+use information_schema;
+with t as (select 1 as t) select * from t;
+t
+1
+with columns as (select 1 as t) select * from columns;
+t
+1
+use test;
diff --git a/mysql-test/main/cte_nonrecursive.test b/mysql-test/main/cte_nonrecursive.test
index 920c27a70f9..c0c5c22bed0 100644
--- a/mysql-test/main/cte_nonrecursive.test
+++ b/mysql-test/main/cte_nonrecursive.test
@@ -1168,3 +1168,15 @@ select * from v1;
drop view v1;
drop table t1,t2;
+
+--echo #
+--echo # MDEV-19112: CTE usage when information_schema is set as default db
+--echo #
+
+with t as (select 1 as t ) select * from t;
+
+use information_schema;
+with t as (select 1 as t) select * from t;
+with columns as (select 1 as t) select * from columns;
+
+use test;
diff --git a/mysql-test/main/having_cond_pushdown.result b/mysql-test/main/having_cond_pushdown.result
index bec2a937e38..85ca0342dee 100644
--- a/mysql-test/main/having_cond_pushdown.result
+++ b/mysql-test/main/having_cond_pushdown.result
@@ -4625,3 +4625,35 @@ a MAX(t1.b) c
1 22 3
deallocate prepare stmt1;
DROP TABLE t1,t3;
+#
+# MDEV-19185: pushdown constant function with subquery
+#
+CREATE TABLE t1 (pk INT, c1 VARCHAR(64));
+INSERT INTO t1 VALUES (1,'bbb'),(2,'aaa'),(3,'ccc');
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT pk
+FROM t1
+GROUP BY pk
+HAVING (1 NOT IN (SELECT COUNT(t1.c1) FROM (v1, t1)));
+pk
+1
+2
+3
+DROP TABLE t1;
+DROP VIEW v1;
+#
+# MDEV-19186: temporary table defined with view field in HAVING
+#
+CREATE TABLE t1 (pk INT, x VARCHAR(10));
+INSERT INTO t1 VALUES (1,'y'),(2,'s'),(3,'aaa');
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (pk INT, x VARCHAR(10));
+INSERT INTO t2 VALUES (1,'aa'),(2,'t'),(3,'bb');
+CREATE TABLE tmp1
+SELECT v1.pk
+FROM t2,v1
+WHERE v1.x = t2.x
+GROUP BY v1.pk
+HAVING (v1.pk = 1);
+DROP TABLE t1,t2,tmp1;
+DROP VIEW v1;
diff --git a/mysql-test/main/having_cond_pushdown.test b/mysql-test/main/having_cond_pushdown.test
index 1e5ad610e90..257e5cb4875 100644
--- a/mysql-test/main/having_cond_pushdown.test
+++ b/mysql-test/main/having_cond_pushdown.test
@@ -1301,3 +1301,42 @@ execute stmt1;
deallocate prepare stmt1;
DROP TABLE t1,t3;
+
+
+--echo #
+--echo # MDEV-19185: pushdown constant function with subquery
+--echo #
+
+CREATE TABLE t1 (pk INT, c1 VARCHAR(64));
+INSERT INTO t1 VALUES (1,'bbb'),(2,'aaa'),(3,'ccc');
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+SELECT pk
+FROM t1
+GROUP BY pk
+HAVING (1 NOT IN (SELECT COUNT(t1.c1) FROM (v1, t1)));
+
+DROP TABLE t1;
+DROP VIEW v1;
+
+
+--echo #
+--echo # MDEV-19186: temporary table defined with view field in HAVING
+--echo #
+
+CREATE TABLE t1 (pk INT, x VARCHAR(10));
+INSERT INTO t1 VALUES (1,'y'),(2,'s'),(3,'aaa');
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+CREATE TABLE t2 (pk INT, x VARCHAR(10));
+INSERT INTO t2 VALUES (1,'aa'),(2,'t'),(3,'bb');
+
+CREATE TABLE tmp1
+SELECT v1.pk
+FROM t2,v1
+WHERE v1.x = t2.x
+GROUP BY v1.pk
+HAVING (v1.pk = 1);
+
+DROP TABLE t1,t2,tmp1;
+DROP VIEW v1;
diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result
index 2fdff7dda90..280ced71bba 100644
--- a/mysql-test/main/rowid_filter.result
+++ b/mysql-test/main/rowid_filter.result
@@ -1987,4 +1987,29 @@ pk i
1 10
2 20
DROP TABLE t1;
+#
+# MDEV-18956: Possible rowid filter for subquery for which
+# in_to_exists strategy has been chosen
+#
+CREATE TABLE t1 (pk int) engine=myisam ;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (
+pk int auto_increment PRIMARY KEY,
+i1 int, i2 int, c2 varchar(1),
+KEY (i1), KEY (i2)
+) engine=myisam;
+INSERT INTO t2 VALUES
+(1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
+(6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
+(11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+pk
+EXPLAIN EXTENDED
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` having 0
+DROP TABLE t1,t2;
set @@use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/main/rowid_filter.test b/mysql-test/main/rowid_filter.test
index d84839bdf53..9c533674fb1 100644
--- a/mysql-test/main/rowid_filter.test
+++ b/mysql-test/main/rowid_filter.test
@@ -275,4 +275,29 @@ SELECT * FROM t1 WHERE pk < 5;
DROP TABLE t1;
+--echo #
+--echo # MDEV-18956: Possible rowid filter for subquery for which
+--echo # in_to_exists strategy has been chosen
+--echo #
+
+CREATE TABLE t1 (pk int) engine=myisam ;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (
+ pk int auto_increment PRIMARY KEY,
+ i1 int, i2 int, c2 varchar(1),
+ KEY (i1), KEY (i2)
+) engine=myisam;
+
+INSERT INTO t2 VALUES
+ (1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
+ (6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
+ (11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
+
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+EXPLAIN EXTENDED
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+
+DROP TABLE t1,t2;
+
set @@use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result
index 6740111f69b..d19aca16bfd 100644
--- a/mysql-test/main/rowid_filter_innodb.result
+++ b/mysql-test/main/rowid_filter_innodb.result
@@ -1916,6 +1916,31 @@ pk i
1 10
2 20
DROP TABLE t1;
+#
+# MDEV-18956: Possible rowid filter for subquery for which
+# in_to_exists strategy has been chosen
+#
+CREATE TABLE t1 (pk int) engine=myisam ;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (
+pk int auto_increment PRIMARY KEY,
+i1 int, i2 int, c2 varchar(1),
+KEY (i1), KEY (i2)
+) engine=myisam;
+INSERT INTO t2 VALUES
+(1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
+(6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
+(11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+pk
+EXPLAIN EXTENDED
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` having 0
+DROP TABLE t1,t2;
set @@use_stat_tables=@save_use_stat_tables;
#
# MDEV-18755: possible RORI-plan and possible plan with range filter
diff --git a/mysql-test/suite/galera/r/MW-86.result b/mysql-test/suite/galera/r/MW-86.result
deleted file mode 100644
index bca9be93191..00000000000
--- a/mysql-test/suite/galera/r/MW-86.result
+++ /dev/null
@@ -1,78 +0,0 @@
-connection node_2;
-connection node_1;
-connection node_2;
-SET SESSION wsrep_sync_wait = 1;
-SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
-connection node_1;
-CREATE DATABASE db1;
-CREATE TABLE bar (f1 INTEGER) ENGINE=InnoDB;
-INSERT INTO bar VALUES (1);
-connection node_2;
-SHOW BINARY LOGS;
-SHOW BINLOG EVENTS;
-SHOW COLUMNS FROM t1;
-SHOW CREATE DATABASE db1;
-SHOW CREATE EVENT e1;
-SHOW CREATE FUNCTION f1;
-SHOW CREATE PROCEDURE p1;
-SHOW CREATE TABLE t1;
-SHOW CREATE TRIGGER tr1;
-SHOW CREATE VIEW v1;
-SHOW DATABASES;
-SHOW ENGINE InnoDB STATUS;
-SHOW FUNCTION CODE f1;
-SHOW FUNCTION STATUS;
-SHOW GRANTS FOR 'root'@'localhost';
-SHOW INDEX FROM t1;
-SHOW OPEN TABLES;
-SHOW PROCEDURE CODE p1;
-SHOW PROCEDURE STATUS;
-SHOW PRIVILEGES;
-SHOW STATUS LIKE 'wsrep_cluster_size';
-SHOW TABLE STATUS;
-SHOW TABLES;
-SHOW TRIGGERS;
-SHOW GLOBAL VARIABLES LIKE 'foo_bar';
-SHOW WARNINGS;
-SET GLOBAL DEBUG = "";
-SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
-SET SESSION wsrep_sync_wait = 8;
-DROP DATABASE db1;
-connection node_2;
-SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT0.1S";
-SET SESSION wsrep_sync_wait = 8;
-SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
-connection node_1;
-CREATE TABLE q (f1 INTEGER) ENGINE=InnoDB;
-INSERT INTO q VALUES (1);
-connection node_2;
-SHOW BINARY LOGS;
-SHOW BINLOG EVENTS;
-SHOW COLUMNS FROM t1;
-SHOW CREATE DATABASE db1;
-SHOW CREATE EVENT e1;
-SHOW CREATE FUNCTION f1;
-SHOW CREATE PROCEDURE p1;
-SHOW CREATE TABLE t1;
-SHOW CREATE TRIGGER tr1;
-SHOW CREATE VIEW v1;
-SHOW DATABASES;
-SHOW ENGINE InnoDB STATUS;
-SHOW FUNCTION CODE f1;
-SHOW FUNCTION STATUS;
-SHOW GRANTS FOR 'root'@'localhost';
-SHOW INDEX FROM t1;
-SHOW OPEN TABLES;
-SHOW PROCEDURE CODE p1;
-SHOW PROCEDURE STATUS;
-SHOW PRIVILEGES;
-SHOW STATUS LIKE 'wsrep_cluster_size';
-SHOW TABLE STATUS;
-SHOW TABLES;
-SHOW TRIGGERS;
-SHOW GLOBAL VARIABLES LIKE 'foo_bar';
-SHOW WARNINGS;
-SET GLOBAL DEBUG = "";
-SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
diff --git a/mysql-test/suite/galera/r/galera_sp_bf_abort.result b/mysql-test/suite/galera/r/galera_sp_bf_abort.result
new file mode 100644
index 00000000000..9216cc4fa5a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sp_bf_abort.result
@@ -0,0 +1,356 @@
+connection node_2;
+connection node_1;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+connection node_1a;
+SET SESSION wsrep_sync_wait = 0;
+connection node_1;
+CREATE PROCEDURE proc_update_insert()
+BEGIN
+UPDATE t1 SET f2 = 'b';
+INSERT INTO t1 VALUES (4, 'd');
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_update_insert;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 b
+2 c
+3 b
+4 d
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_update_insert_with_exit_handler()
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
+UPDATE t1 SET f2 = 'b';
+INSERT INTO t1 VALUES (4, 'd');
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_update_insert_with_exit_handler;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 b
+2 c
+3 b
+4 d
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_update_insert_with_continue_handler()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+UPDATE t1 SET f2 = 'b';
+INSERT INTO t1 VALUES (4, 'd');
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_update_insert_with_continue_handler;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 b
+2 c
+3 b
+4 d
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_update_insert_transaction()
+BEGIN
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b';
+INSERT INTO t1 VALUES (4, 'd');
+COMMIT;
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_update_insert_transaction;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 b
+2 c
+3 b
+4 d
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_update_insert_transaction_with_continue_handler()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b';
+INSERT INTO t1 VALUES (4, 'd');
+COMMIT;
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_update_insert_transaction_with_continue_handler;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 b
+2 c
+3 b
+4 d
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_update_insert_transaction_with_exit_handler()
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b';
+INSERT INTO t1 VALUES (4, 'd');
+COMMIT;
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_update_insert_transaction_with_exit_handler;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 b
+2 c
+3 b
+4 d
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_insert_insert_conflict()
+BEGIN
+INSERT INTO t1 VALUES (2, 'd');
+INSERT INTO t1 VALUES (4, 'd');
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_insert_insert_conflict;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+Got one of the listed errors
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 c
+3 a
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_insert_insert_conflict_with_exit_handler()
+BEGIN
+DECLARE EXIT HANDLER FOR SQLEXCEPTION SELECT "Conflict exit handler";
+INSERT INTO t1 VALUES (2, 'd');
+INSERT INTO t1 VALUES (4, 'd');
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_insert_insert_conflict_with_exit_handler;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+Conflict exit handler
+Conflict exit handler
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 c
+3 a
+wsrep_local_replays
+1
+DELETE FROM t1;
+connection node_1;
+CREATE PROCEDURE proc_insert_insert_conflict_with_continue_handler()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SELECT "Conflict continue handler";
+INSERT INTO t1 VALUES (2, 'd');
+INSERT INTO t1 VALUES (4, 'd');
+END|
+INSERT INTO t1 VALUES (1, 'a'), (3, 'a');
+SET SESSION wsrep_sync_wait = 0;
+connection node_1a;
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+connection node_2;
+INSERT INTO t1 VALUES (2, 'c');
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync';
+connection node_1;
+CALL proc_insert_insert_conflict_with_continue_handler;
+connection node_1a;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync';
+connection node_1;
+Conflict continue handler
+Conflict continue handler
+SET SESSION wsrep_sync_wait = default;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 c
+3 a
+4 d
+wsrep_local_replays
+1
+DELETE FROM t1;
+DROP PROCEDURE proc_update_insert;
+DROP PROCEDURE proc_update_insert_with_continue_handler;
+DROP PROCEDURE proc_update_insert_with_exit_handler;
+DROP PROCEDURE proc_update_insert_transaction;
+DROP PROCEDURE proc_update_insert_transaction_with_continue_handler;
+DROP PROCEDURE proc_update_insert_transaction_with_exit_handler;
+DROP PROCEDURE proc_insert_insert_conflict;
+DROP PROCEDURE proc_insert_insert_conflict_with_exit_handler;
+DROP PROCEDURE proc_insert_insert_conflict_with_continue_handler;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_sp_insert_parallel.result b/mysql-test/suite/galera/r/galera_sp_insert_parallel.result
new file mode 100644
index 00000000000..3f072be7004
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sp_insert_parallel.result
@@ -0,0 +1,41 @@
+connection node_2;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+CREATE PROCEDURE proc_insert()
+BEGIN
+DECLARE i INT;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET i = 0;
+WHILE i < 1000 DO
+INSERT IGNORE INTO t1 (f1, f2)
+VALUES (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+(FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15));
+SET i = i + 1;
+END WHILE;
+END|
+connection node_1;
+SELECT 0;
+0
+0
+SET SESSION wsrep_sync_wait = 0;
+CALL proc_insert;
+connection node_2;
+SELECT 0;
+0
+0
+SET SESSION wsrep_sync_wait = 0;
+CALL proc_insert;
+connection node_1;
+SET SESSION wsrep_sync_wait = default;
+connection node_2;
+SET SESSION wsrep_sync_wait = default;
+connection node_1;
+DROP PROCEDURE proc_insert;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/mysql-wsrep#216.result b/mysql-test/suite/galera/r/mysql-wsrep#216.result
deleted file mode 100644
index b07589d0c04..00000000000
--- a/mysql-test/suite/galera/r/mysql-wsrep#216.result
+++ /dev/null
@@ -1,11 +0,0 @@
-SET GLOBAL wsrep_debug = ON;
-CREATE USER u1 IDENTIFIED BY 'plaintext_password';
-CREATE USER u1 IDENTIFIED BY 'plaintext_password';
-ERROR HY000: Operation CREATE USER failed for 'u1'@'%'
-0
-0
-2
-1
-DROP USER u1;
-CALL mtr.add_suppression('Operation CREATE USER failed');
- \ No newline at end of file
diff --git a/mysql-test/suite/galera/t/GCF-1081.test b/mysql-test/suite/galera/t/GCF-1081.test
index 8296c55f1b6..38553feda39 100644
--- a/mysql-test/suite/galera/t/GCF-1081.test
+++ b/mysql-test/suite/galera/t/GCF-1081.test
@@ -38,7 +38,7 @@ SET SESSION wsrep_sync_wait = 0;
# Issue a conflicting insert on node #2
--connection node_1a
-SET GLOBAL DEBUG = 'd,sync.wsrep_before_BF_victim_unlock';
+SET GLOBAL debug_dbug = 'd,sync.wsrep_before_BF_victim_unlock';
--connection node_2
--send INSERT INTO t1 VALUES (2, 2);
@@ -46,7 +46,7 @@ SET GLOBAL DEBUG = 'd,sync.wsrep_before_BF_victim_unlock';
# Wait until it BF aborts the SP
--connection node_1a
SET SESSION DEBUG_SYNC = 'now WAIT_FOR sync.wsrep_before_BF_victim_unlock_reached';
-SET GLOBAL DEBUG = '';
+SET GLOBAL debug_dbug = '';
# Unblock the SP
--connection node_1a
diff --git a/mysql-test/suite/galera/t/galera_sp_insert_parallel.test b/mysql-test/suite/galera/t/galera_sp_insert_parallel.test
new file mode 100644
index 00000000000..b6878a9c32a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sp_insert_parallel.test
@@ -0,0 +1,55 @@
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+
+DELIMITER |;
+CREATE PROCEDURE proc_insert()
+BEGIN
+ DECLARE i INT;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+
+ SET i = 0;
+ WHILE i < 1000 DO
+ INSERT IGNORE INTO t1 (f1, f2)
+ VALUES (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15)),
+ (FLOOR(1 + RAND() * 65535), FLOOR(1 + RAND() * 15));
+ SET i = i + 1;
+
+ END WHILE;
+END|
+DELIMITER ;|
+
+--connection node_1
+SELECT 0;
+SET SESSION wsrep_sync_wait = 0;
+--send CALL proc_insert
+--connection node_2
+SELECT 0;
+SET SESSION wsrep_sync_wait = 0;
+--send CALL proc_insert
+
+--connection node_1
+--error 0,ER_LOCK_DEADLOCK,ER_QUERY_INTERRUPTED
+--disable_warnings
+--reap
+--enable_warnings
+SET SESSION wsrep_sync_wait = default;
+--connection node_2
+--error 0,ER_LOCK_DEADLOCK,ER_QUERY_INTERRUPTED
+--disable_warnings
+--reap
+--enable_warnings
+SET SESSION wsrep_sync_wait = default;
+
+--connection node_1
+DROP PROCEDURE proc_insert;
+DROP TABLE t1;
diff --git a/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result b/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result
index 58d02e541af..8333fff98db 100644
--- a/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result
+++ b/mysql-test/suite/galera_3nodes_sr/r/GCF-832.result
@@ -5,9 +5,7 @@ connection node_1;
connection node_2;
connection node_3;
connection node_2;
-SET GLOBAL debug="d,crash_last_fragment_commit_after_fragment_removal";
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal";
CREATE TABLE t1 (f1 VARCHAR(30)) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
SET SESSION wsrep_trx_fragment_size=1;
diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-810A.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-810A.test
index 38d95556e48..fda16b7265c 100644
--- a/mysql-test/suite/galera_3nodes_sr/t/GCF-810A.test
+++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-810A.test
@@ -16,7 +16,7 @@
--connection node_2
--enable_reconnect
-SET GLOBAL debug="d,crash_last_fragment_commit_before_fragment_removal";
+SET GLOBAL debug_dbug="d,crash_last_fragment_commit_before_fragment_removal";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes.inc
@@ -39,7 +39,7 @@ COMMIT;
#
--connection node_2
-SET GLOBAL debug="d,crash_last_fragment_commit_after_fragment_removal";
+SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes.inc
@@ -66,7 +66,7 @@ COMMIT;
#
# --connection node_2
-# SET GLOBAL debug="d,crash_last_fragment_commit_success";
+# SET GLOBAL debug_dbug="d,crash_last_fragment_commit_success";
# --source suite/galera_3nodes/include/galera_expect_node_crash.inc
# --source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes.inc
@@ -84,7 +84,7 @@ COMMIT;
#
--connection node_2
-SET GLOBAL debug="d,crash_replicate_fragment_success";
+SET GLOBAL debug_dbug="d,crash_replicate_fragment_success";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes.inc
@@ -102,7 +102,7 @@ COMMIT;
#
--connection node_2
-SET GLOBAL debug="d,crash_replicate_fragment_after_certify";
+SET GLOBAL debug_dbug="d,crash_replicate_fragment_after_certify";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes.inc
@@ -120,7 +120,7 @@ COMMIT;
#
--connection node_2
-SET GLOBAL debug="d,crash_replicate_fragment_before_certify";
+SET GLOBAL debug_dbug="d,crash_replicate_fragment_before_certify";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes.inc
diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-810B.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-810B.test
index 24a518af9f7..cb41b2348de 100644
--- a/mysql-test/suite/galera_3nodes_sr/t/GCF-810B.test
+++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-810B.test
@@ -15,7 +15,7 @@
#
--connection node_3
-SET GLOBAL debug="d,crash_apply_cb_before_append_frag";
+SET GLOBAL debug_dbug="d,crash_apply_cb_before_append_frag";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes2.inc
@@ -32,7 +32,7 @@ COMMIT;
#
--connection node_3
-SET GLOBAL debug="d,crash_apply_cb_after_append_frag";
+SET GLOBAL debug_dbug="d,crash_apply_cb_after_append_frag";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes2.inc
diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-810C.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-810C.test
index 79948e5a46d..6c4da2cb5f0 100644
--- a/mysql-test/suite/galera_3nodes_sr/t/GCF-810C.test
+++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-810C.test
@@ -16,7 +16,7 @@
#
--connection node_3
-SET GLOBAL debug="d,crash_commit_cb_last_fragment_commit_success";
+SET GLOBAL debug_dbug="d,crash_commit_cb_last_fragment_commit_success";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes3.inc
@@ -30,7 +30,7 @@ SET GLOBAL debug="d,crash_commit_cb_last_fragment_commit_success";
#
--connection node_3
-SET GLOBAL debug="d,crash_commit_cb_before_last_fragment_commit";
+SET GLOBAL debug_dbug="d,crash_commit_cb_before_last_fragment_commit";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes3.inc
@@ -44,7 +44,7 @@ SET GLOBAL debug="d,crash_commit_cb_before_last_fragment_commit";
#
--connection node_3
-SET GLOBAL debug="d,crash_apply_cb_after_fragment_removal";
+SET GLOBAL debug_dbug="d,crash_apply_cb_after_fragment_removal";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes3.inc
@@ -58,7 +58,7 @@ SET GLOBAL debug="d,crash_apply_cb_after_fragment_removal";
#
--connection node_3
-SET GLOBAL debug="d,crash_apply_cb_before_fragment_removal";
+SET GLOBAL debug_dbug="d,crash_apply_cb_before_fragment_removal";
--source suite/galera_3nodes/include/galera_expect_node_crash.inc
--source suite/galera_3nodes/include/galera_sr_crash_prepare_nodes3.inc
diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test
index c5a6346d6a1..eb7f5603452 100644
--- a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test
+++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test
@@ -13,7 +13,7 @@
--source ../galera/include/auto_increment_offset_save.inc
--connection node_2
-SET GLOBAL debug="d,crash_last_fragment_commit_after_fragment_removal";
+SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal";
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result
index 41657d7340a..3f463875eb3 100644
--- a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result
+++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result
@@ -6,9 +6,7 @@ SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SET SESSION wsrep_sync_wait = 0;
-SET GLOBAL debug = '+d,sync.wsrep_apply_cb';
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET GLOBAL debug_dbug = '+d,sync.wsrep_apply_cb';
connection node_1;
SET SESSION wsrep_trx_fragment_size = 1;
SET AUTOCOMMIT=OFF;
@@ -29,9 +27,7 @@ INSERT INTO t1 VALUES (1);;
connection node_1;
COMMIT;
connection node_2a;
-SET GLOBAL debug = '';
-Warnings:
-Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+SET GLOBAL debug_dbug = '';
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2;
Got one of the listed errors
diff --git a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#35.test b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#35.test
index c5cf1dea0ae..f63e1cca70c 100644
--- a/mysql-test/suite/galera_sr/t/mysql-wsrep-features#35.test
+++ b/mysql-test/suite/galera_sr/t/mysql-wsrep-features#35.test
@@ -9,7 +9,7 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
SELECT COUNT(*) = 0 FROM t1;
SET SESSION wsrep_sync_wait = 0;
-SET GLOBAL debug = '+d,sync.wsrep_apply_cb';
+SET GLOBAL debug_dbug = '+d,sync.wsrep_apply_cb';
--connection node_1
SET SESSION wsrep_trx_fragment_size = 1;
@@ -34,7 +34,7 @@ SELECT COUNT(*) = 0 FROM t1;
COMMIT;
--connection node_2a
-SET GLOBAL debug = '';
+SET GLOBAL debug_dbug = '';
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
--connection node_2
diff --git a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
index 516ac333a87..56a1df7ce5d 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
@@ -8,7 +8,7 @@ ALGORITHM=COPY;
ERROR 01000: Data truncated for column 'i1' at row 1
ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY(id), ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
ALTER IGNORE TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows. Try ALGORITHM=COPY
SET @old_sql_mode = @@sql_mode;
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index a65760828be..56f80a4de3e 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -515,7 +515,7 @@ ERROR 42000: Incorrect column name 'FTS_DOC_ID'
ALTER TABLE t1o ADD FULLTEXT INDEX(ct),
CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
CREATE TABLE t1n LIKE t1o;
ALTER TABLE t1n ADD FULLTEXT INDEX(ct);
ALTER TABLE t1n CHANGE c1 Fts_DOC_ID INT, ALGORITHM=INPLACE;
@@ -588,7 +588,7 @@ t1n CREATE TABLE `t1n` (
DROP TABLE t1n;
ALTER TABLE t1o MODIFY c1 BIGINT UNSIGNED NOT NULL, DROP INDEX ct,
ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
ALTER TABLE t1o MODIFY c1 BIGINT UNSIGNED NOT NULL, DROP INDEX ct;
ALTER TABLE t1o CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
index daa3ffc0a9f..0855d6b5148 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
@@ -781,7 +781,7 @@ ERROR 42000: Incorrect column name 'FTS_Doc_ID'
ALTER TABLE t1o ADD FULLTEXT INDEX(ct),
CHANGE c1 FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
CREATE TABLE t1n LIKE t1o;
ALTER TABLE t1n ADD FULLTEXT INDEX(ct);
### files in MYSQL_DATA_DIR/test
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index 0eb66fa22b5..30eddd51bfb 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -830,7 +830,7 @@ SELECT table_id INTO @table_id2 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t1';
affected rows: 1
ALTER TABLE t1 CHANGE m i INT, ALGORITHM=INSTANT;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
ALTER TABLE t1 CHANGE m i INT;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
@@ -1654,7 +1654,7 @@ SELECT table_id INTO @table_id2 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t1';
affected rows: 1
ALTER TABLE t1 CHANGE m i INT, ALGORITHM=INSTANT;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
ALTER TABLE t1 CHANGE m i INT;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
@@ -2478,7 +2478,7 @@ SELECT table_id INTO @table_id2 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
WHERE name = 'test/t1';
affected rows: 1
ALTER TABLE t1 CHANGE m i INT, ALGORITHM=INSTANT;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
ALTER TABLE t1 CHANGE m i INT;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
diff --git a/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff b/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff
index 82a5ca95986..935b5dbf78c 100644
--- a/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff
@@ -4,7 +4,7 @@
alter table boundary_255
modify b varchar(200) charset utf8mb3,
algorithm=instant;
--ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table boundary_255
modify c varchar(300) charset utf8mb3,
algorithm=instant;
diff --git a/mysql-test/suite/innodb/r/instant_alter_charset.result b/mysql-test/suite/innodb/r/instant_alter_charset.result
index 268848f31ec..6242b167412 100644
--- a/mysql-test/suite/innodb/r/instant_alter_charset.result
+++ b/mysql-test/suite/innodb/r/instant_alter_charset.result
@@ -54,7 +54,7 @@ algorithm=inplace;
alter table various_cases
change a a varchar(222),
algorithm=inplace;
-ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table various_cases
change b b varchar(150) as (a) virtual,
algorithm=inplace;
@@ -65,7 +65,7 @@ ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITH
alter table various_cases
modify a char(150) charset utf8mb4,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table various_cases;
create table all_texts (
a tinytext charset ascii,
@@ -87,17 +87,17 @@ e varbinary(150),
f binary(150)
) engine=innodb;
alter table all_binaries modify a tinytext, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_binaries modify b text, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_binaries modify c mediumtext, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_binaries modify d longtext, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_binaries modify e varchar(150), algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_binaries modify f char(150), algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table all_binaries;
create table all_strings (
a tinytext,
@@ -108,29 +108,29 @@ e varchar(150),
f char(150)
) engine=innodb;
alter table all_strings modify a tinyblob, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify b blob, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify c mediumblob, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify d longblob, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify e varbinary(150), algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify f binary(150), algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify a tinytext charset binary, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify b text charset binary, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify c mediumtext charset binary, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify d longtext charset binary, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify e varchar(150) charset binary, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table all_strings modify f char(150) charset binary, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table all_strings;
create table key_part_change (
a char(150) charset ascii,
@@ -143,7 +143,7 @@ modify a char(150) charset utf8mb4,
drop index ab,
add unique key ab(a,c),
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table key_part_change;
create table key_part_change_and_rename (
a char(100) charset ascii,
@@ -156,7 +156,7 @@ change b a char(100) charset utf8mb4,
drop index ab,
add unique key ab(a,b),
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table key_part_change_and_rename;
create table enum_and_set (
a enum('one', 'two') charset utf8mb3,
@@ -165,11 +165,11 @@ b set('three', 'four') charset utf8mb3
alter table enum_and_set
modify a enum('one', 'two') charset utf8mb4,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table enum_and_set
modify b enum('three', 'four') charset utf8mb4,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table enum_and_set;
create table compressed (
a varchar(255) charset utf8mb3 compressed
@@ -254,7 +254,7 @@ algorithm=instant;
alter table boundary_255
modify b varchar(200) charset utf8mb3,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table boundary_255
modify c varchar(300) charset utf8mb3,
algorithm=instant;
@@ -1080,11 +1080,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_bin,
@@ -1097,11 +1097,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_nopad_ci,
@@ -1114,11 +1114,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_nopad_bin,
@@ -1131,11 +1131,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1148,11 +1148,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset koi8u collate koi8u_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset koi8u collate koi8u_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_nopad_ci,
@@ -1165,11 +1165,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset koi8u collate koi8u_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset koi8u collate koi8u_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_nopad_bin,
@@ -1182,11 +1182,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset koi8u collate koi8u_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset koi8u collate koi8u_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1199,11 +1199,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset latin1 collate latin1_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_bin,
@@ -1216,11 +1216,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_nopad_ci,
@@ -1233,11 +1233,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_nopad_bin,
@@ -1250,11 +1250,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb3 collate utf8mb3_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1267,11 +1267,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_bin,
@@ -1284,11 +1284,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_nopad_ci,
@@ -1301,11 +1301,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_nopad_bin,
@@ -1318,11 +1318,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_danish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb3 collate utf8mb3_general_ci,
@@ -1335,11 +1335,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb3 collate utf8mb3_bin,
@@ -1352,11 +1352,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb3 collate utf8mb3_general_nopad_ci,
@@ -1369,11 +1369,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb3 collate utf8mb3_nopad_bin,
@@ -1386,11 +1386,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1403,11 +1403,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset gbk collate gbk_chinese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset gbk collate gbk_chinese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1420,11 +1420,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset gbk collate gbk_chinese_nopad_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset gbk collate gbk_chinese_nopad_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ucs2 collate ucs2_myanmar_ci,
@@ -1437,11 +1437,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf16 collate utf16_thai_520_w2,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf16 collate utf16_thai_520_w2,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ucs2 collate ucs2_general_ci,
@@ -1454,11 +1454,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf16 collate utf16_unicode_nopad_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf16 collate utf16_unicode_nopad_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ucs2 collate ucs2_general_mysql500_ci,
@@ -1471,11 +1471,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf16 collate utf16_spanish2_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf16 collate utf16_spanish2_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1488,11 +1488,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset ascii collate ascii_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset ascii collate ascii_bin,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb3 collate utf8mb3_roman_ci,
@@ -1505,11 +1505,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb3 collate utf8mb3_lithuanian_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb3 collate utf8mb3_lithuanian_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb4 collate utf8mb4_thai_520_w2,
@@ -1522,11 +1522,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_persian_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_persian_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb3 collate utf8mb3_myanmar_ci,
@@ -1539,11 +1539,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb4 collate utf8mb4_german2_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb4 collate utf8mb4_german2_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf8mb3 collate utf8mb3_general_ci,
@@ -1556,11 +1556,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf8mb3 collate utf8mb3_unicode_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf8mb3 collate utf8mb3_unicode_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset latin1 collate latin1_general_cs,
@@ -1573,11 +1573,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset latin1 collate latin1_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset latin1 collate latin1_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1590,11 +1590,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset ujis collate ujis_japanese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset ujis collate ujis_japanese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1607,11 +1607,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset big5 collate big5_chinese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset big5 collate big5_chinese_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1624,11 +1624,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset latin2 collate latin2_croatian_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset latin2 collate latin2_croatian_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset ascii collate ascii_general_ci,
@@ -1641,11 +1641,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset latin7 collate latin7_estonian_cs,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset latin7 collate latin7_estonian_cs,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(50) charset utf16 collate utf16_general_ci,
@@ -1658,11 +1658,11 @@ algorithm=instant;
alter table tmp
modify b varchar(50) charset utf16 collate utf16_german2_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify c varchar(50) charset utf16 collate utf16_german2_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
drop table compatible_without_index;
create table fully_incompatible (
@@ -1691,11 +1691,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset utf8mb3 collate utf8mb3_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset utf8mb3 collate utf8mb3_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset utf8mb4 collate utf8mb4_general_ci,
@@ -1705,11 +1705,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset ascii collate ascii_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset ascii collate ascii_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset utf8mb3 collate utf8mb3_general_ci,
@@ -1719,11 +1719,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset ascii collate ascii_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset ascii collate ascii_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset utf8mb3 collate utf8mb3_general_ci,
@@ -1733,11 +1733,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset latin1 collate latin1_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset latin1 collate latin1_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset utf16 collate utf16_general_ci,
@@ -1747,11 +1747,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset utf32 collate utf32_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset utf32 collate utf32_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset latin1 collate latin1_general_ci,
@@ -1761,11 +1761,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset ascii collate ascii_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset ascii collate ascii_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset ascii collate ascii_general_ci,
@@ -1775,11 +1775,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset swe7 collate swe7_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset swe7 collate swe7_swedish_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset eucjpms collate eucjpms_japanese_nopad_ci,
@@ -1789,11 +1789,11 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset geostd8 collate geostd8_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset geostd8 collate geostd8_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
create table tmp (
a varchar(150) charset latin1 collate latin1_general_ci,
@@ -1803,10 +1803,10 @@ unique key b_idx (b(150))
alter table tmp
change a a varchar(150) charset utf16 collate utf16_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table tmp
modify b text charset utf16 collate utf16_general_ci,
algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
drop table tmp;
drop table fully_incompatible;
diff --git a/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff b/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff
index ad7ad0e1c66..596dfe43ab8 100644
--- a/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_extend,utf8.rdiff
@@ -17,7 +17,7 @@
+a 13 2100FE 660
# Convert from VARCHAR to a bigger CHAR
alter table t modify a varchar(200), algorithm=instant;
- ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
+ ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
@@ -72,7 +72,7 @@
test.t check status OK
call check_table('t');
diff --git a/mysql-test/suite/innodb/r/instant_alter_extend.result b/mysql-test/suite/innodb/r/instant_alter_extend.result
index ca8e566f19c..9136bc7e89c 100644
--- a/mysql-test/suite/innodb/r/instant_alter_extend.result
+++ b/mysql-test/suite/innodb/r/instant_alter_extend.result
Binary files differ
diff --git a/mysql-test/suite/innodb/t/drop_table_background.test b/mysql-test/suite/innodb/t/drop_table_background.test
index 8d82bea9675..20101dada84 100644
--- a/mysql-test/suite/innodb/t/drop_table_background.test
+++ b/mysql-test/suite/innodb/t/drop_table_background.test
@@ -3,6 +3,8 @@
# Embedded server does not support restarting
--source include/not_embedded.inc
+let $MYSQLD_DATADIR=`select @@datadir`;
+
CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT,
KEY(c1), KEY(c2), KEY(c2,c1),
KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1),
@@ -32,7 +34,9 @@ CREATE TABLE target (PRIMARY KEY(c1)) ENGINE=InnoDB SELECT * FROM t;
--error ER_NO_SUCH_TABLE
SELECT * from target;
DROP TABLE t;
---source include/restart_mysqld.inc
+--source include/shutdown_mysqld.inc
+--remove_files_wildcard $MYSQLD_DATADIR/test #sql-*.ibd
+--source include/start_mysqld.inc
CREATE TABLE t (a INT) ENGINE=InnoDB;
DROP TABLE t;
--error ER_BAD_TABLE_ERROR
diff --git a/mysql-test/suite/innodb/t/undo_truncate_recover.test b/mysql-test/suite/innodb/t/undo_truncate_recover.test
index 9f8cd7d81a3..a143c25eaf0 100644
--- a/mysql-test/suite/innodb/t/undo_truncate_recover.test
+++ b/mysql-test/suite/innodb/t/undo_truncate_recover.test
@@ -2,18 +2,14 @@
# WL#6965: Truncate UNDO logs.
#
+--source include/big_test.inc
# With larger innodb_page_size, the undo log tablespaces do not grow enough.
--source include/innodb_page_size_small.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_undo_tablespaces.inc
-
-# Valgrind would complain about memory leaks when we crash on purpose.
---source include/not_valgrind.inc
-# Embedded server does not support crashing
+# Tests with embedded server do not support restarting
--source include/not_embedded.inc
-# Avoid CrashReporter popup on Mac
---source include/not_crashrep.inc
SET GLOBAL innodb_undo_logs = 4;
SET GLOBAL innodb_undo_log_truncate = 1;
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_install.result b/mysql-test/suite/plugins/r/feedback_plugin_install.result
index ee74435e05a..c7f7a5c79f3 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_install.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_install.result
@@ -6,7 +6,7 @@ select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid'
and variable_name not like '%debug%';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK used 1
+FEEDBACK used 2
FEEDBACK version 1.1
FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result
index 330f4325f76..2b8fc03b931 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_load.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result
@@ -4,7 +4,7 @@ ACTIVE
SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
variable_value = @feedback_used + 1
-1
+0
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'
and variable_name not like '%debug%';
diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result
index b09af006e70..0bdf94335d5 100644
--- a/mysql-test/suite/plugins/r/feedback_plugin_send.result
+++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result
@@ -4,7 +4,7 @@ ACTIVE
SELECT variable_value INTO @feedback_used FROM information_schema.feedback where variable_name = 'FEEDBACK used';
SELECT variable_value = @feedback_used + 1 FROM information_schema.feedback where variable_name = 'FEEDBACK used';
variable_value = @feedback_used + 1
-1
+0
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid' and variable_name not like 'FEEDBACK used'
and variable_name not like '%debug%';
@@ -25,5 +25,6 @@ VARIABLE_VALUE>0 VARIABLE_NAME
1 Collation used utf8_bin
1 Collation used utf8_general_ci
set global sql_mode=ONLY_FULL_GROUP_BY;
+# restart
6: feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent
6: feedback plugin: server replied 'ok'
diff --git a/mysql-test/suite/storage_engine/alter_table_online.result b/mysql-test/suite/storage_engine/alter_table_online.result
index 574c46f8cda..2a27c5d108e 100644
--- a/mysql-test/suite/storage_engine/alter_table_online.result
+++ b/mysql-test/suite/storage_engine/alter_table_online.result
@@ -24,7 +24,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <CHAR_COLUMN>) ENGINE=<STORAG
INSERT INTO t1 (a,b,c) VALUES (1,100,'a'),(2,200,'b'),(3,300,'c');
ALTER ONLINE TABLE t1 DROP COLUMN b, ADD b <INT_COLUMN>;
ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED.
+ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type. Try LOCK=SHARED.
ALTER ONLINE TABLE t1 ENGINE=MEMORY;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
DROP TABLE t1;
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index 54b0d85b552..4df856c8b14 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -65,7 +65,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
File file= -1;
DBUG_ENTER("create_temp_file");
- DBUG_PRINT("enter", ("dir: %s, prefix: %s", dir, prefix));
+ DBUG_PRINT("enter", ("dir: %s, prefix: %s", dir ? dir : "(null)", prefix));
DBUG_ASSERT((mode & (O_EXCL | O_TRUNC | O_CREAT | O_RDWR)) == 0);
mode|= O_TRUNC | O_CREAT | O_RDWR; /* not O_EXCL, see Windows code below */
@@ -110,6 +110,8 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
}
#elif defined(HAVE_MKSTEMP)
+ if (!dir && ! (dir =getenv("TMPDIR")))
+ dir= DEFAULT_TMPDIR;
#ifdef O_TMPFILE
{
static int O_TMPFILE_works= 1;
@@ -146,8 +148,6 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
prefix ? prefix : "tmp.",
sizeof(prefix_buff)-7),"XXXXXX") -
prefix_buff);
- if (!dir && ! (dir =getenv("TMPDIR")))
- dir= DEFAULT_TMPDIR;
if (strlen(dir)+ pfx_len > FN_REFLEN-2)
{
errno=my_errno= ENAMETOOLONG;
diff --git a/sql/field.cc b/sql/field.cc
index 14b57b73ecc..4a93464b2e8 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -58,19 +58,25 @@ const char field_separator=',';
((ulong) ((1LL << MY_MIN(arg, 4) * 8) - 1))
// Column marked for read or the field set to read out or record[0] or [1]
-#define ASSERT_COLUMN_MARKED_FOR_READ \
- DBUG_ASSERT(!table || \
- (!table->read_set || \
- bitmap_is_set(table->read_set, field_index) || \
- (!(ptr >= table->record[0] && \
- ptr < table->record[0] + table->s->reclength))))
-
-#define ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED \
- DBUG_ASSERT(is_stat_field || !table || \
- (!table->write_set || \
- bitmap_is_set(table->write_set, field_index) || \
- (!(ptr >= table->record[0] && \
- ptr < table->record[0] + table->s->reclength))))
+inline bool Field::marked_for_read() const
+{
+ return !table ||
+ (!table->read_set ||
+ bitmap_is_set(table->read_set, field_index) ||
+ (!(ptr >= table->record[0] &&
+ ptr < table->record[0] + table->s->reclength)));
+}
+
+
+inline bool Field::marked_for_write_or_computed() const
+{
+ return is_stat_field || !table ||
+ (!table->write_set ||
+ bitmap_is_set(table->write_set, field_index) ||
+ (!(ptr >= table->record[0] &&
+ ptr < table->record[0] + table->s->reclength)));
+}
+
#define FLAGSTR(S,F) ((S) & (F) ? #F " " : "")
@@ -1686,7 +1692,7 @@ int Field::warn_if_overflow(int op_result)
String *Field::val_int_as_str(String *val_buffer, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
CHARSET_INFO *cs= &my_charset_bin;
uint length;
longlong value= val_int();
@@ -2034,7 +2040,7 @@ longlong Field::convert_decimal2longlong(const my_decimal *val,
int Field_int::store_decimal(const my_decimal *val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int err= 0;
longlong i= convert_decimal2longlong(val, unsigned_flag, &err);
return MY_TEST(err | store(i, unsigned_flag));
@@ -2057,7 +2063,7 @@ int Field_int::store_decimal(const my_decimal *val)
my_decimal* Field_int::val_decimal(my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
longlong nr= val_int();
int2my_decimal(E_DEC_FATAL_ERROR, nr, unsigned_flag, decimal_value);
return decimal_value;
@@ -2066,7 +2072,7 @@ my_decimal* Field_int::val_decimal(my_decimal *decimal_value)
bool Field_int::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
Longlong_hybrid nr(val_int(), (flags & UNSIGNED_FLAG));
return int_to_datetime_with_warn(get_thd(), nr, ltime,
fuzzydate, table->s, field_name.str);
@@ -2075,7 +2081,7 @@ bool Field_int::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate)
bool Field_vers_trx_id::get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate, ulonglong trx_id)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
DBUG_ASSERT(ltime);
if (!table || !table->s)
return true;
@@ -2201,7 +2207,7 @@ void Field_num::make_send_field(Send_field *field)
int Field_str::store_decimal(const my_decimal *d)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
double val;
/* TODO: use decimal2string? */
int err= warn_if_overflow(my_decimal2double(E_DEC_FATAL_ERROR &
@@ -2212,7 +2218,7 @@ int Field_str::store_decimal(const my_decimal *d)
my_decimal *Field_str::val_decimal(my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
longlong nr= val_int();
int2my_decimal(E_DEC_FATAL_ERROR, nr, 0, decimal_value);
return decimal_value;
@@ -2271,7 +2277,7 @@ bool Field::get_date(MYSQL_TIME *to, date_mode_t mode)
int Field::store_time_dec(const MYSQL_TIME *ltime, uint dec)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
char buff[MAX_DATE_STRING_REP_LENGTH];
uint length= (uint) my_TIME_to_str(ltime, buff, dec);
/* Avoid conversion when field character set is ASCII compatible */
@@ -2528,7 +2534,7 @@ void Field_decimal::overflow(bool negative)
int Field_decimal::store(const char *from_arg, size_t len, CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
char buff[STRING_BUFFER_USUAL_SIZE];
String tmp(buff,sizeof(buff), &my_charset_bin);
const uchar *from= (uchar*) from_arg;
@@ -2894,7 +2900,7 @@ int Field_decimal::store(const char *from_arg, size_t len, CHARSET_INFO *cs)
int Field_decimal::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
if (unsigned_flag && nr < 0)
{
overflow(1);
@@ -2932,7 +2938,7 @@ int Field_decimal::store(double nr)
int Field_decimal::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
char buff[22];
uint length, int_part;
char fyllchar;
@@ -2968,7 +2974,7 @@ int Field_decimal::store(longlong nr, bool unsigned_val)
double Field_decimal::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int not_used;
char *end_not_used;
return my_strntod(&my_charset_bin, (char*) ptr, field_length, &end_not_used,
@@ -2977,7 +2983,7 @@ double Field_decimal::val_real(void)
longlong Field_decimal::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int not_used;
if (unsigned_flag)
return my_strntoull(&my_charset_bin, (char*) ptr, field_length, 10, NULL,
@@ -2990,7 +2996,7 @@ longlong Field_decimal::val_int(void)
String *Field_decimal::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
uchar *str;
size_t tmp_length;
@@ -3175,7 +3181,7 @@ void Field_new_decimal::set_value_on_overflow(my_decimal *decimal_value,
bool Field_new_decimal::store_value(const my_decimal *decimal_value,
int *native_error)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
DBUG_ENTER("Field_new_decimal::store_value");
#ifndef DBUG_OFF
@@ -3233,7 +3239,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
int Field_new_decimal::store(const char *from, size_t length,
CHARSET_INFO *charset_arg)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
my_decimal decimal_value;
THD *thd= get_thd();
DBUG_ENTER("Field_new_decimal::store(char*)");
@@ -3317,7 +3323,7 @@ int Field_new_decimal::store(const char *from, size_t length,
int Field_new_decimal::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
my_decimal decimal_value;
int err;
THD *thd= get_thd();
@@ -3342,7 +3348,7 @@ int Field_new_decimal::store(double nr)
int Field_new_decimal::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
my_decimal decimal_value;
int err;
@@ -3364,7 +3370,7 @@ int Field_new_decimal::store(longlong nr, bool unsigned_val)
int Field_new_decimal::store_decimal(const my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
return store_value(decimal_value);
}
@@ -3378,7 +3384,7 @@ int Field_new_decimal::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
DBUG_ENTER("Field_new_decimal::val_decimal");
binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value,
precision, dec);
@@ -3581,7 +3587,7 @@ int Field_int::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
int Field_tiny::store(const char *from,size_t len,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error;
longlong rnd;
@@ -3593,7 +3599,7 @@ int Field_tiny::store(const char *from,size_t len,CHARSET_INFO *cs)
int Field_tiny::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
nr=rint(nr);
if (unsigned_flag)
@@ -3636,7 +3642,7 @@ int Field_tiny::store(double nr)
int Field_tiny::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
if (unsigned_flag)
@@ -3681,7 +3687,7 @@ int Field_tiny::store(longlong nr, bool unsigned_val)
double Field_tiny::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int tmp= unsigned_flag ? (int) ptr[0] :
(int) ((signed char*) ptr)[0];
return (double) tmp;
@@ -3690,7 +3696,7 @@ double Field_tiny::val_real(void)
longlong Field_tiny::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int tmp= unsigned_flag ? (int) ptr[0] :
(int) ((signed char*) ptr)[0];
return (longlong) tmp;
@@ -3700,7 +3706,7 @@ longlong Field_tiny::val_int(void)
String *Field_tiny::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
long nr= unsigned_flag ? (long) ptr[0] : (long) ((signed char*) ptr)[0];
return val_str_from_long(val_buffer, 5, -10, nr);
}
@@ -3741,7 +3747,7 @@ void Field_tiny::sql_type(String &res) const
int Field_short::store(const char *from,size_t len,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int store_tmp;
int error;
longlong rnd;
@@ -3755,7 +3761,7 @@ int Field_short::store(const char *from,size_t len,CHARSET_INFO *cs)
int Field_short::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
int16 res;
nr=rint(nr);
@@ -3800,7 +3806,7 @@ int Field_short::store(double nr)
int Field_short::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
int16 res;
@@ -3848,7 +3854,7 @@ int Field_short::store(longlong nr, bool unsigned_val)
double Field_short::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
short j;
j=sint2korr(ptr);
return unsigned_flag ? (double) (unsigned short) j : (double) j;
@@ -3856,7 +3862,7 @@ double Field_short::val_real(void)
longlong Field_short::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
short j;
j=sint2korr(ptr);
return unsigned_flag ? (longlong) (unsigned short) j : (longlong) j;
@@ -3866,7 +3872,7 @@ longlong Field_short::val_int(void)
String *Field_short::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
short j= sint2korr(ptr);
long nr= unsigned_flag ? (long) (unsigned short) j : (long) j;
return val_str_from_long(val_buffer, 7, -10, nr);
@@ -3915,7 +3921,7 @@ void Field_short::sql_type(String &res) const
int Field_medium::store(const char *from,size_t len,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int store_tmp;
int error;
longlong rnd;
@@ -3929,7 +3935,7 @@ int Field_medium::store(const char *from,size_t len,CHARSET_INFO *cs)
int Field_medium::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
nr=rint(nr);
if (unsigned_flag)
@@ -3975,7 +3981,7 @@ int Field_medium::store(double nr)
int Field_medium::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
if (unsigned_flag)
@@ -4024,7 +4030,7 @@ int Field_medium::store(longlong nr, bool unsigned_val)
double Field_medium::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
long j= unsigned_flag ? (long) uint3korr(ptr) : sint3korr(ptr);
return (double) j;
}
@@ -4032,7 +4038,7 @@ double Field_medium::val_real(void)
longlong Field_medium::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
long j= unsigned_flag ? (long) uint3korr(ptr) : sint3korr(ptr);
return (longlong) j;
}
@@ -4041,7 +4047,7 @@ longlong Field_medium::val_int(void)
String *Field_medium::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
long nr= unsigned_flag ? (long) uint3korr(ptr) : sint3korr(ptr);
return val_str_from_long(val_buffer, 10, -10, nr);
}
@@ -4067,7 +4073,7 @@ String *Field_int::val_str_from_long(String *val_buffer,
bool Field_medium::send_binary(Protocol *protocol)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return protocol->store_long(Field_medium::val_int());
}
@@ -4113,7 +4119,7 @@ void Field_medium::sql_type(String &res) const
int Field_long::store(const char *from,size_t len,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
long store_tmp;
int error;
longlong rnd;
@@ -4127,7 +4133,7 @@ int Field_long::store(const char *from,size_t len,CHARSET_INFO *cs)
int Field_long::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
int32 res;
nr=rint(nr);
@@ -4172,7 +4178,7 @@ int Field_long::store(double nr)
int Field_long::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
int32 res;
@@ -4218,7 +4224,7 @@ int Field_long::store(longlong nr, bool unsigned_val)
double Field_long::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int32 j;
j=sint4korr(ptr);
return unsigned_flag ? (double) (uint32) j : (double) j;
@@ -4226,7 +4232,7 @@ double Field_long::val_real(void)
longlong Field_long::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int32 j;
/* See the comment in Field_long::store(long long) */
DBUG_ASSERT(!table || table->in_use == current_thd);
@@ -4238,7 +4244,7 @@ longlong Field_long::val_int(void)
String *Field_long::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
long nr= unsigned_flag ? (long) uint4korr(ptr) : sint4korr(ptr);
return val_str_from_long(val_buffer, 12, unsigned_flag ? 10 : -10, nr);
}
@@ -4246,7 +4252,7 @@ String *Field_long::val_str(String *val_buffer,
bool Field_long::send_binary(Protocol *protocol)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return protocol->store_long(Field_long::val_int());
}
@@ -4286,7 +4292,7 @@ void Field_long::sql_type(String &res) const
int Field_longlong::store(const char *from,size_t len,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
char *end;
ulonglong tmp;
@@ -4309,7 +4315,7 @@ int Field_longlong::store(const char *from,size_t len,CHARSET_INFO *cs)
int Field_longlong::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
Converter_double_to_longlong conv(nr, unsigned_flag);
if (unlikely(conv.error()))
@@ -4322,7 +4328,7 @@ int Field_longlong::store(double nr)
int Field_longlong::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
if (unlikely(nr < 0)) // Only possible error
@@ -4346,7 +4352,7 @@ int Field_longlong::store(longlong nr, bool unsigned_val)
double Field_longlong::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
longlong j;
j=sint8korr(ptr);
/* The following is open coded to avoid a bug in gcc 3.3 */
@@ -4361,7 +4367,7 @@ double Field_longlong::val_real(void)
longlong Field_longlong::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
longlong j;
j=sint8korr(ptr);
return j;
@@ -4391,7 +4397,7 @@ String *Field_longlong::val_str(String *val_buffer,
bool Field_longlong::send_binary(Protocol *protocol)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return protocol->store_longlong(Field_longlong::val_int(), unsigned_flag);
}
@@ -4433,14 +4439,14 @@ void Field_longlong::sql_type(String &res) const
void Field_longlong::set_max()
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
set_notnull();
int8store(ptr, unsigned_flag ? ULONGLONG_MAX : LONGLONG_MAX);
}
bool Field_longlong::is_max()
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
if (unsigned_flag)
{
ulonglong j;
@@ -4470,7 +4476,7 @@ int Field_float::store(const char *from,size_t len,CHARSET_INFO *cs)
int Field_float::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= truncate_double(&nr, field_length,
not_fixed ? NOT_FIXED_DEC : dec,
unsigned_flag, FLT_MAX);
@@ -4499,7 +4505,7 @@ int Field_float::store(longlong nr, bool unsigned_val)
double Field_float::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
float j;
float4get(j,ptr);
return ((double) j);
@@ -4516,7 +4522,7 @@ longlong Field_float::val_int(void)
String *Field_float::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
float nr;
float4get(nr,ptr);
@@ -4598,7 +4604,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
bool Field_float::send_binary(Protocol *protocol)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return protocol->store((float) Field_float::val_real(), dec, (String*) 0);
}
@@ -4649,7 +4655,7 @@ int Field_double::store(const char *from,size_t len,CHARSET_INFO *cs)
int Field_double::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= truncate_double(&nr, field_length,
not_fixed ? NOT_FIXED_DEC : dec,
unsigned_flag, DBL_MAX);
@@ -4803,7 +4809,7 @@ int Field_real::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
double Field_double::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
double j;
float8get(j,ptr);
return j;
@@ -4821,7 +4827,7 @@ longlong Field_double::val_int_from_real(bool want_unsigned_result)
my_decimal *Field_real::val_decimal(my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
double2my_decimal(E_DEC_FATAL_ERROR, val_real(), decimal_value);
return decimal_value;
}
@@ -4829,7 +4835,7 @@ my_decimal *Field_real::val_decimal(my_decimal *decimal_value)
bool Field_real::get_date(MYSQL_TIME *ltime,date_mode_t fuzzydate)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
double nr= val_real();
return double_to_datetime_with_warn(get_thd(), nr, ltime, fuzzydate,
table->s, field_name.str);
@@ -4859,7 +4865,7 @@ Item *Field_real::get_equal_const_item(THD *thd, const Context &ctx,
String *Field_double::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
double nr;
float8get(nr,ptr);
@@ -5017,7 +5023,7 @@ int Field_timestamp::save_in_field(Field *to)
my_time_t Field_timestamp::get_timestamp(const uchar *pos,
ulong *sec_part) const
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
*sec_part= 0;
return sint4korr(pos);
}
@@ -5025,7 +5031,7 @@ my_time_t Field_timestamp::get_timestamp(const uchar *pos,
bool Field_timestamp::val_native(Native *to)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
my_time_t sec= (my_time_t) sint4korr(ptr);
return Timestamp_or_zero_datetime(Timestamp(sec, 0), sec == 0).
to_native(to, 0);
@@ -5035,7 +5041,7 @@ bool Field_timestamp::val_native(Native *to)
int Field_timestamp::store_TIME_with_warning(THD *thd, const Datetime *dt,
const ErrConv *str, int was_cut)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
static const Timestamp zero(0, 0);
// Handle totally bad values
@@ -5439,7 +5445,7 @@ void Field_timestamp_hires::store_TIMEVAL(const timeval &tv)
my_time_t Field_timestamp_hires::get_timestamp(const uchar *pos,
ulong *sec_part) const
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
*sec_part= (long)sec_part_unshift(read_bigendian(pos+4, sec_part_bytes(dec)), dec);
return mi_uint4korr(pos);
}
@@ -5447,7 +5453,7 @@ my_time_t Field_timestamp_hires::get_timestamp(const uchar *pos,
bool Field_timestamp_hires::val_native(Native *to)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
struct timeval tm;
tm.tv_sec= mi_uint4korr(ptr);
tm.tv_usec= (ulong) sec_part_unshift(read_bigendian(ptr+4, sec_part_bytes(dec)), dec);
@@ -5533,7 +5539,7 @@ void Field_timestampf::store_TIMEVAL(const timeval &tm)
void Field_timestampf::set_max()
{
DBUG_ENTER("Field_timestampf::set_max");
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
DBUG_ASSERT(dec == TIME_SECOND_PART_DIGITS);
set_notnull();
@@ -5546,7 +5552,7 @@ void Field_timestampf::set_max()
bool Field_timestampf::is_max()
{
DBUG_ENTER("Field_timestampf::is_max");
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
DBUG_RETURN(mi_sint4korr(ptr) == TIMESTAMP_MAX_VALUE &&
mi_sint3korr(ptr + 4) == TIME_MAX_SECOND_PART);
@@ -5564,7 +5570,7 @@ my_time_t Field_timestampf::get_timestamp(const uchar *pos,
bool Field_timestampf::val_native(Native *to)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
// Check if it's '0000-00-00 00:00:00' rather than a real timestamp
if (ptr[0] == 0 && ptr[1] == 0 && ptr[2] == 0 && ptr[3] == 0)
{
@@ -5618,7 +5624,7 @@ int Field_datetime::store_TIME_with_warning(const Datetime *dt,
const ErrConv *str,
int was_cut)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
// Handle totally bad values
if (!dt->is_valid_datetime())
return store_invalid_with_warning(str, was_cut, "datetime");
@@ -5765,7 +5771,7 @@ Item *Field_temporal::get_equal_const_item_datetime(THD *thd,
int Field_time::store_TIME_with_warning(const Time *t,
const ErrConv *str, int warn)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
// Handle totally bad values
if (!t->is_valid_time())
return store_invalid_with_warning(str, warn, "time");
@@ -5867,14 +5873,14 @@ Field *Field_time::new_key_field(MEM_ROOT *root, TABLE *new_table,
double Field_time::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
uint32 j= (uint32) uint3korr(ptr);
return (double) j;
}
longlong Field_time::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return (longlong) sint3korr(ptr);
}
@@ -5888,7 +5894,7 @@ longlong Field_time::val_int(void)
String *Field_time::val_str(String *str,
String *unused __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
MYSQL_TIME ltime;
get_date(&ltime, Datetime::Options(TIME_TIME_ONLY, get_thd()));
str->alloc(field_length + 1);
@@ -6110,7 +6116,7 @@ Item *Field_time::get_equal_const_item(THD *thd, const Context &ctx,
longlong Field_time_with_dec::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
MYSQL_TIME ltime;
get_date(&ltime, Time::Options(TIME_TIME_ONLY, get_thd()));
longlong val= TIME_to_ulonglong_time(&ltime);
@@ -6119,7 +6125,7 @@ longlong Field_time_with_dec::val_int(void)
double Field_time_with_dec::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
MYSQL_TIME ltime;
get_date(&ltime, Time::Options(TIME_TIME_ONLY, get_thd()));
return TIME_to_double(&ltime);
@@ -6194,7 +6200,7 @@ bool Field_timef::get_date(MYSQL_TIME *ltime, date_mode_t fuzzydate)
int Field_year::store(const char *from, size_t len,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
char *end;
int error;
longlong nr= cs->cset->strntoull10rnd(cs, from, len, 0, &end, &error);
@@ -6242,7 +6248,7 @@ int Field_year::store(double nr)
int Field_year::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
if (nr < 0 || (nr >= 100 && nr <= 1900) || nr > 2155)
{
*ptr= 0;
@@ -6274,7 +6280,7 @@ int Field_year::store_time_dec(const MYSQL_TIME *ltime, uint dec_arg)
bool Field_year::send_binary(Protocol *protocol)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
ulonglong tmp= Field_year::val_int();
return protocol->store_short(tmp);
}
@@ -6288,7 +6294,7 @@ double Field_year::val_real(void)
longlong Field_year::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
DBUG_ASSERT(field_length == 2 || field_length == 4);
int tmp= (int) ptr[0];
if (field_length != 4)
@@ -6337,7 +6343,7 @@ int Field_date_common::store_TIME_with_warning(const Datetime *dt,
const ErrConv *str,
int was_cut)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
// Handle totally bad values
if (!dt->is_valid_datetime())
return store_invalid_with_warning(str, was_cut, "date");
@@ -6422,7 +6428,7 @@ bool Field_date::send_binary(Protocol *protocol)
double Field_date::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int32 j;
j=sint4korr(ptr);
return (double) (uint32) j;
@@ -6431,7 +6437,7 @@ double Field_date::val_real(void)
longlong Field_date::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int32 j;
j=sint4korr(ptr);
return (longlong) (uint32) j;
@@ -6441,7 +6447,7 @@ longlong Field_date::val_int(void)
bool Field_date::get_TIME(MYSQL_TIME *ltime, const uchar *pos,
date_mode_t fuzzydate) const
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int32 tmp= sint4korr(pos);
ltime->year= (int) ((uint32) tmp/10000L % 10000);
ltime->month= (int) ((uint32) tmp/100 % 100);
@@ -6513,14 +6519,14 @@ bool Field_newdate::send_binary(Protocol *protocol)
double Field_newdate::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return (double) Field_newdate::val_int();
}
longlong Field_newdate::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
ulong j= uint3korr(ptr);
j= (j % 32L)+(j / 32L % 16L)*100L + (j/(16L*32L))*10000L;
return (longlong) j;
@@ -6530,7 +6536,7 @@ longlong Field_newdate::val_int(void)
String *Field_newdate::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
val_buffer->alloc(field_length);
val_buffer->length(field_length);
uint32 tmp=(uint32) uint3korr(ptr);
@@ -6560,7 +6566,7 @@ String *Field_newdate::val_str(String *val_buffer,
bool Field_newdate::get_TIME(MYSQL_TIME *ltime, const uchar *pos,
date_mode_t fuzzydate) const
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
uint32 tmp=(uint32) uint3korr(pos);
ltime->day= tmp & 31;
ltime->month= (tmp >> 5) & 15;
@@ -6681,7 +6687,7 @@ double Field_datetime::val_real(void)
longlong Field_datetime::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
longlong j;
j=sint8korr(ptr);
return j;
@@ -6694,7 +6700,7 @@ String *Field_datetime::val_str(String *val_buffer,
val_buffer->alloc(field_length);
val_buffer->length(field_length);
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
ulonglong tmp;
long part1,part2;
char *pos;
@@ -6737,7 +6743,7 @@ String *Field_datetime::val_str(String *val_buffer,
bool Field_datetime::get_TIME(MYSQL_TIME *ltime, const uchar *pos,
date_mode_t fuzzydate) const
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
longlong tmp= sint8korr(pos);
uint32 part1,part2;
part1=(uint32) (tmp/1000000LL);
@@ -6851,7 +6857,7 @@ String *Field_datetime_with_dec::val_str(String *str,
bool Field_datetime_hires::get_TIME(MYSQL_TIME *ltime, const uchar *pos,
date_mode_t fuzzydate) const
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
ulonglong packed= read_bigendian(pos, Field_datetime_hires::pack_length());
unpack_time(sec_part_unshift(packed, dec), ltime, MYSQL_TIMESTAMP_DATETIME);
return validate_MMDD(packed, ltime->month, ltime->day, fuzzydate);
@@ -6891,7 +6897,7 @@ void Field_datetimef::store_TIME(const MYSQL_TIME *ltime)
bool Field_datetimef::get_TIME(MYSQL_TIME *ltime, const uchar *pos,
date_mode_t fuzzydate) const
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
longlong tmp= my_datetime_packed_from_binary(pos, dec);
TIME_from_longlong_datetime_packed(ltime, tmp);
return validate_MMDD(tmp, ltime->month, ltime->day, fuzzydate);
@@ -6996,7 +7002,7 @@ Field_longstr::report_if_important_data(const char *pstr, const char *end,
int Field_string::store(const char *from, size_t length,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
uint copy_length;
int rc;
@@ -7042,7 +7048,7 @@ int Field_str::store(longlong nr, bool unsigned_val)
int Field_str::store(double nr)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
uint local_char_length= MY_MIN(sizeof(buff),
field_length / field_charset->mbmaxlen);
@@ -7178,7 +7184,7 @@ Field_string::Warn_filter_string::Warn_filter_string(const THD *thd,
double Field_string::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
return Converter_strntod_with_warn(get_thd(),
Warn_filter_string(thd, this),
@@ -7190,7 +7196,7 @@ double Field_string::val_real(void)
longlong Field_string::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
return Converter_strntoll_with_warn(thd, Warn_filter_string(thd, this),
Field_string::charset(),
@@ -7202,7 +7208,7 @@ longlong Field_string::val_int(void)
String *Field_string::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
/* See the comment for Field_long::store(long long) */
DBUG_ASSERT(!table || table->in_use == current_thd);
size_t length;
@@ -7220,7 +7226,7 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
my_decimal *Field_string::val_decimal(my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
Converter_str2my_decimal_with_warn(thd,
Warn_filter_string(thd, this),
@@ -7553,7 +7559,7 @@ int Field_varstring::save_field_metadata(uchar *metadata_ptr)
int Field_varstring::store(const char *from,size_t length,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
uint copy_length;
int rc;
@@ -7570,7 +7576,7 @@ int Field_varstring::store(const char *from,size_t length,CHARSET_INFO *cs)
double Field_varstring::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
return Converter_strntod_with_warn(thd, Warn_filter(thd),
Field_varstring::charset(),
@@ -7581,7 +7587,7 @@ double Field_varstring::val_real(void)
longlong Field_varstring::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
return Converter_strntoll_with_warn(thd, Warn_filter(thd),
Field_varstring::charset(),
@@ -7593,7 +7599,7 @@ longlong Field_varstring::val_int(void)
String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
val_ptr->set((const char*) get_data(), get_length(), field_charset);
return val_ptr;
}
@@ -7601,7 +7607,7 @@ String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
Converter_str2my_decimal_with_warn(thd, Warn_filter(thd),
E_DEC_FATAL_ERROR,
@@ -8104,7 +8110,7 @@ String *Field_longstr::uncompress(String *val_buffer, String *val_ptr,
int Field_varstring_compressed::store(const char *from, size_t length,
CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
uint compressed_length;
int rc= compress((char*) get_data(), field_length, from, (uint) length,
Field_varstring_compressed::max_display_length(),
@@ -8117,14 +8123,14 @@ int Field_varstring_compressed::store(const char *from, size_t length,
String *Field_varstring_compressed::val_str(String *val_buffer, String *val_ptr)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return uncompress(val_buffer, val_ptr, get_data(), get_length());
}
double Field_varstring_compressed::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
String buf;
val_str(&buf, &buf);
@@ -8135,7 +8141,7 @@ double Field_varstring_compressed::val_real(void)
longlong Field_varstring_compressed::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
String buf;
val_str(&buf, &buf);
@@ -8236,7 +8242,7 @@ int Field_blob::copy_value(Field_blob *from)
int Field_blob::store(const char *from,size_t length,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
size_t copy_length, new_length;
uint copy_len;
char *tmp;
@@ -8332,7 +8338,7 @@ oom_error:
double Field_blob::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
char *blob;
memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
@@ -8346,7 +8352,7 @@ double Field_blob::val_real(void)
longlong Field_blob::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
char *blob;
memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
@@ -8361,7 +8367,7 @@ longlong Field_blob::val_int(void)
String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
char *blob;
memcpy(&blob, ptr+packlength, sizeof(char*));
if (!blob)
@@ -8374,7 +8380,7 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
const char *blob;
size_t length;
memcpy(&blob, ptr+packlength, sizeof(const uchar*));
@@ -8760,7 +8766,7 @@ void Field_blob::make_send_field(Send_field *field)
int Field_blob_compressed::store(const char *from, size_t length,
CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
uint compressed_length;
uint max_length= max_data_length();
uint to_length= (uint) MY_MIN(max_length,
@@ -8787,14 +8793,14 @@ oom:
String *Field_blob_compressed::val_str(String *val_buffer, String *val_ptr)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return uncompress(val_buffer, val_ptr, get_ptr(), get_length());
}
double Field_blob_compressed::val_real(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
String buf;
val_str(&buf, &buf);
@@ -8805,7 +8811,7 @@ double Field_blob_compressed::val_real(void)
longlong Field_blob_compressed::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
THD *thd= get_thd();
String buf;
val_str(&buf, &buf);
@@ -9111,7 +9117,7 @@ void Field_enum::store_type(ulonglong value)
int Field_enum::store(const char *from,size_t length,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int err= 0;
char buff[STRING_BUFFER_USUAL_SIZE];
String tmpstr(buff,sizeof(buff), &my_charset_bin);
@@ -9163,7 +9169,7 @@ int Field_enum::store(double nr)
int Field_enum::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
if ((ulonglong) nr > typelib->count || nr == 0)
{
@@ -9187,7 +9193,7 @@ double Field_enum::val_real(void)
longlong Field_enum::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
return read_lowendian(ptr, packlength);
}
@@ -9294,7 +9300,7 @@ Field *Field_enum::make_new_field(MEM_ROOT *root, TABLE *new_table,
int Field_set::store(const char *from,size_t length,CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
bool got_warning= 0;
int err= 0;
char *not_used;
@@ -9334,7 +9340,7 @@ int Field_set::store(const char *from,size_t length,CHARSET_INFO *cs)
int Field_set::store(longlong nr, bool unsigned_val)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int error= 0;
ulonglong max_nr;
@@ -9734,7 +9740,7 @@ uint Field_bit::is_equal(Create_field *new_field)
int Field_bit::store(const char *from, size_t length, CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int delta;
for (; length && !*from; from++, length--) // skip left 0's
@@ -9811,7 +9817,7 @@ double Field_bit::val_real(void)
longlong Field_bit::val_int(void)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
ulonglong bits= 0;
if (bit_len)
{
@@ -9836,7 +9842,7 @@ longlong Field_bit::val_int(void)
String *Field_bit::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
char buff[sizeof(longlong)];
uint length= MY_MIN(pack_length(), sizeof(longlong));
ulonglong bits= val_int();
@@ -9852,7 +9858,7 @@ String *Field_bit::val_str(String *val_buffer,
my_decimal *Field_bit::val_decimal(my_decimal *deciaml_value)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(marked_for_read());
int2my_decimal(E_DEC_FATAL_ERROR, val_int(), 1, deciaml_value);
return deciaml_value;
}
@@ -10170,7 +10176,7 @@ Field_bit_as_char::Field_bit_as_char(uchar *ptr_arg, uint32 len_arg,
int Field_bit_as_char::store(const char *from, size_t length, CHARSET_INFO *cs)
{
- ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
+ DBUG_ASSERT(marked_for_write_or_computed());
int delta;
uchar bits= (uchar) (field_length & 7);
diff --git a/sql/field.h b/sql/field.h
index aeed8ae5a64..8bd7343931b 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -627,6 +627,9 @@ public:
static void operator delete(void *ptr, MEM_ROOT *mem_root)
{ DBUG_ASSERT(0); }
+ bool marked_for_read() const;
+ bool marked_for_write_or_computed() const;
+
/**
Used by System Versioning.
*/
diff --git a/sql/item.cc b/sql/item.cc
index 543dc971228..e511921b30b 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -9060,9 +9060,8 @@ bool Item_args::excl_dep_on_grouping_fields(st_select_lex *sel)
{
for (uint i= 0; i < arg_count; i++)
{
- if (args[i]->type() == Item::SUBSELECT_ITEM ||
- (args[i]->type() == Item::FUNC_ITEM &&
- ((Item_func *)args[i])->functype() == Item_func::UDF_FUNC))
+ if (args[i]->type() == Item::FUNC_ITEM &&
+ ((Item_func *)args[i])->functype() == Item_func::UDF_FUNC)
return false;
if (args[i]->const_item())
continue;
diff --git a/sql/item.h b/sql/item.h
index 716b411082f..97d31e6ba34 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -5733,6 +5733,7 @@ public:
{ return get_item_copy<Item_direct_view_ref>(thd, this); }
Item *field_transformer_for_having_pushdown(THD *thd, uchar *arg)
{ return this; }
+ Item *remove_item_direct_ref() { return this; }
};
diff --git a/sql/item_func.h b/sql/item_func.h
index a3bf4d78158..44e9691c9df 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -342,7 +342,7 @@ public:
bool excl_dep_on_grouping_fields(st_select_lex *sel)
{
- if (has_rand_bit())
+ if (has_rand_bit() || with_subquery())
return false;
return Item_args::excl_dep_on_grouping_fields(sel);
}
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index db38b157406..feb47f9af94 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7012,7 +7012,7 @@ ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME
eng "Columns participating in a foreign key are renamed"
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE
- eng "Cannot change column type INPLACE"
+ eng "Cannot change column type"
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK
eng "Adding foreign keys needs foreign_key_checks=OFF"
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index bd4d74c58a8..e98e5fbc27e 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -3605,32 +3605,45 @@ sp_instr_stmt::exec_core(THD *thd, uint *nextp)
3);
int res= mysql_execute_command(thd);
#ifdef WITH_WSREP
- if ((thd->is_fatal_error || thd->killed_errno()) &&
- (thd->wsrep_trx().state() == wsrep::transaction::s_executing))
+ if (WSREP(thd))
{
- /*
- SP was killed, and it is not due to a wsrep conflict.
- We skip after_statement hook at this point because
- otherwise it clears the error, and cleans up the
- whole transaction. For now we just return and finish
- our handling once we are back to mysql_parse.
- */
- WSREP_DEBUG("Skipping after_command hook for killed SP");
- }
- else
- {
- (void) wsrep_after_statement(thd);
- /*
- Final wsrep error status for statement is known only after
- wsrep_after_statement() call. If the error is set, override
- error in thd diagnostics area and reset wsrep client_state error
- so that the error does not get propagated via client-server protocol.
- */
- if (wsrep_current_error(thd))
+ if ((thd->is_fatal_error || thd->killed_errno()) &&
+ (thd->wsrep_trx().state() == wsrep::transaction::s_executing))
+ {
+ /*
+ SP was killed, and it is not due to a wsrep conflict.
+ We skip after_statement hook at this point because
+ otherwise it clears the error, and cleans up the
+ whole transaction. For now we just return and finish
+ our handling once we are back to mysql_parse.
+ */
+ WSREP_DEBUG("Skipping after_command hook for killed SP");
+ }
+ else
{
- wsrep_override_error(thd, wsrep_current_error(thd),
- wsrep_current_error_status(thd));
- thd->wsrep_cs().reset_error();
+ const bool must_replay= wsrep_must_replay(thd);
+ (void) wsrep_after_statement(thd);
+ /*
+ Reset the return code to zero if the transaction was
+ replayed succesfully.
+ */
+ if (res && must_replay && !wsrep_current_error(thd))
+ res= 0;
+ /*
+ Final wsrep error status for statement is known only after
+ wsrep_after_statement() call. If the error is set, override
+ error in thd diagnostics area and reset wsrep client_state error
+ so that the error does not get propagated via client-server protocol.
+ */
+ if (wsrep_current_error(thd))
+ {
+ wsrep_override_error(thd, wsrep_current_error(thd),
+ wsrep_current_error_status(thd));
+ thd->wsrep_cs().reset_error();
+ /* Reset also thd->killed if it has been set during BF abort. */
+ if (thd->killed == KILL_QUERY)
+ thd->reset_killed();
+ }
}
}
#endif /* WITH_WSREP */
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index a7debea0076..dd8d890c301 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2010, 2016, MariaDB
+ Copyright (c) 2010, 2019, 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
@@ -3583,6 +3583,29 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
goto end;
}
}
+
+ if (!tables->derived && is_infoschema_db(&tables->db))
+ {
+ /*
+ Check whether the information schema contains a table
+ whose name is tables->schema_table_name
+ */
+ ST_SCHEMA_TABLE *schema_table;
+ schema_table= find_schema_table(thd, &tables->schema_table_name);
+ if (!schema_table ||
+ (schema_table->hidden &&
+ ((sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0 ||
+ /*
+ this check is used for show columns|keys from I_S hidden table
+ */
+ lex->sql_command == SQLCOM_SHOW_FIELDS ||
+ lex->sql_command == SQLCOM_SHOW_KEYS)))
+ {
+ my_error(ER_UNKNOWN_TABLE, MYF(0),
+ tables->schema_table_name.str, INFORMATION_SCHEMA_NAME.str);
+ DBUG_RETURN(1);
+ }
+ }
/*
If this TABLE_LIST object is a placeholder for an information_schema
table, create a temporary table to represent the information_schema
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 3567e790f78..c0c89ee59b3 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1020,6 +1020,15 @@ Sql_condition* THD::raise_condition(uint sql_errno,
if (!(variables.option_bits & OPTION_SQL_NOTES) &&
(level == Sql_condition::WARN_LEVEL_NOTE))
DBUG_RETURN(NULL);
+#ifdef WITH_WSREP
+ /*
+ Suppress warnings/errors if the wsrep THD is going to replay. The
+ deadlock/interrupted errors may be transitient and should not be
+ reported to the client.
+ */
+ if (wsrep_must_replay(this))
+ DBUG_RETURN(NULL);
+#endif /* WITH_WSREP */
da->opt_clear_warning_info(query_id);
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc
index 455abd9c4b3..6f5162b645b 100644
--- a/sql/sql_cte.cc
+++ b/sql/sql_cte.cc
@@ -1116,6 +1116,7 @@ bool TABLE_LIST::set_as_with_table(THD *thd, With_element *with_elem)
table= 0;
}
with= with_elem;
+ schema_table= NULL;
if (!with_elem->is_referenced() || with_elem->is_recursive)
{
derived= with_elem->spec;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 2da704d9b17..d5d721e0ede 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -8371,7 +8371,6 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->derived= table->sel;
if (!ptr->derived && is_infoschema_db(&ptr->db))
{
- ST_SCHEMA_TABLE *schema_table;
if (ptr->updating &&
/* Special cases which are processed by commands itself */
lex->sql_command != SQLCOM_CHECK &&
@@ -8383,20 +8382,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
INFORMATION_SCHEMA_NAME.str);
DBUG_RETURN(0);
}
+ ST_SCHEMA_TABLE *schema_table;
schema_table= find_schema_table(thd, &ptr->table_name);
- if (unlikely(!schema_table) ||
- (schema_table->hidden &&
- ((sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0 ||
- /*
- this check is used for show columns|keys from I_S hidden table
- */
- lex->sql_command == SQLCOM_SHOW_FIELDS ||
- lex->sql_command == SQLCOM_SHOW_KEYS)))
- {
- my_error(ER_UNKNOWN_TABLE, MYF(0),
- ptr->table_name.str, INFORMATION_SCHEMA_NAME.str);
- DBUG_RETURN(0);
- }
ptr->schema_table_name= ptr->table_name;
ptr->schema_table= schema_table;
}
diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic
index 36748121360..955b9a0ce3a 100644
--- a/sql/sql_plugin_services.ic
+++ b/sql/sql_plugin_services.ic
@@ -172,7 +172,8 @@ static struct wsrep_service_st wsrep_handler = {
wsrep_thd_skip_locking,
wsrep_get_sr_table_name,
wsrep_get_debug,
- wsrep_commit_ordered
+ wsrep_commit_ordered,
+ wsrep_thd_is_applying
};
static struct thd_specifics_service_st thd_specifics_handler=
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 676a73d5958..f96b3409578 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1621,12 +1621,22 @@ bool JOIN::make_range_rowid_filters()
filter_map.merge(tab->table->with_impossible_ranges);
bool force_index_save= tab->table->force_index;
tab->table->force_index= true;
- (void) sel->test_quick_select(thd, filter_map, (table_map) 0,
- (ha_rows) HA_POS_ERROR,
- true, false, true, true);
+ int rc= sel->test_quick_select(thd, filter_map, (table_map) 0,
+ (ha_rows) HA_POS_ERROR,
+ true, false, true, true);
tab->table->force_index= force_index_save;
if (thd->is_error())
goto no_filter;
+ /*
+ If SUBS_IN_TO_EXISTS strtrategy is chosen for the subquery then
+ additional conditions are injected into WHERE/ON/HAVING and it may
+ happen that the call of test_quick_select() discovers impossible range.
+ */
+ if (rc == -1)
+ {
+ const_table_map|= tab->table->map;
+ goto no_filter;
+ }
DBUG_ASSERT(sel->quick);
filter_container=
tab->range_rowid_filter_info->create_container();
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index f516d24bdb6..28c67f0e59a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -6343,7 +6343,7 @@ drop_create_field:
Key_part_spec *kp;
if ((kp= part_it++))
chkname= kp->field_name.str;
- if (keyname == NULL)
+ if (chkname == NULL)
continue;
}
if (key->type == chk_key->type &&
diff --git a/sql/wsrep_client_service.cc b/sql/wsrep_client_service.cc
index c042a1ea051..b182691c593 100644
--- a/sql/wsrep_client_service.cc
+++ b/sql/wsrep_client_service.cc
@@ -250,20 +250,38 @@ void Wsrep_client_service::will_replay()
enum wsrep::provider::status Wsrep_client_service::replay()
{
+
DBUG_ASSERT(m_thd == current_thd);
- Wsrep_replayer_service replayer_service(m_thd);
- wsrep::provider& provider(m_thd->wsrep_cs().provider());
- mysql_mutex_lock(&m_thd->LOCK_thd_data);
- m_thd->killed= NOT_KILLED;
- mysql_mutex_unlock(&m_thd->LOCK_thd_data);
- enum wsrep::provider::status ret=
- provider.replay(m_thd->wsrep_trx().ws_handle(), &replayer_service);
- replayer_service.replay_status(ret);
+ DBUG_ENTER("Wsrep_client_service::replay");
+
+ /*
+ Allocate separate THD for replaying to avoid tampering
+ original THD state during replication event applying.
+ */
+ THD *replayer_thd= new THD(true, true);
+ replayer_thd->thread_stack= m_thd->thread_stack;
+ replayer_thd->real_id= pthread_self();
+ replayer_thd->prior_thr_create_utime=
+ replayer_thd->start_utime= microsecond_interval_timer();
+ replayer_thd->set_command(COM_SLEEP);
+ replayer_thd->reset_for_next_command(true);
+
+ enum wsrep::provider::status ret;
+ {
+ Wsrep_replayer_service replayer_service(replayer_thd, m_thd);
+ wsrep::provider& provider(replayer_thd->wsrep_cs().provider());
+ ret= provider.replay(replayer_thd->wsrep_trx().ws_handle(),
+ &replayer_service);
+ replayer_service.replay_status(ret);
+ }
+
+ delete replayer_thd;
+
mysql_mutex_lock(&LOCK_wsrep_replaying);
--wsrep_replaying;
mysql_cond_broadcast(&COND_wsrep_replaying);
mysql_mutex_unlock(&LOCK_wsrep_replaying);
- return ret;
+ DBUG_RETURN(ret);
}
void Wsrep_client_service::wait_for_replayers(wsrep::unique_lock<wsrep::mutex>& lock)
diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc
index bd37042992a..01f2ad88ed5 100644
--- a/sql/wsrep_dummy.cc
+++ b/sql/wsrep_dummy.cc
@@ -135,3 +135,6 @@ my_bool wsrep_get_debug()
void wsrep_commit_ordered(THD* )
{ }
+
+my_bool wsrep_thd_is_applying(const THD*)
+{ return 0;}
diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc
index bdacdc3b055..afb4ca3d3b7 100644
--- a/sql/wsrep_high_priority_service.cc
+++ b/sql/wsrep_high_priority_service.cc
@@ -519,83 +519,88 @@ bool Wsrep_applier_service::check_exit_status() const
Replayer service
*****************************************************************************/
-Wsrep_replayer_service::Wsrep_replayer_service(THD* thd)
- : Wsrep_high_priority_service(thd)
+Wsrep_replayer_service::Wsrep_replayer_service(THD* replayer_thd, THD* orig_thd)
+ : Wsrep_high_priority_service(replayer_thd)
+ , m_orig_thd(orig_thd)
, m_da_shadow()
, m_replay_status()
{
/* Response must not have been sent to client */
- DBUG_ASSERT(!thd->get_stmt_da()->is_sent());
+ DBUG_ASSERT(!orig_thd->get_stmt_da()->is_sent());
/* PS reprepare observer should have been removed already
open_table() will fail if we have dangling observer here */
- DBUG_ASSERT(!thd->m_reprepare_observer);
+ DBUG_ASSERT(!orig_thd->m_reprepare_observer);
/* Replaying should happen always from after_statement() hook
after rollback, which should guarantee that there are no
transactional locks */
- DBUG_ASSERT(!thd->mdl_context.has_transactional_locks());
+ DBUG_ASSERT(!orig_thd->mdl_context.has_transactional_locks());
/* Make a shadow copy of diagnostics area and reset */
- m_da_shadow.status= thd->get_stmt_da()->status();
+ m_da_shadow.status= orig_thd->get_stmt_da()->status();
if (m_da_shadow.status == Diagnostics_area::DA_OK)
{
- m_da_shadow.affected_rows= thd->get_stmt_da()->affected_rows();
- m_da_shadow.last_insert_id= thd->get_stmt_da()->last_insert_id();
- strmake(m_da_shadow.message, thd->get_stmt_da()->message(),
+ m_da_shadow.affected_rows= orig_thd->get_stmt_da()->affected_rows();
+ m_da_shadow.last_insert_id= orig_thd->get_stmt_da()->last_insert_id();
+ strmake(m_da_shadow.message, orig_thd->get_stmt_da()->message(),
sizeof(m_da_shadow.message) - 1);
}
- thd->get_stmt_da()->reset_diagnostics_area();
+ orig_thd->get_stmt_da()->reset_diagnostics_area();
/* Release explicit locks */
- if (thd->locked_tables_mode && thd->lock)
+ if (orig_thd->locked_tables_mode && orig_thd->lock)
{
WSREP_WARN("releasing table lock for replaying (%llu)",
- thd->thread_id);
- thd->locked_tables_list.unlock_locked_tables(thd);
- thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
+ orig_thd->thread_id);
+ orig_thd->locked_tables_list.unlock_locked_tables(orig_thd);
+ orig_thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
}
+ thd_proc_info(orig_thd, "wsrep replaying trx");
+
/*
- Replaying will call MYSQL_START_STATEMENT when handling
- BEGIN Query_log_event so end statement must be called before
- replaying.
+ Swith execution context to replayer_thd and prepare it for
+ replay execution.
*/
- MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
- thd->m_statement_psi= NULL;
- thd->m_digest= NULL;
- thd_proc_info(thd, "wsrep replaying trx");
+ orig_thd->reset_globals();
+ replayer_thd->store_globals();
+ wsrep_open(replayer_thd);
+ wsrep_before_command(replayer_thd);
+ replayer_thd->wsrep_cs().clone_transaction_for_replay(orig_thd->wsrep_trx());
}
Wsrep_replayer_service::~Wsrep_replayer_service()
{
- THD* thd= m_thd;
- DBUG_ASSERT(!thd->get_stmt_da()->is_sent());
- DBUG_ASSERT(!thd->get_stmt_da()->is_set());
+ THD* replayer_thd= m_thd;
+ THD* orig_thd= m_orig_thd;
+
+ /* Store replay result/state to original thread wsrep client
+ state and switch execution context back to original. */
+ orig_thd->wsrep_cs().after_replay(replayer_thd->wsrep_trx());
+ wsrep_after_apply(replayer_thd);
+ wsrep_after_command_ignore_result(replayer_thd);
+ wsrep_close(replayer_thd);
+ replayer_thd->reset_globals();
+ orig_thd->store_globals();
+
+ DBUG_ASSERT(!orig_thd->get_stmt_da()->is_sent());
+ DBUG_ASSERT(!orig_thd->get_stmt_da()->is_set());
+
if (m_replay_status == wsrep::provider::success)
{
- DBUG_ASSERT(thd->wsrep_cs().current_error() == wsrep::e_success);
- thd->killed= NOT_KILLED;
- if (m_da_shadow.status == Diagnostics_area::DA_OK)
- {
- my_ok(thd,
- m_da_shadow.affected_rows,
- m_da_shadow.last_insert_id,
- m_da_shadow.message);
- }
- else
- {
- my_ok(thd);
- }
+ DBUG_ASSERT(replayer_thd->wsrep_cs().current_error() == wsrep::e_success);
+ orig_thd->killed= NOT_KILLED;
+ my_ok(orig_thd, m_da_shadow.affected_rows, m_da_shadow.last_insert_id);
}
else if (m_replay_status == wsrep::provider::error_certification_failed)
{
- wsrep_override_error(thd, ER_LOCK_DEADLOCK);
+ wsrep_override_error(orig_thd, ER_LOCK_DEADLOCK);
}
else
{
DBUG_ASSERT(0);
WSREP_ERROR("trx_replay failed for: %d, schema: %s, query: %s",
m_replay_status,
- thd->db.str, WSREP_QUERY(thd));
+ orig_thd->db.str, WSREP_QUERY(orig_thd));
unireg_abort(1);
}
}
diff --git a/sql/wsrep_high_priority_service.h b/sql/wsrep_high_priority_service.h
index c483aa82d62..34fa1669b71 100644
--- a/sql/wsrep_high_priority_service.h
+++ b/sql/wsrep_high_priority_service.h
@@ -87,7 +87,7 @@ public:
class Wsrep_replayer_service : public Wsrep_high_priority_service
{
public:
- Wsrep_replayer_service(THD*);
+ Wsrep_replayer_service(THD* replayer_thd, THD* orig_thd);
~Wsrep_replayer_service();
int apply_write_set(const wsrep::ws_meta&, const wsrep::const_buffer&);
void after_apply() { }
@@ -99,6 +99,7 @@ public:
/* Replayer should never be forced to exit */
bool check_exit_status() const { return false; }
private:
+ THD* m_orig_thd;
struct da_shadow
{
enum Diagnostics_area::enum_diagnostics_status status;
diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h
index 467b33ea206..e6901f15ca7 100644
--- a/sql/wsrep_trans_observer.h
+++ b/sql/wsrep_trans_observer.h
@@ -56,6 +56,13 @@ static inline bool wsrep_must_abort(THD* thd)
}
/*
+ Return true if the transaction must be replayed.
+ */
+static inline bool wsrep_must_replay(THD* thd)
+{
+ return (thd->wsrep_trx().state() == wsrep::transaction::s_must_replay);
+}
+/*
Return true if transaction has not been committed.
Note that we don't require thd->LOCK_thd_data here. Calling this method
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 3c79fe6a72d..c7ee80cca5f 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -272,11 +272,6 @@ btr_root_get(
And block the segment list access by others.*/
buf_block_t* root = btr_root_block_get(index, RW_SX_LATCH,
mtr);
-
- if (root && root->page.encrypted == true) {
- root = NULL;
- }
-
return(root ? buf_block_get_frame(root) : NULL);
}
@@ -730,159 +725,54 @@ btr_page_free_for_ibuf(
mtr));
}
-/**************************************************************//**
-Frees a file page used in an index tree. Can be used also to (BLOB)
-external storage pages. */
-void
-btr_page_free_low(
-/*==============*/
- dict_index_t* index, /*!< in: index tree */
- buf_block_t* block, /*!< in: block to be freed, x-latched */
- ulint level, /*!< in: page level (ULINT_UNDEFINED=BLOB) */
- bool blob, /*!< in: blob page */
- mtr_t* mtr) /*!< in: mtr */
+/** Free an index page.
+@param[in,out] index index tree
+@param[in,out] block block to be freed
+@param[in,out] mtr mini-transaction
+@param[in] blob whether this is freeing a BLOB page */
+void btr_page_free(dict_index_t* index, buf_block_t* block, mtr_t* mtr,
+ bool blob)
{
- fseg_header_t* seg_header;
- page_t* root;
-
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
+#ifdef BTR_CUR_HASH_ADAPT
+ ut_ad(!block->index || !blob);
+ ut_ad(!block->index || page_is_leaf(block->frame));
+#endif
+ ut_ad(index->table->space_id == block->page.id.space());
+ /* The root page is freed by btr_free_root(). */
+ ut_ad(block->page.id.page_no() != index->page);
+ ut_ad(mtr->is_named_space(index->table->space));
+
/* The page gets invalid for optimistic searches: increment the frame
modify clock */
buf_block_modify_clock_inc(block);
- if (blob) {
- ut_a(level == 0);
- }
-
- bool scrub = srv_immediate_scrub_data_uncompressed;
- /* scrub page */
- if (scrub && blob) {
- /* blob page: scrub entire page */
- // TODO(jonaso): scrub only what is actually needed
- page_t* page = buf_block_get_frame(block);
- memset(page + PAGE_HEADER, 0,
- srv_page_size - PAGE_HEADER);
-#ifdef UNIV_DEBUG_SCRUBBING
- fprintf(stderr,
- "btr_page_free_low: scrub blob page %lu/%lu\n",
- buf_block_get_space(block),
- buf_block_get_page_no(block));
-#endif /* UNIV_DEBUG_SCRUBBING */
- } else if (scrub) {
- /* scrub records on page */
-
- /* TODO(jonaso): in theory we could clear full page
- * but, since page still remains in buffer pool, and
- * gets flushed etc. Lots of routines validates consistency
- * of it. And in order to remain structurally consistent
- * we clear each record by it own
- *
- * NOTE: The TODO below mentions removing page from buffer pool
- * and removing redo entries, once that is done, clearing full
- * pages should be possible
- */
- uint cnt = 0;
- ulint bytes = 0;
- page_t* page = buf_block_get_frame(block);
- mem_heap_t* heap = NULL;
- ulint* offsets = NULL;
- rec_t* rec = page_rec_get_next(page_get_infimum_rec(page));
- while (!page_rec_is_supremum(rec)) {
- offsets = rec_get_offsets(rec, index, offsets,
- page_is_leaf(page),
- ULINT_UNDEFINED,
- &heap);
- ulint size = rec_offs_data_size(offsets);
- memset(rec, 0, size);
- rec = page_rec_get_next(rec);
- cnt++;
- bytes += size;
- }
-#ifdef UNIV_DEBUG_SCRUBBING
- fprintf(stderr,
- "btr_page_free_low: scrub %lu/%lu - "
- "%u records " ULINTPF " bytes\n",
- buf_block_get_space(block),
- buf_block_get_page_no(block),
- cnt, bytes);
-#endif /* UNIV_DEBUG_SCRUBBING */
- if (heap) {
- mem_heap_free(heap);
- }
- }
-
-#ifdef UNIV_DEBUG_SCRUBBING
- if (scrub == false) {
- fprintf(stderr,
- "btr_page_free_low %lu/%lu blob: %u\n",
- buf_block_get_space(block),
- buf_block_get_page_no(block),
- blob);
- }
-#endif /* UNIV_DEBUG_SCRUBBING */
-
if (dict_index_is_ibuf(index)) {
-
btr_page_free_for_ibuf(index, block, mtr);
-
return;
}
- root = btr_root_get(index, mtr);
-
- if (level == 0 || level == ULINT_UNDEFINED) {
- seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
- } else {
- seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_TOP;
- }
-
-#ifdef UNIV_GIS_DEBUG
- if (dict_index_is_spatial(index)) {
- fprintf(stderr, "GIS_DIAG: Freed %ld\n",
- (long) block->page.id.page_no());
- }
-#endif
-
- if (scrub) {
- /**
- * Reset page type so that scrub thread won't try to scrub it
- */
- mlog_write_ulint(buf_block_get_frame(block) + FIL_PAGE_TYPE,
- FIL_PAGE_TYPE_ALLOCATED, MLOG_2BYTES, mtr);
- }
-
+ /* TODO: Discard any operations for block from mtr->log.
+ The page will be freed, so previous changes to it by this
+ mini-transaction should not matter. */
+ page_t* root = btr_root_get(index, mtr);
+ fseg_header_t* seg_header = &root[blob || page_is_leaf(block->frame)
+ ? PAGE_HEADER + PAGE_BTR_SEG_LEAF
+ : PAGE_HEADER + PAGE_BTR_SEG_TOP];
fseg_free_page(seg_header,
- block->page.id.space(),
- block->page.id.page_no(),
- level != ULINT_UNDEFINED, mtr);
+ index->table->space, block->page.id.page_no(),
+ block->index != NULL, !block->page.flush_observer, mtr);
/* The page was marked free in the allocation bitmap, but it
- should remain buffer-fixed until mtr_commit(mtr) or until it
+ should remain exclusively latched until mtr_t::commit() or until it
is explicitly freed from the mini-transaction. */
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
- /* TODO: Discard any operations on the page from the redo log
- and remove the block from the flush list and the buffer pool.
- This would free up buffer pool earlier and reduce writes to
- both the tablespace and the redo log. */
-}
-/**************************************************************//**
-Frees a file page used in an index tree. NOTE: cannot free field external
-storage pages because the page must contain info on its level. */
-void
-btr_page_free(
-/*==========*/
- dict_index_t* index, /*!< in: index tree */
- buf_block_t* block, /*!< in: block to be freed, x-latched */
- mtr_t* mtr) /*!< in: mtr */
-{
- const page_t* page = buf_block_get_frame(block);
- ulint level = btr_page_get_level(page);
-
- ut_ad(fil_page_index_page_check(block->frame));
- ut_ad(level != ULINT_UNDEFINED);
- btr_page_free_low(index, block, level, false, mtr);
+ /* MDEV-15528 FIXME: Zero out the page after the redo log for
+ this mini-transaction has been durably written.
+ This must be done unconditionally if
+ srv_immediate_scrub_data_uncompressed is set. */
}
/**************************************************************//**
@@ -1092,17 +982,17 @@ void btr_page_get_father(dict_index_t* index, buf_block_t* block, mtr_t* mtr,
mem_heap_free(heap);
}
+/** PAGE_INDEX_ID value for freed index B-trees */
+static const index_id_t BTR_FREED_INDEX_ID = 0;
+
/** Free a B-tree root page. btr_free_but_not_root() must already
have been called.
In a persistent tablespace, the caller must invoke fsp_init_file_page()
before mtr.commit().
-@param[in,out] block index root page
-@param[in,out] mtr mini-transaction */
-static
-void
-btr_free_root(
- buf_block_t* block,
- mtr_t* mtr)
+@param[in,out] block index root page
+@param[in,out] mtr mini-transaction
+@param[in] invalidate whether to invalidate PAGE_INDEX_ID */
+static void btr_free_root(buf_block_t* block, mtr_t* mtr, bool invalidate)
{
fseg_header_t* header;
@@ -1116,31 +1006,18 @@ btr_free_root(
#ifdef UNIV_BTR_DEBUG
ut_a(btr_root_fseg_validate(header, block->page.id.space()));
#endif /* UNIV_BTR_DEBUG */
+ if (invalidate) {
+ btr_page_set_index_id(
+ buf_block_get_frame(block),
+ buf_block_get_page_zip(block),
+ BTR_FREED_INDEX_ID, mtr);
+ }
while (!fseg_free_step(header, true, mtr)) {
/* Free the entire segment in small steps. */
}
}
-/** PAGE_INDEX_ID value for freed index B-trees */
-static const index_id_t BTR_FREED_INDEX_ID = 0;
-
-/** Invalidate an index root page so that btr_free_root_check()
-will not find it.
-@param[in,out] block index root page
-@param[in,out] mtr mini-transaction */
-static
-void
-btr_free_root_invalidate(
- buf_block_t* block,
- mtr_t* mtr)
-{
- btr_page_set_index_id(
- buf_block_get_frame(block),
- buf_block_get_page_zip(block),
- BTR_FREED_INDEX_ID, mtr);
-}
-
/** Prepare to free a B-tree.
@param[in] page_id page id
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
@@ -1254,11 +1131,8 @@ btr_create(
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
/* Not enough space for new segment, free root
segment before return. */
- btr_free_root(block, mtr);
- if (!index->table->is_temporary()) {
- btr_free_root_invalidate(block, mtr);
- }
-
+ btr_free_root(block, mtr,
+ !index->table->is_temporary());
return(FIL_NULL);
}
@@ -1394,8 +1268,7 @@ btr_free_if_exists(
btr_free_but_not_root(root, mtr->get_log_mode());
mtr->set_named_space_id(page_id.space());
- btr_free_root(root, mtr);
- btr_free_root_invalidate(root, mtr);
+ btr_free_root(root, mtr, true);
}
/** Free an index tree in a temporary tablespace.
@@ -1410,7 +1283,7 @@ void btr_free(const page_id_t page_id)
if (block) {
btr_free_but_not_root(block, MTR_LOG_NO_REDO);
- btr_free_root(block, &mtr);
+ btr_free_root(block, &mtr, false);
}
mtr.commit();
}
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index 9cad745aa0d..6a9b71987c5 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -663,11 +663,11 @@ PageBulk::latch()
/* In case the block is S-latched by page_cleaner. */
if (!buf_page_optimistic_get(RW_X_LATCH, m_block, m_modify_clock,
__FILE__, __LINE__, &m_mtr)) {
- m_block = buf_page_get_gen(
- page_id_t(m_index->table->space_id, m_page_no),
- m_index->table->space->zip_size(),
- RW_X_LATCH, m_block, BUF_GET_IF_IN_POOL,
- __FILE__, __LINE__, &m_mtr, &m_err);
+ m_block = buf_page_get_gen(page_id_t(m_index->table->space_id,
+ m_page_no),
+ 0, RW_X_LATCH,
+ m_block, BUF_GET_IF_IN_POOL,
+ __FILE__, __LINE__, &m_mtr, &m_err);
if (m_err != DB_SUCCESS) {
return (m_err);
@@ -1033,7 +1033,7 @@ BtrBulk::finish(dberr_t err)
root_page_bulk.copyIn(first_rec);
/* Remove last page. */
- btr_page_free_low(m_index, last_block, m_root_level, false, &mtr);
+ btr_page_free(m_index, last_block, &mtr);
/* Do not flush the last page. */
last_block->page.flush_observer = NULL;
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 0b61e340f81..1ba0febd415 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -8145,8 +8145,7 @@ btr_free_externally_stored_field(
}
next_page_no = mach_read_from_4(page + FIL_PAGE_NEXT);
- btr_page_free_low(index, ext_block, 0,
- true, &mtr);
+ btr_page_free(index, ext_block, &mtr, true);
if (page_zip != NULL) {
mach_write_to_4(field_ref + BTR_EXTERN_PAGE_NO,
@@ -8172,12 +8171,7 @@ btr_free_externally_stored_field(
next_page_no = mach_read_from_4(
page + FIL_PAGE_DATA
+ BTR_BLOB_HDR_NEXT_PAGE_NO);
-
- /* We must supply the page level (= 0) as an argument
- because we did not store it on the page (we save the
- space overhead from an index page header. */
- btr_page_free_low(index, ext_block, 0,
- true, &mtr);
+ btr_page_free(index, ext_block, &mtr, true);
mlog_write_ulint(field_ref + BTR_EXTERN_PAGE_NO,
next_page_no,
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 2828e63889a..24df4d76911 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1592,7 +1592,7 @@ buf_chunk_init(
/* Round down to a multiple of page size,
although it already should be. */
- mem_size = ut_2pow_round(mem_size, ulint(srv_page_size));
+ mem_size = ut_2pow_round<ulint>(mem_size, srv_page_size);
DBUG_EXECUTE_IF("ib_buf_chunk_init_fails", return(NULL););
@@ -1625,7 +1625,7 @@ buf_chunk_init(
chunk->blocks = (buf_block_t*) chunk->mem;
/* Align a pointer to the first frame. Note that when
- os_large_page_size is smaller than srv_page_size,
+ opt_large_page_size is smaller than srv_page_size,
we may allocate one fewer block than requested. When
it is bigger, we may allocate more blocks than requested. */
@@ -4252,7 +4252,8 @@ buf_page_get_gen(
Skip the assertion on space_page_size. */
break;
case BUF_PEEK_IF_IN_POOL:
- /* In this mode, the caller may pass a dummy page size,
+ case BUF_GET_IF_IN_POOL:
+ /* The caller may pass a dummy page size,
because it does not really matter. */
break;
default:
@@ -4261,7 +4262,6 @@ buf_page_get_gen(
ut_ad(rw_latch == RW_NO_LATCH);
/* fall through */
case BUF_GET:
- case BUF_GET_IF_IN_POOL:
case BUF_GET_IF_IN_POOL_OR_WATCH:
case BUF_GET_POSSIBLY_FREED:
fil_space_t* s = fil_space_acquire_for_io(page_id.space());
@@ -6116,9 +6116,7 @@ database_corrupted:
page_not_corrupt: bpage = bpage; );
if (recv_recovery_is_on()) {
- /* Pages must be uncompressed for crash recovery. */
- ut_a(uncompressed);
- recv_recover_page(TRUE, (buf_block_t*) bpage);
+ recv_recover_page(bpage);
}
/* If space is being truncated then avoid ibuf operation.
@@ -6137,7 +6135,7 @@ database_corrupted:
<< " encrypted. However key "
"management plugin or used "
<< "key_version " << key_version
- << "is not found or"
+ << " is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.";
} else {
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index f4271c8d738..d8ec476cb4b 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -186,7 +186,7 @@ buf_read_page_low(
thd_wait_end(NULL);
}
- if (*err != DB_SUCCESS) {
+ if (UNIV_UNLIKELY(*err != DB_SUCCESS)) {
if (IORequest::ignore_missing(type)
|| *err == DB_TABLESPACE_DELETED) {
buf_read_page_handle_error(bpage);
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index c59f6107c5c..02da027f7a4 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1424,7 +1424,7 @@ next:
look to see if it is already in the tablespace cache. */
if (const fil_space_t* space
= fil_space_for_table_exists_in_mem(
- space_id, table_name.m_name, false, flags)) {
+ space_id, table_name.m_name, flags)) {
/* Recovery can open a datafile that does not
match SYS_DATAFILES. If they don't match, update
SYS_DATAFILES. */
@@ -2799,11 +2799,16 @@ dict_load_tablespace(
/* The tablespace may already be open. */
table->space = fil_space_for_table_exists_in_mem(
- table->space_id, table->name.m_name, false, table->flags);
+ table->space_id, table->name.m_name, table->flags);
if (table->space) {
return;
}
+ if (ignore_err == DICT_ERR_IGNORE_DROP) {
+ table->file_unreadable = true;
+ return;
+ }
+
if (!(ignore_err & DICT_ERR_IGNORE_RECOVER_LOCK)) {
ib::error() << "Failed to find tablespace for table "
<< table->name << " in the cache. Attempting"
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 1ac4b96d4f4..1f13e2abfcc 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1169,9 +1169,7 @@ fil_space_free(
rw_lock_x_unlock(&space->latch);
}
- bool need_mutex = !recv_recovery_on;
-
- if (need_mutex) {
+ if (!recv_recovery_is_on()) {
log_mutex_enter();
}
@@ -1182,7 +1180,7 @@ fil_space_free(
UT_LIST_REMOVE(fil_system.named_spaces, space);
}
- if (need_mutex) {
+ if (!recv_recovery_is_on()) {
log_mutex_exit();
}
@@ -1241,9 +1239,8 @@ fil_space_create(
UT_LIST_INIT(space->chain, &fil_node_t::chain);
if ((purpose == FIL_TYPE_TABLESPACE || purpose == FIL_TYPE_IMPORT)
- && !recv_recovery_on
+ && !recv_recovery_is_on()
&& id > fil_system.max_assigned_id) {
-
if (!fil_system.space_id_reuse_warned) {
fil_system.space_id_reuse_warned = true;
@@ -2847,7 +2844,7 @@ fil_rename_tablespace(
ut_ad(strchr(old_file_name, OS_PATH_SEPARATOR) != NULL);
ut_ad(strchr(new_file_name, OS_PATH_SEPARATOR) != NULL);
- if (!recv_recovery_on) {
+ if (!recv_recovery_is_on()) {
fil_name_write_rename(id, old_file_name, new_file_name);
log_mutex_enter();
}
@@ -2869,7 +2866,7 @@ fil_rename_tablespace(
node->name = new_file_name;
}
- if (!recv_recovery_on) {
+ if (!recv_recovery_is_on()) {
log_mutex_exit();
}
@@ -3904,9 +3901,6 @@ memory cache. Note that if we have not done a crash recovery at the database
startup, there may be many tablespaces which are not yet in the memory cache.
@param[in] id Tablespace ID
@param[in] name Tablespace name used in fil_space_create().
-@param[in] print_error_if_does_not_exist
- Print detailed error information to the
-error log if a matching tablespace is not found from memory.
@param[in] table_flags table flags
@return the tablespace
@retval NULL if no matching tablespace exists in the memory cache */
@@ -3914,7 +3908,6 @@ fil_space_t*
fil_space_for_table_exists_in_mem(
ulint id,
const char* name,
- bool print_error_if_does_not_exist,
ulint table_flags)
{
const ulint expected_flags = dict_tf_to_fsp_flags(table_flags);
@@ -3936,7 +3929,8 @@ fil_space_for_table_exists_in_mem(
<< ", but the tablespace"
" with that id has name " << space->name << "."
" Have you deleted or moved .ibd files?";
- goto error_exit;
+ ib::info() << TROUBLESHOOT_DATADICT_MSG;
+ goto func_exit;
}
/* Adjust the flags that are in FSP_FLAGS_MEM_MASK.
@@ -3951,17 +3945,6 @@ fil_space_for_table_exists_in_mem(
return space;
}
- if (print_error_if_does_not_exist) {
- ib::error() << "Table " << name
- << " in the InnoDB data dictionary"
- " has tablespace id " << id
- << ", but tablespace with that id"
- " or name does not exist. Have"
- " you deleted or moved .ibd files?";
-error_exit:
- ib::info() << TROUBLESHOOT_DATADICT_MSG;
- }
-
func_exit:
mutex_exit(&fil_system.mutex);
return NULL;
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc
index d43b2352a58..da15fb38530 100644
--- a/storage/innobase/fsp/fsp0fsp.cc
+++ b/storage/innobase/fsp/fsp0fsp.cc
@@ -553,13 +553,9 @@ xdes_get_offset(
* FSP_EXTENT_SIZE);
}
-/***********************************************************//**
-Inits a file page whose prior contents should be ignored. */
-static
-void
-fsp_init_file_page_low(
-/*===================*/
- buf_block_t* block) /*!< in: pointer to a page */
+/** Initialize a file page whose prior contents should be ignored.
+@param[in,out] block buffer pool block */
+void fsp_apply_init_file_page(buf_block_t* block)
{
page_t* page = buf_block_get_frame(block);
@@ -581,84 +577,34 @@ fsp_init_file_page_low(
#ifdef UNIV_DEBUG
/** Assert that the mini-transaction is compatible with
updating an allocation bitmap page.
-@param[in] id tablespace identifier
@param[in] mtr mini-transaction */
-static
-void
-fsp_space_modify_check(
- const fil_space_t* space,
- const mtr_t* mtr)
+void fil_space_t::modify_check(const mtr_t& mtr) const
{
- switch (mtr->get_log_mode()) {
+ switch (mtr.get_log_mode()) {
case MTR_LOG_SHORT_INSERTS:
case MTR_LOG_NONE:
/* These modes are only allowed within a non-bitmap page
when there is a higher-level redo log record written. */
- ut_ad(space->purpose == FIL_TYPE_TABLESPACE
- || space->purpose == FIL_TYPE_TEMPORARY);
+ ut_ad(purpose == FIL_TYPE_TABLESPACE
+ || purpose == FIL_TYPE_TEMPORARY);
break;
case MTR_LOG_NO_REDO:
- ut_ad(space->purpose == FIL_TYPE_TEMPORARY
- || space->purpose == FIL_TYPE_IMPORT
- || space->redo_skipped_count);
+ ut_ad(purpose == FIL_TYPE_TEMPORARY
+ || purpose == FIL_TYPE_IMPORT
+ || redo_skipped_count);
return;
case MTR_LOG_ALL:
- /* We may only write redo log for a persistent tablespace. */
- ut_ad(space->purpose == FIL_TYPE_TABLESPACE);
- ut_ad(mtr->is_named_space(space->id));
+ /* We may only write redo log for a persistent
+ tablespace. */
+ ut_ad(purpose == FIL_TYPE_TABLESPACE);
+ ut_ad(mtr.is_named_space(id));
return;
}
- ut_ad(0);
-}
-#endif /* UNIV_DEBUG */
-
-/** Initialize a file page.
-@param[in,out] block file page
-@param[in,out] mtr mini-transaction */
-static
-void
-fsp_init_file_page(buf_block_t* block, mtr_t* mtr)
-{
- fsp_init_file_page_low(block);
-
- mlog_write_initial_log_record(buf_block_get_frame(block),
- MLOG_INIT_FILE_PAGE2, mtr);
+ ut_ad(!"invalid log mode");
}
-
-#ifdef UNIV_DEBUG
-static
-void
-fsp_init_file_page(const fil_space_t* space, buf_block_t* block, mtr_t* mtr)
-{
- ut_d(fsp_space_modify_check(space, mtr));
- ut_ad(space->id == block->page.id.space());
- fsp_init_file_page(block, mtr);
-}
-#else /* UNIV_DEBUG */
-# define fsp_init_file_page(space, block, mtr) fsp_init_file_page(block, mtr)
#endif
-/***********************************************************//**
-Parses a redo log record of a file page init.
-@return end of log record or NULL */
-byte*
-fsp_parse_init_file_page(
-/*=====================*/
- byte* ptr, /*!< in: buffer */
- byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
- buf_block_t* block) /*!< in: block or NULL */
-{
- ut_ad(ptr != NULL);
- ut_ad(end_ptr != NULL);
-
- if (block) {
- fsp_init_file_page_low(block);
- }
-
- return(ptr);
-}
-
/**********************************************************************//**
Writes the space id and flags to a tablespace header. The flags contain
row type, physical/compressed page size, and logical/uncompressed page
@@ -784,7 +730,7 @@ fsp_try_extend_data_file_with_pages(
ulint size;
ut_a(!is_system_tablespace(space->id));
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
size = mach_read_from_4(header + FSP_SIZE);
ut_ad(size == space->size_in_header);
@@ -854,7 +800,7 @@ fsp_try_extend_data_file(fil_space_t* space, fsp_header_t* header, mtr_t* mtr)
"ran out of space. Please add another file or use"
" 'autoextend' for the last file in setting";
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
if (space->id == TRX_SYS_SPACE
&& !srv_sys_space.can_auto_extend_last_file()) {
@@ -924,8 +870,7 @@ fsp_try_extend_data_file(fil_space_t* space, fsp_header_t* header, mtr_t* mtr)
/* We ignore any fragments of a full megabyte when storing the size
to the space header */
- space->size_in_header = ut_calc_align_down(
- space->size, (1024 * 1024) / ps);
+ space->size_in_header = ut_2pow_round(space->size, (1024 * 1024) / ps);
mlog_write_ulint(
header + FSP_SIZE, space->size_in_header, MLOG_4BYTES, mtr);
@@ -974,7 +919,7 @@ fsp_fill_free_list(
ulint i;
ut_ad(page_offset(header) == FSP_HEADER_OFFSET);
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
/* Check if we can fill free list from above the free list limit */
size = mach_read_from_4(header + FSP_SIZE);
@@ -1007,8 +952,8 @@ fsp_fill_free_list(
while ((init_space && i < 1)
|| ((i + FSP_EXTENT_SIZE <= size) && (count < FSP_FREE_ADD))) {
- bool init_xdes
- = (ut_2pow_remainder(i, space->physical_size()) == 0);
+ const bool init_xdes = 0
+ == ut_2pow_remainder(i, ulint(space->physical_size()));
space->free_limit = i + FSP_EXTENT_SIZE;
mlog_write_ulint(header + FSP_FREE_LIMIT, i + FSP_EXTENT_SIZE,
@@ -1281,7 +1226,7 @@ fsp_alloc_free_page(
ulint free;
const ulint space_id = space->id;
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
header = fsp_get_space_header(space, mtr);
/* Get the hinted descriptor */
@@ -1368,8 +1313,10 @@ fsp_alloc_free_page(
The page is marked as free and clean.
@param[in,out] space tablespace
@param[in] offset page number
+@param[in] log whether to write MLOG_INIT_FREE_PAGE record
@param[in,out] mtr mini-transaction */
-static void fsp_free_page(fil_space_t* space, page_no_t offset, mtr_t* mtr)
+static void fsp_free_page(fil_space_t* space, page_no_t offset,
+ bool log, mtr_t* mtr)
{
fsp_header_t* header;
xdes_t* descr;
@@ -1377,7 +1324,7 @@ static void fsp_free_page(fil_space_t* space, page_no_t offset, mtr_t* mtr)
ulint frag_n_used;
ut_ad(mtr);
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
/* fprintf(stderr, "Freeing page %lu in space %lu\n", page, space); */
@@ -1423,6 +1370,17 @@ static void fsp_free_page(fil_space_t* space, page_no_t offset, mtr_t* mtr)
return;
}
+ if (UNIV_UNLIKELY(!log)) {
+ /* The last page freed in BtrBulk::finish() must be
+ written with redo logging disabled for the page
+ itself. The modifications of the allocation data
+ structures are covered by redo log. */
+ } else if (byte* log_ptr = mlog_open(mtr, 11)) {
+ log_ptr = mlog_write_initial_log_record_low(
+ MLOG_INIT_FREE_PAGE, space->id, offset, log_ptr, mtr);
+ mlog_close(mtr, log_ptr);
+ }
+
const ulint bit = offset % FSP_EXTENT_SIZE;
xdes_set_bit(descr, XDES_FREE_BIT, bit, TRUE, mtr);
@@ -1686,16 +1644,18 @@ fsp_alloc_seg_inode(
/** Frees a file segment inode.
@param[in,out] space tablespace
@param[in,out] inode segment inode
+@param[in] log whether to write MLOG_INIT_FREE_PAGE record
@param[in,out] mtr mini-transaction */
static void fsp_free_seg_inode(
fil_space_t* space,
fseg_inode_t* inode,
+ bool log,
mtr_t* mtr)
{
page_t* page;
fsp_header_t* space_header;
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
page = page_align(inode);
@@ -1728,7 +1688,7 @@ static void fsp_free_seg_inode(
flst_remove(space_header + FSP_SEG_INODES_FREE,
page + FSEG_INODE_PAGE_NODE, mtr);
- fsp_free_page(space, page_get_page_no(page), mtr);
+ fsp_free_page(space, page_get_page_no(page), log, mtr);
}
}
@@ -1946,7 +1906,7 @@ fseg_create(
<= srv_page_size - FIL_PAGE_DATA_END);
mtr_x_lock(&space->latch, mtr);
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
if (page != 0) {
block = buf_page_get(page_id_t(space->id, page),
@@ -2011,7 +1971,7 @@ fseg_create(
ut_ad(!has_done_reservation || block != NULL);
if (block == NULL) {
- fsp_free_seg_inode(space, inode, mtr);
+ fsp_free_seg_inode(space, inode, true, mtr);
goto funct_exit;
}
@@ -2120,7 +2080,7 @@ fseg_fill_free_list(
ut_ad(inode && mtr);
ut_ad(!((page_offset(inode) - FSEG_ARR_OFFSET) % FSEG_INODE_SIZE));
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
reserved = fseg_n_reserved_pages_low(inode, &used, mtr);
@@ -2186,7 +2146,7 @@ fseg_alloc_free_extent(
ut_ad(!((page_offset(inode) - FSEG_ARR_OFFSET) % FSEG_INODE_SIZE));
ut_ad(mach_read_from_4(inode + FSEG_MAGIC_N) == FSEG_MAGIC_N_VALUE);
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
if (flst_get_len(inode + FSEG_FREE) > 0) {
/* Segment free list is not empty, allocate from it */
@@ -2271,7 +2231,7 @@ fseg_alloc_free_page_low(
seg_id = mach_read_from_8(seg_inode + FSEG_ID);
ut_ad(seg_id);
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
ut_ad(fil_page_get_type(page_align(seg_inode)) == FIL_PAGE_INODE);
reserved = fseg_n_reserved_pages_low(seg_inode, &used, mtr);
@@ -2779,6 +2739,7 @@ fseg_mark_page_used(
@param[in] offset page number
@param[in] ahi whether we may need to drop the adaptive
hash index
+@param[in] log whether to write MLOG_INIT_FREE_PAGE record
@param[in,out] mtr mini-transaction */
static
void
@@ -2789,6 +2750,7 @@ fseg_free_page_low(
#ifdef BTR_CUR_HASH_ADAPT
bool ahi,
#endif /* BTR_CUR_HASH_ADAPT */
+ bool log,
mtr_t* mtr)
{
xdes_t* descr;
@@ -2803,7 +2765,7 @@ fseg_free_page_low(
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
== FSEG_MAGIC_N_VALUE);
ut_ad(!((page_offset(seg_inode) - FSEG_ARR_OFFSET) % FSEG_INODE_SIZE));
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
#ifdef BTR_CUR_HASH_ADAPT
/* Drop search system page hash index if the page is found in
the pool and is hashed */
@@ -2842,7 +2804,7 @@ fseg_free_page_low(
}
}
- fsp_free_page(space, offset, mtr);
+ fsp_free_page(space, offset, log, mtr);
return;
}
@@ -2897,39 +2859,45 @@ fseg_free_page_low(
}
#ifndef BTR_CUR_HASH_ADAPT
-# define fseg_free_page_low(inode, space, offset, ahi, mtr) \
- fseg_free_page_low(inode, space, offset, mtr)
+# define fseg_free_page_low(inode, space, offset, ahi, log, mtr) \
+ fseg_free_page_low(inode, space, offset, log, mtr)
#endif /* !BTR_CUR_HASH_ADAPT */
-/**********************************************************************//**
-Frees a single page of a segment. */
+/** Free a page in a file segment.
+@param[in,out] seg_header file segment header
+@param[in,out] space tablespace
+@param[in] offset page number
+@param[in] ahi whether we may need to drop the adaptive
+hash index
+@param[in] log whether to write MLOG_INIT_FREE_PAGE record
+@param[in,out] mtr mini-transaction */
void
fseg_free_page_func(
- fseg_header_t* seg_header, /*!< in: segment header */
- ulint space_id,/*!< in: space id */
- ulint page, /*!< in: page offset */
+ fseg_header_t* seg_header,
+ fil_space_t* space,
+ ulint offset,
#ifdef BTR_CUR_HASH_ADAPT
- bool ahi, /*!< in: whether we may need to drop
- the adaptive hash index */
+ bool ahi,
#endif /* BTR_CUR_HASH_ADAPT */
- mtr_t* mtr) /*!< in/out: mini-transaction */
+ bool log,
+ mtr_t* mtr)
{
DBUG_ENTER("fseg_free_page");
fseg_inode_t* seg_inode;
buf_block_t* iblock;
- fil_space_t* space = mtr_x_lock_space(space_id, mtr);
+ mtr_x_lock(&space->latch, mtr);
- DBUG_LOG("fseg_free_page", "space_id: " << space_id
- << ", page_no: " << page);
+ DBUG_LOG("fseg_free_page", "space_id: " << space->id
+ << ", page_no: " << offset);
- seg_inode = fseg_inode_get(seg_header, space_id, space->zip_size(),
+ seg_inode = fseg_inode_get(seg_header, space->id, space->zip_size(),
mtr,
&iblock);
fil_block_check_type(*iblock, FIL_PAGE_INODE, mtr);
- fseg_free_page_low(seg_inode, space, page, ahi, mtr);
+ fseg_free_page_low(seg_inode, space, offset, ahi, log, mtr);
- ut_d(buf_page_set_file_page_was_freed(page_id_t(space_id, page)));
+ ut_d(buf_page_set_file_page_was_freed(page_id_t(space->id, offset)));
DBUG_VOID_RETURN;
}
@@ -2996,7 +2964,7 @@ fseg_free_extent(
ut_a(!memcmp(descr + XDES_ID, seg_inode + FSEG_ID, 8));
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
== FSEG_MAGIC_N_VALUE);
- ut_d(fsp_space_modify_check(space, mtr));
+ ut_d(space->modify_check(*mtr));
first_page_in_extent = page - (page % FSP_EXTENT_SIZE);
@@ -3117,7 +3085,7 @@ fseg_free_step_func(
if (n == ULINT_UNDEFINED) {
/* Freeing completed: free the segment inode */
- fsp_free_seg_inode(space, inode, mtr);
+ fsp_free_seg_inode(space, inode, true, mtr);
DBUG_RETURN(TRUE);
}
@@ -3125,13 +3093,13 @@ fseg_free_step_func(
fseg_free_page_low(
inode, space,
fseg_get_nth_frag_page_no(inode, n, mtr),
- ahi, mtr);
+ ahi, true, mtr);
n = fseg_find_last_used_frag_page_slot(inode, mtr);
if (n == ULINT_UNDEFINED) {
/* Freeing completed: free the segment inode */
- fsp_free_seg_inode(space, inode, mtr);
+ fsp_free_seg_inode(space, inode, true, mtr);
DBUG_RETURN(TRUE);
}
@@ -3196,7 +3164,7 @@ fseg_free_step_not_header_func(
return(TRUE);
}
- fseg_free_page_low(inode, space, page_no, ahi, mtr);
+ fseg_free_page_low(inode, space, page_no, ahi, true, mtr);
return(FALSE);
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 828773fe761..c4fe6cdd449 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4017,12 +4017,6 @@ static int innodb_init_params()
innodb_log_checksums = innodb_log_checksums_func_update(
NULL, innodb_log_checksums);
-#ifdef HAVE_LINUX_LARGE_PAGES
- if ((os_use_large_pages = my_use_large_pages)) {
- os_large_page_size = opt_large_page_size;
- }
-#endif
-
row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout;
srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog;
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index 346caae40c2..639836c9da9 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -2090,8 +2090,9 @@ ibuf_remove_free_page(void)
the free list was so long that they cannot have taken the last
page from it. */
+ compile_time_assert(IBUF_SPACE_ID == 0);
fseg_free_page(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
- IBUF_SPACE_ID, page_no, false, &mtr);
+ fil_system.sys_space, page_no, false, true, &mtr);
const page_id_t page_id(IBUF_SPACE_ID, page_no);
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
index 2585780cfd6..adfd31aa870 100644
--- a/storage/innobase/include/btr0btr.h
+++ b/storage/innobase/include/btr0btr.h
@@ -676,16 +676,6 @@ btr_page_alloc(
for x-latching and initializing
the page */
MY_ATTRIBUTE((warn_unused_result));
-/**************************************************************//**
-Frees a file page used in an index tree. NOTE: cannot free field external
-storage pages because the page must contain info on its level. */
-void
-btr_page_free(
-/*==========*/
- dict_index_t* index, /*!< in: index tree */
- buf_block_t* block, /*!< in: block to be freed, x-latched */
- mtr_t* mtr) /*!< in: mtr */
- MY_ATTRIBUTE((nonnull));
/** Empty an index page (possibly the root page). @see btr_page_create().
@param[in,out] block page to be emptied
@param[in,out] page_zip compressed page frame, or NULL
@@ -711,18 +701,16 @@ btr_page_create(
dict_index_t* index, /*!< in: index */
ulint level, /*!< in: the B-tree level of the page */
mtr_t* mtr); /*!< in: mtr */
-/**************************************************************//**
-Frees a file page used in an index tree. Can be used also to BLOB
-external storage pages. */
-void
-btr_page_free_low(
-/*==============*/
- dict_index_t* index, /*!< in: index tree */
- buf_block_t* block, /*!< in: block to be freed, x-latched */
- ulint level, /*!< in: page level (ULINT_UNDEFINED=BLOB) */
- bool blob, /*!< in: blob page */
- mtr_t* mtr) /*!< in: mtr */
- MY_ATTRIBUTE((nonnull(1,2)));
+
+/** Free an index page.
+@param[in,out] index index tree
+@param[in,out] block block to be freed
+@param[in,out] mtr mini-transaction
+@param[in] blob whether this is freeing a BLOB page */
+MY_ATTRIBUTE((nonnull))
+void btr_page_free(dict_index_t* index, buf_block_t* block, mtr_t* mtr,
+ bool blob = false);
+
/**************************************************************//**
Gets the root node of a tree and x- or s-latches it.
@return root page, x- or s-latched */
diff --git a/storage/innobase/include/dict0types.h b/storage/innobase/include/dict0types.h
index e3b536b83ee..80b918b2df0 100644
--- a/storage/innobase/include/dict0types.h
+++ b/storage/innobase/include/dict0types.h
@@ -78,7 +78,10 @@ enum dict_err_ignore_t {
Silently load a missing
tablespace, and do not load
incomplete index definitions. */
- DICT_ERR_IGNORE_ALL = 0xFFFF /*!< ignore all errors */
+ /** ignore all errors above */
+ DICT_ERR_IGNORE_ALL = 15,
+ /** prepare to drop the table; do not attempt to load tablespace */
+ DICT_ERR_IGNORE_DROP = 31
};
/** Quiescing states for flushing tables to disk. */
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 18449785e61..b58d4e85ac9 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -105,7 +105,7 @@ struct fil_space_t {
bool is_being_truncated;
#ifdef UNIV_DEBUG
/** reference count for operations who want to skip redo log in the
- file space in order to make fsp_space_modify_check pass. */
+ file space in order to make modify_check() pass. */
Atomic_counter<ulint> redo_skipped_count;
#endif
fil_type_t purpose;/*!< purpose */
@@ -198,6 +198,12 @@ struct fil_space_t {
fil_node_t* add(const char* name, pfs_os_file_t handle,
ulint size, bool is_raw, bool atomic_write,
ulint max_pages = ULINT_MAX);
+#ifdef UNIV_DEBUG
+ /** Assert that the mini-transaction is compatible with
+ updating an allocation bitmap page.
+ @param[in] mtr mini-transaction */
+ void modify_check(const mtr_t& mtr) const;
+#endif /* UNIV_DEBUG */
/** Try to reserve free extents.
@param[in] n_free_now current number of free extents
@@ -1338,9 +1344,6 @@ memory cache. Note that if we have not done a crash recovery at the database
startup, there may be many tablespaces which are not yet in the memory cache.
@param[in] id Tablespace ID
@param[in] name Tablespace name used in fil_space_create().
-@param[in] print_error_if_does_not_exist
- Print detailed error information to the
-error log if a matching tablespace is not found from memory.
@param[in] table_flags table flags
@return the tablespace
@retval NULL if no matching tablespace exists in the memory cache */
@@ -1348,7 +1351,6 @@ fil_space_t*
fil_space_for_table_exists_in_mem(
ulint id,
const char* name,
- bool print_error_if_does_not_exist,
ulint table_flags);
/** Try to extend a tablespace if it is smaller than the specified size.
@@ -1554,16 +1556,12 @@ fil_names_write_if_was_clean(
return(was_clean);
}
-extern volatile bool recv_recovery_on;
-
/** During crash recovery, open a tablespace if it had not been opened
yet, to get valid size and flags.
@param[in,out] space tablespace */
-inline
-void
-fil_space_open_if_needed(
- fil_space_t* space)
+inline void fil_space_open_if_needed(fil_space_t* space)
{
+ ut_d(extern volatile bool recv_recovery_on);
ut_ad(recv_recovery_on);
if (space->size == 0) {
@@ -1571,10 +1569,7 @@ fil_space_open_if_needed(
until the files are opened for the first time.
fil_space_get_size() will open the file
and adjust the size and flags. */
-#ifdef UNIV_DEBUG
- ulint size =
-#endif /* UNIV_DEBUG */
- fil_space_get_size(space->id);
+ ut_d(ulint size =) fil_space_get_size(space->id);
ut_ad(size == space->size);
}
}
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h
index 9a89971bb0d..897d9d29d63 100644
--- a/storage/innobase/include/fsp0fsp.h
+++ b/storage/innobase/include/fsp0fsp.h
@@ -484,24 +484,30 @@ fsp_reserve_free_extents(
mtr_t* mtr,
ulint n_pages = 2);
-/**********************************************************************//**
-Frees a single page of a segment. */
+/** Free a page in a file segment.
+@param[in,out] seg_header file segment header
+@param[in,out] space tablespace
+@param[in] offset page number
+@param[in] ahi whether we may need to drop the adaptive
+hash index
+@param[in] log whether to write MLOG_INIT_FREE_PAGE record
+@param[in,out] mtr mini-transaction */
void
fseg_free_page_func(
- fseg_header_t* seg_header, /*!< in: segment header */
- ulint space_id, /*!< in: space id */
- ulint page, /*!< in: page offset */
+ fseg_header_t* seg_header,
+ fil_space_t* space,
+ ulint offset,
#ifdef BTR_CUR_HASH_ADAPT
- bool ahi, /*!< in: whether we may need to drop
- the adaptive hash index */
+ bool ahi,
#endif /* BTR_CUR_HASH_ADAPT */
- mtr_t* mtr); /*!< in/out: mini-transaction */
+ bool log,
+ mtr_t* mtr);
#ifdef BTR_CUR_HASH_ADAPT
-# define fseg_free_page(header, space_id, page, ahi, mtr) \
- fseg_free_page_func(header, space_id, page, ahi, mtr)
+# define fseg_free_page(header, space, offset, ahi, log, mtr) \
+ fseg_free_page_func(header, space, offset, ahi, log, mtr)
#else /* BTR_CUR_HASH_ADAPT */
-# define fseg_free_page(header, space_id, page, ahi, mtr) \
- fseg_free_page_func(header, space_id, page, mtr)
+# define fseg_free_page(header, space, offset, ahi, log, mtr) \
+ fseg_free_page_func(header, space, offset, log, mtr)
#endif /* BTR_CUR_HASH_ADAPT */
/** Determine whether a page is free.
@param[in,out] space tablespace
@@ -602,15 +608,30 @@ inline bool fsp_descr_page(const page_id_t page_id, ulint physical_size)
return (page_id.page_no() & (physical_size - 1)) == FSP_XDES_OFFSET;
}
-/***********************************************************//**
-Parses a redo log record of a file page init.
-@return end of log record or NULL */
-byte*
-fsp_parse_init_file_page(
-/*=====================*/
- byte* ptr, /*!< in: buffer */
- byte* end_ptr, /*!< in: buffer end */
- buf_block_t* block); /*!< in: block or NULL */
+/** Initialize a file page whose prior contents should be ignored.
+@param[in,out] block buffer pool block */
+void fsp_apply_init_file_page(buf_block_t* block);
+
+/** Initialize a file page.
+@param[in] space tablespace
+@param[in,out] block file page
+@param[in,out] mtr mini-transaction */
+inline void fsp_init_file_page(
+#ifdef UNIV_DEBUG
+ const fil_space_t* space,
+#endif
+ buf_block_t* block, mtr_t* mtr)
+{
+ ut_d(space->modify_check(*mtr));
+ ut_ad(space->id == block->page.id.space());
+ fsp_apply_init_file_page(block);
+ mlog_write_initial_log_record(block->frame, MLOG_INIT_FILE_PAGE2, mtr);
+}
+
+#ifndef UNIV_DEBUG
+# define fsp_init_file_page(space, block, mtr) fsp_init_file_page(block, mtr)
+#endif
+
#ifdef UNIV_BTR_PRINT
/*******************************************************************//**
Writes info of a segment. */
@@ -769,8 +790,9 @@ xdes_get_bit(
@return descriptor index */
inline ulint xdes_calc_descriptor_index(ulint zip_size, ulint offset)
{
- return(ut_2pow_remainder(offset, zip_size ? zip_size : srv_page_size)
- / FSP_EXTENT_SIZE);
+ return ut_2pow_remainder<ulint>(offset,
+ zip_size ? zip_size : srv_page_size)
+ / FSP_EXTENT_SIZE;
}
/** Determine the descriptor page number for a page.
@@ -795,7 +817,8 @@ inline ulint xdes_calc_descriptor_page(ulint zip_size, ulint offset)
ut_ad(!zip_size
|| zip_size > XDES_ARR_OFFSET
+ (zip_size / FSP_EXTENT_SIZE) * XDES_SIZE);
- return ut_2pow_round(offset, zip_size ? zip_size : srv_page_size);
+ return ut_2pow_round<ulint>(offset,
+ zip_size ? zip_size : srv_page_size);
}
#endif /* UNIV_INNOCHECKSUM */
diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
index 3f0d149d5f1..e088f248681 100644
--- a/storage/innobase/include/log0log.h
+++ b/storage/innobase/include/log0log.h
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2009, Google Inc.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -559,11 +559,12 @@ struct log_t{
uint32_t subformat;
/** individual log file size in bytes, including the header */
lsn_t file_size;
+ private:
/** lsn used to fix coordinates within the log group */
lsn_t lsn;
/** the byte offset of the above lsn */
lsn_t lsn_offset;
-
+ public:
/** used only in recovery: recovery scan succeeded up to this
lsn in this log group */
lsn_t scanned_lsn;
@@ -580,8 +581,9 @@ struct log_t{
/** Set the field values to correspond to a given lsn. */
void set_fields(lsn_t lsn)
{
- lsn_offset = calc_lsn_offset(lsn);
- this->lsn = lsn;
+ lsn_t c_lsn_offset = calc_lsn_offset(lsn);
+ set_lsn(lsn);
+ set_lsn_offset(c_lsn_offset);
}
/** Read a log segment to log_sys.buf.
@@ -600,6 +602,10 @@ struct log_t{
{
n_files = 0;
}
+ void set_lsn(lsn_t a_lsn);
+ lsn_t get_lsn() const { return lsn; }
+ void set_lsn_offset(lsn_t a_lsn);
+ lsn_t get_lsn_offset() const { return lsn_offset; }
} log;
/** The fields involved in the log buffer flush @{ */
@@ -760,6 +766,17 @@ inline lsn_t log_t::files::calc_lsn_offset(lsn_t lsn) const
return l + LOG_FILE_HDR_SIZE * (1 + l / (file_size - LOG_FILE_HDR_SIZE));
}
+inline void log_t::files::set_lsn(lsn_t a_lsn) {
+ ut_ad(log_sys.mutex.is_owned() || log_sys.write_mutex.is_owned());
+ lsn = a_lsn;
+}
+
+inline void log_t::files::set_lsn_offset(lsn_t a_lsn) {
+ ut_ad(log_sys.mutex.is_owned() || log_sys.write_mutex.is_owned());
+ ut_ad((lsn % OS_FILE_LOG_BLOCK_SIZE) == (a_lsn % OS_FILE_LOG_BLOCK_SIZE));
+ lsn_offset = a_lsn;
+}
+
/** Test if flush order mutex is owned. */
#define log_flush_order_mutex_own() \
mutex_own(&log_sys.log_flush_order_mutex)
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index 5fe00d65f2c..5d5ccac885a 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 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
@@ -40,7 +40,7 @@ Created 9/20/1997 Heikki Tuuri
extern bool recv_writer_thread_active;
/** @return whether recovery is currently running. */
-#define recv_recovery_is_on() recv_recovery_on
+#define recv_recovery_is_on() UNIV_UNLIKELY(recv_recovery_on)
/** Find the latest checkpoint in the log header.
@param[out] max_field LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2
@@ -49,12 +49,9 @@ dberr_t
recv_find_max_checkpoint(ulint* max_field)
MY_ATTRIBUTE((nonnull, warn_unused_result));
-/** Apply the hashed log records to the page, if the page lsn is less than the
-lsn of a log record.
-@param just_read_in whether the page recently arrived to the I/O handler
-@param block the page in the buffer pool */
-void
-recv_recover_page(bool just_read_in, buf_block_t* block);
+/** Apply any buffered redo log to a page that was just read from a data file.
+@param[in,out] bpage buffer pool page */
+ATTRIBUTE_COLD void recv_recover_page(buf_page_t* bpage);
/** Start recovering from a redo log checkpoint.
@see recv_recovery_from_checkpoint_finish
diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h
index b013d597393..a1f7282b3e2 100644
--- a/storage/innobase/include/mem0mem.h
+++ b/storage/innobase/include/mem0mem.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 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
@@ -77,7 +77,7 @@ is the maximum size for a single allocated buffer: */
/** Space needed when allocating for a user a field of length N.
The space is allocated only in multiples of UNIV_MEM_ALIGNMENT. */
-#define MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT)
+#define MEM_SPACE_NEEDED(N) UT_CALC_ALIGN((N), UNIV_MEM_ALIGNMENT)
#ifdef UNIV_DEBUG
/** Macro for memory heap creation.
@@ -348,8 +348,8 @@ struct mem_block_info_t {
#define MEM_FREED_BLOCK_MAGIC_N 547711122
/* Header size for a memory heap block */
-#define MEM_BLOCK_HEADER_SIZE ut_calc_align(sizeof(mem_block_info_t),\
- UNIV_MEM_ALIGNMENT)
+#define MEM_BLOCK_HEADER_SIZE UT_CALC_ALIGN(sizeof(mem_block_info_t),\
+ UNIV_MEM_ALIGNMENT)
#include "mem0mem.ic"
#endif
diff --git a/storage/innobase/include/os0proc.h b/storage/innobase/include/os0proc.h
index 823da83c63e..30ef295a7ab 100644
--- a/storage/innobase/include/os0proc.h
+++ b/storage/innobase/include/os0proc.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 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
@@ -42,12 +42,6 @@ typedef unsigned long int os_process_id_t;
system with os_mem_alloc_large(). */
extern Atomic_counter<ulint> os_total_large_mem_allocated;
-/** Whether to use large pages in the buffer pool */
-extern my_bool os_use_large_pages;
-
-/** Large page size. This may be a boot-time option on some platforms */
-extern uint os_large_page_size;
-
/** Converts the current process id to a number.
@return process id as a number */
ulint
diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h
index c5376967bd8..b462833e4c7 100644
--- a/storage/innobase/include/page0zip.h
+++ b/storage/innobase/include/page0zip.h
@@ -471,16 +471,14 @@ page_zip_copy_recs(
dict_index_t* index, /*!< in: index of the B-tree */
mtr_t* mtr); /*!< in: mini-transaction */
-/**********************************************************************//**
-Parses a log record of compressing an index page.
-@return end of log record or NULL */
-byte*
-page_zip_parse_compress(
-/*====================*/
- byte* ptr, /*!< in: buffer */
- byte* end_ptr, /*!< in: buffer end */
- page_t* page, /*!< out: uncompressed page */
- page_zip_des_t* page_zip); /*!< out: compressed page */
+/** Parse and optionally apply MLOG_ZIP_PAGE_COMPRESS.
+@param[in] ptr log record
+@param[in] end_ptr end of log
+@param[in,out] block ROW_FORMAT=COMPRESSED block, or NULL for parsing only
+@return end of log record
+@retval NULL if the log record is incomplete */
+byte* page_zip_parse_compress(const byte* ptr, const byte* end_ptr,
+ buf_block_t* block);
#endif /* !UNIV_INNOCHECKSUM */
diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h
index 7d49f0ee346..1bc3bc060dc 100644
--- a/storage/innobase/include/row0merge.h
+++ b/storage/innobase/include/row0merge.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2017, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -292,6 +292,12 @@ row_merge_drop_table(
dict_table_t* table) /*!< in: table instance to drop */
MY_ATTRIBUTE((nonnull, warn_unused_result));
+/** Write an MLOG_INDEX_LOAD record to indicate in the redo-log
+that redo-logging of individual index pages was disabled, and
+the flushing of such pages to the data files was completed.
+@param[in] index an index tree on which redo logging was disabled */
+void row_merge_write_redo(const dict_index_t* index);
+
/** Build indexes on a table by reading a clustered index, creating a temporary
file containing index entries, merge sorting these index entries and inserting
sorted index entries to indexes.
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 6ca661378b1..65c5d63953c 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 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
@@ -127,26 +128,23 @@ Calculates fast the remainder of n/m when m is a power of two.
@param n in: numerator
@param m in: denominator, must be a power of two
@return the remainder of n/m */
-#define ut_2pow_remainder(n, m) ((n) & ((m) - 1))
+template <typename T> inline T ut_2pow_remainder(T n, T m){return n & (m - 1);}
/*************************************************************//**
Calculates the biggest multiple of m that is not bigger than n
when m is a power of two. In other words, rounds n down to m * k.
@param n in: number to round down
@param m in: alignment, must be a power of two
@return n rounded down to the biggest possible integer multiple of m */
-#define ut_2pow_round(n, m) ((n) & ~((m) - 1))
-/** Align a number down to a multiple of a power of two.
-@param n in: number to round down
-@param m in: alignment, must be a power of two
-@return n rounded down to the biggest possible integer multiple of m */
-#define ut_calc_align_down(n, m) ut_2pow_round(n, m)
+template <typename T> inline T ut_2pow_round(T n, T m) { return n & ~(m - 1); }
/********************************************************//**
Calculates the smallest multiple of m that is not smaller than n
when m is a power of two. In other words, rounds n up to m * k.
@param n in: number to round up
@param m in: alignment, must be a power of two
@return n rounded up to the smallest possible integer multiple of m */
-#define ut_calc_align(n, m) (((n) + ((m) - 1)) & ~((m) - 1))
+#define UT_CALC_ALIGN(n, m) ((n + m - 1) & ~(m - 1))
+template <typename T> inline T ut_calc_align(T n, T m)
+{ return UT_CALC_ALIGN(n, m); }
/*************************************************************//**
Calculates fast the 2-logarithm of a number, rounded upward to an
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index a39b46b53be..a6f8ea99dcf 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
-Copyright (c) 2014, 2018, MariaDB Corporation.
+Copyright (c) 2014, 2019, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -193,10 +193,8 @@ void log_buffer_extend(ulong len)
log_sys.is_extending = true;
- while (ut_calc_align_down(log_sys.buf_free,
- OS_FILE_LOG_BLOCK_SIZE)
- != ut_calc_align_down(log_sys.buf_next_to_write,
- OS_FILE_LOG_BLOCK_SIZE)) {
+ while ((log_sys.buf_free ^ log_sys.buf_next_to_write)
+ & (OS_FILE_LOG_BLOCK_SIZE - 1)) {
/* Buffer might have >1 blocks to write still. */
log_mutex_exit_all();
@@ -205,9 +203,8 @@ void log_buffer_extend(ulong len)
log_mutex_enter_all();
}
- ulong move_start = ut_calc_align_down(
- log_sys.buf_free,
- OS_FILE_LOG_BLOCK_SIZE);
+ ulong move_start = ut_2pow_round(log_sys.buf_free,
+ ulong(OS_FILE_LOG_BLOCK_SIZE));
ulong move_end = log_sys.buf_free;
/* store the last log block in buffer */
@@ -896,8 +893,8 @@ log_buffer_switch()
ut_ad(log_write_mutex_own());
const byte* old_buf = log_sys.buf;
- ulint area_end = ut_calc_align(log_sys.buf_free,
- OS_FILE_LOG_BLOCK_SIZE);
+ ulong area_end = ut_calc_align(
+ log_sys.buf_free, ulong(OS_FILE_LOG_BLOCK_SIZE));
if (log_sys.first_in_use) {
log_sys.first_in_use = false;
@@ -1031,8 +1028,9 @@ loop:
start_offset = log_sys.buf_next_to_write;
end_offset = log_sys.buf_free;
- area_start = ut_calc_align_down(start_offset, OS_FILE_LOG_BLOCK_SIZE);
- area_end = ut_calc_align(end_offset, OS_FILE_LOG_BLOCK_SIZE);
+ area_start = ut_2pow_round(start_offset,
+ ulint(OS_FILE_LOG_BLOCK_SIZE));
+ area_end = ut_calc_align(end_offset, ulint(OS_FILE_LOG_BLOCK_SIZE));
ut_ad(area_end - area_start > 0);
@@ -1189,14 +1187,11 @@ synchronization objects!
this lsn
@return false if there was a flush batch of the same type running,
which means that we could not start this flush batch */
-static
-bool
-log_preflush_pool_modified_pages(
- lsn_t new_oldest)
+static bool log_preflush_pool_modified_pages(lsn_t new_oldest)
{
bool success;
- if (recv_recovery_on) {
+ if (recv_recovery_is_on()) {
/* If the recovery is running, we must first apply all
log records to their respective file pages to get the
right modify lsn values to these pages: otherwise, there
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 4840bf3088a..6305f5ec1d2 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -670,7 +670,7 @@ DECLARE_THREAD(recv_writer_thread)(
mutex_enter(&recv_sys->writer_mutex);
- if (!recv_recovery_on) {
+ if (!recv_recovery_is_on()) {
mutex_exit(&recv_sys->writer_mutex);
break;
}
@@ -765,7 +765,7 @@ recv_sys_debug_free(void)
/* wake page cleaner up to progress */
if (!srv_read_only_mode) {
- ut_ad(!recv_recovery_on);
+ ut_ad(!recv_recovery_is_on());
ut_ad(!recv_writer_thread_active);
os_event_reset(buf_flush_event);
os_event_set(recv_sys->flush_start);
@@ -987,11 +987,12 @@ recv_find_max_checkpoint_0(ulint* max_field)
*max_field = field;
max_no = checkpoint_no;
- log_sys.log.lsn = mach_read_from_8(
- buf + LOG_CHECKPOINT_LSN);
- log_sys.log.lsn_offset = static_cast<ib_uint64_t>(
- mach_read_from_4(buf + OFFSET_HIGH32)) << 32
- | mach_read_from_4(buf + OFFSET_LOW32);
+ log_sys.log.set_lsn(mach_read_from_8(
+ buf + LOG_CHECKPOINT_LSN));
+ log_sys.log.set_lsn_offset(
+ lsn_t(mach_read_from_4(buf + OFFSET_HIGH32))
+ << 32
+ | mach_read_from_4(buf + OFFSET_LOW32));
}
}
@@ -1152,10 +1153,10 @@ recv_find_max_checkpoint(ulint* max_field)
if (checkpoint_no >= max_no) {
*max_field = field;
max_no = checkpoint_no;
- log_sys.log.lsn = mach_read_from_8(
- buf + LOG_CHECKPOINT_LSN);
- log_sys.log.lsn_offset = mach_read_from_8(
- buf + LOG_CHECKPOINT_OFFSET);
+ log_sys.log.set_lsn(mach_read_from_8(
+ buf + LOG_CHECKPOINT_LSN));
+ log_sys.log.set_lsn_offset(mach_read_from_8(
+ buf + LOG_CHECKPOINT_OFFSET));
log_sys.next_checkpoint_no = checkpoint_no;
}
}
@@ -1550,7 +1551,7 @@ parse_log:
break;
case MLOG_INIT_FILE_PAGE2:
/* Allow anything in page_type when creating a page. */
- ptr = fsp_parse_init_file_page(ptr, end_ptr, block);
+ if (block) fsp_apply_init_file_page(block);
break;
case MLOG_INIT_FREE_PAGE:
/* The page can be zero-filled and its previous
@@ -1577,7 +1578,7 @@ parse_log:
break;
case MLOG_ZIP_PAGE_COMPRESS:
/* Allow anything in page_type when creating a page. */
- ptr = page_zip_parse_compress(ptr, end_ptr, page, page_zip);
+ ptr = page_zip_parse_compress(ptr, end_ptr, block);
break;
case MLOG_ZIP_PAGE_COMPRESS_NO_DATA:
if (NULL != (ptr = mlog_parse_index(
@@ -1659,6 +1660,8 @@ recv_get_fil_addr_struct(
ulint space, /*!< in: space id */
ulint page_no)/*!< in: page number */
{
+ ut_ad(mutex_own(&recv_sys->mutex));
+
recv_addr_t* recv_addr;
for (recv_addr = static_cast<recv_addr_t*>(
@@ -1732,10 +1735,6 @@ recv_add_to_hash_table(
HASH_INSERT(recv_addr_t, addr_hash, recv_sys->addr_hash,
recv_fold(space, page_no), recv_addr);
recv_sys->n_addrs++;
-#if 0
- fprintf(stderr, "Inserting log rec for space %lu, page %lu\n",
- space, page_no);
-#endif
}
UT_LIST_ADD_LAST(recv_addr->rec_list, recv);
@@ -1804,45 +1803,20 @@ recv_data_copy_to_buf(
/** Apply the hashed log records to the page, if the page lsn is less than the
lsn of a log record.
-@param just_read_in whether the page recently arrived to the I/O handler
-@param block the page in the buffer pool */
-void
-recv_recover_page(bool just_read_in, buf_block_t* block)
+@param[in,out] block buffer pool page
+@param[in,out] mtr mini-transaction
+@param[in,out] recv_addr recovery address */
+static void recv_recover_page(buf_block_t* block, mtr_t& mtr,
+ recv_addr_t* recv_addr)
{
page_t* page;
page_zip_des_t* page_zip;
- recv_addr_t* recv_addr;
- lsn_t start_lsn;
- lsn_t end_lsn;
- lsn_t page_lsn;
- lsn_t page_newest_lsn;
- mtr_t mtr;
-
- mutex_enter(&(recv_sys->mutex));
-
- if (recv_sys->apply_log_recs == FALSE) {
-
- /* Log records should not be applied now */
-
- mutex_exit(&(recv_sys->mutex));
-
- return;
- }
-
- recv_addr = recv_get_fil_addr_struct(block->page.id.space(),
- block->page.id.page_no());
-
- if ((recv_addr == NULL)
- || (recv_addr->state == RECV_BEING_PROCESSED)
- || (recv_addr->state == RECV_PROCESSED)) {
- ut_ad(recv_addr == NULL || recv_needed_recovery);
-
- mutex_exit(&(recv_sys->mutex));
-
- return;
- }
+ ut_ad(mutex_own(&recv_sys->mutex));
+ ut_ad(recv_sys->apply_log_recs);
ut_ad(recv_needed_recovery);
+ ut_ad(recv_addr->state != RECV_BEING_PROCESSED);
+ ut_ad(recv_addr->state != RECV_PROCESSED);
if (UNIV_UNLIKELY(srv_print_verbose_log == 2)) {
fprintf(stderr, "Applying log to page %u:%u\n",
@@ -1852,56 +1826,30 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
DBUG_LOG("ib_log", "Applying log to page " << block->page.id);
recv_addr->state = RECV_BEING_PROCESSED;
-
- mutex_exit(&(recv_sys->mutex));
-
- mtr_start(&mtr);
- mtr_set_log_mode(&mtr, MTR_LOG_NONE);
+ mutex_exit(&recv_sys->mutex);
page = block->frame;
page_zip = buf_block_get_page_zip(block);
- if (just_read_in) {
- /* Move the ownership of the x-latch on the page to
- this OS thread, so that we can acquire a second
- x-latch on it. This is needed for the operations to
- the page to pass the debug checks. */
-
- rw_lock_x_lock_move_ownership(&block->lock);
+ /* The page may have been modified in the buffer pool.
+ FIL_PAGE_LSN would only be updated right before flushing. */
+ lsn_t page_lsn = buf_page_get_newest_modification(&block->page);
+ if (!page_lsn) {
+ page_lsn = mach_read_from_8(page + FIL_PAGE_LSN);
}
- ibool success = buf_page_get_known_nowait(
- RW_X_LATCH, block, BUF_KEEP_OLD,
- __FILE__, __LINE__, &mtr);
- ut_a(success);
-
- buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
-
- /* Read the newest modification lsn from the page */
- page_lsn = mach_read_from_8(page + FIL_PAGE_LSN);
-
- /* It may be that the page has been modified in the buffer
- pool: read the newest modification lsn there */
-
- page_newest_lsn = buf_page_get_newest_modification(&block->page);
-
- if (page_newest_lsn) {
-
- page_lsn = page_newest_lsn;
- }
-
- start_lsn = end_lsn = 0;
-
- fil_space_t* space = fil_space_acquire(block->page.id.space());
+ lsn_t start_lsn = 0, end_lsn = 0;
for (recv_t* recv = UT_LIST_GET_FIRST(recv_addr->rec_list);
recv; recv = UT_LIST_GET_NEXT(rec_list, recv)) {
+ ut_ad(recv->start_lsn);
end_lsn = recv->end_lsn;
-
ut_ad(end_lsn <= log_sys.log.scanned_lsn);
- ut_ad(recv->start_lsn);
- if (recv->start_lsn >= page_lsn) {
+ if (recv->start_lsn < page_lsn) {
+ /* Ignore this record, because there are later changes
+ for this page. */
+ } else {
if (!start_lsn) {
start_lsn = recv->start_lsn;
}
@@ -1923,10 +1871,8 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
if (recv->len > RECV_DATA_BLOCK_SIZE) {
/* We have to copy the record body to
a separate buffer */
-
- buf = static_cast<byte*>(ut_malloc_nokey(
- recv->len));
-
+ buf = static_cast<byte*>
+ (ut_malloc_nokey(recv->len));
recv_data_copy_to_buf(buf, recv);
} else {
buf = reinterpret_cast<byte*>(recv->data)
@@ -1955,15 +1901,10 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
}
}
- space->release();
-
#ifdef UNIV_ZIP_DEBUG
- if (fil_page_index_page_check(page)) {
- page_zip_des_t* page_zip = buf_block_get_page_zip(block);
-
- ut_a(!page_zip
- || page_zip_validate_low(page_zip, page, NULL, FALSE));
- }
+ ut_ad(!fil_page_index_page_check(page)
+ || !page_zip
+ || page_zip_validate_low(page_zip, page, NULL, FALSE));
#endif /* UNIV_ZIP_DEBUG */
if (start_lsn) {
@@ -1976,8 +1917,7 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
lsn values of page */
mtr.discard_modifications();
-
- mtr_commit(&mtr);
+ mtr.commit();
ib_time_t time = ut_time();
@@ -1987,6 +1927,7 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
recv_max_page_lsn = page_lsn;
}
+ ut_ad(recv_addr->state == RECV_BEING_PROCESSED);
recv_addr->state = RECV_PROCESSED;
ut_a(recv_sys->n_addrs > 0);
@@ -1997,52 +1938,76 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
INNODB_EXTEND_TIMEOUT_INTERVAL, "To recover: " ULINTPF " pages from log", n);
}
}
+}
+
+/** Apply any buffered redo log to a page that was just read from a data file.
+@param[in,out] bpage buffer pool page */
+void recv_recover_page(buf_page_t* bpage)
+{
+ mtr_t mtr;
+ mtr.start();
+ mtr.set_log_mode(MTR_LOG_NONE);
+
+ ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
+ buf_block_t* block = reinterpret_cast<buf_block_t*>(bpage);
+
+ /* Move the ownership of the x-latch on the page to
+ this OS thread, so that we can acquire a second
+ x-latch on it. This is needed for the operations to
+ the page to pass the debug checks. */
+ rw_lock_x_lock_move_ownership(&block->lock);
+ buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
+ ibool success = buf_page_get_known_nowait(
+ RW_X_LATCH, block, BUF_KEEP_OLD,
+ __FILE__, __LINE__, &mtr);
+ ut_a(success);
+
+ mutex_enter(&recv_sys->mutex);
+ if (!recv_sys->apply_log_recs) {
+ } else if (recv_addr_t* recv_addr = recv_get_fil_addr_struct(
+ bpage->id.space(), bpage->id.page_no())) {
+ switch (recv_addr->state) {
+ case RECV_BEING_PROCESSED:
+ case RECV_PROCESSED:
+ break;
+ default:
+ recv_recover_page(block, mtr, recv_addr);
+ goto func_exit;
+ }
+ }
+ mtr.commit();
+func_exit:
mutex_exit(&recv_sys->mutex);
+ ut_ad(mtr.has_committed());
}
/** Reads in pages which have hashed log records, from an area around a given
page number.
-@param[in] page_id page id
-@return number of pages found */
-static ulint recv_read_in_area(const page_id_t page_id)
+@param[in] page_id page id */
+static void recv_read_in_area(const page_id_t page_id)
{
- recv_addr_t* recv_addr;
ulint page_nos[RECV_READ_AHEAD_AREA];
- ulint low_limit;
- ulint n;
-
- low_limit = page_id.page_no()
+ ulint page_no = page_id.page_no()
- (page_id.page_no() % RECV_READ_AHEAD_AREA);
+ ulint* p = page_nos;
- n = 0;
-
- for (ulint page_no = low_limit;
- page_no < low_limit + RECV_READ_AHEAD_AREA;
- page_no++) {
-
- recv_addr = recv_get_fil_addr_struct(page_id.space(), page_no);
-
- const page_id_t cur_page_id(page_id.space(), page_no);
-
- if (recv_addr && !buf_page_peek(cur_page_id)) {
-
- mutex_enter(&(recv_sys->mutex));
-
- if (recv_addr->state == RECV_NOT_PROCESSED) {
- recv_addr->state = RECV_BEING_READ;
-
- page_nos[n] = page_no;
-
- n++;
- }
-
- mutex_exit(&(recv_sys->mutex));
+ for (const ulint up_limit = page_no + RECV_READ_AHEAD_AREA;
+ page_no < up_limit; page_no++) {
+ recv_addr_t* recv_addr = recv_get_fil_addr_struct(
+ page_id.space(), page_no);
+ if (recv_addr
+ && recv_addr->state == RECV_NOT_PROCESSED
+ && !buf_page_peek(page_id_t(page_id.space(), page_no))) {
+ recv_addr->state = RECV_BEING_READ;
+ *p++ = page_no;
}
}
- buf_read_recv_pages(FALSE, page_id.space(), page_nos, n);
- return(n);
+ mutex_exit(&recv_sys->mutex);
+ buf_read_recv_pages(FALSE, page_id.space(), page_nos,
+ ulint(p - page_nos));
+ mutex_enter(&recv_sys->mutex);
}
/** Apply the hash table of stored log records to persistent data pages.
@@ -2106,55 +2071,49 @@ void recv_apply_hashed_log_recs(bool last_batch)
}
}
+ mtr_t mtr;
+
for (ulint i = 0; i < hash_get_n_cells(recv_sys->addr_hash); i++) {
for (recv_addr_t* recv_addr = static_cast<recv_addr_t*>(
HASH_GET_FIRST(recv_sys->addr_hash, i));
recv_addr;
recv_addr = static_cast<recv_addr_t*>(
HASH_GET_NEXT(addr_hash, recv_addr))) {
-
- if (recv_addr->state == RECV_DISCARDED
- || !UT_LIST_GET_LEN(recv_addr->rec_list)) {
-not_found:
+ if (!UT_LIST_GET_LEN(recv_addr->rec_list)) {
+ignore:
ut_a(recv_sys->n_addrs);
recv_sys->n_addrs--;
continue;
}
- fil_space_t* space = fil_space_acquire_for_io(
- recv_addr->space);
- if (!space) {
- goto not_found;
+ switch (recv_addr->state) {
+ case RECV_BEING_READ:
+ case RECV_BEING_PROCESSED:
+ case RECV_PROCESSED:
+ continue;
+ case RECV_DISCARDED:
+ goto ignore;
+ case RECV_NOT_PROCESSED:
+ break;
}
- const page_id_t page_id(recv_addr->space,
- recv_addr->page_no);
- const ulint zip_size = space->zip_size();
-
- if (recv_addr->state == RECV_NOT_PROCESSED) {
- mutex_exit(&recv_sys->mutex);
-
- if (buf_page_peek(page_id)) {
- mtr_t mtr;
- mtr.start();
-
- buf_block_t* block = buf_page_get(
- page_id, zip_size,
- RW_X_LATCH, &mtr);
-
- buf_block_dbg_add_level(
- block, SYNC_NO_ORDER_CHECK);
-
- recv_recover_page(FALSE, block);
- mtr.commit();
- } else {
- recv_read_in_area(page_id);
- }
-
- mutex_enter(&recv_sys->mutex);
+ const page_id_t page_id(recv_addr->space,
+ recv_addr->page_no);
+
+ mtr.start();
+ mtr.set_log_mode(MTR_LOG_NONE);
+ if (buf_block_t* block = buf_page_get_gen(
+ page_id, 0, RW_X_LATCH,
+ NULL, BUF_GET_IF_IN_POOL,
+ __FILE__, __LINE__, &mtr, NULL)) {
+ buf_block_dbg_add_level(
+ block, SYNC_NO_ORDER_CHECK);
+ recv_recover_page(block, mtr, recv_addr);
+ ut_ad(mtr.has_committed());
+ } else {
+ mtr.commit();
+ recv_read_in_area(page_id);
}
-
- space->release_for_io();
}
}
@@ -2395,6 +2354,15 @@ recv_report_corrupt_log(
return(true);
}
+/** Report a MLOG_INDEX_LOAD operation.
+@param[in] space_id tablespace identifier */
+ATTRIBUTE_COLD static void recv_mlog_index_load(ulint space_id)
+{
+ if (log_optimized_ddl_op) {
+ log_optimized_ddl_op(space_id);
+ }
+}
+
/** Parse log records from a buffer and optionally store them to a
hash table to wait merging to file pages.
@param[in] checkpoint_lsn the LSN of the latest checkpoint
@@ -2416,6 +2384,7 @@ bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply)
byte* body;
ut_ad(log_mutex_own());
+ ut_ad(mutex_own(&recv_sys->mutex));
ut_ad(recv_sys->parse_start_lsn != 0);
loop:
ptr = recv_sys->buf + recv_sys->recovered_offset;
@@ -2550,9 +2519,7 @@ loop:
/* fall through */
case MLOG_INDEX_LOAD:
if (type == MLOG_INDEX_LOAD) {
- if (log_optimized_ddl_op) {
- log_optimized_ddl_op(space);
- }
+ recv_mlog_index_load(space);
}
/* fall through */
case MLOG_FILE_NAME:
@@ -2706,10 +2673,7 @@ corrupted_log:
break;
#endif /* UNIV_LOG_LSN_DEBUG */
case MLOG_INDEX_LOAD:
- /* Mariabackup FIXME: Report an error
- when encountering MLOG_INDEX_LOAD on
- --prepare or already on --backup. */
- ut_a(srv_operation == SRV_OPERATION_NORMAL);
+ recv_mlog_index_load(space);
break;
case MLOG_FILE_NAME:
case MLOG_FILE_DELETE:
@@ -2983,6 +2947,8 @@ recv_scan_log_recs(
*group_scanned_lsn = scanned_lsn;
+ mutex_enter(&recv_sys->mutex);
+
if (more_data && !recv_sys->found_corrupt_log) {
/* Try to parse more log records */
@@ -2992,7 +2958,8 @@ recv_scan_log_recs(
|| recv_sys->found_corrupt_fs
|| recv_sys->mlog_checkpoint_lsn
== recv_sys->recovered_lsn);
- return(true);
+ finished = true;
+ goto func_exit;
}
if (*store_to_hash != STORE_NO
@@ -3013,6 +2980,8 @@ recv_scan_log_recs(
}
}
+func_exit:
+ mutex_exit(&recv_sys->mutex);
return(finished);
}
@@ -3657,8 +3626,8 @@ recv_reset_logs(
log_sys.lsn = ut_uint64_align_up(lsn, OS_FILE_LOG_BLOCK_SIZE);
- log_sys.log.lsn = log_sys.lsn;
- log_sys.log.lsn_offset = LOG_FILE_HDR_SIZE;
+ log_sys.log.set_lsn(log_sys.lsn);
+ log_sys.log.set_lsn_offset(LOG_FILE_HDR_SIZE);
log_sys.buf_next_to_write = 0;
log_sys.write_lsn = log_sys.lsn;
diff --git a/storage/innobase/os/os0proc.cc b/storage/innobase/os/os0proc.cc
index 7b8e4bde442..33e65484003 100644
--- a/storage/innobase/os/os0proc.cc
+++ b/storage/innobase/os/os0proc.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 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
@@ -25,6 +26,9 @@ Created 9/30/1995 Heikki Tuuri
*******************************************************/
#include "univ.i"
+#ifdef HAVE_LINUX_LARGE_PAGES
+# include "mysqld.h"
+#endif
/* FreeBSD for example has only MAP_ANON, Linux has MAP_ANONYMOUS and
MAP_ANON but MAP_ANON is marked as deprecated */
@@ -38,12 +42,6 @@ MAP_ANON but MAP_ANON is marked as deprecated */
system with os_mem_alloc_large(). */
Atomic_counter<ulint> os_total_large_mem_allocated;
-/** Whether to use large pages in the buffer pool */
-my_bool os_use_large_pages;
-
-/** Large page size. This may be a boot-time option on some platforms */
-uint os_large_page_size;
-
/** Converts the current process id to a number.
@return process id as a number */
ulint
@@ -66,18 +64,18 @@ os_mem_alloc_large(
{
void* ptr;
ulint size;
-#if defined HAVE_LINUX_LARGE_PAGES && defined UNIV_LINUX
+#ifdef HAVE_LINUX_LARGE_PAGES
int shmid;
struct shmid_ds buf;
- if (!os_use_large_pages || !os_large_page_size) {
+ if (!my_use_large_pages || !opt_large_page_size) {
goto skip;
}
- /* Align block size to os_large_page_size */
- ut_ad(ut_is_2pow(os_large_page_size));
- size = ut_2pow_round(*n + (os_large_page_size - 1),
- os_large_page_size);
+ /* Align block size to opt_large_page_size */
+ ut_ad(ut_is_2pow(opt_large_page_size));
+ size = ut_2pow_round(*n + opt_large_page_size - 1,
+ ulint(opt_large_page_size));
shmid = shmget(IPC_PRIVATE, (size_t) size, SHM_HUGETLB | SHM_R | SHM_W);
if (shmid < 0) {
@@ -107,7 +105,7 @@ os_mem_alloc_large(
ib::warn() << "Using conventional memory pool";
skip:
-#endif /* HAVE_LINUX_LARGE_PAGES && UNIV_LINUX */
+#endif /* HAVE_LINUX_LARGE_PAGES */
#ifdef _WIN32
SYSTEM_INFO system_info;
@@ -115,10 +113,8 @@ skip:
/* Align block size to system page size */
ut_ad(ut_is_2pow(system_info.dwPageSize));
- /* system_info.dwPageSize is only 32-bit. Casting to ulint is required
- on 64-bit Windows. */
- size = *n = ut_2pow_round(*n + (system_info.dwPageSize - 1),
- (ulint) system_info.dwPageSize);
+ size = *n = ut_2pow_round<ulint>(*n + (system_info.dwPageSize - 1),
+ system_info.dwPageSize);
ptr = VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE);
if (!ptr) {
@@ -157,12 +153,12 @@ os_mem_free_large(
{
ut_a(os_total_large_mem_allocated >= size);
-#if defined HAVE_LINUX_LARGE_PAGES && defined UNIV_LINUX
- if (os_use_large_pages && os_large_page_size && !shmdt(ptr)) {
+#ifdef HAVE_LINUX_LARGE_PAGES
+ if (my_use_large_pages && opt_large_page_size && !shmdt(ptr)) {
os_total_large_mem_allocated -= size;
return;
}
-#endif /* HAVE_LINUX_LARGE_PAGES && UNIV_LINUX */
+#endif /* HAVE_LINUX_LARGE_PAGES */
#ifdef _WIN32
/* When RELEASE memory, the size parameter must be 0.
Do not use MEM_RELEASE with MEM_DECOMMIT. */
diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc
index ae70c29913f..542db15f3bc 100644
--- a/storage/innobase/page/page0zip.cc
+++ b/storage/innobase/page/page0zip.cc
@@ -4861,23 +4861,20 @@ page_zip_copy_recs(
page_zip_compress_write_log(page_zip, page, index, mtr);
}
-/**********************************************************************//**
-Parses a log record of compressing an index page.
-@return end of log record or NULL */
-byte*
-page_zip_parse_compress(
-/*====================*/
- byte* ptr, /*!< in: buffer */
- byte* end_ptr,/*!< in: buffer end */
- page_t* page, /*!< out: uncompressed page */
- page_zip_des_t* page_zip)/*!< out: compressed page */
+/** Parse and optionally apply MLOG_ZIP_PAGE_COMPRESS.
+@param[in] ptr log record
+@param[in] end_ptr end of log
+@param[in,out] block ROW_FORMAT=COMPRESSED block, or NULL for parsing only
+@return end of log record
+@retval NULL if the log record is incomplete */
+byte* page_zip_parse_compress(const byte* ptr, const byte* end_ptr,
+ buf_block_t* block)
{
ulint size;
ulint trailer_size;
ut_ad(ptr != NULL);
ut_ad(end_ptr!= NULL);
- ut_ad(!page == !page_zip);
if (UNIV_UNLIKELY(ptr + (2 + 2) > end_ptr)) {
@@ -4894,14 +4891,22 @@ page_zip_parse_compress(
return(NULL);
}
- if (page) {
- if (!page_zip || page_zip_get_size(page_zip) < size) {
+ if (block) {
+ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
+ page_zip_des_t* page_zip = buf_block_get_page_zip(block);
+ if (!page_zip || page_zip_get_size(page_zip) < size
+ || block->page.id.page_no() < 3) {
corrupt:
recv_sys->found_corrupt_log = TRUE;
return(NULL);
}
+ memset(page_zip->data, 0, page_zip_get_size(page_zip));
+ mach_write_to_4(FIL_PAGE_OFFSET
+ + page_zip->data, block->page.id.page_no());
+ mach_write_to_4(FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
+ + page_zip->data, block->page.id.space());
memcpy(page_zip->data + FIL_PAGE_PREV, ptr, 4);
memcpy(page_zip->data + FIL_PAGE_NEXT, ptr + 4, 4);
memcpy(page_zip->data + FIL_PAGE_TYPE, ptr + 8, size);
@@ -4911,14 +4916,14 @@ corrupt:
memcpy(page_zip->data + page_zip_get_size(page_zip)
- trailer_size, ptr + 8 + size, trailer_size);
- if (UNIV_UNLIKELY(!page_zip_decompress(page_zip, page,
+ if (UNIV_UNLIKELY(!page_zip_decompress(page_zip, block->frame,
TRUE))) {
goto corrupt;
}
}
- return(ptr + 8 + size + trailer_size);
+ return(const_cast<byte*>(ptr) + 8 + size + trailer_size);
}
#endif /* !UNIV_INNOCHECKSUM */
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 16b8fcc8536..1ac726fd8cd 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1806,5 +1806,9 @@ exit:
ib::info() << "InnoDB_FTS: inserted " << count << " records";
}
+ if (psort_info[0].psort_common->trx->get_flush_observer()) {
+ row_merge_write_redo(aux_index);
+ }
+
return(error);
}
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 5c8a7c47435..dd3d1434418 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -4518,17 +4518,14 @@ row_merge_drop_table(
that redo-logging of individual index pages was disabled, and
the flushing of such pages to the data files was completed.
@param[in] index an index tree on which redo logging was disabled */
-static
-void
-row_merge_write_redo(
- const dict_index_t* index)
+void row_merge_write_redo(const dict_index_t* index)
{
- mtr_t mtr;
- byte* log_ptr;
-
ut_ad(!index->table->is_temporary());
+ ut_ad(!(index->type & (DICT_SPATIAL | DICT_FTS)));
+
+ mtr_t mtr;
mtr.start();
- log_ptr = mlog_open(&mtr, 11 + 8);
+ byte* log_ptr = mlog_open(&mtr, 11 + 8);
log_ptr = mlog_write_initial_log_record_low(
MLOG_INDEX_LOAD,
index->table->space_id, index->page, log_ptr, &mtr);
@@ -5069,7 +5066,10 @@ func_exit:
= dict_table_get_first_index(new_table);
index != NULL;
index = dict_table_get_next_index(index)) {
- row_merge_write_redo(index);
+ if (!(index->type
+ & (DICT_FTS | DICT_SPATIAL))) {
+ row_merge_write_redo(index);
+ }
}
}
}
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 8f0b7727b49..1225c7f35f4 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2772,7 +2772,7 @@ row_mysql_drop_garbage_tables()
btr_pcur_commit_specify_mtr(&pcur, &mtr);
if (dict_load_table(table_name, true,
- DICT_ERR_IGNORE_ALL)) {
+ DICT_ERR_IGNORE_DROP)) {
row_drop_table_for_mysql(table_name, trx,
SQLCOM_DROP_TABLE);
trx_commit_for_mysql(trx);
diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc
index df5adbd5186..dbd45979c93 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -831,35 +831,30 @@ trx_undo_free_page(
undo log page; the caller must have reserved
the rollback segment mutex */
{
- page_t* header_page;
- page_t* undo_page;
- fil_addr_t last_addr;
- trx_rsegf_t* rseg_header;
- ulint hist_size;
const ulint space = rseg->space->id;
ut_a(hdr_page_no != page_no);
ut_ad(mutex_own(&(rseg->mutex)));
- undo_page = trx_undo_page_get(page_id_t(space, page_no), mtr);
+ page_t* undo_page = trx_undo_page_get(page_id_t(space, page_no), mtr);
+ page_t* header_page = trx_undo_page_get(page_id_t(space, hdr_page_no),
+ mtr);
- header_page = trx_undo_page_get(page_id_t(space, hdr_page_no), mtr);
+ flst_remove(TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + header_page,
+ TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_NODE + undo_page, mtr);
- flst_remove(header_page + TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST,
- undo_page + TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_NODE, mtr);
+ fseg_free_page(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER + header_page,
+ rseg->space, page_no, false, true, mtr);
- fseg_free_page(header_page + TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER,
- space, page_no, false, mtr);
-
- last_addr = flst_get_last(header_page + TRX_UNDO_SEG_HDR
- + TRX_UNDO_PAGE_LIST, mtr);
+ const fil_addr_t last_addr = flst_get_last(
+ TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + header_page, mtr);
rseg->curr_size--;
if (in_history) {
- rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
-
- hist_size = mtr_read_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
- MLOG_4BYTES, mtr);
+ trx_rsegf_t* rseg_header = trx_rsegf_get(
+ rseg->space, rseg->page_no, mtr);
+ uint32_t hist_size = mach_read_from_4(
+ rseg_header + TRX_RSEG_HISTORY_SIZE);
ut_ad(hist_size > 0);
mlog_write_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
hist_size - 1, MLOG_4BYTES, mtr);
diff --git a/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff b/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff
index 5ae99e2035c..58c7620f3b9 100644
--- a/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff
+++ b/storage/myisam/mysql-test/storage_engine/alter_table_online.rdiff
@@ -14,7 +14,7 @@
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>;
--ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED.
+-ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type. Try LOCK=SHARED.
+ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected results: ER_ALTER_OPERATION_NOT_SUPPORTED_REASON)
ALTER ONLINE TABLE t1 ENGINE=MEMORY;
diff --git a/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff b/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff
index 854a00cfd81..857854a6115 100644
--- a/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff
+++ b/storage/myisammrg/mysql-test/storage_engine/alter_table_online.rdiff
@@ -61,7 +61,7 @@
+# Also, this problem may cause a chain effect (more errors of different kinds in the test).
+# -------------------------------------------
ALTER ONLINE TABLE t1 MODIFY b BIGINT <CUSTOM_COL_OPTIONS>;
--ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type INPLACE. Try LOCK=SHARED.
+-ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot change column type. Try LOCK=SHARED.
+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
+# ERROR: Statement ended with errno 1845, errname ER_ALTER_OPERATION_NOT_SUPPORTED (expected results: ER_ALTER_OPERATION_NOT_SUPPORTED_REASON)
ALTER ONLINE TABLE t1 ENGINE=MEMORY;
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 6bb8c9f6d67..e4906638f6c 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -5,8 +5,8 @@ MACRO(SKIP_ROCKSDB_PLUGIN msg)
RETURN()
ENDMACRO()
-IF (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/Makefile")
- SKIP_ROCKSDB_PLUGIN("Missing Makefile in rocksdb directory. Try \"git submodule update\".")
+IF (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/CMakeLists.txt")
+ SKIP_ROCKSDB_PLUGIN("Missing CMakeLists.txt in rocksdb directory. Try \"git submodule update\".")
ENDIF()
CHECK_LIBRARY_EXISTS(rt timer_delete "" HAVE_TIMER_DELETE)
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 6aca388ca32..b5ce958b927 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -1951,6 +1951,9 @@ int spider_db_mbase::connect(
connect_retry_count--;
my_sleep((ulong) connect_retry_interval);
} else {
+#ifdef SPIDER_NET_HAS_THD
+ db_conn->net.thd = NULL;
+#endif
if (connect_mutex)
pthread_mutex_unlock(&spider_open_conn_mutex);
break;
diff --git a/storage/spider/spd_environ.h b/storage/spider/spd_environ.h
index 5e66a912582..ded2927482b 100644
--- a/storage/spider/spd_environ.h
+++ b/storage/spider/spd_environ.h
@@ -25,6 +25,7 @@
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100100
#define SPIDER_SUPPORT_CREATE_OR_REPLACE_TABLE
+#define SPIDER_NET_HAS_THD
#endif
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100211
diff --git a/wsrep-lib b/wsrep-lib
-Subproject ae746fb28957140fb996a4aaf994baea58bd528
+Subproject e9dafb73734d71ab55078b34748e54f139aec82