summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorAjo Robert <ajo.robert@oracle.com>2015-08-07 16:26:10 +0530
committerAjo Robert <ajo.robert@oracle.com>2015-08-07 16:26:10 +0530
commitf3dce250f45b3a02a30743b2c0928f8aaf132e88 (patch)
tree87b766abaf235a99efe778b5ab5169359a3feca9 /sql/sql_select.cc
parentc28626d0af640dddfb2c4d970f0ce4f6ec1776cc (diff)
downloadmariadb-git-f3dce250f45b3a02a30743b2c0928f8aaf132e88.tar.gz
Bug #20760261 mysqld crashed in materialized_cursor::
send_result_set_metadata Analysis -------- Cursor inside trigger accessing NEW/OLD row leads server exit. The reason for the bug was that implementation of function create_tmp_table() was not considering Item::TRIGGER_FIELD_ITEM as possible alternative for type of class being instantiated. This was resulting in a mismatch between a number of columns in result list and temp table definition. This mismatch leads to the failure of assertion DBUG_ASSERT(send_result_set_metadata.elements == item_list.elements) in the method Materialized_cursor::send_result_set_metadata in debug mode. Fix: --- Added code to consider Item::TRIGGER_FIELD_ITEM as valid type while creating fields.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8a83b907b2e..acf6efa5a13 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -9820,6 +9820,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
}
case Item::FIELD_ITEM:
case Item::DEFAULT_VALUE_ITEM:
+ case Item::TRIGGER_FIELD_ITEM:
{
Item_field *field= (Item_field*) item;
bool orig_modify= modify_item;