List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:July 1 2009 11:03am
Subject:bzr commit into mysql-5.1-bugteam branch (Sergey.Glukhov:2990)
Bug#42364
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.1-bug-42364/ based on revid:satya.bn@stripped

 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

    modified:
      mysql-test/r/warnings.result
      mysql-test/t/warnings.test
      sql/sql_table.cc
      tests/mysql_client_test.c
=== modified file 'mysql-test/r/warnings.result'
--- a/mysql-test/r/warnings.result	2009-02-16 11:38:15 +0000
+++ b/mysql-test/r/warnings.result	2009-07-01 11:03:04 +0000
@@ -313,4 +313,9 @@ ERROR 22001: Data too long for column 'c
 insert into t2 values(@q);
 ERROR 22001: Data too long for column 'c_tinyblob' at row 1
 drop table t1, t2;
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
+SHOW ERRORS;
+Level	Code	Message
+Error	1051	Unknown table 't1'
 End of 5.0 tests

=== modified file 'mysql-test/t/warnings.test'
--- a/mysql-test/t/warnings.test	2009-02-05 09:49:32 +0000
+++ b/mysql-test/t/warnings.test	2009-07-01 11:03:04 +0000
@@ -225,4 +225,11 @@ insert into t2 values(@q);
 
 drop table t1, t2;
 
+#
+# Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
+#
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;
+SHOW ERRORS;
+
 --echo End of 5.0 tests

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-06-29 14:00:47 +0000
+++ b/sql/sql_table.cc	2009-07-01 11:03:04 +0000
@@ -1995,6 +1995,7 @@ int mysql_rm_table_part2(THD *thd, TABLE
   pthread_mutex_unlock(&LOCK_open);
   thd->thread_specific_used|= tmp_table_deleted;
   error= 0;
+  thd->no_warnings_for_error= 0;
   if (wrong_tables.length())
   {
     if (!foreign_key_error)
@@ -2056,7 +2057,6 @@ int mysql_rm_table_part2(THD *thd, TABLE
 err_with_placeholders:
   unlock_table_names(thd, tables, (TABLE_LIST*) 0);
   pthread_mutex_unlock(&LOCK_open);
-  thd->no_warnings_for_error= 0;
   DBUG_RETURN(error);
 }
 

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2009-05-23 13:19:58 +0000
+++ b/tests/mysql_client_test.c	2009-07-01 11:03:04 +0000
@@ -4769,6 +4769,8 @@ static void test_errors()
   result= mysql_store_result(mysql);
   mytest(result);
 
+  DIE_UNLESS(mysql_num_rows(result) == 1);
+
   (void) my_process_result_set(result);
   mysql_free_result(result);
 }


Attachment: [text/bzr-bundle] bzr/sergey.glukhov@sun.com-20090701110304-sn4qcqvf60sdhsax.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (Sergey.Glukhov:2990)Bug#42364Sergey Glukhov1 Jul