summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-09-07 16:44:18 +0200
committerunknown <msvensson@neptunus.(none)>2006-09-07 16:44:18 +0200
commit7f713ab402628ddbdf7a5024801d267b9ee7c078 (patch)
tree7044e2ed85855a805b74f1815d3ade1b459ce5ca /sql/sql_union.cc
parentbd8309cce6793352cebcf54459fa301eaab0b3b8 (diff)
downloadmariadb-git-7f713ab402628ddbdf7a5024801d267b9ee7c078.tar.gz
Bug#17039 Cursor with procedure crashes client
- Change 'get_unit_column_type" to return the field list for the procedure sql/sql_union.cc: Change 'get_unit_column_type' to return the procedure field list if this is the execution of a procedure. tests/mysql_client_test.c: Add test case for using "procedure" in cursor.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index c5af81ae55a..b14acf26607 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -689,7 +689,17 @@ bool st_select_lex_unit::change_result(select_subselect *result,
List<Item> *st_select_lex_unit::get_unit_column_types()
{
- bool is_union= test(first_select()->next_select());
+ SELECT_LEX *sl= first_select();
+ bool is_union= test(sl->next_select());
+ bool is_procedure= test(sl->join->procedure);
+
+ if (is_procedure)
+ {
+ /* Types for "SELECT * FROM t1 procedure analyse()"
+ are generated during execute */
+ return &sl->join->procedure_fields_list;
+ }
+
if (is_union)
{
@@ -697,7 +707,8 @@ List<Item> *st_select_lex_unit::get_unit_column_types()
/* Types are generated during prepare */
return &types;
}
- return &first_select()->item_list;
+
+ return &sl->item_list;
}
bool st_select_lex::cleanup()