Commit graph

24 commits

Author SHA1 Message Date
kostja@bodhi.(none)
2537a87fb5 Provide initial module structure to Doxygen. 2007-08-15 19:08:44 +04:00
andrey@whirlpool.mysql.com
ce856126d9 Fix for bug#28075 COM_DEBUG crashes mysqld
Uninitialized in the constructor member variables were
pointing to nirvana and causing a crash when debug information
of the Event Scheduler was dumped in result to COM_DEBUG
packet sent to the server.
2007-05-21 10:51:11 +02:00
kostja@vajra.(none)
98db230086 A set of changes aiming to make the Event Scheduler more user-friendly
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
2007-04-05 15:24:34 +04:00
kostja@bodhi.local
094612854d Trivial cleanups and whitespace change in Event Scheduler code.
A larger patch is to come, this is to exclude rudimentary changes
from it.
2007-03-23 18:14:03 +03:00
kroki/tomash@moonlight.home
c06c7356e3 Fix for bug#22740 Events: Decouple Event_queue from Event_db_repository
This patch implements the idea of the bug report by making Event_queue
unaware of Event_db_repository by making a higher level class - Events,
which is aware of most of all classes, responsible for passing all data
needed for adding/updating/deleting an event to/from the queue.

Introduces few new classes :
 - Event_worker_thread
 - Event_queue_element_for_exec
2007-01-29 20:46:29 +03:00
kent@mysql.com/kent-amd64.(none)
1e3237fefa Many files:
Changed header to GPL version 2 only
2006-12-27 02:23:51 +01:00
andrey@example.com
25862a8671 WL#3337 (Event scheduler new architecture)
Remove SHOW SCHEDULER STATUS command and migrate the
information output to `mysqladmin debug` (COM_DEBUG)

SHOW SCHEDULER STATUS was introduced in 5.1.11, provided
some debug information about event scheduler internals and
was enabled only in debug builds.
2006-09-12 12:26:12 +02:00
andrey@fifo.vaih.whnetz
7b5916a26c WL#3337 (Event scheduler new architecture)
This patch makes the relationship between Event_scheduler and Event_queue
unidirectional from the former to the latter.




The change is that the conditional on which the scheduler sleeped has been
moved to the Event_queue and the latter does not call anymore
Event_scheduler::queue_changed(), which in turn has be removed.
2006-08-31 17:18:39 +02:00
andrey@example.com
5d626c5c9a WL#3337 (Event scheduler new architecture)
Post-review fixes. Mostly whitespace, int-to-bool return value, fixed comments
2006-08-17 14:22:59 +02:00
andrey@lmy004.
0404763d81 WL#3337 (Events new architecture)
Small updates before patch submit.
2006-07-17 16:52:45 +02:00
andrey@lmy004.
3f6de6c523 update to ease the patch process 2006-07-13 16:24:55 +02:00
andrey@lmy004.
dd31d45789 WL #3337 (Events new architecture)
Final stroke, events should be loaded from disk on server startup.
Also check the validity of their bodies if possible during loading.
2006-07-13 10:59:58 +02:00
andrey@lmy004.
3f4e1f5c69 WL#3337 (Event scheduler new architecture)
event_scheduler_ng.cc/h is no more
2006-07-12 10:37:30 +02:00
andrey@lmy004.
3b840adee7 WL#3337 (Event scheduler new architecture)
Cleaned up the code a bit. Fixed few leaks.
This code still does not load events on server startup
from disk. The problem is that there is a need for a THD instance, which
does not exist during server boot. This will be solved soon.
Still Event_timed is used both for the memory queue and for exectution.
This will be changed according to WL#3337 probably in the next commit.
2006-07-05 17:12:50 +02:00
andrey@lmy004.
2bdd872e5f WL #3337 (Event scheduler new architecture)
Cut Nr. 8.

All tests pass.

Separated Event_scheduler into Event_queue and Event_scheduler.
Added new Event_scheduler_ng which is the new scheduler and is used
system-wide. Will be moved to the event_scheduler.cc in the future.
Using Event_timed in Event_queue as well as cloned during execution.
Next step is to have Event_worker_data which will be used during execution
and will take ::compile()/::execute() out of Event_timed.
2006-07-04 18:44:35 +02:00
andrey@lmy004.
6dd9a3bb60 WL#3337 (Event scheduler new architecture)
This is the first cut of separating Event_scheduler in two
classes which are more specialized.
Inheritance was used to separate methods and member variables.
Still Event_scheduler is a child of Event_queue. This dependency
will be removed soon.
2006-07-03 11:20:08 +02:00
andrey@lmy004.
3c793e23ee WL#3337 (Events new architecture)
This cut No 7 should finish the part of fixing the parsing of the events :
- Event_timed is no more used during parsing. Less problems because it has
  a mutex. Event_parse_data class is used during parsing. It is suited only
  for this purpose. It's pretty lightweight
- Late checking of data from parsing is being performed. This should solve
  the problems of nested events in SP or other events (for the situation 
  of no nested bodies). Before if an ALTER EVENT was in a SP, then when the
  SP was compiled, and not executed, the actual init_xxx methods of Event_timed
  were called, which is wrong.
- It could be a side effect of using a specialized class, but test events_stress is
  now 25% quicker.

Cut No8 will start splitting Event_scheduler into 2 parts, the QUEUE will be moved
to Event_queue.
2006-06-29 00:42:25 +02:00
andrey@lmy004.
9309fae9b5 WL#3337 (Events new architecture)
5th cut, moved DB related code to Event_db_repository and
updated accordingly the remanining code.
Moved change/restore_security_context() to class THD
Removed events_priv.h
Next step is to reorganize create/update_event() and parsing for them.
But probably some other refactoring could be done in the meanwhile.
The changes so far pass the test suite.
2006-06-28 01:28:03 +02:00
andrey@lmy004.
4e0a752ff6 WL#3337 (Event scheduler new architecture)
Third cut to simplify parsing phase. Now DROP EVENT works.

Overloaded few functions to be able to use either sp_name or pass two LEX_STRINGs
instead of a Event_timed pointer. This is transitional and eventually the old
functions will be removed. For now DROP EVENT also works, does not need anymore
a parsing object (Event_timed) and definer initialization because everyone who
has EVENT_ACL can drop events, and this is checked on execution time in sql_parse.cc
from the security context, as it should be.
2006-06-27 11:51:11 +02:00
andrey@lmy004.
1d1e9d10b6 Reorganize, physically the events code
Unify method naming -> create/update/drop_event
Move class Event_timed to event_timed.h
class Events is in events.h (renamed from event.h)
The implementation is in events.cc (renamed from event.h)
2006-06-08 23:07:11 +02:00
kent@mysql.com
ade3de74d7 event_scheduler.h, event_scheduler.cc:
Rename load_event() to load_named_event(), to avoid name clash on HP-UX
2006-05-23 17:47:17 +02:00
andrey@lmy004.
86052a9567 various fixes after push of fix for bug#17619 2006-05-23 13:32:22 +02:00
andrey@lmy004.
ec0e9d5977 fix win32 build after push for bug#17619 2006-05-23 00:19:02 +02:00
andrey@lmy004.
b429d73d62 fix for bug #17619 Scheduler race conditions
- 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
2006-05-22 20:46:13 +02:00