Commit graph

20 commits

Author SHA1 Message Date
andrey@lmy004.
2158add8f0 merge 2006-02-16 01:27:36 +01:00
andrey@lmy004.
d3e0875759 fix for bug#16406 (Events: DROP DATABASE doesn't automatically drop events)
WL#1034
- This changeset also changes the executor so its quite more stable now.
  Stressing test case added that executes ~800 events per second and dropping
  hundreds of events at once using DROP DATABASE.
(with fixes after review of JimW)
(with fixes after review of Serg)
2006-02-16 00:43:11 +01:00
konstantin@mysql.com
99030e3f43 Fix the coding style in a few new files. 2006-02-15 21:08:44 +03:00
andrey@lmy004.
4ba2a3322b - fix for bug #16414 (Events: Crash or hang if event drops itself)
WL#1034 (Internal CRON)
(with post-review fix)
2006-02-07 19:28:33 +01:00
andrey@lmy004.
9d7d8767dd post-commit merge 2006-01-30 14:28:48 +01:00
andrey@lmy004.
d847ac54ca fix for bug#16642 (Events: No INFORMATION_SCHEMA.EVENTS table)
post-review change - use pointer instead of copy on the stack.
WL#1034 (Internal CRON)
 This patch adds INFORMATION_SCHEMA.EVENTS table with the following format:
  EVENT_CATALOG  - MYSQL_TYPE_STRING  (Always NULL)
  EVENT_SCHEMA   - MYSQL_TYPE_STRING  (the database)
  EVENT_NAME     - MYSQL_TYPE_STRING  (the name)
  DEFINER        - MYSQL_TYPE_STRING  (user@host)
  EVENT_BODY     - MYSQL_TYPE_STRING  (the body from mysql.event)
  EVENT_TYPE     - MYSQL_TYPE_STRING  ("ONE TIME" | "RECURRING")
  EXECUTE_AT     - MYSQL_TYPE_TIMESTAMP (set for "ONE TIME" otherwise NULL)
  INTERVAL_VALUE - MYSQL_TYPE_LONG    (set for RECURRING otherwise NULL)
  INTERVAL_FIELD - MYSQL_TYPE_STRING  (set for RECURRING otherwise NULL)
  SQL_MODE       - MYSQL_TYPE_STRING  (for now NULL)
  STARTS         - MYSQL_TYPE_TIMESTAMP (starts from mysql.event)
  ENDS           - MYSQL_TYPE_TIMESTAMP (ends from mysql.event)
  STATUS         - MYSQL_TYPE_STRING  (ENABLED | DISABLED)
  ON_COMPLETION  - MYSQL_TYPE_STRING  (NOT PRESERVE | PRESERVE)
  CREATED        - MYSQL_TYPE_TIMESTAMP
  LAST_ALTERED   - MYSQL_TYPE_TIMESTAMP
  LAST_EXECUTED  - MYSQL_TYPE_TIMESTAMP
  EVENT_COMMENT  - MYSQL_TYPE_STRING

  SQL_MODE is NULL for now, because the value is still not stored in mysql.event .
Support will be added as a fix for another bug.

 This patch also adds SHOW [FULL] EVENTS [FROM db] [LIKE pattern]
1. SHOW EVENTS shows always only the events on the same user,
   because the PK of mysql.event is (definer, db, name) several 
   users may have event with the same name -> no information disclosure.
2. SHOW FULL EVENTS - shows the events (in the current db as SHOW EVENTS)
   of all users. The user has to have PROCESS privilege, if not then
   SHOW FULL EVENTS behave like SHOW EVENTS.
3. If [FROM db] is specified then this db is considered.
4. Event names can be filtered with LIKE pattern.
  SHOW EVENTS returns table with the following columns, which are subset of
  the data which is returned by SELECT * FROM I_S.EVENTS
   Db
   Name
   Definer 
   Type
   Execute at
   Interval value
   Interval field 
   Starts 
   Ends
   Status
2006-01-30 13:15:23 +01:00
andrey@lmy004.
0322cb1df8 - fix bug #16435 (Weekly events execute every second) (WL#1034 Internal CRON)
Before the interval expression was considered to be in seconds, now it is
just a number and the type of interval is considered.

- this changeset introduces also fix for bug#16432 (Events: error re interval
  misrepresents the facts)
  the code of event_timed::set_interval() was refactored anyway so it is meaningful to
  fix the bug in the same changeset.
2006-01-18 20:41:22 +01:00
andrey@lmy004.
3cd5a23f49 WL #1034 update
- fix problem with too long identifier name
2005-12-28 18:29:32 +02:00
andrey@lmy004.
b95f342fad WL #1034 (update)
- improve the stability of the executor
- make create event if not exists work as before
2005-12-28 12:07:57 +02:00
andrey@lmy004.
67a8172207 WL #1034 update
- handle crashes where the table definition has been changed
  (different number of fields)
2005-12-16 12:42:39 +01:00
andrey@lmy004.
831569cb2d WL#1034 (update)
- fixed silly bug, the main thread restarted but did not execute events,
  Quite currious why many calls to pthread_mutex_init() do not lead to abort()
2005-12-13 23:10:29 +01:00
andrey@lmy004.
ba79f499e6 WL#1034 update
(cleanups, leaks fixed)
2005-12-13 19:16:00 +01:00
andrey@lmy004.
854d2d4bcd WL#1034 update
cleanup before throwin away DYNAMIC_ARRAY for event storage,
once reallocated I get dangling pointers so that's not good.
solution will be found however ;)
2005-12-13 13:21:11 +01:00
andrey@lmy004.
d94bae3a21 WL#1034 update
QUEUE implementation working now. this should be ready more or less
for testing once the debug output is being cleaned and some things
around DYNAMIC_ARRAY are cleaned
- fix handling in case of errors that lead to crashes, now no more crashes
  in case of table corruption and such.
2005-12-12 21:19:19 +01:00
andrey@lmy004.
0797be8aef - last bits of unneeded error checking in sql_parse.cc thrown away
- fix a bug introduced with last commit ALTER EVENT a RENAME TO b; failed
- misc
2005-12-08 15:34:11 +01:00
andrey@lmy004.
3d85464143 WL #1034 updates after review
(strip m_ as prefix from member variables' names)
2005-12-08 00:17:05 +01:00
andrey@lmy004.
b7578df06c WL #1034 updates after review 2005-12-07 22:29:00 +01:00
andrey@lmy004.
efeb286e78 WL#1034
make more independent of SP
2005-12-06 16:46:29 +01:00
andrey@lmy004.
fcafcff181 WL#1034
updated sources
2005-12-06 16:15:29 +01:00
andrey@lmy004.
7120d43c36 WL#1034 updated
- split into several files
- forbid parallel execution (before analyse is done how to make it possible)
  because the same sp_head instance cannot be executed in parallel
- added GPL headers
- changed EVENT_ACL to be per DB variable
- fixed minor problems
2005-12-05 11:45:04 +01:00