summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
authorunknown <thek@adventure.(none)>2007-05-07 10:23:10 +0200
committerunknown <thek@adventure.(none)>2007-05-07 10:23:10 +0200
commit72569cc66d2a1d8edcc3e368213619f7ea855329 (patch)
tree2bff0cc91cb05a081ba21c79a104862facc39de5 /sql/sp_head.h
parentc49e378ac4a690220d86c11ef40f2382848c6d30 (diff)
downloadmariadb-git-72569cc66d2a1d8edcc3e368213619f7ea855329.tar.gz
Bug#26977 exception handlers never hreturn
- In some cases, flow control optimization implemented in sp::optimize removes hreturn instructions, causing SQL exception handlers to: * never return * execute wrong logic - This patch overrides default short cut optimization on hreturn instructions to avoid this problem. mysql-test/r/sp-code.result: Added test case mysql-test/t/sp-code.test: Added test case sql/sp_head.cc: Override opt_mark to get correct execution paths without jump short cut optimization. sql/sp_head.h: Added override sp_instr_hreturn::opt_shortcut_jump so that jump short cuts aren't performed on hreturn instructions operating on handlers which are set to CONTINUE after interruption.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 4632f6808fd..ed99885ae9a 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -973,6 +973,12 @@ public:
virtual void print(String *str);
+ /* This instruction will not be short cut optimized. */
+ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start)
+ {
+ return m_ip;
+ }
+
virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads);
private: