Loading mysql-test/r/sp-error.result +1 −1 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ bug11834_2() 10 drop function bug11834_1; execute stmt; ERROR 42000: FUNCTION test.bug11834_1 does not exist ERROR 42000: FUNCTION test.bug11834_2 does not exist deallocate prepare stmt; drop function bug11834_2; DROP FUNCTION IF EXISTS bug12953| Loading mysql-test/r/sp_notembedded.result +0 −11 Original line number Diff line number Diff line Loading @@ -25,17 +25,6 @@ Id User Host db Command Time State Info # event_scheduler localhost NULL Connect # Suspended NULL # root localhost test Query # NULL show processlist drop procedure bug4902_2| drop function if exists bug5278| create function bug5278 () returns char begin SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass'); return 'okay'; end| select bug5278()| ERROR 42000: Can't find any matching row in the user table select bug5278()| ERROR 42000: Can't find any matching row in the user table drop function bug5278| drop table if exists t1| create table t1 ( id char(16) not null default '', Loading mysql-test/t/sp-error.test +4 −0 Original line number Diff line number Diff line Loading @@ -1075,6 +1075,10 @@ execute stmt; drop function bug11834_1; # Attempt to execute statement should return proper error and # should not crash server. # NOTE! The error we get from the below query indicates that the sp bug11834_2 # does not exist(this is wrong but can be accepted) # This behaviour has been reported as bug#21294 --error ER_SP_DOES_NOT_EXIST execute stmt; deallocate prepare stmt; Loading mysql-test/t/sp_notembedded.test +3 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ call bug4902_2()| drop procedure bug4902_2| # Disable until bug#17244 is fixed --disable_parsing # # BUG#5278: Stored procedure packets out of order if SET PASSWORD. # Loading @@ -63,7 +65,7 @@ select bug5278()| --error 1133 select bug5278()| drop function bug5278| --enable_parsing --disable_warnings drop table if exists t1| Loading sql/sp.cc +9 −18 Original line number Diff line number Diff line Loading @@ -1537,7 +1537,6 @@ static void sp_update_stmt_used_routines(THD *thd, LEX *lex, SQL_LIST *src, first_no_prelock - If true, don't add tables or cache routines used by the body of the first routine (i.e. *start) will be executed in non-prelocked mode. tabs_changed - Set to TRUE some tables were added, FALSE otherwise NOTE If some function is missing this won't be reported here. Instead this fact will be discovered during query execution. Loading @@ -1550,10 +1549,9 @@ static void sp_update_stmt_used_routines(THD *thd, LEX *lex, SQL_LIST *src, static int sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, Sroutine_hash_entry *start, bool first_no_prelock, bool *tabs_changed) bool first_no_prelock) { int ret= 0; bool tabschnd= 0; /* Set if tables changed */ bool first= TRUE; DBUG_ENTER("sp_cache_routines_and_add_tables_aux"); Loading Loading @@ -1626,16 +1624,13 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, { sp_update_stmt_used_routines(thd, lex, &sp->m_sroutines, rt->belong_to_view); tabschnd|= sp->add_used_tables_to_table_list(thd, &lex->query_tables_last, (void)sp->add_used_tables_to_table_list(thd, &lex->query_tables_last, rt->belong_to_view); } sp->propagate_attributes(lex); } first= FALSE; } if (tabs_changed) /* it can be NULL */ *tabs_changed= tabschnd; DBUG_RETURN(ret); } Loading @@ -1651,7 +1646,6 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, lex - LEX representing statement first_no_prelock - If true, don't add tables or cache routines used by the body of the first routine (i.e. *start) tabs_changed - Set to TRUE some tables were added, FALSE otherwise RETURN VALUE 0 - success Loading @@ -1659,12 +1653,11 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, */ int sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock, bool *tabs_changed) sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock) { return sp_cache_routines_and_add_tables_aux(thd, lex, (Sroutine_hash_entry *)lex->sroutines_list.first, first_no_prelock, tabs_changed); first_no_prelock); } Loading Loading @@ -1692,8 +1685,7 @@ sp_cache_routines_and_add_tables_for_view(THD *thd, LEX *lex, TABLE_LIST *view) sp_update_stmt_used_routines(thd, lex, &view->view->sroutines_list, view->top_table()); return sp_cache_routines_and_add_tables_aux(thd, lex, *last_cached_routine_ptr, FALSE, NULL); *last_cached_routine_ptr, FALSE); } Loading Loading @@ -1742,8 +1734,7 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, } } ret= sp_cache_routines_and_add_tables_aux(thd, lex, *last_cached_routine_ptr, FALSE, NULL); *last_cached_routine_ptr, FALSE); } return ret; } Loading Loading
mysql-test/r/sp-error.result +1 −1 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ bug11834_2() 10 drop function bug11834_1; execute stmt; ERROR 42000: FUNCTION test.bug11834_1 does not exist ERROR 42000: FUNCTION test.bug11834_2 does not exist deallocate prepare stmt; drop function bug11834_2; DROP FUNCTION IF EXISTS bug12953| Loading
mysql-test/r/sp_notembedded.result +0 −11 Original line number Diff line number Diff line Loading @@ -25,17 +25,6 @@ Id User Host db Command Time State Info # event_scheduler localhost NULL Connect # Suspended NULL # root localhost test Query # NULL show processlist drop procedure bug4902_2| drop function if exists bug5278| create function bug5278 () returns char begin SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass'); return 'okay'; end| select bug5278()| ERROR 42000: Can't find any matching row in the user table select bug5278()| ERROR 42000: Can't find any matching row in the user table drop function bug5278| drop table if exists t1| create table t1 ( id char(16) not null default '', Loading
mysql-test/t/sp-error.test +4 −0 Original line number Diff line number Diff line Loading @@ -1075,6 +1075,10 @@ execute stmt; drop function bug11834_1; # Attempt to execute statement should return proper error and # should not crash server. # NOTE! The error we get from the below query indicates that the sp bug11834_2 # does not exist(this is wrong but can be accepted) # This behaviour has been reported as bug#21294 --error ER_SP_DOES_NOT_EXIST execute stmt; deallocate prepare stmt; Loading
mysql-test/t/sp_notembedded.test +3 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ call bug4902_2()| drop procedure bug4902_2| # Disable until bug#17244 is fixed --disable_parsing # # BUG#5278: Stored procedure packets out of order if SET PASSWORD. # Loading @@ -63,7 +65,7 @@ select bug5278()| --error 1133 select bug5278()| drop function bug5278| --enable_parsing --disable_warnings drop table if exists t1| Loading
sql/sp.cc +9 −18 Original line number Diff line number Diff line Loading @@ -1537,7 +1537,6 @@ static void sp_update_stmt_used_routines(THD *thd, LEX *lex, SQL_LIST *src, first_no_prelock - If true, don't add tables or cache routines used by the body of the first routine (i.e. *start) will be executed in non-prelocked mode. tabs_changed - Set to TRUE some tables were added, FALSE otherwise NOTE If some function is missing this won't be reported here. Instead this fact will be discovered during query execution. Loading @@ -1550,10 +1549,9 @@ static void sp_update_stmt_used_routines(THD *thd, LEX *lex, SQL_LIST *src, static int sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, Sroutine_hash_entry *start, bool first_no_prelock, bool *tabs_changed) bool first_no_prelock) { int ret= 0; bool tabschnd= 0; /* Set if tables changed */ bool first= TRUE; DBUG_ENTER("sp_cache_routines_and_add_tables_aux"); Loading Loading @@ -1626,16 +1624,13 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, { sp_update_stmt_used_routines(thd, lex, &sp->m_sroutines, rt->belong_to_view); tabschnd|= sp->add_used_tables_to_table_list(thd, &lex->query_tables_last, (void)sp->add_used_tables_to_table_list(thd, &lex->query_tables_last, rt->belong_to_view); } sp->propagate_attributes(lex); } first= FALSE; } if (tabs_changed) /* it can be NULL */ *tabs_changed= tabschnd; DBUG_RETURN(ret); } Loading @@ -1651,7 +1646,6 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, lex - LEX representing statement first_no_prelock - If true, don't add tables or cache routines used by the body of the first routine (i.e. *start) tabs_changed - Set to TRUE some tables were added, FALSE otherwise RETURN VALUE 0 - success Loading @@ -1659,12 +1653,11 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex, */ int sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock, bool *tabs_changed) sp_cache_routines_and_add_tables(THD *thd, LEX *lex, bool first_no_prelock) { return sp_cache_routines_and_add_tables_aux(thd, lex, (Sroutine_hash_entry *)lex->sroutines_list.first, first_no_prelock, tabs_changed); first_no_prelock); } Loading Loading @@ -1692,8 +1685,7 @@ sp_cache_routines_and_add_tables_for_view(THD *thd, LEX *lex, TABLE_LIST *view) sp_update_stmt_used_routines(thd, lex, &view->view->sroutines_list, view->top_table()); return sp_cache_routines_and_add_tables_aux(thd, lex, *last_cached_routine_ptr, FALSE, NULL); *last_cached_routine_ptr, FALSE); } Loading Loading @@ -1742,8 +1734,7 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, } } ret= sp_cache_routines_and_add_tables_aux(thd, lex, *last_cached_routine_ptr, FALSE, NULL); *last_cached_routine_ptr, FALSE); } return ret; } Loading