Fixed test failure under heavy load, in case truncate table is slow.
mysql-test/r/events_logs_tests.result:
Fixed test failure under heavy load, in case truncate table is slow.
mysql-test/t/events_logs_tests.test:
Fixed test failure under heavy load, in case truncate table is slow.
Moved duplicated code to inline function store_timestamp()
Save thd->time_zone_used when logging to table as CSV internally cases it to be changed
Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables.
Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping
Set TABLE->no_replicate on open
client/mysqlbinlog.cc:
Fixed several memory leaks (most in case of error situations)
mysql-test/r/events_logs_tests.result:
Made long_query_timeout smaller to ensure next query comes into log
mysql-test/r/variables.result:
Make it safe to run test with --log
mysql-test/t/events_logs_tests.test:
Made long_query_timeout smaller to ensure next query comes into log
mysql-test/t/variables.test:
Make it safe to run test with --log
sql/field.cc:
Moved duplicated code to inline function store_timestamp()
sql/field.h:
Moved duplicated code to inline function store_timestamp()
sql/handler.cc:
Reorder checks in likely order
Simplify checks if we should do binary logging
(no_replicate is set once and for all when table is opened)
sql/log.cc:
Save thd->time_zone_used as CVS internally cases it to be changed
Use Field_timestamp->store_timestamp instead of automatic timestamps.
This gives us correct timestamp even if thd->set_time() is not called (in case
of connect) and we don't have to store thd->query_start_used anymore.
sql/sql_base.cc:
Removed not needed comment
Moved LINT_INIT() to after declaration
Renamed temporary variable to avoid compiler warning
Added MYSQL_LOCK_IGNORE_FLUSH to log tables to avoid deadlock in case of flush tables.
Mark log tables with TIMESTAMP_NO_AUTO_SET to avoid automatic timestamping
sql/table.cc:
Set TABLE->no_replicate on open
mysql-test/extra/rpl_tests/rpl_row_func003.test:
Fix spelling error
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Restore sql_mode after test
mysql-test/r/events_logs_tests.result:
Turn even_scheduleroff before test ends
mysql-test/r/events_scheduling.result:
Turn even_scheduleroff before test ends
mysql-test/r/insert.result:
Drop tables t1 before test ends
mysql-test/r/rpl_read_only.result:
Set read_only flag back to default
mysql-test/r/rpl_row_NOW.result:
Drop database mysqltest1 before test ends
mysql-test/r/rpl_row_USER.result:
Drop users created by test
mysql-test/r/rpl_row_basic_11bugs.result:
Drop table and set query_cache_size back to default
mysql-test/r/rpl_row_func002.result:
Drop table created by test
mysql-test/r/rpl_row_sp008.result:
Drop table created by test
mysql-test/r/rpl_row_sp012.result:
Drop user created by test
mysql-test/r/rpl_row_tabledefs_2myisam.result:
Restore sql_mode
mysql-test/r/rpl_row_tabledefs_3innodb.result:
Restore sql_mode
mysql-test/r/rpl_row_tabledefs_7ndb.result:
Restore sql_mode
mysql-test/r/rpl_row_view01.result:
Drop database created by test
mysql-test/r/rpl_slave_status.result:
Remove created users
mysql-test/r/rpl_switch_stm_row_mixed.result:
Reset binlog_format to default
mysql-test/r/sp.result:
Drop procedure created by test
mysql-test/r/varbinary.result:
Drop table created by test
mysql-test/r/variables.result:
Reset changed variables to their defaults
mysql-test/t/events_logs_tests.test:
Turn off event_scheduler before test ends
mysql-test/t/events_scheduling.test:
Turn off event_scheduler
mysql-test/t/insert.test:
Drop table created by test
mysql-test/t/rpl_read_only.test:
Reset read_only flag
mysql-test/t/rpl_row_NOW.test:
Drop db created by test
mysql-test/t/rpl_row_USER.test:
Drop users created
mysql-test/t/rpl_row_basic_11bugs.test:
Drop tables created by test
mysql-test/t/rpl_row_func002.test:
Drop table created by test
mysql-test/t/rpl_row_sp008.test:
Drop table created by test
mysql-test/t/rpl_row_sp012.test:
Drop user created by test
mysql-test/t/rpl_row_view01.test:
Drop db created by test
mysql-test/t/rpl_slave_status.test:
Remove users created by test
mysql-test/t/rpl_switch_stm_row_mixed.test:
Reset binlog_format
mysql-test/t/sp.test:
Drop procedure created by test
mysql-test/t/varbinary.test:
Drop tables created by test
mysql-test/t/variables.test:
Restore variables to their default before test ends
On loaded boxes it is possible a INSERT with sleep of 1.5s to take
more time.
mysql-test/r/events_logs_tests.result:
update result file
mysql-test/t/events_logs_tests.test:
fix test case to be proof of loaded boxes. 20 seconds is reasonable time
not to get a sleep of 1.5s to sleep for 20s
This is a post-review patch.
Fixes the typelib implementation, available only in 5.1.11.
--event-scheduler cmdline : DISABLED | ON | OFF | 0 | 1
DISABLED - makes the scheduler unavailable during the server run
(ON|1)- When the server is started the scheduler will be started. It can
be stopped and restarted by setting appropriate values to
GLOBAL event_scheduler
(OFF|0)- When the server is started, the scheduler won't be started. It
can be started and again stopped by setting appropriate values to
GLOBAL event_scheduler. _DEFAULT_ value
The GLOBAL variable event_scheduler can have the following values:
OFF | ON | 0 | 1
DISABLED is not possible and every attempt will end with an error that
it's not a valid value for the variable.
OFF | 0 - This is the pre-5.1.11 behavior - The scheduler stops, if not
already stopped, and can be started again by setting
the value of the variable to ON|1.
ON | 1 - This is the pre-5.1.11 behavior - The scheduler starts, if not
already started, and can be stopped again by setting the value
of the variable to OFF|0.
mysql-test/r/events.result:
update result
mysql-test/r/events_bugs.result:
update result
mysql-test/r/events_logs_tests.result:
update result
mysql-test/r/events_restart_phase1.result:
update result
mysql-test/r/events_restart_phase3.result:
update result
mysql-test/r/events_scheduling.result:
update result
mysql-test/r/events_stress.result:
update result
mysql-test/t/events.test:
update test:
2 -> off
1 -> on
mysql-test/t/events_bugs.test:
update test:
2 -> off
1 -> on
mysql-test/t/events_logs_tests.test:
update test:
2 -> off
1 -> on
mysql-test/t/events_restart_phase1.test:
update test:
2 -> off
1 -> on
mysql-test/t/events_restart_phase2-master.opt:
update master file : 1 => on
mysql-test/t/events_scheduling.test:
update test:
2 -> off
1 -> on
add tests for event_scheduler global variable representation from
SHOW VARIABLES.
mysql-test/t/events_stress.test:
update test:
2 -> off
1 -> on
sql/events.cc:
Implement two different TYPELIBs for --event-scheduler cmd line
option and for GLOBAL variable event_scheduler
--event-scheduler cmdline : DISABLED | ON | OFF | 0 | 1
DISABLED - makes the scheduler unavailable during the server run
(ON|1)- When the server is started the scheduler will be started. It can
be stopped and restarted by setting appropriate values to
GLOBAL event_scheduler
(OFF|0)- When the server is started, the scheduler won't be started. It
can be started and again stopped by setting appropriate values to
GLOBAL event_scheduler. _DEFAULT_ value
The GLOBAL variable event_scheduler can have the following values:
OFF | ON | 0 | 1
DISABLED is not possible and every attempt will end with an error that
it's not a valid value for the variable.
OFF | 0 - This is the pre-5.1.11 behavior - The scheduler stops, if not
already stopped, and can be started again by setting
the value of the variable to ON|1.
ON | 1 - This is the pre-5.1.11 behavior - The scheduler starts, if not
already started, and can be stopped again by setting the value
of the variable to OFF|0.
sql/events.h:
additional TYPELIB for GLOBAL event_scheduler
sql/mysqld.cc:
--event-scheduler should be checked against a TYPELIB and
therefore should be GET_STR, as well as we make the parameter optional.
When not provided OFF|0 is used.
sql/set_var.cc:
Implement typelib for event_scheduler variable.
If allows both INT_RESULT -> 0 | 1
and STRING_RESULT -> OFF | ON
The variable is shown as DISABLED | ON | OFF
sql/set_var.h:
Implement typelib, which expects both STRING and INT,
for event_scheduler.
More small fixes to the API : use LEX_STRING instead of LEX_STRING* and if error
then return bool(true) instead of error code.
Merged functions. Reduced usage of sp_name.
Fixed a lot of function documentation errors.
Added function documentation wherever needed.
Removed some unused defines and error codes.
Next to come is batch rename of Event_scheduler_ng to Event_scheduler.
mysql-test/r/events.result:
update result
mysql-test/r/events_logs_tests.result:
update result
mysql-test/t/events.test:
more test coverage
mysql-test/t/events_logs_tests.test:
fix test
sql/event_data_objects.cc:
Cosmetics.
Fix function documentation whenever needed.
Move Event_job_data::compile() next to Event_job_data::execute()
sql/event_data_objects.h:
Remove unneeded error codes and defines
Move function declarations at the end of the header
sql/event_db_repository.cc:
Fix function documentation.
Event_db_repository::update_event() now uses LEX_STRING *-s instead of
sp_name . Lower coupling.
sql/event_db_repository.h:
Event_db_repository::update_event() now uses LEX_STRING *-s instead of
sp_name . Lower coupling.
find_event -> find_named_event
find_event_by_name is not used externally, merge with load_named_event()
sql/event_queue.cc:
LEX_STRING* to LEX_STRING
Fix comments.
Fix and add function documentation.
Remove Event_queue::events_count() as it is unused
Change get_top_for_execution_if_time() to return status code as return value
and the object is in out parameter.
sql/event_queue.h:
LEX_STRING* to LEX_STRING
Fix comments.
Fix and add function documentation.
Remove Event_queue::events_count() as it is unused
Change get_top_for_execution_if_time() to return status code as return value
and the object is in out parameter.
Try to detect also lock attemptions for deadlocks.
sql/event_scheduler_ng.cc:
Always execute on thd->mem_root
Fix according to changed API of Event_queue::get_top_for_execution_if_time()
sql/events.cc:
Fix function documentation.
Fix code after API changes of internal Event module classes.
sql/events.h:
sp_name -> LEX_STRINGs
sql/sql_parse.cc:
Fix according to changed API of Events::show_create_event()
sql/sql_yacc.yy:
Don't pass NULL as third parameter to sp_head::init_strings()
BitKeeper/etc/ignore:
auto-union
mysql-test/r/events_logs_tests.result:
Auto merged
mysql-test/t/events_logs_tests.test:
Auto merged
mysql-test/t/events_stress.test:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/event_data_objects.cc:
manual merge
sql/events.cc:
manual merge
This patch introduces specialized Event data objects
Event_basic as parent.
Event_queue_element used for queue storage
Event_timed used for SHOW EVENTS/ I_S.EVENTS / SHOW CREATE EVENT
Event_job_data using during execution.
Methods were moved out of Event_timed to other classes.
This patch also introduces Events::LOCK_event_metadata.
This patch gives new implementation of Events::dump_internal_status().
Now both the Event_scheduler and Event_queue return information during
their ::dump_internal_status().
Shortened a bit the runtime for executing events test cases.
mysql-test/r/events.result:
update results
mysql-test/r/events_bugs.result:
update results
mysql-test/r/events_logs_tests.result:
update results
mysql-test/r/events_scheduling.result:
update results
mysql-test/t/events.test:
update test
make --sleep more appropriate . saving some time could mean failure on loaded boxes though :(
add tests for previously uncovered branches.
mysql-test/t/events_bugs.test:
update test
make --sleep more appropriate . saving some time could mean failure on loaded boxes though :(
add tests for previously uncovered branches.
mysql-test/t/events_logs_tests.test:
make the test shorter by time
mysql-test/t/events_scheduling.test:
when selecting always use ORDER BY
mysql-test/t/events_stress.test:
sleep 2.5secs for shorter stress test
sql/event_data_objects.cc:
Event_timed is no more used during execution.
Event_timed is no more used during in the memory queue.
Event_timed is only used for SHOW CREATE EVENT/ I_S.EVENTS/ SHOW EVENTS
Event_basic is the parent of almost all Event data objects.
Event_basic -> Event_queue_element (used for the memory queue) -> Event_timed
Event_basic -> Event_job_data (the object used for execution)
Sql_alloc -> Event_parse_data (used during parsing)
sql/event_data_objects.h:
Event_timed is no more used during execution.
Event_timed is no more used during in the memory queue.
Event_timed is only used for SHOW CREATE EVENT/ I_S.EVENTS/ SHOW EVENTS
Event_basic is the parent of almost all Event data objects.
Event_basic -> Event_queue_element (used for the memory queue) -> Event_timed
Event_basic -> Event_job_data (the object used for execution)
Sql_alloc -> Event_parse_data (used during parsing)
sql/event_db_repository.cc:
Cosmetics.
load_named_event now uses Event_basic, for polymorphism
find_event uses Event_basic, to be polymorphic.
use Field **fields= table->field and then index fields[...]
Add documentation.
Fix documentation.
sql/event_db_repository.h:
Event_db_repository depends only on Event_basic's interface
sql/event_queue.cc:
Cosmetics.
Don't use Event_timed for the queue and giving back object for execution.
Event_queue_element is for the queue, Event_job_data is for execution.
Add Event_queue::dump_internal_status() for SHOW SCHEDULER STATUS command
sql/event_queue.h:
Cosmetics.
Don't use Event_timed for the queue and giving back object for execution.
Event_queue_element is for the queue, Event_job_data is for execution.
Add Event_queue::dump_internal_status() for SHOW SCHEDULER STATUS command
sql/event_scheduler_ng.cc:
Add back Event_scheduler::cond_wait()
Add back Event_scheduler::dump_internal_status()
Using Event_job_data for execution. Make the scheduler thread unkillable (thd->command= COM_DAEMON).
Add a lot of documentation.
sql/event_scheduler_ng.h:
Add back Event_scheduler::cond_wait()
Add back Event_scheduler::dump_internal_status()
Using Event_job_data for execution.
sql/events.cc:
Documentation
Add LOCK_event_metadata
sql/events.h:
Change the signature of Events::drop_event() not to use sp_name but LEX_STRING
sql/share/errmsg.txt:
Fix error message
sql/sql_parse.cc:
Events::drop_event() has new signature
fix for bug#20624 events_logs_tests.test fails randomly
BitKeeper/etc/ignore:
Added server-tools/instance-manager/net_serv.cc to the ignore list
mysql-test/r/events_logs_tests.result:
update result
mysql-test/t/events_logs_tests.test:
fix test. this should remove the problem of
Bug #20624 events_logs_tests.test fails randomly
(this is a change to a faulty test file)
mysql-test/r/events_logs_tests.result:
update result
mysql-test/t/events_logs_tests.test:
fix the test file, so TRUNCATE should not land into the slow_log
This happens on loaded machines, for example when running few suites
in parallel.
fix for bug #20624: events_logs_tests.test fails randomly
of hostname in query results.
mysql-test/r/events_logs_tests.result:
Update results
mysql-test/t/events_logs_tests.test:
Replace user_host in results, since it is system dependent.
- Scheduler is either initialized at server start or never.
Starting & stopping is now suspending & resuming.
- The scheduler has clear OO interface
- Now all calls to the scheduler are synchronous
- GLOBAL event_scheduler uses thd::sys_var_tmp (see set_var.cc)
- External API is encapsulated into class Events
- Includes fixes for all comments of Kostja's review of 19.05.2005
Starting to merge into 5.1-release (5.1.10) and push
BitKeeper/etc/ignore:
Added libmysqld/event_scheduler.cc to the ignore list
libmysqld/Makefile.am:
executor -> scheduler
mysql-test/r/events.result:
update result
mysql-test/r/events_bugs.result:
update result
mysql-test/r/events_logs_tests.result:
update result
mysql-test/r/events_microsec.result:
update result
mysql-test/r/events_scheduling.result:
update result
mysql-test/r/events_stress.result:
update result
mysql-test/t/disabled.def:
enable these tests
mysql-test/t/events.test:
optimize the test a bit for speed, save some seconds runtime
remove FULL from SHOW EVENTS
mostly use I_S.EVENTS
mysql-test/t/events_bugs.test:
Skip irrelevant for the current design tests - all events are loaded
on server startup. Change in mysql.event will be visible on next server start.
Don't use numeric error codes.
mysql-test/t/events_logs_tests.test:
optimize the test a bit for speed
mysql-test/t/events_microsec.test:
Skip irrelevant for the current design tests - all events are loaded
on server startup. Change in mysql.event will be visible on next server start.
Don't use numeric error codes.
mysql-test/t/events_scheduling.test:
broader test
mysql-test/t/events_stress.test:
Rework the test to the new architecture of suspending/resuming.
Use less events, no need for thousands, hundreds is still ok.
sql/Makefile.am:
executor -> scheduler
sql/cmakelists.txt:
executor -> scheduler
sql/event.cc:
- remove todo comments
- remove unneded evex_queue abstraction functions
- move events_init() and events_shutdown() from event_executor.cc to here
- export db_create_event
- remove evex_load_and_compile_event, part of class Event_scheduler
- integrate the public interface found in event.h and used by sql_parse.cc
to use the new class Event_scheduler.
sql/event.h:
- add COND_finished so if one thread kills a running event it waits on this
- export callback event_timed_definer_equal, event_timed_identifier_equal(),
event_timed_name_equal and event_timed_db_equal()
to be used by Event_scheduler::drop_matching_events()
- cleanup event.h
- encapsulated all external interface into class Events
sql/event_executor.cc:
make it empty, will delete after that
sql/event_priv.h:
- more things in the private header
- remove event queue abstraction functions. tightly bind to QUEUE
- export privately db_drop_event, db_find_event, db_create_event()
- made change_security_context() and restore_security_context() free functions
sql/event_timed.cc:
- fix calculation of time when ENDS is set (STARTS is always set)
- during Event_timed::compile() set the right Security_ctx. Prevents a crash
during Event_scheduler::load_events_from_db()
- add Event_timed::kill_thread()
- implement event_timed_*_equal()
- made change_security_context() and restore_security_context() free functions.
- Comments cleanups
sql/lex.h:
new word scheduler for SHOW SCHEDULER STATUS (available only debug builds)
sql/log.cc:
move these from event_scheduler.cc
sql/mysql_priv.h:
refactor kill_one_thread
export sql_print_message_func and sql_print_message_handlers
sql/mysqld.cc:
In close_connections, called by kill_server() skip the main scheduler
thread and use events_shutdown() for shutting down the scheduler, in the same
manner it's done for RPL.
Add a new value to --event-scheduler :
0 <- No scheduler available
1 <- Start with scheduler enabled
2 <- Start with scheduler suspended
sql/repl_failsafe.cc:
refactor thd::system_thread to be an enum
sql/set_var.cc:
move sys_var_event_executor::update() to set_var.cc
executor -> scheduler
use thd::sys_var_tmp
sql/set_var.h:
executor -> scheduler
sql/share/errmsg.txt:
3 new error messages
sql/sql_class.cc:
refactor thd::system_thread to be an enum . more type-safety
sql/sql_class.h:
refactor thd::system_thread to be an enum . more type-safety
sql/sql_db.cc:
get the error from evex_drop_schema_events
sql/sql_error.h:
export warning_level_names
sql/sql_lex.h:
new command SHOW SCHEDULER STATUS, available only in debug build and
for debug purposes.
sql/sql_parse.cc:
refactor kill_one_thread() -> does the *dirty* work, and sql_kill
just the reporting.
add handler for SQLCOM_SHOW_SCHEDULER_STATUS
sql/sql_show.cc:
fix verbosity handling (this will be obsoleted anyway by the fix for 17394).
sql/sql_yacc.yy:
remove FULL from SHOW EVENTS
add SHOW SCHEDULER STATUS in debug builds
sql/table.cc:
Fix valgrind warning.
mysql-test/r/events_logs_tests.result:
update result
mysql-test/r/events_scheduling.result:
update result
mysql-test/t/events_logs_tests.test:
fix test
mysql-test/t/events_scheduling.test:
add test case for bug 19170
WL#1034
mysql-test/t/events_logs_tests-master.opt:
Rename: mysql-test/t/events_slow_query-master.opt -> mysql-test/t/events_logs_tests-master.opt
sql/event_timed.cc:
ask the anonymous SP to log general statements
sql/sp_head.cc:
save the OPTION_LOG_OFF and restore it after execution
sql/sp_head.h:
add a new flag for general log
mysql-test/r/events_logs_tests.result:
update result file
mysql-test/t/events_logs_tests.test:
add test for general log
2006-03-01 16:27:57 +01:00
Renamed from mysql-test/r/events_slow_query.result (Browse further)