From 7240746776d97c8a4411ca9c09674e7006eeec89 Mon Sep 17 00:00:00 2001
From: unknown <davi@mysql.com/endora.local>
Date: Wed, 6 Feb 2008 11:20:15 -0200
Subject: [PATCH] Bug#32710: SHOW INNODB STATUS requires SUPER

Changed "SHOW ENGINE ... STATUS" and "SHOW ENGINE ... MUTEX"
to require the PROCESS privilege, instead of SUPER.

Fixed by Damien Katz


mysql-test/r/show_check.result:
  Add test case result for Bug#32710
mysql-test/t/show_check.test:
  Add test case for Bug#32710
sql/sql_parse.cc:
  Require PROCESS privilege instead of SUPER.
---
 mysql-test/r/show_check.result |  5 +++++
 mysql-test/t/show_check.test   | 19 +++++++++++++++++++
 sql/sql_parse.cc               |  4 ++--
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index ff32d2a1512..c5fcb833933 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -1427,4 +1427,9 @@ DROP FUNCTION f1;
 DROP TABLE t1;
 DROP EVENT ev1;
 SHOW TABLE TYPES;
+CREATE USER test_u@localhost;
+GRANT PROCESS ON *.* TO test_u@localhost;
+SHOW ENGINE MYISAM MUTEX;
+SHOW ENGINE MYISAM STATUS;
+DROP USER test_u@localhost;
 End of 5.1 tests
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 34e1941c9d7..613e9acc4c4 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -1115,5 +1115,24 @@ DROP EVENT ev1;
 SHOW TABLE TYPES;
 --enable_result_log
 
+#
+# Bug #32710: SHOW INNODB STATUS requires SUPER
+#
+
+
+CREATE USER test_u@localhost;
+GRANT PROCESS ON *.* TO test_u@localhost;
+
+connect (conn1, localhost, test_u,,);
+
+--disable_result_log
+SHOW ENGINE MYISAM MUTEX;
+SHOW ENGINE MYISAM STATUS;
+--enable_result_log
+
+disconnect conn1;
+connection default;
+DROP USER test_u@localhost;
+
 
 --echo End of 5.1 tests
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 221c156fe6b..226cd8f9432 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2271,14 +2271,14 @@ mysql_execute_command(THD *thd)
 #endif /* HAVE_REPLICATION */
   case SQLCOM_SHOW_ENGINE_STATUS:
     {
-      if (check_global_access(thd, SUPER_ACL))
+      if (check_global_access(thd, PROCESS_ACL))
         goto error;
       res = ha_show_status(thd, lex->create_info.db_type, HA_ENGINE_STATUS);
       break;
     }
   case SQLCOM_SHOW_ENGINE_MUTEX:
     {
-      if (check_global_access(thd, SUPER_ACL))
+      if (check_global_access(thd, PROCESS_ACL))
         goto error;
       res = ha_show_status(thd, lex->create_info.db_type, HA_ENGINE_MUTEX);
       break;
-- 
2.30.9