From d9d0c96a4e25196b06d7886e8c1648778f431d2c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Jun 2005 12:18:41 +0200 Subject: Fixed BUG#10961: Stored procedures: crash if select * from dual Have to catch errors from SELECT when opening a cursor. mysql-test/r/sp.result: New test case for BUG#10961. mysql-test/t/sp.test: New test case for BUG#10961. sql/protocol.h: Init data in Protocol_cursor constructor, for error cases. sql/sp_head.cc: Catch "hidden" errors during SELECT when opening a cursor. --- sql/protocol.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/protocol.h') diff --git a/sql/protocol.h b/sql/protocol.h index 01331ef64ba..5b402cb2669 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -159,8 +159,8 @@ public: MYSQL_ROWS **prev_record; ulong row_count; - Protocol_cursor() {} - Protocol_cursor(THD *thd_arg, MEM_ROOT *ini_alloc) :Protocol_simple(thd_arg), alloc(ini_alloc) {} + Protocol_cursor() :data(NULL) {} + Protocol_cursor(THD *thd_arg, MEM_ROOT *ini_alloc) :Protocol_simple(thd_arg), alloc(ini_alloc), data(NULL) {} bool prepare_for_send(List *item_list) { row_count= 0; -- cgit v1.2.1