Bug #94368 show errors from previous MySQL operation
Submitted: 17 Feb 17:21 Modified: 18 Feb 9:34
Reporter: PRABHU R Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:8 OS:Microsoft Windows
Assigned to: CPU Architecture:Other

[17 Feb 17:21] PRABHU R
Description:
 	show errors from previous MySQL operation
------------------------------------------------------------
show errors not getting updated..
 Compared with other RDBMS (MS SQLSERVER) working Fine..
But Mysql issue persist..

KIndly forward to developers...

How to repeat:
I did,
       SELECT * FROM unknown_table;
       SELECT @@error_count;

       --Returns Error
       --Returns Errorcount as 1
       
       SELECT 1;
       SELECT @@error_count;

       --Returns 1
       --Returns Errorcount as 1

I expected,

       SELECT * FROM unknown_table;
       SELECT @@error_count;

       --Returns Error
       --Returns Errorcount as 1

       SELECT 1;
       SELECT @@error_count;

       --Returns 1
       --Returns Errorcount as 0

It happens,

           show errors from previous MySQL operation

Suggested fix:
 Already gone thru' this documentation...

[17 Feb 17:00] Miguel Solorzano

Thank you for the bug report. Behavior according documented on Manual:
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html
[17 Feb 17:27] PRABHU R
Bug #94366 : Last Call marked as not bug...
[18 Feb 9:34] Umesh Shastry
I quickly tried on latest GA build, I'm not seeing any issues.

-- 8.0.15

mysql> show variables like '%version%';
+--------------------------+------------------------------+
| Variable_name            | Value                        |
+--------------------------+------------------------------+
| immediate_server_version | 999999                       |
| innodb_version           | 8.0.15                       |
| original_server_version  | 999999                       |
| protocol_version         | 10                           |
| slave_type_conversions   |                              |
| tls_version              | TLSv1,TLSv1.1,TLSv1.2        |
| version                  | 8.0.15                       |
| version_comment          | MySQL Community Server - GPL |
| version_compile_machine  | x86_64                       |
| version_compile_os       | linux-glibc2.12              |
| version_compile_zlib     | 1.2.11                       |
+--------------------------+------------------------------+
11 rows in set (0.01 sec)

mysql> SELECT * FROM unknown_table;
ERROR 1146 (42S02): Table 'sbtest.unknown_table' doesn't exist
mysql>        SELECT @@error_count;
+---------------+
| @@error_count |
+---------------+
|             1 |
+---------------+
1 row in set (0.00 sec)

mysql>        SELECT 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

mysql>        SELECT @@error_count;
+---------------+
| @@error_count |
+---------------+
|             0 |
+---------------+
1 row in set (0.00 sec)

- 5.7.25

 bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.25 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database test;
Query OK, 1 row affected (0.00 sec)

mysql> use test
Database changed
mysql>   SELECT * FROM unknown_table;
ERROR 1146 (42S02): Table 'test.unknown_table' doesn't exist
mysql>        SELECT @@error_count;
+---------------+
| @@error_count |
+---------------+
|             1 |
+---------------+
1 row in set (0.00 sec)

mysql>        SELECT 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

mysql>        SELECT @@error_count;
+---------------+
| @@error_count |
+---------------+
|             0 |
+---------------+
1 row in set (0.00 sec)

Thank you for your interest in MySQL.