Skip to content
Permalink
Browse files
Merge 10.3 into 10.4
The MDEV-17262 commit 26432e4
was skipped. In Galera 4, the implementation would seem to require
changes to the streaming replication.

In the tests archive.rnd_pos main.profiling, disable_ps_protocol
for SHOW STATUS and SHOW PROFILE commands until MDEV-18974
has been fixed.
  • Loading branch information
dr-m committed Mar 20, 2019
2 parents de51acd + 117291d commit 514b305
Show file tree
Hide file tree
Showing 152 changed files with 1,636 additions and 966 deletions.
@@ -516,3 +516,6 @@ compile_commands.json
.editorconfig
.kateconfig
*.kdev4

# Visual Studio Code workspace
.vscode/
@@ -3215,17 +3215,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
};

/*
@@ -962,7 +962,8 @@ static int handle_request_for_tables(char *tables, size_t length,
puts(query);
if (mysql_real_query(sock, query, (ulong)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);
@@ -8267,6 +8267,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
*/
@@ -8804,18 +8810,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
@@ -68,7 +68,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;
@@ -336,7 +335,6 @@ get_mysql_vars(MYSQL *connection)
char *version_comment_var = NULL;
char *innodb_version_var = NULL;
char *have_backup_locks_var = NULL;
char *have_backup_safe_binlog_info_var = NULL;
char *log_bin_var = NULL;
char *lock_wait_timeout_var= NULL;
char *wsrep_on_var = NULL;
@@ -360,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},
@@ -394,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;
}
@@ -1716,4 +1701,3 @@ mdl_unlock_all()
mysql_close(mdl_con);
spaceid_to_tablename.clear();
}

@@ -363,9 +363,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
@@ -2012,7 +2009,6 @@ xtrabackup_read_metadata(char *filename)
{
FILE *fp;
my_bool r = TRUE;
int t;

fp = fopen(filename,"r");
if(!fp) {
@@ -2043,9 +2039,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);

@@ -2064,13 +2057,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);
}

/***********************************************************************
@@ -5295,27 +5286,6 @@ innodb_free_param()
}


/** Store the current binary log coordinates in a specified file.
@param[in] filename file name
@param[in] name binary log file name
@param[in] pos binary log file position
@return whether the operation succeeded */
static bool
store_binlog_info(const char* filename, const char* name, ulonglong pos)
{
FILE *fp = fopen(filename, "w");

if (!fp) {
msg("mariabackup: failed to open '%s'", filename);
return(false);
}

fprintf(fp, "%s\t%llu\n", name, pos);
fclose(fp);

return(true);
}

/** Check if file exists*/
static bool file_exists(std::string name)
{
@@ -5581,20 +5551,6 @@ xtrabackup_prepare_func(char** argv)
msg("Last binlog file %s, position %lld",
trx_sys.recovered_binlog_filename,
longlong(trx_sys.recovered_binlog_offset));

/* 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",
trx_sys.recovered_binlog_filename,
trx_sys.recovered_binlog_offset)
&& (!recover_binlog_info
|| store_binlog_info(XTRABACKUP_BINLOG_INFO,
trx_sys.recovered_binlog_filename,
trx_sys.recovered_binlog_offset));
}

/* Check whether the log is applied enough or not. */
@@ -141,7 +141,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;
@@ -94,8 +94,6 @@ void mysql_audit_release(THD *thd);
bool thd_is_connection_alive(THD *thd);
/* Close connection with possible error code */
void close_connection(THD *thd, uint errcode);
/* End the connection before closing it */
void end_connection(THD *thd);
/* Decrement connection counter */
void dec_connection_count();
/* Destroy THD object */
@@ -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
@@ -98,6 +98,7 @@ call mtr.check_testcase();
let $datadir=`select @@datadir`;
list_files $datadir mysql_upgrade_info;
list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*;
--replace_regex /#sql-ib[0-9a-f]+-[0-9a-f]+\.ibd\n//
cat_file $datadir.tempfiles.txt;
remove_file $datadir.tempfiles.txt;
list_files $datadir/mysql #sql*;
@@ -247,11 +247,9 @@ 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
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
drop table t1;
#
# MDEV-6394: ANALYZE DELETE .. RETURNING fails with ERROR 2027 Malformed packet
@@ -283,12 +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
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
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
@@ -196,7 +196,7 @@ drop table t1;
--echo #
create table t1 (i int);
insert into t1 values (1);
analyze select * from t1 into @var;
analyze select * into @var from t1 ;
drop table t1;

--echo #
@@ -223,9 +223,9 @@ 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 ;
--error ER_TOO_MANY_ROWS
analyze select a from t1 into @var;
analyze select a into @var from t1 ;

analyze insert into t1 select * from t1;

0 comments on commit 514b305

Please sign in to comment.