| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Detail:
- Choose the solution that was already in place (before last fix)
for 6.0
- minor cleanup in comments
|
|
|
|
|
| |
- restore original state of event_scheduler at the end of the test
- minor fixes around comments, formatting
|
|
|
|
|
|
|
|
| |
mysql-test/r/events_scheduling.result:
Result change.
mysql-test/t/events_scheduling.test:
Removing a test that only confirms that event scheduling is
inexact, hence causing sporadic failures on loaded machines.
|
|
|
|
|
|
|
|
| |
Change LAST_EXECUTED time the execution start time, instead of the execution completion time. This ensures the END time always the same or later than the LAST_EXECUTED time.
mysql-test/t/disabled.def:
Enable events_scheduling test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug#23631 "Events: SHOW VARIABLES doesn't work when mysql.event
is damaged:
mysql-test/r/events.result:
Update results (a post-merge fix)
mysql-test/r/events_bugs.result:
Update results (a post-merge fix)
mysql-test/r/events_scheduling.result:
Update results (a post-merge fix)
mysql-test/t/events_scheduling.test:
Make sure this test has no races.
sql/event_data_objects.cc:
Manual post-merge fix for the events replication patch.
sql/event_data_objects.h:
A post-merge fix.
sql/event_db_repository.cc:
A post-merge fix.
sql/event_scheduler.cc:
We should drop the event inside ::execute since there we have
the right credentials to do so (otherwise Events::drop_event
returns "access denied" error).
sql/events.cc:
A post-review fix for: rename start_or_stop_event_scheduler
to switch_event_scheduler_state.
sql/events.h:
A post-review fix for: rename start_or_stop_event_scheduler
to switch_event_scheduler_state.
sql/set_var.cc:
A post-review fix for: rename start_or_stop_event_scheduler
to switch_event_scheduler_state.
sql/sql_yacc.yy:
Remove unused declaratoins.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
into vajra.(none):/opt/local/work/mysql-5.1-c1
mysql-test/r/events_bugs.result:
Auto merged
mysql-test/r/events_scheduling.result:
Auto merged
mysql-test/t/events.test:
Auto merged
mysql-test/t/events_scheduling.test:
Auto merged
sql/event_data_objects.h:
Auto merged
sql/event_db_repository.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/table.h:
Auto merged
sql/share/errmsg.txt:
Auto merged
mysql-test/r/events.result:
e
Use local.
mysql-test/r/events_restart_phase1.result:
Use local
mysql-test/r/events_time_zone.result:
SCCS merged
mysql-test/t/events_restart_phase1.test:
Use local
sql/event_data_objects.cc:
Use local
sql/event_db_repository.cc:
Manual merge.
sql/event_queue.cc:
Manual merge.
sql/events.cc:
Manual merge.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
when there are no up-to-date system tables to support it:
- initialize the scheduler before reporting "Ready for connections".
This ensures that warnings, if any, are printed before "Ready for
connections", and this message is not mangled.
- do not abort the scheduler if there are no system tables
- check the tables once at start up, remember the status and disable
the scheduler if the tables are not up to date.
If one attempts to use the scheduler with bad tables,
issue an error message.
- clean up the behaviour of the module under LOCK TABLES and pre-locking
mode
- make sure implicit commit of Events DDL works as expected.
- add more tests
Collateral clean ups in the events code.
This patch fixes Bug#23631 Events: SHOW VARIABLES doesn't work
when mysql.event is damaged
mysql-test/r/events.result:
Update results.
mysql-test/r/events_bugs.result:
Update results.
mysql-test/r/events_restart_phase1.result:
Update results.
mysql-test/r/events_restart_phase2.result:
Update results.
mysql-test/r/events_restart_phase3.result:
Update results.
mysql-test/r/events_scheduling.result:
Update results.
mysql-test/r/events_time_zone.result:
Update results.
mysql-test/t/events.test:
Add new tests for tampering with mysql.event and some more
tests for sub-statements, LOCK TABLES mode and pre-locking.
mysql-test/t/events_bugs.test:
Move the non-concurrent part of test for Bug 16420 to this file.
mysql-test/t/events_restart_phase1.test:
Rewrite events_restart_* tests to take into account that now
we check mysql.event table only once, at server startup.
mysql-test/t/events_restart_phase2.test:
Rewrite events_restart_* tests to take into account that now
we check mysql.event table only once, at server startup.
mysql-test/t/events_restart_phase3.test:
Rewrite events_restart_* tests to take into account that now
we check mysql.event table only once, at server startup.
mysql-test/t/events_scheduling.test:
Add more coverage for event_scheduler global variable.
mysql-test/t/events_time_zone.test:
Move the non-concurrent part of the tests for Bug 16420 to
events_bugs.test
sql/event_data_objects.cc:
Move update_timing_fields functionality to Event_db_repository.
Make loading of events from a table record more robust to tampering
with the table - now we do not check mysql.event on every table open.
sql/event_data_objects.h:
Cleanup.
sql/event_db_repository.cc:
Now Event_db_repository is responsible for table I/O only.
All the logic of events DDL is handled outside, in Events class please
refer to the added test coverage to see how this change affected
the behavior of Event Scheduler.
Dependency on sp_head.h and sp.h removed.
Make this module robust to tweaks with mysql.event table.
Move check_system_tables from events.cc to this file
sql/event_db_repository.h:
Cleanup declarations (remove unused ones, change return type to bool
from int).
sql/event_queue.cc:
Update to adapt to the new start up scheme of the Event Scheduler.
sql/event_queue.h:
Cleanup declarations.
sql/event_scheduler.cc:
Make all the error messages uniform:
[SEVERITY] Event Scheduler: [user][schema.event] message
Using append_identifier for error logging was an overkill - we may
need it only if the system character set may have NUL (null character)
as part of a valid identifier, this is currently never the case,
whereas additional quoting did not look nice in the log.
sql/event_scheduler.h:
Cleanup the headers.
sql/events.cc:
Use a different start up procedure of Event Scheduler:
- at start up, try to check the system tables first.
If they are not up-to-date, disable the scheduler.
- try to load all the active events. In case of a load error, abort
start up.
- do not parse an event on start up. Parsing only gives some information
about event validity, but far not all.
Consolidate the business logic of Events DDL in this module.
Now opt_event_scheduler may change after start up and thus is protected
by LOCK_event_metadata mutex.
sql/events.h:
Use all-static-data-members approach to implement Singleton pattern.
sql/mysqld.cc:
New invocation scheme of Events. Move some logic to events.cc.
Initialize the scheduler before reporting "Ready for connections".
sql/set_var.cc:
Clean up sys_var_thd_sql_mode::symbolic_mode_representation
to work with a LEX_STRING.
Move more logic related to @@events_scheduler global variable to Events
module.
sql/set_var.h:
Update declarations.
sql/share/errmsg.txt:
If someone tampered with mysql.event table after the server has
started we no longer give him/her a complete report what was actually
broken. Do not send the user to look at the error log in such case,
as there is nothing there (check_table_intact is not executed).
sql/sp_head.cc:
Update to a new declaration of
sys_var_thd_sql_mode::symbolic_mode_representation
sql/sql_db.cc:
New invocation scheme of Events module.
sql/sql_parse.cc:
Move more logic to Events module. Make sure that we are consistent
in the way access rights are checked for Events DDL: always
after committing the current transaction and checking the system tables.
sql/sql_show.cc:
Update to the new declarations of
sys_var_thd_sql_mode::symbolic_mode_representation
sql/sql_test.cc:
New invocation scheme of events.
sql/table.cc:
mysql.event is a system table.
Update check_table_intact to be concurrent, more verbose, and less smart.
sql/table.h:
Add a helper method.
mysql-test/r/events_trans.result:
New BitKeeper file ``mysql-test/r/events_trans.result''
mysql-test/t/events_trans.test:
New BitKeeper file ``mysql-test/t/events_trans.test'':
test cases for Event Scheduler that require a transactional
storage engine.
|
|/
|
|
|
|
|
|
|
| |
some build machines during testing.
mysql-test/t/events_scheduling.test:
This patch alters result file to match the DROP IF EXISTS that was changed
in the test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Small updates before patch submit.
client/mysqltest.c:
allow --valgrind option to mysqltest so one can be able to detect
whether the test is running under valgrind by having $VALGRIND_TEST,
similar to BIG_TEST, in the test file.
mysql-test/mysql-test-run.pl:
If the test suite is running under valgrind start mysqltest with --valgrind
to inform that we run valgrind. mysqltest will provide $VALGRIND_TEST for the
test cases.
mysql-test/r/events_bugs.result:
update result
mysql-test/r/events_scheduling.result:
update result
mysql-test/t/events.test:
Increase times or the test will fail under valgrind
mysql-test/t/events_bugs.test:
Increase times or the test will fail under valgrind
mysql-test/t/events_scheduling.test:
Remove faulty test
Disable the test case for valgrind
sql/event_data_objects.cc:
count the number of executions
sql/event_data_objects.h:
flags is not used at all
add execution_count to count the number of executions
sql/event_db_repository.cc:
Initialize wherever needed.
Add a comment regarding valgrind warning.
sql/event_queue.cc:
more debug info in the trace log
sql/event_scheduler.cc:
Use macro COND_STATE_WAIT() in all cases we need waiting
on condition. Hence, we can trace locking, attemption to lock
and more with SHOW SCHEDULER STATUS
sql/event_scheduler.h:
Change the declaration of cond_wait to accept THD
sql/events.cc:
fix memory leak. Destroy event_queue
mysql-test/include/not_valgrind.inc:
New BitKeeper file ``mysql-test/include/not_valgrind.inc''
mysql-test/r/not_valgrind.require:
New BitKeeper file ``mysql-test/r/not_valgrind.require''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(one testcase, one memory leak and some accesses to not initialized memory)
mysql-test/r/events_scheduling.result:
Changed event timer to two seconds to not get problems with slow system or when running with valgrind
mysql-test/t/events_scheduling.test:
Changed event timer to two seconds to not get problems with slow system or when running with valgrind
mysql-test/valgrind.supp:
Avoid purify warnings from DBUG library (safe to do)
sql/ha_berkeley.cc:
Fix problem with not freed memory
sql/sql_class.cc:
Ensure that row_count is initalized (as we otherwise may access it uninitialized)
sql/sql_show.cc:
c_ptr -> ptr to avoid accessing not initialized memory
sql/sql_yacc.yy:
Fix to not access not initialized memory
sql/table.cc:
Fix to not access not initialized memory
sql/time.cc:
Fix to not access not initialized memory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
fully correct)
This also should fix 17493 and 17346, and probably 16397 (not tested).
WL#1034 (Internal CRON)
(post-review commit)
mysql-test/r/events.result:
update result
mysql-test/t/events.test:
update test
sql/event.cc:
seems we get a crash if we compile it this way. better let the worker thread do it,
this increases the stability.
sql/event_executor.cc:
kick in more often
sql/event_timed.cc:
- don't NULLify last_executed
- implement (fix) better get_next_time() which does not use last_executed as basis
but STARTS. STARTS is used as basis and the next point of time which is before ENDS,
if set, is being found. The point > now and (point-starts) % interval_expression == 0.
sql/item_timefunc.cc:
move calc_time_diff to time.cc as it can be reused in other parts of the
server code (see event_timed.cc)
sql/mysql_priv.h:
export calc_time_diff() moved to time.cc from item_timefunc.cc
sql/sql_show.cc:
- fix presenting of LAST_EXECUTED
- cleanup a bit
sql/time.cc:
- move calc_time_diff() from item_timefunc.cc to here
|