Commit graph

37 commits

Author SHA1 Message Date
cbell/Chuck@mysql_cab_desk.
89838e1008 WL#3629 - Replication of Invocation and Invoked Features
This patch corrects errors that occurred in a local manual merge as a result
of updating the local repository and includes changes necessary to correct 
problems found during the recalculation of next execution of events in RBR.
2007-03-29 08:17:19 -04:00
cbell/Chuck@mysql_cab_desk.
71c4bd1f0a Merge mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.1_WL_3629
2007-03-26 09:57:16 -04:00
cbell/Chuck@mysql_cab_desk.
3e44599c11 WL#3629 - Replication of Invocation and Invoked Features
This changeset adds replication of events and user-defined functions. 
There are several bug reports involved in this change:

BUG#16421, BUG#17857, BUG#20384:
This patch modifies the mysql.events table to permit the addition of
another enum value for the status column. The column now has values
of ('DISABLED','SLAVESIDE_DISABLED','ENABLED'). A status of
SLAVESIDE_DISABLED is set on the slave during replication of events.
This enables users to determine which events werereplicated from the 
master and to later enable them if they promote the slave to a master.
The CREATE, ALTER, and DROP statements are binlogged.
A new test was added for replication of events (rpl_events).

BUG#17671:
This patch modifies the code to permit logging of user-defined functions.
Note: this is the CREATE FUNCTION ... SONAME variety. A more friendly error 
message to be displayed should a replicated user-defined function not be
found in the loadable library or if the library is missing from the
slave.The CREATE andDROP statements are binlogged. A new test was added 
for replication of user-defined functions (rpl_udf). 

The patch also adds a new column to the mysql.event table named
'originator' that is used to store the server_id of the server that
the event originated on. This enables users to promote a slave to a 
master and later return the promoted slave to a slave and disable the
replicated events.
2007-03-16 09:56:57 -04:00
msvensson@pilot.blaudden
8a8c69f3fd Fix 6 warnings from win64, where one is a potential bug. 2007-03-08 14:29:29 +01:00
kostja@bodhi.local
ba60ccbf48 A post merge fix. 2007-03-07 16:08:36 +03:00
malff/marcsql@weblab.(none)
5c8216ba83 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge
2007-02-15 14:04:03 -07:00
kroki/tomash@moonlight.home
a4017eceb1 BUG#16425: Events: no DEFINER clause
There was already support for CREATE DEFINER=... EVENT syntax in the
parser, but DEFINER information was ignored.

This patch adds processing of DEFINER, and a new ALTER DEFINER=...
EVENT syntax.
2007-02-02 20:43:33 +03:00
kroki/tomash@moonlight.home
84ca9c72ca Fix for memory leaks introduced with the push of patch for bug#22740.
Original patch did not have these leaks, they were introduced later
during manual applying of the patch.
2007-01-31 21:16:48 +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
monty@mysql.com/narttu.mysql.fi
410fc81a72 After merge fixes
Removed a lot of compiler warnings
Removed not used variables, functions and labels
Initialize some variables that could be used unitialized (fatal bugs)
%ll -> %l
2007-01-29 01:47:35 +02:00
malff/marcsql@weblab.(none)
0055056c91 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-merge
2007-01-02 14:18:13 -07: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
petr/cps@outpost.site
c25429f1a6 remove assert 2006-12-05 19:04:46 +03:00
monty@mysql.com/narttu.mysql.fi
3a35c30027 Fixed compiler warnings (Mostly VC++):
- Removed not used variables
- Changed some ulong parameters/variables to ulonglong (possible serious bug)
- Added casts to get rid of safe assignment from longlong to long (and similar)
- Added casts to function parameters
- Fixed signed/unsigned compares
- Added some constructores to structures
- Removed some not portable constructs

Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
(Added new parameter to net_clear() to define when we want the communication buffer to be emptied)
2006-11-30 03:40:42 +02:00
monty@mysql.com/nosik.monty.fi
0e149b7170 Removed compiler warnings
Ensure that my_size_t is always unsigned (to get predictiable results from system to system)
Removed some %lld, as these are not portable
2006-11-27 18:16:08 +02:00
monty@mysql.com/nosik.monty.fi
fa81a82e7f Fixed a LOT of compiler warnings
Added missing DBUG_RETURN statements (in mysqldump.c)
Added missing enums
Fixed a lot of wrong DBUG_PRINT() statements, some of which could cause crashes
Removed usage of %lld and %p in printf strings as these are not portable or produces different results on different systems.
2006-11-27 01:47:38 +02:00
andrey@example.com
5fd8554a77 Remove direct mapping of enum interval_type to mysql.event.interval_field
This decoupling allows in further versions of MySQL enum interval_type to
  be reordered without this affecting any backward compatibility in the
  events code.
  This changeset doesn't change any exposed behavior but makes events' code
  more durable to changes outside of their code base.
  
  To the reviewer: There is no regression test included as it is impossible
  to construct one with the current infrastructure which can test it. To test
  the code one has create and event, then change the order of
  enum interval_type in my_time.h, update sql/time.cc, recompile the server
  and run it with scheduler running.
2006-10-10 17:59:46 +02:00
andrey@example.com
db3a25fd78 Fix for bug#22397 Events: crash with procedure which alters events
ALTER EVENT in stored procedure body led to a crash during the
procedure call. Affected was only ALTER EVENT which changed the
interval of the event. No problems with AT, STARTS, ENDS and so on.
2006-09-25 16:49:25 +02:00
andrey@example.com
eedee130c7 WL#3337 (Event scheduler new architecture)
Don't send affected rows after CREATE/ALTER/DROP EVENT as this is
inconsistent with the rest of the server in terms of CREATE/ALTER/DROP
DDLs
2006-08-28 10:27:42 +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.
9eee0ee47a WL #3337 (Event scheduler new architecture)
move back THD::change_security_context to event_change_security_context
2006-07-13 12:19:01 +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.
0d517461f0 WL#3337 (Event scheduler new architecture)
More small fixes to the API : use LEX_STRING instead of LEX_STRING* and if error
then return bool(true) instead of error code.
Merged functions. Reduced usage of sp_name.
Fixed a lot of function documentation errors.
Added function documentation wherever needed.
Removed some unused defines and error codes.

Next to come is batch rename of Event_scheduler_ng to Event_scheduler.
2006-07-11 18:28:15 +02:00
andrey@lmy004.
2f7555b308 Remove trailing whitespace.
After merge fixes.
2006-07-10 23:54:46 +02:00
andrey@lmy004.
2319aac01e Manual merge 2006-07-10 14:42:29 +02:00
andrey@lmy004.
e3d0524bbd WL#3337 (Event scheduler new architecture)
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.
2006-07-10 13:44:43 +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.
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.
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.
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
Renamed from sql/event_timed.cc (Browse further)