Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Apr 13, 2021
2 parents 450c017 + e262eb1 commit 6e6318b
Show file tree
Hide file tree
Showing 40 changed files with 566 additions and 131 deletions.
9 changes: 9 additions & 0 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ then
sed '/Package: mariadb-plugin-cassandra/,/^$/d' -i debian/control
fi

# From Debian Stretch/Ubuntu Bionic onwards dh-systemd is just an empty
# transitional metapackage and the functionality was merged into debhelper.
# In Ubuntu Hirsute is was completely removed, so it can't be referenced anymore.
# Keep using it only on Debian Jessie and Ubuntu Xenial.
if apt-cache madison dh-systemd | grep 'dh-systemd' >/dev/null 2>&1
then
sed 's/debhelper (>= 9.20160709~),/debhelper (>= 9), dh-systemd,/' -i debian/control
fi

# Mroonga, TokuDB never built on Travis CI anyway, see build flags above
if [[ $TRAVIS ]]
then
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: bison,
chrpath,
cmake (>= 2.7),
debhelper (>= 9),
debhelper (>= 9.20160709~),
dh-apparmor,
dh-exec,
dh-systemd,
Expand Down
8 changes: 8 additions & 0 deletions extra/mariabackup/backup_mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include <mysql.h>
#include <mysqld.h>
#include <my_sys.h>
#include <stdlib.h>
#include <string.h>
#include <limits>
#include "common.h"
Expand Down Expand Up @@ -108,6 +109,13 @@ xb_mysql_connect()
return(NULL);
}

#if !defined(DONT_USE_MYSQL_PWD)
if (!opt_password)
{
opt_password=getenv("MYSQL_PWD");
}
#endif

if (!opt_secure_auth) {
mysql_options(connection, MYSQL_SECURE_AUTH,
(char *) &opt_secure_auth);
Expand Down
7 changes: 0 additions & 7 deletions extra/mariabackup/innobackupex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA

#include <my_global.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mysql.h>
#include <my_dir.h>
Expand Down Expand Up @@ -905,12 +904,6 @@ ibx_init()

opt_user = opt_ibx_user;
opt_password = opt_ibx_password;
#if !defined(DONT_USE_MYSQL_PWD)
if (!opt_password)
{
opt_password=getenv("MYSQL_PWD");
}
#endif
opt_host = opt_ibx_host;
opt_defaults_group = opt_ibx_defaults_group;
opt_socket = opt_ibx_socket;
Expand Down
16 changes: 9 additions & 7 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1809,33 +1809,33 @@ static int prepare_export()

// Process defaults-file , it can have some --lc-language stuff,
// which is* unfortunately* still necessary to get mysqld up
if (strncmp(orig_argv1,"--defaults-file=",16) == 0)
if (strncmp(orig_argv1,"--defaults-file=", 16) == 0)
{
snprintf(cmdline, sizeof cmdline,
IF_WIN("\"","") "\"%s\" --mysqld \"%s\" "
IF_WIN("\"","") "\"%s\" --mysqld \"%s\""
" --defaults-extra-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
" --innodb --innodb-fast-shutdown=0 --loose-partition"
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
" --console --skip-log-error --skip-log-bin --bootstrap %s < "
" --console --skip-log-error --skip-log-bin --bootstrap %s< "
BOOTSTRAP_FILENAME IF_WIN("\"",""),
mariabackup_exe,
orig_argv1, (my_defaults_group_suffix?my_defaults_group_suffix:""),
xtrabackup_use_memory,
(srv_force_recovery ? "--innodb-force-recovery=1" : ""));
(srv_force_recovery ? "--innodb-force-recovery=1 " : ""));
}
else
{
snprintf(cmdline, sizeof cmdline,
IF_WIN("\"","") "\"%s\" --mysqld"
IF_WIN("\"","") "\"%s\" --mysqld"
" --defaults-file=./backup-my.cnf --defaults-group-suffix=%s --datadir=."
" --innodb --innodb-fast-shutdown=0 --loose-partition"
" --innodb_purge_rseg_truncate_frequency=1 --innodb-buffer-pool-size=%llu"
" --console --log-error= --skip-log-bin --bootstrap %s < "
" --console --log-error= --skip-log-bin --bootstrap %s< "
BOOTSTRAP_FILENAME IF_WIN("\"",""),
mariabackup_exe,
(my_defaults_group_suffix?my_defaults_group_suffix:""),
xtrabackup_use_memory,
(srv_force_recovery ? "--innodb-force-recovery=1" : ""));
(srv_force_recovery ? "--innodb-force-recovery=1 " : ""));
}

msg("Prepare export : executing %s\n", cmdline);
Expand Down Expand Up @@ -6559,6 +6559,8 @@ int main(int argc, char **argv)
{
char **client_defaults, **server_defaults;

my_getopt_prefix_matching= 0;

if (get_exepath(mariabackup_exe,FN_REFLEN, argv[0]))
strncpy(mariabackup_exe,argv[0], FN_REFLEN-1);

Expand Down
30 changes: 19 additions & 11 deletions mysql-test/lib/mtr_report.pm
Original file line number Diff line number Diff line change
Expand Up @@ -497,23 +497,21 @@ sub mtr_report_stats ($$$$) {
$test_time = sprintf("%.3f", $test->{timer} / 1000);
$test->{'name'} =~ s/$current_suite\.//;

my $test_result;

# if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
if ($test->{'retries'} > 0) {
$test_result = "MTR_RES_FAILED";
my $combinations;
if (defined($test->{combinations})){
$combinations = join ',', sort @{$test->{combinations}};
} else {
$test_result = $test->{'result'};
$combinations = "";
}

$xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test_result" time="$test_time");
$xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" ).
qq(status="$test->{'result'}" time="$test_time" combinations="$combinations");

my $comment = $test->{'comment'};
$comment =~ s/[\"]//g;
my $comment= replace_special_symbols($test->{'comment'});

# if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML
if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'} > 0) {
if ($test->{'result'} eq "MTR_RES_FAILED") {
my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'};
$logcontents= $logcontents.$test->{'warnings'}."\n";
# remove any double ] that would end the cdata
$logcontents =~ s/]]/\x{fffd}/g;
# replace wide characters that aren't allowed in XML 1.0
Expand Down Expand Up @@ -576,6 +574,16 @@ sub mtr_print_line () {
print '-' x 74 . "\n";
}

sub replace_special_symbols($) {
my $text= shift;
$text =~ s/&/&#38;/g;
$text =~ s/'/&#39;/g;
$text =~ s/"/&#34;/g;
$text =~ s/</&lt;/g;
$text =~ s/>/&gt;/g;
return $text;
}


sub mtr_print_thick_line {
my $char= shift || '=';
Expand Down
27 changes: 27 additions & 0 deletions mysql-test/main/derived_opt.result
Original file line number Diff line number Diff line change
Expand Up @@ -540,4 +540,31 @@ id select_type table type possible_keys key key_len ref rows Extra
set join_cache_level=default;
set optimizer_switch= @save_optimizer_switch;
DROP TABLE t1,t2;
set @save_optimizer_switch= @@optimizer_switch;
set optimizer_switch="derived_merge=on";
CREATE TABLE t1 (id int, d2 datetime, id1 int) ;
insert into t1 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',3);
CREATE TABLE t2 (id int, d1 datetime, id1 int) ;
insert into t2 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',2);
prepare stmt from "
SELECT * from
(SELECT min(d2) AS d2, min(d1) AS d1 FROM
(SELECT t1.d2 AS d2, (SELECT t2.d1
FROM t2 WHERE t1.id1 = t2.id1
ORDER BY t2.id DESC LIMIT 1) AS d1
FROM t1
) dt2
) ca
ORDER BY ca.d2;";
execute stmt;
d2 d1
2020-01-01 10:10:10 2020-01-01 10:10:10
execute stmt;
d2 d1
2020-01-01 10:10:10 2020-01-01 10:10:10
set optimizer_switch= @save_optimizer_switch;
DROP TABLE t1, t2;
#
# End of 10.3 tests
#
set optimizer_switch=@exit_optimizer_switch;
33 changes: 33 additions & 0 deletions mysql-test/main/derived_opt.test
Original file line number Diff line number Diff line change
Expand Up @@ -406,5 +406,38 @@ set optimizer_switch= @save_optimizer_switch;

DROP TABLE t1,t2;

#
# MDEV-25182: Complex query in Store procedure corrupts results
#
set @save_optimizer_switch= @@optimizer_switch;
set optimizer_switch="derived_merge=on";

CREATE TABLE t1 (id int, d2 datetime, id1 int) ;
insert into t1 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',3);

CREATE TABLE t2 (id int, d1 datetime, id1 int) ;
insert into t2 values (1,'2020-01-01 10:10:10',1),(2,'2020-01-01 10:10:10',2),(3,'2020-01-01 10:10:10',2);

prepare stmt from "
SELECT * from
(SELECT min(d2) AS d2, min(d1) AS d1 FROM
(SELECT t1.d2 AS d2, (SELECT t2.d1
FROM t2 WHERE t1.id1 = t2.id1
ORDER BY t2.id DESC LIMIT 1) AS d1
FROM t1
) dt2
) ca
ORDER BY ca.d2;";

execute stmt;
execute stmt;

set optimizer_switch= @save_optimizer_switch;
DROP TABLE t1, t2;

--echo #
--echo # End of 10.3 tests
--echo #

# The following command must be the last one the file
set optimizer_switch=@exit_optimizer_switch;
8 changes: 4 additions & 4 deletions mysql-test/main/mysqldump-nl.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ create procedure sp() select * from `v1
flush tables;
use test;

exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1
exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1
1tsetlqsym';

exec $MYSQL_DUMP --compact --comment --routines --add-drop-database --databases 'mysqltest1
exec $MYSQL_DUMP --compact --comments --routines --add-drop-database --databases 'mysqltest1
1tsetlqsym' | $MYSQL;

show tables from `mysqltest1
Expand All @@ -45,11 +45,11 @@ create database `test\``

show databases like 'test%';

exec $MYSQL_DUMP --compact --comment --add-drop-database --databases 'test`' 'test\`
exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\`
\! ls
#';

exec $MYSQL_DUMP --compact --comment --add-drop-database --databases 'test`' 'test\`
exec $MYSQL_DUMP --compact --comments --add-drop-database --databases 'test`' 'test\`
\! ls
#' | $MYSQL;

Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/parser_not_embedded.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ select 7 as expected, /*!01000 1 + /*!01000 8 + /*!01000 error */ 16 + */ 2 + */
select 4 as expected, /* 1 + /*!01000 8 + */ 2 + */ 4;
EOF

--exec $MYSQL --comment --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql
--exec $MYSQL --comments --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql
--remove_file $MYSQLTEST_VARDIR/tmp/bug39559.sql

--echo # Bug#46527 "COMMIT AND CHAIN RELEASE does not make sense"
Expand Down
37 changes: 37 additions & 0 deletions mysql-test/main/ps.result
Original file line number Diff line number Diff line change
Expand Up @@ -5496,5 +5496,42 @@ id select_type table type possible_keys key key_len ref rows Extra
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
#
# MDEV-25108: Running of the EXPLAIN EXTENDED statement produces extra warning
# in case it is executed in PS (prepared statement) mode
#
CREATE TABLE t1 (c int);
CREATE TABLE t2 (d int);
# EXPLAIN EXTENDED in regular way (not PS mode)
EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
SHOW WARNINGS;
Level Code Message
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
# Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings
# and their content must be the same as in case running the statement
# in regular way
PREPARE stmt FROM "EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1";
Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 Const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
SHOW WARNINGS;
Level Code Message
Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2;
#
# End of 10.2 tests
#
20 changes: 20 additions & 0 deletions mysql-test/main/ps.test
Original file line number Diff line number Diff line change
Expand Up @@ -4963,6 +4963,26 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;

--echo #
--echo # MDEV-25108: Running of the EXPLAIN EXTENDED statement produces extra warning
--echo # in case it is executed in PS (prepared statement) mode
--echo #
CREATE TABLE t1 (c int);
CREATE TABLE t2 (d int);

--echo # EXPLAIN EXTENDED in regular way (not PS mode)
EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
SHOW WARNINGS;

--echo # Now run the same EXPLAIN EXTENDED in PS mode. Number of warnings
--echo # and their content must be the same as in case running the statement
--echo # in regular way
PREPARE stmt FROM "EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1";
EXECUTE stmt;
SHOW WARNINGS;

DEALLOCATE PREPARE stmt;
DROP TABLE t1, t2;
--echo #
--echo # End of 10.2 tests
--echo #
10 changes: 7 additions & 3 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,13 @@ ($$$)

rename $log_file_name, $log_file_name.".failed";
}
delete($result->{result});
$result->{retries}= $retries+1;
$result->write_test($sock, 'TESTCASE');
{
local @$result{'retries', 'result'};
delete $result->{result};
$result->{retries}= $retries+1;
$result->write_test($sock, 'TESTCASE');
}
push(@$completed, $result);
next;
}
}
Expand Down
2 changes: 0 additions & 2 deletions mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600
MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002
MW-329 : MDEV-19962 Galera test failure on MW-329
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_concurrent_ctas : MDEV-24842 Galera test failure on galera_concurrent_ctas
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_mdl_race : MDEV-21524: galera.galera_mdl_race MTR failed: query 'reap' succeeded - should have failed with errno 1213
galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails
galera_partition : MDEV-21806: galera.galera_partition MTR failed: failed to recover from DONOR state
galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim
galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key
galera_var_node_address : MDEV-20485 Galera test failure
galera_wan : MDEV-17259 Test failure on galera.galera_wan
partition : MDEV-19958 Galera test failure on galera.partition
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/galera/r/galera_var_sst_auth.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
connection node_1;
connection node_2;
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
********
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
!include ../galera_2nodes.cnf

[mysqld.1]
auto_increment_offset=1

[mysqld.2]
auto_increment_offset=2
5 changes: 0 additions & 5 deletions mysql-test/suite/galera/t/galera_var_sst_auth.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@ wsrep_sst_auth=root:

[mysqld.2]
wsrep_sst_auth=root:





Loading

0 comments on commit 6e6318b

Please sign in to comment.