@@ -2039,6 +2039,7 @@ rule:
20392039%type <spblock> opt_sp_decl_body_list
20402040%type <spblock> sp_decl_variable_list
20412041%type <spblock> sp_decl_variable_list_anchored
2042+ %type <spblock> sp_decl_type
20422043%type <spblock> sp_decl_non_handler
20432044%type <spblock> sp_decl_non_handler_list
20442045%type <spblock> sp_decl_handler
@@ -11045,6 +11046,7 @@ function_call_generic:
1104511046 Item *item= NULL;
1104611047 const sp_type_def *tdef= NULL;
1104711048 const Lex_ident_sys ident(thd, &$1);
11049+ const Sp_rcontext_handler *rh;
1104811050 sp_variable *spv= NULL;
1104911051 bool allow_field_accessor= false;
1105011052
@@ -11083,13 +11085,12 @@ function_call_generic:
1108311085 {
1108411086 // Found a constructor with a proper argument count
1108511087 }
11086- else if (Lex->spcont &&
11087- (tdef= Lex->spcont->find_type_def(ident, false)))
11088+ else if (Lex->spcont && (tdef= Lex->find_type_def(ident)))
1108811089 {
1108911090 item= tdef->make_constructor_item(thd, $4);
1109011091 }
1109111092 else if (Lex->spcont &&
11092- (spv= Lex->spcont-> find_variable(&ident, false )) &&
11093+ (spv= Lex->find_variable(&ident, &rh )) &&
1109311094 spv->type_handler()->has_functors())
1109411095 {
1109511096 const char *end= $6.str ? $6.end() : $5.end();
@@ -19574,6 +19575,7 @@ sf_return_type:
1957419575
1957519576package_implementation_item_declaration:
1957619577 sp_decl_variable_list ';'
19578+ | sp_decl_type ';'
1957719579 ;
1957819580
1957919581sp_package_function_body:
@@ -20460,7 +20462,11 @@ sp_decl_non_handler:
2046020462 $$.vars= $$.conds= $$.hndlrs= 0;
2046120463 $$.curs= 1;
2046220464 }
20463- | typed_ident IS RECORD_SYM rec_type_body
20465+ | sp_decl_type
20466+ ;
20467+
20468+ sp_decl_type:
20469+ typed_ident IS RECORD_SYM rec_type_body
2046420470 {
2046520471 if (unlikely(Lex->declare_type_record(thd, $1, $4)))
2046620472 MYSQL_YYABORT;
0 commit comments