diff options
author | Igor Babaev <igor@askmonty.org> | 2018-08-18 22:57:20 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-08-21 12:27:29 -0700 |
commit | a1fd25c22bc27e58b802dd83ee48428913351180 (patch) | |
tree | 3b71e72fb1b2ecdb6f4360a99cf24cd2f6caefca /sql/sql_tvc.h | |
parent | 0dadb96e169d3fa94b5cbcadd97b3cc8e3c0e138 (diff) | |
download | mariadb-git-a1fd25c22bc27e58b802dd83ee48428913351180.tar.gz |
MDEV-17017 Explain for query using derived table specified with a table
value constructor shows wrong number of rows
If the specification of a derived table contained a table value constructor
then the optimizer incorrectly estimated the number of rows in the derived
table. This happened because the optimizer did not take into account the
number of rows in the constructor. The wrong estimate could lead to choosing
inefficient execution plans.
Diffstat (limited to 'sql/sql_tvc.h')
-rw-r--r-- | sql/sql_tvc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_tvc.h b/sql/sql_tvc.h index 420311cccb2..128cc883dd8 100644 --- a/sql/sql_tvc.h +++ b/sql/sql_tvc.h @@ -50,6 +50,8 @@ public: have_query_plan(QEP_NOT_PRESENT_YET), explain(0), select_options(select_options_arg) { }; + + ha_rows get_records() { return lists_of_values.elements; } bool prepare(THD *thd_arg, SELECT_LEX *sl, select_result *tmp_result, |