diff options
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 18d54bf0d69..5f2f072b348 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -719,7 +719,6 @@ init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex) return TRUE; context->resolve_in_table_list_only(table_list); lex->use_only_table_context= TRUE; - lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VCOL_EXPR; select_lex->cur_pos_in_select_list= UNDEF_POS; table->map= 1; //To ensure correct calculation of const item table_list->table= table; @@ -1212,6 +1211,7 @@ void LEX::start(THD *thd_arg) context_stack.empty(); //empty select_stack select_stack_top= 0; + select_stack_outer_barrier= 0; unit.init_query(); current_select_number= 0; curr_with_clause= 0; @@ -5296,17 +5296,21 @@ void SELECT_LEX::update_used_tables() while ((tl= ti++)) { TABLE_LIST *embedding= tl; - do + if (!is_eliminated_table(join->eliminated_tables, tl)) { - bool maybe_null; - if ((maybe_null= MY_TEST(embedding->outer_join))) + do { - tl->table->maybe_null= maybe_null; - break; + bool maybe_null; + if ((maybe_null= MY_TEST(embedding->outer_join))) + { + tl->table->maybe_null= maybe_null; + break; + } } + while ((embedding= embedding->embedding)); } - while ((embedding= embedding->embedding)); - if (tl->on_expr) + + if (tl->on_expr && !is_eliminated_table(join->eliminated_tables, tl)) { tl->on_expr->update_used_tables(); tl->on_expr->walk(&Item::eval_not_null_tables, 0, NULL); @@ -5333,8 +5337,11 @@ void SELECT_LEX::update_used_tables() if (embedding->on_expr && embedding->nested_join->join_list.head() == tl) { - embedding->on_expr->update_used_tables(); - embedding->on_expr->walk(&Item::eval_not_null_tables, 0, NULL); + if (!is_eliminated_table(join->eliminated_tables, embedding)) + { + embedding->on_expr->update_used_tables(); + embedding->on_expr->walk(&Item::eval_not_null_tables, 0, NULL); + } } tl= embedding; embedding= tl->embedding; @@ -7800,7 +7807,7 @@ bool LEX::maybe_start_compound_statement(THD *thd) if (!make_sp_head(thd, NULL, &sp_handler_procedure, DEFAULT_AGGREGATE)) return true; sphead->set_suid(SP_IS_NOT_SUID); - sphead->set_body_start(thd, thd->m_parser_state->m_lip.get_cpp_ptr()); + sphead->set_body_start(thd, thd->m_parser_state->m_lip.get_cpp_tok_start()); } return false; } @@ -11867,6 +11874,21 @@ bool LEX::sp_create_set_password_instr(THD *thd, } +bool LEX::set_names(const char *pos, + const Lex_exact_charset_opt_extended_collate &cscl, + bool no_lookahead) +{ + if (sp_create_assignment_lex(thd, pos)) + return true; + CHARSET_INFO *ci= cscl.collation().charset_info(); + set_var_collation_client *var; + var= new (thd->mem_root) set_var_collation_client(ci, ci, ci); + return unlikely(var == NULL) || + unlikely(thd->lex->var_list.push_back(var, thd->mem_root)) || + unlikely(sp_create_assignment_instr(thd, no_lookahead)); +} + + bool LEX::map_data_type(const Lex_ident_sys_st &schema_name, Lex_field_type_st *type) const { |