List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:October 22 2009 6:22pm
Subject:bzr commit into mysql-5.5.0-next-mr-runtime branch (alik:2892)
Bug#43138
View as plain text  
#At file:///mnt/raid/alik/MySQL/bzr/backporting/mysql-next-mr-runtime/ based on revid:alik@stripped

 2892 Alexander Nozdrin	2009-10-22
      Backporting a patch for Bug#43138. That patch had been already backported
      to 5.1 partially. This patch brings what was left to mysql-next-mr.
      
      Original revisions in 6.0:
      ------------------------------------------------------------
      revno: 2617.31.26
      committer: Alexander Nozdrin <alik@stripped>
      branch nick: 6.0-rt-bug43138.3
      timestamp: Thu 2009-04-30 19:31:30 +0400
      message:
        Fix for Bug#43138: DROP DATABASE failure does not clean up message list.
        
        The problem was that the high-level function mysql_rm_db() invoked
        low-level mysql_rm_table_part2(), which reported low-level error
        (Unknown table) if SE refused to delete a table. Also when
        mysql_rm_table_part2() reported an error, it didn't add corresponding
        warning into the list (because it is used from other places where such
        behaviour is required).
        
        The fix is to
          1. Remove no_warnings_for_error usage from sql_table.cc
          2. Improve internal error handler support in THD, so that
             a stack of error handlers is allowed.
          3. Create an internal error handler (Drop_table_error_handler)
             to silence useless warnings.
          4. Use the handler in DROP DATABASE and DROP TABLE statements.
      ------------------------------------------------------------
      revno: 2617.69.38
      committer: Alexander Nozdrin <alik@stripped>
      branch nick: mysql-next-bugfixing-bug37431
      timestamp: Mon 2009-08-24 21:52:09 +0400
      message:
        A test case for Bug#37431 (DROP TABLE does not report errors correctly).
      ------------------------------------------------------------
      revno: 2617.31.29
      committer: Dmitry Lenev <dlenev@stripped>
      branch nick: mysql-6.0-runtime
      timestamp: Fri 2009-05-01 17:37:34 +0400
      message:
        Follow-up for fix for bug "Bug#43138: DROP DATABASE failure
        does not clean up message list".
        
        Fixed drop.test failure under non-debug server by moving part
        of test dependent on debug-only feature to separate .test file,
        which won't be run for non-debug versions of server.
      ------------------------------------------------------------
      revno: 2617.45.17
      committer: Sergei Golubchik <serg@stripped>
      branch nick: 6.0-maria
      timestamp: Wed 2009-05-13 20:08:58 +0200
      message:
        followup for bug#43138
        if delete fails with a permission denied error, we want to show it
      ------------------------------------------------------------
      
      The patch was backported to 5.1 in scope of Bug#42364 by
      the following revision:
      ------------------------------------------------------------
      revno: 2497.975.3
      committer: Sergey Glukhov <Sergey.Glukhov@stripped>
      branch nick: mysql-5.1-bugteam
      timestamp: Fri 2009-07-03 13:22:06 +0500
      message:
        Bug#42364 SHOW ERRORS returns empty resultset after dropping non existent table
        enabled message storing into error message list
        for 'drop table' command
      ------------------------------------------------------------

    modified:
      mysql-test/r/drop.result
      mysql-test/t/drop.test
      sql/sql_class.cc
      sql/sql_table.cc
=== modified file 'mysql-test/r/drop.result'
--- a/mysql-test/r/drop.result	2008-04-03 09:50:43 +0000
+++ b/mysql-test/r/drop.result	2009-10-22 18:22:53 +0000
@@ -121,3 +121,17 @@ ERROR 42000: Incorrect table name '#mysq
 use test;
 drop database mysqltestbug26703;
 End of 5.1 tests
+
+# --
+# -- Bug#37431 (DROP TABLE does not report errors correctly).
+# --
+DROP TABLE IF EXISTS t1;
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
+SHOW WARNINGS;
+Level	Code	Message
+Error	1051	Unknown table 't1'
+
+# --
+# -- End of Bug#37431.
+# --

=== modified file 'mysql-test/t/drop.test'
--- a/mysql-test/t/drop.test	2009-05-15 10:15:56 +0000
+++ b/mysql-test/t/drop.test	2009-10-22 18:22:53 +0000
@@ -202,3 +202,24 @@ use test;
 drop database mysqltestbug26703;
 
 --echo End of 5.1 tests
+
+###########################################################################
+
+--echo
+--echo # --
+--echo # -- Bug#37431 (DROP TABLE does not report errors correctly).
+--echo # --
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;
+
+SHOW WARNINGS;
+
+--echo
+--echo # --
+--echo # -- End of Bug#37431.
+--echo # --

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2009-10-14 16:37:38 +0000
+++ b/sql/sql_class.cc	2009-10-22 18:22:53 +0000
@@ -390,7 +390,7 @@ char *thd_security_context(THD *thd, cha
 
 
 /**
-  Implementation of Drop_table_error_handler::handle_error().
+  Implementation of Drop_table_error_handler::handle_condition().
   The reason in having this implementation is to silence technical low-level
   warnings during DROP TABLE operation. Currently we don't want to expose
   the following warnings during DROP TABLE:

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-10-16 13:41:43 +0000
+++ b/sql/sql_table.cc	2009-10-22 18:22:53 +0000
@@ -2054,6 +2054,12 @@ int mysql_rm_table_part2(THD *thd, TABLE
     }
     DBUG_PRINT("table", ("table: 0x%lx  s: 0x%lx", (long) table->table,
                          table->table ? (long) table->table->s : (long) -1));
+
+    DBUG_EXECUTE_IF("bug43138",
+                    my_printf_error(ER_BAD_TABLE_ERROR,
+                                    ER(ER_BAD_TABLE_ERROR), MYF(0),
+                                    table->table_name););
+
   }
   /*
     It's safe to unlock LOCK_open: we have an exclusive lock


Attachment: [text/bzr-bundle] bzr/alik@sun.com-20091022182253-je34dzwysaq6sufi.bundle
Thread
bzr commit into mysql-5.5.0-next-mr-runtime branch (alik:2892)Bug#43138Alexander Nozdrin22 Oct