diff options
author | Ignacio Galarza <iggy@mysql.com> | 2009-03-17 16:29:24 -0400 |
---|---|---|
committer | Ignacio Galarza <iggy@mysql.com> | 2009-03-17 16:29:24 -0400 |
commit | 428e28e00c679ca6f3a997e0303604d881e361c3 (patch) | |
tree | 3c313f70fd16653491985d8e8108fb5b99f0d5d0 /client/mysqldump.c | |
parent | 2d9421c3bb7376bcfa5484d94b45df65d67e4468 (diff) | |
parent | ec39e58d13f95e455a6553bca3e618e7065707d0 (diff) | |
download | mariadb-git-428e28e00c679ca6f3a997e0303604d881e361c3.tar.gz |
auto-merge
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r-- | client/mysqldump.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 1e0c57782b3..9912f7b7257 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1475,7 +1475,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; @@ -2421,11 +2422,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); |