List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:October 14 2010 10:10am
Subject:bzr push into mysql-5.5-bugteam branch (alexander.nozdrin:3244 to 3245)
Bug#48874
View as plain text  
 3245 Alexander Nozdrin	2010-10-14
      A patch for Bug#48874 (Test "is_triggers" fails because of wrong charset info).
      
      The thing is that the following attributes are fixed (remembered) when a trigger
      is created:
        - character_set_client
        - character_set_results
        - collation_connection
      
      There are two triggers created in mysql-test/include/mtr_warnings.sql.
      They were created using "current default" character set / collation.
      is_triggers.test shows definition of these triggers including recorded
      character set information.
      
      The problem was that if "current default" changed, the recorded character
      set information was not accurate.
      
      There might be two ways to fix that:
        a) update is_triggers.test so that it does not put character-set information
           into result-file;
        b) update mtr_warnings.sql so that the triggers are created using
           hard-coded character sets.
      
      This patch implements option b).

    modified:
      mysql-test/include/mtr_warnings.sql
 3244 Davi Arnaut	2010-10-13
      Bug#56096: STOP SLAVE hangs if executed in parallel with user sleep
      
      The root of the problem is that to interrupt a slave SQL thread
      wait, the STOP SLAVE implementation uses thd->awake(THD::NOT_KILLED).
      This appears as a spurious wakeup (e.g. from a sleep on a
      condition variable) to the code that the slave SQL thread is
      executing at the time of the STOP. If the code is not written
      to be spurious-wakeup safe, unexpected behavior can occur. For
      the reported case, this problem led to an infinite loop around
      the interruptible_wait() function in item_func.cc (SLEEP()
      function implementation).  The loop was not being properly
      restarted and, consequently, would not come to an end. Since the
      SLEEP function sleeps on a timed event in order to be killable
      and to perform periodic checks until the requested time has
      elapsed, the spurious wake up was causing the requested sleep
      time to be reset every two seconds.
      
      The solution is to calculate the requested absolute time only
      once and to ensure that the thread only sleeps until this
      time is elapsed. In case of a spurious wake up, the sleep is
      restarted using the previously calculated absolute time. This
      restores the behavior present in previous releases. If a slave
      thread is executing a SLEEP function, a STOP SLAVE statement
      will wait until the time requested in the sleep function
      has elapsed.
     @ mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
        Add test case for Bug#56096.
     @ mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
        Add test case result for Bug#56096.
     @ sql/item_func.cc
        Reorganize interruptible_wait into a class so that the absolute
        time can be preserved across calls to the wait function. This
        allows the sleep to be properly restarted in the presence of
        spurious wake ups, including those generated by a STOP SLAVE.

    modified:
      mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
      mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
      sql/item_func.cc
=== modified file 'mysql-test/include/mtr_warnings.sql'
--- a/mysql-test/include/mtr_warnings.sql	2010-06-02 16:08:06 +0000
+++ b/mysql-test/include/mtr_warnings.sql	2010-10-14 10:05:59 +0000
@@ -16,6 +16,12 @@ CREATE TABLE test_suppressions (
 -- no invalid patterns can be inserted
 -- into test_suppressions
 --
+SET @character_set_client_saved = @@character_set_client||
+SET @character_set_results_saved = @@character_set_results||
+SET @collation_connection_saved = @@collation_connection||
+SET @@character_set_client = latin1||
+SET @@character_set_results = latin1||
+SET @@collation_connection = latin1_swedish_ci||
 /*!50002
 CREATE DEFINER=root@localhost TRIGGER ts_insert
 BEFORE INSERT ON test_suppressions
@@ -24,6 +30,9 @@ FOR EACH ROW BEGIN
   SELECT "" REGEXP NEW.pattern INTO dummy;
 END
 */||
+SET @@character_set_client = @character_set_client_saved||
+SET @@character_set_results = @character_set_results_saved||
+SET @@collation_connection = @collation_connection_saved||
 
 
 --
@@ -38,6 +47,12 @@ CREATE TABLE global_suppressions (
 -- no invalid patterns can be inserted
 -- into global_suppressions
 --
+SET @character_set_client_saved = @@character_set_client||
+SET @character_set_results_saved = @@character_set_results||
+SET @collation_connection_saved = @@collation_connection||
+SET @@character_set_client = latin1||
+SET @@character_set_results = latin1||
+SET @@collation_connection = latin1_swedish_ci||
 /*!50002
 CREATE DEFINER=root@localhost TRIGGER gs_insert
 BEFORE INSERT ON global_suppressions
@@ -46,6 +61,9 @@ FOR EACH ROW BEGIN
   SELECT "" REGEXP NEW.pattern INTO dummy;
 END
 */||
+SET @@character_set_client = @character_set_client_saved||
+SET @@character_set_results = @character_set_results_saved||
+SET @@collation_connection = @collation_connection_saved||
 
 
 


Attachment: [text/bzr-bundle] bzr/alexander.nozdrin@oracle.com-20101014100559-ej9ai4fpkhz2ks5y.bundle
Thread
bzr push into mysql-5.5-bugteam branch (alexander.nozdrin:3244 to 3245)Bug#48874Alexander Nozdrin14 Oct