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

Bug#38486 Crash when using cursor protocol

Server side cursors were not initialized properly and this caused a reference to
uninitialized memory.
This commit is contained in:
Kristofer Pettersson
2008-08-11 11:40:54 +02:00
parent 7b244002a3
commit 9fc39adfda
2 changed files with 34 additions and 1 deletions

View File

@ -111,7 +111,8 @@ class Select_materialize: public select_union
select_result *result; /* the result object of the caller (PS or SP) */
public:
Materialized_cursor *materialized_cursor;
Select_materialize(select_result *result_arg) :result(result_arg) {}
Select_materialize(select_result *result_arg) :result(result_arg),
materialized_cursor(0) {}
virtual bool send_fields(List<Item> &list, uint flags);
};
@ -155,6 +156,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
if (! (sensitive_cursor= new (thd->mem_root) Sensitive_cursor(thd, result)))
{
delete result_materialize;
result_materialize= NULL;
return 1;
}
@ -212,6 +214,7 @@ int mysql_open_cursor(THD *thd, uint flags, select_result *result,
if ((rc= materialized_cursor->open(0)))
{
delete materialized_cursor;
materialized_cursor= NULL;
goto err_open;
}