summaryrefslogtreecommitdiff
path: root/sql/opt_split.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2018-09-15 14:28:19 -0700
committerIgor Babaev <igor@askmonty.org>2018-09-15 14:28:33 -0700
commitc5a9a63293f868f074def37c985fe23a9c01c276 (patch)
tree8cb910e2e4251e3e6cf7cd4bd14f5fffdc587704 /sql/opt_split.cc
parentaba5c72be28cbd3028623070b7bf3d7d1e128be1 (diff)
downloadmariadb-git-c5a9a63293f868f074def37c985fe23a9c01c276.tar.gz
MDEV-16917 Index affects query results
The optimizer erroneously allowed to use join cache when joining a splittable materialized table together with splitting optimization. As a consequence in some rare cases the server returned wrong result sets for queries with materialized derived. This patch allows to use either join cache without usage of splitting technique for materialization of a splittable derived table or splitting without usage of join cache when joining such table. The costs the these alternatives are compared and the best variant is chosen.
Diffstat (limited to 'sql/opt_split.cc')
-rw-r--r--sql/opt_split.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/opt_split.cc b/sql/opt_split.cc
index 611e70376c8..c5e31ba5bcf 100644
--- a/sql/opt_split.cc
+++ b/sql/opt_split.cc
@@ -267,6 +267,13 @@ void TABLE::deny_splitting()
}
+double TABLE::get_materialization_cost()
+{
+ DBUG_ASSERT(spl_opt_info != NULL);
+ return spl_opt_info->unsplit_cost;
+}
+
+
/* This structure is auxiliary and used only in the function that follows it */
struct SplM_field_ext_info: public SplM_field_info
{