summaryrefslogtreecommitdiff
path: root/sql/sql_cursor.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kpettersson@mysql.com>2008-08-11 11:40:54 +0200
committerKristofer Pettersson <kpettersson@mysql.com>2008-08-11 11:40:54 +0200
commit75a5ecbd7292e70a14b0fd44d75540937ed31487 (patch)
tree89512c065da9a263fa235b749bf53e95ba490c00 /sql/sql_cursor.cc
parent0a415f62fdf4c0698a04b97b3b3208455bf9c834 (diff)
downloadmariadb-git-75a5ecbd7292e70a14b0fd44d75540937ed31487.tar.gz
Bug#38486 Crash when using cursor protocol
Server side cursors were not initialized properly and this caused a reference to uninitialized memory.
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r--sql/sql_cursor.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index c2345f1f2cd..16567765ba6 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -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;
}