From: Alexander Nozdrin Date: October 14 2010 10:12am Subject: bzr push into mysql-5.5-bugteam branch (alexander.nozdrin:3244 to 3245) Bug#48874 List-Archive: http://lists.mysql.com/commits/120766 X-Bug: 48874 Message-Id: <201010141012.o9E6cGeT016150@acsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4188925373825277672==" --===============4188925373825277672== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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|| --===============4188925373825277672== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/alexander.nozdrin@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: alexander.nozdrin@stripped\ # ej9ai4fpkhz2ks5y # target_branch: file:///home/alik/MySQL/bzr/mysql-5.5-bugteam/ # testament_sha1: 197e3cd2397ddc99eaddbcf8c42d6d9ae5e22d84 # timestamp: 2010-10-14 14:12:12 +0400 # source_branch: file:///home/alik/MySQL/bzr/mysql-5.5/ # base_revision_id: davi.arnaut@stripped\ # 0hhdj147bwsa0gxt # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWXojp8AAAhvfgCAQWGf//3IB DAC////0YAYnO7u+6qrY9GvVvu7e4JA8JKagmE0T0wp+qeUzSaGTJk00DQaDJBMVP01HiKeU9J6T Q0aAAGgAlENNTVP0k9E9Jpp6mQBoMhoANAlNFU/ITJGZTQ0yaaPRMhoBoADaooekyeoA0aDQABoA AAkiCaAmTRNPQmmKepPNKNPU0ZNB6MSnFxju6A7l8fxVHwl7efNsHl9uF5SIzjgtCtwHBwR6G0ps VVkkeOB4oEuNlc1OTEob/R7nOQ/kRQyZGKbXmQ7ORZKU1OmwaoykA45uDsECECEIQhCLiWKczzt4 JSlbgSjUUa3nUKQlRGlHp7dc4rLIhV4XCQMVZkIwulrjJ7IYpjox7xHZV3N4LppP2U5D0iY0723N huiIznDVC28KQZBEQ3qOyvw6ilNPibTGIc7TFsFTba1ZYR36bbKJXzvhhfky96hxCJGmSlSuIrnj T1YJgXq9Jm2EIYcGHDXjjJmH5rhoVCtcqgDNNcHjCMQ+SuR0qFUIf2cR9dDhv1vDjqHufZLBkmlh QFcaDefmV1HnGk5Du068W8ApmI6uFJplfSJUEctAVZMxXrM8iJiwaj4FroV7CG28hKBlIQdK4MG2 4V5H4SloYXzMgs5oDik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