summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index ffc3686fcd9..42c335875d6 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1692,7 +1692,7 @@ static bool mysql_test_create_view(Prepared_statement *stmt)
if (open_normal_and_derived_tables(thd, tables, 0))
goto err;
- lex->view_prepare_mode= 1;
+ lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW;
res= select_like_stmt_test(stmt, 0, 0);
err:
@@ -2238,19 +2238,6 @@ end:
}
-/** Init PS/SP specific parse tree members. */
-
-static void init_stmt_after_parse(LEX *lex)
-{
- SELECT_LEX *sl= lex->all_selects_list;
- /*
- Switch off a temporary flag that prevents evaluation of
- subqueries in statement prepare.
- */
- for (; sl; sl= sl->next_select_in_list())
- sl->uncacheable&= ~UNCACHEABLE_PREPARE;
-}
-
/**
SQLCOM_PREPARE implementation.
@@ -3083,6 +3070,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
parser_state.m_lip.stmt_prepare_mode= TRUE;
lex_start(thd);
+ lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_PREPARE;
error= parse_sql(thd, & parser_state, NULL) ||
thd->is_error() ||
@@ -3135,7 +3123,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
if (error == 0)
{
setup_set_params();
- init_stmt_after_parse(lex);
+ lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_PREPARE;
state= Query_arena::PREPARED;
flags&= ~ (uint) IS_IN_USE;
/*