Skip to content

Commit

Permalink
SQL: SIGSEGV in create_tmp_table() [fixes #179]
Browse files Browse the repository at this point in the history
tests are in main,rpl suites
  • Loading branch information
kevgs authored and midenok committed May 5, 2017
1 parent 6ac4dfe commit 7d2ed77
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16876,15 +16876,18 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields,

if (type == Item::FIELD_ITEM || type == Item::REF_ITEM)
{
Item_field *item_field= (Item_field *)item->real_item();
Field *field= item_field->field;
TABLE_SHARE *s= field->table->s;
if (s->versioned)
if (item->real_item()->type() == Item::FIELD_ITEM)
{
if (field->flags & VERS_SYS_START_FLAG)
sys_trx_start= new_field;
else if (field->flags & VERS_SYS_END_FLAG)
sys_trx_end= new_field;
Item_field *item_field= (Item_field *)item->real_item();
Field *field= item_field->field;
TABLE_SHARE *s= field->table->s;
if (s->versioned)
{
if (field->flags & VERS_SYS_START_FLAG)
sys_trx_start= new_field;
else if (field->flags & VERS_SYS_END_FLAG)
sys_trx_end= new_field;
}
}
}
if (type == Item::TYPE_HOLDER)
Expand Down

0 comments on commit 7d2ed77

Please sign in to comment.