diff options
Diffstat (limited to 'mysql-test')
| -rw-r--r-- | mysql-test/r/ps.result | 17 | ||||
| -rw-r--r-- | mysql-test/r/show_check.result | 15 | ||||
| -rw-r--r-- | mysql-test/r/union.result | 8 | ||||
| -rw-r--r-- | mysql-test/t/ps-master.opt | 1 | ||||
| -rw-r--r-- | mysql-test/t/ps.test | 14 | ||||
| -rw-r--r-- | mysql-test/t/show_check-master.opt | 1 | ||||
| -rw-r--r-- | mysql-test/t/show_check.test | 12 |
7 files changed, 64 insertions, 4 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 1727c4ddfbe..1d06ff65439 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1358,4 +1358,21 @@ EXECUTE stmt USING @a; i j i i j DEALLOCATE PREPARE stmt; DROP TABLE IF EXISTS t1, t2, t3; +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. diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 762019be313..1ced624b196 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -630,4 +630,19 @@ 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 +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 diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 12463658bf9..dc174e35c8f 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -836,27 +836,27 @@ count(*) 26 show status like 'Slow_queries'; Variable_name Value -Slow_queries 1 +Slow_queries 0 select count(*) from t1 where b=13; count(*) 10 show status like 'Slow_queries'; Variable_name Value -Slow_queries 3 +Slow_queries 1 select count(*) from t1 where b=13 union select count(*) from t1 where a=7; count(*) 10 26 show status like 'Slow_queries'; Variable_name Value -Slow_queries 5 +Slow_queries 2 select count(*) from t1 where a=7 union select count(*) from t1 where b=13; count(*) 26 10 show status like 'Slow_queries'; Variable_name Value -Slow_queries 7 +Slow_queries 3 flush status; select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6); a diff --git a/mysql-test/t/ps-master.opt b/mysql-test/t/ps-master.opt new file mode 100644 index 00000000000..3eb98fc3d6b --- /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 cc239306558..91700fdae95 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1410,4 +1410,18 @@ DEALLOCATE PREPARE stmt; DROP TABLE IF EXISTS t1, t2, t3; +# +# 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 00000000000..3eb98fc3d6b --- /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 07426193dcf..849be577893 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -507,4 +507,16 @@ SHOW TABLES FROM no_such_database; SHOW COLUMNS FROM no_such_table; +# +# 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 |
