Closed
Description
Bug Report
This feature is used by the test suite. I've never seen it used by applications or users, but it seems easy to implement.
1. Minimal reproduce step (Required)
show count(*) warnings;
show count(*) errors;
2. What did you expect to see? (Required)
mysql [localhost:8024] {msandbox} (test) > show count(*) warnings;
+-------------------------+
| @@session.warning_count |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
mysql [localhost:8024] {msandbox} (test) > show count(*) errors;
+-----------------------+
| @@session.error_count |
+-----------------------+
| 0 |
+-----------------------+
1 row in set (0.00 sec)
3. What did you see instead (Required)
mysql> show count(*) warnings;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 10 near "count(*) warnings"
mysql> show count(*) errors;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 10 near "count(*) errors"
mysql> select @@session.error_count;
+-----------------------+
| @@session.error_count |
+-----------------------+
| 0 |
+-----------------------+
1 row in set (0.00 sec)
mysql> select @@session.warning_count;
+-------------------------+
| @@session.warning_count |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.1.0-alpha-87-g0158f71cd-dirty
Edition: Community
Git Commit Hash: 0158f71cda6ccbbd382c6e8759904234baca259c
Git Branch: master
UTC Build Time: 2021-06-01 18:35:21
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)