summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2014-03-05 02:10:06 +0400
committerSergey Petrunya <psergey@askmonty.org>2014-03-05 02:10:06 +0400
commit23af77d26e3ff336e415a5d8bf3f4c4a7bc84a18 (patch)
treedffd06372c243b60f0d091485ea48fa8169d74e6 /client
parent5bb978777e1f3cca8298b207fd7b35c0ddf4695a (diff)
downloadmariadb-git-23af77d26e3ff336e415a5d8bf3f4c4a7bc84a18.tar.gz
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]
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index cf42b161f8a..e445fb96d59 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -3991,7 +3991,13 @@ static int dump_tablespaces(char* ts_where)
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_where)
mysql_free_result(tableres);
dynstr_free(&sqlbuf);
+ mysql_query(mysql, "set optimizer_switch=default");
+
DBUG_RETURN(0);
}