Bug #42364 SHOW ERRORS returns empty resultset after dropping non existent table
Submitted: 27 Jan 2009 8:49 Modified: 18 Dec 2009 20:42
Reporter: Georg Richter Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.0.74, 5.1.32 OS:Any
Assigned to: Sergey Glukhov CPU Architecture:Any
Tags: regression
Triage: Triaged: D3 (Medium)

[27 Jan 2009 8: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 2009 8:51] Tonci Grgin
Verified as described with several server versions on Windows.
[27 Jan 2009 8:59] Georg Richter
Fix for test_errors in mysql_client_test

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

[19 Jun 2009 10:28] Bjørn Munch
This is not an MTR issue.
[1 Jul 2009 12: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 2009 9: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 2009 6: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 2009 13: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 2009 7: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 2009 11: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 2009 13: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 2009 13: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 2009 13: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 2009 16: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 2009 8: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 2009 9: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 2009 16: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 2009 20: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 2009 10: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 2009 12: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 2009 8: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 2009 8: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)
[1 Oct 2009 23:42] Paul Dubois
Moved 5.4 changelog entry from 5.4.4 to 5.4.3.
Noted in 6.0.14 changelog.
[6 Oct 2009 9: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 2009 7: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 2009 8: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 2009 19:05] Paul Dubois
Noted in 5.5.0 changelog.
[18 Dec 2009 10:28] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:44] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 10:59] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:14] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)