• Alexander Barkov's avatar
    MDEV-20366 Server crashes in get_current_user upon SET PASSWORD via SP · 0bf843cd
    Alexander Barkov authored
    The opt_for_user subrule was incorrectly scanned before sp_create_assignment_lex(),
    so the user name and the host were created on a wrong memory root.
    
    - Reoganizing the grammar to make sure that sp_create_assignment_lex()
      is called immediately after PASSWORD_SYM is scanned, so all attributes
      are then allocated on its memory root.
    
    - Moving the semantic code as methods to LEX, so the grammar looks as simple as possible.
    
    - Changing text_or_password to be of the data type USER_AUTH*.
      As a side effect, the LEX::definer member is now not used when processing
      the SET PASSWORD statement. Everything is done using Bison's stack.
    
    The bug sas introduced by this commit:
    commit bf5a144e
    0bf843cd
sp-security.test 26.9 KB