Commit graph

35465 commits

Author SHA1 Message Date
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.
4d22fd1acf fix for bug#16394 "Events: Crash if schedule contains SELECT"
Parsing of CREATE/ALTER EVENT statement was crashing because of early
initialization done during parsing, instead in the after parsing phase.
Moreover, we don't want SUBqueries in CREATE/ALTER EVENT therefore we
disable them, though it is possible to make them work. It can be emulated
inside SP with a cursor and SP variable (CREATE/ALTER EVENT can still
accept variables as values).
2006-06-29 11:53:51 +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.
e5e8713c60 after merge fix 2006-06-28 16:02:20 +02:00
andrey@lmy004.
f92454082a Merge 2006-06-28 15:54:09 +02:00
andrey@lmy004.
98d1047715 WL#3337 (Events new architecture)
Cut 7 (refactoring)

db_repository is no more embedded in the Events
singleton. Therefore a change to Events_db_repository
won't mean recompile of all files in the server which include events.h
2006-06-28 15:14:05 +02:00
andrey@lmy004.
03e0a2315e WL#3337 (Events new architecture)
Cut number 6. Move code from sql_show.cc to event_db_repository.cc
that more belongs to the latter.
2006-06-28 14:22:14 +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.
0c439c9f76 WL#3337 (Event scheduler new architecture) Fourth cut of refactoring
the parsing. Next step will be to refactor of usage of Event_timed 
during Events::create_event() and Events::update_event().

Disallow:
- CREATE EVENT ... DO CREATE EVENT ...;
- ALTER  EVENT ... DO CREATE EVENT ...;
- CREATE EVENT ... DO ALTER EVENT DO ....;
- CREATE PROCEDURE ... BEGIN CREATE EVENT ... END|

Allowed:
- CREATE EVENT ... DO DROP EVENT yyy;
- CREATE EVENT ... DO ALTER EVENT yyy;
  (the nested ALTER EVENT can have anything but DO clause)
- ALTER  EVENT ... DO ALTER EVENT yyy;
  (the nested ALTER EVENT can have anything but DO clause)
- ALTER  EVENT ... DO DROP EVENT yyy;
- CREATE PROCEDURE ... BEGIN ALTER EVENT ... END|
  (the nested ALTER EVENT can have anything but DO clause)
- CREATE PROCEDURE ... BEGIN DROP EVENT ... END|
2006-06-27 13:15:40 +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.
04659677a8 WL#3337 (Events new infrasctructure)
Second cut of separating parsing phase from execution phase
Separate Event_timed from parsing phase and introducing Event_parse_data.
2006-06-27 10:53:26 +02:00
andrey@lmy004.
e5936fce6c first cut of WL#3337 (New event scheduler locking infrastructure).
Infrastructure built. Added the  foreseen files and change Makefile.am/CMakeLists.txt
accordingly.
2006-06-27 08:48:50 +02:00
konstantin@bodhi.netgear
632c6e607b Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/opt/local/work/mysql-5.1-runtime
2006-06-27 03:38:46 +04:00
jmiller@ndb08.mysql.com
cf58d2b544 Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/data0/mysql-5.1
2006-06-26 22:31:31 +02:00
konstantin@mysql.com
a04bfd8e2a Merge mysql.com:/opt/local/work/tmp_merge
into  mysql.com:/opt/local/work/mysql-5.1-runtime
2006-06-26 18:49:20 +04:00
konstantin@mysql.com
5e0a692723 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/opt/local/work/mysql-5.1-runtime
2006-06-26 18:45:46 +04:00
knielsen@rt.int.sifira.dk
b6c587695b Merge mysql.com:/usr/local/mysql/mysql-5.1-pristine
into  mysql.com:/usr/local/mysql/tmp-5.1
2006-06-26 16:04:06 +02:00
knielsen@mysql.com
3ba774f1d7 BUG#20676: debug warnings about too many lock waiters cause test failure.
The 250 simultaneous events all accessing the same table caused the
events_stress test to fail due to debug warnings about too many table
waiters. Fixed by using three different tables.
2006-06-26 15:49:58 +02:00
andrey@lmy004.
23340f3fdd Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into lmy004.:/work/mysql-5.1-runtime-bug16992
2006-06-26 12:22:13 +02:00
knielsen@rt.int.sifira.dk
22285bb75a Merge mysql.com:/usr/local/mysql/mysql-5.1-bug20549
into  mysql.com:/usr/local/mysql/tmp-5.1
2006-06-26 11:26:24 +02:00
andrey@lmy004.
d617241c3f Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into lmy004.:/work/mysql-5.1-runtime-bug18897
2006-06-26 08:55:49 +02:00
elliot@mysql.com
72e8a44d51 Post merge fix 2006-06-25 16:04:11 -04:00
elliot@mysql.com
bc2b96fee3 Merge mysql.com:/home/emurphy/src/bk-clean/tmp_merge
into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.1
2006-06-25 09:59:34 -04:00
kent@mysql.com
b6e89c2b1e .del-make_win_src_distribution.sh~f80d8fca44e4e5f1:
Delete: scripts/make_win_src_distribution.sh
Makefile.am:
  Unix and Windows now shares source package
2006-06-25 10:25:00 +02:00
knielsen@mysql.com
b9b25ada28 BUG#20677: Sporadic failure of test case 'ndb_binlog_multi'.
Start test case with a dummy table create and drop. This ensures that
NDB event subscription is properly set up before the real test starts,
which otherwise could sometimes cause INSERT events to be lost.
2006-06-25 08:59:44 +02:00
knielsen@rt.int.sifira.dk
7491454f78 Merge mysql.com:/usr/local/mysql/tmp-5.0
into  mysql.com:/usr/local/mysql/tmp-5.1
2006-06-24 13:14:24 +02:00
knielsen@rt.int.sifira.dk
9e1b155e1c Merge bk-internal:/home/bk/mysql-5.1
into  mysql.com:/usr/local/mysql/tmp-5.1
2006-06-24 13:12:45 +02:00
knielsen@mysql.com
34cf139bd9 Fix race condition in test case wait_timeout.
Sometimes the helper connection (that is watching for the main connection
to time out) would itself time out first, causing the test to fail.
2006-06-24 13:11:09 +02:00
knielsen@mysql.com
f976f27a8f Build fixes for Windows, Solaris, HPUX, AIX. 2006-06-24 07:45:23 +02:00
knielsen@devsrv-b.mysql.com
2e08725994 Merge bk-internal:/home/bk/mysql-5.1
into  mysql.com:/data0/knielsen/tmp-5.1
2006-06-24 00:12:34 +02:00
elliot@mysql.com
a5181fdcde Post merge fix. 2006-06-23 17:59:24 -04:00
elliot@mysql.com
d4796d9df6 Merge mysql.com:/home/emurphy/src/bk-clean/tmp_merge
into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.1
2006-06-23 17:27:54 -04:00
andrey@lmy004.
e71ef73d53 Fix for bug #18897 "Events: unauthorized action possible with
alter event rename".

ALTER EVENT ... RENAME statement hasn't checked privileges
for the target database. It also caused server crashes when
target database was not specified explicitly and there was
no current database.

This fix adds missing privilege check and check for the case
when target database is not specified explicitly or implicitly.
2006-06-23 17:29:01 +02:00
petr@owlet.
f25b7844b2 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/home/cps/mysql/devel/5.1-curs-bug
2006-06-23 18:21:56 +04:00
petr@mysql.com
0da59ab63d remove links from bk to get rid of warnings on windows 2006-06-23 18:19:14 +04:00
knielsen@rt.int.sifira.dk
4966090d3f Merge mysql.com:/usr/local/mysql/mysql-5.1-vg-apr2
into  mysql.com:/usr/local/mysql/tmp-5.1
2006-06-23 15:05:15 +02:00
knielsen@mysql.com
af9e69b512 Merge mysql.com:/usr/local/mysql/mysql-5.0-bug20622
into  mysql.com:/usr/local/mysql/mysql-5.1-vg-apr2
2006-06-23 14:59:40 +02:00
knielsen@mysql.com
98a5cdfe4c BUG#20622: Fix one-byte buffer overrun in IM directory string handling.
The problem was a call to convert_dirname() with a destination buffer
that did not have room for the trailing slash added by that function.
This could cause the instance manager to crash in some cases.
2006-06-23 14:50:02 +02:00
monty@hasky.mysql.fi
ebe57fc707 Merge monty@192.168.0.9:/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-23 11:01:00 +03:00
monty@mysql.com
059c45d016 Suppress memory leak from 'kill_server'
(Happens if main thread exists before kill_server thread, which is ok)
2006-06-23 10:46:16 +03:00
andrey@lmy004.
ef5c261afe Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into lmy004.:/work/mysql-5.1-runtime-bug20624
2006-06-23 09:42:11 +02:00
andrey@lmy004.
08f9d359d4 disable events tests in embedded
(fix for bug#20290 Event mechanism incompatible with embedded server, but tests tried)
2006-06-23 09:40:06 +02:00
monty@mysql.com
7ec5a7ecc5 Fixed memory leak (found by rpl_row_inexist_tbl) 2006-06-23 10:35:45 +03:00
monty@hasky.mysql.fi
a4f6871dbc Merge monty@192.168.0.9:/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-23 03:36:16 +03:00
monty@mysql.com
fba475cc47 Fixed problem when compiling libmysqld (without replication)
This change allows us to use the stmt_binlog function in the code without ifdefs
(We should avoid having ifdefs in the .cc and .c files)
2006-06-23 03:21:12 +03:00
monty@hasky.mysql.fi
14e05051f1 Merge monty@192.168.0.9:/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-23 03:04:13 +03:00
monty@narttu.mysql.fi
a168d1396c Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2006-06-23 03:03:03 +03:00
monty@mysql.com
4697deb436 Remove compiler warnings
Fixed wrong table flags type in ndbcluster that caused previous commit to fail
2006-06-23 02:49:19 +03:00
jmiller@mysql.com
3d445c52dd disabled.def:
Enabled rpl_ndb_auto_inc per Tomas and Lars
2006-06-22 23:42:11 +02:00