Commit graph

135 commits

Author SHA1 Message Date
unknown
bf4996c4eb Missing parameter to DBUG_PRINT 2007-03-01 18:14:51 -07:00
unknown
2e34602392 Fixed compiler warnings
server-tools/instance-manager/angel.cc:
  Compiler warnings
sql/event_queue.cc:
  Compier warnings
sql/event_scheduler.cc:
  Compiler warnings
sql/events.cc:
  Compiler warnings
2007-03-01 16:39:00 -07:00
unknown
3c39b0d831 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


sql/event_data_objects.cc:
  Introduced a new class Event_queue_element_for_exec
  According to Konstantin it should be named Event_name and hold
  only two LEX_STRINGs but `dropped` is not saved on disk and will
  require additional logic in Event_worker_thread class, after loading
  to compute whether the event should be dropped or not. It's easier
  just to pass this flag around.
  
  Removed Event_queue_element::drop(). This method was a source of a
  race condition. At the place where the event should be dropped we
  call Events::drop_event() which is the only code-flow for dropping.
  In addition, because ::drop_event() holds Events::LOCK_metadata there is
  no source of race conditions. Before this patch dropping from ::drop()
  wasn't under LOCK_metadata and races were possible.
  
  Because Events::open_event_table was removed as a method, provisionally
  events_event_db_repository was exported from events.cc till a solution is
  build where Event_queue_element does not access directly mysql.event.
sql/event_data_objects.h:
  New class Event_queue_element_for_exec added which is returned
  from Event_queue::get_top_if_time() and passed through Event_scheduler
  to Event_worker_thread. There by using the (db)name Event_job_data is
  instanciated and executed.
  
  Dropped Event_queue_element::drop()
  
  thd was moved out of Event_job_data as it is now part of
  Event_queue_element_for_exec
sql/event_queue.cc:
  Removed dependency of Event_queue on Event_db_repository.
  The instantiation of Event_job_data was moved to class Event_worker_thread
  In place is a return of an object of Event_queue_element_for_exec is used
  later for instantiating Event_job_data.
  
  The `dropped` flag of Event_queue_element is passed over
  Event_queue_element_for_exec to the code in Event_worker_thread.
sql/event_queue.h:
  Removed dependency of Event_queue on Event_db_repository
  Removed dependency on Event_scheduler
sql/event_scheduler.cc:
  Added class Event_worker_thread, which is used during
  the execution of an event. It has a static init() method
  to get a pointer to Event_db_repository to be used for
  instantiation of Event_job_data object. This object it then
  executed.
sql/event_scheduler.h:
  Added class Event_worker_thread, which is used during
  the execution of an event.
sql/events.cc:
  Removed Events::open_event_table() because it was a product of
  a bad architecture.
sql/events.h:
  Removed friend definition, unneeded.
  
  Fixed Events::drop_event() to have the previous signature without
  bool only_from_disk
sql/sql_parse.cc:
  Fix call
2007-01-29 20:46:29 +03:00
unknown
92e68d49d7 Many files:
Changed header to GPL version 2 only


client/mysqlslap.c:
  Changed header to GPL version 2 only
include/atomic/nolock.h:
  Changed header to GPL version 2 only
include/atomic/rwlock.h:
  Changed header to GPL version 2 only
include/atomic/x86-gcc.h:
  Changed header to GPL version 2 only
include/atomic/x86-msvc.h:
  Changed header to GPL version 2 only
include/my_atomic.h:
  Changed header to GPL version 2 only
include/my_trie.h:
  Changed header to GPL version 2 only
include/my_vle.h:
  Changed header to GPL version 2 only
include/mysql/plugin.h:
  Changed header to GPL version 2 only
mysys/my_atomic.c:
  Changed header to GPL version 2 only
mysys/my_getncpus.c:
  Changed header to GPL version 2 only
mysys/my_memmem.c:
  Changed header to GPL version 2 only
mysys/my_vle.c:
  Changed header to GPL version 2 only
mysys/trie.c:
  Changed header to GPL version 2 only
plugin/Makefile.am:
  Changed header to GPL version 2 only
server-tools/instance-manager/IMService.h:
  Changed header to GPL version 2 only
server-tools/instance-manager/WindowsService.h:
  Changed header to GPL version 2 only
server-tools/instance-manager/exit_codes.h:
  Changed header to GPL version 2 only
server-tools/instance-manager/user_management_commands.h:
  Changed header to GPL version 2 only
sql/authors.h:
  Changed header to GPL version 2 only
sql/contributors.h:
  Changed header to GPL version 2 only
sql/event_data_objects.cc:
  Changed header to GPL version 2 only
sql/event_data_objects.h:
  Changed header to GPL version 2 only
sql/event_db_repository.cc:
  Changed header to GPL version 2 only
sql/event_db_repository.h:
  Changed header to GPL version 2 only
sql/event_queue.cc:
  Changed header to GPL version 2 only
sql/event_queue.h:
  Changed header to GPL version 2 only
sql/event_scheduler.cc:
  Changed header to GPL version 2 only
sql/event_scheduler.h:
  Changed header to GPL version 2 only
sql/events.cc:
  Changed header to GPL version 2 only
sql/events.h:
  Changed header to GPL version 2 only
sql/ha_ndbcluster_binlog.cc:
  Changed header to GPL version 2 only
sql/ha_ndbcluster_binlog.h:
  Changed header to GPL version 2 only
sql/ha_ndbcluster_tables.h:
  Changed header to GPL version 2 only
sql/ha_partition.cc:
  Changed header to GPL version 2 only
sql/ha_partition.h:
  Changed header to GPL version 2 only
sql/item_xmlfunc.cc:
  Changed header to GPL version 2 only
sql/item_xmlfunc.h:
  Changed header to GPL version 2 only
sql/log.h:
  Changed header to GPL version 2 only
sql/partition_element.h:
  Changed header to GPL version 2 only
sql/partition_info.cc:
  Changed header to GPL version 2 only
sql/partition_info.h:
  Changed header to GPL version 2 only
sql/rpl_filter.cc:
  Changed header to GPL version 2 only
sql/rpl_filter.h:
  Changed header to GPL version 2 only
sql/rpl_injector.cc:
  Changed header to GPL version 2 only
sql/rpl_injector.h:
  Changed header to GPL version 2 only
sql/rpl_mi.cc:
  Changed header to GPL version 2 only
sql/rpl_mi.h:
  Changed header to GPL version 2 only
sql/rpl_rli.cc:
  Changed header to GPL version 2 only
sql/rpl_rli.h:
  Changed header to GPL version 2 only
sql/rpl_tblmap.cc:
  Changed header to GPL version 2 only
sql/rpl_tblmap.h:
  Changed header to GPL version 2 only
sql/rpl_utility.cc:
  Changed header to GPL version 2 only
sql/rpl_utility.h:
  Changed header to GPL version 2 only
sql/sql_binlog.cc:
  Changed header to GPL version 2 only
sql/sql_partition.cc:
  Changed header to GPL version 2 only
sql/sql_partition.h:
  Changed header to GPL version 2 only
sql/sql_plugin.cc:
  Changed header to GPL version 2 only
sql/sql_plugin.h:
  Changed header to GPL version 2 only
sql/sql_servers.cc:
  Changed header to GPL version 2 only
sql/sql_servers.h:
  Changed header to GPL version 2 only
sql/sql_tablespace.cc:
  Changed header to GPL version 2 only
sql/sql_yacc.yy.bak:
  Changed header to GPL version 2 only
storage/Makefile.am:
  Changed header to GPL version 2 only
storage/archive/Makefile.am:
  Changed header to GPL version 2 only
storage/blackhole/Makefile.am:
  Changed header to GPL version 2 only
storage/csv/Makefile.am:
  Changed header to GPL version 2 only
storage/example/Makefile.am:
  Changed header to GPL version 2 only
storage/federated/Makefile.am:
  Changed header to GPL version 2 only
storage/innobase/handler/Makefile.am:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/AllocNodeId.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/CreateObj.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/DictObjOp.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/DihFragCount.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/DropFilegroup.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/DropObj.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/Extent.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/RestoreImpl.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/RouteOrd.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp:
  Changed header to GPL version 2 only
storage/ndb/include/ndbapi/NdbIndexStat.hpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/mgmapi_logevent/mgmapi_logevent.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/mgmapi_logevent_dual/mgmapi_logevent_dual.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_async/ndbapi_async.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_event/ndbapi_event.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_retries/ndbapi_retries.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_scan/ndbapi_scan.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual.cpp:
  Changed header to GPL version 2 only
storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbdih/printSysfile.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbtup/Undo_buffer.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/dbtux/DbtuxStat.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/diskpage.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/lgman.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/lgman.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/pgman.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/pgman.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/print_file.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/record_types.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/restore.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/restore.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/tsman.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/blocks/tsman.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/DLCFifoList.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/DLCHashTable.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/DynArr256.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/DynArr256.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/KeyTable2Ref.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/LinearPool.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/NdbdSuperPool.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/NdbdSuperPool.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/Pool.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/Pool.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/RWPool.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/RWPool.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/Rope.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/SLFifoList.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/WOPool.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/WOPool.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/bench_pool.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/kernel/vm/ndbd_malloc_impl.hpp:
  Changed header to GPL version 2 only
storage/ndb/src/mgmsrv/ParamInfo.cpp:
  Changed header to GPL version 2 only
storage/ndb/src/ndbapi/NdbIndexStat.cpp:
  Changed header to GPL version 2 only
storage/ndb/test/ndbapi/testIndexStat.cpp:
  Changed header to GPL version 2 only
storage/ndb/test/tools/listen.cpp:
  Changed header to GPL version 2 only
storage/ndb/tools/restore/ndb_nodegroup_map.h:
  Changed header to GPL version 2 only
strings/my_strchr.c:
  Changed header to GPL version 2 only
unittest/mysys/base64-t.c:
  Changed header to GPL version 2 only
unittest/mysys/bitmap-t.c:
  Changed header to GPL version 2 only
unittest/mysys/my_atomic-t.c:
  Changed header to GPL version 2 only
unittest/mytap/tap.c:
  Changed header to GPL version 2 only
unittest/mytap/tap.h:
  Changed header to GPL version 2 only
win/Makefile.am:
  Changed header to GPL version 2 only
2006-12-27 02:23:51 +01:00
unknown
788ad30f08 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.


client/mysqldump.c:
  Fixed some compiler warnings
  Added some missing DBUG_RETURN
  Remove copying of 'cluster' database
client/mysqlslap.c:
  Fixed compiler warnings
client/mysqltest.c:
  After merge fix
extra/yassl/taocrypt/include/algebra.hpp:
  Removed compiler warning
mysql-test/include/im_check_env.inc:
  Fixed race condition (mysqld1 could report 'starting' or 'online'
mysql-test/mysql-test-run.pl:
  After merge fixes
  Added missing directory to LD_LIBRARY_PATH
mysql-test/r/ctype_cp1250_ch.result:
  After merge fix
mysql-test/r/im_cmd_line.result:
  Fixed race condition
mysql-test/r/im_daemon_life_cycle.result:
  Fixed race condition
mysql-test/r/im_instance_conf.result:
  Fixed race condition
mysql-test/r/im_life_cycle.result:
  Fixed race condition
mysql-test/r/im_utils.result:
  Fixed race condition
mysql-test/r/log_tables.result:
  Fixed wrong result
mysql-test/t/disabled.def:
  Disabled ndb_restore_partion, as ndb_restore_compate caused it to fail, becasue of table 'cluster/def/schema' which is stored in ndb_backup50
mysys/my_compress.c:
  Removed compiler warnings
mysys/my_getopt.c:
  Ensure we always have at least one space between option name and value
plugin/fulltext/plugin_example.c:
  Removed compiler warnings
server-tools/instance-manager/mysql_connection.cc:
  After merge fix
sql/event_data_objects.cc:
  Fixed compiler warnings
  Fixed platform compatibility issues (%lld is not portable)
sql/event_data_objects.h:
  Fixed compiler warnings
sql/event_db_repository.cc:
  Fixed compiler warnings
sql/event_queue.cc:
  Fixed compiler warnings
sql/event_scheduler.cc:
  Fixed compiler warnings
sql/events.cc:
  Fixed compiler warnings
sql/field.cc:
  Fixed compiler warnings
sql/ha_ndbcluster.cc:
  Fixed compiler warnings
sql/ha_ndbcluster_binlog.cc:
  Fixed compiler warnings
sql/ha_partition.cc:
  Fixed compiler warnings
sql/handler.cc:
  Fixed compiler warnings
sql/item_cmpfunc.cc:
  Fixed DBUG_PRINT style
sql/item_func.cc:
  Fixed compiler warnings
sql/log.cc:
  Fixed compiler warnings
sql/log_event.cc:
  Fixed compiler warnings
sql/mysqld.cc:
  Fixed compiler warnings
sql/opt_range.cc:
  Fixed compiler warnings
sql/repl_failsafe.cc:
  Indentation fixes
sql/rpl_rli.cc:
  Fixed compiler warnings
sql/rpl_tblmap.cc:
  Fixed compiler warnings
sql/set_var.cc:
  Fixed compiler warnings
sql/slave.cc:
  Fixed compiler warnings
sql/sp_head.cc:
  Fixed compiler warnings
sql/sql_base.cc:
  Fixed compiler warnings
  Fixed indentation
sql/sql_binlog.cc:
  Fixed compiler warnings
sql/sql_cache.cc:
  Fixed compiler warnings
sql/sql_class.cc:
  Fixed compiler warnings
sql/sql_handler.cc:
  Fixed compiler warnings
sql/sql_lex.cc:
  Fixed compiler warnings
sql/sql_parse.cc:
  Fixed compiler warnings
sql/sql_partition.cc:
  Fixed compiler warnings
sql/sql_prepare.cc:
  Fixed compiler warnings
sql/sql_table.cc:
  Fixed compiler warnings
sql/sql_test.cc:
  Fixed DBUG_PRINT style
sql/sql_trigger.cc:
  Fixed DBUG_PRINT style
sql/table.cc:
  Fixed compiler warnings
storage/federated/ha_federated.cc:
  Fixed compiler warnings
storage/myisam/mi_rsamepos.c:
  Fixed compiler warnings
storage/ndb/include/ndb_global.h.in:
  After merge fix
storage/ndb/include/util/NdbOut.hpp:
  Inform gcc that ndbout_c takes a printf() string as argument
storage/ndb/include/util/SimpleProperties.hpp:
  After merge fixes
storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Fixed compiler warnings
  Fixed usage of uninitialized value (Got help from Jonas with patch)
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/lgman.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/pgman.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/restore.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/suma/Suma.cpp:
  Fixed compiler warnings
  Added missing enum's to switch
storage/ndb/src/kernel/vm/Configuration.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/DLHashTable.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/RWPool.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/SimulatedBlock.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/WOPool.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp:
  Fixed compiler warnings
storage/ndb/src/mgmclient/CommandInterpreter.cpp:
  Fixed compiler warnings
storage/ndb/src/mgmsrv/MgmtSrvr.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/DictCache.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbIndexOperation.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbIndexStat.cpp:
  Initialize possible uninitialized variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbRecAttr.cpp:
  Added missing enum's (To avoid compiler warnings)
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/ObjectMap.hpp:
  Fixed compiler warnings
storage/ndb/tools/desc.cpp:
  Fixed compiler warnings
storage/ndb/tools/restore/Restore.cpp:
  Fixed compiler warnings
storage/ndb/tools/restore/consumer_restore.cpp:
  Fixed compiler warnings
unittest/mytap/t/basic-t.c:
  Fixed compiler warnings
unittest/mytap/tap.c:
  Fixed compiler warnings
2006-11-27 01:47:38 +02:00
unknown
04a5f335d3 WL#3337 (Event scheduler new architecture)
Remove SHOW SCHEDULER STATUS command and migrate the
information output to `mysqladmin debug` (COM_DEBUG)

SHOW SCHEDULER STATUS was introduced in 5.1.11, provided
some debug information about event scheduler internals and
was enabled only in debug builds.


sql/event_queue.cc:
  Remove SHOW SCHEDULER STATUS. Reporting still will be
  there but through COM_DEBUG (mysqladmin debug)
sql/event_queue.h:
  dump_internal_status cannot return an error, therefore it
  should be void.
sql/event_scheduler.cc:
  Remove SHOW SCHEDULER STATUS. Reporting still will be
  there but through COM_DEBUG (mysqladmin debug)
sql/event_scheduler.h:
  dump_internal_status cannot return an error, therefore it
  should be void.
sql/events.cc:
  Change from outputting the internal data from
  the wire to the standard output. SHOW SCHEDULER STATUS was
  removed.
sql/events.h:
  dump_internal_status() cannot return an error, therefore
  it should be void
sql/lex.h:
  remove SCHEDULER as recognized word. This is part
  of removing SHOW SCHEDULER STATUS
sql/sp_head.cc:
  SQLCOM_SHOW_SCHEDULER_STATUS has been removed
sql/sql_lex.h:
  SQLCOM_SHOW_SCHEDULER_STATUS has been removed
sql/sql_parse.cc:
  SQLCOM_SHOW_SCHEDULER_STATUS has been removed
sql/sql_test.cc:
  Dump Events' internal information on COM_DEBUG
sql/sql_yacc.yy:
  SQLCOM_SHOW_SCHEDULER_STATUS has been removed
2006-09-12 12:26:12 +02:00
unknown
e22b6703f8 remove unused artifacts
sql/event_db_repository.cc:
  remove unused variables - reported by MS compiler
sql/event_queue.cc:
  remove unused variables - reported by MS compiler
sql/event_scheduler.cc:
  remove unused label
sql/events.cc:
  remove unused variable and a label - reported by MS compiler
2006-09-01 14:25:29 +02:00
unknown
c67c49fca5 post-merge fix
sql/event_scheduler.cc:
  fix typo
sql/events.cc:
  This check is not needed since UNINITIALIZED state was introduced
  in the Event_scheduler
2006-09-01 14:08:50 +02:00
unknown
33b8dbc756 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-wl3337
into  example.com:/work/mysql-5.1-runtime-wl3337


sql/events.cc:
  Auto merged
2006-09-01 13:11:24 +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
bbd8f9aca5 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-wl3337
into  fifo.vaih.whnetz:/work/mysql-5.1-wl3337-tree2


sql/events.cc:
  Auto merged
2006-08-31 17:20:16 +02:00
unknown
0410cc3a0c WL#3337 (Event scheduler new architecture)
This patch makes the relationship between Event_scheduler and Event_queue
unidirectional from the former to the latter.




The change is that the conditional on which the scheduler sleeped has been
moved to the Event_queue and the latter does not call anymore
Event_scheduler::queue_changed(), which in turn has be removed.


sql/event_queue.cc:
  Remove dependency of Event_queue on Event_scheduler but not vice versa.
  Event_scheduler polls whether there is time to execute an event.
  
  Removed notify_observers() as the way of calling has changed.
  Added Event_queue::cond_wait() similar to Event_scheduler::cond_wait().
sql/event_queue.h:
  init_queue() does not need anymore Event_scheduler object because
  the relationship is now one-way. Event_scheduler knows about Event_queue
  but not vice versa.
  
  get_top_execution_if_time() does by itself the waiting instead of
  returning abstime. This simplifies the code in Event_scheduler::run()
  get_top_execution_if_time() returns only if job_data != NULL or if
  the scheduler thread was killed.
  
  notify_observers() is no more used and therefore removed.
  
  Added Event_queue::cond_wait() because now there is waiting on a
  conditional variable in Event_queue too (like in Event_scheduler for
  ::stop()).
sql/event_scheduler.cc:
  Change the relationship between Event_scheduler & Event_queue.
  Event_queue does not know anymore about Event_scheduler. When
  the scheduler calls get_top_element_if_time() it may fall asleep
  on a conditional of Event_queue, if either the queue is empty or
  it's still not time for activation. When the method returns it
  will return a non-null address, namely an object to be executed.
  If the return value is NULL, the thread was killed by a call to
  Event_scheduler::stop() (we assert this).
sql/event_scheduler.h:
  Remove queue_changed() as it is obsoleted by making the relationship
  between Event_scheduler and Event_queue one-way, from the former to the
  latter. Event_queue now does not know about Event_scheduler.
  
  get_state() is changed to is_running(). The state enum should be private,
  as it is not needed to be seen from outside anymore.
sql/events.cc:
  Event_queue does not need anymore a pointer to Event_scheduler.
2006-08-31 17:18:39 +02:00
unknown
f18ec676a0 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


sql/event_data_objects.cc:
  Events::drop_event() does not expect anymore a parameter named affected_rows
sql/event_db_repository.cc:
  Remove rows_affected as the behavior exposed by Events is not
  coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc.
sql/event_db_repository.h:
  Remove rows_affected as the behavior exposed by Events is not
  coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc.
sql/events.cc:
  Remove rows_affected as the behavior exposed by Events is not
  coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc.
sql/events.h:
  Remove rows_affected as the behavior exposed by Events is not
  coherent with the behavior of many other DDL, like CREATE PROCEDURE, etc.
sql/sql_parse.cc:
  Don't send affected rows, because this behavior is not consistent
  with the rest of the server for CREATE/ALTER/DROP DDLs
2006-08-28 10:27:42 +02:00
unknown
99adbd131a WL#3337 (Event scheduler new architecture)
Post-review fixes. Mostly whitespace, int-to-bool return value, fixed comments


sql/Makefile.am:
  compile all submodules of Events before compiling the facade
sql/event_data_objects.cc:
  - Use initialization list
  - Clean whitespaces
  - Shorten comments
  - Fix comments
sql/event_data_objects.h:
  - Fix whitespace
sql/event_db_repository.cc:
  - Change return type from int to bool where only one error code is
    returned.
  - Don't use macros but get the maximal number of characters in a column
    from the column
  - Fix  comments
  - Make functions which has return value but it's not used - void.
sql/event_db_repository.h:
  - Methods with only one error code int -> bool return value
  - Remove declaration of fill_schema_events, a function that does not exist
sql/event_queue.cc:
  - Use initialization lists
  - Let find_n_remove_event delete the object thus making the code more robust.
    The caller could forget to destruct the object. In addition, find_n_remove_element()
    does not return a value.
  - Move check_system_tables() to class Events
  - Fix comments
sql/event_queue.h:
  - Whitespace changes
  - init_queue() should allow passing of THD
  - check_system_tables moved to class Events
  - find_n_remove_event() is now void
sql/event_scheduler.cc:
  - Initialize res before use
  - Remove end stop from message
sql/event_scheduler.h:
  Add uninitialized state. The scheduler is in it before init_scheduler()
  is called. The rationale is that otherwise state has no value before
  the call. If the system tables were damaged the scheduler won't be initialized
  but in Events::deinit() Event_scheduler::stop() will be called and this will
  touch state, generating valgrind warning at minimum.
sql/events.cc:
  - Whitespace changes
  - Fix comments
  - Make methods which have only one error code be bool instead of int
  - Create temporarily a THD to be used for the initialization of Event_queue
  - Event_queue::check_system_tables() moved to Events::check_system_tables
  - is_started() is renamed to is_execution_of_events_started()
sql/events.h:
  - Whitespace changes
  - When a method returns only one error code it should be bool, not int
  - is_started() renamed to is_execution_of_events_started()
sql/set_var.cc:
  is_started() is renamed to is_execution_of_events_started()
sql/sql_db.cc:
  The return code is not used, thus don't return anything and drop_schema_events()
  is now void.
sql/sql_yacc.yy:
  - Fix comments
  - Remove unneeded initialization which is performed in lex_init()
sql/share/errmsg.txt:
  New error message
sql/table.cc:
  - Fix comments
  - make table_check_intact() accespt const *table_def
sql/table.h:
  Make table_check_intact() accespt const *table_def
2006-08-17 14:22:59 +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
31caa8c433 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.


sql/event_data_objects.cc:
  Remove Event_job_data::free_sp(), move the code to the destructor
  Change the way we change the security context
  Steal some code from sql_parse.cc
sql/event_data_objects.h:
  Remove free_sp()
  Make compile() public, to be used when booting for verifying the integrity of mysql.event
sql/event_queue.cc:
  Make the queue load events from disk on server boot.
  Compile and thus check for integrity the events.
sql/event_queue.h:
  shift methods around. add queue_loaded boolean.
sql/event_scheduler.cc:
  Rename init_event_thread() to pre_init_event_thread()
  and make it more generic.
  Add post_init_event_thread()
  Export these two as well as deinit_event_thread().
  Now it is quite easy to write code to spawn a new event thread
  whenever needed.
sql/event_scheduler.h:
  export pre_init_event_thread(), post_init_event_thread() and deinit_event_thread()
  to simplify writing of thread functions.
sql/events.cc:
  Events::init() returns only one error code, then make it bool
sql/events.h:
  Events::init() returns only one error code, then make it bool
sql/mysqld.cc:
  Check the return code of Events::init()
sql/sp_head.cc:
  Add trace info
sql/sql_class.cc:
  Reorganize thd::change_security_context() to load main_security_ctx
sql/sql_class.h:
  Reorganize thd::change_security_context() to load main_security_ctx
sql/sql_lex.cc:
  Initialize lex->spname
sql/sql_yacc.yy:
  Add a comment
2006-07-13 10:59:58 +02:00
unknown
628be8a716 WL#3337 (Event scheduler new architecture)
event_scheduler_ng.cc/h is no more


BitKeeper/deleted/.del-event_scheduler_ng.cc~8896b89040dbc4f6:
  Delete: sql/event_scheduler_ng.cc
BitKeeper/deleted/.del-event_scheduler_ng.h~1431af5b185376f:
  Delete: sql/event_scheduler_ng.h
mysql-test/r/not_embedded_server.result:
  fix test
sql/Makefile.am:
  event_scheduler_ng.cc/h is no more
sql/event_queue.cc:
  event_scheduler_ng.cc/h is no more
sql/event_queue.h:
  event_scheduler_ng.cc/h is no more
sql/event_scheduler.cc:
  event_scheduler_ng.cc/h is no more
sql/event_scheduler.h:
  event_scheduler_ng.cc/h is no more
sql/events.cc:
  event_scheduler_ng.cc/h is no more
sql/events.h:
  event_scheduler_ng.cc/h is no more
2006-07-12 10:37:30 +02:00
unknown
42a8e2c942 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.


mysql-test/r/events.result:
  update result
mysql-test/r/events_logs_tests.result:
  update result
mysql-test/t/events.test:
  more test coverage
mysql-test/t/events_logs_tests.test:
  fix test
sql/event_data_objects.cc:
  Cosmetics.
  Fix function documentation whenever needed.
  Move Event_job_data::compile() next to Event_job_data::execute()
sql/event_data_objects.h:
  Remove unneeded error codes and defines
  Move function declarations at the end of the header
sql/event_db_repository.cc:
  Fix function documentation.
  Event_db_repository::update_event() now uses LEX_STRING *-s instead of
  sp_name . Lower coupling.
sql/event_db_repository.h:
  Event_db_repository::update_event() now uses LEX_STRING *-s instead of
  sp_name . Lower coupling.
  find_event -> find_named_event
  find_event_by_name is not used externally, merge with load_named_event()
sql/event_queue.cc:
  LEX_STRING* to LEX_STRING
  Fix comments.
  Fix and add function documentation.
  Remove Event_queue::events_count() as it is unused
  Change get_top_for_execution_if_time() to return status code as return value
  and the object is in out parameter.
sql/event_queue.h:
  LEX_STRING* to LEX_STRING
  Fix comments.
  Fix and add function documentation.
  Remove Event_queue::events_count() as it is unused
  Change get_top_for_execution_if_time() to return status code as return value
  and the object is in out parameter.
  Try to detect also lock attemptions for deadlocks.
sql/event_scheduler_ng.cc:
  Always execute on thd->mem_root
  Fix according to changed API of Event_queue::get_top_for_execution_if_time()
sql/events.cc:
  Fix function documentation.
  Fix code after API changes of internal Event module classes.
sql/events.h:
  sp_name -> LEX_STRINGs
sql/sql_parse.cc:
  Fix according to changed API of Events::show_create_event()
sql/sql_yacc.yy:
  Don't pass NULL as third parameter to sp_head::init_strings()
2006-07-11 18:28:15 +02:00
unknown
084f74426b Remove trailing whitespace.
After merge fixes.


sql/event_data_objects.cc:
  after merge fix. use thd->strmake instead of strmake_root
  Remove commented out code.
  Remove trailing whitespace.
sql/event_db_repository.cc:
  After merge fix.
  Before closing thread tables check whether table is actuall non-NULL.
  And always initialize it to NULL.
sql/event_queue.cc:
  Remove trailing whitespace.
sql/event_scheduler_ng.cc:
  Remove trailing whitespace.
  Tabs to spaces.
sql/events.cc:
  Remove trailing whitespace.
2006-07-10 23:54:46 +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
b9a7fe2757 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.


sql/event_data_objects.cc:
  Strip unneeded stuff from class Event_timed
  Event_timed is still used for the queue and execution.
  That will be changed in the next commit.
sql/event_data_objects.h:
  Strip unneeded stuff from class Event_timed
  Event_timed is still used for the queue and execution.
  That will be changed in the next commit.
sql/event_db_repository.cc:
  Cosmetics.
  Add a new method load_named_event_job, to be made complete in the 
  next commit. It will load from disk an instance of Event_job_data to
  be used during execution.
sql/event_db_repository.h:
  find_event does not need MEM_ROOT anymore
  because the memory is allocated on Event's own root.
sql/event_queue.cc:
  Remove dead code.
  Move dumping of the queue to separate method.
  Make critical sections in create_event & update_event
  as small as possible - load the new event outside of the section
  and free the object also outside of it.
sql/event_queue.h:
  init -> init_queue -> easier for ctags
  deinit -> deinit_queue -> easier for ctags
sql/event_scheduler.cc:
  empty this file
sql/event_scheduler.h:
  empty this file
sql/event_scheduler_ng.cc:
  add back DBUG_RETURN(0) in thread handlers.
  We don't stop running events when stopping the scheduler. Therefore
  remove this method now. If it is needed later it can be added back.
sql/event_scheduler_ng.h:
  Remove stop_all_running_threads()
  init -> init_scheduler
  deinit -> deinit_scheduler
  easier for ctags
sql/events.cc:
  Cosmetics
sql/events.h:
  Cosmetics
sql/set_var.cc:
  Remove references to dead code
sql/sql_parse.cc:
  Reorganize a bit.
2006-07-05 17:12:50 +02:00
unknown
a5dfeb02e9 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.


mysql-test/r/events.result:
  update result
mysql-test/r/events_bugs.result:
  update result
mysql-test/r/ps_1general.result:
  update result
mysql-test/r/skip_name_resolve.result:
  update result
mysql-test/r/sp-threads.result:
  update result
mysql-test/r/sp_notembedded.result:
  update result
mysql-test/r/status.result:
  update result
mysql-test/t/events_stress.test:
  Make event_stress a bit longer
sql/Makefile.am:
  Add new event_scheduler_ng.h/cc . These are only to be in the experimental
  clone. Later their content will be moved to event_scheduler.h/cc
sql/event_data_objects.cc:
  Allocate strings memory on own memory root, instead
  on the schedulers. Thus don't "leak" memory. This should
  fix bug#18683 memory leak in event scheduler
sql/event_data_objects.h:
  add mem_root
  add THD - this is only temporal, will be moved to class Event_job_data
  once Event_job_data is responsible for the execution.
sql/event_db_repository.cc:
  Remove unused code.
  Cosmetic changes
sql/event_queue.cc:
  Now use the Event_scheduler_ng (NextGen)
sql/event_queue.h:
  Now use the Event_scheduler_ng (NextGen)
sql/event_scheduler.cc:
  This file is no more used, but will be soon.
sql/event_scheduler.h:
  This file is no more used but will be soon
sql/events.cc:
  Now use the Event_scheduler_ng (NextGen)
sql/events.h:
  Now use the Event_scheduler_ng (NextGen)
sql/mysqld.cc:
  Make it again possible to kill the scheduler thread
sql/set_var.cc:
  Now use the Event_scheduler_ng (NextGen)
sql/share/errmsg.txt:
  Shorten the message.
sql/sql_show.cc:
  Loading is on a own root, then don't use thd->mem_root
2006-07-04 18:44:35 +02:00
unknown
377446fa34 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.


sql/event_data_objects.cc:
  add comments
sql/event_db_repository.cc:
  coding style
sql/event_db_repository.h:
  add a call, will be implemented later
sql/event_queue.cc:
  Event_queue, still as super-class of Event_scheduler
sql/event_queue.h:
  Event_queue as super-class of Event_scheduler. Trying to
  separate the two classes
sql/event_scheduler.cc:
  Event_scheduler as child class of Event_queue.
  Trying to separate both classes.
sql/event_scheduler.h:
  Event_scheduler as child class of Event_queue.
  Trying to separate both classes.
sql/events.cc:
  Don't allocate on the stack the scheduler but on the heap.
  The exact way it is done will be changed, that's ok for now.
2006-07-03 11:20:08 +02:00
unknown
9fa9378b2e 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.


mysql-test/r/events.result:
  update result
mysql-test/t/events.test:
  disabled is actually wrong, should be disable, but because of the early
  checking it was never parsed.
sql/event_data_objects.cc:
  move add init_xxx methods from Event_timed to Event_parse_data
  Event_parse data does not need definer_user and definer_host
  in Event_timed::compile() do not use lex.et, well there is no more lex.et :)
sql/event_data_objects.h:
  move parsing responsibilities from Event_timed to Event_parse_data
sql/event_db_repository.cc:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/event_db_repository.h:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/event_scheduler.cc:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/event_scheduler.h:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/events.cc:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/events.h:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/sql_lex.cc:
  lex->et_compile_phase and lex->et are no more.
  Use lex->event_parse_data
sql/sql_lex.h:
  lex->et_compile_phase and lex->et are no more.
  Use lex->event_parse_data
sql/sql_parse.cc:
  lex->et_compile_phase and lex->et are no more.
  Use lex->event_parse_data
  ACL checks were moved inside the Events subsystem.
  Also ending of the transaction is performed only just
  before doing disk operation. Therefore only when needed.
sql/sql_yacc.yy:
  lex->et and lex->et_parse_phase are no more
  Use the specialized for parsing Event_parse_data
2006-06-29 00:42:25 +02:00
unknown
739ea377bd after merge fix 2006-06-28 16:02:20 +02:00
unknown
98211beaee Merge
sql/CMakeLists.txt:
  Auto merged
sql/events.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/sql_show.cc:
  SCCS merged
2006-06-28 15:54:09 +02:00
unknown
400276c2f5 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


sql/event_data_objects.cc:
  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
sql/event_db_repository.cc:
  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
sql/events.cc:
  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
sql/events.h:
  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
sql/mysqld.cc:
  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
unknown
8ca78787a5 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.


sql/event_db_repository.cc:
  move code that works with mysql.event from sql_show.cc to 
  event_db_repository.cc . Route through Event_db_repository's interface
  which is proxied by class Events. The code relies on a function from
  sql_show.cc which does the actual storage in the schema table. I think
  it's better to leave the function there because the structure of 
  I_S.EVENTS is defined in sql_show.cc
sql/event_db_repository.h:
  I_S / SHOW EVENTS handling hooks
sql/event_scheduler.cc:
  use the pointer to db_repository which Event_scheduler already has
sql/events.cc:
  Put a comment to get_instance
sql/events.h:
  callback for I_S (sql_show.cc)
sql/sql_show.cc:
  move code that belongs more to Event_db_repository than to here.
  Use a callback of class Events. Only 1 function is left here, because
  it copies data into the actual rows of I_S.EVENTS and belongs to this file.
sql/sql_show.h:
  export this function will be called from event_db_repository.cc
2006-06-28 14:22:14 +02:00
unknown
acefb78bc3 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.


BitKeeper/deleted/.del-events_priv.h~2e8bce2cf35997df:
  Delete: sql/events_priv.h
sql/Makefile.am:
  events_priv.h is no more
sql/event_data_objects.cc:
  reorganize events code
sql/event_data_objects.h:
  reorganize events code
sql/event_db_repository.cc:
  reorganize events code
sql/event_db_repository.h:
  reorganize events code
sql/event_scheduler.cc:
  reorganize events code
sql/event_scheduler.h:
  reorganize events code
sql/events.cc:
  reorganize events code
sql/events.h:
  reorganize events code
sql/mysqld.cc:
  reorganize events code
sql/set_var.cc:
  reorganize events code
sql/sql_class.cc:
  add ::change_security_context() and restore_security_context()
sql/sql_class.h:
  add ::change_security_context() and restore_security_context()
sql/sql_db.cc:
  reorganize Events code
sql/sql_parse.cc:
  reorganize Events code
sql/sql_show.cc:
  reorganize Events code
2006-06-28 01:28:03 +02:00
unknown
ef9a97e685 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.


sql/event_data_objects.cc:
  overload few functions
sql/event_scheduler.cc:
  Event_scheduler::drop_event() actually does not need Event_timed object
  but just an identifier, hence pass only sp_name.
  
  Overloaded Event_scheduler::find_event() to work with sp_name object. Eventually
  the old version will be removed. This is being done as transitional step to
  be able to test frequently code.
sql/event_scheduler.h:
  Event_scheduler::drop_event() actually does not need Event_timed object
  but just an identifier, hence pass only sp_name.
  
  Overloaded Event_scheduler::find_event() to work with sp_name object. Eventually
  the old version will be removed. This is being done as transitional step to
  be able to test frequently code.
sql/events.cc:
  Change db_drop_event() not to use Event_timed, either coming from parsing
  or from Event_timed::drop, but use LEX_STRINGs. sp_name is not convinient
  because in Event_timed::drop a temporary object has to be created. Hence, 
  dereference the sp_name in Events::drop_event() and pass the LEX_STRINGs.
sql/events.h:
  Change db_drop_event() not to use Event_timed, either coming from parsing
  or from Event_timed::drop, but use LEX_STRINGs. sp_name is not convinient
  because in Event_timed::drop a temporary object has to be created. Hence, 
  dereference the sp_name in Events::drop_event() and pass the LEX_STRINGs.
sql/events_priv.h:
  Change db_drop_event() not to use Event_timed, either coming from parsing
  or from Event_timed::drop, but use LEX_STRINGs. sp_name is not convinient
  because in Event_timed::drop a temporary object has to be created. Hence, 
  dereference the sp_name in Events::drop_event() and pass the LEX_STRINGs.
sql/sql_parse.cc:
  SQLCOM_DROP_EVENT does not need lex->event_parse_data object and 
  is more like SQLCOM_SHOW_CREATE_EVENT. Therefore, move it to the block that
  handles the latter.
sql/sql_yacc.yy:
  DROP EVENT does not need a parsing object, just a name.
  Store it as lex->spname. Pretty similar handling to the one of
  SHOW CREATE EVENT.
2006-06-27 11:51:11 +02:00
unknown
d2db48c69b 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.


sql/event_data_objects.cc:
  second cut,
  copy Event_timed::init_body() to Event_parse_data::init_body()
  Init the body during parsing, everything else keep as a pointer to
  Item or some other pointer to use for later initialization.
sql/event_data_objects.h:
  get the identifier as sp_name*, later will initialize our structures
sql/events.cc:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
sql/events.h:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
BitKeeper/etc/ignore:
  Added libmysql/viosocket.o.6WmSJk libmysqld/event_data_objects.cc libmysqld/event_db_repository.cc libmysqld/event_queue.cc server-tools/instance-manager/net_serv.cc to the ignore list
sql/share/errmsg.txt:
  remove this message, not used and needed for now
sql/sql_lex.h:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
sql/sql_parse.cc:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
sql/sql_yacc.yy:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
2006-06-27 10:53:26 +02:00
unknown
e5f8163b88 first cut of WL#3337 (New event scheduler locking infrastructure).
Infrastructure built. Added the  foreseen files and change Makefile.am/CMakeLists.txt
accordingly.


libmysqld/Makefile.am:
  add new files. this is first cut of WL3337u
sql/CMakeLists.txt:
  add more files to build
sql/Makefile.am:
  add new files. this is first cut of WL3337
sql/event_scheduler.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/events.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/share/errmsg.txt:
  new error message
sql/event_data_objects.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/event_data_objects.h:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/sql_parse.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/sql_show.cc:
  event_timed.h -> event_data_objects.h (WL#3337)
sql/sql_yacc.yy:
  event_timed.h -> event_data_objects.h (WL#3337)
2006-06-27 08:48:50 +02:00
unknown
fee803af17 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/opt/local/work/mysql-5.1-runtime


mysql-test/r/information_schema.result:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/events.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/t/events_microsec.test:
  SCCS merged
2006-06-26 18:45:46 +04:00
unknown
d898972dc0 manual merge
BitKeeper/etc/ignore:
  auto-union
libmysqld/Makefile.am:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/events.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/time.cc:
  Auto merged
2006-06-20 17:14:36 +02:00
unknown
99438424ac Reorganize, physically the events code
Unify method naming -> create/update/drop_event
Move class Event_timed to event_timed.h
class Events is in events.h (renamed from event.h)
The implementation is in events.cc (renamed from event.h)


BitKeeper/deleted/.del-event_executor.cc~f4a4645b973838ab:
  Delete: sql/event_executor.cc
include/my_time.h:
  add a boundary
libmysqld/CMakeLists.txt:
  event.cc -> events.cc
libmysqld/Makefile.am:
  event.cc -> event.cc
sql/CMakeLists.txt:
  event.cc -> events.cc
sql/Makefile.am:
  event.cc -> events.cc
  event_priv.h -> events_priv.h
sql/event_scheduler.cc:
  event.h -> events.h
  add_event -> create_event
  replace_event -> update_event()
  event_timed_compare_q is only used in event_scheduler.cc , so moving it
  from event.cc and making it static
sql/event_scheduler.h:
  add_event -> create_event
  replace_event -> update_event
sql/event_timed.cc:
  moved extern interval_type_to_name to mysql_priv.h
sql/mysql_priv.h:
  moved my_time_compare to time.cc
sql/mysqld.cc:
  event.h -> events.h
sql/sql_db.cc:
  event.h -> events.h
sql/sql_parse.cc:
  event.h -> events.h
  class Event_timed moved to event_timed.h
sql/sql_show.cc:
  event.h -> events.h
  class Event_timed moved to event_timed.h
sql/sql_yacc.yy:
  event.h -> events.h
  class Event_timed moved to event_timed.h
sql/events.cc:
  add_event -> create_event
  replace_event -> update_event
  event_timed_compare_q moved to event_scheduler.cc
sql/events.h:
  class Event_timed moved to event_timed.h
sql/events_priv.h:
  my_time_compare moved to mysql_priv.h
  event_timed_compare_q is static in event_scheduler.cc
sql/time.cc:
  moved interval_type_to_name from event.cc to here.
BitKeeper/etc/ignore:
  Added libmysqld/events.cc to the ignore list
2006-06-08 23:07:11 +02:00
Renamed from sql/event.cc (Browse further)