1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#17039 Cursor with procedure crashes client

- Change 'get_unit_column_type" to return the field list for the procedure
This commit is contained in:
msvensson@neptunus.(none)
2006-09-07 16:44:18 +02:00
parent b5f67a642f
commit 3a1e9009a2
2 changed files with 27 additions and 2 deletions

View File

@@ -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()