Commit 44534487 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-11505 wrong databasename in mysqldump comment

fix_for_comment() uses a static buffer. cannot have two
fix_for_comment() calls as arguments to one printf().
parent d72dbb41
......@@ -670,8 +670,9 @@ static void write_header(FILE *sql_file, char *db_name)
"-- MySQL dump %s Distrib %s, for %s (%s)\n--\n",
DUMP_VERSION, MYSQL_SERVER_VERSION, SYSTEM_TYPE,
MACHINE_TYPE);
print_comment(sql_file, 0, "-- Host: %s Database: %s\n",
fix_for_comment(current_host ? current_host : "localhost"),
print_comment(sql_file, 0, "-- Host: %s ",
fix_for_comment(current_host ? current_host : "localhost"));
print_comment(sql_file, 0, "Database: %s\n",
fix_for_comment(db_name ? db_name : ""));
print_comment(sql_file, 0,
"-- ------------------------------------------------------\n"
......
......@@ -2509,3 +2509,11 @@ if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Wind
}
--exec $MYSQL_DUMP --routines --compact $shell_ready_db_name
DROP DATABASE `a\"'``b`;
#"
# MDEV-11505 wrong databasename in mysqldump comment
#
let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/bug11505.sql;
let SEARCH_PATTERN=Database: mysql;
exec $MYSQL_DUMP mysql func > $SEARCH_FILE;
source include/search_pattern_in_file.inc;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment