summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <cvicentiu@gmail.com>2021-09-09 09:18:12 +0300
committerVicențiu Ciorbaru <cvicentiu@gmail.com>2021-09-09 09:23:35 +0300
commitde7e027d5e5a67d207927c4643b744ec2da25aac (patch)
tree020cd80c7ce686593b73cef6912966ffc698e849 /sql/sql_base.cc
parenta4b3970c6ec5cbdc03dd7301e5a6fdd1faa81932 (diff)
parenta6383a1954bb9deb61425fce9d71e02d2dea56bd (diff)
downloadmariadb-git-de7e027d5e5a67d207927c4643b744ec2da25aac.tar.gz
Merge remote-tracking branch 'upstream/10.3' into 10.4
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 0a351809c16..e0a70ff023a 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -7684,6 +7684,17 @@ bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array,
thd->column_usage= column_usage;
DBUG_PRINT("info", ("thd->column_usage: %d", thd->column_usage));
+ /*
+ Followimg 2 condition always should be true (but they was added
+ due to an error present only in 10.3):
+ 1) nest_level shoud be 0 or positive;
+ 2) nest level of all SELECTs on the same level shoud be equal first
+ SELECT on this level (and each other).
+ */
+ DBUG_ASSERT(thd->lex->current_select->nest_level >= 0);
+ DBUG_ASSERT(thd->lex->current_select->master_unit()->first_select()
+ ->nest_level ==
+ thd->lex->current_select->nest_level);
if (allow_sum_func)
thd->lex->allow_sum_func.set_bit(thd->lex->current_select->nest_level);
thd->where= THD::DEFAULT_WHERE;