diff options
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 69f1eae9ac8..97714da0e8d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1388,10 +1388,14 @@ mysql_execute_command(THD *thd) for (TABLE_LIST *cursor= tables; cursor; cursor= cursor->next) - if (cursor->derived && mysql_derived(thd, lex, + if (cursor->derived && (res=mysql_derived(thd, lex, (SELECT_LEX_UNIT *)cursor->derived, - cursor, 0)) + cursor, 0))) + { + if (res < 0) + send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN : 0); DBUG_VOID_RETURN; + } } if ((lex->select_lex.next_select_in_list() && lex->unit.create_total_list(thd, lex, &tables)) || @@ -2781,7 +2785,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables, found=1; } } - else if (check_access(thd,want_access,tables->db,&tables->grant.privilege, + else if (tables->db && check_access(thd,want_access,tables->db,&tables->grant.privilege, 0, no_errors)) return TRUE; } |