Commit 5603a584 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge bb-10.2-ext into 10.3

parents 06ec864a 2ec7b870
...@@ -11,7 +11,7 @@ language: cpp ...@@ -11,7 +11,7 @@ language: cpp
os: os:
- linux - linux
- osx - osx
osx_image: xcode8.3 osx_image: xcode9.1
compiler: compiler:
- gcc - gcc
- clang - clang
......
...@@ -479,8 +479,9 @@ The following options may be given as the first argument: ...@@ -479,8 +479,9 @@ The following options may be given as the first argument:
file.Value can be between 0 and 11. Higher values mean file.Value can be between 0 and 11. Higher values mean
more verbosity more verbosity
--long-query-time=# Log all queries that have taken more than long_query_time --long-query-time=# Log all queries that have taken more than long_query_time
seconds to execute to file. The argument will be treated seconds to execute to the slow query log file. The
as a decimal value with microsecond precision argument will be treated as a decimal value with
microsecond precision
--low-priority-updates --low-priority-updates
INSERT/DELETE/UPDATE has lower priority than selects INSERT/DELETE/UPDATE has lower priority than selects
--lower-case-table-names[=#] --lower-case-table-names[=#]
......
...@@ -12,4 +12,4 @@ ...@@ -12,4 +12,4 @@
innodb_scrub : MDEV-8139 scrubbing does not work reliably innodb_scrub : MDEV-8139 scrubbing does not work reliably
innodb_scrub_background : MDEV-8139 scrubbing does not work reliably innodb_scrub_background : MDEV-8139 scrubbing does not work reliably
innodb-redo-badkey : MDEV-13893 / MDEV-12699 Improve crash recovery of corrupted data pages
...@@ -34,11 +34,11 @@ t4 CREATE TABLE `t4` ( ...@@ -34,11 +34,11 @@ t4 CREATE TABLE `t4` (
PARTITION BY HASH (`a`) PARTITION BY HASH (`a`)
PARTITIONS 2 PARTITIONS 2
alter table t1 encrypted=no; alter table t1 encrypted=no;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED'
alter table t2 encrypted=yes; alter table t2 encrypted=yes;
alter table t3 encrypted=default; alter table t3 encrypted=default;
alter table t4 encrypted=no; alter table t4 encrypted=no;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -14,7 +14,7 @@ t1 CREATE TABLE `t1` ( ...@@ -14,7 +14,7 @@ t1 CREATE TABLE `t1` (
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
alter table t1 encryption_key_id=3; alter table t1 encryption_key_id=3;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -14,7 +14,7 @@ t1 CREATE TABLE `t1` ( ...@@ -14,7 +14,7 @@ t1 CREATE TABLE `t1` (
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
alter table t1 encryption_key_id=3; alter table t1 encryption_key_id=3;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
......
...@@ -41,11 +41,10 @@ CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNOD ...@@ -41,11 +41,10 @@ CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNOD
Warnings: Warnings:
Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 1 when encryption is disabled Warning 140 InnoDB: Ignored ENCRYPTION_KEY_ID 1 when encryption is disabled
ALTER TABLE t1 ENCRYPTION_KEY_ID=99; ALTER TABLE t1 ENCRYPTION_KEY_ID=99;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available Warning 140 InnoDB: ENCRYPTION_KEY_ID 99 not available
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") Error 1478 Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
set innodb_default_encryption_key_id = 1; set innodb_default_encryption_key_id = 1;
drop table t1,t2; drop table t1,t2;
...@@ -5,7 +5,7 @@ ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") ...@@ -5,7 +5,7 @@ ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB; c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB;
ALTER TABLE t1 ENCRYPTED=YES; ALTER TABLE t1 ENCRYPTED=YES;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED'
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
c VARCHAR(256), coordinate POINT NOT NULL) ENCRYPTED=YES ENGINE=INNODB; c VARCHAR(256), coordinate POINT NOT NULL) ENCRYPTED=YES ENGINE=INNODB;
......
...@@ -22,13 +22,11 @@ show create table t2; ...@@ -22,13 +22,11 @@ show create table t2;
show create table t3; show create table t3;
show create table t4; show create table t4;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ --error ER_ILLEGAL_HA_CREATE_OPTION
--error ER_CANT_CREATE_TABLE
alter table t1 encrypted=no; alter table t1 encrypted=no;
alter table t2 encrypted=yes; alter table t2 encrypted=yes;
alter table t3 encrypted=default; alter table t3 encrypted=default;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ --error ER_ILLEGAL_HA_CREATE_OPTION
--error ER_CANT_CREATE_TABLE
alter table t4 encrypted=no; alter table t4 encrypted=no;
show create table t1; show create table t1;
......
...@@ -7,8 +7,7 @@ insert t1 values (12345, repeat('1234567890', 20)); ...@@ -7,8 +7,7 @@ insert t1 values (12345, repeat('1234567890', 20));
alter table t1 encryption_key_id=2; alter table t1 encryption_key_id=2;
show create table t1; show create table t1;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ --error ER_ILLEGAL_HA_CREATE_OPTION
--error ER_CANT_CREATE_TABLE
alter table t1 encryption_key_id=3; alter table t1 encryption_key_id=3;
show create table t1; show create table t1;
alter table t1 encryption_key_id=33; alter table t1 encryption_key_id=33;
...@@ -17,4 +16,3 @@ alter table t1 encryption_key_id=4; ...@@ -17,4 +16,3 @@ alter table t1 encryption_key_id=4;
show create table t1; show create table t1;
drop table t1; drop table t1;
...@@ -27,10 +27,8 @@ DROP TABLE t1; ...@@ -27,10 +27,8 @@ DROP TABLE t1;
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB; CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=1; CREATE TABLE t2 (pk INT PRIMARY KEY AUTO_INCREMENT, c VARCHAR(256)) ENGINE=INNODB ENCRYPTED=NO ENCRYPTION_KEY_ID=1;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ --error ER_ILLEGAL_HA_CREATE_OPTION
--error 1005
ALTER TABLE t1 ENCRYPTION_KEY_ID=99; ALTER TABLE t1 ENCRYPTION_KEY_ID=99;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
SHOW WARNINGS; SHOW WARNINGS;
set innodb_default_encryption_key_id = 1; set innodb_default_encryption_key_id = 1;
......
...@@ -20,10 +20,8 @@ ENCRYPTED=YES; ...@@ -20,10 +20,8 @@ ENCRYPTED=YES;
# #
CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT, CREATE TABLE t1 (pk INT PRIMARY KEY AUTO_INCREMENT,
c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB; c VARCHAR(256), coordinate POINT NOT NULL, SPATIAL index(coordinate)) ENGINE=INNODB;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/ --error ER_ILLEGAL_HA_CREATE_OPTION
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ENCRYPTED=YES; ALTER TABLE t1 ENCRYPTED=YES;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
DROP TABLE t1; DROP TABLE t1;
# #
......
innodb_virtual_debug_purge : MDEV-13568 should purge yield to LOCK TABLES?
...@@ -36,12 +36,11 @@ innodb_redundant CREATE TABLE `innodb_redundant` ( ...@@ -36,12 +36,11 @@ innodb_redundant CREATE TABLE `innodb_redundant` (
`b` char(200) DEFAULT NULL `b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
alter table innodb_redundant page_compressed=1; alter table innodb_redundant page_compressed=1;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
show warnings; show warnings;
Level Code Message Level Code Message
Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT
Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") Error 1478 Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
show create table innodb_redundant; show create table innodb_redundant;
Table Create Table Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` ( innodb_redundant CREATE TABLE `innodb_redundant` (
......
...@@ -235,7 +235,8 @@ t1 CREATE TABLE `t1` ( ...@@ -235,7 +235,8 @@ t1 CREATE TABLE `t1` (
ALTER TABLE t1 ROW_FORMAT=REDUNDANT; ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done'; SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done';
SET lock_wait_timeout = 10; SET lock_wait_timeout = 10;
ALTER TABLE t1 ROW_FORMAT=COMPACT, ALGORITHM = INPLACE; ALTER TABLE t1 ROW_FORMAT=COMPACT
PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;
# session default # session default
connection default; connection default;
INSERT INTO t1 SELECT 80 + c1, c2, c3 FROM t1; INSERT INTO t1 SELECT 80 + c1, c2, c3 FROM t1;
......
...@@ -26,10 +26,8 @@ create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row ...@@ -26,10 +26,8 @@ create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row
show warnings; show warnings;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant; create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
show create table innodb_redundant; show create table innodb_redundant;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/ --error ER_ILLEGAL_HA_CREATE_OPTION
--error 1005
alter table innodb_redundant page_compressed=1; alter table innodb_redundant page_compressed=1;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
show warnings; show warnings;
show create table innodb_redundant; show create table innodb_redundant;
alter table innodb_redundant row_format=compact page_compressed=1; alter table innodb_redundant row_format=compact page_compressed=1;
......
...@@ -215,7 +215,8 @@ SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done ...@@ -215,7 +215,8 @@ SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt2 WAIT_FOR dml2_done
# Ensure that the ALTER TABLE will be executed even with some concurrent DML. # Ensure that the ALTER TABLE will be executed even with some concurrent DML.
SET lock_wait_timeout = 10; SET lock_wait_timeout = 10;
--send --send
ALTER TABLE t1 ROW_FORMAT=COMPACT, ALGORITHM = INPLACE; ALTER TABLE t1 ROW_FORMAT=COMPACT
PAGE_COMPRESSED = YES PAGE_COMPRESSION_LEVEL = 1, ALGORITHM = INPLACE;
# Generate some log (delete-mark, delete-unmark, insert etc.) # Generate some log (delete-mark, delete-unmark, insert etc.)
# while the index creation is blocked. Some of this may run # while the index creation is blocked. Some of this may run
......
...@@ -1935,7 +1935,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME ...@@ -1935,7 +1935,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10.000000 DEFAULT_VALUE 10.000000
VARIABLE_SCOPE SESSION VARIABLE_SCOPE SESSION
VARIABLE_TYPE DOUBLE VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Log all queries that have taken more than long_query_time seconds to execute to file. The argument will be treated as a decimal value with microsecond precision VARIABLE_COMMENT Log all queries that have taken more than long_query_time seconds to execute to the slow query log file. The argument will be treated as a decimal value with microsecond precision
NUMERIC_MIN_VALUE 0 NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000 NUMERIC_MAX_VALUE 31536000
NUMERIC_BLOCK_SIZE NULL NUMERIC_BLOCK_SIZE NULL
......
...@@ -2131,7 +2131,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME ...@@ -2131,7 +2131,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 10.000000 DEFAULT_VALUE 10.000000
VARIABLE_SCOPE SESSION VARIABLE_SCOPE SESSION
VARIABLE_TYPE DOUBLE VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Log all queries that have taken more than long_query_time seconds to execute to file. The argument will be treated as a decimal value with microsecond precision VARIABLE_COMMENT Log all queries that have taken more than long_query_time seconds to execute to the slow query log file. The argument will be treated as a decimal value with microsecond precision
NUMERIC_MIN_VALUE 0 NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000 NUMERIC_MAX_VALUE 31536000
NUMERIC_BLOCK_SIZE NULL NUMERIC_BLOCK_SIZE NULL
......
...@@ -153,7 +153,11 @@ log_generic () { ...@@ -153,7 +153,11 @@ log_generic () {
echo "$msg" echo "$msg"
case $logging in case $logging in
init) ;; # Just echo the message, don't save it anywhere init) ;; # Just echo the message, don't save it anywhere
file) echo "$msg" | "$helper" "$user" log "$err_log" ;; file)
if [ -n "$helper" ]; then
echo "$msg" | "$helper" "$user" log "$err_log"
fi
;;
syslog) logger -t "$syslog_tag_mysqld_safe" -p "$priority" "$*" ;; syslog) logger -t "$syslog_tag_mysqld_safe" -p "$priority" "$*" ;;
*) *)
echo "Internal program error (non-fatal):" \ echo "Internal program error (non-fatal):" \
...@@ -173,7 +177,11 @@ log_notice () { ...@@ -173,7 +177,11 @@ log_notice () {
eval_log_error () { eval_log_error () {
local cmd="$1" local cmd="$1"
case $logging in case $logging in
file) cmd="$cmd 2>&1 | "`shell_quote_string "$helper"`" $user log "`shell_quote_string "$err_log"` ;; file)
if [ -n "$helper" ]; then
cmd="$cmd 2>&1 | "`shell_quote_string "$helper"`" $user log "`shell_quote_string "$err_log"`
fi
;;
syslog) syslog)
# mysqld often prefixes its messages with a timestamp, which is # mysqld often prefixes its messages with a timestamp, which is
# redundant when logging to syslog (which adds its own timestamp) # redundant when logging to syslog (which adds its own timestamp)
...@@ -455,8 +463,9 @@ get_mysql_config() { ...@@ -455,8 +463,9 @@ get_mysql_config() {
# set_malloc_lib LIB # set_malloc_lib LIB
# - If LIB is empty, do nothing and return # - If LIB is empty, do nothing and return
# - If LIB is 'tcmalloc', look for tcmalloc shared library in /usr/lib # - If LIB starts with 'tcmalloc' or 'jemalloc', look for the shared library in
# then pkglibdir. tcmalloc is part of the Google perftools project. # /usr/lib, /usr/lib64 and then pkglibdir.
# tcmalloc is part of the Google perftools project.
# - If LIB is an absolute path, assume it is a malloc shared library # - If LIB is an absolute path, assume it is a malloc shared library
# #
# Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when # Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when
...@@ -464,23 +473,23 @@ get_mysql_config() { ...@@ -464,23 +473,23 @@ get_mysql_config() {
set_malloc_lib() { set_malloc_lib() {
malloc_lib="$1" malloc_lib="$1"
if [ "$malloc_lib" = tcmalloc ]; then if expr "$malloc_lib" : "\(tcmalloc\|jemalloc\)" > /dev/null ; then
pkglibdir=`get_mysql_config --variable=pkglibdir` pkglibdir=`get_mysql_config --variable=pkglibdir`
malloc_lib= where=''
# This list is kept intentionally simple. Simply set --malloc-lib # This list is kept intentionally simple. Simply set --malloc-lib
# to a full path if another location is desired. # to a full path if another location is desired.
for libdir in /usr/lib "$pkglibdir" "$pkglibdir/mysql"; do for libdir in /usr/lib /usr/lib64 "$pkglibdir" "$pkglibdir/mysql"; do
for flavor in _minimal '' _and_profiler _debug; do tmp=`echo "$libdir/lib$malloc_lib.so".[0-9]`
tmp="$libdir/libtcmalloc$flavor.so" where="$where $libdir"
#log_notice "DEBUG: Checking for malloc lib '$tmp'" # log_notice "DEBUG: Checking for malloc lib '$tmp'"
[ -r "$tmp" ] || continue [ -r "$tmp" ] || continue
malloc_lib="$tmp" malloc_lib="$tmp"
break 2 where=''
done break
done done
if [ -z "$malloc_lib" ]; then if [ -n "$where" ]; then
log_error "no shared library for --malloc-lib=tcmalloc found in /usr/lib or $pkglibdir" log_error "no shared library for lib$malloc_lib.so.[0-9] found in$where"
exit 1 exit 1
fi fi
fi fi
...@@ -496,8 +505,8 @@ set_malloc_lib() { ...@@ -496,8 +505,8 @@ set_malloc_lib() {
fi fi
;; ;;
*) *)
log_error "--malloc-lib must be an absolute path or 'tcmalloc'; " \ log_error "--malloc-lib must be an absolute path, 'tcmalloc' or " \
"ignoring value '$malloc_lib'" "'jemalloc'; ignoring value '$malloc_lib'"
exit 1 exit 1
;; ;;
esac esac
...@@ -549,6 +558,9 @@ fi ...@@ -549,6 +558,9 @@ fi
helper=`find_in_bin mysqld_safe_helper` helper=`find_in_bin mysqld_safe_helper`
print_defaults=`find_in_bin my_print_defaults` print_defaults=`find_in_bin my_print_defaults`
# Check if helper exists
$helper --help >/dev/null 2>&1 || helper=""
# #
# Second, try to find the data directory # Second, try to find the data directory
# #
...@@ -751,7 +763,7 @@ then ...@@ -751,7 +763,7 @@ then
does not exist or is not executable. Please cd to the mysql installation does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows: directory and restart this script from there as follows:
./bin/mysqld_safe& ./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information" See https://mariadb.com/kb/en/mysqld_safe for more information"
exit 1 exit 1
fi fi
......
...@@ -1353,6 +1353,8 @@ longlong Item_func_json_contains_path::val_int() ...@@ -1353,6 +1353,8 @@ longlong Item_func_json_contains_path::val_int()
bzero(p_found, (arg_count-2) * sizeof(bool)); bzero(p_found, (arg_count-2) * sizeof(bool));
n_found= arg_count - 2; n_found= arg_count - 2;
} }
else
n_found= 0; /* Jost to prevent 'uninitialized value' warnings */
result= 0; result= 0;
while (json_get_path_next(&je, &p) == 0) while (json_get_path_next(&je, &p) == 0)
...@@ -2059,7 +2061,7 @@ String *Item_func_json_merge::val_str(String *str) ...@@ -2059,7 +2061,7 @@ String *Item_func_json_merge::val_str(String *str)
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
json_engine_t je1, je2; json_engine_t je1, je2;
String *js1= args[0]->val_json(&tmp_js1), *js2; String *js1= args[0]->val_json(&tmp_js1), *js2=NULL;
uint n_arg; uint n_arg;
LINT_INIT(js2); LINT_INIT(js2);
......
...@@ -2160,15 +2160,15 @@ static void mysqld_exit(int exit_code) ...@@ -2160,15 +2160,15 @@ static void mysqld_exit(int exit_code)
shutdown_performance_schema(); // we do it as late as possible shutdown_performance_schema(); // we do it as late as possible
#endif #endif
set_malloc_size_cb(NULL); set_malloc_size_cb(NULL);
if (!opt_debugging && !my_disable_leak_check) if (opt_endinfo && global_status_var.global_memory_used)
fprintf(stderr, "Warning: Memory not freed: %ld\n",
(long) global_status_var.global_memory_used);
if (!opt_debugging && !my_disable_leak_check && exit_code == 0)
{ {
DBUG_SLOW_ASSERT(global_status_var.global_memory_used == 0); DBUG_SLOW_ASSERT(global_status_var.global_memory_used == 0);
} }
cleanup_tls(); cleanup_tls();
DBUG_LEAVE; DBUG_LEAVE;
if (opt_endinfo && global_status_var.global_memory_used)
fprintf(stderr, "Warning: Memory not freed: %ld\n",
(long) global_status_var.global_memory_used);
sd_notify(0, "STATUS=MariaDB server is down"); sd_notify(0, "STATUS=MariaDB server is down");
exit(exit_code); /* purecov: inspected */ exit(exit_code); /* purecov: inspected */
} }
......
...@@ -1309,8 +1309,8 @@ static bool update_cached_long_query_time(sys_var *self, THD *thd, ...@@ -1309,8 +1309,8 @@ static bool update_cached_long_query_time(sys_var *self, THD *thd,
static Sys_var_double Sys_long_query_time( static Sys_var_double Sys_long_query_time(
"long_query_time", "long_query_time",
"Log all queries that have taken more than long_query_time seconds " "Log all queries that have taken more than long_query_time seconds "
"to execute to file. The argument will be treated as a decimal value " "to execute to the slow query log file. The argument will be treated "
"with microsecond precision", "as a decimal value with microsecond precision",
SESSION_VAR(long_query_time_double), SESSION_VAR(long_query_time_double),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(10), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(10),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
......
...@@ -77,7 +77,7 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_REBUILD ...@@ -77,7 +77,7 @@ static const Alter_inplace_info::HA_ALTER_FLAGS INNOBASE_ALTER_REBUILD
= Alter_inplace_info::ADD_PK_INDEX = Alter_inplace_info::ADD_PK_INDEX
| Alter_inplace_info::DROP_PK_INDEX | Alter_inplace_info::DROP_PK_INDEX
| Alter_inplace_info::CHANGE_CREATE_OPTION | Alter_inplace_info::CHANGE_CREATE_OPTION
/* CHANGE_CREATE_OPTION needs to check innobase_need_rebuild() */ /* CHANGE_CREATE_OPTION needs to check create_option_need_rebuild() */
| Alter_inplace_info::ALTER_COLUMN_NULLABLE | Alter_inplace_info::ALTER_COLUMN_NULLABLE
| Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE | Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE
| Alter_inplace_info::ALTER_STORED_COLUMN_ORDER | Alter_inplace_info::ALTER_STORED_COLUMN_ORDER
...@@ -445,33 +445,61 @@ innobase_spatial_exist( ...@@ -445,33 +445,61 @@ innobase_spatial_exist(
return(false); return(false);
} }
/*******************************************************************//** /** Determine if CHANGE_CREATE_OPTION requires rebuilding the table.
Determine if ALTER TABLE needs to rebuild the table. @param[in] ha_alter_info the ALTER TABLE operation
@param ha_alter_info the DDL operation @param[in] table metadata before ALTER TABLE
@param altered_table MySQL original table @return whether it is mandatory to rebuild the table */
@return whether it is necessary to rebuild the table */ static bool create_option_need_rebuild(
const Alter_inplace_info* ha_alter_info,
const TABLE* table)
{
DBUG_ASSERT((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
== Alter_inplace_info::CHANGE_CREATE_OPTION);
if (ha_alter_info->create_info->used_fields
& (HA_CREATE_USED_ROW_FORMAT
| HA_CREATE_USED_KEY_BLOCK_SIZE)) {
/* Specifying ROW_FORMAT or KEY_BLOCK_SIZE requires
rebuilding the table. (These attributes in the .frm
file may disagree with the InnoDB data dictionary, and
the interpretation of thse attributes depends on
InnoDB parameters. That is why we for now always
require a rebuild when these attributes are specified.) */
return true;
}
const ha_table_option_struct& alt_opt=
*ha_alter_info->create_info->option_struct;
const ha_table_option_struct& opt= *table->s->option_struct;
if (alt_opt.page_compressed != opt.page_compressed
|| alt_opt.page_compression_level
!= opt.page_compression_level
|| alt_opt.encryption != opt.encryption
|| alt_opt.encryption_key_id != opt.encryption_key_id) {
return(true);
}
return false;
}
/** Determine if ALTER TABLE needs to rebuild the table
(or perform instant operation).
@param[in] ha_alter_info the ALTER TABLE operation
@param[in] table metadata before ALTER TABLE
@return whether it is necessary to rebuild the table or to alter columns */
static MY_ATTRIBUTE((nonnull, warn_unused_result)) static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool bool
innobase_need_rebuild( innobase_need_rebuild(
/*==================*/
const Alter_inplace_info* ha_alter_info, const Alter_inplace_info* ha_alter_info,
const TABLE* altered_table) const TABLE* table)
{ {
Alter_inplace_info::HA_ALTER_FLAGS alter_inplace_flags = if ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
ha_alter_info->handler_flags & ~(INNOBASE_INPLACE_IGNORE); == Alter_inplace_info::CHANGE_CREATE_OPTION) {
return create_option_need_rebuild(ha_alter_info, table);
if (alter_inplace_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !(ha_alter_info->create_info->used_fields
& (HA_CREATE_USED_ROW_FORMAT
| HA_CREATE_USED_KEY_BLOCK_SIZE))) {
/* Any other CHANGE_CREATE_OPTION than changing
ROW_FORMAT or KEY_BLOCK_SIZE can be done without
rebuilding the table. */
return(false);
} }
return(!!(ha_alter_info->handler_flags & INNOBASE_ALTER_REBUILD)); return !!(ha_alter_info->handler_flags & INNOBASE_ALTER_REBUILD);
} }
/** Check if virtual column in old and new table are in order, excluding /** Check if virtual column in old and new table are in order, excluding
...@@ -631,28 +659,6 @@ ha_innobase::check_if_supported_inplace_alter( ...@@ -631,28 +659,6 @@ ha_innobase::check_if_supported_inplace_alter(
// allow ADD COLUMN even if SPATIAL INDEX, FULLTEXT INDEX or // allow ADD COLUMN even if SPATIAL INDEX, FULLTEXT INDEX or
// virtual columns exist, also together with adding virtual columns. // virtual columns exist, also together with adding virtual columns.
/* Change on engine specific table options require rebuild of the
table */
if (ha_alter_info->handler_flags
& Alter_inplace_info::CHANGE_CREATE_OPTION) {
ha_table_option_struct *new_options= ha_alter_info->create_info->option_struct;
ha_table_option_struct *old_options= table->s->option_struct;
if (new_options->page_compressed != old_options->page_compressed ||
new_options->page_compression_level != old_options->page_compression_level) {
ha_alter_info->unsupported_reason = innobase_get_err_msg(
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
if (new_options->encryption != old_options->encryption ||
new_options->encryption_key_id != old_options->encryption_key_id) {
ha_alter_info->unsupported_reason = innobase_get_err_msg(
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
}
if (ha_alter_info->handler_flags if (ha_alter_info->handler_flags
& ~(INNOBASE_INPLACE_IGNORE & ~(INNOBASE_INPLACE_IGNORE
| INNOBASE_ALTER_NOREBUILD | INNOBASE_ALTER_NOREBUILD
...@@ -5084,11 +5090,9 @@ prepare_inplace_alter_table_dict( ...@@ -5084,11 +5090,9 @@ prepare_inplace_alter_table_dict(
goto not_instant_add_column; goto not_instant_add_column;
} }
if ((ha_alter_info->handler_flags if ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
& Alter_inplace_info::CHANGE_CREATE_OPTION) == Alter_inplace_info::CHANGE_CREATE_OPTION
&& (ha_alter_info->create_info->used_fields && create_option_need_rebuild(ha_alter_info, old_table)) {
& (HA_CREATE_USED_ROW_FORMAT
| HA_CREATE_USED_KEY_BLOCK_SIZE))) {
goto not_instant_add_column; goto not_instant_add_column;
} }
...@@ -5262,6 +5266,20 @@ prepare_inplace_alter_table_dict( ...@@ -5262,6 +5266,20 @@ prepare_inplace_alter_table_dict(
fil_space_release(s); fil_space_release(s);
} }
if (ha_alter_info->handler_flags
& Alter_inplace_info::CHANGE_CREATE_OPTION) {
const ha_table_option_struct& alt_opt=
*ha_alter_info->create_info->option_struct;
const ha_table_option_struct& opt=
*old_table->s->option_struct;
if (alt_opt.encryption != opt.encryption
|| alt_opt.encryption_key_id
!= opt.encryption_key_id) {
key_id = alt_opt.encryption_key_id;
mode = fil_encryption_t(alt_opt.encryption);
}
}
if (dict_table_get_low(ctx->new_table->name.m_name)) { if (dict_table_get_low(ctx->new_table->name.m_name)) {
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), my_error(ER_TABLE_EXISTS_ERROR, MYF(0),
ctx->new_table->name.m_name); ctx->new_table->name.m_name);
...@@ -6607,7 +6625,7 @@ ha_innobase::prepare_inplace_alter_table( ...@@ -6607,7 +6625,7 @@ ha_innobase::prepare_inplace_alter_table(
if (!(ha_alter_info->handler_flags & INNOBASE_ALTER_DATA) if (!(ha_alter_info->handler_flags & INNOBASE_ALTER_DATA)
|| ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) || ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
== Alter_inplace_info::CHANGE_CREATE_OPTION == Alter_inplace_info::CHANGE_CREATE_OPTION
&& !innobase_need_rebuild(ha_alter_info, table))) { && !create_option_need_rebuild(ha_alter_info, table))) {
if (heap) { if (heap) {
ha_alter_info->handler_ctx ha_alter_info->handler_ctx
...@@ -6892,7 +6910,7 @@ ha_innobase::inplace_alter_table( ...@@ -6892,7 +6910,7 @@ ha_innobase::inplace_alter_table(
if ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE) if ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
== Alter_inplace_info::CHANGE_CREATE_OPTION == Alter_inplace_info::CHANGE_CREATE_OPTION
&& !innobase_need_rebuild(ha_alter_info, table)) { && !create_option_need_rebuild(ha_alter_info, table)) {
goto ok_exit; goto ok_exit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment