diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2015-11-06 16:36:41 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2015-11-09 16:08:06 +0100 |
commit | 7e4da9b370d032db9015adb47ad2ff585aeaea5d (patch) | |
tree | 3bb50a0b8369545517f537e2885436ee7e6af3ca /sql/sql_yacc.yy | |
parent | 5d754fce95fa378027d1b575d049ab6b78823bb7 (diff) | |
download | mariadb-git-7e4da9b370d032db9015adb47ad2ff585aeaea5d.tar.gz |
DEV-8632 Segmentation fault on INSERT
View/derived fields should be taken into account when we build ref_pointer_array constructed.
DBUG_ASSERTs added to avoid memory overrun.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a49dea6380e..11d7efdbadf 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9872,6 +9872,15 @@ table_factor: sel->add_joined_table($$); lex->pop_context(); lex->nest_level--; + /* + Fields in derived table can be used in upper select in + case of merge. We do not add HAVING fields because we do + not merge such derived. We do not add union because + also do not merge them + */ + if (!sel->next_select()) + $2->select_n_where_fields+= + sel->select_n_where_fields; } /*else if (($3->select_lex && $3->select_lex->master_unit()->is_union() && |