diff options
author | konstantin@mysql.com <> | 2005-09-03 03:13:18 +0400 |
---|---|---|
committer | konstantin@mysql.com <> | 2005-09-03 03:13:18 +0400 |
commit | 38486e83c1ee11abb7c52ea6a215960aca0c92a8 (patch) | |
tree | 981df38c4f1f46f7080926e10ff505778048f4af /sql/sql_lex.h | |
parent | a3ddcdf8fbf2058eeae6d7db7f1dc99785329d7b (diff) | |
download | mariadb-git-38486e83c1ee11abb7c52ea6a215960aca0c92a8.tar.gz |
Implement WL#2661 "Prepared Statements: Dynamic SQL in Stored Procedures".
The idea of the patch is to separate statement processing logic,
such as parsing, validation of the parsed tree, execution and cleanup,
from global query processing logic, such as logging, resetting
priorities of a thread, resetting stored procedure cache, resetting
thread count of errors and warnings.
This makes PREPARE and EXECUTE behave similarly to the rest of SQL
statements and allows their use in stored procedures.
This patch contains a change in behaviour:
until recently for each SQL prepared statement command, 2 queries
were written to the general log, e.g.
[Query] prepare stmt from @stmt_text;
[Prepare] select * from t1 <-- contents of @stmt_text
The chagne was necessary to prevent [Prepare] commands from being written
to the general log when executing a stored procedure with Dynamic SQL.
We should consider whether the old behavior is preferrable and probably
restore it.
This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
in Dynamic SQL reported before it was disabled).
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index d777abca29a..6c91045189c 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -808,6 +808,11 @@ typedef struct st_lex to an .frm file. We need this definition to stay untouched. */ bool view_prepare_mode; + /* + TRUE if we're parsing a prepared statement: in this mode + we should allow placeholders and disallow multistatements. + */ + bool stmt_prepare_mode; bool safe_to_cache_query; bool subqueries, ignore; bool variables_used; |