Merge branch '10.1' into 10.2

This commit is contained in:
Vicențiu Ciorbaru 2018-04-10 17:43:18 +03:00
commit 45e6d0aebf
134 changed files with 1474 additions and 391 deletions

View file

@ -5,15 +5,14 @@ The current main sponsors of the MariaDB Foundation are:
Alibaba Cloud https://www.alibabacloud.com/ (2017)
Booking.com https://www.booking.com (2013)
MariaDB Corporation https://www.mariadb.com (2013)
Microsoft https://microsoft.com/ (2017)
Tencent Cloud https://cloud.tencent.com (2017)
Development Bank of Singapore https://dbs.com (2016)
IBM https://www.ibm.com (2017)
MariaDB Corporation https://www.mariadb.com (2013)
Visma https://visma.com (2015)
Acronis http://acronis.com (2016)
Nexedi https://www.nexedi.com (2016)
Automattic https://automattic.com (2014)
Tencent Game DBA http://tencentdba.com/about (2016)
Tencent TDSQL http://tdsql.org (2016)
Verkkokauppa.com https://www.verkkokauppa.com (2015)

View file

@ -522,7 +522,7 @@ struct st_match_err
struct st_expected_errors
{
struct st_match_err err[10];
struct st_match_err err[12];
uint count;
};
static struct st_expected_errors saved_expected_errors;

View file

@ -241,7 +241,7 @@ static struct my_option ibx_long_options[] =
{"galera-info", OPT_GALERA_INFO, "This options creates the "
"xtrabackup_galera_info file which contains the local node state at "
"the time of the backup. Option should be used when performing the "
"backup of Percona-XtraDB-Cluster. Has no effect when backup locks "
"backup of MariaDB Galera Cluster. Has no effect when backup locks "
"are used to create the backup.",
(uchar *) &opt_ibx_galera_info, (uchar *) &opt_ibx_galera_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},

View file

@ -813,7 +813,7 @@ struct my_option xb_client_options[] =
{"galera-info", OPT_GALERA_INFO, "This options creates the "
"xtrabackup_galera_info file which contains the local node state at "
"the time of the backup. Option should be used when performing the "
"backup of Percona-XtraDB-Cluster. Has no effect when backup locks "
"backup of MariaDB Galera Cluster. Has no effect when backup locks "
"are used to create the backup.",
(uchar *) &opt_galera_info, (uchar *) &opt_galera_info, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -5705,6 +5705,10 @@ static int main_low(char** argv)
xtrabackup_incremental = NULL;
}
if (xtrabackup_stream && !xtrabackup_backup) {
msg("Warning: --stream parameter is ignored, it only works together with --backup.\n");
}
if (!xb_init()) {
return(EXIT_FAILURE);
}

View file

@ -16,8 +16,8 @@
*/
#ifndef MY_SYSTEMD_INCLUDED
#define MY_SYSTEMD_INCLUDED
#ifndef MY_SERVICE_MANAGER_INCLUDED
#define MY_SERVICE_MANAGER_INCLUDED
#if defined(HAVE_SYSTEMD) && !defined(EMBEDDED_LIBRARY)
/*
@ -26,9 +26,14 @@
*/
#define __STDC_FORMAT_MACROS
#include <systemd/sd-daemon.h>
/** INTERVAL in seconds followed by printf style status */
#define service_manager_extend_timeout(INTERVAL, FMTSTR, ...) \
sd_notifyf(0, "STATUS=" FMTSTR "\nEXTEND_TIMEOUT_USEC=%u\n", ##__VA_ARGS__, INTERVAL * 1000000)
#else
#define sd_notify(X, Y)
#define sd_notifyf(E, F, ...)
#define service_manager_extend_timeout(I, FMTSTR, ...)
#endif
#endif /* MY_SYSTEMD_INCLUDED */
#endif /* MY_SERVICE_MANAGER_INCLUDED */

View file

@ -16,9 +16,6 @@ if (!$restart_parameters)
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
# Wait for wsrep
--source include/wait_wsrep_ready.inc
# Turn off reconnect again
--disable_reconnect

View file

@ -23,3 +23,9 @@ while ($mysql_errno)
}
--enable_query_log
--enable_result_log
# WSREP: SHOW STATUS queries are allowed even if wsrep
# is not ready. Make sure wsrep is ready before
# returning from this script
--source include/wait_wsrep_ready.inc

View file

@ -4446,6 +4446,7 @@ sub extract_warning_lines ($$) {
qr|SSL error: Failed to set ciphers to use|,
qr/Plugin 'InnoDB' will be forced to shutdown/,
qr|Could not increase number of max_open_files to more than|,
qr|Changed limits: max_open_files|,
qr/InnoDB: Error table encrypted but encryption service not available.*/,
qr/InnoDB: Could not find a valid tablespace file for*/,
qr/InnoDB: Tablespace open failed for*/,

View file

@ -179,8 +179,16 @@ drop table t1;
CREATE USER mysqltest_u1@localhost;
GRANT USAGE ON *.* TO mysqltest_u1@localhost;
SET GLOBAL max_connections = 3;
SET GLOBAL max_connections = 10;
SET GLOBAL event_scheduler = ON;
connect tmp_con1,localhost,mysqltest_u1,,;
connect tmp_con2,localhost,mysqltest_u1,,;
connect tmp_con3,localhost,mysqltest_u1,,;
connect tmp_con4,localhost,mysqltest_u1,,;
connect tmp_con5,localhost,mysqltest_u1,,;
connect tmp_con6,localhost,mysqltest_u1,,;
connect tmp_con7,localhost,mysqltest_u1,,;
connection default;
# -- Waiting for Event Scheduler to start...
@ -224,6 +232,13 @@ event_scheduler
mysqltest_u1
mysqltest_u1
mysqltest_u1
mysqltest_u1
mysqltest_u1
mysqltest_u1
mysqltest_u1
mysqltest_u1
mysqltest_u1
mysqltest_u1
root
# -- Resetting variables...
@ -239,6 +254,13 @@ disconnect con_1;
disconnect con_2;
disconnect con_3;
disconnect con_super_1;
disconnect tmp_con1;
disconnect tmp_con2;
disconnect tmp_con3;
disconnect tmp_con4;
disconnect tmp_con5;
disconnect tmp_con6;
disconnect tmp_con7;
# -- Restoring default connection...
connect default,localhost,root,,test;

View file

@ -4,13 +4,12 @@ Booking.com https://www.booking.com Founding member, Platinum Sponsor of the Mar
Alibaba Cloud https://www.alibabacloud.com/ Platinum Sponsor of the MariaDB Foundation
Tencent Cloud https://cloud.tencent.com Platinum Sponsor of the MariaDB Foundation
Microsoft https://microsoft.com/ Platinum Sponsor of the MariaDB Foundation
MariaDB Corporation https://mariadb.com Founding member, Gold Sponsor of the MariaDB Foundation
MariaDB Corporation https://mariadb.com Founding member, Platinum Sponsor of the MariaDB Foundation
Visma https://visma.com Gold Sponsor of the MariaDB Foundation
DBS https://dbs.com Gold Sponsor of the MariaDB Foundation
IBM https://www.ibm.com Gold Sponsor of the MariaDB Foundation
Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation
Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation
Auttomattic https://automattic.com Bronze Sponsor of the MariaDB Foundation
Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation
Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation
Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation

View file

@ -585,6 +585,17 @@ SELECT NAME_CONST('a', -(1)) OR 1;
NAME_CONST('a', -(1)) OR 1
1
#
# MDEV-15630 uuid() function evaluates at wrong time in query
#
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
COUNT(1) uid
1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
DROP TABLE t1;
#
# End of 5.5 tests
#
#

View file

@ -4577,6 +4577,43 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF)`
#
# MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data
#
CREATE TABLE t1 (
id int(11) NOT NULL,
session_id varchar(255) DEFAULT NULL,
directory mediumtext,
checksum int(10) DEFAULT NULL,
last_update datetime DEFAULT NULL,
PRIMARY KEY (id),
KEY lastupdate (last_update)
) DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28');
UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW();
SELECT directory IS NULL FROM t1;
directory IS NULL
0
DROP TABLE t1;
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
directory mediumtext
) DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554'));
SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1;
AES_DECRYPT(directory,'95F5A1F52A554')
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554');
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
directory mediumtext
) DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554'));
SELECT * FROM t1;
id directory
1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
#
# Start of 10.1 tests
#
#

View file

@ -1,5 +1,13 @@
SET GLOBAL log_warnings=4;
SET GLOBAL max_connections=2;
SET GLOBAL max_connections=10;
connect tmp_con1,localhost,root,,;
connect tmp_con2,localhost,root,,;
connect tmp_con3,localhost,root,,;
connect tmp_con4,localhost,root,,;
connect tmp_con5,localhost,root,,;
connect tmp_con6,localhost,root,,;
connect tmp_con7,localhost,root,,;
connect tmp_con8,localhost,root,,;
connect con1,localhost,root,,;
SELECT 1;
1
@ -15,6 +23,6 @@ SELECT 0;
0
show status like "Threads_connected";
Variable_name Value
Threads_connected 3
Threads_connected 11
SET GLOBAL log_warnings=default;
SET GLOBAL max_connections=default;

View file

@ -1938,16 +1938,17 @@ DROP TABLE t1;
#
# BUG#48438 - crash with error in unioned query against merge table and view...
#
SET GLOBAL table_open_cache=3;
SET @save_table_open_cache=@@table_open_cache;
SET GLOBAL table_open_cache=10;
CREATE TABLE t1(a INT);
SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE;
1
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
TABLE_ROWS DATA_LENGTH
0 0
DROP TABLE t1;
SET GLOBAL table_open_cache=DEFAULT;
SET GLOBAL table_open_cache=@save_table_open_cache;
End of 5.0 tests
create table t1 (a int not null, key `a` (a) key_block_size=1024);
show create table t1;

View file

@ -18,6 +18,7 @@ connection con1;
call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
call mtr.add_suppression(" '\..test.t1'");
set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=256;
set global table_definition_cache=400;
drop procedure if exists p_create;
@ -98,7 +99,7 @@ prepare stmt from @drop_table_stmt;
execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
set @@global.table_open_cache=default;
set @@global.table_open_cache=@save_table_open_cache;
disconnect con1;
connection default;
#

View file

@ -105,10 +105,10 @@
sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
-table-cache 431
-table-cache 421
+table-cache 2000
table-definition-cache 400
-table-open-cache 431
-table-open-cache 421
+table-open-cache 2000
table-open-cache-instances 8
tc-heuristic-recover OFF

View file

@ -1508,9 +1508,9 @@ sync-master-info 10000
sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
table-cache 431
table-cache 421
table-definition-cache 400
table-open-cache 431
table-open-cache 421
table-open-cache-instances 8
tc-heuristic-recover OFF
thread-cache-size 151

View file

@ -673,6 +673,13 @@ PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\' at line 1
DROP TABLE t1;
#
# MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
#
CREATE TABLE t1 (a INT);
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
ERROR HY000: Unknown system variable 'NEW'
DROP TABLE t1;
#
# MDEV-7792 - SQL Parsing Error - UNION AND ORDER BY WITH JOIN
#
CREATE TABLE t1(a INT);

View file

@ -3,4 +3,4 @@ MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MySQL error code 1408 (ER_STARTUP): %s: ready for connections.
Version: '%s' socket: '%s' port: %d %s
MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!
MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu)
MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %u)

View file

@ -821,7 +821,7 @@ Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '10000000000000000'
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
1048576
4294967295
set global max_prepared_stmt_count=default;
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count

View file

@ -7954,7 +7954,7 @@ CLOSE cur1;
end|
set @tmp_toc= @@table_open_cache;
set @tmp_tdc= @@table_definition_cache;
set global table_open_cache=1;
set global table_open_cache=10;
set global table_definition_cache=1;
Warnings:
Warning 1292 Truncated incorrect table_definition_cache value: '1'

View file

@ -1664,6 +1664,24 @@ db_name table_name column_name HEX(min_value) HEX(max_value) nulls_ratio avg_fre
test t1 a D879626AF872675F73E662F8 D879626AF872675F73E662F8 0.0000 1.0000 0 NULL NULL
drop table t1;
#
# MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918):
# Encountered illegal value '' when converting to DECIMAL
#
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
set optimizer_use_condition_selectivity=3, use_stat_tables=preferably;
create table t1 (id int(10),cost decimal(9,2)) engine=innodb;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
create temporary table t2 (id int);
insert into t2 (id) select id from t1 where cost > 0;
select * from t2;
id
set use_stat_tables=@save_use_stat_tables;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1,t2;
#
# MDEV-9590: Always print "Engine-independent statistic" warnings and
# might be filtering columns unintentionally from engines
#

View file

@ -568,6 +568,7 @@ set sql_safe_updates=1;
set sql_select_limit=1;
set sql_select_limit=default;
set sql_warnings=1;
set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
@ -748,11 +749,11 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SHOW VARIABLES LIKE 'table_open_cache';
Variable_name Value
table_open_cache 1
table_open_cache 10
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
VARIABLE_NAME VARIABLE_VALUE
TABLE_OPEN_CACHE 1
SET GLOBAL table_open_cache=DEFAULT;
TABLE_OPEN_CACHE 10
SET GLOBAL table_open_cache=@save_table_open_cache;
set character_set_results=NULL;
select ifnull(@@character_set_results,"really null");
ifnull(@@character_set_results,"really null")

View file

@ -5583,6 +5583,203 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
CREATE TABLE IF NOT EXISTS t0 (f0 INT);
CREATE TABLE IF NOT EXISTS t1 (f1 INT);
CREATE TABLE IF NOT EXISTS t2 (f2 INT);
CREATE TABLE IF NOT EXISTS t3 (f3 INT);
CREATE TABLE IF NOT EXISTS t4 (f4 INT);
CREATE TABLE IF NOT EXISTS t5 (f5 INT);
CREATE TABLE IF NOT EXISTS t6 (f6 INT);
CREATE TABLE IF NOT EXISTS t7 (f7 INT);
CREATE TABLE IF NOT EXISTS t8 (f8 INT);
CREATE TABLE IF NOT EXISTS t9 (f9 INT);
CREATE TABLE IF NOT EXISTS t10 (f10 INT);
CREATE TABLE IF NOT EXISTS t11 (f11 INT);
CREATE TABLE IF NOT EXISTS t12 (f12 INT);
CREATE TABLE IF NOT EXISTS t13 (f13 INT);
CREATE TABLE IF NOT EXISTS t14 (f14 INT);
CREATE TABLE IF NOT EXISTS t15 (f15 INT);
CREATE TABLE IF NOT EXISTS t16 (f16 INT);
CREATE TABLE IF NOT EXISTS t17 (f17 INT);
CREATE TABLE IF NOT EXISTS t18 (f18 INT);
CREATE TABLE IF NOT EXISTS t19 (f19 INT);
CREATE TABLE IF NOT EXISTS t20 (f20 INT);
CREATE TABLE IF NOT EXISTS t21 (f21 INT);
CREATE TABLE IF NOT EXISTS t22 (f22 INT);
CREATE TABLE IF NOT EXISTS t23 (f23 INT);
CREATE TABLE IF NOT EXISTS t24 (f24 INT);
CREATE TABLE IF NOT EXISTS t25 (f25 INT);
CREATE TABLE IF NOT EXISTS t26 (f26 INT);
CREATE TABLE IF NOT EXISTS t27 (f27 INT);
CREATE TABLE IF NOT EXISTS t28 (f28 INT);
CREATE TABLE IF NOT EXISTS t29 (f29 INT);
CREATE TABLE IF NOT EXISTS t30 (f30 INT);
CREATE TABLE IF NOT EXISTS t31 (f31 INT);
CREATE TABLE IF NOT EXISTS t32 (f32 INT);
CREATE TABLE IF NOT EXISTS t33 (f33 INT);
CREATE TABLE IF NOT EXISTS t34 (f34 INT);
CREATE TABLE IF NOT EXISTS t35 (f35 INT);
CREATE TABLE IF NOT EXISTS t36 (f36 INT);
CREATE TABLE IF NOT EXISTS t37 (f37 INT);
CREATE TABLE IF NOT EXISTS t38 (f38 INT);
CREATE TABLE IF NOT EXISTS t39 (f39 INT);
CREATE TABLE IF NOT EXISTS t40 (f40 INT);
CREATE TABLE IF NOT EXISTS t41 (f41 INT);
CREATE TABLE IF NOT EXISTS t42 (f42 INT);
CREATE TABLE IF NOT EXISTS t43 (f43 INT);
CREATE TABLE IF NOT EXISTS t44 (f44 INT);
CREATE TABLE IF NOT EXISTS t45 (f45 INT);
CREATE TABLE IF NOT EXISTS t46 (f46 INT);
CREATE TABLE IF NOT EXISTS t47 (f47 INT);
CREATE TABLE IF NOT EXISTS t48 (f48 INT);
CREATE TABLE IF NOT EXISTS t49 (f49 INT);
CREATE TABLE IF NOT EXISTS t50 (f50 INT);
CREATE TABLE IF NOT EXISTS t51 (f51 INT);
CREATE TABLE IF NOT EXISTS t52 (f52 INT);
CREATE TABLE IF NOT EXISTS t53 (f53 INT);
CREATE TABLE IF NOT EXISTS t54 (f54 INT);
CREATE TABLE IF NOT EXISTS t55 (f55 INT);
CREATE TABLE IF NOT EXISTS t56 (f56 INT);
CREATE TABLE IF NOT EXISTS t57 (f57 INT);
CREATE TABLE IF NOT EXISTS t58 (f58 INT);
CREATE TABLE IF NOT EXISTS t59 (f59 INT);
CREATE TABLE IF NOT EXISTS t60 (f60 INT);
CREATE OR REPLACE VIEW v60 AS SELECT * FROM t60;
EXPLAIN
SELECT t0.*
FROM t0
JOIN t1
ON t1.f1 = t0.f0
LEFT JOIN t2
ON t0.f0 = t2.f2
LEFT JOIN t3
ON t0.f0 = t3.f3
LEFT JOIN t4
ON t0.f0 = t4.f4
LEFT JOIN t5
ON t4.f4 = t5.f5
LEFT JOIN t6
ON t0.f0 = t6.f6
LEFT JOIN t7
ON t0.f0 = t7.f7
LEFT JOIN t8
ON t0.f0 = t8.f8
LEFT JOIN t9
ON t0.f0 = t9.f9
LEFT JOIN t10
ON t0.f0 = t10.f10
LEFT JOIN t11
ON t0.f0 = t11.f11
LEFT JOIN t12
ON t0.f0 = t12.f12
LEFT JOIN t13
ON t0.f0 = t13.f13
LEFT JOIN t14
ON t0.f0 = t14.f14
LEFT JOIN t15
ON t0.f0 = t15.f15
LEFT JOIN t16
ON t0.f0 = t16.f16
LEFT JOIN t17
ON t0.f0 = t17.f17
LEFT JOIN t18
ON t0.f0 = t18.f18
LEFT JOIN t19
ON t18.f18 = t19.f19
LEFT JOIN t20
ON t20.f20 = t19.f19
LEFT JOIN t21
ON t20.f20 = t21.f21
LEFT JOIN t22
ON t19.f19 = t22.f22
LEFT JOIN t23
ON t23.f23 = t0.f0
LEFT JOIN t24
ON t24.f24 = t23.f23
LEFT JOIN t25
ON t0.f0 = t25.f25
LEFT JOIN t26
ON t26.f26 = t0.f0
LEFT JOIN t27
ON t27.f27 = t0.f0
LEFT JOIN t28
ON t0.f0 = t28.f28
LEFT JOIN t29
ON t0.f0 = t29.f29
LEFT JOIN t30
ON t30.f30 = t0.f0
LEFT JOIN t31
ON t0.f0 = t31.f31
LEFT JOIN t32
ON t32.f32 = t31.f31
LEFT JOIN t33
ON t33.f33 = t0.f0
LEFT JOIN t34
ON t33.f33 = t34.f34
LEFT JOIN t35
ON t33.f33 = t35.f35
LEFT JOIN t36
ON t36.f36 = t0.f0
LEFT JOIN t37
ON t32.f32 = t37.f37
LEFT JOIN t38
ON t31.f31 = t38.f38
LEFT JOIN t39
ON t39.f39 = t0.f0
LEFT JOIN t40
ON t40.f40 = t39.f39
LEFT JOIN t41
ON t41.f41 = t0.f0
LEFT JOIN t42
ON t42.f42 = t41.f41
LEFT JOIN t43
ON t43.f43 = t41.f41
LEFT JOIN t44
ON t44.f44 = t0.f0
LEFT JOIN t45
ON t45.f45 = t0.f0
LEFT JOIN t46
ON t46.f46 = t0.f0
LEFT JOIN t47
ON t47.f47 = t0.f0
LEFT JOIN t48
ON t48.f48 = t0.f0
LEFT JOIN t49
ON t0.f0 = t49.f49
LEFT JOIN t50
ON t0.f0 = t50.f50
LEFT JOIN t51
ON t0.f0 = t51.f51
LEFT JOIN t52
ON t52.f52 = t0.f0
LEFT JOIN t53
ON t53.f53 = t0.f0
LEFT JOIN t54
ON t54.f54 = t0.f0
LEFT JOIN t55
ON t55.f55 = t0.f0
LEFT JOIN t56
ON t56.f56 = t0.f0
LEFT JOIN t57
ON t57.f57 = t0.f0
LEFT JOIN t58
ON t58.f58 = t57.f57
LEFT JOIN t59
ON t36.f36 = t59.f59
LEFT JOIN v60
ON t36.f36 = v60.f60
;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
t10, t11, t12, t13, t14, t15, t16, t17, t18,
t19, t20, t21, t22, t23, t24, t25, t26, t27,
t28, t29, t30, t31, t32, t33, t34, t35, t36,
t37, t38, t39, t40, t41, t42, t43, t44, t45,
t46, t47, t48, t49, t50, t51, t52, t53, t54,
t55, t56, t57, t58, t59,t60;
drop view v60;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------

View file

@ -0,0 +1,41 @@
set global innodb_file_per_table=OFF;
call mtr.add_suppression("mysqld: file-key-management-filename is not set");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error.");
call mtr.add_suppression("Plugin 'file_key_management' registration as a ENCRYPTION failed.");
flush tables;
create table t1(a int not null primary key, b char(200)) engine=innodb;
# Restart server with encryption
# Wait until encryption threads have encrypted all tablespaces
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
NAME
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
# Success!
SELECT * from t1;
a b
# Now turn off encryption and wait for threads to decrypt all tablespaces
SET GLOBAL innodb_encrypt_tables = off;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
NAME
# Success!
# Restart server with no encryption setup, there should be no crashes
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
NAME
innodb_system
mysql/innodb_index_stats
mysql/innodb_table_stats
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
NAME
SELECT * from t1;
a b
DROP TABLE t1;

View file

@ -0,0 +1,59 @@
--source include/have_innodb.inc
# Test uses restart
--source include/not_embedded.inc
--source filekeys_plugin.inc
#
# MDEV-15566: System tablespace does not easily key rotate to unencrypted
#
set global innodb_file_per_table=OFF;
call mtr.add_suppression("mysqld: file-key-management-filename is not set");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error.");
call mtr.add_suppression("Plugin 'file_key_management' registration as a ENCRYPTION failed.");
flush tables;
create table t1(a int not null primary key, b char(200)) engine=innodb;
--echo
--echo # Restart server with encryption
-- let $restart_parameters=--plugin-load-add=$FILE_KEY_MANAGEMENT_SO --loose-file-key-management --loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt --file-key-management-encryption-algorithm=aes_cbc --innodb-encrypt-tables=ON --innodb-encryption-threads=4 --innodb-tablespaces-encryption --innodb-encryption-rotate-key-age=15
-- source include/restart_mysqld.inc
--echo # Wait until encryption threads have encrypted all tablespaces
--let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'`
--let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND ROTATING_OR_FLUSHING = 0;
--source include/wait_condition.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--echo # Success!
SELECT * from t1;
--echo # Now turn off encryption and wait for threads to decrypt all tablespaces
SET GLOBAL innodb_encrypt_tables = off;
--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING = 0;
--source include/wait_condition.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--echo # Success!
--echo
--echo # Restart server with no encryption setup, there should be no crashes
--let $restart_parameters=--skip-file-key-management --innodb-encrypt-tables=OFF --innodb-encryption-threads=0 --innodb-tablespaces-encryption
-- source include/restart_mysqld.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
SELECT * from t1;
DROP TABLE t1;

View file

@ -9,51 +9,30 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
galera_gra_log : MDEV-13549 Galera test failures
galera_flush : MDEV-13549 Galera test failures
galera_flush : MariaDB does not have global.thread_statistics
galera_account_management : MariaDB 10.0 does not support ALTER USER
galera_binlog_row_image : MariaDB 10.0 does not support binlog_row_image
galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
GAL-419 : MDEV-13549 Galera test failures
galera_toi_ddl_fk_insert : MDEV-13549 Galera test failures
galera_var_notify_cmd : MDEV-13549 Galera test failures
mysql-wsrep#90 : MDEV-13549 Galera test failures
galera_migrate : MariaDB does not support START SLAVE USER
galera_as_master_gtid : Requires MySQL GTID
galera_as_master_gtid_change_master : Requires MySQL GTID
galera_as_slave_replication_bundle : MDEV-13549 Galera test failures
galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
galera_gcs_fragment : MDEV-13549 Galera test failures
GAL-419 : MDEV-13549 Galera test failures
galera_var_notify_cmd : MDEV-13549 Galera test failures
galera_as_slave_replication_bundle : MDEV-13549 Galera test failures
galera_gcache_recover : MDEV-13549 Galera test failures
galera_gcache_recover_full_gcache : MDEV-13549 Galera test failures
galera_gcache_recover_manytrx : MDEV-13549 Galera test failures
galera_ist_mysqldump : MDEV-13549 Galera test failures
mysql-wsrep#31 : MDEV-13549 Galera test failures
galera_migrate : MariaDB 10.0 does not support START SLAVE USER
galera_wsrep_desync_wsrep_on : MDEV-13549 Galera test failures
galera_ssl_upgrade : MDEV-13549 Galera test failures
mysql-wsrep#33 : MDEV-13549 Galera test failures
galera_var_auto_inc_control_on : MDEV-13549 Galera test failures
MW-44 : MDEV-13549 Galera test failures
galera_var_retry_autocommit : MDEV-13549 Galera test failures
pxc-421 : MDEV-13549 Galera test failures
lp1376747-2 : MDEV-13549 Galera test failures
lp1376747 : MDEV-13549 Galera test failures
galera_toi_ddl_nonconflicting : MDEV-13549 Galera test failures
galera_parallel_simple : MDEV-13549 Galera test failures
galera_admin : MDEV-13549 Galera test failures
galera_as_master: MDEV-13549 Galera test failures 10.1
galera_pc_ignore_sb : MDEV-13549 Galera test failures 10.1
galera_lock_table : MDEV-13549 Galera test failures 10.1
MW-284 : MDEV-13549 Galera test failures 10.1
galera_as_slave : MDEV-13549 Galera test failures 10.1
galera.MW-329 : wsrep_local_replays not stable
galera.MW-328A : have_deadlocks test not stable
galera_var_retry_autocommit: MDEV-15794 Test failure on galera.galera_var_retry_autocommit
galera_var_auto_inc_control_on: MDEV-15803 Test failure on galera.galera_var_auto_inc_control_on
pxc-421 : MDEV-15804 Test failure on galera.pxc-421
query_cache : MDEV-15805 Test failure on galera.query_cache
galera.galera_gra_log : MDEV-15808 Test failure on galera.galera_gra_log
galera.MW-44 : MDEV-15809 Test failure on galera.MW-44
galera.galera_pc_ignore_sb : MDEV-15811 Test failure on galera_pc_ignore_sb
galera_kill_applier : race condition at the start of the test
MW-328C: MDEV-13549 Galera test failures 10.1
MW-328A: MDEV-13549 Galera test failures 10.1
MW-328B: MDEV-13549 Galera test failures 10.1
MW-328: MDEV-13549 Galera test failures 10.1
galera_suspend_slave: MDEV-13549 Galera test failures 10.1
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
galera_gtid : MDEV-13549 Galera test failures 10.1
galera_gtid_slave : MDEV-13549 Galera test failures 10.1
galera_unicode_identifiers : MDEV-13549 Galera test failures 10.1
galera.galera_gcs_fc_limit : MDEV-13549 Galera test failures 10.1

View file

@ -1,7 +1,6 @@
--echo Killing server ...
# Write file to make mysql-test-run.pl expect the crash, but don't start it
--source include/wait_until_connected_again.inc
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name

View file

@ -23,3 +23,8 @@ STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
connection node_1;
RESET MASTER;
CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
connection node_2;
CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');

View file

@ -1,8 +1,18 @@
SET @@global.wsrep_replicate_myisam=OFF;
connection node_1;
TRUNCATE TABLE mysql.general_log;
SELECT COUNT(*) from mysql.general_log;
COUNT(*)
1
connection node_2;
TRUNCATE TABLE mysql.general_log;
SELECT COUNT(*) from mysql.general_log;
COUNT(*)
1
connection node_1;
SELECT COUNT(*) from mysql.general_log;
COUNT(*)
1
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
@ -16,3 +26,4 @@ SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
COUNT(*) = 0
1
DROP TABLE t1;
SET @@global.wsrep_replicate_myisam=Default;

View file

@ -53,3 +53,5 @@ connection node_3;
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
connection node_1;
RESET MASTER;

View file

@ -1,3 +1,4 @@
connection node_1;
SET SESSION binlog_row_image=minimal;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER NOT NULL UNIQUE) ENGINE=InnoDB;
@ -5,6 +6,7 @@ CREATE TABLE t3 (f1 VARCHAR(1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t3 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
COUNT(*) = 1
1
@ -14,9 +16,11 @@ COUNT(*) = 1
SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 1;
COUNT(*) = 1
1
connection node_1;
UPDATE t1 SET f1 = 2 WHERE f1 = 1;
UPDATE t2 SET f1 = 2 WHERE f1 = 1;
UPDATE t3 SET f1 = 2 WHERE f1 = 1;
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
COUNT(*) = 1
1
@ -26,9 +30,11 @@ COUNT(*) = 1
SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 2;
COUNT(*) = 1
1
connection node_1;
DELETE FROM t1;
DELETE FROM t2;
DELETE FROM t3;
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
@ -41,34 +47,42 @@ COUNT(*) = 0
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
connection node_1;
SET SESSION binlog_row_image=noblob;
CREATE TABLE t1 (f1 BLOB, f2 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('abc', 1);
INSERT INTO t2 VALUES ('abc');
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'abc';
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'abc';
COUNT(*) = 1
1
connection node_1;
UPDATE t1 SET f1 = 'xyz';
UPDATE t2 SET f1 = 'xyz';
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'xyz';
COUNT(*) = 1
1
connection node_1;
UPDATE t1 SET f2 = 2 WHERE f2 = 1;
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 2;
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz';
COUNT(*) = 1
1
connection node_1;
DELETE FROM t1;
DELETE FROM t2;
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1

View file

@ -1,6 +1,9 @@
connection node_2;
SET SESSION wsrep_on=OFF;
CREATE TABLE t1 (f1 INTEGER);
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
@ -8,22 +11,13 @@ COUNT(*) = 0
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
<ISO TIMESTAMP> server id 2 end_log_pos 120 Start: binlog v 4, server v 5.6.24-debug-log created 150804 11:37:14 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
unnAVQ8CAAAAdAAAAHgAAAABAAQANS42LjI0LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAC6ecBVEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAKNu
Jfk=
'/*!*/;
# at 120
<ISO TIMESTAMP> server id 1 end_log_pos 91 Query thread_id=<QUERY_THREAD_ID> exec_time=0 error_code=0
ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=<TIMESTAMP>/*!*/;
SET @@session.pseudo_thread_id=<PSEUDO_THREAD_ID>/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=1073741824/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;

View file

@ -25,7 +25,6 @@ SELECT @@global.gtid_binlog_state;
1-1-4,2-2-2,2-3-3
connection node_1;
DROP TABLE t1,t2;
reset master;
connection node_2;
connection node_3;
connection node_2;
@ -34,3 +33,5 @@ RESET SLAVE ALL;
reset master;
connection node_3;
reset master;
connection node_1;
reset master;

View file

@ -1,6 +1,10 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
NAME
test/t1
test/t2
LOCK TABLE t1 READ;
connection node_1;
INSERT INTO t1 VALUES (1);

View file

@ -1,7 +1,13 @@
CREATE TABLE t1 (id INT) ENGINE=InnoDB;
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
connection node_2;
SET GLOBAL wsrep_slave_threads = 2;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
NAME
test/t1
test/t2
LOCK TABLE t1 WRITE;
connection node_1;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
@ -14,6 +20,7 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2;
SET SESSION wsrep_sync_wait = 0;
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 15;

View file

@ -6,13 +6,13 @@ connection node_2;
disconnect node_2;
connection node_1;
Suspending node_2 ...
SET SESSION wsrep_sync_wait = 0;
INSERT INTO t1 VALUES (1);
Got one of the listed errors
Resuming node_2 ...
SET SESSION wsrep_sync_wait = 1;
INSERT INTO t1 VALUES (1);
connection node_2a;
SET SESSION wsrep_sync_wait = 1;
SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1

View file

@ -9,7 +9,7 @@ CREATE TABLE child (
id INT PRIMARY KEY AUTO_INCREMENT,
parent_id INT
) ENGINE=InnoDB;
INSERT INTO parent VALUES (DEFAULT, 0);
INSERT INTO parent VALUES (1, 0);
INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
INSERT INTO parent (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;
INSERT INTO parent (f2) SELECT 2 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;;

View file

@ -1,4 +1,10 @@
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE
2
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
VARIABLE_VALUE
0
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
1
@ -7,6 +13,12 @@ SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_
1
INSERT INTO t1 VALUES (DEFAULT, 'node1');;
INSERT INTO t1 VALUES (DEFAULT, 'node2');;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE
2
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
VARIABLE_VALUE
1
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size')
1

View file

@ -110,6 +110,8 @@ INSERT INTO t1 VALUES (DEFAULT);
INSERT INTO t1 VALUES (DEFAULT);
DROP TABLE t1;
connection node_2;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
NAME
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
COUNT(*) = 1
1

View file

@ -4,6 +4,9 @@ INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
connection node_2;
SELECT COUNT(*) = 100000 FROM t1;
COUNT(*) = 100000
1
SET GLOBAL wsrep_desync = TRUE;
SET SESSION wsrep_on = FALSE;
ALTER TABLE t1 ADD PRIMARY KEY (f1);

View file

@ -1,6 +1,9 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
NAME
test/t1
FLUSH TABLES t1 FOR EXPORT;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;

View file

@ -1,6 +1,9 @@
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
NAME
test/t1
FLUSH TABLES t1 WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;

View file

@ -1,4 +1,6 @@
Setting SST method to mysqldump ...
call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'");
call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
CREATE USER 'sst';
GRANT ALL PRIVILEGES ON *.* TO 'sst';
SET GLOBAL wsrep_sst_auth = 'sst:';
@ -98,5 +100,4 @@ CALL mtr.add_suppression("Can't open and lock time zone table");
CALL mtr.add_suppression("Can't open and lock privilege tables");
CALL mtr.add_suppression("Info table is not ready to be used");
CALL mtr.add_suppression("Native table .* has the wrong structure");
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
Restarting server ...

View file

@ -1,31 +1,44 @@
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
connection node_1;
SET GLOBAL wsrep_OSU_method = "RSU";
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_OSU_method = "TOI";
SET DEBUG_SYNC= 'now SIGNAL continue';
connection node_1;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
connection node_1;
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
connection node_1;
SET GLOBAL wsrep_OSU_method = "TOI";
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_OSU_method = "RSU";
SET DEBUG_SYNC= 'now SIGNAL continue';
connection node_1;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
INSERT INTO t1 VALUES (1,2);
connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
INSERT INTO t1 VALUES (3,4);
connection node_1;
DROP TABLE t1;
SET GLOBAL WSREP_OSU_METHOD = TOI;
SET DEBUG_SYNC = 'RESET';

View file

@ -1,4 +1,6 @@
connection node_1;
connection node_2;
connection node_1;
set GLOBAL wsrep_slave_threads=26;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
@ -32,7 +34,6 @@ SET GLOBAL wsrep_slave_threads = 1;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
SET GLOBAL auto_increment_offset = 2;
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
@ -42,4 +43,3 @@ Variable_name Value
wsrep_slave_threads 12
SET GLOBAL wsrep_slave_threads = 1;
DROP TABLE t1;
SET GLOBAL auto_increment_offset = 1;

View file

@ -24,7 +24,6 @@ SET global wsrep_sync_wait=0;
--connection node_3
START SLAVE;
--sleep 1
--let $slave_param= Slave_IO_Running
--let $slave_param_value= Connecting
--source include/wait_for_slave_param.inc
@ -38,6 +37,7 @@ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
--source include/wait_for_slave_to_start.inc
--connection node_1
--source include/galera_wait_ready.inc
INSERT INTO t1 VALUES (1);
--connection node_3
@ -61,3 +61,10 @@ RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
--connection node_1
RESET MASTER;
CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
--connection node_2
CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');

View file

@ -5,15 +5,19 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
SET @@global.wsrep_replicate_myisam=OFF;
--connection node_1
TRUNCATE TABLE mysql.general_log;
SELECT COUNT(*) from mysql.general_log;
--sleep 1
--connection node_2
TRUNCATE TABLE mysql.general_log;
SELECT COUNT(*) from mysql.general_log;
--sleep 1
--connection node_1
SELECT COUNT(*) from mysql.general_log;
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
@ -25,3 +29,4 @@ SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argu
--connection node_2
SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
DROP TABLE t1;
SET @@global.wsrep_replicate_myisam=Default;

View file

@ -27,7 +27,6 @@ CREATE TABLE test.t3 AS SELECT * from t1;
SET SQL_LOG_BIN=ON;
INSERT INTO t1 VALUES(3);
CREATE TABLE test.t4 AS SELECT * from t1;
--save_master_pos
--connection node_2
SELECT * FROM t1;
@ -36,7 +35,12 @@ SELECT * FROM t3;
SELECT * FROM t4;
--connection node_3
--sync_with_master
--let $wait_condition = SELECT COUNT(*) = 2 FROM t1;
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 3 FROM t4;
--source include/wait_condition.inc
SHOW TABLES;
SELECT * FROM t1;
@ -45,15 +49,19 @@ SELECT * FROM t4;
--echo # Cleanup
--connection node_1
DROP TABLE t1, t4;
--save_master_pos
SET SQL_LOG_BIN=OFF;
DROP TABLE t2, t3;
--connection node_3
--sync_with_master
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't4';
--source include/wait_condition.inc
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
--connection node_1
RESET MASTER;

View file

@ -1,6 +1,7 @@
# Test fragmentation over configuration changes
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source suite/galera/include/galera_have_debug_sync.inc
# Prepare table
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);

View file

@ -19,17 +19,10 @@ CREATE TABLE t1 (f1 INTEGER);
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
# Compose a valid binlog from a header file and the GRA file
# Make sure the GRA file produced is readable and contains the failure
--let $gra_binlog_file = $MYSQLTEST_VARDIR/tmp/gra.log
--exec rm -rf $gra_binlog_file
--exec cp std_data/binlog-header.log $gra_binlog_file
--exec cat $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log >> $gra_binlog_file
# Make sure the binlog thus produced is readable and contains the failure
--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /#[0-9]+ +[0-9]+:[0-9]+:[0-9]+/<ISO TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/ /thread_id=[0-9]+/thread_id=<QUERY_THREAD_ID>/
--exec $MYSQL_BINLOG $gra_binlog_file
--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
SET SESSION wsrep_on=ON;

View file

@ -38,7 +38,13 @@ SELECT @@global.gtid_binlog_state;
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
--sleep 1
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 2 FROM t2;
--source include/wait_condition.inc
INSERT INTO t1 VALUES(2);
INSERT INTO t1 VALUES(3);
SELECT @@global.gtid_binlog_state;
@ -52,14 +58,6 @@ SELECT @@global.gtid_binlog_state;
--connection node_1
DROP TABLE t1,t2;
reset master;
#
# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
# warning is also reported by MTR, which is also weird.
#
--sleep 1
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
@ -76,3 +74,6 @@ reset master;
--connection node_3
reset master;
--connection node_1
reset master;

View file

@ -14,6 +14,13 @@ CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
--sleep 1
--connection node_2
# Wait until above DDL's are replicated
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
--source include/wait_condition.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
LOCK TABLE t1 READ;
--connection node_1

View file

@ -13,6 +13,13 @@ CREATE TABLE t2 (id INT) ENGINE=InnoDB;
--connection node_2
SET GLOBAL wsrep_slave_threads = 2;
# Wait until above DDL's are replicated
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
--source include/wait_condition.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
LOCK TABLE t1 WRITE;
--connection node_1

View file

@ -29,6 +29,11 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
exit(0);
EOF
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--error ER_UNKNOWN_COM_ERROR,ER_LOCK_WAIT_TIMEOUT,ER_LOCK_DEADLOCK,ER_ERROR_DURING_COMMIT
INSERT INTO t1 VALUES (1);
@ -41,8 +46,6 @@ INSERT INTO t1 VALUES (1);
exit(0);
EOF
SET SESSION wsrep_sync_wait = 1;
--sleep 10
--source include/wait_until_ready.inc
INSERT INTO t1 VALUES (1);
@ -51,7 +54,7 @@ INSERT INTO t1 VALUES (1);
--source include/galera_connect.inc
--connection node_2a
SET SESSION wsrep_sync_wait = 1;
SET SESSION wsrep_sync_wait = 0;
--source include/wait_until_ready.inc
SELECT COUNT(*) = 1 FROM t1;

View file

@ -20,7 +20,7 @@ CREATE TABLE child (
parent_id INT
) ENGINE=InnoDB;
INSERT INTO parent VALUES (DEFAULT, 0);
INSERT INTO parent VALUES (1, 0);
--connection node_2
--send INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;

View file

@ -17,12 +17,23 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
--reap
INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 234);
--let $wait_condition = SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM t1;
--connection node_1
--reap
--let $wait_condition = SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
--source include/wait_condition.inc
SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1';
SELECT COUNT(*) = 2 FROM t1;

View file

@ -0,0 +1 @@
--wsrep-auto-increment-control=ON

View file

@ -5,6 +5,11 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB;
@ -12,6 +17,8 @@ CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE
# auto_increment_increment is equal to the number of nodes
# auto_increment_offset is equal to the ID of the node
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;
@ -27,6 +34,8 @@ SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_
--connection node_2
--reap
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index';
SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size');
SELECT @@global.auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1;

View file

@ -86,6 +86,13 @@ INSERT INTO t1 VALUES (DEFAULT);
DROP TABLE t1;
--connection node_2
# Wait until above DDL is replicated
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
--source include/wait_condition.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
#
# make sure that we are left with exactly one applier thread before we leaving the test
#

View file

@ -17,6 +17,8 @@ CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
--connection node_2
SELECT COUNT(*) = 100000 FROM t1;
SET GLOBAL wsrep_desync = TRUE;
SET SESSION wsrep_on = FALSE;

View file

@ -5,6 +5,13 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
# Wait until above DDL's are replicated
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
--source include/wait_condition.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
FLUSH TABLES t1 FOR EXPORT;
--connection node_1

View file

@ -5,6 +5,13 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
# Wait until above DDL's are replicated
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
--source include/wait_condition.inc
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t%';
FLUSH TABLES t1 WITH READ LOCK;
--connection node_1

View file

@ -3,6 +3,9 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $node_1=node_1
--let $node_2=node_2
--source suite/galera/include/auto_increment_offset_save.inc
--source suite/galera/include/galera_sst_set_mysqldump.inc
--source suite/galera/include/galera_st_disconnect_slave.inc
@ -10,9 +13,8 @@
--source suite/galera/include/galera_sst_restore.inc
--connection node_2
# We have to manually restore global_log and slow_query_log due to mysql-wsrep#108
# Otherwise MTR's check_testcases complains
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;
--echo Restarting server ...
--source include/restart_mysqld.inc
--source suite/galera/include/auto_increment_offset_restore.inc

View file

@ -31,6 +31,7 @@ SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
--connection node_1
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
@ -63,3 +64,4 @@ INSERT INTO t1 VALUES (3,4);
DROP TABLE t1;
SET GLOBAL WSREP_OSU_METHOD = TOI;
SET DEBUG_SYNC = 'RESET';

View file

@ -6,6 +6,11 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_1
--let $wsrep_slave_1 = `SELECT @@wsrep_slave_threads`
set GLOBAL wsrep_slave_threads=26;
@ -54,12 +59,11 @@ show global variables like 'wsrep_slave_threads';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_2
SELECT COUNT(*) FROM t1;
SET GLOBAL auto_increment_offset = 2;
--connection node_1
SELECT COUNT(*) FROM t1;
show global variables like 'wsrep_slave_threads';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_1
DROP TABLE t1;
SET GLOBAL auto_increment_offset = 1;
--source include/auto_increment_offset_restore.inc

View file

@ -9,16 +9,12 @@
--connection node_1
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
--source include/wait_until_connected_again.inc
--source include/galera_suspend.inc
--sleep 10
--connection node_2
# Do not wait for causality as we are no longer in the primary component
SET SESSION wsrep_sync_wait=0;
--source include/wait_until_connected_again.inc
SET SESSION wsrep_on=OFF;
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
--source include/wait_condition.inc
@ -39,7 +35,6 @@ SHOW STATUS LIKE 'wsrep_local_state_comment';
--source include/galera_connect.inc
--connection node_3
SET SESSION wsrep_sync_wait=0;
--source include/wait_until_connected_again.inc
SHOW STATUS LIKE 'wsrep_cluster_size';
SHOW STATUS LIKE 'wsrep_cluster_status';

View file

@ -561,8 +561,15 @@ disconnect con4a;
disconnect con4b;
disconnect con4c;
set global max_user_connections = 0;
set global max_connections = 3;
set global max_connections = 10;
flush user_resources;
connect tmp_con1,localhost,root,,;
connect tmp_con2,localhost,root,,;
connect tmp_con3,localhost,root,,;
connect tmp_con4,localhost,root,,;
connect tmp_con5,localhost,root,,;
connect tmp_con6,localhost,root,,;
connect tmp_con7,localhost,root,,;
connect con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
@ -697,6 +704,13 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
disconnect con5a;
disconnect con5b;
disconnect tmp_con1;
disconnect tmp_con2;
disconnect tmp_con3;
disconnect tmp_con4;
disconnect tmp_con5;
disconnect tmp_con6;
disconnect tmp_con7;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv4.example.com';

View file

@ -561,8 +561,15 @@ disconnect con4a;
disconnect con4b;
disconnect con4c;
set global max_user_connections = 0;
set global max_connections = 3;
set global max_connections = 10;
flush user_resources;
connect tmp_con1,localhost,root,,;
connect tmp_con2,localhost,root,,;
connect tmp_con3,localhost,root,,;
connect tmp_con4,localhost,root,,;
connect tmp_con5,localhost,root,,;
connect tmp_con6,localhost,root,,;
connect tmp_con7,localhost,root,,;
connect con5a,"::1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
@ -697,6 +704,13 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
disconnect con5a;
disconnect con5b;
disconnect tmp_con1;
disconnect tmp_con2;
disconnect tmp_con3;
disconnect tmp_con4;
disconnect tmp_con5;
disconnect tmp_con6;
disconnect tmp_con7;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv6.example.com';

View file

@ -176,9 +176,17 @@ disconnect con4c;
--source ../include/wait_for_pfs_thread_count.inc
set global max_user_connections = 0;
set global max_connections = 3;
set global max_connections = 10;
flush user_resources;
connect (tmp_con1,localhost,root,,);
connect (tmp_con2,localhost,root,,);
connect (tmp_con3,localhost,root,,);
connect (tmp_con4,localhost,root,,);
connect (tmp_con5,localhost,root,,);
connect (tmp_con6,localhost,root,,);
connect (tmp_con7,localhost,root,,);
connect (con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
select "Con4a is alive";
select current_user();
@ -233,6 +241,13 @@ connect (con5d,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
disconnect con5a;
disconnect con5b;
--disconnect tmp_con1
--disconnect tmp_con2
--disconnect tmp_con3
--disconnect tmp_con4
--disconnect tmp_con5
--disconnect tmp_con6
--disconnect tmp_con7
# Wait for all disconnects
--source ../include/wait_for_pfs_thread_count.inc

View file

@ -177,9 +177,17 @@ disconnect con4c;
--source ../include/wait_for_pfs_thread_count.inc
set global max_user_connections = 0;
set global max_connections = 3;
set global max_connections = 10;
flush user_resources;
connect (tmp_con1,localhost,root,,);
connect (tmp_con2,localhost,root,,);
connect (tmp_con3,localhost,root,,);
connect (tmp_con4,localhost,root,,);
connect (tmp_con5,localhost,root,,);
connect (tmp_con6,localhost,root,,);
connect (tmp_con7,localhost,root,,);
connect (con5a,"::1",quota,,test,$MASTER_MYPORT,);
select "Con4a is alive";
select current_user();
@ -215,6 +223,13 @@ connect (con5d,"::1",quota,,test,$MASTER_MYPORT,);
disconnect con5a;
disconnect con5b;
--disconnect tmp_con1
--disconnect tmp_con2
--disconnect tmp_con3
--disconnect tmp_con4
--disconnect tmp_con5
--disconnect tmp_con6
--disconnect tmp_con7
# Wait for all disconnects
--source ../include/wait_for_pfs_thread_count.inc

View file

@ -1,3 +1,3 @@
select @@global.host_cache_size;
@@global.host_cache_size
653
632

View file

@ -27,20 +27,24 @@ SELECT @@global.max_connections;
@@global.max_connections
65536
SET @@global.max_connections = 1;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '1'
SELECT @@global.max_connections;
@@global.max_connections
1
10
SET @@global.max_connections = 2;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '2'
SELECT @@global.max_connections;
@@global.max_connections
2
10
'#--------------------FN_DYNVARS_074_04-------------------------#'
SET @@global.max_connections = -1;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '-1'
SELECT @@global.max_connections;
@@global.max_connections
1
10
SET @@global.max_connections = 100000000000;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '100000000000'
@ -57,13 +61,13 @@ Warnings:
Warning 1292 Truncated incorrect max_connections value: '-1024'
SELECT @@global.max_connections;
@@global.max_connections
1
10
SET @@global.max_connections = 0;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
SELECT @@global.max_connections;
@@global.max_connections
1
10
SET @@global.max_connections = 100001;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '100001'
@ -98,15 +102,17 @@ WHERE VARIABLE_NAME='max_connections';
1
'#---------------------FN_DYNVARS_074_07----------------------#'
SET @@global.max_connections = TRUE;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '1'
SELECT @@global.max_connections;
@@global.max_connections
1
10
SET @@global.max_connections = FALSE;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '0'
SELECT @@global.max_connections;
@@global.max_connections
1
10
'#---------------------FN_DYNVARS_074_08----------------------#'
SET @@global.max_connections = 5000;
SELECT @@max_connections = @@global.max_connections;

View file

@ -46,40 +46,40 @@ Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '100000000000'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
4294967295
SET @@global.max_prepared_stmt_count = 10000.01;
ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
4294967295
SET @@global.max_prepared_stmt_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1024'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
SET @@global.max_prepared_stmt_count = 1048577;
SET @@global.max_prepared_stmt_count = 4294967296;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '1048577'
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '4294967296'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
SET @@global.max_prepared_stmt_count = 104857612;
4294967295
SET @@global.max_prepared_stmt_count = 4294967295*1024;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '104857612'
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '4398046510080'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
4294967295
SET @@global.max_prepared_stmt_count = ON;
ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
4294967295
SET @@global.max_prepared_stmt_count = 'test';
ERROR 42000: Incorrect argument type to variable 'max_prepared_stmt_count'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
4294967295
'#-------------------FN_DYNVARS_081_05----------------------------#'
SET @@session.max_prepared_stmt_count = 4096;
ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should be set with SET GLOBAL

View file

@ -1879,7 +1879,7 @@ DEFAULT_VALUE 151
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 1
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
@ -2017,10 +2017,10 @@ GLOBAL_VALUE 16382
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16382
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Maximum number of prepared statements in the server
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -3917,13 +3917,13 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
SESSION_VALUE NULL
GLOBAL_VALUE 2000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
GLOBAL_VALUE 100
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 1
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL

View file

@ -2061,7 +2061,7 @@ DEFAULT_VALUE 151
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 1
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
@ -2199,10 +2199,10 @@ GLOBAL_VALUE 16382
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 16382
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Maximum number of prepared statements in the server
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
NUMERIC_MAX_VALUE 4294967295
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
@ -4701,13 +4701,13 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
SESSION_VALUE NULL
GLOBAL_VALUE 2000
GLOBAL_VALUE_ORIGIN COMPILE-TIME
GLOBAL_VALUE 100
GLOBAL_VALUE_ORIGIN CONFIG
DEFAULT_VALUE 2000
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 1
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL

View file

@ -1,7 +1,7 @@
SET @start_value = @@global.table_open_cache ;
SELECT @start_value;
@start_value
2000
421
'#--------------------FN_DYNVARS_001_01------------------------#'
SET @@global.table_open_cache = 99;
SET @@global.table_open_cache = DeFAULT;
@ -15,13 +15,17 @@ SELECT @@global.table_open_cache = 400;
0
'#--------------------FN_DYNVARS_001_03------------------------#'
SET @@global.table_open_cache = 8;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '8'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
8
10
SET @@global.table_open_cache = 1;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
10
SET @@global.table_open_cache = 1073741824;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '1073741824'
@ -42,7 +46,7 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
10
SET @@global.table_open_cache = 100000000000;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '100000000000'
@ -54,13 +58,13 @@ Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '-1024'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
10
SET @@global.table_open_cache = 0;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
10
SET @@global.table_open_cache = 10000.01;
ERROR 42000: Incorrect argument type to variable 'table_open_cache'
SET @@global.table_open_cache = ON;
@ -78,15 +82,17 @@ SELECT @@global.table_open_cache = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL
1
'#---------------------FN_DYNVARS_001_09----------------------#'
SET @@global.table_open_cache = TRUE;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '1'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
10
SET @@global.table_open_cache = FALSE;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
10
'#---------------------FN_DYNVARS_001_10----------------------#'
SET @@global.table_open_cache = 10;
SELECT @@table_open_cache = @@global.table_open_cache ;
@ -104,4 +110,4 @@ ERROR 42S22: Unknown column 'table_open_cache' in 'field list'
SET @@global.table_open_cache = @start_value;
SELECT @@global.table_open_cache ;
@@global.table_open_cache
2000
421

View file

@ -92,9 +92,9 @@ SET @@global.max_prepared_stmt_count = 10000.01;
SELECT @@global.max_prepared_stmt_count;
SET @@global.max_prepared_stmt_count = -1024;
SELECT @@global.max_prepared_stmt_count;
SET @@global.max_prepared_stmt_count = 1048577;
SET @@global.max_prepared_stmt_count = 4294967296;
SELECT @@global.max_prepared_stmt_count;
SET @@global.max_prepared_stmt_count = 104857612;
SET @@global.max_prepared_stmt_count = 4294967295*1024;
SELECT @@global.max_prepared_stmt_count;
--Error ER_WRONG_TYPE_FOR_VAR

View file

@ -1 +1,2 @@
--loose-innodb-flush-log-at-timeout=3
--table_open_cache=200

View file

@ -0,0 +1 @@
--table_open_cache=100

View file

@ -0,0 +1 @@
--table_open_cache=100

View file

@ -143,9 +143,18 @@ GRANT USAGE ON *.* TO mysqltest_u1@localhost;
--echo
let $saved_max_connections = `SELECT @@global.max_connections`;
SET GLOBAL max_connections = 3;
SET GLOBAL max_connections = 10;
SET GLOBAL event_scheduler = ON;
connect (tmp_con1,localhost,mysqltest_u1,,);
connect (tmp_con2,localhost,mysqltest_u1,,);
connect (tmp_con3,localhost,mysqltest_u1,,);
connect (tmp_con4,localhost,mysqltest_u1,,);
connect (tmp_con5,localhost,mysqltest_u1,,);
connect (tmp_con6,localhost,mysqltest_u1,,);
connect (tmp_con7,localhost,mysqltest_u1,,);
connection default;
--echo
--echo # -- Waiting for Event Scheduler to start...
let $wait_condition =
@ -230,6 +239,13 @@ let $wait_condition =
--disconnect con_2
--disconnect con_3
--disconnect con_super_1
--disconnect tmp_con1
--disconnect tmp_con2
--disconnect tmp_con3
--disconnect tmp_con4
--disconnect tmp_con5
--disconnect tmp_con6
--disconnect tmp_con7
--echo
--echo # -- Restoring default connection...

View file

@ -606,6 +606,17 @@ SELECT NAME_CONST('a', -(1 OR 2)) OR 1;
SELECT NAME_CONST('a', -(1 AND 2)) OR 1;
SELECT NAME_CONST('a', -(1)) OR 1;
--echo #
--echo # MDEV-15630 uuid() function evaluates at wrong time in query
--echo #
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
--replace_column 2 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #

View file

@ -1768,6 +1768,41 @@ EXPLAIN EXTENDED SELECT CHAR(0xDF USING latin1);
EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
EXPLAIN EXTENDED SELECT CHAR(0xDF);
--echo #
--echo # MDEV-15619 using CONVERT() inside AES_ENCRYPT() in an UPDATE corrupts data
--echo #
CREATE TABLE t1 (
id int(11) NOT NULL,
session_id varchar(255) DEFAULT NULL,
directory mediumtext,
checksum int(10) DEFAULT NULL,
last_update datetime DEFAULT NULL,
PRIMARY KEY (id),
KEY lastupdate (last_update)
) DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,'',NULL,38391,'2017-06-24 07:35:28');
UPDATE t1 SET directory = AES_ENCRYPT(CONVERT('test stringrererejrjerjehrjekhrjkehrjkehrkjehrjkerhkjehrjekrhkjehrkjerhjkehrkjehrkjehrjkehrjkehrjkehrjkerjkehrjkehrjkehrjke rekjhrejrejhrjehgrehjgrhjerjhegrjherejhgrjhegrjehgrjhegrejhrgjehgrjhegrjhegrjhergjhegrjhegrhjegrjerhthkjjkdhjkgdfjkgjkdgdjkfjkhgjkfdhjgjkfdghkjdfghkjfdghfjkdghkdjfghdkjfghfjkdghfkjdghkjfdghfkjdghfkdjghfkjdghfdjkghjkdfhgdfjkghfjkdghfjkdghfjdkghfjkdghkfjdghfkjdghfkjdghkjdfghfjdkghjkfdghkjdfhgjkdfhgjkfdhgkjfdghkfjdhgkjfdgdjkejktjherjthkjrethkjrethjkerthjkerhtjkerhtkjerhtjkerhtjkerhtjkrehtkjerhtkjrehtjkrehtkjrehtkjerhtkjerhtjkrehtkjrehtjkrehtkjrethjkrethkjrehtkjethjkerhtjkrehtjkretkjerhtkjrehtjkerhtjkrehtjrehtkjrekjtrfgdsfgdhjsghjgfdhjsfhjdfgdhjshjdshjfghjdsfgjhsfgjhsdfgjhdsfgjdhsfgsjhfgjhsdfgsdjhfgjdhsfdjshfgdsjhfgjsdhfdjshfgdjhsfgdjshfgjdhsfgjhsdfgjhsdgfjhsdgfjhdsgfjhsgfjhsdgfjhdsgfhjsdehkjthrkjethjkre' USING latin1), '95F5A1F52A554'), last_update= NOW();
SELECT directory IS NULL FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
directory mediumtext
) DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,AES_ENCRYPT(CONVERT(REPEAT('a',800) USING latin1),'95F5A1F52A554'));
SELECT AES_DECRYPT(directory,'95F5A1F52A554') FROM t1;
DROP TABLE t1;
SET @enc=AES_ENCRYPT(REPEAT(_latin1'a',800),'95F5A1F52A554');
CREATE TABLE t1 (
id int(11) NOT NULL PRIMARY KEY,
directory mediumtext
) DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,AES_DECRYPT(CONVERT(@enc USING binary),'95F5A1F52A554'));
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # Start of 10.1 tests
--echo #

View file

@ -4,7 +4,16 @@
--source include/not_embedded.inc
SET GLOBAL log_warnings=4;
SET GLOBAL max_connections=2;
SET GLOBAL max_connections=10;
--connect (tmp_con1,localhost,root,,)
--connect (tmp_con2,localhost,root,,)
--connect (tmp_con3,localhost,root,,)
--connect (tmp_con4,localhost,root,,)
--connect (tmp_con5,localhost,root,,)
--connect (tmp_con6,localhost,root,,)
--connect (tmp_con7,localhost,root,,)
--connect (tmp_con8,localhost,root,,)
--connect (con1,localhost,root,,)
SELECT 1;

View file

@ -1225,13 +1225,14 @@ DROP TABLE t1;
--echo #
--echo # BUG#48438 - crash with error in unioned query against merge table and view...
--echo #
SET GLOBAL table_open_cache=3;
SET @save_table_open_cache=@@table_open_cache;
SET GLOBAL table_open_cache=10;
CREATE TABLE t1(a INT);
SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4 FOR UPDATE;
SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4, t1 AS a5, t1 AS a6, t1 AS a7, t1 AS a8, t1 AS a9, t1 AS a10, t1 AS a11 FOR UPDATE;
SELECT TABLE_ROWS, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DROP TABLE t1;
SET GLOBAL table_open_cache=DEFAULT;
SET GLOBAL table_open_cache=@save_table_open_cache;
--echo End of 5.0 tests

View file

@ -23,6 +23,7 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
call mtr.add_suppression(" '\..test.t1'");
set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=256;
set global table_definition_cache=400;
--disable_warnings
@ -104,7 +105,7 @@ prepare stmt from @drop_table_stmt;
execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
set @@global.table_open_cache=default;
set @@global.table_open_cache=@save_table_open_cache;
disconnect con1;
connection default;
--enable_ps_protocol

View file

@ -684,7 +684,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
# Too many errorcodes specified
--error 1
--exec echo "--error 1,2,3,4,5,6,7,8,9,10,11" | $MYSQL_TEST 2>&1
--exec echo "--error 1,2,3,4,5,6,7,8,9,10,11,12,13" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------

View file

@ -781,6 +781,15 @@ CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\;
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
DROP TABLE t1;
--echo #
--echo # MDEV-15620 Crash when using "SET @@NEW.a=expr" inside a trigger
--echo #
CREATE TABLE t1 (a INT);
--error ER_UNKNOWN_SYSTEM_VARIABLE
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @@NEW.a=0;
DROP TABLE t1;
#
# start of 10.1 tests
#

View file

@ -9401,7 +9401,7 @@ DELIMITER ;|
set @tmp_toc= @@table_open_cache;
set @tmp_tdc= @@table_definition_cache;
set global table_open_cache=1;
set global table_open_cache=10;
set global table_definition_cache=1;
call p1();

View file

@ -799,6 +799,25 @@ select db_name, table_name, column_name,
drop table t1;
--echo #
--echo # MDEB-9744: session optimizer_use_condition_selectivity=5 causing SQL Error (1918):
--echo # Encountered illegal value '' when converting to DECIMAL
--echo #
set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
set optimizer_use_condition_selectivity=3, use_stat_tables=preferably;
create table t1 (id int(10),cost decimal(9,2)) engine=innodb;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
create temporary table t2 (id int);
insert into t2 (id) select id from t1 where cost > 0;
select * from t2;
set use_stat_tables=@save_use_stat_tables;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1,t2;
--echo #
--echo # MDEV-9590: Always print "Engine-independent statistic" warnings and
--echo # might be filtering columns unintentionally from engines

View file

@ -343,6 +343,7 @@ set sql_select_limit=1;
# reset it, so later tests don't get confused
set sql_select_limit=default;
set sql_warnings=1;
set @save_table_open_cache=@@table_open_cache;
set global table_open_cache=100;
set default_storage_engine=myisam;
set global thread_cache_size=100;
@ -502,7 +503,7 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'MYI
SET GLOBAL table_open_cache=-1;
SHOW VARIABLES LIKE 'table_open_cache';
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'table_open_cache';
SET GLOBAL table_open_cache=DEFAULT;
SET GLOBAL table_open_cache=@save_table_open_cache;
#
# Bugs12363: character_set_results is nullable,

View file

@ -5483,6 +5483,202 @@ SHOW CREATE VIEW v1;
drop view v1;
drop table t1;
CREATE TABLE IF NOT EXISTS t0 (f0 INT);
CREATE TABLE IF NOT EXISTS t1 (f1 INT);
CREATE TABLE IF NOT EXISTS t2 (f2 INT);
CREATE TABLE IF NOT EXISTS t3 (f3 INT);
CREATE TABLE IF NOT EXISTS t4 (f4 INT);
CREATE TABLE IF NOT EXISTS t5 (f5 INT);
CREATE TABLE IF NOT EXISTS t6 (f6 INT);
CREATE TABLE IF NOT EXISTS t7 (f7 INT);
CREATE TABLE IF NOT EXISTS t8 (f8 INT);
CREATE TABLE IF NOT EXISTS t9 (f9 INT);
CREATE TABLE IF NOT EXISTS t10 (f10 INT);
CREATE TABLE IF NOT EXISTS t11 (f11 INT);
CREATE TABLE IF NOT EXISTS t12 (f12 INT);
CREATE TABLE IF NOT EXISTS t13 (f13 INT);
CREATE TABLE IF NOT EXISTS t14 (f14 INT);
CREATE TABLE IF NOT EXISTS t15 (f15 INT);
CREATE TABLE IF NOT EXISTS t16 (f16 INT);
CREATE TABLE IF NOT EXISTS t17 (f17 INT);
CREATE TABLE IF NOT EXISTS t18 (f18 INT);
CREATE TABLE IF NOT EXISTS t19 (f19 INT);
CREATE TABLE IF NOT EXISTS t20 (f20 INT);
CREATE TABLE IF NOT EXISTS t21 (f21 INT);
CREATE TABLE IF NOT EXISTS t22 (f22 INT);
CREATE TABLE IF NOT EXISTS t23 (f23 INT);
CREATE TABLE IF NOT EXISTS t24 (f24 INT);
CREATE TABLE IF NOT EXISTS t25 (f25 INT);
CREATE TABLE IF NOT EXISTS t26 (f26 INT);
CREATE TABLE IF NOT EXISTS t27 (f27 INT);
CREATE TABLE IF NOT EXISTS t28 (f28 INT);
CREATE TABLE IF NOT EXISTS t29 (f29 INT);
CREATE TABLE IF NOT EXISTS t30 (f30 INT);
CREATE TABLE IF NOT EXISTS t31 (f31 INT);
CREATE TABLE IF NOT EXISTS t32 (f32 INT);
CREATE TABLE IF NOT EXISTS t33 (f33 INT);
CREATE TABLE IF NOT EXISTS t34 (f34 INT);
CREATE TABLE IF NOT EXISTS t35 (f35 INT);
CREATE TABLE IF NOT EXISTS t36 (f36 INT);
CREATE TABLE IF NOT EXISTS t37 (f37 INT);
CREATE TABLE IF NOT EXISTS t38 (f38 INT);
CREATE TABLE IF NOT EXISTS t39 (f39 INT);
CREATE TABLE IF NOT EXISTS t40 (f40 INT);
CREATE TABLE IF NOT EXISTS t41 (f41 INT);
CREATE TABLE IF NOT EXISTS t42 (f42 INT);
CREATE TABLE IF NOT EXISTS t43 (f43 INT);
CREATE TABLE IF NOT EXISTS t44 (f44 INT);
CREATE TABLE IF NOT EXISTS t45 (f45 INT);
CREATE TABLE IF NOT EXISTS t46 (f46 INT);
CREATE TABLE IF NOT EXISTS t47 (f47 INT);
CREATE TABLE IF NOT EXISTS t48 (f48 INT);
CREATE TABLE IF NOT EXISTS t49 (f49 INT);
CREATE TABLE IF NOT EXISTS t50 (f50 INT);
CREATE TABLE IF NOT EXISTS t51 (f51 INT);
CREATE TABLE IF NOT EXISTS t52 (f52 INT);
CREATE TABLE IF NOT EXISTS t53 (f53 INT);
CREATE TABLE IF NOT EXISTS t54 (f54 INT);
CREATE TABLE IF NOT EXISTS t55 (f55 INT);
CREATE TABLE IF NOT EXISTS t56 (f56 INT);
CREATE TABLE IF NOT EXISTS t57 (f57 INT);
CREATE TABLE IF NOT EXISTS t58 (f58 INT);
CREATE TABLE IF NOT EXISTS t59 (f59 INT);
CREATE TABLE IF NOT EXISTS t60 (f60 INT);
CREATE OR REPLACE VIEW v60 AS SELECT * FROM t60;
EXPLAIN
SELECT t0.*
FROM t0
JOIN t1
ON t1.f1 = t0.f0
LEFT JOIN t2
ON t0.f0 = t2.f2
LEFT JOIN t3
ON t0.f0 = t3.f3
LEFT JOIN t4
ON t0.f0 = t4.f4
LEFT JOIN t5
ON t4.f4 = t5.f5
LEFT JOIN t6
ON t0.f0 = t6.f6
LEFT JOIN t7
ON t0.f0 = t7.f7
LEFT JOIN t8
ON t0.f0 = t8.f8
LEFT JOIN t9
ON t0.f0 = t9.f9
LEFT JOIN t10
ON t0.f0 = t10.f10
LEFT JOIN t11
ON t0.f0 = t11.f11
LEFT JOIN t12
ON t0.f0 = t12.f12
LEFT JOIN t13
ON t0.f0 = t13.f13
LEFT JOIN t14
ON t0.f0 = t14.f14
LEFT JOIN t15
ON t0.f0 = t15.f15
LEFT JOIN t16
ON t0.f0 = t16.f16
LEFT JOIN t17
ON t0.f0 = t17.f17
LEFT JOIN t18
ON t0.f0 = t18.f18
LEFT JOIN t19
ON t18.f18 = t19.f19
LEFT JOIN t20
ON t20.f20 = t19.f19
LEFT JOIN t21
ON t20.f20 = t21.f21
LEFT JOIN t22
ON t19.f19 = t22.f22
LEFT JOIN t23
ON t23.f23 = t0.f0
LEFT JOIN t24
ON t24.f24 = t23.f23
LEFT JOIN t25
ON t0.f0 = t25.f25
LEFT JOIN t26
ON t26.f26 = t0.f0
LEFT JOIN t27
ON t27.f27 = t0.f0
LEFT JOIN t28
ON t0.f0 = t28.f28
LEFT JOIN t29
ON t0.f0 = t29.f29
LEFT JOIN t30
ON t30.f30 = t0.f0
LEFT JOIN t31
ON t0.f0 = t31.f31
LEFT JOIN t32
ON t32.f32 = t31.f31
LEFT JOIN t33
ON t33.f33 = t0.f0
LEFT JOIN t34
ON t33.f33 = t34.f34
LEFT JOIN t35
ON t33.f33 = t35.f35
LEFT JOIN t36
ON t36.f36 = t0.f0
LEFT JOIN t37
ON t32.f32 = t37.f37
LEFT JOIN t38
ON t31.f31 = t38.f38
LEFT JOIN t39
ON t39.f39 = t0.f0
LEFT JOIN t40
ON t40.f40 = t39.f39
LEFT JOIN t41
ON t41.f41 = t0.f0
LEFT JOIN t42
ON t42.f42 = t41.f41
LEFT JOIN t43
ON t43.f43 = t41.f41
LEFT JOIN t44
ON t44.f44 = t0.f0
LEFT JOIN t45
ON t45.f45 = t0.f0
LEFT JOIN t46
ON t46.f46 = t0.f0
LEFT JOIN t47
ON t47.f47 = t0.f0
LEFT JOIN t48
ON t48.f48 = t0.f0
LEFT JOIN t49
ON t0.f0 = t49.f49
LEFT JOIN t50
ON t0.f0 = t50.f50
LEFT JOIN t51
ON t0.f0 = t51.f51
LEFT JOIN t52
ON t52.f52 = t0.f0
LEFT JOIN t53
ON t53.f53 = t0.f0
LEFT JOIN t54
ON t54.f54 = t0.f0
LEFT JOIN t55
ON t55.f55 = t0.f0
LEFT JOIN t56
ON t56.f56 = t0.f0
LEFT JOIN t57
ON t57.f57 = t0.f0
LEFT JOIN t58
ON t58.f58 = t57.f57
LEFT JOIN t59
ON t36.f36 = t59.f59
LEFT JOIN v60
ON t36.f36 = v60.f60
;
drop table t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
t10, t11, t12, t13, t14, t15, t16, t17, t18,
t19, t20, t21, t22, t23, t24, t25, t26, t27,
t28, t29, t30, t31, t32, t33, t34, t35, t36,
t37, t38, t39, t40, t41, t42, t43, t44, t45,
t46, t47, t48, t49, t50, t51, t52, t53, t54,
t55, t56, t57, t58, t59,t60;
drop view v60;
--echo # -----------------------------------------------------------------
--echo # -- End of 5.5 tests.
--echo # -----------------------------------------------------------------

View file

@ -226,7 +226,7 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc)
strnmov(addr2line_binary, info.dli_fname, sizeof(addr2line_binary));
}
offset = info.dli_fbase;
len= my_snprintf(input, sizeof(input), "%p\n", ptr - offset);
len= my_snprintf(input, sizeof(input), "%08x\n", (ulonglong)(ptr - offset));
if (write(in[1], input, len) <= 0)
return 3;

View file

@ -1822,7 +1822,8 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const c
*/
#ifdef HAVE_X509_check_host
ret_validation= X509_check_host(server_cert, server_hostname, 0, 0, 0) != 1;
ret_validation= X509_check_host(server_cert, server_hostname,
strlen(server_hostname), 0, 0) != 1;
#else
subject= X509_get_subject_name(server_cert);
cn_loc= X509_NAME_get_index_by_NID(subject, NID_commonName, -1);
@ -2512,10 +2513,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
if (mysql->client_flag & CLIENT_MULTI_STATEMENTS)
mysql->client_flag|= CLIENT_MULTI_RESULTS;
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
#ifdef HAVE_OPENSSL
if (mysql->options.use_ssl)
mysql->client_flag|= CLIENT_SSL;
#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY*/
#endif /* HAVE_OPENSSL */
if (mpvio->db)
mysql->client_flag|= CLIENT_CONNECT_WITH_DB;

View file

@ -41,13 +41,12 @@ struct show_table_contributors_st show_table_contributors[]= {
{"Alibaba Cloud", "https://www.alibabacloud.com/", "Platinum Sponsor of the MariaDB Foundation"},
{"Tencent Cloud", "https://cloud.tencent.com", "Platinum Sponsor of the MariaDB Foundation"},
{"Microsoft", "https://microsoft.com/", "Platinum Sponsor of the MariaDB Foundation"},
{"MariaDB Corporation", "https://mariadb.com", "Founding member, Gold Sponsor of the MariaDB Foundation"},
{"MariaDB Corporation", "https://mariadb.com", "Founding member, Platinum Sponsor of the MariaDB Foundation"},
{"Visma", "https://visma.com", "Gold Sponsor of the MariaDB Foundation"},
{"DBS", "https://dbs.com", "Gold Sponsor of the MariaDB Foundation"},
{"IBM", "https://www.ibm.com", "Gold Sponsor of the MariaDB Foundation"},
{"Nexedi", "https://www.nexedi.com", "Silver Sponsor of the MariaDB Foundation"},
{"Acronis", "http://www.acronis.com", "Silver Sponsor of the MariaDB Foundation"},
{"Auttomattic", "https://automattic.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Verkkokauppa.com", "https://www.verkkokauppa.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Virtuozzo", "https://virtuozzo.com", "Bronze Sponsor of the MariaDB Foundation"},
{"Tencent Game DBA", "http://tencentdba.com/about", "Bronze Sponsor of the MariaDB Foundation"},

View file

@ -317,7 +317,7 @@ String *Item_aes_crypt::val_str(String *str2)
{
DBUG_ASSERT(fixed == 1);
StringBuffer<80> user_key_buf;
String *sptr= args[0]->val_str(&str_value);
String *sptr= args[0]->val_str(&tmp_value);
String *user_key= args[1]->val_str(&user_key_buf);
uint32 aes_length;

View file

@ -213,6 +213,7 @@ class Item_aes_crypt :public Item_str_binary_checksum_func
protected:
int what;
String tmp_value;
public:
Item_aes_crypt(THD *thd, Item *a, Item *b)
:Item_str_binary_checksum_func(thd, a, b) {}
@ -222,8 +223,8 @@ public:
class Item_func_aes_encrypt :public Item_aes_crypt
{
public:
Item_func_aes_encrypt(THD *thd, Item *a, Item *b):
Item_aes_crypt(thd, a, b) {}
Item_func_aes_encrypt(THD *thd, Item *a, Item *b)
:Item_aes_crypt(thd, a, b) {}
void fix_length_and_dec();
const char *func_name() const { return "aes_encrypt"; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
@ -1383,6 +1384,7 @@ public:
DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
fix_char_length(MY_UUID_STRING_LENGTH);
}
table_map used_tables() const { return RAND_TABLE_BIT; }
const char *func_name() const{ return "uuid"; }
String *val_str(String *);
bool check_vcol_func_processor(void *arg)

View file

@ -115,7 +115,7 @@
#include <poll.h>
#endif
#include <my_systemd.h>
#include <my_service_manager.h>
#define mysqld_charset &my_charset_latin1
@ -547,7 +547,7 @@ bool max_user_connections_checking=0;
Limit of the total number of prepared statements in the server.
Is necessary to protect the server against out-of-memory attacks.
*/
ulong max_prepared_stmt_count;
uint max_prepared_stmt_count;
/**
Current total number of prepared statements in the server. This number
is exact, and therefore may not be equal to the difference between
@ -558,7 +558,7 @@ ulong max_prepared_stmt_count;
two different connections, this counts as two distinct prepared
statements.
*/
ulong prepared_stmt_count=0;
uint prepared_stmt_count=0;
my_thread_id global_thread_id= 0;
ulong current_pid;
ulong slow_launch_threads = 0;
@ -4393,11 +4393,20 @@ static int init_common_variables()
/* connections and databases needs lots of files */
{
uint files, wanted_files, max_open_files;
uint files, wanted_files, max_open_files, min_tc_size, extra_files,
min_connections;
ulong org_max_connections, org_tc_size;
/* Number of files reserved for temporary files */
extra_files= 30;
min_connections= 10;
/* MyISAM requires two file handles per table. */
wanted_files= (10 + max_connections + extra_max_connections +
wanted_files= (extra_files + max_connections + extra_max_connections +
tc_size * 2);
min_tc_size= MY_MIN(tc_size, TABLE_OPEN_CACHE_MIN);
org_max_connections= max_connections;
org_tc_size= tc_size;
/*
We are trying to allocate no less than max_connections*5 file
handles (i.e. we are trying to set the limit so that they will
@ -4409,44 +4418,49 @@ static int init_common_variables()
requested (value of wanted_files).
*/
max_open_files= MY_MAX(MY_MAX(wanted_files,
(max_connections + extra_max_connections)*5),
open_files_limit);
(max_connections + extra_max_connections)*5),
open_files_limit);
files= my_set_max_open_files(max_open_files);
SYSVAR_AUTOSIZE_IF_CHANGED(open_files_limit, files, ulong);
if (files < wanted_files)
{
if (!open_files_limit || IS_SYSVAR_AUTOSIZE(&open_files_limit))
{
/*
If we have requested too much file handles than we bring
max_connections in supported bounds.
*/
SYSVAR_AUTOSIZE(max_connections,
(ulong) MY_MIN(files-10-TABLE_OPEN_CACHE_MIN*2, max_connections));
/*
Decrease tc_size according to max_connections, but
not below TABLE_OPEN_CACHE_MIN. Outer MY_MIN() ensures that we
never increase tc_size automatically (that could
happen if max_connections is decreased above).
*/
SYSVAR_AUTOSIZE(tc_size,
(ulong) MY_MIN(MY_MAX((files - 10 - max_connections) / 2,
TABLE_OPEN_CACHE_MIN), tc_size));
DBUG_PRINT("warning",
("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
files, max_connections, tc_size));
if (global_system_variables.log_warnings > 1)
sql_print_warning("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
files, max_connections, tc_size);
}
else if (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);
}
SYSVAR_AUTOSIZE(open_files_limit, files);
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 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,
max_connections),
min_connections),
ulong);
/*
Decrease tc_size according to max_connections, but
not below min_tc_size. Outer MY_MIN() ensures that we
never increase tc_size automatically (that could
happen if max_connections is decreased above).
*/
SYSVAR_AUTOSIZE_IF_CHANGED(tc_size,
(ulong) MY_MIN(MY_MAX((files - extra_files -
max_connections) / 2,
min_tc_size),
tc_size), ulong);
DBUG_PRINT("warning",
("Current limits: max_open_files: %u max_connections: %ld table_cache: %ld",
files, max_connections, tc_size));
if (global_system_variables.log_warnings > 1 &&
(max_connections < org_max_connections ||
tc_size < org_tc_size))
sql_print_warning("Changed limits: max_open_files: %u max_connections: %lu (was %lu) table_cache: %lu (was %lu)",
files, max_connections, org_max_connections,
tc_size, org_tc_size);
}
/*
Max_connections is now set.
Max_connections and tc_cache are now set.
Now we can fix other variables depending on this variable.
*/
@ -6579,7 +6593,7 @@ void handle_connections_sockets()
#endif
sd_notify(0, "READY=1\n"
"STATUS=Taking your SQL requests now...");
"STATUS=Taking your SQL requests now...\n");
DBUG_PRINT("general",("Waiting for connections."));
MAYBE_BROKEN_SYSCALL;
@ -6781,7 +6795,7 @@ void handle_connections_sockets()
create_new_thread(connect);
}
sd_notify(0, "STOPPING=1\n"
"STATUS=Shutdown in progress");
"STATUS=Shutdown in progress\n");
DBUG_VOID_RETURN;
}

Some files were not shown because too many files have changed in this diff Show more