1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-30 05:23:50 +03:00

MDEV-17781: Server crashes in next_linear_tab

For degenerate joins we may have JOIN::table_list as NULL, so instead
of using JOIN::top_join_tab_count use the function JOIN::exec_join_tab_cnt
to get the number of tables joined at the top level.
This commit is contained in:
Varun Gupta
2019-05-03 09:35:47 +05:30
parent ce195987c3
commit e292c67bb2
3 changed files with 33 additions and 1 deletions

View File

@@ -3518,5 +3518,23 @@ rank() OVER (ORDER BY 1) ROW_NUMBER() OVER (ORDER BY (EXPORT_SET(5,'Y','N',',',4
1 3
drop table t1;
#
# MDEV-17781: Server crashes in next_linear_tab
#
CREATE TABLE t1 (i1 int);
explain
(SELECT AVG(0) OVER (), MAX('2') FROM t1)
UNION ALL
(SELECT AVG(0) OVER (), MAX('2') FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
(SELECT AVG(0) OVER (), MAX('2') FROM t1)
UNION ALL
(SELECT AVG(0) OVER (), MAX('2') FROM t1);
AVG(0) OVER () MAX('2')
0.0000 NULL
0.0000 NULL
drop table t1;
#
# End of 10.2 tests
#