summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-02-19 17:33:28 +0100
committerTatiana A. Nurnberg <azundris@mysql.com>2009-02-19 17:33:28 +0100
commit1c5c2a45f00c5edd6bdd3274a8b91c4c5bd43496 (patch)
treee6eaead5b5204eabb62e5232a73ecf563484d89a /client
parentb68e5b66ed2241e8b6a90a057894d9b557b60a81 (diff)
parent3913a257bfabe2873fbd0eed1180b76f4f512587 (diff)
downloadmariadb-git-1c5c2a45f00c5edd6bdd3274a8b91c4c5bd43496.tar.gz
Bug#33550: mysqldump 4.0 compatibility broken
mysqldump included character_set_client magic that is unknown before 4.1 even when asked for an appropriate compatibility mode. In compatibility (3.23, 4.0) mode, we do not output charset statements (not even in a "comment conditional"), nor do we do magic on the server, even if the server is sufficient new (4.1+). Table-names will be output converted to the charset requested by mysqldump; if such a conversion is not possible (Ivrit -> Latin), mysqldump will fail.
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index ced34f16212..97e8d6ed5ef 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1129,7 +1129,8 @@ static int connect_to_db(char *host, char *user,char *passwd)
DB_error(&mysql_connection, "when trying to connect");
DBUG_RETURN(1);
}
- if (mysql_get_server_version(&mysql_connection) < 40100)
+ if ((mysql_get_server_version(&mysql_connection) < 40100) ||
+ (opt_compatible_mode & 3))
{
/* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */
opt_set_charset= 0;
@@ -1857,11 +1858,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
row= mysql_fetch_row(result);
- fprintf(sql_file,
- "SET @saved_cs_client = @@character_set_client;\n"
- "SET character_set_client = utf8;\n"
+ fprintf(sql_file, (opt_compatible_mode & 3) ? "%s;\n" :
+ "/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
+ "/*!40101 SET character_set_client = utf8 */;\n"
"%s;\n"
- "SET character_set_client = @saved_cs_client;\n",
+ "/*!40101 SET character_set_client = @saved_cs_client */;\n",
row[1]);
check_io(sql_file);