diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-09-27 20:09:46 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-09-27 20:09:46 +0200 |
commit | 474fe6d9d9e0b4d8803bdf439dd017ba0c729729 (patch) | |
tree | 6b088655217934bf0cbb6cdf85df0a217ef1d939 /sql/event_scheduler.cc | |
parent | cd9f773020c6ddfc1ea39e9037e4258b8bc32a08 (diff) | |
download | mariadb-git-474fe6d9d9e0b4d8803bdf439dd017ba0c729729.tar.gz |
fixes for test failures
and small collateral changes
mysql-test/lib/My/Test.pm:
somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
this differs, because we don't rewrite general log queries, and multi-statement
packets are logged as a one entry. this result file is identical to what mysql-5.6.5
produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r-- | sql/event_scheduler.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index fae703e23c4..58aedcc45e2 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,8 +38,8 @@ #define LOCK_DATA() lock_data(SCHED_FUNC, __LINE__) #define UNLOCK_DATA() unlock_data(SCHED_FUNC, __LINE__) -#define COND_STATE_WAIT(mythd, abstime, msg) \ - cond_wait(mythd, abstime, msg, SCHED_FUNC, __LINE__) +#define COND_STATE_WAIT(mythd, abstime, stage) \ + cond_wait(mythd, abstime, stage, SCHED_FUNC, __FILE__, __LINE__) extern pthread_attr_t connection_attrib; @@ -405,7 +405,7 @@ Event_scheduler::start() } pre_init_event_thread(new_thd); new_thd->system_thread= SYSTEM_THREAD_EVENT_SCHEDULER; - new_thd->command= COM_DAEMON; + new_thd->set_command(COM_DAEMON); /* We should run the event scheduler thread under the super-user privileges. @@ -632,7 +632,7 @@ Event_scheduler::stop() { /* Synchronously wait until the scheduler stops. */ while (state != INITIALIZED) - COND_STATE_WAIT(thd, NULL, "Waiting for the scheduler to stop"); + COND_STATE_WAIT(thd, NULL, &stage_waiting_for_scheduler_to_stop); goto end; } @@ -674,7 +674,7 @@ Event_scheduler::stop() */ struct timespec top_time; set_timespec(top_time, 2); - COND_STATE_WAIT(thd, &top_time, "Waiting scheduler to stop"); + COND_STATE_WAIT(thd, NULL, &stage_waiting_for_scheduler_to_stop); } while (state == STOPPING); DBUG_PRINT("info", ("Scheduler thread has cleaned up. Set state to INIT")); sql_print_information("Event Scheduler: Stopped"); @@ -768,16 +768,17 @@ Event_scheduler::unlock_data(const char *func, uint line) */ void -Event_scheduler::cond_wait(THD *thd, struct timespec *abstime, const char* msg, - const char *func, uint line) +Event_scheduler::cond_wait(THD *thd, struct timespec *abstime, const PSI_stage_info *stage, + const char *src_func, const char *src_file, uint src_line) { DBUG_ENTER("Event_scheduler::cond_wait"); waiting_on_cond= TRUE; - mutex_last_unlocked_at_line= line; + mutex_last_unlocked_at_line= src_line; mutex_scheduler_data_locked= FALSE; - mutex_last_unlocked_in_func= func; + mutex_last_unlocked_in_func= src_func; if (thd) - thd->enter_cond(&COND_state, &LOCK_scheduler_state, msg); + thd->enter_cond(&COND_state, &LOCK_scheduler_state, stage, + NULL, src_func, src_file, src_line); DBUG_PRINT("info", ("mysql_cond_%swait", abstime? "timed":"")); if (!abstime) @@ -790,11 +791,11 @@ Event_scheduler::cond_wait(THD *thd, struct timespec *abstime, const char* msg, This will free the lock so we need to relock. Not the best thing to do but we need to obey cond_wait() */ - thd->exit_cond(""); + thd->exit_cond(NULL, src_func, src_file, src_line); LOCK_DATA(); } - mutex_last_locked_in_func= func; - mutex_last_locked_at_line= line; + mutex_last_locked_in_func= src_func; + mutex_last_locked_at_line= src_line; mutex_scheduler_data_locked= TRUE; waiting_on_cond= FALSE; DBUG_VOID_RETURN; |