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
commit4a3f5b2b20f9ec9618b00ea4dd77000127841ec5 (patch)
treee6eaead5b5204eabb62e5232a73ecf563484d89a /client
parentc2e23208ef7ae6b315ca4988e903bff2bc0284d4 (diff)
parent0ad6e488a2e5f0964a303ba4908ac18a4683b403 (diff)
downloadmariadb-git-4a3f5b2b20f9ec9618b00ea4dd77000127841ec5.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);