Commit a610da4
Mattias Jonsson
Bug#14789301: CRASHING SERVER BY STORED FUNCTION
REFERENCING USER DEFINED VARIABLE IN QUERY
There are 2 steps resulting in the crash:
1) the stored procedure was executed during JOIN::prepare resulting
in setting thd->user_var_events_alloc to NULL (due to LTM_NONE)
2) the next time the stored procedure was executed in the same statement
it crashes due to thd->user_var_events_alloc was null. (it was not
set to thd->mem_root since LTM_PRELOCKED).
The fix is to:
* avoid executing the stored program during prepare phase of
Item_func_isnull (update_used_tables).
Also updated a comment which got out of date after bug 14247298.
Also added test case copied from the duplicate bug:
BUG#11765560 - SEGFAULT ON SHOW TABLE STATUS (MYSQLDUMP) OF NESTED
VIEWS
which is a duplicate in 5.6 (other cause in 5.1/5.5), but with another crash.
In 5.1/5.5 this patch cannot be used since it lacks of with_stored_program,
and the problem is caching strategy for is_not_null/isnull and
DETERMINISTIC stored programs.1 parent b410d34 commit a610da4
3 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5160 | 5160 | | |
5161 | 5161 | | |
5162 | 5162 | | |
5163 | | - | |
| 5163 | + | |
5164 | 5164 | | |
5165 | 5165 | | |
5166 | 5166 | | |
| |||
5169 | 5169 | | |
5170 | 5170 | | |
5171 | 5171 | | |
5172 | | - | |
| 5172 | + | |
5173 | 5173 | | |
5174 | 5174 | | |
5175 | 5175 | | |
| |||
5201 | 5201 | | |
5202 | 5202 | | |
5203 | 5203 | | |
5204 | | - | |
| 5204 | + | |
| 5205 | + | |
5205 | 5206 | | |
5206 | 5207 | | |
5207 | 5208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1492 | 1492 | | |
1493 | 1493 | | |
1494 | 1494 | | |
1495 | | - | |
| 1495 | + | |
1496 | 1496 | | |
1497 | 1497 | | |
1498 | 1498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6131 | 6131 | | |
6132 | 6132 | | |
6133 | 6133 | | |
| 6134 | + | |
| 6135 | + | |
6134 | 6136 | | |
6135 | 6137 | | |
6136 | 6138 | | |
| |||
0 commit comments