[Pkg-mysql-commits] r1347 - in trunk/debian: . patches

Norbert Tretkowski nobse at alioth.debian.org
Thu Dec 4 20:19:17 UTC 2008


tags 507789 pending
thanks

Author: nobse
Date: 2008-12-04 20:19:16 +0000 (Thu, 04 Dec 2008)
New Revision: 1347

Added:
   trunk/debian/patches/50_fix_mysqldump2.dpatch
Modified:
   trunk/debian/changelog
   trunk/debian/patches/00list
Log:
Fix mysqldump from 4.0 server

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-12-04 20:14:56 UTC (rev 1346)
+++ trunk/debian/changelog	2008-12-04 20:19:16 UTC (rev 1347)
@@ -1,3 +1,10 @@
+mysql-dfsg-5.0 (5.0.51a-19) UNRELEASED; urgency=low
+
+  * New patch 50_fix_mysqldump2.dpatch from 5.0.60 to fix dumping databases
+    from mysql 4.0 server. (closes: #507789)
+
+ -- Norbert Tretkowski <nobse at debian.org>  Thu, 04 Dec 2008 21:17:25 +0100
+
 mysql-dfsg-5.0 (5.0.51a-18) testing-proposed-updates; urgency=high
 
   * SECURITY:

Modified: trunk/debian/patches/00list
===================================================================
--- trunk/debian/patches/00list	2008-12-04 20:14:56 UTC (rev 1346)
+++ trunk/debian/patches/00list	2008-12-04 20:19:16 UTC (rev 1347)
@@ -7,6 +7,7 @@
 44_scripts__mysql_config__libs.dpatch
 45_warn-CLI-passwords.dpatch
 50_fix_mysqldump.dpatch
+50_fix_mysqldump2.dpatch
 51_incorrect-order.dpatch
 52_ndb-gcc-4.2.dpatch
 53_integer-gcc-4.2.dpatch

Added: trunk/debian/patches/50_fix_mysqldump2.dpatch
===================================================================
--- trunk/debian/patches/50_fix_mysqldump2.dpatch	                        (rev 0)
+++ trunk/debian/patches/50_fix_mysqldump2.dpatch	2008-12-04 20:19:16 UTC (rev 1347)
@@ -0,0 +1,65 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50_fix_mysqldump2.dpatch by Norbert Tretkowski <nobse at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: http://bugs.mysql.com/bug.php?id=34192
+
+ at DPATCH@
+diff -Nrup a/client/mysqldump.c b/client/mysqldump.c
+--- a/client/mysqldump.c	2007-12-04 22:07:00 -05:00
++++ b/client/mysqldump.c	2008-03-12 17:03:49 -04:00
+@@ -109,6 +109,8 @@ static char  *opt_password=0,*current_us
+              *log_error_file= NULL;
+ static char **defaults_argv= 0;
+ static char compatible_mode_normal_str[255];
++/* Server supports character_set_results session variable? */
++static my_bool server_supports_switching_charsets= TRUE;
+ static ulong opt_compatible_mode= 0;
+ #define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
+ #define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2
+@@ -1011,11 +1013,27 @@ static int mysql_query_with_error_report
+ }
+ 
+ 
++/**
++  Switch charset for results to some specified charset.  If the server does not
++  support character_set_results variable, nothing can be done here.  As for
++  whether something should be done here, future new callers of this function
++  should be aware that the server lacking the facility of switching charsets is
++  treated as success.
++
++  @note  If the server lacks support, then nothing is changed and no error
++         condition is returned.
++
++  @returns  whether there was an error or not
++*/
+ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
+ {
+   char query_buffer[QUERY_LENGTH];
+   size_t query_length;
+ 
++  /* Server lacks facility.  This is not an error, by arbitrary decision . */
++  if (!server_supports_switching_charsets)
++    return FALSE;
++
+   query_length= my_snprintf(query_buffer,
+                             sizeof (query_buffer),
+                             "SET SESSION character_set_results = '%s'",
+@@ -1111,11 +1129,14 @@ static int connect_to_db(char *host, cha
+     DB_error(&mysql_connection, "when trying to connect");
+     DBUG_RETURN(1);
+   }
+-  /*
+-    Don't dump SET NAMES with a pre-4.1 server (bug#7997).
+-  */
+   if (mysql_get_server_version(&mysql_connection) < 40100)
++  {
++    /* Don't dump SET NAMES with a pre-4.1 server (bug#7997).  */
+     opt_set_charset= 0;
++
++    /* Don't switch charsets for 4.1 and earlier.  (bug#34192). */
++    server_supports_switching_charsets= FALSE;
++  } 
+   /*
+     As we're going to set SQL_MODE, it would be lost on reconnect, so we
+     cannot reconnect.




More information about the Pkg-mysql-commits mailing list