Skip to content
Permalink
Browse files
Merge branch '10.1' into 10.2
  • Loading branch information
vuvova committed Mar 15, 2019
2 parents bb8c82c + 34db995 commit 0508d32
Show file tree
Hide file tree
Showing 97 changed files with 1,032 additions and 568 deletions.
@@ -3173,17 +3173,24 @@ int main(int argc, char** argv)
DBUG_RETURN(retval == ERROR_STOP ? 1 : 0);
}

uint e_key_get_latest_version_func(uint) { return 1; }
uint e_key_get_func(uint, uint, uchar*, uint*) { return 1; }
uint e_ctx_size_func(uint, uint) { return 1; }
int e_ctx_init_func(void *, const uchar*, uint, const uchar*, uint,
int, uint, uint) { return 1; }
int e_ctx_update_func(void *, const uchar*, uint, uchar*, uint*) { return 1; }
int e_ctx_finish_func(void *, uchar*, uint*) { return 1; }
uint e_encrypted_length_func(uint, uint, uint) { return 1; }

uint dummy1() { return 1; }
struct encryption_service_st encryption_handler=
{
(uint(*)(uint))dummy1,
(uint(*)(uint, uint, uchar*, uint*))dummy1,
(uint(*)(uint, uint))dummy1,
(int (*)(void*, const uchar*, uint, const uchar*, uint, int, uint, uint))dummy1,
(int (*)(void*, const uchar*, uint, uchar*, uint*))dummy1,
(int (*)(void*, uchar*, uint*))dummy1,
(uint (*)(uint, uint, uint))dummy1
e_key_get_latest_version_func,
e_key_get_func,
e_ctx_size_func,
e_ctx_init_func,
e_ctx_update_func,
e_ctx_finish_func,
e_encrypted_length_func
};

/*
@@ -953,7 +953,8 @@ static int handle_request_for_tables(char *tables, size_t length,
puts(query);
if (mysql_real_query(sock, query, query_length))
{
sprintf(message, "when executing '%s%s... %s'", op, tab_view, options);
my_snprintf(message, sizeof(message), "when executing '%s%s... %s'",
op, tab_view, options);
DBerror(sock, message);
my_free(query);
DBUG_RETURN(1);
@@ -8272,6 +8272,12 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
DBUG_ENTER("run_query_stmt");
DBUG_PRINT("query", ("'%-.60s'", query));

if (!mysql)
{
handle_no_active_connection(command, cn, ds);
DBUG_VOID_RETURN;
}

/*
Init a new stmt if it's not already one created for this connection
*/
@@ -8809,18 +8815,56 @@ void init_re(void)
*/
const char *ps_re_str =
"^("
"[[:space:]]*REPLACE[[:space:]]|"
"[[:space:]]*INSERT[[:space:]]|"
"[[:space:]]*UPDATE[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]|"
"[[:space:]]*SELECT[[:space:]]|"
"[[:space:]]*ALTER[[:space:]]+SEQUENCE[[:space:]]|"
"[[:space:]]*ALTER[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*ALTER[[:space:]]+USER[[:space:]]|"
"[[:space:]]*ANALYZE[[:space:]]|"
"[[:space:]]*ASSIGN[[:space:]]|"
//"[[:space:]]*CALL[[:space:]]|" // XXX run_query_stmt doesn't read multiple result sets
"[[:space:]]*CHANGE[[:space:]]|"
"[[:space:]]*CHECKSUM[[:space:]]|"
"[[:space:]]*COMMIT[[:space:]]|"
"[[:space:]]*COMPOUND[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+DATABASE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+INDEX[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+ROLE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+SEQUENCE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+USER[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+VIEW[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]|"
"[[:space:]]*DO[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+DATABASE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+INDEX[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+ROLE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+SEQUENCE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+USER[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+VIEW[[:space:]]|"
"[[:space:]]*FLUSH[[:space:]]|"
"[[:space:]]*GRANT[[:space:]]|"
"[[:space:]]*HANDLER[[:space:]]+.*[[:space:]]+READ[[:space:]]|"
"[[:space:]]*INSERT[[:space:]]|"
"[[:space:]]*INSTALL[[:space:]]+|"
"[[:space:]]*KILL[[:space:]]|"
"[[:space:]]*OPTIMIZE[[:space:]]|"
"[[:space:]]*PRELOAD[[:space:]]|"
"[[:space:]]*RENAME[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*RENAME[[:space:]]+USER[[:space:]]|"
"[[:space:]]*REPAIR[[:space:]]|"
"[[:space:]]*REPLACE[[:space:]]|"
"[[:space:]]*RESET[[:space:]]|"
"[[:space:]]*REVOKE[[:space:]]|"
"[[:space:]]*ROLLBACK[[:space:]]|"
"[[:space:]]*SELECT[[:space:]]|"
"[[:space:]]*SET[[:space:]]+OPTION[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]+MULTI[[:space:]]|"
"[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"
"[[:space:]]*INSERT[[:space:]]+SELECT[[:space:]])";
"[[:space:]]*SHOW[[:space:]]|"
"[[:space:]]*SHUTDOWN[[:space:]]|"
"[[:space:]]*SLAVE[[:space:]]|"
"[[:space:]]*TRUNCATE[[:space:]]|"
"[[:space:]]*UNINSTALL[[:space:]]+|"
"[[:space:]]*UPDATE[[:space:]]"
")";

/*
Filter for queries that can be run using the
@@ -67,7 +67,6 @@ unsigned long mysql_server_version = 0;
/* server capabilities */
bool have_changed_page_bitmaps = false;
bool have_backup_locks = false;
bool have_backup_safe_binlog_info = false;
bool have_lock_wait_timeout = false;
bool have_galera_enabled = false;
bool have_flush_engine_logs = false;
@@ -359,8 +358,6 @@ get_mysql_vars(MYSQL *connection)

mysql_variable mysql_vars[] = {
{"have_backup_locks", &have_backup_locks_var},
{"have_backup_safe_binlog_info",
&have_backup_safe_binlog_info_var},
{"log_bin", &log_bin_var},
{"lock_wait_timeout", &lock_wait_timeout_var},
{"gtid_mode", &gtid_mode_var},
@@ -393,23 +390,12 @@ get_mysql_vars(MYSQL *connection)
}

if (opt_binlog_info == BINLOG_INFO_AUTO) {

if (have_backup_safe_binlog_info_var != NULL)
opt_binlog_info = BINLOG_INFO_LOCKLESS;
else if (log_bin_var != NULL && !strcmp(log_bin_var, "ON"))
if (log_bin_var != NULL && !strcmp(log_bin_var, "ON"))
opt_binlog_info = BINLOG_INFO_ON;
else
opt_binlog_info = BINLOG_INFO_OFF;
}

if (have_backup_safe_binlog_info_var == NULL &&
opt_binlog_info == BINLOG_INFO_LOCKLESS) {

msg("Error: --binlog-info=LOCKLESS is not supported by the "
"server");
return(false);
}

if (lock_wait_timeout_var != NULL) {
have_lock_wait_timeout = true;
}
@@ -1821,4 +1807,3 @@ mdl_unlock_all()
mysql_close(mdl_con);
spaceid_to_tablename.clear();
}

@@ -362,9 +362,6 @@ struct ddl_tracker_t {

static ddl_tracker_t ddl_tracker;

/* Whether xtrabackup_binlog_info should be created on recovery */
static bool recover_binlog_info;

/* Simple datasink creation tracking...add datasinks in the reverse order you
want them destroyed. */
#define XTRABACKUP_MAX_DATASINKS 10
@@ -2048,9 +2045,6 @@ xtrabackup_read_metadata(char *filename)
}
/* Optional fields */

if (fscanf(fp, "recover_binlog_info = %d\n", &t) == 1) {
recover_binlog_info = (t == 1);
}
end:
fclose(fp);

@@ -2069,13 +2063,11 @@ xtrabackup_print_metadata(char *buf, size_t buf_len)
"backup_type = %s\n"
"from_lsn = " UINT64PF "\n"
"to_lsn = " UINT64PF "\n"
"last_lsn = " UINT64PF "\n"
"recover_binlog_info = %d\n",
"last_lsn = " UINT64PF "\n",
metadata_type,
metadata_from_lsn,
metadata_to_lsn,
metadata_last_lsn,
MY_TEST(opt_binlog_info == BINLOG_INFO_LOCKLESS));
metadata_last_lsn);
}

/***********************************************************************
@@ -5627,18 +5619,6 @@ xtrabackup_prepare_func(char** argv)
TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME
+ sys_header);
msg("Last binlog file %s, position %llu", name, pos);

/* output to xtrabackup_binlog_pos_innodb and
(if backup_safe_binlog_info was available on
the server) to xtrabackup_binlog_info. In the
latter case xtrabackup_binlog_pos_innodb
becomes redundant and is created only for
compatibility. */
ok = store_binlog_info(
"xtrabackup_binlog_pos_innodb", name, pos)
&& (!recover_binlog_info || store_binlog_info(
XTRABACKUP_BINLOG_INFO,
name, pos));
}

mtr.commit();
@@ -140,7 +140,7 @@ extern uint opt_safe_slave_backup_timeout;

extern const char *opt_history;

enum binlog_info_enum { BINLOG_INFO_OFF, BINLOG_INFO_LOCKLESS, BINLOG_INFO_ON,
enum binlog_info_enum { BINLOG_INFO_OFF, BINLOG_INFO_ON,
BINLOG_INFO_AUTO};

extern ulong opt_binlog_info;
@@ -50,9 +50,9 @@
#define WSREP_WARN(...) WSREP_LOG(sql_print_warning, ##__VA_ARGS__)
#define WSREP_ERROR(...) WSREP_LOG(sql_print_error, ##__VA_ARGS__)

#define WSREP_SYNC_WAIT(thd_, before_) \
{ if (WSREP_CLIENT(thd_) && \
wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; }
#define WSREP_SYNC_WAIT(thd_, before_) \
do { if (WSREP_CLIENT(thd_) && \
wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; } while(0)
#define WSREP_ERROR_LABEL wsrep_error_label
#else
#define IF_WSREP(A,B) B
@@ -64,7 +64,7 @@
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#define WSREP_SYNC_WAIT(thd_, before_)
#define WSREP_SYNC_WAIT(thd_, before_) do { } while(0)
#define WSREP_ERROR_LABEL goto wsrep_error_label; wsrep_error_label

#endif /* WITH_WSREP */
@@ -210,6 +210,30 @@ should be chosen from the following list:
.IP \(bu 2.3
.\}
t,
aa: Sort by rows affected or average rows affected
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
l,
ae: Sort by rows examined or aggregate rows examined
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
l,
at: Sort by query time or average query time
.RE
.sp
@@ -247,7 +247,7 @@ drop table t1;
#
create table t1 (i int);
insert into t1 values (1);
analyze select * from t1 into @var;
analyze select * into @var from t1 ;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 NULL 100.00 NULL
drop table t1;
@@ -281,10 +281,10 @@ drop table t1;
#
create table t1(a int);
insert into t1 values (1),(2);
analyze select a from t1 where a <2 into @var;
analyze select a into @var from t1 where a <2 ;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 100.00 50.00 Using where
analyze select a from t1 into @var;
analyze select a into @var from t1 ;
ERROR 42000: Result consisted of more than one row
analyze insert into t1 select * from t1;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
@@ -3421,6 +3421,36 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
#
# MDEV-14926 AddressSanitizer: heap-use-after-free in make_date_time on weird combination of functions
#
DO INET_ATON( FROM_UNIXTIME( @@timestamp, ( TRIM( UNHEX(HEX('%m.%d.%Y') ) ) ) ) );
CREATE TABLE t1 (d DATE);
INSERT INTO t1 VALUES ('1989-03-10');
SELECT TIME_FORMAT('23:59:43', BINARY d) AS f FROM t1 GROUP BY 'foo';
f
1989-03-10
DROP TABLE t1;
CREATE TABLE t1 (d DATE) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('1900-01-01');
SELECT LENGTH( DATE_FORMAT( d, BINARY DATABASE() ) ) AS f FROM t1 GROUP BY d;
f
4
DROP TABLE t1;
#
# MDEV-18667 ASAN heap-use-after-free in make_date_time / Arg_comparator::compare_string / Item_func_nullif::compare
#
SELECT NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0)));
NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0)))
foo
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: '2012-12-12 12:12:12'
#
# MDEV-18626 ASAN stack-buffer-overflow in int10_to_str / make_date_time upon DATE_FORMAT
#
SELECT DATE_FORMAT(100000000000, '%j');
DATE_FORMAT(100000000000, '%j')
NULL
#
# End of 10.1 tests
#
#

0 comments on commit 0508d32

Please sign in to comment.