diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2009-02-02 18:19:07 +0100 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2009-02-02 18:19:07 +0100 |
commit | 0ad6e488a2e5f0964a303ba4908ac18a4683b403 (patch) | |
tree | cd452f43ea1c8945f1b415986a36f036ace209aa /client | |
parent | 386ec13b590a29608bf8ddea39e1acc875c702a7 (diff) | |
download | mariadb-git-0ad6e488a2e5f0964a303ba4908ac18a4683b403.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.
client/mysqldump.c:
in 3.23/4.0 compat mode, don't do charset magic,
period. not in output, but not on the server,
either!
mysql-test/r/mysqldump-max.result:
character_set_client magic lives in version-conditional
now (except in compat 3.23/4.0 mode, in which case we
don't output any at all!).
mysql-test/r/mysqldump.result:
character_set_client magic lives in version-conditional
now (except in compat 3.23/4.0 mode, in which case we
don't output any at all!).
mysql-test/r/openssl_1.result:
character_set_client magic lives in version-conditional
now (except in compat 3.23/4.0 mode, in which case we
don't output any at all!).
mysql-test/t/mysqldump.test:
character_set_client magic lives in version-conditional
now (except in compat 3.23/4.0 mode, in which case we
don't output any at all!).
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 11 |
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); |