Commit graph

28 commits

Author SHA1 Message Date
unknown
fce7280591 Fix spelling (recursivity -> recursion)
mysql-test/r/events.result:
  Fix spelling.
mysql-test/r/events_bugs.result:
  Fix spelling.
mysql-test/r/ps.result:
  Fix spelling.
mysql-test/t/events.test:
  Fix spelling.
mysql-test/t/events_bugs.test:
  Fix spelling.
mysql-test/t/ps.test:
  Fix spelling.
sql/sql_yacc.yy:
  Fix spelling.
sql/share/errmsg.txt:
  Fix spelling.
2007-03-27 22:15:51 +04:00
unknown
086fba7627 BUG#16420: Events: timestamps become UTC
BUG#26429: SHOW CREATE EVENT is incorrect for an event that
           STARTS NOW()
BUG#26431: Impossible to re-create an event from backup if its
           STARTS clause is in the past
WL#3698: Events: execution in local time zone

The problem was that local times specified by the user in AT, STARTS
and ENDS of CREATE EVENT/ALTER EVENT statement were converted to UTC,
and the original time zone was forgotten.  This way, event scheduler
couldn't honor Daylight Saving Time shifts, and times shown to the
user were also in UTC.  Additionally, CREATE EVENT didn't allow times
in the past, thus preventing straightforward event restoration from
old backups.

This patch reworks event scheduler time computations, performing them
in the time zone associated with the event.  Also it allows times to
be in the past.

The patch adds time_zone column to mysql.event table.

NOTE: The patch is almost final, but the bug#9953 should be pushed
first.


client/mysqldump.c:
  Before every CREATE EVENT, output its time zone.
mysql-test/include/wait_condition.inc:
  Add optional $wait_timeout parameter.
mysql-test/lib/init_db.sql:
  Add time_zone column.
mysql-test/r/events.result:
  Update result.
mysql-test/r/events_bugs.result:
  Update result.
mysql-test/r/events_grant.result:
  Update result.
mysql-test/r/events_restart_phase1.result:
  Update result.
mysql-test/r/events_scheduling.result:
  Update result.
mysql-test/r/mysqldump.result:
  Update result.
mysql-test/r/ps.result:
  Update result.
mysql-test/r/system_mysql_db.result:
  Update result.
mysql-test/t/events.test:
  Remove STARTS from the result, as it depends on current time.
mysql-test/t/events_bugs.test:
  Time in the past is no longer an error.
mysql-test/t/events_restart_phase1.test:
  Fill new column 'time_zone' in mysql.event.
mysql-test/t/events_scheduling.test:
  Cleanup: disable event scheduler.
scripts/mysql_create_system_tables.sh:
  Add new column 'time_zone' to mysql.event.
scripts/mysql_fix_privilege_tables.sql:
  Add new column 'time_zone' to mysql.event.
sql/event_data_objects.cc:
  The essence of the change is the following:
   - for internal times use my_time_t instead of TIME.  Assignment and
     comparison is done now on plain numbers.
   - in init_execute_at(), init_starts(), init_ends() convert given time
     to number of seconds since Epoch (aka Unix time, in UTC).
   - handle time_zone field loading and storing.
   - in get_next_time(), Unix time is converted back to event time zone,
     interval is added, and the result is converted to UTC again.
   - fix Event_timed::get_create_event() to report STARTS and ENDS.
   - before executing the event body we set thread time zone to the
     event time zone.
sql/event_data_objects.h:
  Add time_zone member to Event_basic class.
  
  Store internal times in my_time_t (number of seconds since Epoch),
  rather than in broken down TIME structure.
sql/event_db_repository.cc:
  Add time_zone column handling.
  
  Give a warning and do not create an event if its execution time is in
  the past, and ON COMPLETION NOT PRESERVE is set, because such an event
  should be dropped by that time.  Also, do not allow ALTER EVENT to
  set execution time in the past when ON COMPLETION NOT PRESERVE is set.
sql/event_db_repository.h:
  Add enum member for new time zone column.
sql/event_queue.cc:
  Replace handling of broken down times with simple handling of
  my_time_t.
sql/event_queue.h:
  Store internal times in my_time_t (number of seconds since Epoch),
  rather than in broken down TIME structure.
sql/event_scheduler.cc:
  Add TODO comment.
sql/events.cc:
  Send time_zone column for SHOW CREATE EVENT.
sql/share/errmsg.txt:
  Update error message, and add two more errors.
sql/sql_show.cc:
  Add TIME_ZONE column to the output of SHOW EVENTS.
mysql-test/r/events_time_zone.result:
  BitKeeper file /home/tomash/src/mysql_ab/mysql-5.1-wl3698/mysql-test/r/events_time_zone.result
mysql-test/t/events_time_zone.test:
  BitKeeper file /home/tomash/src/mysql_ab/mysql-5.1-wl3698/mysql-test/t/events_time_zone.test
2007-03-16 17:31:07 +03:00
unknown
2b48825bd6 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.


mysql-test/r/events_bugs.result:
  Add result for bug#16425: Events: no DEFINER clause.
mysql-test/t/events_bugs.test:
  Add test case for bug#16425: Events: no DEFINER clause.
sql/event_data_objects.cc:
  Event_parse_data::init_definer() looks for DEFINER in
  thd->lex->definer, which is always set now.
sql/sql_parse.cc:
  Move DEFINER processing into the sp_process_definer().  Call this
  function for CREATE EVENT/ALTER EVENT, as well as for CREATE
  PROCEDURE/FUNCTION.
sql/sql_yacc.yy:
  Add 'alter DEFINER=... event', update rule references accordingly.
2007-02-02 20:43:33 +03:00
unknown
35fdeff81f BUG#25211: events_bugs.test fails on sapsrv1
The problem was that the events_bugs test could randomly fail due to
races in the test case.

The solution is to replace fixed sleeps with reliable polling of a
certain state to settle.  For that, a new auxiliary script
include/wait_condition.inc is used, that allows waiting for a given
query to return true.


mysql-test/include/wait_until_rows_count.inc:
  Script is rewritten using new include/wait_condition.inc.
mysql-test/r/events_bugs.result:
  Update result: add missing quotation mark.
mysql-test/t/events_bugs.test:
  Replace --sleep with the reliable waiting for a certain state.
mysql-test/include/wait_condition.inc:
  New BitKeeper file ``mysql-test/include/wait_condition.inc''
2007-01-19 18:33:48 +03:00
unknown
0a22a1b915 Additional fix for bug#22369
mysql-test/t/events_bugs.test:
  let events_bugs not fail because of timing
sql/sql_table.cc:
  if the db or name has been changed ALTER_RENAME,
  then fix table_list
  Solution by having the second table added in the parser to the
  list of used tables, won't work because checking of rights of merge
  tables goes over table_list->next_local and checks the rights, so
  we will fail there.
sql/sql_yacc.yy:
  fix name - prevents ddd from correct working
2006-12-07 13:57:39 +01:00
unknown
2a434f728f fix for bug#24396
mysql-test/t/events_bugs.test:
  increase wait time..this had to be > 0.7
2006-11-22 14:06:59 +01:00
unknown
63030d767c Better fix for bug#22830
Events: crash with procedure which alters events with function

Post-review CS

This fix also changes the handling of KILL command combined with
subquery. It changes the error message given back to "not supported",
from parse error. The error for CREATE|ALTER EVENT has also been changed
to generate "not supported yet" instead of parse error.
In case of a SP call, the error is "not supported yet". This change
cleans the parser from code which should not belong to there. Still
LEX::expr_allows_subselect is existant because it simplifies the handling
 of SQLCOM_HA_READ which forbids subselects.


mysql-test/r/events_bugs.result:
  update resut
mysql-test/r/events_grant.result:
  update result
mysql-test/r/kill.result:
  the error message has been changed for KILL
mysql-test/t/events_bugs.test:
  Update old tests with the new emitted error
  
  Add a test case for
  BUG#22830 Events: crash with procedure which alters events with function
mysql-test/t/events_grant.test:
  add ORDER BY clause to keep the result deterministic.
mysql-test/t/kill.test:
  use name of the error, and change the error
  from parse error, to not supported
sql/sql_lex.cc:
  Add an auxiliary function that checks whether SP and/or
  tables are used in the statement. This function is helpful for
  statements that cannot handle subqueries ans SP calls. Adding out
  of the parser cleans the latter of handling of special cases and
  letting it do its job of parsing.
sql/sql_lex.h:
  helper function to check whether a table or SP was used
sql/sql_parse.cc:
  Use LEX::table_or_sp_used() for SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT
  and SQLCOM_KILL. SQLCOM_DROP event does not use `expr` rule and thus a check is
  not needed.
sql/sql_yacc.yy:
  Remove usage of LEX::expr_allows_subselect for CREATE|ALTER EVENT
  and KILL. There is only one left occurence - SQLCOM_HAREAD, but it 
  adds one table to the list of tables
2006-11-02 13:51:43 +01:00
unknown
6c9400b930 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.



mysql-test/r/events_bugs.result:
  fix result
mysql-test/t/events_bugs.test:
  add test case for bug 22397 : Events, crash with procedure which alters body
sql/event_data_objects.cc:
  fix copy&paste error in code, which resulted in bug#22397
  Events: crash with procedure which alters body
2006-09-25 16:49:25 +02:00
unknown
53267edaf6 fix build 2006-09-08 00:49:37 +02:00
unknown
da4734c3bc WL#3337 (Event scheduler new architecture)
This is a post-review patch.

Fixes the typelib implementation, available only in 5.1.11.

--event-scheduler cmdline : DISABLED | ON | OFF | 0 | 1
DISABLED - makes the scheduler unavailable during the server run
(ON|1)-  When the server is started the scheduler will be started. It can
         be stopped and restarted by setting appropriate values to
         GLOBAL event_scheduler
(OFF|0)- When the server is started, the scheduler won't be started. It
         can be started and again stopped by setting appropriate values to
         GLOBAL event_scheduler. _DEFAULT_ value

The GLOBAL variable event_scheduler can have the following values:
OFF | ON | 0 | 1
DISABLED is not possible and every attempt will end with an error that
it's not a valid value for the variable.
OFF | 0 - This is the pre-5.1.11 behavior - The scheduler stops, if not
          already stopped, and can be started again  by setting
          the value of the variable to ON|1.
ON | 1  - This is the pre-5.1.11 behavior - The scheduler starts, if not
          already started, and can be stopped again by setting the value
          of the variable to OFF|0.


mysql-test/r/events.result:
  update result
mysql-test/r/events_bugs.result:
  update result
mysql-test/r/events_logs_tests.result:
  update result
mysql-test/r/events_restart_phase1.result:
  update result
mysql-test/r/events_restart_phase3.result:
  update result
mysql-test/r/events_scheduling.result:
  update result
mysql-test/r/events_stress.result:
  update result
mysql-test/t/events.test:
  update test:
  2 -> off
  1 -> on
mysql-test/t/events_bugs.test:
  update test:
  2 -> off
  1 -> on
mysql-test/t/events_logs_tests.test:
  update test:
  2 -> off
  1 -> on
mysql-test/t/events_restart_phase1.test:
  update test:
  2 -> off
  1 -> on
mysql-test/t/events_restart_phase2-master.opt:
  update master file : 1 => on
mysql-test/t/events_scheduling.test:
  update test:
  2 -> off
  1 -> on
  
  add tests for event_scheduler global variable representation from
  SHOW VARIABLES.
mysql-test/t/events_stress.test:
  update test:
  2 -> off
  1 -> on
sql/events.cc:
  Implement two different TYPELIBs for --event-scheduler cmd line
  option and for GLOBAL variable event_scheduler
  
  --event-scheduler cmdline : DISABLED | ON | OFF | 0 | 1
  DISABLED - makes the scheduler unavailable during the server run
  (ON|1)-  When the server is started the scheduler will be started. It can
           be stopped and restarted by setting appropriate values to
           GLOBAL event_scheduler
  (OFF|0)- When the server is started, the scheduler won't be started. It
           can be started and again stopped by setting appropriate values to
           GLOBAL event_scheduler. _DEFAULT_ value
  
  The GLOBAL variable event_scheduler can have the following values:
  OFF | ON | 0 | 1
  DISABLED is not possible and every attempt will end with an error that
  it's not a valid value for the variable.
  OFF | 0 - This is the pre-5.1.11 behavior - The scheduler stops, if not
            already stopped, and can be started again  by setting
            the value of the variable to ON|1.
  ON | 1  - This is the pre-5.1.11 behavior - The scheduler starts, if not
            already started, and can be stopped again by setting the value
            of the variable to OFF|0.
sql/events.h:
  additional TYPELIB for GLOBAL event_scheduler
sql/mysqld.cc:
  --event-scheduler should be checked against a TYPELIB and
  therefore should be GET_STR, as well as we make the parameter optional.
  When not provided OFF|0 is used.
sql/set_var.cc:
  Implement typelib for event_scheduler variable.
  If allows both INT_RESULT -> 0 | 1 
  and STRING_RESULT -> OFF | ON
  The variable is shown as DISABLED | ON | OFF
sql/set_var.h:
  Implement typelib, which expects both STRING and INT,
  for event_scheduler.
2006-09-01 13:08:44 +02:00
unknown
e5a2cb50fa post-merge and testing fixes
mysql-test/r/events_bugs.result:
  update results after merge
mysql-test/t/events.test:
  num to name
mysql-test/t/events_bugs.test:
  num to name
sql/sql_yacc.yy:
  post-merge fixes regarding init_sp_name
  put back code which I unintentionally removed during merg
sql/share/errmsg.txt:
  add the message back
2006-08-15 00:50:26 +02:00
unknown
e69e640f2e WL#3337 (Events new architecture)
Small updates before patch submit.


client/mysqltest.c:
  allow --valgrind option to mysqltest so one can be able to detect
  whether the test is running under valgrind by having $VALGRIND_TEST,
  similar to BIG_TEST, in the test file.
mysql-test/mysql-test-run.pl:
  If the test suite is running under valgrind start mysqltest with --valgrind
  to inform that we run valgrind. mysqltest will provide $VALGRIND_TEST for the
  test cases.
mysql-test/r/events_bugs.result:
  update result
mysql-test/r/events_scheduling.result:
  update result
mysql-test/t/events.test:
  Increase times or the test will fail under valgrind
mysql-test/t/events_bugs.test:
  Increase times or the test will fail under valgrind
mysql-test/t/events_scheduling.test:
  Remove faulty test
  Disable the test case for valgrind
sql/event_data_objects.cc:
  count the number of executions
sql/event_data_objects.h:
  flags is not used at all
  add execution_count to count the number of executions
sql/event_db_repository.cc:
  Initialize wherever needed.
  Add a comment regarding valgrind warning.
sql/event_queue.cc:
  more debug info in the trace log
sql/event_scheduler.cc:
  Use macro COND_STATE_WAIT() in all cases we need waiting
  on condition. Hence, we can trace locking, attemption to lock
  and more with SHOW SCHEDULER STATUS
sql/event_scheduler.h:
  Change the declaration of cond_wait to accept THD
sql/events.cc:
  fix memory leak. Destroy event_queue
mysql-test/include/not_valgrind.inc:
  New BitKeeper file ``mysql-test/include/not_valgrind.inc''
mysql-test/r/not_valgrind.require:
  New BitKeeper file ``mysql-test/r/not_valgrind.require''
2006-07-17 16:52:45 +02:00
unknown
974eecc246 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.


mysql-test/r/events.result:
  update results
mysql-test/r/events_bugs.result:
  update results
mysql-test/r/events_logs_tests.result:
  update results
mysql-test/r/events_scheduling.result:
  update results
mysql-test/t/events.test:
  update test
  make --sleep more appropriate . saving some time could mean failure on loaded boxes though :(
  add tests for previously uncovered branches.
mysql-test/t/events_bugs.test:
  update test
  make --sleep more appropriate . saving some time could mean failure on loaded boxes though :(
  add tests for previously uncovered branches.
mysql-test/t/events_logs_tests.test:
  make the test shorter by time
mysql-test/t/events_scheduling.test:
  when selecting always use ORDER BY
mysql-test/t/events_stress.test:
  sleep 2.5secs for shorter stress test
sql/event_data_objects.cc:
  Event_timed is no more used during execution.
  Event_timed is no more used during in the memory queue.
  Event_timed is only used for SHOW CREATE EVENT/ I_S.EVENTS/ SHOW EVENTS
  Event_basic is the parent of almost all Event data objects.
  Event_basic -> Event_queue_element (used for the memory queue) -> Event_timed
  Event_basic -> Event_job_data (the object used for execution)
  Sql_alloc -> Event_parse_data (used during parsing)
sql/event_data_objects.h:
  Event_timed is no more used during execution.
  Event_timed is no more used during in the memory queue.
  Event_timed is only used for SHOW CREATE EVENT/ I_S.EVENTS/ SHOW EVENTS
  Event_basic is the parent of almost all Event data objects.
  Event_basic -> Event_queue_element (used for the memory queue) -> Event_timed
  Event_basic -> Event_job_data (the object used for execution)
  Sql_alloc -> Event_parse_data (used during parsing)
sql/event_db_repository.cc:
  Cosmetics.
  load_named_event now uses Event_basic, for polymorphism
  find_event uses Event_basic, to be polymorphic.
  use Field **fields= table->field and then index fields[...]
  Add documentation.
  Fix documentation.
sql/event_db_repository.h:
  Event_db_repository depends only on Event_basic's interface
sql/event_queue.cc:
  Cosmetics.
  Don't use Event_timed for the queue and giving back object for execution.
  Event_queue_element is for the queue, Event_job_data is for execution.
  Add Event_queue::dump_internal_status() for SHOW SCHEDULER STATUS command
sql/event_queue.h:
  Cosmetics.
  Don't use Event_timed for the queue and giving back object for execution.
  Event_queue_element is for the queue, Event_job_data is for execution.
  Add Event_queue::dump_internal_status() for SHOW SCHEDULER STATUS command
sql/event_scheduler_ng.cc:
  Add back Event_scheduler::cond_wait()
  Add back Event_scheduler::dump_internal_status()
  Using Event_job_data for execution. Make the scheduler thread unkillable (thd->command= COM_DAEMON).
  Add a lot of documentation.
sql/event_scheduler_ng.h:
  Add back Event_scheduler::cond_wait()
  Add back Event_scheduler::dump_internal_status()
  Using Event_job_data for execution.
sql/events.cc:
  Documentation
  Add LOCK_event_metadata
sql/events.h:
  Change the signature of Events::drop_event() not to use sp_name but LEX_STRING
sql/share/errmsg.txt:
  Fix error message
sql/sql_parse.cc:
  Events::drop_event() has new signature
2006-07-10 13:44:43 +02:00
unknown
8d961c45e2 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).


mysql-test/r/events_bugs.result:
  update result
mysql-test/t/events_bugs.test:
  tests for bug#16384
sql/sql_yacc.yy:
  disallow subqueries when SQLCOM_CREATE_EVENT | SQLCOM_ALTER_EVENT
  The fix is not big, though lex->forbid_subqueries could have been introduced.
  Easier is just to set the sql_command and check in both rules where
  subqueries enter.
2006-06-29 11:53:51 +02:00
unknown
cace147c63 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|


mysql-test/r/events.result:
  update results
mysql-test/r/events_bugs.result:
  update results
mysql-test/t/events.test:
  use number as error, mysql-test-run does not like the name.
  will come back to this later, now it's enough to pass the test.
  disable nested events / events in SP, when the nested event has
  a body. If no body is provided, namely DROP EVENT or ALTER that
  changes the characteristics, then these are allowed.
mysql-test/t/events_bugs.test:
  use number as error, mysql-test-run does not like the name.
  will come back to this later, now it's enough to pass the test.
  disable nested events / events in SP, when the nested event has
  a body. If no body is provided, namely DROP EVENT or ALTER that
  changes the characteristics, then these are allowed.
sql/share/errmsg.txt:
  new message
sql/sql_yacc.yy:
  refactor CREATE EVENT parsing to fit into the structure
  CREATE DEFINER=xxx EVENT
  The actual definer part is not used, but parsed, for now.
  Disable nested CREATE EVENTS, CREATE EVENT inside CREATE PROCEDURE.
  And an event DDL with body inside an ALTER.
  This stops the following :
  - CREATE EVENT ... DO CREATE EVENT ...;
  - ALTER  EVENT ... DO CREATE EVENT ...;
  - CREATE EVENT ... DO ALTER EVENT DO ....;
  - CREATE PROCEDURE ... BEGIN CREATE EVENT ... END|
  This allows:
  - 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
unknown
c945766ff3 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into lmy004.:/work/mysql-5.1-runtime-bug18897


mysql-test/t/events_bugs.test:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2006-06-26 08:55:49 +02:00
unknown
d6cf50ca8b 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.


mysql-test/r/events_bugs.result:
  update result
mysql-test/t/events_bugs.test:
  add test case for bug 18897 Events: unauthorized action possible with alter event
  rename:
  - test rename to db the user does not have access to
  - test rename when there is no selected db
sql/sql_parse.cc:
  Additional check for the situation when no db is selected.
  CREATE EVENT abc and ALTER EVENT db.abc RENAME TO xyz,
  and DROP EVENT abc
  won't work if there is no selected DB.
2006-06-23 17:29:01 +02:00
unknown
d0a603e35c disable events tests in embedded
(fix for bug#20290 Event mechanism incompatible with embedded server, but tests tried)


mysql-test/t/events.test:
  disable test in embedded
mysql-test/t/events_bugs.test:
  disable test in embedded
mysql-test/t/events_grant.test:
  disable test in embedded
mysql-test/t/events_logs_tests.test:
  disable test in embedded
mysql-test/t/events_microsec.test:
  disable test in embedded
mysql-test/t/events_scheduling.test:
  disable test in embedded
mysql-test/t/events_stress.test:
  disable test in embedded
2006-06-23 09:40:06 +02:00
unknown
f4781a7e4c 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


BitKeeper/etc/ignore:
  Added libmysqld/event_scheduler.cc to the ignore list
libmysqld/Makefile.am:
  executor -> scheduler
mysql-test/r/events.result:
  update result
mysql-test/r/events_bugs.result:
  update result
mysql-test/r/events_logs_tests.result:
  update result
mysql-test/r/events_microsec.result:
  update result
mysql-test/r/events_scheduling.result:
  update result
mysql-test/r/events_stress.result:
  update result
mysql-test/t/disabled.def:
  enable these tests
mysql-test/t/events.test:
  optimize the test a bit for speed, save some seconds runtime
  remove FULL from SHOW EVENTS
  mostly use I_S.EVENTS
mysql-test/t/events_bugs.test:
  Skip irrelevant for the current design tests - all events are loaded
  on server startup. Change in mysql.event will be visible on next server start.
  Don't use numeric error codes.
mysql-test/t/events_logs_tests.test:
  optimize the test a bit for speed
mysql-test/t/events_microsec.test:
   Skip irrelevant for the current design tests - all events are loaded
      on server startup. Change in mysql.event will be visible on next server start.
      Don't use numeric error codes.
mysql-test/t/events_scheduling.test:
  broader test
mysql-test/t/events_stress.test:
  Rework the test to the new architecture of suspending/resuming.
  Use less events, no need for thousands, hundreds is still ok.
sql/Makefile.am:
  executor -> scheduler
sql/cmakelists.txt:
  executor -> scheduler
sql/event.cc:
  - remove todo comments
  - remove unneded evex_queue abstraction functions
  - move events_init() and events_shutdown() from event_executor.cc to here
  - export db_create_event
  - remove evex_load_and_compile_event, part of class Event_scheduler
  - integrate the public interface found in event.h and used by sql_parse.cc
    to use the new class Event_scheduler.
sql/event.h:
  - add COND_finished so if one thread kills a running event it waits on this
  - export callback event_timed_definer_equal, event_timed_identifier_equal(),
    event_timed_name_equal and event_timed_db_equal()
    to be used by Event_scheduler::drop_matching_events()
  - cleanup event.h
  - encapsulated all external interface into class Events
sql/event_executor.cc:
  make it empty, will delete after that
sql/event_priv.h:
  - more things in the private header
  - remove event queue abstraction functions. tightly bind to QUEUE
  - export privately db_drop_event, db_find_event, db_create_event()
  - made change_security_context() and restore_security_context() free functions
sql/event_timed.cc:
  - fix calculation of time when ENDS is set (STARTS is always set)
  - during Event_timed::compile() set the right Security_ctx. Prevents a crash
        during Event_scheduler::load_events_from_db()
  - add Event_timed::kill_thread()
  - implement event_timed_*_equal()
  - made change_security_context() and restore_security_context() free functions.
  - Comments cleanups
sql/lex.h:
  new word scheduler for SHOW SCHEDULER STATUS (available only debug builds)
sql/log.cc:
  move these from event_scheduler.cc
sql/mysql_priv.h:
  refactor kill_one_thread
  export sql_print_message_func and sql_print_message_handlers
sql/mysqld.cc:
  In close_connections, called by kill_server() skip the main scheduler
  thread and use events_shutdown() for shutting down the scheduler, in the same
  manner it's done for RPL.
  Add a new value to --event-scheduler :
  0 <- No scheduler available
  1 <- Start with scheduler enabled
  2 <- Start with scheduler suspended
sql/repl_failsafe.cc:
  refactor thd::system_thread to be an enum
sql/set_var.cc:
  move sys_var_event_executor::update() to set_var.cc
  executor -> scheduler
  use thd::sys_var_tmp
sql/set_var.h:
  executor -> scheduler
sql/share/errmsg.txt:
  3 new error messages
sql/sql_class.cc:
  refactor thd::system_thread to be an enum . more type-safety
sql/sql_class.h:
  refactor thd::system_thread to be an enum . more type-safety
sql/sql_db.cc:
  get the error from evex_drop_schema_events
sql/sql_error.h:
  export warning_level_names
sql/sql_lex.h:
  new command SHOW SCHEDULER STATUS, available only in debug build and
  for debug purposes.
sql/sql_parse.cc:
  refactor kill_one_thread() -> does the *dirty* work, and sql_kill
  just the reporting.
  add handler for SQLCOM_SHOW_SCHEDULER_STATUS
sql/sql_show.cc:
  fix verbosity handling (this will be obsoleted anyway by the fix for 17394).
sql/sql_yacc.yy:
  remove FULL from SHOW EVENTS
  add SHOW SCHEDULER STATUS in debug builds
sql/table.cc:
  Fix valgrind warning.
2006-05-22 20:46:13 +02:00
unknown
fd1303ead7 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into lmy004.:/work/mysql-5.1-bug14356


mysql-test/r/events.result:
  Auto merged
mysql-test/r/events_bugs.result:
  Auto merged
mysql-test/t/events.test:
  Auto merged
mysql-test/t/events_bugs.test:
  Auto merged
2006-03-28 10:42:46 +02:00
unknown
b95fb17332 manual merge
mysql-test/r/events.result:
  Auto merged
mysql-test/t/events_bugs.test:
  Auto merged
scripts/mysql_fix_privilege_tables.sql:
  Auto merged
2006-03-25 00:24:04 +01:00
unknown
6e9cd55d83 fix for bug#16415 Events names are case sensitive
mysql-test/lib/init_db.sql:
  make name not binary, then event names won't be case sensitive
mysql-test/r/events.result:
  output fix
mysql-test/r/events_bugs.result:
  update result
mysql-test/t/events_bugs.test:
  test case for bug #16415 events' names are case sensitive
scripts/mysql_create_system_tables.sh:
  make name not binary, then event names won't be case sensitive
scripts/mysql_fix_privilege_tables.sql:
  make name not binary, then event names won't be case sensitive
2006-03-24 17:45:52 +01:00
unknown
647eefca2c fix after manual merge of fix for bug #16396: Events: Distant-future dates become past dates.
mysql-test/r/events.result:
  update result
mysql-test/r/events_bugs.result:
  update result after manual merge
mysql-test/t/events.test:
  move from error number to a constant
mysql-test/t/events_bugs.test:
  update error codes
2006-03-17 11:01:45 +01:00
unknown
a9e6af8ddf manual merge
sql/event_timed.cc:
  Auto merged
2006-03-17 09:40:48 +01:00
unknown
119de0547c fix for bug #17578: Test "events" fails due to scheduling difference
mysql-test/r/events.result:
  update result
mysql-test/r/events_bugs.result:
  update result
mysql-test/t/events.test:
  - use information_schema.processlist
  - move from error codes to constants
mysql-test/t/events_bugs.test:
  fix for bug #17578: Test "events" fails due to scheduling difference
  use information_schema.processlist
2006-03-16 16:41:00 +01:00
unknown
06dd976419 fix for bug 16408 (Events: crash for an event in a procedure)
(one patch)


mysql-test/r/events_bugs.result:
  fix for bug 16408
mysql-test/t/events_bugs.test:
  fix for bug 16408
sql/event.h:
  fix for bug 16408
sql/event_timed.cc:
  fix for bug 16408
sql/sql_parse.cc:
  fix for bug 16408
sql/sql_yacc.yy:
  fix for bug 16408
2006-03-16 13:14:40 +01:00
unknown
bcc6821b25 fix for bug #16396: Events: Distant-future dates become past dates
WL#1034 (Internal CRON)
timestamps does not support > y2038


mysql-test/r/events_bugs.result:
  update results
mysql-test/t/events_bugs.test:
  add tests
sql/event_timed.cc:
  fix for bug #16396: Events: Distant-future dates become past dates.
2006-03-03 01:39:11 +01:00
unknown
203b37effe 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)


sql/event.cc:
  store the sql_mode when the body is stored
  - always on create event
  - during alter event if the user changes the body
sql/event.h:
  add sql_mode as member variable
sql/event_timed.cc:
  - exchange thd->variables.sql_mode before and after execution
  - set the sql_mode of the anonymous SP -> event_timed::sphead
sql/sql_show.cc:
  - show real content in I_S.EVENTS.SQL_MODE , disallow NULL
2006-02-20 23:52:22 +01:00