• Martin Hansson's avatar
    · e86f08d0
    Martin Hansson authored
    Bug#35996: SELECT + SHOW VIEW should be enough to display
    view definition
    
    During SHOW CREATE VIEW there is no reason to 'anonymize'
    errors that name objects that a user does not have access
    to. Moreover it was inconsistently implemented. For example
    base tables being referenced from a view appear to be ok,
    but not views. The manual on the other hand is clear: If a
    user has the privileges SELECT and SHOW VIEW, the view
    definition is available to that user, period. The fix
    changes the behavior to support the manual.
    
    
    mysql-test/r/information_schema_db.result:
      Bug#35996: Changed warnings.
    mysql-test/r/view_grant.result:
      Bug#35996: Changed warnings, test result.
    mysql-test/t/information_schema_db.test:
      Bug#35996: Changed test case to reflect new behavior.
    mysql-test/t/view_grant.test:
      Bug#35996: Test case.
    sql/sql_acl.cc:
      Bug#35996: Code no longer necessary, we may as well exempt 
      SHOW CREATE VIEW from this check.
    sql/sql_show.cc:
      Bug#35996: The fix: An Internal_error_handler that hides
      most errors raised by access checking as they are not
      relevant to SHOW CREATE VIEW.
    sql/table.cc:
      Bug#35996: Restricting this hack to act only when there is 
      no Internal_error_handler.
    e86f08d0
sql_show.cc 241 KB