Bug #42364 SHOW ERRORS returns empty resultset after dropping non existent table
Submitted: 27 Jan 9:49 Modified: 12 Nov 20:05
Reporter: Georg Richter
Status: Closed
Category:Server: Errors Severity:S3 (Non-critical)
Version:5.0.74, 5.1.32 OS:Any
Assigned to: Sergey Gluhov Target Version:5.1+
Tags: regression
Triage: Triaged: D3 (Medium)

[27 Jan 9:49] Georg Richter
Description:
SHOW ERRORS returns an empty resultset when dropping a non existent table.

test_errors function in mysql_client_test should be fixed too, since it doesn't check the
resultset properly.

How to repeat:
Version: /usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.1.32, for suse-linux-gnu
(x86_64) using readline 5.1

mysql> drop table foo;
ERROR 1051 (42S02): Unknown table 'foo'
mysql> show errors;
Empty set (0.00 sec)

This works fine with 4.1:
Server version: 4.1.22-log

mysql> drop table foo;
ERROR 1051 (42S02): Unknown table 'foo'
mysql> show errors;
+-------+------+---------------------+
| Level | Code | Message             |
+-------+------+---------------------+
| Error | 1051 | Unknown table 'foo' |
+-------+------+---------------------+
1 row in set (0.00 sec)
[27 Jan 9:51] Tonci Grgin
Verified as described with several server versions on Windows.
[27 Jan 9:59] Georg Richter
Fix for test_errors in mysql_client_test

Attachment: mysql_client_test.patch (text/x-patch), 362 bytes.

[19 Jun 12:28] Bjorn Munch
This is not an MTR issue.
[1 Jul 14:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/77647

2990 Sergey Glukhov	2009-07-01
      Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
      enabled message storing into error message list
      for 'drop table' command
     @ mysql-test/r/warnings.result
        test result
     @ mysql-test/t/warnings.test
        test case
     @ sql/sql_table.cc
        enabled message storing into error message list
        for 'drop table' command
     @ tests/mysql_client_test.c
        test fix
[3 Jul 11:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/77859

2994 Sergey Glukhov	2009-07-03
      Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
      enabled message storing into error message list
      for 'drop table' command
     @ mysql-test/r/warnings.result
        test result
     @ mysql-test/t/warnings.test
        test case
     @ sql/sql_table.cc
        We should skip error sending then we should return
        warnings to client as some functions may send its
        own errors, so we should set no_warnings_for_error= 0
        only in case of warning.
        The fix is to enable message storing into error message
        list for 'drop table' command(only for error case).
     @ tests/mysql_client_test.c
        test fix
[6 Jul 8:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/77966

2998 Ramil Kalimullin	2009-07-06
      Fix for bug#42364 reverted.
[8 Jul 15:30] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source
revid:ramil@mysql.com-20090706065553-ybmr7xntdb3ysuci) (merge vers: 5.1.37) (pib:11)
[9 Jul 9:37] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source
revid:ramil@mysql.com-20090706065553-ybmr7xntdb3ysuci) (merge vers: 5.1.37) (pib:11)
[10 Jul 13:20] Bugs System
Pushed into 5.4.4-alpha
(revid:anozdrin@bk-internal.mysql.com-20090710111017-bnh2cau84ug1hvei) (version source
revid:ramil@mysql.com-20090706070111-eg8v3gioi6u0vzag) (merge vers: 5.4.4-alpha) (pib:11)
[26 Aug 15:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l)
(version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers:
5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 15:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc)
(version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers:
5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 15:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4)
(version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers:
5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 18:32] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr)
(version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers:
5.1.37-ndb-7.0.8) (pib:11)
[9 Sep 10:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/82775

3095 Sergey Glukhov	2009-09-09
      Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
      partial backport of bug43138 fix
     @ mysql-test/r/warnings.result
        test result
     @ mysql-test/t/warnings.test
        test case
     @ sql/sql_class.cc
        partial backport of bug43138 fix
     @ sql/sql_class.h
        partial backport of bug43138 fix
     @ sql/sql_table.cc
        partial backport of bug43138 fix
[10 Sep 11:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/82908

3116 Sergey Glukhov	2009-09-10
      Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
      partial backport of bug43138 fix
     @ mysql-test/r/warnings.result
        test result
     @ mysql-test/t/warnings.test
        test case
     @ sql/sql_class.cc
        partial backport of bug43138 fix
     @ sql/sql_class.h
        partial backport of bug43138 fix
     @ sql/sql_table.cc
        partial backport of bug43138 fix
[14 Sep 18:03] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (version
source revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (merge vers: 5.4.4-alpha)
(pib:11)
[15 Sep 22:36] Paul DuBois
Noted in 5.1.37, 5.4.4 changelogs.

SHOW ERRORS returned an empty result set after an attempt to drop a
nonexistent table.
[17 Sep 12:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/83577

3111 Sergey Glukhov	2009-09-17
      Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
       additional backport of of bug43138 fix
     @ mysql-test/t/myisam-system.test
        additional backport of of bug43138 fix
     @ sql/sql_db.cc
        additional backport of of bug43138 fix
[17 Sep 14:33] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/83600

3111 Sergey Glukhov	2009-09-17
      Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
      additional backport of of bug43138 fix
     @ mysql-test/t/myisam-system.test
        additional backport of of bug43138 fix
     @ sql/sql_db.cc
        additional backport of of bug43138 fix
[30 Sep 10:18] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20090929093622-1mooerbh12e97zux) (version
source revid:sergey.glukhov@sun.com-20090917114056-3f3anqkqeiql8khv) (merge vers:
5.4.4-alpha) (pib:11)
[30 Sep 10:20] Bugs System
Pushed into 5.4.5-beta (revid:alik@sun.com-20090925094254-tjl9eajkzwzgthoe) (version
source revid:alik@sun.com-20090918152344-nl5pzeugpejb2sth) (merge vers: 5.4.3-beta)
(pib:11)
[2 Oct 1:42] Paul DuBois
Moved 5.4 changelog entry from 5.4.4 to 5.4.3.
Noted in 6.0.14 changelog.
[6 Oct 11:01] Bugs System
Pushed into 5.1.40 (revid:joro@sun.com-20091006073316-lea2cpijh9r6on7c) (version source
revid:sergey.glukhov@sun.com-20090917113323-agtvt6240jo1b7yo) (merge vers: 5.1.39)
(pib:11)
[3 Nov 8:17] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091102151658-j9o4wgro47m5v84d) (version
source revid:alik@sun.com-20091023064702-2f8jdmny61bdl94u) (merge vers: 6.0.14-alpha)
(pib:13)
[12 Nov 9:17] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version
source revid:mikael@mysql.com-20091103113702-p61dlwc6ml6fxg18) (merge vers: 5.5.0-beta)
(pib:13)
[12 Nov 20:05] Paul DuBois
Noted in 5.5.0 changelog.