Skip to content

Commit

Permalink
Merge branch '10.2' into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed Feb 10, 2020
2 parents d72038a + 235d7c6 commit 58b70dc
Show file tree
Hide file tree
Showing 23 changed files with 129 additions and 90 deletions.
2 changes: 2 additions & 0 deletions cmake/cpack_rpm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ SET(ignored
"%ignore /etc/systemd/system"
"%ignore /lib"
"%ignore /lib/security"
"%ignore /lib64"
"%ignore /lib64/security"
"%ignore ${CMAKE_INSTALL_PREFIX}"
"%ignore ${CMAKE_INSTALL_PREFIX}/bin"
"%ignore ${CMAKE_INSTALL_PREFIX}/include"
Expand Down
2 changes: 1 addition & 1 deletion cmake/install_layout.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock"
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
SET(INSTALL_PAMDIR_RPM "/lib/security")
SET(INSTALL_PAMDIR_RPM "/${INSTALL_LIBDIR_RPM}/security")

#
# DEB layout
Expand Down
34 changes: 18 additions & 16 deletions mysql-test/main/mysqld--help,win.rdiff
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -381,7 +381,6 @@ The following options may be given as the first argument:
@@ -395,7 +395,6 @@
The number of segments in a key cache
-L, --language=name Client error messages in given language. May be given as
a full path. Deprecated. Use --lc-messages-dir instead.
- --large-pages Enable support for large pages
--lc-messages=name Set the language used for the error messages.
-L, --lc-messages-dir=name
Directory where error messages are
@@ -603,6 +602,7 @@ The following options may be given as the first argument:
@@ -617,6 +616,7 @@
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
DATETIME, TIMESTAMP columns.
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
+ --named-pipe Enable the named pipe (NT)
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
@@ -1048,6 +1048,9 @@ The following options may be given as the first argument:
@@ -1073,6 +1073,9 @@
characteristics (isolation level, read only/read
write,snapshot - but not any work done / data modified
within the transaction).
Expand All @@ -26,7 +26,7 @@
--show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this
master.
@@ -1171,6 +1174,10 @@ The following options may be given as the first argument:
@@ -1196,6 +1199,10 @@
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
slow log options
Expand All @@ -37,15 +37,15 @@
--socket=name Socket file to use for connection
--sort-buffer-size=#
Each thread that needs to do a sort allocates a buffer of
@@ -1190,6 +1197,7 @@ The following options may be given as the first argument:
EMPTY_STRING_IS_NULL, SIMULTANEOUS_ASSIGNMENT
@@ -1219,6 +1226,7 @@
deleting or updating every row in a table.
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
+ --standalone Dummy option to start as a standalone program (NT).
--standard-compliant-cte
Allow only CTEs compliant to SQL standard
(Defaults to on; use --skip-standard-compliant-cte to disable.)
@@ -1257,6 +1265,11 @@ The following options may be given as the first argument:
@@ -1286,6 +1294,11 @@
--thread-pool-max-threads=#
Maximum allowed number of worker threads in the thread
pool
Expand All @@ -57,7 +57,7 @@
--thread-pool-oversubscribe=#
How many additional active worker threads in a group are
allowed.
@@ -1295,8 +1308,8 @@ The following options may be given as the first argument:
@@ -1324,8 +1337,8 @@
automatically convert it to an on-disk MyISAM or Aria
table.
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
Expand All @@ -68,23 +68,23 @@
--transaction-alloc-block-size=#
Allocation block size for transactions to be stored in
binary log
@@ -1430,7 +1443,6 @@ key-cache-block-size 1024
@@ -1462,7 +1475,6 @@
key-cache-division-limit 100
key-cache-file-hash-size 512
key-cache-segments 0
-large-pages FALSE
lc-messages en_US
lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
@@ -1502,6 +1514,7 @@ myisam-sort-buffer-size 134216704
@@ -1534,6 +1546,7 @@
myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
mysql56-temporal-format TRUE
+named-pipe FALSE
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
@@ -1612,6 +1625,8 @@ session-track-schema TRUE
@@ -1645,6 +1658,8 @@
session-track-state-change FALSE
session-track-system-variables autocommit,character_set_client,character_set_connection,character_set_results,time_zone
session-track-transaction-info OFF
Expand All @@ -93,27 +93,29 @@
show-slave-auth-info FALSE
silent-startup FALSE
skip-grant-tables TRUE
@@ -1638,6 +1653,7 @@ slave-transaction-retry-interval 0
@@ -1671,6 +1686,7 @@
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
+slow-start-timeout 15000
sort-buffer-size 2097152
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
stack-trace TRUE
@@ -1652,9 +1668,9 @@ sync-relay-log 10000
sql-safe-updates FALSE
@@ -1686,10 +1702,10 @@
sync-relay-log-info 10000
sysdate-is-now FALSE
system-versioning-alter-history ERROR
-table-cache 421
+table-cache 2000
table-definition-cache 400
-table-open-cache 421
-table-open-cache-instances 1
+table-open-cache 2000
table-open-cache-instances 8
+table-open-cache-instances 8
tc-heuristic-recover OFF
tcp-keepalive-interval 0
@@ -1663,6 +1679,8 @@ tcp-keepalive-time 0
tcp-keepalive-probes 0
@@ -1697,6 +1713,8 @@
thread-cache-size 151
thread-pool-idle-timeout 60
thread-pool-max-threads 65536
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/mysqld--help.result
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ system-versioning-alter-history ERROR
table-cache 421
table-definition-cache 400
table-open-cache 421
table-open-cache-instances 8
table-open-cache-instances 1
tc-heuristic-recover OFF
tcp-keepalive-interval 0
tcp-keepalive-probes 0
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4732,8 +4732,8 @@ ($$)
qr/InnoDB: See also */,
qr/InnoDB: Cannot open .*ib_buffer_pool.* for reading: No such file or directory*/,
qr/InnoDB: Table .*mysql.*innodb_table_stats.* not found./,
qr/InnoDB: User stopword table .* does not exist./

qr/InnoDB: User stopword table .* does not exist./,
qr/Detected table cache mutex contention at instance .* waits. Additional table cache instance cannot be activated: consider raising table_open_cache_instances. Number of active instances/
);

my $matched_lines= [];
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/suite/innodb/r/innodb-blob.result
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,9 @@ a
SELECT * FROM t2;
a
DROP TABLE t1,t2,t3;
CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT)ENGINE=InnoDB
ROW_FORMAT=REDUNDANT;
SET @fill_amount = (@@innodb_page_size / 2 ) + 1 ;
INSERT INTO t1 VALUES(1, REPEAT(2, @fill_amount));
UPDATE t1 SET f1 = 2;
DROP TABLE t1;
7 changes: 7 additions & 0 deletions mysql-test/suite/innodb/t/innodb-blob.test
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,10 @@ SELECT a FROM t3;
SELECT * FROM t2;

DROP TABLE t1,t2,t3;

CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT)ENGINE=InnoDB
ROW_FORMAT=REDUNDANT;
SET @fill_amount = (@@innodb_page_size / 2 ) + 1 ;
INSERT INTO t1 VALUES(1, REPEAT(2, @fill_amount));
UPDATE t1 SET f1 = 2;
DROP TABLE t1;
6 changes: 6 additions & 0 deletions mysql-test/suite/innodb_fts/r/misc_debug2.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded");
CREATE TABLE mdev21563(f1 VARCHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
set debug_dbug="+d,fts_instrument_sync_request";
INSERT INTO mdev21563 VALUES('This is a test');
ALTER TABLE mdev21563 DISCARD TABLESPACE;
DROP TABLE mdev21563;
11 changes: 11 additions & 0 deletions mysql-test/suite/innodb_fts/t/misc_debug2.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded");

CREATE TABLE mdev21563(f1 VARCHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
set debug_dbug="+d,fts_instrument_sync_request";
INSERT INTO mdev21563 VALUES('This is a test');
ALTER TABLE mdev21563 DISCARD TABLESPACE;
--source include/restart_mysqld.inc
DROP TABLE mdev21563;
2 changes: 1 addition & 1 deletion mysql-test/suite/sys_vars/r/host_cache_size_auto.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
select @@global.host_cache_size;
@@global.host_cache_size
632
653
14 changes: 11 additions & 3 deletions sql/mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4495,7 +4495,7 @@ static int init_common_variables()
min_connections= 10;
/* MyISAM requires two file handles per table. */
wanted_files= (extra_files + max_connections + extra_max_connections +
tc_size * 2);
tc_size * 2 * tc_instances);
#if defined(HAVE_POOL_OF_THREADS) && !defined(__WIN__)
// add epoll or kevent fd for each threadpool group, in case pool of threads is used
wanted_files+= (thread_handling > SCHEDULER_NO_THREADS) ? 0 : threadpool_size;
Expand Down Expand Up @@ -4524,14 +4524,22 @@ static int init_common_variables()
if (files < wanted_files && global_system_variables.log_warnings)
sql_print_warning("Could not increase number of max_open_files to more than %u (request: %u)", files, wanted_files);

/* If we required too much tc_instances than we reduce */
SYSVAR_AUTOSIZE_IF_CHANGED(tc_instances,
(uint32) MY_MIN(MY_MAX((files - extra_files -
max_connections)/
2/tc_size,
1),
tc_instances),
uint32);
/*
If we have requested too much file handles than we bring
max_connections in supported bounds. Still leave at least
'min_connections' connections
*/
SYSVAR_AUTOSIZE_IF_CHANGED(max_connections,
(ulong) MY_MAX(MY_MIN(files- extra_files-
min_tc_size*2,
min_tc_size*2*tc_instances,
max_connections),
min_connections),
ulong);
Expand All @@ -4544,7 +4552,7 @@ static int init_common_variables()
*/
SYSVAR_AUTOSIZE_IF_CHANGED(tc_size,
(ulong) MY_MIN(MY_MAX((files - extra_files -
max_connections) / 2,
max_connections) / 2 / tc_instances,
min_tc_size),
tc_size), ulong);
DBUG_PRINT("warning",
Expand Down
1 change: 0 additions & 1 deletion sql/sql_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) &&
! thd->is_error())
{
thd->get_stmt_da()->set_skip_flush();
/*
Multiple queries exist, execute them individually
*/
Expand Down
1 change: 0 additions & 1 deletion sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4251,7 +4251,6 @@ bool check_column_name(const char *name)
been opened.

@param[in] table The table to check
@param[in] table_f_count Expected number of columns in the table
@param[in] table_def Expected structure of the table (column name
and type)

Expand Down
8 changes: 4 additions & 4 deletions storage/innobase/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2253,8 +2253,8 @@ buf_page_realloc(
ut_d(block->page.in_page_hash = FALSE);
ulint fold = block->page.id.fold();
ut_ad(fold == new_block->page.id.fold());
HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, (&block->page));
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, (&new_block->page));
HASH_REPLACE(buf_page_t, hash, buf_pool->page_hash, fold,
&block->page, &new_block->page);

ut_ad(new_block->page.in_page_hash);

Expand Down Expand Up @@ -3372,8 +3372,8 @@ buf_relocate(
/* relocate buf_pool->page_hash */
ulint fold = bpage->id.fold();
ut_ad(fold == dpage->id.fold());
HASH_DELETE(buf_page_t, hash, buf_pool->page_hash, fold, bpage);
HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, dpage);
HASH_REPLACE(buf_page_t, hash, buf_pool->page_hash, fold, bpage,
dpage);
}

/** Hazard Pointer implementation. */
Expand Down
8 changes: 6 additions & 2 deletions storage/innobase/buf/buf0lru.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************

Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
Copyright (c) 2017, 2020, 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
Expand Down Expand Up @@ -59,6 +59,7 @@ static const ulint BUF_LRU_OLD_TOLERANCE = 20;
@see buf_LRU_old_adjust_len */
#define BUF_LRU_NON_OLD_MIN_LEN 5

#ifdef BTR_CUR_HASH_ADAPT
/** When dropping the search hash index entries before deleting an ibd
file, we build a local array of pages belonging to that tablespace
in the buffer pool. Following is the size of that array.
Expand All @@ -67,6 +68,7 @@ flush_list when dropping a table. This is to ensure that other threads
are not blocked for extended period of time when using very large
buffer pools. */
static const ulint BUF_LRU_DROP_SEARCH_SIZE = 1024;
#endif /* BTR_CUR_HASH_ADAPT */

/** We scan these many blocks when looking for a clean page to evict
during LRU eviction. */
Expand Down Expand Up @@ -376,7 +378,6 @@ bool buf_LRU_drop_page_hash_for_tablespace(dict_table_t* table)

return true;
}
#endif /* BTR_CUR_HASH_ADAPT */

/******************************************************************//**
While flushing (or removing dirty) pages from a tablespace we don't
Expand Down Expand Up @@ -465,6 +466,7 @@ buf_flush_try_yield(

return(false);
}
#endif /* BTR_CUR_HASH_ADAPT */

/******************************************************************//**
Removes a single page from a given tablespace inside a specific
Expand Down Expand Up @@ -640,6 +642,7 @@ buf_flush_or_remove_pages(
goto rescan;
}

#ifdef BTR_CUR_HASH_ADAPT
++processed;

/* Yield if we have hogged the CPU and mutexes for too long. */
Expand All @@ -649,6 +652,7 @@ buf_flush_or_remove_pages(

processed = 0;
}
#endif /* BTR_CUR_HASH_ADAPT */

/* The check for trx is interrupted is expensive, we want
to check every N iterations. */
Expand Down
23 changes: 15 additions & 8 deletions storage/innobase/handler/i_s.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************

Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 2019, MariaDB Corporation.
Copyright (c) 2014, 2020, 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
Expand Down Expand Up @@ -9050,6 +9050,8 @@ i_s_innodb_mutexes_fill_table(
~Locking() { mutex_exit(&rw_lock_list_mutex); }
} locking;

char lock_name[sizeof "buf0dump.cc:12345"];

for (lock = UT_LIST_GET_FIRST(rw_lock_list); lock != NULL;
lock = UT_LIST_GET_NEXT(list, lock)) {
if (lock->count_os_wait == 0) {
Expand All @@ -9062,11 +9064,16 @@ i_s_innodb_mutexes_fill_table(
continue;
}

//OK(field_store_string(fields[MUTEXES_NAME],
// lock->lock_name));
OK(field_store_string(
fields[MUTEXES_CREATE_FILE],
innobase_basename(lock->cfile_name)));
const char* basename = innobase_basename(
lock->cfile_name);

snprintf(lock_name, sizeof lock_name, "%s:%u",
basename, lock->cline);

OK(field_store_string(fields[MUTEXES_NAME],
lock_name));
OK(field_store_string(fields[MUTEXES_CREATE_FILE],
basename));
OK(fields[MUTEXES_CREATE_LINE]->store(lock->cline,
true));
fields[MUTEXES_CREATE_LINE]->set_notnull();
Expand All @@ -9082,8 +9089,8 @@ i_s_innodb_mutexes_fill_table(
snprintf(buf1, sizeof buf1, "combined %s",
innobase_basename(block_lock->cfile_name));

//OK(field_store_string(fields[MUTEXES_NAME],
// block_lock->lock_name));
OK(field_store_string(fields[MUTEXES_NAME],
"buf_block_t::lock"));
OK(field_store_string(fields[MUTEXES_CREATE_FILE],
buf1));
OK(fields[MUTEXES_CREATE_LINE]->store(block_lock->cline,
Expand Down
Loading

0 comments on commit 58b70dc

Please sign in to comment.