1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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).
This commit is contained in:
konstantin@mysql.com
2005-09-03 03:13:18 +04:00
parent a3ddcdf8fb
commit 38486e83c1
19 changed files with 1679 additions and 700 deletions

View File

@ -1,5 +1,5 @@
prepare stmt1 from ' show full processlist ';
execute stmt1;
Id User Host db Command Time State Info
number root localhost test Execute time NULL show full processlist
number root localhost test Query time NULL show full processlist
deallocate prepare stmt1;