• Sergei Golubchik's avatar
    MDEV-6960 Server crashes in check_alter_user on setting a default role via PS · ba80708f
    Sergei Golubchik authored
    There were two issues:
    
    * set_var_default_role::user was overwritten with a new value,
      allocated in the thd->mem_root, which is reset between executions.
      That was causing the crash. Solved by introducing set_var_default_role::real_user
    
    * when privilege tables were opened on EXECUTE, the reprepare_observer
      would abort the statement (as privilege tables are opened using
      the local TABLE_LIST that doesn't preserve metadata from PREPARE, so
      reprepare_observer thought they're changed). This issue also applied
      to SET PASSWORD. Solved by disabling reprepare_observer.
    ba80708f
set_default_role_ps-6960.result 221 Bytes