Merge branch '10.1' into 10.2

This commit is contained in:
Sergei Golubchik 2018-06-21 23:47:39 +02:00
commit b942aa34c1
185 changed files with 2884 additions and 1966 deletions

7
.gitignore vendored
View File

@ -126,6 +126,7 @@ scripts/mytop
scripts/wsrep_sst_common
scripts/wsrep_sst_mysqldump
scripts/wsrep_sst_rsync
scripts/wsrep_sst_rsync_wan
scripts/wsrep_sst_mariabackup
scripts/wsrep_sst_xtrabackup
scripts/wsrep_sst_xtrabackup-v2
@ -494,3 +495,9 @@ UpgradeLog*.htm
# Microsoft Fakes
FakesAssemblies/
# macOS garbage
.DS_Store
# QtCreator && CodeBlocks
*.cbp

View File

@ -5008,6 +5008,14 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (opt_xml)
print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);
/* obtain dump of routines (procs/functions) */
if (opt_routines && mysql_get_server_version(mysql) >= 50009)
{
DBUG_PRINT("info", ("Dumping routines for database %s", db));
dump_routines_for_db(db);
}
if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
{
verbose_msg("-- Setting savepoint...\n");
@ -5017,7 +5025,6 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
DBUG_RETURN(1);
}
}
/* Dump each selected table */
for (pos= dump_tables; pos < end; pos++)
{
@ -5079,12 +5086,6 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
DBUG_PRINT("info", ("Dumping events for database %s", db));
dump_events_for_db(db);
}
/* obtain dump of routines (procs/functions) */
if (opt_routines && mysql_get_server_version(mysql) >= 50009)
{
DBUG_PRINT("info", ("Dumping routines for database %s", db));
dump_routines_for_db(db);
}
free_root(&glob_root, MYF(0));
if (opt_xml)
{

View File

@ -853,7 +853,7 @@ build_table_string(void)
if (auto_generate_sql_guid_primary)
{
dynstr_append(&table_string, "id varchar(32) primary key");
dynstr_append(&table_string, "id varchar(36) primary key");
if (num_int_cols || num_char_cols || auto_generate_sql_guid_primary)
dynstr_append(&table_string, ",");
@ -868,7 +868,7 @@ build_table_string(void)
if (count) /* Except for the first pass we add a comma */
dynstr_append(&table_string, ",");
if (snprintf(buf, HUGE_STRING_LENGTH, "id%d varchar(32) unique key", count)
if (snprintf(buf, HUGE_STRING_LENGTH, "id%d varchar(36) unique key", count)
> HUGE_STRING_LENGTH)
{
fprintf(stderr, "Memory Allocation error in create table\n");

View File

@ -8747,6 +8747,7 @@ void init_re(void)
"[[:space:]]*SELECT[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*DO[[:space:]]|"
"[[:space:]]*HANDLER[[:space:]]+.*[[:space:]]+READ[[:space:]]|"
"[[:space:]]*SET[[:space:]]+OPTION[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]+MULTI[[:space:]]|"
"[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"

2
debian/control vendored
View File

@ -351,7 +351,7 @@ Depends: bsdutils,
findutils,
galera-3 (>=25.3),
gawk,
iproute2,
iproute | iproute2,
libdbi-perl,
lsb-base (>= 3.0-10),
lsof,

View File

@ -598,6 +598,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC 0
#else
#define HAVE_SOCK_CLOEXEC
#endif
/* additional file share flags for win32 */

View File

@ -561,6 +561,12 @@ inline_mysql_socket_socket
(key, (const my_socket*)&mysql_socket.fd, NULL, 0);
}
#endif
/* SOCK_CLOEXEC isn't always a number - can't preprocessor compare */
#if defined(HAVE_FCNTL) && defined(FD_CLOEXEC) && !defined(HAVE_SOCK_CLOEXEC)
(void) fcntl(mysql_socket.fd, F_SETFD, FD_CLOEXEC);
#endif
return mysql_socket;
}

View File

@ -5698,7 +5698,7 @@ sub lldb_arguments {
$input = $input ? "< $input" : "";
# write init file for mysqld or client
mtr_tofile($lldb_init_file, "set args $str $input\n");
mtr_tofile($lldb_init_file, "process launch --stop-at-entry -- $str $input\n");
print "\nTo start lldb for $type, type in another window:\n";
print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n";

View File

@ -2237,6 +2237,29 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key
#
CREATE TABLE t1 (
`ID` BIGINT(20) NOT NULL,
`RANK` MEDIUMINT(4) NOT NULL,
`CHECK_POINT` BIGINT(20) NOT NULL,
UNIQUE INDEX `HORIZON_UIDX01` (`ID`, `RANK`)
) ENGINE=InnoDB;
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`ID` bigint(20) NOT NULL,
`RANK` mediumint(4) NOT NULL,
`CHECK_POINT` bigint(20) NOT NULL,
PRIMARY KEY (`ID`,`CHECK_POINT`),
UNIQUE KEY `HORIZON_UIDX01` (`ID`,`RANK`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
Warnings:
Note 1061 Multiple primary key defined
DROP TABLE t1;
#
# End of 10.0 tests
#
#

View File

@ -306,7 +306,7 @@ ANALYZE
"r_rows": 10,
"r_total_time_ms": "REPLACED",
"filtered": 100,
"r_filtered": 1,
"r_filtered": 100,
"attached_condition": "t0.a is not null"
}
}

View File

@ -538,6 +538,35 @@ pk
1
drop table t1;
#
# End of 5.3 tests
#
#
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
#
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
`name` char(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
id name
-1 dog
2 cat
DROP TABLE t1;
#
# End of 5.5 tests
#
#
# MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
#
SET @engine='MyISAM';
@ -657,3 +686,6 @@ id name
-1 dog
2 cat
DROP PROCEDURE autoinc_mdev15353_one;
#
# End of 10.2 tests
#

View File

@ -711,6 +711,23 @@ a ct
set sql_mode=@save_sql_mode;
drop table t1;
#
# mdev-16235: impossible HAVING in query without aggregation
#
explain extended
select * from mysql.help_topic where example = 'foo' having description is null;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
Warnings:
Note 1003 select `mysql`.`help_topic`.`help_topic_id` AS `help_topic_id`,`mysql`.`help_topic`.`name` AS `name`,`mysql`.`help_topic`.`help_category_id` AS `help_category_id`,`mysql`.`help_topic`.`description` AS `description`,`mysql`.`help_topic`.`example` AS `example`,`mysql`.`help_topic`.`url` AS `url` from `mysql`.`help_topic` where `mysql`.`help_topic`.`example` = 'foo' having 0
select * from mysql.help_topic where example = 'foo' having description is null;
help_topic_id name help_category_id description example url
#
# End of 5. tests
#
#
# Start of 10.0 tests
#
#
# Bug mdev-5160: two-way join with HAVING over the second table
#
CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM;

View File

@ -1472,7 +1472,7 @@ USE test;
End of 5.0 tests.
select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
MyISAM DEFAULT MyISAM storage engine NO NO NO
MyISAM DEFAULT Non-transactional engine with good performance and small data footprint NO NO NO
grant select on *.* to user3148@localhost;
connect con3148,localhost,user3148,,test;
connection con3148;

View File

@ -146,3 +146,19 @@ a
16
DROP TABLE t1;
End of 5.1 tests
#
# mdev-16235: SELECT over a table with LIMIT 0
#
EXPLAIN
SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
EXPLAIN
SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
help_topic_id name help_category_id description example url
End of 5.5 tests

View File

@ -406,7 +406,7 @@ LOCK TABLE t1 WRITE;
HANDLER t1 OPEN;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
HANDLER t1 READ FIRST;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
Got one of the listed errors
HANDLER t1 CLOSE;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
UNLOCK TABLES;

View File

@ -5598,6 +5598,21 @@ DROP DATABASE db1;
DROP DATABASE db2;
FOUND 1 /Database: mysql/ in bug11505.sql
#
# MDEV-15021: Fix the order in which routines are called
#
use test;
CREATE FUNCTION f() RETURNS INT RETURN 1;
CREATE VIEW v1 AS SELECT f();
# Running mysqldump -uroot test --routines --tables v1 > **vardir**/test.dmp
DROP VIEW v1;
DROP FUNCTION f;
# Running mysql -uroot test < **vardir**/test.dmp
#
# Cleanup after succesful import.
#
DROP VIEW v1;
DROP FUNCTION f;
#
# Test for --add-drop-trigger
#
use test;

View File

@ -255,3 +255,6 @@ Benchmark
# MDEV-4684 - Enhancement request: --init-command support for mysqlslap
#
DROP TABLE t1;
#
# Bug MDEV-15789 (Upstream: #80329): MYSQLSLAP OPTIONS --AUTO-GENERATE-SQL-GUID-PRIMARY and --AUTO-GENERATE-SQL-SECONDARY-INDEXES DONT WORK
#

View File

@ -766,3 +766,25 @@ b
NULL
DROP TABLE t1, t2;
End of 5.0 tests
#
# Start of 10.1 tests
#
#
# MDEV-16190 Server crashes in Item_null_result::field_type on SELECT with time field, ROLLUP and HAVING
#
CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('12:12:12');
SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
t COUNT(*)
12:12:12 1
DROP TABLE t1;
CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('12:12:12'),('12:12:13');
SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
t COUNT(*)
12:12:12 1
12:12:13 1
DROP TABLE t1;
#
# End of 10.1 tests
#

View File

@ -4365,7 +4365,46 @@ LINE3 3
drop table t1;
# End of 5.5 tests
#
# Start of 10.2 tests
# End of 10.0 tests
#
#
# MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command
# (the 10.1 part)
#
CREATE PROCEDURE p2 ()
BEGIN
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END;
/
CALL p2();
1
1
DROP PROCEDURE p2;
BEGIN NOT ATOMIC
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END;
/
1
1
BEGIN NOT ATOMIC
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
DEALLOCATE PREPARE stmt;
END;
/
BEGIN NOT ATOMIC
PREPARE stmt FROM 'SELECT 1';
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END;
/
1
1
#
# End of 10.1 tests
#
#
# MDEV-10709 Expressions as parameters to Dynamic SQL

View File

@ -237,14 +237,6 @@ a a
5 10
DROP TABLE temp1, temp2;
# MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDB.
CREATE TEMPORARY TABLE temp1 ENGINE=INNODB AS SELECT a FROM t1;
SELECT * FROM temp1;
a
1
DROP TABLE temp1;
# Disconnect and cleanup
disconnect con1;

View File

@ -356,13 +356,13 @@ and o_orderkey = l_orderkey
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
order by o_totalprice desc, o_orderdate;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort
1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 <subquery2>.l_orderkey 1 100.00 Using where
1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 <subquery2>.l_orderkey 4 100.00
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index
Warnings:
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `dbt3_s001`.`orders`.`o_orderkey` = `<subquery2>`.`l_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `<subquery2>`.`l_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
select
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
from customer, orders, lineitem
@ -1530,6 +1530,68 @@ t
10:00:00
11:00:00
DROP TABLE t1;
#
# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
# always pick materialization scan over materialization lookup
#
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int);
insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
(11,11),(12,12),(13,13),(14,14),(15,15);
set @@optimizer_use_condition_selectivity=2;
explain extended select * from t1 where a in (select max(a) from t1 group by b);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
select * from t1 where a in (select max(a) from t1 group by b);
a b
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
set @@optimizer_use_condition_selectivity=1;
explain extended select * from t1 where a in (select max(a) from t1 group by b);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
select * from t1 where a in (select max(a) from t1 group by b);
a b
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;

View File

@ -359,13 +359,13 @@ and o_orderkey = l_orderkey
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
order by o_totalprice desc, o_orderdate;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort
1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 <subquery2>.l_orderkey 1 100.00 Using where
1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 <subquery2>.l_orderkey 4 100.00
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00
Warnings:
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `dbt3_s001`.`orders`.`o_orderkey` = `<subquery2>`.`l_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `<subquery2>`.`l_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
select
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
from customer, orders, lineitem
@ -1540,6 +1540,68 @@ t
10:00:00
11:00:00
DROP TABLE t1;
#
# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
# always pick materialization scan over materialization lookup
#
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int);
insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
(11,11),(12,12),(13,13),(14,14),(15,15);
set @@optimizer_use_condition_selectivity=2;
explain extended select * from t1 where a in (select max(a) from t1 group by b);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
select * from t1 where a in (select max(a) from t1 group by b);
a b
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
set @@optimizer_use_condition_selectivity=1;
explain extended select * from t1 where a in (select max(a) from t1 group by b);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where `<subquery2>`.`max(a)` = `test`.`t1`.`a`
select * from t1 where a in (select max(a) from t1 group by b);
a b
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14
15 15
drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;

View File

@ -334,7 +334,7 @@ SELECT * FROM t1
WHERE (f1) IN (SELECT f1 FROM t2)
LIMIT 0;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Zero limit
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1
WHERE (f1) IN (SELECT f1 FROM t2)

View File

@ -1670,3 +1670,150 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func 1
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
DROP TABLE t1,t2;
#
# MDEV-16225: wrong resultset from query with semijoin=on
#
CREATE TABLE t1 (
`id` int(10) NOT NULL AUTO_INCREMENT,
`local_name` varchar(64) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
insert into t1(`id`,`local_name`) values
(1,'Cash Advance'),
(2,'Cash Advance'),
(3,'Rollover'),
(4,'AL Installment'),
(5,'AL Installment'),
(6,'AL Installment'),
(7,'AL Installment'),
(8,'AL Installment'),
(9,'AL Installment'),
(10,'Internet Payday'),
(11,'Rollover - Internet Payday'),
(12,'AL Monthly Installment'),
(13,'AL Semi-Monthly Installment');
explain
SELECT SQL_NO_CACHE t.id
FROM t1 t
WHERE (
t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
OR
(t.id IN (0,4,12,13,1,10,3,11))
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t index PRIMARY PRIMARY 4 NULL 13 Using where; Using index
2 MATERIALIZED <subquery3> ALL distinct_key NULL NULL NULL 8
2 MATERIALIZED A ALL PRIMARY NULL NULL NULL 13 Using where; Using join buffer (flat, BNL join)
3 MATERIALIZED B ALL PRIMARY NULL NULL NULL 13 Using where
SELECT SQL_NO_CACHE t.id
FROM t1 t
WHERE (
t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
OR
(t.id IN (0,4,12,13,1,10,3,11))
);
id
1
2
3
4
5
6
7
8
9
10
11
12
13
drop table t1;
#
# MDEV-15247: Crash when SET NAMES 'utf8' is set
#
CREATE TABLE t1 (
id_category int unsigned,
id_product int unsigned,
PRIMARY KEY (id_category,id_product)
) ENGINE=MyISAM;
INSERT INTO `t1` VALUES (31,216), (31,215), (31,214), (31,213), (31,212), (32,211), (32,210), (32,209), (32,208), (29,207), (30,315372), (2,161), (2,132), (33,315380), (31,315371), (29,315370), (29,315373), (29,315369), (29,315374), (29,315368), (29,315375), (29,315367), (29,183), (29,182), (30,177), (29,315376), (13,315365), (2,167), (2,315357), (2,164), (2,159), (2,131), (2,127), (14,315364), (27,315363), (29,205), (29,204), (29,203), (29,202), (29,201), (29,200), (29,199), (29,198), (29,197), (29,196), (29,195), (29,194), (29,193), (29,192), (29,191), (29,190), (29,189), (14,188), (29,187), (29,186), (29,185), (29,184), (29,315377), (29,315378), (29,181), (33,315379), (29,179), (30,178), (29,180), (30,176), (30,175), (30,174), (30,173), (30,172), (11,171), (27,315357), (23,108), (23,102);
CREATE TABLE t2 (
id_product int,
id_t2 int,
KEY id_t2 (id_t2),
KEY id_product (id_product)
) ENGINE=MyISAM;
INSERT INTO `t2` VALUES (11,31), (11,31), (11,31), (11,32), (11,32),
(11,32), (10,26), (11,32), (10,28), (11,32), (10,29), (11,33), (10,26),
(11,33), (10,27), (9,23), (11,32), (10,26), (8,18), (7,15), (11,32),
(10,28), (11,32), (10,28), (11,32), (10,29), (11,32), (10,29), (8,19),
(7,16), (8,18), (7,16), (8,20), (7,16), (11,32), (10,28), (8,19),
(7,16), (8,20), (7,16), (11,32), (10,29), (8,19), (7,16), (8,20),
(7,16), (10,27), (9,23), (10,27), (9,23), (10,27), (9,23), (11,32),
(10,27), (11,32), (10,27), (8,18), (7,15), (10,26), (9,24), (8,19),
(7,16), (10,26), (9,23), (8,19), (7,16), (8,18), (7,16), (8,18), (7,16),
(9,23), (8,18), (9,23), (8,19), (7,16), (7,16), (8,19), (7,16), (11,31),
(10,27), (9,24), (11,31), (10,27), (9,23), (8,19), (11,31), (10,26), (9,24),
(8,19), (11,31), (10,26), (9,25), (8,18), (11,31), (10,26), (9,23), (8,19),
(11,31), (10,26), (9,23), (8,18), (11,31), (10,30), (9,23), (8,18), (11,31),
(10,30), (9,23), (8,19), (11,31), (10,26), (9,25), (8,19), (8,21), (11,32),
(10,26), (9,22), (8,19), (11,32), (10,26), (9,22), (8,18), (11,32), (10,26),
(9,22), (8,20), (11,33), (10,26), (9,22), (8,19), (11,33), (10,26), (9,22),
(8,18), (11,33), (10,26), (9,22), (8,20), (11,32), (10,26), (9,24), (8,19),
(11,32), (10,26), (9,25), (8,19), (11,32), (10,26), (9,25), (8,18), (11,32),
(10,26), (9,23), (8,18), (11,32), (10,30), (9,23), (8,18), (11,32), (10,30),
(9,23), (8,19), (11,32), (10,26), (9,23), (8,19), (11,32), (10,27), (9,23),
(11,32), (10,27), (9,23), (11,32), (10,27), (9,23), (10,26), (9,22), (8,19),
(7,15), (10,26), (9,22), (8,20), (7,15), (10,26), (9,22), (8,18), (7,15),
(8,19), (10,26), (10,26), (11,33), (10,26), (11,33), (10,26), (11,33),
(10,27), (11,33), (10,27), (11,31), (10,26), (11,31), (10,26), (8,18),
(7,15), (9,23), (9,23), (9,24), (8,21), (7,15), (7,15), (7,15), (7,15),
(7,15), (7,15), (7,15), (7,15), (7,15), (8,18), (7,17), (8,18), (7,17), (8,19), (8,19);
CREATE TABLE t3 (
id_product int unsigned,
PRIMARY KEY (id_product)
) ENGINE=MyISAM;
INSERT INTO t3 VALUES
(102),(103),(104),(105),(106),(107),(108),(109),(110),
(315371),(315373),(315374),(315375),(315376),(315377),
(315378),(315379),(315380);
CREATE TABLE t4 (
id_product int not null,
id_shop int,
PRIMARY KEY (id_product,id_shop)
) ENGINE=MyISAM ;
INSERT INTO t4 VALUES
(202,1),(201,1),(200,1),(199,1),(198,1),(197,1),(196,1),(195,1),
(194,1),(193,1),(192,1),(191,1),(190,1),(189,1),(188,1),(187,1),
(186,1),(185,1),(184,1),(183,1),(182,1),(181,1),(179,1),(178,1),
(177,1),(176,1),(126,1),(315380,1);
CREATE TABLE t5 (id_product int) ENGINE=MyISAM;
INSERT INTO `t5` VALUES
(652),(668),(669),(670),(671),(673),(674),(675),(676),
(677),(679),(680),(681),(682),(683),(684),(685),(686);
explain
SELECT * FROM t3
JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1)
JOIN t1 ON (t1.id_product = t3.id_product)
LEFT JOIN t5 ON (t5.id_product = t3.id_product)
WHERE 1=1
AND t3.id_product IN (SELECT id_product FROM t2 t2_1 WHERE t2_1.id_t2 = 32)
AND t3.id_product IN (SELECT id_product FROM t2 t2_2 WHERE t2_2.id_t2 = 15)
AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2_3.id_t2 = 19)
AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23)
AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using index
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.id_product 1 Using index
1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 4 func 1 Using where
1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t1.id_product,const 1 Using where; Using index
1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where
1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
5 MATERIALIZED t2_4 range id_t2,id_product id_t2 5 NULL 18 Using index condition; Using where
4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 32 Using index condition; Using where
3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12
2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 50
6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 30 Using index condition; Using where
drop table t1,t2,t3,t4,t5;

View File

@ -77,9 +77,9 @@ explain select * from t4 where
t4.a in (select max(t2.a) from t1, t2 group by t2.b) and
t4.b in (select max(t2.a) from t1, t2 group by t2.b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 5
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 Using join buffer (flat, BNL join)
1 PRIMARY t4 ref a a 10 <subquery2>.max(t2.a),<subquery3>.max(t2.a) 12
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5
1 PRIMARY t4 ref a a 5 <subquery2>.max(t2.a) 12 Using index condition
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 test.t4.b 1
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
3 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary

Binary file not shown.

View File

@ -12,5 +12,3 @@
innodb_scrub : MDEV-8139 scrubbing does not work reliably
innodb_scrub_background : MDEV-8139 scrubbing does not work reliably
innodb-redo-badkey : MDEV-13893 / MDEV-12699 Improve crash recovery of corrupted data pages

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("mysqld: File .*");
call mtr.add_suppression("Plugin 'file_key_management' .*");
call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");

View File

@ -1,10 +1,6 @@
-- source include/have_innodb.inc
-- source include/innodb_page_size_small.inc
-- source include/have_file_key_management_plugin.inc
# embedded does not support restart
-- source include/not_embedded.inc
-- source include/not_valgrind.inc
# Avoid CrashReporter popup on Mac
-- source include/not_crashrep.inc
#
# MDEV-8770: Incorrect error message when importing page compressed tablespace
@ -28,7 +24,9 @@ create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes en
show warnings;
create table t2(c1 bigint not null, b char(200)) engine=innodb page_compressed=1 encrypted=yes encryption_key_id=4;
show warnings;
create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
let $kbs= `select floor(@@global.innodb_page_size/1024)`;
--replace_regex / key_block_size=\d+//i
eval create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4 key_block_size=$kbs;
show warnings;
create table t4(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
show warnings;
@ -89,6 +87,7 @@ ALTER TABLE t2 IMPORT TABLESPACE;
SHOW CREATE TABLE t2;
SELECT COUNT(*) FROM t2;
ALTER TABLE t3 IMPORT TABLESPACE;
--replace_regex / key_block_size=\d+//i
SHOW CREATE TABLE t3;
SELECT COUNT(*) FROM t3;
ALTER TABLE t4 IMPORT TABLESPACE;
@ -118,5 +117,5 @@ DROP TABLE t1,t2,t3,t4;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
eval SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
--enable_query_log

View File

@ -60,5 +60,3 @@ SELECT COUNT(1) FROM t2;
SELECT COUNT(1) FROM t3;
DROP TABLE t1, t2, t3;

View File

@ -6,7 +6,7 @@
call mtr.add_suppression("mysqld: File .*");
call mtr.add_suppression("Plugin 'file_key_management' .*");
call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");

View File

@ -1,5 +1,5 @@
if (!`SELECT count(*) FROM information_schema.plugins WHERE
plugin_name = 'federated' AND plugin_status = 'active' AND
plugin_description LIKE '%FederatedX%'`){
plugin_description LIKE '%transactions%'`){
skip Need FederatedX engine;
}

View File

@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'ARCHIVE';
ENGINE ARCHIVE
SUPPORT YES
COMMENT Archive storage engine
COMMENT gzip-compresses tables for a low storage footprint
TRANSACTIONS NO
XA NO
SAVEPOINTS NO

View File

@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'CSV';
ENGINE CSV
SUPPORT YES
COMMENT CSV storage engine
COMMENT Stores tables as CSV files
TRANSACTIONS NO
XA NO
SAVEPOINTS NO

View File

@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'FEDERATED';
ENGINE FEDERATED
SUPPORT YES
COMMENT FederatedX pluggable storage engine
COMMENT Allows to access tables on other MariaDB servers, supports transactions and more
TRANSACTIONS YES
XA NO
SAVEPOINTS YES

View File

@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
WHERE ENGINE = 'MyISAM';
ENGINE MyISAM
SUPPORT DEFAULT
COMMENT MyISAM storage engine
COMMENT Non-transactional engine with good performance and small data footprint
TRANSACTIONS NO
XA NO
SAVEPOINTS NO

View File

@ -27,6 +27,9 @@ galera_ssl_upgrade : MDEV-13549 Galera test failures
galera.MW-329 : wsrep_local_replays not stable
galera.MW-328A : have_deadlocks test not stable
query_cache : MDEV-15805 Test failure on galera.query_cache
MW-416 : MDEV-13549 Galera test failures
galera_wan : MDEV-13549 Galera test failures
MW-388 : MDEV-13549 Galera test failures
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

View File

@ -1,83 +0,0 @@
#
# Let's understand the topology.
# * Independent Master with server-id = 1
# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3
# node#1 act as slave to Independent Master with server-id = 1
# * Independent Slave with server-id = 4 replicating from galera node#2
#
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld]
log-slave-updates
log-bin=mysqld-bin
binlog-format=row
gtid-mode=on
enforce-gtid-consistency=true
[mysqld.1]
server-id=1
[mysqld.2]
server-id=2
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 15
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.3]
server-id=3
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 15
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.4]
server-id=4
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_MYPORT_4= @mysqld.4.port
NODE_MYSOCK_4= @mysqld.4.socket
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port

View File

@ -1,87 +0,0 @@
#
# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave
#
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld]
default-storage-engine=InnoDB
[mysqld.1]
server-id=1
binlog-format=row
log-bin=mysqld-bin
log_slave_updates
gtid-mode=on
enforce-gtid-consistency=true
event-scheduler=1
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 15
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.2]
server-id=2
binlog-format=row
log-bin=mysqld-bin
log_slave_updates
gtid-mode=on
enforce-gtid-consistency=true
event-scheduler=1
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 15
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.3]
server-id=3
replicate-ignore-db=test
replicate-wild-ignore-table=test.%
log-bin=mysqld-bin
log_slave_updates
gtid-mode=on
enforce-gtid-consistency=true
event-scheduler=1
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port

View File

@ -0,0 +1,114 @@
CREATE USER 'userMW416'@'localhost';
GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost';
SHOW GLOBAL STATUS LIKE 'wsrep_replicated';
Variable_name Value
wsrep_replicated 2
ALTER DATABASE db CHARACTER SET = utf8;
ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'db'
ALTER EVENT ev1 RENAME TO ev2;
ERROR 42000: Access denied for user 'userMW416'@'localhost' to database 'test'
ALTER FUNCTION fun1 COMMENT 'foo';
ERROR 42000: alter routine command denied to user 'userMW416'@'localhost' for routine 'test.fun1'
ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
Got one of the listed errors
ALTER PROCEDURE proc1 COMMENT 'foo';
Got one of the listed errors
ALTER SERVER srv OPTIONS (USER 'sally');
Got one of the listed errors
ALTER TABLE tbl DROP COLUMN col;
Got one of the listed errors
ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
Got one of the listed errors
ALTER VIEW vw AS SELECT 1;
Got one of the listed errors
CREATE DATABASE db;
Got one of the listed errors
CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1;
Got one of the listed errors
CREATE FUNCTION fun1() RETURNS int RETURN(1);
Got one of the listed errors
CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so';
Got one of the listed errors
CREATE PROCEDURE proc1() BEGIN END;
Got one of the listed errors
CREATE INDEX idx ON tbl(id);
Got one of the listed errors
CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
Got one of the listed errors
CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
Got one of the listed errors
CREATE TABLE t (i int);
Got one of the listed errors
CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
Got one of the listed errors
CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
Got one of the listed errors
CREATE VIEW vw AS SELECT 1;
Got one of the listed errors
DROP DATABASE db;
Got one of the listed errors
DROP EVENT ev;
Got one of the listed errors
DROP FUNCTION fun1;
Got one of the listed errors
DROP INDEX idx ON t0;
Got one of the listed errors
DROP LOGFILE GROUP lfg;
Got one of the listed errors
DROP PROCEDURE proc1;
Got one of the listed errors
DROP SERVEr srv;
Got one of the listed errors
DROP TABLE t0;
Got one of the listed errors
DROP TABLESPACE tblspc;
Got one of the listed errors
DROP TRIGGER trg;
Got one of the listed errors
DROP VIEW vw;
Got one of the listed errors
RENAME TABLE t0 TO t1;
Got one of the listed errors
TRUNCATE TABLE t0;
Got one of the listed errors
ALTER USER myuser PASSWORD EXPIRE;
Got one of the listed errors
CREATE USER myuser IDENTIFIED BY 'pass';
Got one of the listed errors
DROP USER myuser;
Got one of the listed errors
GRANT ALL ON *.* TO 'myuser';
Got one of the listed errors
RENAME USER myuser TO mariauser;
Got one of the listed errors
REVOKE SELECT ON test FROM myuser;
Got one of the listed errors
REVOKE ALL, GRANT OPTION FROM myuser;
Got one of the listed errors
REVOKE PROXY ON myuser FROM myuser;
Got one of the listed errors
ANALYZE TABLE db.tbl;
Got one of the listed errors
CHECK TABLE db.tbl;
Got one of the listed errors
CHECKSUM TABLE db.tbl;
Got one of the listed errors
OPTIMIZE TABLE db.tbl;
Got one of the listed errors
REPAIR TABLE db.tbl;
Got one of the listed errors
INSTALL PLUGIN plg SONAME 'plg.so';
Got one of the listed errors
UNINSTALL PLUGIN plg;
Got one of the listed errors
DROP USER 'userMW416'@'localhost';
SHOW DATABASES;
Database
information_schema
mtr
mysql
performance_schema
test
SHOW GLOBAL STATUS LIKE 'wsrep_replicated';
Variable_name Value
wsrep_replicated 3

View File

@ -0,0 +1,10 @@
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
SET SESSION wsrep_sync_wait = 0;
SHOW STATUS LIKE 'wsrep_cluster_status';
Variable_name Value
wsrep_cluster_status non-Primary
SET SESSION wsrep_sync_wait = default;
SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
SET SESSION wsrep_on=0;
CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");

View File

@ -1,13 +1,21 @@
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");
connection node_1;
CREATE USER 'sst';
GRANT ALL PRIVILEGES ON *.* TO 'sst';
SET GLOBAL wsrep_sst_auth = 'sst:';
connection node_2;
SET GLOBAL wsrep_sst_method = 'mysqldump';
connection node_1;
connection node_2;
connection node_1;
CREATE USER sslsst;
GRANT ALL PRIVILEGES ON *.* TO sslsst;
GRANT USAGE ON *.* TO sslsst REQUIRE SSL;
SET GLOBAL wsrep_sst_auth = 'sslsst:';
Performing State Transfer on a server that has been temporarily disconnected
connection node_1;
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
@ -17,6 +25,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
INSERT INTO t1 VALUES ('node1_committed_before');
INSERT INTO t1 VALUES ('node1_committed_before');
COMMIT;
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node2_committed_before');
@ -27,6 +36,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
COMMIT;
Unloading wsrep provider ...
SET GLOBAL wsrep_provider = 'none';
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_committed_during');
@ -41,6 +51,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
@ -48,6 +59,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
connection node_2;
Loading wsrep provider ...
SET AUTOCOMMIT=OFF;
START TRANSACTION;
@ -57,6 +69,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
INSERT INTO t1 VALUES ('node2_committed_after');
INSERT INTO t1 VALUES ('node2_committed_after');
COMMIT;
connection node_1;
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
@ -71,6 +84,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
INSERT INTO t1 VALUES ('node1_committed_after');
INSERT INTO t1 VALUES ('node1_committed_after');
COMMIT;
connection node_1a_galera_st_disconnect_slave;
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
@ -85,6 +99,7 @@ COUNT(*) = 0
1
COMMIT;
SET AUTOCOMMIT=ON;
connection node_1;
SELECT COUNT(*) = 35 FROM t1;
COUNT(*) = 35
1
@ -94,8 +109,10 @@ COUNT(*) = 0
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
connection node_1;
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
DROP USER sst;
connection node_2;
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
CALL mtr.add_suppression("Can't open and lock time zone table");
@ -103,5 +120,3 @@ 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");
DROP USER sslsst;
SET GLOBAL general_log = ON;
SET GLOBAL slow_query_log = ON;

View File

@ -1,5 +1,7 @@
connection node_1;
connection node_2;
connection node_1;
connection node_2;
connection node_2;
CREATE TABLE t1(i INT) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);

View File

@ -0,0 +1,134 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/wait_until_ready.inc
CREATE USER 'userMW416'@'localhost';
GRANT SELECT, INSERT, UPDATE ON test.* TO 'userMW416'@'localhost';
SHOW GLOBAL STATUS LIKE 'wsrep_replicated';
--connect userMW416, localhost, userMW416,, test, $NODE_MYPORT_1
--connection userMW416
# DDL
--error 1044
ALTER DATABASE db CHARACTER SET = utf8;
--error 1044
ALTER EVENT ev1 RENAME TO ev2;
--error 1370
ALTER FUNCTION fun1 COMMENT 'foo';
#--error 1044,1227
#ALTER INSTANCE ROTATE INNODB MASTER KEY;
--error 1044,1227
ALTER LOGFILE GROUP lfg ADD UNDOFILE 'file' ENGINE=InnoDB;
--error 1044,1227,1370
ALTER PROCEDURE proc1 COMMENT 'foo';
--error 1044,1227,1370
ALTER SERVER srv OPTIONS (USER 'sally');
--error 1044,1142,1227,1370
ALTER TABLE tbl DROP COLUMN col;
--error 1044,1227,1370
ALTER TABLESPACE tblspc DROP DATAFILE 'file' ENGINE=innodb;
--error 1044,1142,1227,1370
ALTER VIEW vw AS SELECT 1;
--error 1044,1227,1370
CREATE DATABASE db;
--error 1044,1227,1370
CREATE EVENT ev1 ON SCHEDULE AT CURRENT_TIMESTAMP DO SELECT 1;
--error 1044,1227,1370
CREATE FUNCTION fun1() RETURNS int RETURN(1);
--error 1044,1227,1370
CREATE FUNCTION fun1 RETURNS STRING SONAME 'funlib.so';
--error 1044,1227,1370
CREATE PROCEDURE proc1() BEGIN END;
--error 1044,1142,1227,1370
CREATE INDEX idx ON tbl(id);
--error 1044,1142,1227,1370
CREATE LOGFILE GROUP lfg ADD UNDOFILE 'undofile' ENGINE innodb;
--error 1044,1142,1227,1370
CREATE SERVER srv FOREIGN DATA WRAPPER 'fdw' OPTIONS (USER 'user');
--error 1044,1142,1227,1370
CREATE TABLE t (i int);
--error 1044,1142,1227,1370
CREATE TABLESPACE tblspc ADD DATAFILE 'file' ENGINE=innodb;
--error 1044,1142,1227,1370
CREATE TRIGGER trg BEFORE UPDATE ON t FOR EACH ROW BEGIN END;
--error 1044,1142,1227,1370
CREATE VIEW vw AS SELECT 1;
--error 1044,1142,1227,1370
DROP DATABASE db;
--error 1044,1142,1227,1370
DROP EVENT ev;
--error 1044,1142,1227,1370
DROP FUNCTION fun1;
--error 1044,1142,1227,1370
DROP INDEX idx ON t0;
--error 1044,1142,1227,1370,1064
DROP LOGFILE GROUP lfg;
--error 1044,1142,1227,1370
DROP PROCEDURE proc1;
--error 1044,1142,1227,1370
DROP SERVEr srv;
--error 1044,1142,1227,1370
DROP TABLE t0;
--error 1044,1142,1227,1370,1064
DROP TABLESPACE tblspc;
--error 1044,1142,1227,1360,1370
DROP TRIGGER trg;
--error 1044,1142,1227,1370
DROP VIEW vw;
--error 1044,1142,1227,1370
RENAME TABLE t0 TO t1;
--error 1044,1142,1227,1370
TRUNCATE TABLE t0;
# DCL
# account management
--error 1044,1142,1227,1370,1064
ALTER USER myuser PASSWORD EXPIRE;
--error 1044,1142,1227,1370
CREATE USER myuser IDENTIFIED BY 'pass';
--error 1044,1142,1227,1370
DROP USER myuser;
--error 1044,1045,1142,1227,1370
GRANT ALL ON *.* TO 'myuser';
--error 1044,1142,1227,1370
RENAME USER myuser TO mariauser;
--error 1044,1142,1227,1370
REVOKE SELECT ON test FROM myuser;
--error 1044,1142,1227,1370,1698
REVOKE ALL, GRANT OPTION FROM myuser;
--error 1044,1142,1227,1370,1698
REVOKE PROXY ON myuser FROM myuser;
# table maintenance
--error 1044,1142,1227,1370
ANALYZE TABLE db.tbl;
--error 1044,1142,1227,1370
CHECK TABLE db.tbl;
--error 1044,1142,1227,1370
CHECKSUM TABLE db.tbl;
--error 1044,1142,1227,1370
OPTIMIZE TABLE db.tbl;
--error 1044,1142,1227,1370
REPAIR TABLE db.tbl;
# plugin and user defined functions
--error 1044,1142,1227,1370
INSTALL PLUGIN plg SONAME 'plg.so';
--error 1044,1142,1227,1370
UNINSTALL PLUGIN plg;
--connection node_1
DROP USER 'userMW416'@'localhost';
SHOW DATABASES;
SHOW GLOBAL STATUS LIKE 'wsrep_replicated';

View File

@ -0,0 +1,38 @@
#
# The purpose of this test is to verify that if an exception is
# thrown from gcomm background thread, the provider terminates properly
# and wsrep_ready becomes 0.
#
--source include/have_innodb.inc
--source include/galera_cluster.inc
--source include/galera_have_debug_sync.inc
# Force node_2 gcomm background thread to terminate via exception.
--connection node_2
--let $wsrep_cluster_address = `SELECT @@wsrep_cluster_address`
# Setting gmcast.isolate=2 will force gcomm background thread to
# throw exception.
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_provider_options="gmcast.isolate=2";
# Wait until wsrep_ready becomes 0.
--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME ='wsrep_ready'
--source include/wait_condition.inc
# Wait until node_1 ends up in non-prim and rebootstrap the cluster.
--connection node_1
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
SHOW STATUS LIKE 'wsrep_cluster_status';
SET SESSION wsrep_sync_wait = default;
SET GLOBAL wsrep_provider_options="pc.bootstrap=1";
# Restart node_2
--connection node_2
SET SESSION wsrep_on=0;
--source include/restart_mysqld.inc
--connection node_2
CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2.");

View File

@ -5,6 +5,7 @@
--source include/galera_cluster.inc
--source include/big_test.inc
--source include/have_log_bin.inc
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
@ -93,6 +94,8 @@ END|
DELIMITER ;|
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1
@ -124,6 +127,13 @@ DELIMITER ;|
--connection node_2
SET SESSION wsrep_sync_wait = 0;
# Make sure that node_2 is not killed while TOIs are applied.
# Otherwhise we risk that grastate file is marked unsafe, and
# as a consequence the node cannot rejoin with IST.
--let $wait_condition = SELECT VARIABLE_VALUE > $wsrep_last_committed_before FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
--source include/wait_condition.inc
--source include/kill_galera.inc
--sleep 10
@ -172,9 +182,8 @@ SET SESSION wsrep_sync_wait = 0;
--source include/start_mysqld.inc
--connection node_1
--source include/wait_until_connected_again.inc
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $diff_servers = 1 2
--source include/diff_servers.inc

View File

@ -16,7 +16,7 @@ if (!`SELECT @@open_files_limit >= 1024`){
while ($count)
{
--disable_query_log
--let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB")`
--let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB")`
--eval $ddl_var
--enable_query_log
--dec $count
@ -37,7 +37,7 @@ START TRANSACTION;
while ($count)
{
--disable_query_log
--let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (DEFAULT)")`
--let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (1)")`
--eval $ddl_var
--enable_query_log
--dec $count

View File

@ -1,3 +1,4 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_mariabackup.inc

View File

@ -1,3 +1,4 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source suite/galera/include/galera_sst_set_mysqldump.inc

View File

@ -12,10 +12,6 @@ wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore
[mysqld]
wsrep_debug=ON
ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem
ssl-key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem
[client]
ssl-ca=@ENV.MYSQL_TEST_DIR/std_data/cacert.pem
ssl-cert=@ENV.MYSQL_TEST_DIR/std_data/client-cert.pem

View File

@ -5,9 +5,12 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_openssl.inc
--source include/have_ssl_communication.inc
--source suite/galera/include/galera_sst_set_mysqldump.inc
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--connection node_1
CREATE USER sslsst;
@ -18,12 +21,7 @@ SET GLOBAL wsrep_sst_auth = 'sslsst:';
--source suite/galera/include/galera_st_disconnect_slave.inc
--source include/auto_increment_offset_restore.inc
--source suite/galera/include/galera_sst_restore.inc
DROP USER sslsst;
--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;

View File

@ -1,3 +1,4 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--let $node_1=node_1

View File

@ -8,7 +8,7 @@ wsrep_debug=ON
[xtrabackup]
backup-locks
close-files
compact
#compact - disabled in xtrabackup 2.4, https://bugs.launchpad.net/percona-xtrabackup/+bug/1192834/comments/29
# compression requires qpress from the Percona repositories
# compress
# compress-threads=2

View File

@ -1,3 +1,4 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_xtrabackup.inc

View File

@ -11,6 +11,11 @@
--let $node_2=node_2
--source include/auto_increment_offset_save.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_2
--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address`

View File

@ -11,6 +11,7 @@ SET SESSION wsrep_sync_wait = 0;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
SET SESSION wsrep_sync_wait = DEFAULT;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1

View File

@ -50,6 +50,7 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
--enable_query_log
--source include/wait_until_connected_again.inc
SET SESSION wsrep_sync_wait = DEFAULT;
SELECT COUNT(*) = 1 FROM t1;
DROP TABLE t1;

View File

@ -373,7 +373,9 @@ connection con2;
send optimize table t1;
--sleep 1
connection default;
--disable_ps_protocol
handler t1 read next;
--enable_ps_protocol
handler t1 close;
connection con2;
reap;

View File

@ -0,0 +1,9 @@
create table t1 (i int);
handler test.t1 open handler_a;
flush status;
handler handler_a read first;
i
show status like 'Com_stmt_prepare%';
Variable_name Value
Com_stmt_prepare OK
drop table t1;

View File

@ -0,0 +1,11 @@
#
# MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed with PS protocol
#
create table t1 (i int);
handler test.t1 open handler_a;
flush status;
handler handler_a read first;
# handler...read must be prepared in --ps-protocol mode
--replace_result $PS_PROTOCOL OK
show status like 'Com_stmt_prepare%';
drop table t1;

View File

@ -40,6 +40,32 @@ _rowid _rowid skey sval
2 2 2 hey
drop table t1;
#
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
#
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MEMORY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
`name` char(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
id name
-1 dog
2 cat
DROP TABLE t1;
#
# End of 5.5 tests
#
#
# MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
#
SET @engine='MEMORY';
@ -159,3 +185,6 @@ id name
-1 dog
2 cat
DROP PROCEDURE autoinc_mdev15353_one;
#
# End of 10.2 tests
#

View File

@ -34,9 +34,34 @@ drop table t1;
# End of 4.1 tests
--echo #
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
--echo #
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MEMORY;
SHOW CREATE TABLE t1;
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
--echo #
SET @engine='MEMORY';
--source include/autoinc_mdev15353.inc
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -1,28 +0,0 @@
#
# BUG#27216817: INNODB: FAILING ASSERTION:
# PREBUILT->TABLE->N_MYSQL_HANDLES_OPENED == 1
#
source include/have_innodb.inc;
create table t1 (a int not null, b int not null) engine=innodb;
insert t1 values (1,2),(3,4);
lock table t1 write, t1 tr read;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
unlock tables;
alter table t1 drop primary key;
lock table t1 write;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
unlock tables;
alter table t1 drop primary key;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
drop table t1;

View File

@ -2745,6 +2745,35 @@ INSERT INTO t1 (b) VALUES ('');
ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
#
# Start of 5.5 tests
#
#
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
#
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=ARIA;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
`name` char(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
id name
-1 dog
2 cat
DROP TABLE t1;
#
# End of 5.5 tests
#
#
# BUG#47444 - --myisam_repair_threads > 1 can result in all index
# cardinalities=1
#

View File

@ -1989,6 +1989,30 @@ ALTER TABLE t1 ENABLE KEYS;
# Cleanup
DROP TABLE t1;
--echo #
--echo # Start of 5.5 tests
--echo #
--echo #
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
--echo #
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=ARIA;
SHOW CREATE TABLE t1;
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # BUG#47444 - --myisam_repair_threads > 1 can result in all index
--echo # cardinalities=1

View File

@ -0,0 +1,11 @@
create table t1 (a int) engine=innodb;
start transaction;
insert t1 values (1);
connect con2,localhost,root;
state from show engine innodb status
state from show processlist
disconnect con2;
connection default;
drop table t1;

View File

@ -0,0 +1,18 @@
#
# MDEV-15359 Thread stay in "cleaning up" status after finishing
#
source include/have_innodb.inc;
create table t1 (a int) engine=innodb;
start transaction;
insert t1 values (1);
let id=`select connection_id()`;
connect con2,localhost,root;
let s=query_get_value(show engine innodb status,Status,1);
disable_query_log;
eval select regexp_replace("$s", '(?s)^.*MySQL thread id $id,.*root([^\n]*)\n.*', '\\\\1') as `state from show engine innodb status`;
eval select state as `state from show processlist` from information_schema.processlist where id = $id;
enable_query_log;
disconnect con2;
connection default;
drop table t1;

View File

@ -610,8 +610,39 @@ a b
57 7
58 8
59 9
connection server_1;
DELETE FROM t1;
DELETE FROM t2;
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
connection server_2;
set global log_warnings=2;
BEGIN;
INSERT INTO t1 SET a=1;
connection server_1;
SET @save.binlog_format=@@session.binlog_format;
SET @@SESSION.binlog_format=row;
BEGIN;
INSERT INTO t1 SET a=1;
INSERT INTO t2 SET a=1;
COMMIT;
BEGIN;
DELETE FROM t2;
COMMIT;
connection server_2;
connection server_2;
ROLLBACK;
connection server_1;
SET @@SESSION.binlog_format= @save.binlog_format;
DELETE FROM t1;
DELETE FROM t2;
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
connection server_2;
include/stop_slave.inc
set global log_warnings=default;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc

View File

@ -484,10 +484,69 @@ SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
SELECT * FROM t1 WHERE a >= 40 ORDER BY a;
SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
# Clean up.
# partial cleanup to reuse the tables by following tests
--connection server_1
DELETE FROM t1;
DELETE FROM t2;
--source include/save_master_gtid.inc
--connection server_2
--source include/sync_with_master_gtid.inc
#
# MDEV-13577 optimistic parallel slave errors out to error log unnecessary
#
# The 1st of the following two trx:s a blocker on slave
--connection server_2
set global log_warnings=2;
BEGIN;
INSERT INTO t1 SET a=1;
--connection server_1
SET @save.binlog_format=@@session.binlog_format;
SET @@SESSION.binlog_format=row;
BEGIN;
INSERT INTO t1 SET a=1;
INSERT INTO t2 SET a=1;
COMMIT;
# This transaction is going to win optimistical race with above INSERT
# on slave while being depend on it. That means it will face a kind of temporary error
# and then will retry to succeed.
BEGIN;
DELETE FROM t2;
COMMIT;
# First make sure DELETE raced indeed to get stuck at retrying stage
# where it runs "realistically" now. There is nomore optimistic error
# in the errorlog, which is downgraded to the warning level (when
# --log-warnings > 1), see above suppression.
--connection server_2
--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
--source include/wait_condition.inc
# Next release the 1st trx to commit.
--connection server_2
ROLLBACK;
# MDEV-13577 local cleanup:
--connection server_1
SET @@SESSION.binlog_format= @save.binlog_format;
DELETE FROM t1;
DELETE FROM t2;
--source include/save_master_gtid.inc
--connection server_2
--source include/sync_with_master_gtid.inc
#
# Clean up.
#
--connection server_2
--source include/stop_slave.inc
set global log_warnings=default;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
--source include/start_slave.inc

View File

@ -40,7 +40,7 @@ sub start_test {
my $bin=$ENV{MTR_BINDIR} || '..';
return "Not run for embedded server" if $::opt_embedded_server;
return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake";
my ($ctest_vs)= $opt_vs_config ? "-C $opt_vs_config" : "";
my ($ctest_vs)= $::opt_vs_config ? "-C ".substr($::opt_vs_config,1) : "";
my (@ctest_list)= `cd "$bin" && ctest $ctest_vs --show-only --verbose`;
return "No ctest" if $?;

View File

@ -352,6 +352,16 @@ a b c
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
# MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
#
SHOW TABLES;
Tables_in_test
t1
SHOW CREATE TABLE t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
ALTER TABLE t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
#
# End of 5.5 tests
#
#

View File

@ -1,5 +1,7 @@
--source include/have_ucs2.inc
let $MYSQLD_DATADIR= `select @@datadir`;
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
@ -321,6 +323,20 @@ SELECT * FROM t1;
DROP TABLE t1;
SET sql_mode=DEFAULT;
--echo #
--echo # MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
--echo #
--copy_file std_data/frm/t1.frm $MYSQLD_DATADIR/test/t1.frm
SHOW TABLES;
--error ER_NOT_FORM_FILE
SHOW CREATE TABLE t1;
--error ER_NOT_FORM_FILE
ALTER TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.frm
--echo #
--echo # End of 5.5 tests
--echo #

View File

@ -207,6 +207,16 @@ Threads_connected 1
SHOW STATUS LIKE 'wsrep_thread_count';
Variable_name Value
wsrep_thread_count 11
set wsrep_on=0;
set wsrep_on=1;
create user test@localhost;
connect con1,localhost,test;
set auto_increment_increment=10;
set wsrep_on=0;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
disconnect con1;
connection default;
drop user test@localhost;
#
# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
#

View File

@ -118,6 +118,20 @@ sleep 3;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
#
# privileges for wsrep_on
#
set wsrep_on=0;
set wsrep_on=1;
create user test@localhost;
connect con1,localhost,test;
set auto_increment_increment=10;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set wsrep_on=0;
disconnect con1;
connection default;
drop user test@localhost;
--echo #
--echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
--echo #

View File

@ -1838,6 +1838,21 @@ ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN IF EXISTS c;
SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key
--echo #
CREATE TABLE t1 (
`ID` BIGINT(20) NOT NULL,
`RANK` MEDIUMINT(4) NOT NULL,
`CHECK_POINT` BIGINT(20) NOT NULL,
UNIQUE INDEX `HORIZON_UIDX01` (`ID`, `RANK`)
) ENGINE=InnoDB;
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
SHOW CREATE TABLE t1;
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
DROP TABLE t1;
--echo #
--echo # End of 10.0 tests
--echo #

View File

@ -398,6 +398,29 @@ select last_insert_id();
select * from t1;
drop table t1;
--echo #
--echo # End of 5.3 tests
--echo #
--echo #
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
--echo #
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
@ -405,3 +428,8 @@ drop table t1;
SET @engine='MyISAM';
--source include/autoinc_mdev15353.inc
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -745,6 +745,23 @@ set sql_mode=@save_sql_mode;
drop table t1;
--echo #
--echo # mdev-16235: impossible HAVING in query without aggregation
--echo #
explain extended
select * from mysql.help_topic where example = 'foo' having description is null;
select * from mysql.help_topic where example = 'foo' having description is null;
--echo #
--echo # End of 5. tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
--echo #
--echo # Bug mdev-5160: two-way join with HAVING over the second table
--echo #

View File

@ -115,3 +115,17 @@ SELECT a FROM t1 ORDER BY a LIMIT 2 OFFSET 14;
DROP TABLE t1;
--echo End of 5.1 tests
--echo #
--echo # mdev-16235: SELECT over a table with LIMIT 0
--echo #
EXPLAIN
SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
EXPLAIN
SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
--echo End of 5.5 tests

View File

@ -474,7 +474,7 @@ LOCK TABLE t1 WRITE;
--echo # HANDLER commands are not allowed in LOCK TABLES mode
--error ER_LOCK_OR_ACTIVE_TRANSACTION
HANDLER t1 OPEN;
--error ER_LOCK_OR_ACTIVE_TRANSACTION
--error ER_LOCK_OR_ACTIVE_TRANSACTION,ER_UNKNOWN_TABLE
HANDLER t1 READ FIRST;
--error ER_LOCK_OR_ACTIVE_TRANSACTION
HANDLER t1 CLOSE;

View File

@ -2635,6 +2635,28 @@ let SEARCH_PATTERN=Database: mysql;
exec $MYSQL_DUMP mysql func > $SEARCH_FILE;
source include/search_pattern_in_file.inc;
--echo #
--echo # MDEV-15021: Fix the order in which routines are called
--echo #
use test;
CREATE FUNCTION f() RETURNS INT RETURN 1;
CREATE VIEW v1 AS SELECT f();
--echo # Running mysqldump -uroot test --routines --tables v1 > **vardir**/test.dmp
--exec $MYSQL_DUMP -uroot test --routines --tables v1 > $MYSQLTEST_VARDIR/test.dmp
DROP VIEW v1;
DROP FUNCTION f;
--echo # Running mysql -uroot test < **vardir**/test.dmp
--exec $MYSQL -uroot test < $MYSQLTEST_VARDIR/test.dmp
--echo #
--echo # Cleanup after succesful import.
--echo #
DROP VIEW v1;
DROP FUNCTION f;
--echo #
--echo # Test for --add-drop-trigger
--echo #

View File

@ -80,3 +80,11 @@ DROP DATABASE bug58090;
--exec $MYSQL_SLAP --create-schema=test --init-command="CREATE TABLE t1(a INT)" --silent --concurrency=1 --iterations=1
DROP TABLE t1;
--echo #
--echo # Bug MDEV-15789 (Upstream: #80329): MYSQLSLAP OPTIONS --AUTO-GENERATE-SQL-GUID-PRIMARY and --AUTO-GENERATE-SQL-SECONDARY-INDEXES DONT WORK
--echo #
--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --create-schema=slap
--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-secondary-indexes=1 --create-schema=slap

View File

@ -404,3 +404,26 @@ SELECT DISTINCT b FROM t1, t2 GROUP BY a, b WITH ROLLUP;
DROP TABLE t1, t2;
--echo End of 5.0 tests
--echo #
--echo # Start of 10.1 tests
--echo #
--echo #
--echo # MDEV-16190 Server crashes in Item_null_result::field_type on SELECT with time field, ROLLUP and HAVING
--echo #
CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('12:12:12');
SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
DROP TABLE t1;
CREATE TABLE t1 (t TIME) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('12:12:12'),('12:12:13');
SELECT t, COUNT(*) FROM t1 GROUP BY t WITH ROLLUP HAVING t > '00:00:00';
DROP TABLE t1;
--echo #
--echo # End of 10.1 tests
--echo #

View File

@ -3875,7 +3875,58 @@ drop table t1;
--echo # End of 5.5 tests
--echo #
--echo # Start of 10.2 tests
--echo # End of 10.0 tests
--echo #
--echo #
--echo # MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command
--echo # (the 10.1 part)
--echo #
DELIMITER /;
CREATE PROCEDURE p2 ()
BEGIN
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END;
/
DELIMITER ;/
CALL p2();
DROP PROCEDURE p2;
DELIMITER /;
BEGIN NOT ATOMIC
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END;
/
DELIMITER ;/
DELIMITER /;
BEGIN NOT ATOMIC
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR PREPARE stmt FROM 'SELECT 1';
DEALLOCATE PREPARE stmt;
END;
/
DELIMITER ;/
DELIMITER /;
BEGIN NOT ATOMIC
PREPARE stmt FROM 'SELECT 1';
SET STATEMENT join_cache_level=CAST(CONCAT(_utf8'6',_latin1'') AS INT) FOR EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END;
/
DELIMITER ;/
--echo #
--echo # End of 10.1 tests
--echo #
--echo #
@ -4696,7 +4747,6 @@ DROP PROCEDURE p2;
DROP PROCEDURE p1;
DROP ROLE testrole;
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -240,15 +240,6 @@ UPDATE temp1,temp2 SET temp1.a = 5, temp2.a = 10;
SELECT * FROM temp1, temp2;
DROP TABLE temp1, temp2;
--echo
--echo # MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDB.
--echo
CREATE TEMPORARY TABLE temp1 ENGINE=INNODB AS SELECT a FROM t1;
SELECT * FROM temp1;
DROP TABLE temp1;
--echo
--echo # Disconnect and cleanup
--echo

View File

@ -1045,6 +1045,24 @@ SELECT * FROM (SELECT t FROM t1 WHERE d IS NULL) sq;
DROP TABLE t1;
--echo #
--echo # MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
--echo # always pick materialization scan over materialization lookup
--echo #
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int);
insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
(11,11),(12,12),(13,13),(14,14),(15,15);
set @@optimizer_use_condition_selectivity=2;
explain extended select * from t1 where a in (select max(a) from t1 group by b);
select * from t1 where a in (select max(a) from t1 group by b);
set @@optimizer_use_condition_selectivity=1;
explain extended select * from t1 where a in (select max(a) from t1 group by b);
select * from t1 where a in (select max(a) from t1 group by b);
drop table t1,t0;
set histogram_size=@save_histogram_size;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;

View File

@ -303,3 +303,132 @@ eval $q;
eval explain $q;
DROP TABLE t1,t2;
--echo #
--echo # MDEV-16225: wrong resultset from query with semijoin=on
--echo #
CREATE TABLE t1 (
`id` int(10) NOT NULL AUTO_INCREMENT,
`local_name` varchar(64) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
insert into t1(`id`,`local_name`) values
(1,'Cash Advance'),
(2,'Cash Advance'),
(3,'Rollover'),
(4,'AL Installment'),
(5,'AL Installment'),
(6,'AL Installment'),
(7,'AL Installment'),
(8,'AL Installment'),
(9,'AL Installment'),
(10,'Internet Payday'),
(11,'Rollover - Internet Payday'),
(12,'AL Monthly Installment'),
(13,'AL Semi-Monthly Installment');
explain
SELECT SQL_NO_CACHE t.id
FROM t1 t
WHERE (
t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
OR
(t.id IN (0,4,12,13,1,10,3,11))
);
SELECT SQL_NO_CACHE t.id
FROM t1 t
WHERE (
t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
OR
(t.id IN (0,4,12,13,1,10,3,11))
);
drop table t1;
--echo #
--echo # MDEV-15247: Crash when SET NAMES 'utf8' is set
--echo #
CREATE TABLE t1 (
id_category int unsigned,
id_product int unsigned,
PRIMARY KEY (id_category,id_product)
) ENGINE=MyISAM;
INSERT INTO `t1` VALUES (31,216), (31,215), (31,214), (31,213), (31,212), (32,211), (32,210), (32,209), (32,208), (29,207), (30,315372), (2,161), (2,132), (33,315380), (31,315371), (29,315370), (29,315373), (29,315369), (29,315374), (29,315368), (29,315375), (29,315367), (29,183), (29,182), (30,177), (29,315376), (13,315365), (2,167), (2,315357), (2,164), (2,159), (2,131), (2,127), (14,315364), (27,315363), (29,205), (29,204), (29,203), (29,202), (29,201), (29,200), (29,199), (29,198), (29,197), (29,196), (29,195), (29,194), (29,193), (29,192), (29,191), (29,190), (29,189), (14,188), (29,187), (29,186), (29,185), (29,184), (29,315377), (29,315378), (29,181), (33,315379), (29,179), (30,178), (29,180), (30,176), (30,175), (30,174), (30,173), (30,172), (11,171), (27,315357), (23,108), (23,102);
CREATE TABLE t2 (
id_product int,
id_t2 int,
KEY id_t2 (id_t2),
KEY id_product (id_product)
) ENGINE=MyISAM;
INSERT INTO `t2` VALUES (11,31), (11,31), (11,31), (11,32), (11,32),
(11,32), (10,26), (11,32), (10,28), (11,32), (10,29), (11,33), (10,26),
(11,33), (10,27), (9,23), (11,32), (10,26), (8,18), (7,15), (11,32),
(10,28), (11,32), (10,28), (11,32), (10,29), (11,32), (10,29), (8,19),
(7,16), (8,18), (7,16), (8,20), (7,16), (11,32), (10,28), (8,19),
(7,16), (8,20), (7,16), (11,32), (10,29), (8,19), (7,16), (8,20),
(7,16), (10,27), (9,23), (10,27), (9,23), (10,27), (9,23), (11,32),
(10,27), (11,32), (10,27), (8,18), (7,15), (10,26), (9,24), (8,19),
(7,16), (10,26), (9,23), (8,19), (7,16), (8,18), (7,16), (8,18), (7,16),
(9,23), (8,18), (9,23), (8,19), (7,16), (7,16), (8,19), (7,16), (11,31),
(10,27), (9,24), (11,31), (10,27), (9,23), (8,19), (11,31), (10,26), (9,24),
(8,19), (11,31), (10,26), (9,25), (8,18), (11,31), (10,26), (9,23), (8,19),
(11,31), (10,26), (9,23), (8,18), (11,31), (10,30), (9,23), (8,18), (11,31),
(10,30), (9,23), (8,19), (11,31), (10,26), (9,25), (8,19), (8,21), (11,32),
(10,26), (9,22), (8,19), (11,32), (10,26), (9,22), (8,18), (11,32), (10,26),
(9,22), (8,20), (11,33), (10,26), (9,22), (8,19), (11,33), (10,26), (9,22),
(8,18), (11,33), (10,26), (9,22), (8,20), (11,32), (10,26), (9,24), (8,19),
(11,32), (10,26), (9,25), (8,19), (11,32), (10,26), (9,25), (8,18), (11,32),
(10,26), (9,23), (8,18), (11,32), (10,30), (9,23), (8,18), (11,32), (10,30),
(9,23), (8,19), (11,32), (10,26), (9,23), (8,19), (11,32), (10,27), (9,23),
(11,32), (10,27), (9,23), (11,32), (10,27), (9,23), (10,26), (9,22), (8,19),
(7,15), (10,26), (9,22), (8,20), (7,15), (10,26), (9,22), (8,18), (7,15),
(8,19), (10,26), (10,26), (11,33), (10,26), (11,33), (10,26), (11,33),
(10,27), (11,33), (10,27), (11,31), (10,26), (11,31), (10,26), (8,18),
(7,15), (9,23), (9,23), (9,24), (8,21), (7,15), (7,15), (7,15), (7,15),
(7,15), (7,15), (7,15), (7,15), (7,15), (8,18), (7,17), (8,18), (7,17), (8,19), (8,19);
CREATE TABLE t3 (
id_product int unsigned,
PRIMARY KEY (id_product)
) ENGINE=MyISAM;
INSERT INTO t3 VALUES
(102),(103),(104),(105),(106),(107),(108),(109),(110),
(315371),(315373),(315374),(315375),(315376),(315377),
(315378),(315379),(315380);
CREATE TABLE t4 (
id_product int not null,
id_shop int,
PRIMARY KEY (id_product,id_shop)
) ENGINE=MyISAM ;
INSERT INTO t4 VALUES
(202,1),(201,1),(200,1),(199,1),(198,1),(197,1),(196,1),(195,1),
(194,1),(193,1),(192,1),(191,1),(190,1),(189,1),(188,1),(187,1),
(186,1),(185,1),(184,1),(183,1),(182,1),(181,1),(179,1),(178,1),
(177,1),(176,1),(126,1),(315380,1);
CREATE TABLE t5 (id_product int) ENGINE=MyISAM;
INSERT INTO `t5` VALUES
(652),(668),(669),(670),(671),(673),(674),(675),(676),
(677),(679),(680),(681),(682),(683),(684),(685),(686);
explain
SELECT * FROM t3
JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1)
JOIN t1 ON (t1.id_product = t3.id_product)
LEFT JOIN t5 ON (t5.id_product = t3.id_product)
WHERE 1=1
AND t3.id_product IN (SELECT id_product FROM t2 t2_1 WHERE t2_1.id_t2 = 32)
AND t3.id_product IN (SELECT id_product FROM t2 t2_2 WHERE t2_2.id_t2 = 15)
AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2_3.id_t2 = 19)
AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23)
AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26);
drop table t1,t2,t3,t4,t5;

View File

@ -244,7 +244,7 @@ const char *my_open_parent_dir_nosymlinks(const char *pathname, int *pdfd)
return pathname + (s - buf);
}
fd = openat(dfd, s, O_NOFOLLOW | O_PATH);
fd = openat(dfd, s, O_NOFOLLOW | O_PATH | O_CLOEXEC);
if (fd < 0)
goto err;

View File

@ -331,6 +331,22 @@ ELSE()
COMPONENT ${${file}_COMPONENT}
)
ENDFOREACH()
SET (wsrep_sst_rsync_wan ${CMAKE_CURRENT_BINARY_DIR}/wsrep_sst_rsync_wan)
ADD_CUSTOM_COMMAND(
OUTPUT ${wsrep_sst_rsync_wan}
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
wsrep_sst_rsync
wsrep_sst_rsync_wan
)
ADD_CUSTOM_TARGET(symlink_wsrep_sst_rsync
ALL
DEPENDS ${wsrep_sst_rsync_wan}
)
INSTALL(
FILES ${wsrep_sst_rsync_wan}
DESTINATION ${INSTALL_BINDIR}
COMPONENT Server
)
FOREACH(file ${WSREP_SOURCE})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
@ -344,7 +360,6 @@ ELSE()
COMPONENT ${${file}_COMPONENT}
)
ENDFOREACH()
ENDIF()
# Install libgcc as mylibgcc.a

View File

@ -35,12 +35,24 @@ case "$1" in
#
# Break address string into host:port/path parts
#
readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
readonly WSREP_SST_OPT_HOST_UNESCAPED=`echo "$WSREP_SST_OPT_HOST"|awk '{if(match($0,/^\[.*\]$/)) $0=substr($0,2,RLENGTH-2);print}'`
readonly WSREP_SST_OPT_ADDR_PORT=$(echo $WSREP_SST_OPT_ADDR | \
cut -d ']' -f 2 | cut -s -d ':' -f 2 | cut -d '/' -f 1)
case "${WSREP_SST_OPT_ADDR}" in
\[*)
# IPv6
addr_no_bracket=${WSREP_SST_OPT_ADDR#\[}
readonly WSREP_SST_OPT_HOST_UNESCAPED=${addr_no_bracket%%\]*}
readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]"
;;
*)
readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*}
readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST
;;
esac
remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST}}
remain=${remain#:}
readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*}
remain=${remain#*/}
readonly WSREP_SST_OPT_MODULE=${remain%%/*}
readonly WSREP_SST_OPT_PATH=${WSREP_SST_OPT_ADDR#*/}
readonly WSREP_SST_OPT_MODULE=${WSREP_SST_OPT_PATH%%/*}
remain=${WSREP_SST_OPT_PATH#*/}
readonly WSREP_SST_OPT_LSN=${remain%%/*}
remain=${remain#*/}
@ -120,10 +132,10 @@ done
readonly WSREP_SST_OPT_BYPASS
readonly WSREP_SST_OPT_BINLOG
if [ -n "${WSREP_SST_OPT_ADDR:-}" ]; then
if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then
if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then
if [ -n "$WSREP_SST_OPT_ADDR_PORT" -a "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
wsrep_log_error "port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR"
if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
echo "WSREP_SST: [ERROR] port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR" >&2
exit 2
fi
else

View File

@ -108,11 +108,6 @@ then
DROP PREPARE stmt;"
fi
# Retrieve the donor's @@global.gtid_binlog_state.
GTID_BINLOG_STATE=$(echo "SHOW GLOBAL VARIABLES LIKE 'gtid_binlog_state'" |\
$MYSQL_CLIENT $AUTH -S$WSREP_SST_OPT_SOCKET --disable-reconnect --connect_timeout=10 |\
tail -1 | awk -F ' ' '{ print $2 }')
MYSQL="$MYSQL_CLIENT $WSREP_SST_OPT_CONF "\
"$AUTH -h${WSREP_SST_OPT_HOST_UNESCAPED} "\
"-P$WSREP_SST_OPT_PORT --disable-reconnect --connect_timeout=10"
@ -126,12 +121,16 @@ tail -1 | awk -F ' ' '{ print $2 }')
SERVER_VERSION=$(echo "set statement wsrep_sync_wait=0 for SHOW VARIABLES LIKE 'version'" | $MYSQL |\
tail -1 | awk -F ' ' '{ print $2 }')
# Retrieve the donor's @@global.gtid_binlog_state.
GTID_BINLOG_STATE=$(echo "SHOW GLOBAL VARIABLES LIKE 'gtid_binlog_state'" | $MYSQL |\
tail -1 | awk -F ' ' '{ print $2 }')
RESET_MASTER=""
SET_GTID_BINLOG_STATE=""
SQL_LOG_BIN_OFF=""
# Safety check
if echo $SERVER_VERSION | grep '^10.' > /dev/null
if [ "${SERVER_VERSION%%.*}" != '5' ]
then
# If binary logging is enabled on the joiner node, we need to copy donor's
# gtid_binlog_state to joiner. In order to do that, a RESET MASTER must be
@ -146,7 +145,7 @@ then
fi
# NOTE: we don't use --routines here because we're dumping mysql.proc table
MYSQLDUMP="$MYSQLDUMP $AUTH -S$WSREP_SST_OPT_SOCKET \
MYSQLDUMP="$MYSQLDUMP $WSREP_SST_OPT_CONF $AUTH -S$WSREP_SST_OPT_SOCKET \
--add-drop-database --add-drop-table --skip-add-locks --create-options \
--disable-keys --extended-insert --skip-lock-tables --quick --set-charset \
--skip-comments --flush-privileges --all-databases --events"

View File

@ -2522,6 +2522,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
mysql->client_flag|= CLIENT_MULTI_RESULTS;
#ifdef HAVE_OPENSSL
if (mysql->options.ssl_key || mysql->options.ssl_cert ||
mysql->options.ssl_ca || mysql->options.ssl_capath ||
mysql->options.ssl_cipher)
mysql->options.use_ssl = 1;
if (mysql->options.use_ssl)
mysql->client_flag|= CLIENT_SSL;
#endif /* HAVE_OPENSSL */

View File

@ -462,8 +462,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
if (lock_object_name(thd, MDL_key::EVENT,
parse_data->dbname.str, parse_data->name.str))
@ -592,8 +591,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0))
DBUG_RETURN(TRUE);
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
/*
Turn off row binlogging of this statement and use statement-based so
@ -619,7 +617,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
#ifdef WITH_WSREP
error:
DBUG_RETURN(TRUE);
#endif
#endif /* WITH_WSREP */
}

View File

@ -3654,7 +3654,7 @@ void handler::print_error(int error, myf errflag)
*/
errflag|= ME_NOREFRESH;
}
}
}
/* if we got an OS error from a file-based engine, specify a path of error */
if (error < HA_ERR_FIRST && bas_ext()[0])
@ -4383,6 +4383,7 @@ handler::ha_create_partitioning_metadata(const char *name,
DBUG_ASSERT(m_lock_type == F_UNLCK ||
(!old_name && strcmp(name, table_share->path.str)));
return create_partitioning_metadata(name, old_name, action_flag);
}
@ -6185,6 +6186,12 @@ void ha_fake_trx_id(THD *thd)
DBUG_VOID_RETURN;
}
if (thd->wsrep_ws_handle.trx_id != WSREP_UNDEFINED_TRX_ID)
{
WSREP_DEBUG("fake trx id skipped: %lu", thd->wsrep_ws_handle.trx_id);
DBUG_VOID_RETURN;
}
/* Try statement transaction if standard one is not set. */
THD_TRANS *trans= (thd->transaction.all.ha_list) ? &thd->transaction.all :
&thd->transaction.stmt;

View File

@ -1360,7 +1360,7 @@ bool Item::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
ltime, fuzzydate,
field_name_or_null()))
goto err;
break;
return null_value= false;
}
case REAL_RESULT:
{
@ -1368,7 +1368,7 @@ bool Item::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
if (null_value || double_to_datetime_with_warn(value, ltime, fuzzydate,
field_name_or_null()))
goto err;
break;
return null_value= false;
}
case DECIMAL_RESULT:
{
@ -1377,7 +1377,7 @@ bool Item::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
decimal_to_datetime_with_warn(res, ltime, fuzzydate,
field_name_or_null()))
goto err;
break;
return null_value= false;
}
case STRING_RESULT:
{
@ -1387,15 +1387,20 @@ bool Item::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
str_to_datetime_with_warn(res->charset(), res->ptr(), res->length(),
ltime, fuzzydate))
goto err;
break;
return null_value= false;
}
default:
null_value= true;
DBUG_ASSERT(0);
}
return null_value= 0;
err:
return null_value|= make_zero_date(ltime, fuzzydate);
}
bool Item::make_zero_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
/*
if the item was not null and convertion failed, we return a zero date
if allowed, otherwise - null.
@ -1417,7 +1422,7 @@ err:
*/
ltime->time_type= MYSQL_TIMESTAMP_TIME;
}
return null_value|= !(fuzzydate & TIME_FUZZY_DATES);
return !(fuzzydate & TIME_FUZZY_DATES);
}
bool Item::get_seconds(ulonglong *sec, ulong *sec_part)
@ -3366,6 +3371,15 @@ my_decimal *Item_null::val_decimal(my_decimal *decimal_value)
}
bool Item_null::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
// following assert is redundant, because fixed=1 assigned in constructor
DBUG_ASSERT(fixed == 1);
make_zero_date(ltime, fuzzydate);
return (null_value= true);
}
Item *Item_null::safe_charset_converter(THD *thd, CHARSET_INFO *tocs)
{
return this;

View File

@ -705,6 +705,12 @@ protected:
bool fixed_length,
bool set_blob_packlength);
Field *create_tmp_field(bool group, TABLE *table, uint convert_int_length);
/*
This method is used if the item was not null but convertion to
TIME/DATE/DATETIME failed. We return a zero date if allowed,
otherwise - null.
*/
bool make_zero_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
void push_note_converted_to_negative_complement(THD *thd);
void push_note_converted_to_positive_complement(THD *thd);
@ -2766,6 +2772,7 @@ public:
longlong val_int();
String *val_str(String *str);
my_decimal *val_decimal(my_decimal *);
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
int save_in_field(Field *field, bool no_conversions);
int save_safe_in_field(Field *field);
bool send(Protocol *protocol, String *str);

View File

@ -2565,7 +2565,7 @@ bool MYSQL_LOG::open(
File file= -1;
my_off_t seek_offset;
bool is_fifo = false;
int open_flags= O_CREAT | O_BINARY;
int open_flags= O_CREAT | O_BINARY | O_CLOEXEC;
DBUG_ENTER("MYSQL_LOG::open");
DBUG_PRINT("enter", ("log_type: %d", (int) log_type_arg));
@ -3288,7 +3288,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
".index", opt);
if ((index_file_nr= mysql_file_open(m_key_file_log_index,
index_file_name,
O_RDWR | O_CREAT | O_BINARY,
O_RDWR | O_CREAT | O_BINARY | O_CLOEXEC,
MYF(MY_WME))) < 0 ||
mysql_file_sync(index_file_nr, MYF(MY_WME)) ||
init_io_cache(&index_file, index_file_nr,
@ -8966,14 +8966,14 @@ int TC_LOG_MMAP::open(const char *opt_name)
tc_log_page_size= my_getpagesize();
fn_format(logname,opt_name,mysql_data_home,"",MY_UNPACK_FILENAME);
if ((fd= mysql_file_open(key_file_tclog, logname, O_RDWR, MYF(0))) < 0)
if ((fd= mysql_file_open(key_file_tclog, logname, O_RDWR | O_CLOEXEC, MYF(0))) < 0)
{
if (my_errno != ENOENT)
goto err;
if (using_heuristic_recover())
return 1;
if ((fd= mysql_file_create(key_file_tclog, logname, CREATE_MODE,
O_RDWR, MYF(MY_WME))) < 0)
O_RDWR | O_CLOEXEC, MYF(MY_WME))) < 0)
goto err;
inited=1;
file_length= opt_tc_log_size;

View File

@ -5216,22 +5216,6 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
else
thd->variables.collation_database= thd->db_charset;
{
const CHARSET_INFO *cs= thd->charset();
/*
We cannot ask for parsing a statement using a character set
without state_maps (parser internal data).
*/
if (!cs->state_map)
{
rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
ER_THD(thd, ER_SLAVE_FATAL_ERROR),
"character_set cannot be parsed");
thd->is_slave_error= true;
goto end;
}
}
/*
Record any GTID in the same transaction, so slave state is
transactionally consistent.
@ -13036,6 +13020,16 @@ void issue_long_find_row_warning(Log_event_type type,
}
/*
HA_ERR_KEY_NOT_FOUND is a fatal error normally, but it's an expected
error in speculate optimistic mode, so use something non-fatal instead
*/
static int row_not_found_error(rpl_group_info *rgi)
{
return rgi->speculation != rpl_group_info::SPECULATE_OPTIMISTIC
? HA_ERR_KEY_NOT_FOUND : HA_ERR_RECORD_CHANGED;
}
/**
Locate the current row in event's table.
@ -13123,8 +13117,8 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
if (error)
{
DBUG_PRINT("info",("rnd_pos returns error %d",error));
if (error == HA_ERR_RECORD_DELETED)
error= HA_ERR_KEY_NOT_FOUND;
if (error == HA_ERR_RECORD_DELETED || error == HA_ERR_KEY_NOT_FOUND)
error= row_not_found_error(rgi);
table->file->print_error(error, MYF(0));
}
DBUG_RETURN(error);
@ -13189,8 +13183,8 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
HA_READ_KEY_EXACT)))
{
DBUG_PRINT("info",("no record matching the key found in the table"));
if (error == HA_ERR_RECORD_DELETED)
error= HA_ERR_KEY_NOT_FOUND;
if (error == HA_ERR_RECORD_DELETED || error == HA_ERR_KEY_NOT_FOUND)
error= row_not_found_error(rgi);
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
goto end;

View File

@ -199,7 +199,7 @@ int main(int argc, char **argv)
die("database creation failed");
}
printf("Creation of the database was successfull");
printf("Creation of the database was successful");
return 0;
}

View File

@ -146,6 +146,11 @@ static void die(const char *fmt, ...)
exit(1);
}
#define WRITE_LOG(fmt,...) {\
char log_buf[1024]; \
snprintf(log_buf,sizeof(log_buf), fmt, __VA_ARGS__);\
WriteFile(logfile_handle,log_buf, strlen(log_buf), 0 , 0);\
}
/*
spawn-like function to run subprocesses.
@ -187,17 +192,22 @@ static intptr_t run_tool(int wait_flag, const char *program,...)
{
char tmpdir[FN_REFLEN];
GetTempPath(FN_REFLEN, tmpdir);
sprintf_s(logfile_path, "%s\\mysql_upgrade_service.%s.log", tmpdir,
sprintf_s(logfile_path, "%smysql_upgrade_service.%s.log", tmpdir,
opt_service);
logfile_handle= CreateFile(logfile_path, GENERIC_WRITE, FILE_SHARE_READ,
NULL, TRUNCATE_EXISTING, 0, NULL);
if (!logfile_handle)
SECURITY_ATTRIBUTES attr= {0};
attr.nLength= sizeof(SECURITY_ATTRIBUTES);
attr.bInheritHandle= TRUE;
logfile_handle= CreateFile(logfile_path, FILE_APPEND_DATA,
FILE_SHARE_READ|FILE_SHARE_WRITE, &attr, CREATE_ALWAYS, 0, NULL);
if (logfile_handle == INVALID_HANDLE_VALUE)
{
die("Cannot open log file %s, windows error %u",
logfile_path, GetLastError());
}
}
WRITE_LOG("Executing %s\r\n", cmdline);
/* Start child process */
STARTUPINFO si= {0};
si.cb= sizeof(si);
@ -458,7 +468,7 @@ int main(int argc, char **argv)
log("Phase 3/8: Starting mysqld for upgrade");
mysqld_process= (HANDLE)run_tool(P_NOWAIT, mysqld_path,
defaults_file_param, "--skip-networking", "--skip-grant-tables",
"--enable-named-pipe", socket_param, NULL);
"--enable-named-pipe", socket_param,"--skip-slave-start", NULL);
if (mysqld_process == INVALID_HANDLE_VALUE)
{

View File

@ -5947,6 +5947,7 @@ bool JOIN::choose_tableless_subquery_plan()
functions produce empty subquery result. There is no need to further
rewrite the subquery because it will not be executed at all.
*/
exec_const_cond= 0;
return FALSE;
}
@ -5978,6 +5979,6 @@ bool JOIN::choose_tableless_subquery_plan()
tmp_having= having;
}
}
exec_const_cond= conds;
exec_const_cond= zero_result_cause ? 0 : conds;
return FALSE;
}

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