Merge branch '10.5' into 10.6

This commit is contained in:
Sergei Golubchik 2025-03-31 11:40:23 +02:00
commit 51cc77f212
16 changed files with 131 additions and 80 deletions

View file

@ -855,8 +855,7 @@ static int upgrade_already_done(int silent)
s= strchr(version, '.');
s= strchr(s + 1, '.');
if (strncmp(upgrade_from_version, version,
(size_t)(s - version + 1)))
if (strncmp(upgrade_from_version, version, (size_t)(s - version + 1)))
{
if (calc_server_version(upgrade_from_version) <= MYSQL_VERSION_ID)
{
@ -870,9 +869,14 @@ static int upgrade_already_done(int silent)
}
if (!silent)
{
verbose("This installation of MariaDB is already upgraded to %s.\n"
"There is no need to run mysql_upgrade again for %s.",
upgrade_from_version, version);
if (strcmp(upgrade_from_version, version))
verbose("This installation of MariaDB is already upgraded to %s.\n"
"There is no need to run mysql_upgrade again for %s, because "
"they're both %.*s.",
upgrade_from_version, version, (int)(s - version), version);
else
verbose("This installation of MariaDB is already upgraded to %s.\n"
"There is no need to run mysql_upgrade again.", version);
if (!opt_check_upgrade)
verbose("You can use --force if you still want to run mysql_upgrade");
}

View file

@ -2124,7 +2124,7 @@ static char *quote_for_equal(const char *name, char *buff)
*to++='\\';
}
if (*name == '\'')
*to++= '\\';
*to++= '\'';
*to++= *name++;
}
to[0]= '\'';
@ -3638,7 +3638,7 @@ static void dump_trigger_old(FILE *sql_file, MYSQL_RES *show_triggers_rs,
fprintf(sql_file,
"DELIMITER ;;\n"
"/*!50003 SET SESSION SQL_MODE=\"%s\" */;;\n"
"/*!50003 SET SESSION SQL_MODE='%s' */;;\n"
"/*!50003 CREATE */ ",
(*show_trigger_row)[6]);
@ -4604,17 +4604,19 @@ static int dump_all_users_roles_and_grants()
return 1;
while ((row= mysql_fetch_row(tableres)))
{
char buf[200];
if (opt_replace_into)
/* Protection against removing the current import user */
/* MySQL-8.0 export capability */
fprintf(md_result_file,
"DELIMITER |\n"
"/*M!100101 IF current_user()=\"%s\" THEN\n"
"/*M!100101 IF current_user()=%s THEN\n"
" SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001,"
" MESSAGE_TEXT=\"Don't remove current user %s'\";\n"
"END IF */|\n"
"DELIMITER ;\n"
"/*!50701 DROP USER IF EXISTS %s */;\n", row[0], row[0], row[0]);
"/*!50701 DROP USER IF EXISTS %s */;\n",
quote_for_equal(row[0],buf), row[0], row[0]);
if (dump_create_user(row[0]))
result= 1;
/* if roles exist, defer dumping grants until after roles created */
@ -6732,6 +6734,7 @@ static my_bool get_view_structure(char *table, char* db)
char *result_table, *opt_quoted_table;
char table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3];
char temp_buff[NAME_LEN*2 + 3], temp_buff2[NAME_LEN*2 + 3];
char query[QUERY_LENGTH];
FILE *sql_file= md_result_file;
DBUG_ENTER("get_view_structure");
@ -6792,7 +6795,9 @@ static my_bool get_view_structure(char *table, char* db)
"SELECT CHECK_OPTION, DEFINER, SECURITY_TYPE, "
" CHARACTER_SET_CLIENT, COLLATION_CONNECTION "
"FROM information_schema.views "
"WHERE table_name=\"%s\" AND table_schema=\"%s\"", table, db);
"WHERE table_name=%s AND table_schema=%s",
quote_for_equal(table, temp_buff2),
quote_for_equal(db, temp_buff));
if (mysql_query(mysql, query))
{