Commit graph

45 commits

Author SHA1 Message Date
andrey@lmy004.
8e881441a1 fix compiler warnings: precision loses, unused vars
the warnings came from MSFT compiler (output of pushbuild)
2006-02-28 20:32:37 +01:00
andrey@lmy004.
991ff4783e class event_timed -> Event_timed
fix for bug#17793 (Scheduler uses class event_timed should be Event_timed)
2006-02-28 18:33:38 +01:00
andrey@lmy004.
780d634496 fix for bug#16537
(post-review pre-push changes)
coding style (mostly trailing spaces removed)
2006-02-28 14:43:49 +01:00
andrey@lmy004.
8fe55c09db manual merge 2006-02-28 12:08:13 +01:00
andrey@lmy004.
483a6d06fa fix for bug#16537 (Events: mysql.event.starts is null)
- now when the event is created and STARTS is omitted then STARTS is implicitly
  CURRENT_TIMESTAMP
- This CS also fixed incorrect presentation of STARTS/ENDS in I_S.EVENTS
(incorporated review changes)
2006-02-28 11:43:10 +01:00
monty@mysql.com
e3796c924f After merge fixes 2006-02-26 15:11:56 +02:00
andrey@lmy004.
c4602da973 merge 2006-02-24 12:03:32 +01:00
andrey@lmy004.
0ba2425caf fix for bug#16407 (EVENTS: sql_mode)
post-review fixes
2006-02-21 02:40:23 +01:00
andrey@lmy004.
a1fdeb1386 manual merge 2006-02-21 00:01:39 +01:00
andrey@lmy004.
22ba4ca3a3 fix for bug#16407 (Events: Changes in sql_mode won't be taken into account)
WL#1032
sql_mode setting was disregarded during create/alter event and wasn't set during
event execution.
(post-review small fixes)
2006-02-20 23:52:22 +01:00
andrey@lmy004.
2996d95257 fix for bug #16411 Events: Microsecond intervals are allowed
WL#1034
2006-02-20 16:06:05 +01:00
andrey@lmy004.
3c82af94e7 fix bug in show events which shows
| INTERVAL_VALUE | INTERVAL_FIELD |
| 20             | 20 MINUTE      |
the second one should be without the value
2006-02-16 13:11:16 +01:00
andrey@lmy004.
7b2650a256 small post-merge fixes for bug#16406
(pre-push)
2006-02-16 05:21:02 +01:00
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
andrey@lmy004.
00b188cc52 build fixes 2006-02-15 23:43:11 +01:00
andrey@lmy004.
e9af8c1d83 post-merge fixes of bug 16548 2006-02-14 20:10:51 +01:00
andrey@lmy004.
d5d11a9c23 manual merge 2006-02-14 17:05:36 +01:00
andrey@lmy004.
815927e590 - final fixes for bug#16431 (Events: An event which alters itself disappears)
- fix for bug#16423 (Events: SHOW CREATE EVENT doesn't work)
- this Changeset commits makes CREATE/UPDATE/DELETE EVENT real DDL statements
  by committing the currently open transaction before they are executed.
- this Changeset also fixes a trailing space problem since the very early days
  of the internal cron
- adds sophisticated checking of whether mysql.event was tampered accidentally
  or with purpose by an user.
- adds a lot of inline function documentation - documents everything left
  uncodumented
- INTERVAL_XXXX to XXX in I_S.EVENTS.INTERVAL_FIELD

WL#1034 (Internal CRON)
2006-02-14 16:20:48 +01: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.
a6494fbe31 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into lmy004.:/work/mysql-5.1-tt-copy-works
2006-01-23 16:13:46 +01:00
andrey@lmy004.
7740652961 fix for bug#16431 (Events: An event which alters itself disappears)
WL#1034 (Internal CRON)
2006-01-20 22:24:58 +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.
c326d96535 WL #1034 (Internal CRON) pre-push fixes
after another merge fixes.
2006-01-11 12:49:56 +01:00
andrey@lmy004.
64d2033f09 WL 1034 update
(pre-push cleanups removing debugging code)
2006-01-10 11:31:45 +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.
fa9f2a773b WL #1034 update
- fix one bug found by PeterG, namely bug #51

#there is a major problem currently after removing the specialised DYNAMIC_ARRAY as 
  storage for the events. I have to reintroduce similar storage, this time probably some
  linked list or maybe some API on top of DYNAMIC_ARRAY.
2005-12-20 14:21:02 +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.
533180d76c WL#1034 update
- fix EVENT_ACL problem that GRANT ALL on some_db.* to someone@somewhere did not get to mysql.db
- fix crash when the following is executed :
  CREATE EVENT P() CREATE EVENT E ON SCHEDULER 1 SECOND DO ROLLBACK;
  (creation works as well as calling P() which creates the event).
2005-12-15 14:12:28 +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.
56db09cfe6 WL #1034 update
- handle better non-latin1 identifiers
2005-12-08 20:37:54 +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.
bee8598784 WL#1034 ongoing updates after review 2005-12-07 19:26:44 +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
andrey@lmy004.
ebe90857cb add these, forgotten in the previous commit 2005-12-02 13:22:15 +01:00