Skip to content
  • Dmitry Lenev's avatar
    74dfe884
    Bug#31304432 "INSUFFICIENT PRIVILEGE CHECK BY LOCK TABLES". · 74dfe884
    Dmitry Lenev authored
    
    
    The problem was that LOCK TABLES statement on a view did insufficient
    privilege checking for view's underlying tables.
    
    This patch solves the problem by ensuring that when we lock tables
    through a view we require the same SELECT and LOCK TABLES privileges
    on its underlying tables as would have been required if these tables
    were locked directly.
    
    To avoid breaking mysqldump/pump tools which need to be able to dump
    views with broken definer, which in default mode involves locking of
    such views, we accept both cases when:
    1) User whose context will be used for view execution has necessary
       privileges on underlying tables.
    2) User who originally inititated LOCK TABLES operation has them
       (which is typically for admin/backup users used for dumping).
    
    This is version of the patch for 5.6 branch.
    
    Reviewed-by: default avatarSivert Sorumgaard <sivert.sorumgaard@oracle.com>
    Reviewed-by: default avatarGopal Shankar <gopal.shankar@oracle.com>
    74dfe884
    Bug#31304432 "INSUFFICIENT PRIVILEGE CHECK BY LOCK TABLES".
    Dmitry Lenev authored
    
    
    The problem was that LOCK TABLES statement on a view did insufficient
    privilege checking for view's underlying tables.
    
    This patch solves the problem by ensuring that when we lock tables
    through a view we require the same SELECT and LOCK TABLES privileges
    on its underlying tables as would have been required if these tables
    were locked directly.
    
    To avoid breaking mysqldump/pump tools which need to be able to dump
    views with broken definer, which in default mode involves locking of
    such views, we accept both cases when:
    1) User whose context will be used for view execution has necessary
       privileges on underlying tables.
    2) User who originally inititated LOCK TABLES operation has them
       (which is typically for admin/backup users used for dumping).
    
    This is version of the patch for 5.6 branch.
    
    Reviewed-by: default avatarSivert Sorumgaard <sivert.sorumgaard@oracle.com>
    Reviewed-by: default avatarGopal Shankar <gopal.shankar@oracle.com>
Loading