1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge remote-tracking branch '10.4' into 10.5

This commit is contained in:
Oleksandr Byelkin
2023-03-31 21:32:41 +02:00
306 changed files with 10920 additions and 6615 deletions

View File

@ -2527,7 +2527,10 @@ static uint dump_events_for_db(char *db)
/* Get database collation. */
if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
{
mysql_free_result(event_list_res);
DBUG_RETURN(1);
}
}
if (switch_character_set_results(mysql, "binary"))
@ -3329,7 +3332,10 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
if (path)
{
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
{
mysql_free_result(result);
DBUG_RETURN(0);
}
write_header(sql_file, db);
}
@ -3730,7 +3736,7 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
char name_buff[NAME_LEN*4+3];
char query_buff[QUERY_LENGTH];
uint old_opt_compatible_mode= opt_compatible_mode;
MYSQL_RES *show_triggers_rs;
MYSQL_RES *show_triggers_rs= NULL;
MYSQL_ROW row;
FILE *sql_file= md_result_file;
@ -3814,8 +3820,6 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
}
skip:
mysql_free_result(show_triggers_rs);
if (switch_character_set_results(mysql, default_charset))
goto done;
@ -3830,7 +3834,7 @@ skip:
done:
if (path)
my_fclose(sql_file, MYF(0));
mysql_free_result(show_triggers_rs);
DBUG_RETURN(ret);
}
@ -3936,7 +3940,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
uint num_fields;
size_t total_length, init_length;
MYSQL_RES *res;
MYSQL_RES *res= NULL;
MYSQL_FIELD *field;
MYSQL_ROW row;
DBUG_ENTER("dump_table");
@ -4130,6 +4134,8 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n",
my_progname_short, result_table);
error= EX_CONSCHECK;
if (!quick)
mysql_free_result(res);
goto err;
}
@ -4438,6 +4444,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key,
err:
dynstr_free(&query_string);
maybe_exit(error);
mysql_free_result(res);
DBUG_VOID_RETURN;
} /* dump_table */
@ -4703,7 +4710,11 @@ static int dump_all_users_roles_and_grants()
" '@', QUOTE(DEFAULT_ROLE_HOST))) as r,"
" CONCAT(QUOTE(mu.USER),'@',QUOTE(mu.HOST)) as u "
"FROM mysql.user mu LEFT JOIN mysql.default_roles using (USER, HOST)"))
{
mysql_free_result(tableres);
return 1;
}
while ((row= mysql_fetch_row(tableres)))
{
if (dump_grants(row[1]))
@ -5780,7 +5791,8 @@ static int get_sys_var_lower_case_table_names()
lower_case_table_names= atoi(row[1]);
mysql_free_result(table_res);
}
if (!row)
mysql_free_result(table_res);
return lower_case_table_names;
}
@ -6023,7 +6035,11 @@ static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos,
}
if (have_mariadb_gtid && get_gtid_pos(gtid_pos, 1))
{
mysql_free_result(master);
return 1;
}
}
/* SHOW MASTER STATUS reports file and position */
@ -6145,7 +6161,10 @@ static int do_show_slave_status(MYSQL *mysql_con, int use_gtid,
{
char gtid_pos[MAX_GTID_LENGTH];
if (have_mariadb_gtid && get_gtid_pos(gtid_pos, 0))
{
mysql_free_result(slave);
return 1;
}
if (opt_comments)
fprintf(md_result_file, "\n--\n-- Gtid position to start replication "
"from\n--\n\n");
@ -6341,7 +6360,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length,
{
const char *end= x + length;
ulong found= 0;
uint find;
int find;
char buff[255];
*err_pos= 0; /* No error yet */