summaryrefslogtreecommitdiff
path: root/sql/opt_trace.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2021-01-18 12:29:12 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2021-01-18 12:29:12 +0530
commite7f289c514290d4995b0f3c2fc764e0eb11675ca (patch)
tree447ff490652ff3c4c016ed19b9fb38f3aa15ced9 /sql/opt_trace.cc
parentedb5ae009c13e6bbb68696f0aeb2ce1b69c2b493 (diff)
downloadmariadb-git-e7f289c514290d4995b0f3c2fc764e0eb11675ca.tar.gz
MDEV-23646: Optimizer trace: optimize_cond() should show ON expression processing10.4-opt_trace
Print in the optimizer trace equality and constant propagation of the ON expression
Diffstat (limited to 'sql/opt_trace.cc')
-rw-r--r--sql/opt_trace.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/opt_trace.cc b/sql/opt_trace.cc
index 2d14972aba5..a49273c0a9f 100644
--- a/sql/opt_trace.cc
+++ b/sql/opt_trace.cc
@@ -689,6 +689,28 @@ void print_on_expr(JOIN *join, Json_writer_array *trace_on_expr)
}
+void print_on_expr(THD *thd, List<TABLE_LIST> *join_list,
+ Json_writer_array *trace_array)
+{
+ if (join_list == NULL)
+ return;
+ TABLE_LIST *table;
+ List_iterator<TABLE_LIST> li(*join_list);
+
+ while ((table= li++))
+ {
+ if (table->on_expr)
+ {
+ List<TABLE_LIST> *nested_join_list= table->nested_join ?
+ &table->nested_join->join_list : NULL;
+
+ trace_array->add(table->on_expr);
+ print_on_expr(thd, nested_join_list, trace_array);
+ }
+ }
+}
+
+
/*
Introduce enum_query_type flags parameter, maybe also allow
EXPLAIN also use this function.