Description:
A query that uses a full index scan is not logged when log_queries_not_using_indexes is ON.
How to repeat:
1、 create table t1(c1 int, c2 char(255), c3 varchar(1000), primary key(c1,c2), index(c1));
2、insert into t1 values(1,'c21','c31'),(2,'c22','c32'),(3,'c23','c33'),(4,'c24','c34'),(5,'c25','c35');
3、set global slow_query_log=on;
4、set global log_queries_not_using_indexes=on;
5、mysql> explain select c1 from t1 where c2='c21';
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------+
| 1 | SIMPLE | t1 | NULL | index | PRIMARY,c1 | c1 | 4 | NULL | 5 | 20.00 | Using where; Using index |
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------+
1 row in set, 1 warning (14.71 sec)
5、select c1 from t1 where c2='c21';
6、check the slow query log, the query above was not logged.