2006-03-28 18:05:25 +02:00
|
|
|
SET(CMAKE_CXX_FLAGS_DEBUG
|
|
|
|
"${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
|
|
|
SET(CMAKE_C_FLAGS_DEBUG
|
|
|
|
"${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
|
2006-01-31 14:52:16 +01:00
|
|
|
|
2006-02-08 18:18:17 +01:00
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
|
|
|
${CMAKE_SOURCE_DIR}/extra/yassl/include
|
|
|
|
${CMAKE_SOURCE_DIR}/sql
|
|
|
|
${CMAKE_SOURCE_DIR}/regex
|
2006-03-23 16:34:52 +01:00
|
|
|
${CMAKE_SOURCE_DIR}/zlib
|
2006-08-14 23:45:48 +02:00
|
|
|
)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
|
|
|
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
|
|
|
|
${CMAKE_SOURCE_DIR}/sql/message.h
|
|
|
|
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
|
|
|
|
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
|
|
|
|
${CMAKE_SOURCE_DIR}/include/mysql_version.h
|
2006-04-20 19:37:37 +02:00
|
|
|
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
|
2006-02-07 16:43:42 +01:00
|
|
|
${CMAKE_SOURCE_DIR}/sql/lex_hash.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
|
2006-03-28 18:05:25 +02:00
|
|
|
${PROJECT_SOURCE_DIR}/include/sql_state.h
|
|
|
|
PROPERTIES GENERATED 1)
|
2006-03-27 23:19:56 +02:00
|
|
|
|
2006-03-28 18:05:25 +02:00
|
|
|
ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
|
|
|
|
-D_CONSOLE -DHAVE_DLOPEN)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
2006-03-28 18:05:25 +02:00
|
|
|
ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
|
|
|
|
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
|
2006-08-19 19:23:22 +02:00
|
|
|
filesort.cc gstream.cc ha_myisam.cc
|
2006-08-19 06:19:19 +02:00
|
|
|
ha_innodb.cc ha_partition.cc
|
2006-04-20 19:37:37 +02:00
|
|
|
handler.cc hash_filo.cc hash_filo.h
|
2006-03-28 18:05:25 +02:00
|
|
|
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
|
|
|
|
item_create.cc item_func.cc item_geofunc.cc item_row.cc
|
|
|
|
item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc
|
|
|
|
item_uniq.cc key.cc log.cc lock.cc log_event.cc message.rc
|
|
|
|
message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c
|
2006-08-19 19:23:22 +02:00
|
|
|
mysqld.cc net_serv.cc
|
2006-03-28 18:05:25 +02:00
|
|
|
nt_servc.cc nt_servc.h opt_range.cc opt_range.h opt_sum.cc
|
|
|
|
../sql-common/pack.c parse_file.cc password.c procedure.cc
|
|
|
|
protocol.cc records.cc repl_failsafe.cc rpl_filter.cc set_var.cc
|
|
|
|
slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc
|
|
|
|
sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc
|
|
|
|
sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h
|
|
|
|
sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc sql_do.cc
|
|
|
|
sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc sql_lex.cc
|
|
|
|
sql_list.cc sql_load.cc sql_manager.cc sql_map.cc sql_parse.cc
|
|
|
|
sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc
|
|
|
|
sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc
|
|
|
|
sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
|
|
|
|
sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc
|
|
|
|
time.cc tztime.cc uniques.cc unireg.cc item_xmlfunc.cc
|
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
|
|
|
rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_timed.cc
|
2006-06-08 23:07:11 +02:00
|
|
|
sql_tablespace.cc events.cc ../sql-common/my_user.c
|
2006-07-28 14:37:16 +02:00
|
|
|
partition_info.cc rpl_injector.cc sql_locale.cc
|
2006-03-28 18:05:25 +02:00
|
|
|
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
|
|
|
|
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/sql_state.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/mysql_version.h
|
2006-04-20 19:37:37 +02:00
|
|
|
${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
|
2006-03-28 18:05:25 +02:00
|
|
|
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
|
|
|
|
TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl
|
|
|
|
taocrypt strings vio regex wsock32)
|
2006-03-28 13:49:29 +02:00
|
|
|
IF(WITH_ARCHIVE_STORAGE_ENGINE)
|
|
|
|
TARGET_LINK_LIBRARIES(mysqld archive)
|
|
|
|
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
|
2006-04-20 19:37:37 +02:00
|
|
|
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
|
|
|
TARGET_LINK_LIBRARIES(mysqld blackhole)
|
|
|
|
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
|
|
|
IF(WITH_CSV_STORAGE_ENGINE)
|
|
|
|
TARGET_LINK_LIBRARIES(mysqld csv)
|
|
|
|
ENDIF(WITH_CSV_STORAGE_ENGINE)
|
2006-03-28 13:49:29 +02:00
|
|
|
IF(WITH_EXAMPLE_STORAGE_ENGINE)
|
|
|
|
TARGET_LINK_LIBRARIES(mysqld example)
|
|
|
|
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
|
|
|
|
IF(WITH_INNOBASE_STORAGE_ENGINE)
|
|
|
|
TARGET_LINK_LIBRARIES(mysqld innobase)
|
|
|
|
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
|
|
|
|
|
2006-03-16 15:42:48 +01:00
|
|
|
ADD_DEPENDENCIES(mysqld GenError)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
|
|
|
# Sql Parser custom command
|
|
|
|
ADD_CUSTOM_COMMAND(
|
2006-02-07 16:43:42 +01:00
|
|
|
SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
|
|
|
|
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
|
2006-03-28 18:05:25 +02:00
|
|
|
COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
|
|
|
|
--output=sql_yacc.cc sql_yacc.yy
|
2006-02-07 16:43:42 +01:00
|
|
|
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(
|
2006-02-07 16:43:42 +01:00
|
|
|
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
|
2006-01-31 14:52:16 +01:00
|
|
|
COMMAND echo
|
2006-02-07 16:43:42 +01:00
|
|
|
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
|
2006-01-31 14:52:16 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# Windows message file
|
|
|
|
ADD_CUSTOM_COMMAND(
|
2006-03-24 22:50:56 +01:00
|
|
|
SOURCE message.mc
|
2006-01-31 14:52:16 +01:00
|
|
|
OUTPUT message.rc message.h
|
2006-03-24 22:50:56 +01:00
|
|
|
COMMAND mc ARGS message.mc
|
|
|
|
DEPENDS message.mc)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
|
|
|
# Gen_lex_hash
|
|
|
|
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
|
|
|
|
TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32)
|
|
|
|
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
|
|
|
|
ADD_CUSTOM_COMMAND(
|
2006-02-07 16:43:42 +01:00
|
|
|
OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
|
2006-01-31 14:52:16 +01:00
|
|
|
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
|
|
|
|
DEPENDS ${GEN_LEX_HASH_EXE}
|
|
|
|
)
|
2006-02-07 16:43:42 +01:00
|
|
|
|
|
|
|
ADD_DEPENDENCIES(mysqld gen_lex_hash)
|