File tree Expand file tree Collapse file tree 5 files changed +45
-1
lines changed Expand file tree Collapse file tree 5 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -1064,3 +1064,21 @@ DROP TABLE t1;
1064
1064
#
1065
1065
# End of 10.1 tests
1066
1066
#
1067
+ #
1068
+ # MDEV-10554: Assertion `!derived->first_select()->
1069
+ # exclude_from_table_unique_test || derived->outer_select()->
1070
+ # exclude_from_table_unique_test'
1071
+ # failed in TABLE_LIST::set_check_merged()
1072
+ #
1073
+ CREATE TABLE t1 (f INT);
1074
+ CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT * FROM ( SELECT * FROM t1 ) AS sq;
1075
+ PREPARE stmt FROM 'SELECT * FROM v1';
1076
+ EXECUTE stmt;
1077
+ f
1078
+ EXECUTE stmt;
1079
+ f
1080
+ drop view v1;
1081
+ drop table t1;
1082
+ #
1083
+ # End of 10.2 tests
1084
+ #
Original file line number Diff line number Diff line change @@ -910,3 +910,24 @@ DROP TABLE t1;
910
910
--echo #
911
911
--echo # End of 10.1 tests
912
912
--echo #
913
+
914
+ --echo #
915
+ --echo # MDEV-10554: Assertion `!derived->first_select()->
916
+ --echo # exclude_from_table_unique_test || derived->outer_select()->
917
+ --echo # exclude_from_table_unique_test'
918
+ --echo # failed in TABLE_LIST::set_check_merged()
919
+ --echo #
920
+
921
+ CREATE TABLE t1 (f INT);
922
+ CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT * FROM ( SELECT * FROM t1 ) AS sq;
923
+
924
+ PREPARE stmt FROM 'SELECT * FROM v1';
925
+ EXECUTE stmt;
926
+ EXECUTE stmt;
927
+
928
+ drop view v1;
929
+ drop table t1;
930
+
931
+ --echo #
932
+ --echo # End of 10.2 tests
933
+ --echo #
Original file line number Diff line number Diff line change @@ -2375,6 +2375,8 @@ void st_select_lex_unit::exclude_level()
2375
2375
if (next)
2376
2376
next->prev = prev;
2377
2377
}
2378
+ // Mark it excluded
2379
+ prev= NULL ;
2378
2380
}
2379
2381
2380
2382
Original file line number Diff line number Diff line change @@ -698,6 +698,7 @@ class st_select_lex_unit: public st_select_lex_node {
698
698
st_select_lex* return_after_parsing () { return return_to; }
699
699
void exclude_level ();
700
700
void exclude_tree ();
701
+ bool is_excluded () { return prev == NULL ; }
701
702
702
703
/* UNION methods */
703
704
bool prepare (THD *thd, select_result *result, ulong additional_options);
Original file line number Diff line number Diff line change @@ -5485,7 +5485,8 @@ void TABLE_LIST::set_check_merged()
5485
5485
It is not simple to check all, but at least this should be checked:
5486
5486
this select is not excluded or the exclusion came from above.
5487
5487
*/
5488
- DBUG_ASSERT (!derived->first_select ()->exclude_from_table_unique_test ||
5488
+ DBUG_ASSERT (derived->is_excluded () ||
5489
+ !derived->first_select ()->exclude_from_table_unique_test ||
5489
5490
derived->outer_select ()->
5490
5491
exclude_from_table_unique_test);
5491
5492
}
@@ -5498,6 +5499,7 @@ void TABLE_LIST::set_check_materialized()
5498
5499
if (view)
5499
5500
derived= &view->unit ;
5500
5501
DBUG_ASSERT (derived);
5502
+ DBUG_ASSERT (!derived->is_excluded ());
5501
5503
if (!derived->first_select ()->exclude_from_table_unique_test )
5502
5504
derived->set_unique_exclude ();
5503
5505
else
You can’t perform that action at this time.
0 commit comments