diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index f7a9f0440a3847b93cc4c2552ef63edd45503d4c..7dadb3207a8e7ccbb9d5938298d989faae88ad61 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -1379,6 +1379,23 @@ i
 1
 DEALLOCATE PREPARE stmt;
 DROP TABLE t1, t2;
+flush status;
+prepare sq from 'show status like "slow_queries"';
+execute sq;
+Variable_name	Value
+Slow_queries	0
+prepare no_index from 'select 1 from information_schema.tables limit 1';
+execute sq;
+Variable_name	Value
+Slow_queries	0
+execute no_index;
+1
+1
+execute sq;
+Variable_name	Value
+Slow_queries	1
+deallocate prepare no_index;
+deallocate prepare sq;
 End of 5.0 tests.
 create procedure proc_1() reset query cache;
 call proc_1();
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index b473bbac92309b0b999f1ba28545fb08c416131b..3836148faa9c923acb9c2b49d8bd014d1f51de4d 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -672,7 +672,22 @@ SHOW TABLES FROM no_such_database;
 ERROR 42000: Unknown database 'no_such_database'
 SHOW COLUMNS FROM no_such_table;
 ERROR 42S02: Table 'test.no_such_table' doesn't exist
-End of 5.0 tests.
+flush status;
+show status like 'slow_queries';
+Variable_name  Value
+Slow_queries 0
+show tables;
+Tables_in_test
+show status like 'slow_queries';
+Variable_name  Value
+Slow_queries 0
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name  Value
+Slow_queries 1
+End of 5.0 tests
 SHOW AUTHORS;
 create database mysqltest;
 show create database mysqltest;
diff --git a/mysql-test/t/ps-master.opt b/mysql-test/t/ps-master.opt
new file mode 100644
index 0000000000000000000000000000000000000000..3eb98fc3d6b41fa1ba44551038c00dab7cd4984d
--- /dev/null
+++ b/mysql-test/t/ps-master.opt
@@ -0,0 +1 @@
+--log-slow-queries --log-long-format --log-queries-not-using-indexes
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 902d8fcd9d8f80a3d6d2019fbd0443f08bab26d4..62e2e9e8dd90f6e07bae6ad6ad0eb20dd07dd879 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -1437,6 +1437,20 @@ DEALLOCATE PREPARE stmt;
 DROP TABLE t1, t2;
 
 
+#
+# Bug 19764:  SHOW commands end up in the slow log as table scans
+#
+
+flush status;
+prepare sq from 'show status like "slow_queries"';
+execute sq;
+prepare no_index from 'select 1 from information_schema.tables limit 1';
+execute sq;
+execute no_index;
+execute sq;
+deallocate prepare no_index;
+deallocate prepare sq;
+
 --echo End of 5.0 tests.
 
 #
diff --git a/mysql-test/t/show_check-master.opt b/mysql-test/t/show_check-master.opt
new file mode 100644
index 0000000000000000000000000000000000000000..3eb98fc3d6b41fa1ba44551038c00dab7cd4984d
--- /dev/null
+++ b/mysql-test/t/show_check-master.opt
@@ -0,0 +1 @@
+--log-slow-queries --log-long-format --log-queries-not-using-indexes
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 553b3d9059bfb130e59daa04118affbcacd6342b..7d4ad099e6f867da28c37e3ad3efe74adce0f401 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -501,7 +501,19 @@ SHOW TABLES FROM no_such_database;
 --error ER_NO_SUCH_TABLE
 SHOW COLUMNS FROM no_such_table;
 
-# End of 5.0 tests.
+
+#
+# Bug #19764: SHOW commands end up in the slow log as table scans
+#
+flush status;
+show status like 'slow_queries';
+show tables;
+show status like 'slow_queries';
+# Table scan query, to ensure that slow_queries does still get incremented
+# (mysqld is started with --log-queries-not-using-indexes)
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+
 --echo End of 5.0 tests.
 
 --disable_result_log