Commit c15a2647 authored by iggy@alf's avatar iggy@alf

Embedded Server doesn't build on Windows.

- Add build configuration parameter EMBEDDED_ONLY which will configure 
the VS solution to produce only mysql embedded binary.
- Make necessary updates to successfully compile solution.
parent 65e47d59
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
*/.pure */.pure
*/debug/* */debug/*
*/release/* */release/*
*/relwithdebinfo/*
*/minsizerel/*
*~ *~
.*.swp .*.swp
./CMakeCache.txt ./CMakeCache.txt
...@@ -1020,6 +1022,7 @@ libmysqld/backup_dir ...@@ -1020,6 +1022,7 @@ libmysqld/backup_dir
libmysqld/client.c libmysqld/client.c
libmysqld/client_settings.h libmysqld/client_settings.h
libmysqld/convert.cc libmysqld/convert.cc
libmysqld/cmake_dummy.c
libmysqld/derror.cc libmysqld/derror.cc
libmysqld/discover.cc libmysqld/discover.cc
libmysqld/emb_qcache.cpp libmysqld/emb_qcache.cpp
......
...@@ -18,50 +18,64 @@ PROJECT(MySql) ...@@ -18,50 +18,64 @@ PROJECT(MySql)
# This reads user configuration, generated by configure.js. # This reads user configuration, generated by configure.js.
INCLUDE(win/configure.data) INCLUDE(win/configure.data)
# Hardcode support for CSV storage engine # By default, CMake will create Release, Debug, RelWithDebInfo and MinSizeRel
SET(WITH_CSV_STORAGE_ENGINE TRUE) # configurations. The EMBEDDED_ONLY build parameter is necessary because CMake
# doesn't support custom build configurations for VS2005. Since the Debug
# configuration does not work properly with USE_TLS defined
# (see mysys/CMakeLists.txt) the easiest way to debug the Embedded Server is to
# use the RelWithDebInfo configuration without optimizations.
#
# Debug default CXX_FLAGS "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1"
# RelWithDebInfo default CXX_FLAGS "/MD /Zi /O2 /Ob1 /D NDEBUG"
#
IF(NOT EMBEDDED_ONLY)
# Hardcode support for CSV storage engine
SET(WITH_CSV_STORAGE_ENGINE TRUE)
ELSE(NOT EMBEDDED_ONLY)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /Od /Ob0 /D NDEBUG" CACHE STRING "No Optimization" FORCE)
ENDIF(NOT EMBEDDED_ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY) ${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
SET(WITH_HEAP_STORAGE_ENGINE TRUE) SET(WITH_HEAP_STORAGE_ENGINE TRUE)
ADD_DEFINITIONS(-D WITH_HEAP_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_HEAP_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_heap_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_heap_plugin")
SET(WITH_MYISAM_STORAGE_ENGINE TRUE) SET(WITH_MYISAM_STORAGE_ENGINE TRUE)
ADD_DEFINITIONS(-D WITH_MYISAM_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_MYISAM_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin")
SET(WITH_MYISAMMRG_STORAGE_ENGINE TRUE) SET(WITH_MYISAMMRG_STORAGE_ENGINE TRUE)
ADD_DEFINITIONS(-D WITH_MYISAMMRG_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_MYISAMMRG_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisammrg_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisammrg_plugin")
IF(WITH_ARCHIVE_STORAGE_ENGINE) IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_ARCHIVE_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_ARCHIVE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_archive_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_archive_plugin")
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE) IF(WITH_BLACKHOLE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_BLACKHOLE_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_BLACKHOLE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_blackhole_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_blackhole_plugin")
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE) ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE) IF(WITH_CSV_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_CSV_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_CSV_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_csv_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_csv_plugin")
ENDIF(WITH_CSV_STORAGE_ENGINE) ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE) IF(WITH_EXAMPLE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_EXAMPLE_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_EXAMPLE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_example_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_example_plugin")
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_INNOBASE_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_innobase_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_innobase_plugin")
ENDIF(WITH_INNOBASE_STORAGE_ENGINE) ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
IF(WITH_PARTITION_STORAGE_ENGINE) IF(WITH_PARTITION_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_PARTITION_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_PARTITION_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
ENDIF(WITH_PARTITION_STORAGE_ENGINE) ENDIF(WITH_PARTITION_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE) IF(WITH_FEDERATED_STORAGE_ENGINE)
ADD_DEFINITIONS(-D WITH_FEDERATED_STORAGE_ENGINE) ADD_DEFINITIONS(-DWITH_FEDERATED_STORAGE_ENGINE)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin") SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin")
ENDIF(WITH_FEDERATED_STORAGE_ENGINE) ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
...@@ -81,15 +95,15 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh ...@@ -81,15 +95,15 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh
${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY) ${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY)
IF(__NT__) IF(__NT__)
ADD_DEFINITIONS(-D __NT__) ADD_DEFINITIONS(-D__NT__)
ENDIF(__NT__) ENDIF(__NT__)
IF(CYBOZU) IF(CYBOZU)
ADD_DEFINITIONS(-D CYBOZU) ADD_DEFINITIONS(-DCYBOZU)
ENDIF(CYBOZU) ENDIF(CYBOZU)
# in some places we use DBUG_OFF # in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -D DBUG_OFF") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D DBUG_OFF") SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
...@@ -132,7 +146,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR ...@@ -132,7 +146,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
CMAKE_GENERATOR MATCHES "Visual Studio 8") CMAKE_GENERATOR MATCHES "Visual Studio 8")
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D _CRT_SECURE_NO_DEPRECATE") ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
IF(EMBED_MANIFESTS) IF(EMBED_MANIFESTS)
# Search for the Manifest tool. CMake will first search it's defaults # Search for the Manifest tool. CMake will first search it's defaults
...@@ -179,7 +193,7 @@ ADD_SUBDIRECTORY(extra) ...@@ -179,7 +193,7 @@ ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(storage/heap) ADD_SUBDIRECTORY(storage/heap)
ADD_SUBDIRECTORY(storage/myisam) ADD_SUBDIRECTORY(storage/myisam)
ADD_SUBDIRECTORY(storage/myisammrg) ADD_SUBDIRECTORY(storage/myisammrg)
ADD_SUBDIRECTORY(client)
IF(WITH_ARCHIVE_STORAGE_ENGINE) IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/archive) ADD_SUBDIRECTORY(storage/archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
...@@ -198,11 +212,16 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE) ...@@ -198,11 +212,16 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/innobase) ADD_SUBDIRECTORY(storage/innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE) ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(sql) # CMAKE will not allow custom VS7+ configurations. mysqld and libmysqld
ADD_SUBDIRECTORY(server-tools/instance-manager) # cannot be built at the same time as they require different configurations
ADD_SUBDIRECTORY(libmysql) IF(EMBEDDED_ONLY)
ADD_SUBDIRECTORY(tests) ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
ADD_SUBDIRECTORY(libmysqld)
# disable libmysqld until it's fixed, so we can use Cmake 2.2 and 2.4 ADD_SUBDIRECTORY(libmysqld/examples)
#ADD_SUBDIRECTORY(libmysqld) ELSE(EMBEDDED_ONLY)
#ADD_SUBDIRECTORY(libmysqld/examples) ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(server-tools/instance-manager)
ADD_SUBDIRECTORY(libmysql)
ADD_SUBDIRECTORY(tests)
ENDIF(EMBEDDED_ONLY)
...@@ -42,7 +42,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); ...@@ -42,7 +42,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
void mysql_read_default_options(struct st_mysql_options *options, void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group); const char *filename,const char *group);
void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name); void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name);
MYSQL * MYSQL * STDCALL
cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db, const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag); uint port, const char *unix_socket,ulong client_flag);
......
...@@ -18,7 +18,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ...@@ -18,7 +18,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Need to set USE_TLS, since __declspec(thread) approach to thread local # Need to set USE_TLS, since __declspec(thread) approach to thread local
# storage does not work properly in DLLs. # storage does not work properly in DLLs.
ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER -DEMBEDDED_LIBRARY) ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER)
# The old Windows build method used renamed (.cc -> .cpp) source files, fails # The old Windows build method used renamed (.cc -> .cpp) source files, fails
# in #include in lib_sql.cc. So disable that using the USING_CMAKE define. # in #include in lib_sql.cc. So disable that using the USING_CMAKE define.
...@@ -38,47 +38,51 @@ SET_SOURCE_FILES_PROPERTIES(${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc ...@@ -38,47 +38,51 @@ SET_SOURCE_FILES_PROPERTIES(${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
PROPERTIES GENERATED 1) PROPERTIES GENERATED 1)
ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
../client/get_password.c ../libmysql/errmsg.c ../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
../libmysql/libmysql.c ../sql/password.c ../sql-common/client.c ../sql-common/client.c ../sql-common/my_time.c
../sql-common/my_time.c ../sql-common/my_user.c ../sql-common/my_user.c ../sql-common/pack.c
../sql-common/pack.c ../sql/derror.cc ../sql/event_scheduler.cc ../sql/password.c ../sql/discover.cc ../sql/derror.cc
../sql/event_timed.cc ../sql/events.cc ../sql/discover.cc ../sql/event_scheduler.cc ../sql/events.cc
../sql/field_conv.cc ../sql/field.cc ../sql/filesort.cc ../sql/event_data_objects.cc ../sql/event_queue.cc
../sql/gstream.cc ${mysql_se_ha_src} ../sql/event_db_repository.cc ../sql/field.cc ../sql/field_conv.cc
../sql/handler.cc ../sql/hash_filo.cc ../sql/filesort.cc ../sql/gstream.cc ../sql/ha_partition.cc
../sql/hostname.cc ../sql/init.cc ../sql/item_buff.cc ../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc
../sql/item_cmpfunc.cc ../sql/item.cc ../sql/item_create.cc ../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc
../sql/item_func.cc ../sql/item_geofunc.cc ../sql/item_row.cc ../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc
../sql/item_strfunc.cc ../sql/item_subselect.cc ../sql/item_sum.cc ../sql/item_geofunc.cc ../sql/item_row.cc ../sql/item_strfunc.cc
../sql/item_timefunc.cc ../sql/item_uniq.cc ../sql/item_xmlfunc.cc ../sql/item_subselect.cc ../sql/item_sum.cc ../sql/item_timefunc.cc
../sql/key.cc ../sql/lock.cc ../sql/log.cc ../sql/log_event.cc ../sql/item_xmlfunc.cc ../sql/key.cc ../sql/lock.cc ../sql/log.cc
../sql/mf_iocache.cc ../sql/my_decimal.cc ../sql/net_serv.cc ../sql/log_event.cc ../sql/mf_iocache.cc ../sql/my_decimal.cc
../sql/opt_range.cc ../sql/opt_sum.cc ../sql/parse_file.cc ../sql/net_serv.cc ../sql/opt_range.cc ../sql/opt_sum.cc
../sql/procedure.cc ../sql/protocol.cc ../sql/records.cc ../sql/parse_file.cc ../sql/procedure.cc ../sql/protocol.cc
../sql/repl_failsafe.cc ../sql/rpl_filter.cc ../sql/set_var.cc ../sql/records.cc ../sql/repl_failsafe.cc ../sql/rpl_filter.cc
../sql/spatial.cc ../sql/sp_cache.cc ../sql/sp.cc ../sql/rpl_record.cc
../sql/sp_head.cc ../sql/sp_pcontext.cc ../sql/sp_rcontext.cc ../sql/rpl_injector.cc ../sql/set_var.cc ../sql/spatial.cc
../sql/sql_acl.cc ../sql/sql_analyse.cc ../sql/sql_base.cc ../sql/sp_cache.cc ../sql/sp.cc ../sql/sp_head.cc
../sql/sql_cache.cc ../sql/sql_class.cc ../sql/sql_crypt.cc ../sql/sp_pcontext.cc ../sql/sp_rcontext.cc ../sql/sql_acl.cc
../sql/sql_cursor.cc ../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_analyse.cc ../sql/sql_base.cc ../sql/sql_cache.cc
../sql/sql_derived.cc ../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_class.cc ../sql/sql_crypt.cc ../sql/sql_cursor.cc
../sql/sql_handler.cc ../sql/sql_help.cc ../sql/sql_insert.cc ../sql/sql_db.cc ../sql/sql_delete.cc ../sql/sql_derived.cc
../sql/sql_lex.cc ../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_do.cc ../sql/sql_error.cc ../sql/sql_handler.cc
../sql/sql_manager.cc ../sql/sql_map.cc ../sql/sql_parse.cc ../sql/sql_help.cc ../sql/sql_insert.cc ../sql/sql_lex.cc
../sql/sql_partition.cc ../sql/sql_plugin.cc ../sql/sql_prepare.cc ../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc
../sql/sql_rename.cc ../sql/sql_repl.cc ../sql/sql_select.cc ../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc ../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc ../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc ../sql/sql_select.cc ../sql/sql_servers.cc ../sql/sql_builtin.cc
../sql/sql_update.cc ../sql/sql_view.cc ../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc ../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
../sql/partition_info.cc ../sql/sql_locale.cc ../sql/sql_update.cc ../sql/sql_view.cc
../sql/sql_connect.cc ../sql/scheduler.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
../vio/viosslfactories.c ../sql/partition_info.cc ../sql/sql_locale.cc ../sql/sql_connect.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc ../sql/scheduler.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h) ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c
../vio/viosslfactories.c
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h)
ADD_DEPENDENCIES(mysqldemb GenError)
# Seems we cannot make a library without at least one source file. So use a # Seems we cannot make a library without at least one source file. So use a
# dummy empty file # dummy empty file
...@@ -86,14 +90,20 @@ FILE(WRITE cmake_dummy.c " ") ...@@ -86,14 +90,20 @@ FILE(WRITE cmake_dummy.c " ")
ADD_LIBRARY(mysqlserver cmake_dummy.c) ADD_LIBRARY(mysqlserver cmake_dummy.c)
TARGET_LINK_LIBRARIES(mysqlserver wsock32) TARGET_LINK_LIBRARIES(mysqlserver wsock32)
ADD_DEPENDENCIES(mysqlserver dbug mysys strings zlib mysqldemb regex myisam myisammrg ADD_DEPENDENCIES(mysqlserver mysqldemb heap myisam myisammrg dbug mysys zlib strings mysqldemb regex
heap yassl taocrypt) yassl taocrypt vio)
IF(WITH_ARCHIVE_STORAGE_ENGINE) IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver archive) ADD_DEPENDENCIES(mysqlserver archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE) ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE) IF(WITH_EXAMPLE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver example) ADD_DEPENDENCIES(mysqlserver example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqlserver blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqlserver csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE) IF(WITH_FEDERATED_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver federated) ADD_DEPENDENCIES(mysqlserver federated)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE) ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
...@@ -104,3 +114,9 @@ ENDIF(WITH_INNOBASE_STORAGE_ENGINE) ...@@ -104,3 +114,9 @@ ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def) ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def)
TARGET_LINK_LIBRARIES(libmysqld wsock32) TARGET_LINK_LIBRARIES(libmysqld wsock32)
ADD_DEPENDENCIES(libmysqld mysqlserver) ADD_DEPENDENCIES(libmysqld mysqlserver)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_DEPENDENCIES(libmysqld archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
...@@ -15,12 +15,24 @@ ...@@ -15,12 +15,24 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include ${CMAKE_SOURCE_DIR}/libmysqld/include
${CMAKE_SOURCE_DIR}/libmysqld/release
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/yassl/include) ${CMAKE_SOURCE_DIR}/extra/yassl/include)
# Currently does not work with DBUG, there are missing symbols reported. # Currently does not work with DBUG, there are missing symbols reported.
ADD_DEFINITIONS(-DDBUG_OFF) ADD_DEFINITIONS(-DDBUG_OFF)
ADD_DEFINITIONS(-DUSE_TLS)
ADD_EXECUTABLE(test_libmysqld ../../client/completion_hash.cc ADD_EXECUTABLE(test_libmysqld ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc ../../client/mysql.cc ../../client/readline.cc
../../client/sql_string.cc) ../../client/sql_string.cc)
TARGET_LINK_LIBRARIES(test_libmysqld yassl taocrypt zlib wsock32) TARGET_LINK_LIBRARIES(test_libmysqld mysys yassl taocrypt zlib dbug regex strings wsock32)
ADD_DEPENDENCIES(test_libmysqld libmysqld) ADD_DEPENDENCIES(test_libmysqld libmysqld)
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib dbug regex strings wsock32)
ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
TARGET_LINK_LIBRARIES(mysql_client_test_embedded dbug mysys yassl taocrypt zlib strings wsock32)
ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)
...@@ -41,7 +41,9 @@ EXPORTS ...@@ -41,7 +41,9 @@ EXPORTS
mysql_commit mysql_commit
mysql_data_seek mysql_data_seek
mysql_debug mysql_debug
mysql_disable_rpl_parse
mysql_dump_debug_info mysql_dump_debug_info
mysql_enable_rpl_parse
mysql_eof mysql_eof
mysql_errno mysql_errno
mysql_error mysql_error
...@@ -55,6 +57,7 @@ EXPORTS ...@@ -55,6 +57,7 @@ EXPORTS
mysql_field_seek mysql_field_seek
mysql_field_tell mysql_field_tell
mysql_free_result mysql_free_result
mysql_get_character_set_info
mysql_get_client_info mysql_get_client_info
mysql_get_host_info mysql_get_host_info
mysql_get_proto_info mysql_get_proto_info
...@@ -84,6 +87,8 @@ EXPORTS ...@@ -84,6 +87,8 @@ EXPORTS
mysql_rollback mysql_rollback
mysql_row_seek mysql_row_seek
mysql_row_tell mysql_row_tell
mysql_rpl_parse_enabled
mysql_rpl_probe
mysql_select_db mysql_select_db
mysql_send_query mysql_send_query
mysql_shutdown mysql_shutdown
...@@ -109,6 +114,7 @@ EXPORTS ...@@ -109,6 +114,7 @@ EXPORTS
get_tty_password get_tty_password
sql_protocol_typelib sql_protocol_typelib
mysql_get_server_version mysql_get_server_version
mysql_set_character_set
mysql_sqlstate mysql_sqlstate
charsets_dir charsets_dir
disabled_my_option disabled_my_option
...@@ -133,6 +139,8 @@ EXPORTS ...@@ -133,6 +139,8 @@ EXPORTS
my_read my_read
llstr llstr
mysql_get_parameters mysql_get_parameters
mysql_thread_init
mysql_thread_end
mysql_stmt_bind_param mysql_stmt_bind_param
mysql_stmt_bind_result mysql_stmt_bind_result
mysql_stmt_execute mysql_stmt_execute
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#define MYSQL_CLIENT #define MYSQL_CLIENT
#endif #endif
#define CLI_MYSQL_REAL_CONNECT cli_mysql_real_connect #define CLI_MYSQL_REAL_CONNECT STDCALL cli_mysql_real_connect
#undef net_flush #undef net_flush
my_bool net_flush(NET *net); my_bool net_flush(NET *net);
......
...@@ -1883,9 +1883,11 @@ static void init_signals(void) ...@@ -1883,9 +1883,11 @@ static void init_signals(void)
static void start_signal_handler(void) static void start_signal_handler(void)
{ {
#ifndef EMBEDDED_LIBRARY
// Save vm id of this process // Save vm id of this process
if (!opt_bootstrap) if (!opt_bootstrap)
create_pid_file(); create_pid_file();
#endif /* EMBEDDED_LIBRARY */
} }
......
...@@ -172,6 +172,7 @@ void mysql_client_binlog_statement(THD* thd) ...@@ -172,6 +172,7 @@ void mysql_client_binlog_statement(THD* thd)
not used at all: the rli_fake instance is used only for error not used at all: the rli_fake instance is used only for error
reporting. reporting.
*/ */
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
if (IF_DBUG(int err= ) ev->apply_event(thd->rli_fake)) if (IF_DBUG(int err= ) ev->apply_event(thd->rli_fake))
{ {
DBUG_PRINT("info", ("apply_event() returned: %d", err)); DBUG_PRINT("info", ("apply_event() returned: %d", err));
...@@ -182,6 +183,7 @@ void mysql_client_binlog_statement(THD* thd) ...@@ -182,6 +183,7 @@ void mysql_client_binlog_statement(THD* thd)
my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG statement"); my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG statement");
goto end; goto end;
} }
#endif
delete ev; delete ev;
ev= 0; ev= 0;
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex ${CMAKE_SOURCE_DIR}/regex
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB) ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB)
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
include include
......
...@@ -16,6 +16,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") ...@@ -16,6 +16,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
......
...@@ -1437,8 +1437,10 @@ int ha_myisam::enable_indexes(uint mode) ...@@ -1437,8 +1437,10 @@ int ha_myisam::enable_indexes(uint mode)
might have been set by the first repair. They can still be seen might have been set by the first repair. They can still be seen
with SHOW WARNINGS then. with SHOW WARNINGS then.
*/ */
#ifndef EMBEDDED_LIBRARY
if (! error) if (! error)
thd->clear_error(); thd->clear_error();
#endif /* EMBEDDED_LIBRARY */
} }
info(HA_STATUS_CONST); info(HA_STATUS_CONST);
thd->proc_info=save_proc_info; thd->proc_info=save_proc_info;
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
......
...@@ -47,6 +47,7 @@ try ...@@ -47,6 +47,7 @@ try
case "__NT__": case "__NT__":
case "CYBOZU": case "CYBOZU":
case "EMBED_MANIFESTS": case "EMBED_MANIFESTS":
case "EMBEDDED_ONLY":
configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
break; break;
case "MYSQL_SERVER_SUFFIX": case "MYSQL_SERVER_SUFFIX":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment