Skip to content

Commit

Permalink
Merge branch '10.2' into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed May 11, 2018
2 parents 33721d9 + 1d411a8 commit c9717dc
Show file tree
Hide file tree
Showing 140 changed files with 2,186 additions and 2,420 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pcre/testdata/greppatN4 -text
*.MYD binary
*.MYI binary
*.class binary
*.jar binary

*.c diff=cpp
*.h diff=cpp
Expand Down
1 change: 1 addition & 0 deletions debian/mariadb-server-10.3.install
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ usr/bin/wsrep_sst_xtrabackup-v2
usr/lib/mysql/plugin/auth_ed25519.so
usr/lib/mysql/plugin/auth_pam.so
usr/lib/mysql/plugin/auth_socket.so
usr/lib/mysql/plugin/disks.so
usr/lib/mysql/plugin/file_key_management.so
usr/lib/mysql/plugin/ha_archive.so
usr/lib/mysql/plugin/ha_blackhole.so
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ELSE()
SET(NT_SERVICE_SOURCE)
ENDIF()

ADD_DEFINITIONS(-DPCRE_STATIC=1)
ADD_DEFINITIONS(-DPCRE_STATIC=1 -DHAVE_OPENSSL=1)

MYSQL_ADD_EXECUTABLE(mariabackup
xtrabackup.cc
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/backup_mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ time_t history_lock_time;

MYSQL *mysql_connection;

my_bool opt_ssl_verify_server_cert;
extern my_bool opt_ssl_verify_server_cert, opt_use_ssl;

MYSQL *
xb_mysql_connect()
Expand Down
16 changes: 9 additions & 7 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ static ulong max_buf_pool_modified_pct;
/* Ignored option (--log) for MySQL option compatibility */
static char* log_ignored_opt;


extern my_bool opt_use_ssl;
my_bool opt_ssl_verify_server_cert;

/* === metadata of backup === */
#define XTRABACKUP_METADATA_FILENAME "xtrabackup_checkpoints"
char metadata_type[30] = ""; /*[full-backuped|log-applied|incremental]*/
Expand Down Expand Up @@ -334,9 +338,6 @@ uint opt_safe_slave_backup_timeout = 0;

const char *opt_history = NULL;

#if defined(HAVE_OPENSSL)
my_bool opt_ssl_verify_server_cert = FALSE;
#endif

char mariabackup_exe[FN_REFLEN];
char orig_argv1[FN_REFLEN];
Expand Down Expand Up @@ -589,6 +590,7 @@ typedef struct {
} data_thread_ctxt_t;

/* ======== for option and variables ======== */
#include <../../client/client_priv.h>

enum options_xtrabackup
{
Expand Down Expand Up @@ -649,8 +651,6 @@ enum options_xtrabackup
OPT_INNODB_LOG_CHECKSUMS,
OPT_XTRA_INCREMENTAL_FORCE_SCAN,
OPT_DEFAULTS_GROUP,
OPT_OPEN_FILES_LIMIT,
OPT_PLUGIN_DIR,
OPT_PLUGIN_LOAD,
OPT_INNODB_ENCRYPT_LOG,
OPT_CLOSE_FILES,
Expand Down Expand Up @@ -1030,9 +1030,9 @@ struct my_option xb_client_options[] =
{"secure-auth", OPT_XB_SECURE_AUTH, "Refuse client connecting to server if it"
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},

#define MYSQL_CLIENT
#include "sslopt-longopts.h"

#undef MYSQL_CLIENT

{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
Expand Down Expand Up @@ -1570,7 +1570,9 @@ xb_get_one_option(int optid,
}
}
break;
#define MYSQL_CLIENT
#include "sslopt-case.h"
#undef MYSQL_CLIENT

case '?':
usage();
Expand Down
2 changes: 1 addition & 1 deletion include/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ my_bool my_hash_init2(HASH *hash, uint growth_size, CHARSET_INFO *charset,
uint flags);
void my_hash_free(HASH *tree);
void my_hash_reset(HASH *hash);
uchar *my_hash_element(HASH *hash, ulong idx);
uchar *my_hash_element(HASH *hash, size_t idx);
uchar *my_hash_search(const HASH *info, const uchar *key, size_t length);
uchar *my_hash_search_using_hash_value(const HASH *info,
my_hash_value_type hash_value,
Expand Down
14 changes: 6 additions & 8 deletions mysql-test/lib/My/SafeProcess/safe_process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static void die(const char* fmt, ...)
}


static void kill_child(bool was_killed)
static int kill_child(bool was_killed)
{
int status= 0;

Expand All @@ -108,15 +108,15 @@ static void kill_child(bool was_killed)
exit_code= WEXITSTATUS(status);
message("Child exit: %d", exit_code);
// Exit with exit status of the child
exit(exit_code);
return exit_code;
}

if (WIFSIGNALED(status))
message("Child killed by signal: %d", WTERMSIG(status));

exit(exit_code);
return exit_code;
}
exit(5);
return 5;
}


Expand All @@ -136,7 +136,7 @@ extern "C" void handle_signal(int sig)
terminated= 1;

if (child_pid > 0)
kill_child(sig == SIGCHLD);
_exit(kill_child(sig == SIGCHLD));

// Ignore further signals
signal(SIGTERM, SIG_IGN);
Expand Down Expand Up @@ -300,8 +300,6 @@ int main(int argc, char* const argv[] )
/* Wait for parent or child to die */
sleep(1);
}
kill_child(0);

return 4;
return kill_child(0);
}

13 changes: 13 additions & 0 deletions mysql-test/main/assign_key_cache.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set global my_cache.key_buffer_size = 1024*1024;
create table t1 (i int) engine=myisam partition by hash (i) partitions 2;
xa start 'xid';
cache index t1 partition (non_existing_partition) in my_cache;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache error Error in list of partitions to test.t1
cache index t1 partition (p1) in my_cache;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
xa end 'xid';
xa rollback 'xid';
drop table t1;
set global my_cache.key_buffer_size = 0;
13 changes: 13 additions & 0 deletions mysql-test/main/assign_key_cache.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# MDEV-15216 Assertion `! is_set() || m_can_overwrite_status' failed in Diagnostics_area::set_error_status upon operation inside XA
#
--source include/have_partition.inc
set global my_cache.key_buffer_size = 1024*1024;
create table t1 (i int) engine=myisam partition by hash (i) partitions 2;
xa start 'xid';
cache index t1 partition (non_existing_partition) in my_cache;
cache index t1 partition (p1) in my_cache;
xa end 'xid';
xa rollback 'xid';
drop table t1;
set global my_cache.key_buffer_size = 0;
File renamed without changes.
5 changes: 5 additions & 0 deletions mysql-test/main/connect_debug.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set @old_dbug=@@global.debug_dbug;
set global debug_dbug='+d,auth_disconnect';
create user 'bad' identified by 'worse';
set global debug_dbug=@old_dbug;
drop user bad;
12 changes: 12 additions & 0 deletions mysql-test/main/connect_debug.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source include/have_debug.inc;
set @old_dbug=@@global.debug_dbug;

#
# use after free if need plugin change and auth aborted
#
set global debug_dbug='+d,auth_disconnect';
create user 'bad' identified by 'worse';
--error 1
--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse
set global debug_dbug=@old_dbug;
drop user bad;
4 changes: 2 additions & 2 deletions mysql-test/main/implicit_commit.result
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ INSERT INTO db1.trans (a) VALUES (1);
cache index t3 in keycache;
CALL db1.test_if_commit();
IMPLICIT COMMIT
YES
NO
set global keycache.key_buffer_size=0;
#
# SQLCOM_PRELOAD_KEYS
Expand All @@ -571,7 +571,7 @@ INSERT INTO db1.trans (a) VALUES (1);
load index into cache t3;
CALL db1.test_if_commit();
IMPLICIT COMMIT
YES
NO
#
# SQLCOM_FLUSH
#
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/main/ps.result
Original file line number Diff line number Diff line change
Expand Up @@ -5240,3 +5240,14 @@ END;
$$
CALL p1('x');
DROP PROCEDURE p1;
create table t1 (b blob default '');
prepare stmt from "alter table t1 force";
execute stmt;
execute stmt;
execute stmt;
set names latin1;
prepare stmt from "alter table t1 modify b text character set utf8 default 'a'";
execute stmt;
execute stmt;
execute stmt;
drop table t1;
15 changes: 15 additions & 0 deletions mysql-test/main/ps.test
Original file line number Diff line number Diff line change
Expand Up @@ -4672,3 +4672,18 @@ DELIMITER ;$$
--disable_result_log
CALL p1('x');
DROP PROCEDURE p1;

#
# MDEV-15746 ASAN heap-use-after-free in Item_change_list::rollback_item_tree_changes on ALTER executed as PS
#
create table t1 (b blob default '');
prepare stmt from "alter table t1 force";
execute stmt;
execute stmt;
execute stmt;
set names latin1;
prepare stmt from "alter table t1 modify b text character set utf8 default 'a'";
execute stmt;
execute stmt;
execute stmt;
drop table t1;
34 changes: 34 additions & 0 deletions mysql-test/main/sp-innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,37 @@ SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved;
#
# BUG 16041903: End of test case
#
#
# MDEV-15035: SP using query with outer join and a parameter
# in ON expression
#
CREATE TABLE t1 (
id int NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2);
CREATE TABLE t2 (
id int NOT NULL,
id_foo int NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1, 1);
DROP PROCEDURE IF EXISTS test_proc;
CREATE PROCEDURE test_proc(IN param int)
LANGUAGE SQL
READS SQL DATA
BEGIN
SELECT DISTINCT f.id
FROM t1 f
LEFT OUTER JOIN t2 b ON b.id_foo = f.id
WHERE (param <> 0 OR b.id IS NOT NULL);
END|
CALL test_proc(0);
id
1
CALL test_proc(1);
id
1
2
DROP PROCEDURE IF EXISTS test_proc;
DROP TABLE t1, t2;
42 changes: 42 additions & 0 deletions mysql-test/main/sp-innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,47 @@ SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved;
--echo # BUG 16041903: End of test case
--echo #

--echo #
--echo # MDEV-15035: SP using query with outer join and a parameter
--echo # in ON expression
--echo #

CREATE TABLE t1 (
id int NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;

INSERT INTO t1 VALUES (1), (2);

CREATE TABLE t2 (
id int NOT NULL,
id_foo int NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;

INSERT INTO t2 VALUES (1, 1);

--disable_warnings
DROP PROCEDURE IF EXISTS test_proc;
--enable_warnings

DELIMITER |;
CREATE PROCEDURE test_proc(IN param int)
LANGUAGE SQL
READS SQL DATA
BEGIN
SELECT DISTINCT f.id
FROM t1 f
LEFT OUTER JOIN t2 b ON b.id_foo = f.id
WHERE (param <> 0 OR b.id IS NOT NULL);
END|
DELIMITER ;|

CALL test_proc(0);
CALL test_proc(1);

DROP PROCEDURE IF EXISTS test_proc;
DROP TABLE t1, t2;

# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
26 changes: 26 additions & 0 deletions mysql-test/main/subselect_sj.result
Original file line number Diff line number Diff line change
Expand Up @@ -3165,4 +3165,30 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2`,`test`.`t4`.`c4` AS `c4` from `test`.`t1` left join (`test`.`t2` join `test`.`t4`) on(`test`.`t2`.`c2` = `test`.`t1`.`c1` and <in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#3 */ select `test`.`t3`.`c3` from `test`.`t3` where <cache>(`test`.`t2`.`c2`) = `test`.`t3`.`c3`))) where 1
DROP TABLE t1,t2,t3,t4;
#
# MDEV-13699: Assertion `!new_field->field_name.str ||
# strlen(new_field->field_name.str) == new_field->field_name.length'
# failed in create_tmp_table on 2nd execution of PS with semijoin
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
CREATE TABLE t3 (c INT);
CREATE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
INSERT INTO t3 VALUES (5),(6);
PREPARE stmt FROM
"SELECT * FROM t1
WHERE EXISTS (
SELECT * FROM t2 WHERE t1.a IN ( SELECT c AS fld FROM v3 )
)";
EXECUTE stmt;
a
EXECUTE stmt;
a
EXECUTE stmt;
a
drop view v3;
drop table t1,t2,t3;
# End of 5.5 test
set optimizer_switch=@subselect_sj_tmp;
Loading

0 comments on commit c9717dc

Please sign in to comment.