[Commits] Rev 3982: MDEV-5723: mysqldump -uroot unusable for multi-database operations, checks all databases in file:///home/psergey/dev2/10.0-base/

Sergey Petrunya psergey at askmonty.org
Wed Mar 5 00:10:06 EET 2014


At file:///home/psergey/dev2/10.0-base/

------------------------------------------------------------
revno: 3982
revision-id: psergey at askmonty.org-20140304221006-izet74rk9t6on00j
parent: psergey at askmonty.org-20140304215757-9bmdz6pmvb33w8le
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 10.0-base
timestamp: Wed 2014-03-05 02:10:06 +0400
message:
  MDEV-5723: mysqldump -uroot unusable for multi-database operations, checks all databases
  - MariaDB-5.5 part of the fix: since we can't easily fix query optimization for I_S tables, 
    run the affected-tablespaces query with semijoin=off. It happens to have a good query plan
    with that setting.
  [This is a forward-port to MariaDB 10.0]
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2014-02-25 15:04:35 +0000
+++ b/client/mysqldump.c	2014-03-04 22:10:06 +0000
@@ -3991,7 +3991,13 @@ static int dump_tablespaces(char* ts_whe
   char *ubs;
   char *endsemi;
   DBUG_ENTER("dump_tablespaces");
-
+  
+  /*
+    Try to turn off semi-join optimization (if that fails, this is a
+    pre-optimizer_switch server, and the old query plan is ok for us.
+  */
+  mysql_query(mysql, "set optimizer_switch='semijoin=off'");
+ 
   init_dynamic_string_checked(&sqlbuf,
                       "SELECT LOGFILE_GROUP_NAME,"
                       " FILE_NAME,"
@@ -4151,6 +4157,8 @@ static int dump_tablespaces(char* ts_whe
 
   mysql_free_result(tableres);
   dynstr_free(&sqlbuf);
+  mysql_query(mysql, "set optimizer_switch=default");
+
   DBUG_RETURN(0);
 }
 



More information about the commits mailing list