Navigation Menu

Skip to content

Commit

Permalink
mysql57: add NULL check in reset()
Browse files Browse the repository at this point in the history
Because table->pos_in_table_list may be NULL.
  • Loading branch information
kou committed Mar 17, 2015
1 parent 4e4a828 commit b2b9795
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions ha_mroonga.cpp
Expand Up @@ -11170,16 +11170,29 @@ int ha_mroonga::generic_reset()
{
MRN_DBUG_ENTER_METHOD();
int error = 0;
if (thd_sql_command(ha_thd()) == SQLCOM_SELECT) {
st_select_lex *select_lex = table->pos_in_table_list->select_lex;
List_iterator<Item_func_match> iterator(*(select_lex->ftfunc_list));
Item_func_match *item;
while ((item = iterator++)) {
if (item->ft_handler) {
mrn_generic_ft_clear(item->ft_handler);
}

if (thd_sql_command(ha_thd()) != SQLCOM_SELECT) {
DBUG_RETURN(error);
}

TABLE_LIST *table_list = table->pos_in_table_list;
if (!table_list) {
DBUG_RETURN(error);
}

st_select_lex *select_lex = table_list->select_lex;
if (!select_lex) {
DBUG_RETURN(error);
}

List_iterator<Item_func_match> iterator(*(select_lex->ftfunc_list));
Item_func_match *item;
while ((item = iterator++)) {
if (item->ft_handler) {
mrn_generic_ft_clear(item->ft_handler);
}
}

DBUG_RETURN(error);
}

Expand Down

0 comments on commit b2b9795

Please sign in to comment.