• Kristofer Pettersson's avatar
    Bug#44658 Create procedure makes server crash when user does not have ALL privilege · a6455554
    Kristofer Pettersson authored
    MySQL crashes if a user without proper privileges attempts to create a procedure.
    
    The crash happens because more than one error state is pushed onto the Diagnostic
    area. In this particular case the user is denied to implicitly create a new user
    account with the implicitly granted privileges ALTER- and EXECUTE ROUTINE.
    
    The new account is needed if the original user account contained a host mask.
    A user account with a host mask is a distinct user account in this context.
    An alternative would be to first get the most permissive user account which
    include the current user connection and then assign privileges to that
    account. This behavior change is considered out of scope for this bug patch.
    
    The implicit assignment of privileges when a user creates a stored routine is a
    considered to be a feature for user convenience and as such it is not
    a critical operation. Any failure to complete this operation is thus considered
    non-fatal (an error becomes a warning).
    
    The patch back ports a stack implementation of the internal error handler interface.
    This enables the use of multiple error handlers so that it is possible to intercept
    and cancel errors thrown by lower layers. This is needed as a error handler already
    is used in the call stack emitting the errors which needs to be converted.
    a6455554
grant.test 45.3 KB