summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2009-08-11 18:05:25 +0500
committerSergey Vojtovich <svoj@sun.com>2009-08-11 18:05:25 +0500
commit24e418df6937109bd8167561f46822f02942e375 (patch)
tree51c420178316e108b0380d5666aadf5881384c5a /sql
parentc1433ba201f6532aeb36b6ac2cf6718f2665aaa3 (diff)
parent94efc1c6b084ed531b513e70fb66e7b7a1186b56 (diff)
downloadmariadb-git-24e418df6937109bd8167561f46822f02942e375.tar.gz
Merge mysql-5.1-innodb_plugin to mysql-5.1.
Diffstat (limited to 'sql')
-rwxr-xr-xsql/CMakeLists.txt80
-rw-r--r--sql/handler.h4
-rw-r--r--sql/mysql_priv.h56
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/sql_list.h2
-rw-r--r--sql/sql_profile.h23
8 files changed, 88 insertions, 87 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index cfd049e1864..6f162f4d84d 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -39,7 +39,8 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN -DHAVE_EVENT_SCHEDULER)
-ADD_EXECUTABLE(mysqld
+
+SET (SQL_SOURCE
../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc
@@ -82,54 +83,45 @@ ADD_EXECUTABLE(mysqld
${PROJECT_SOURCE_DIR}/include/mysql_version.h
${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
+ADD_LIBRARY(sql ${SQL_SOURCE})
-TARGET_LINK_LIBRARIES(mysqld
- heap myisam myisammrg mysys yassl zlib debug dbug yassl
- taocrypt strings vio regex wsock32 ws2_32)
+IF (NOT EXISTS cmake_dummy.cc)
+ FILE (WRITE cmake_dummy.cc "")
+ENDIF (NOT EXISTS cmake_dummy.cc)
+ADD_EXECUTABLE(mysqld cmake_dummy.cc)
SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX})
+SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
+
+SET (MYSQLD_CORE_LIBS mysys zlib dbug strings yassl taocrypt vio regex sql)
+TARGET_LINK_LIBRARIES(mysqld ${MYSQLD_CORE_LIBS} ${MYSQLD_STATIC_ENGINE_LIBS})
+TARGET_LINK_LIBRARIES(mysqld ws2_32.lib)
+
-IF(cmake_version EQUAL 20406)
-# Work around for 2.4.6 bug, OUTPUT_NAME will not set the right .PDB
-# file name. Note that COMPILE_FLAGS set some temporary pdb during build,
-# LINK_FLAGS sets the real one.
-SET_TARGET_PROPERTIES(mysqld PROPERTIES
- COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb"
- LINK_FLAGS "/PDB:${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb")
-ENDIF(cmake_version EQUAL 20406)
-
-IF(EMBED_MANIFESTS)
- MYSQL_EMBED_MANIFEST("mysqld" "asInvoker")
-ENDIF(EMBED_MANIFESTS)
-IF(WITH_ARCHIVE_STORAGE_ENGINE)
- TARGET_LINK_LIBRARIES(mysqld archive)
-ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
-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)
-IF(WITH_EXAMPLE_STORAGE_ENGINE)
- TARGET_LINK_LIBRARIES(mysqld example)
-ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
-IF(WITH_FEDERATED_STORAGE_ENGINE)
- TARGET_LINK_LIBRARIES(mysqld federated)
-ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
-IF(WITH_INNOBASE_STORAGE_ENGINE)
- TARGET_LINK_LIBRARIES(mysqld innobase)
-ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
-
-ADD_DEPENDENCIES(mysqld GenError)
-
-# NOTE CMake 2.4.6 creates strange dependencies between files in OUTPUT,
-# so for now we only list one if more than one
+IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
+ # Set module definition file. Also use non-incremental linker,
+ # incremental appears to crash from time to time,if used with /DEF option
+ SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "/DEF:mysqld.def /INCREMENTAL:NO")
+
+ FOREACH (CORELIB ${MYSQLD_CORE_LIBS})
+ GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
+ FILE(TO_NATIVE_PATH ${LOC} LOC)
+ SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC})
+ ENDFOREACH (CORELIB ${MYSQLD_CORE_LIBS})
+
+ ADD_CUSTOM_COMMAND(TARGET mysqld PRE_LINK
+ COMMAND cscript ARGS //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
+ ${PLATFORM} ${LIB_LOCATIONS} > mysqld.def
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/sql)
+ENDIF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
+
+ADD_DEPENDENCIES(sql GenError)
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
-# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
- COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
+ ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
+ COMMAND bison ARGS -y -p MYSQL --defines=sql_yacc.h
--output=sql_yacc.cc sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
@@ -146,16 +138,16 @@ ADD_CUSTOM_COMMAND(
ADD_CUSTOM_TARGET(
GenServerSource ALL
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
-# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
+ ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/message.h
-# ${PROJECT_SOURCE_DIR}/sql/message.rc
+ ${PROJECT_SOURCE_DIR}/sql/message.rc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
ADD_DEPENDENCIES(mysqld GenServerSource)
# Remove the auto-generated files as part of 'Clean Solution'
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
- "lex_hash.h;sql_yacc.h;sql_yacc.cc")
+ "lex_hash.h;sql_yacc.h;sql_yacc.cc;mysqld.def")
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
ADD_DEPENDENCIES(udf_example strings GenError)
diff --git a/sql/handler.h b/sql/handler.h
index 01f673ecd51..5d27d3eff6d 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1937,8 +1937,8 @@ private:
/* Some extern variables used with handlers */
extern const char *ha_row_type[];
-extern const char *tx_isolation_names[];
-extern const char *binlog_format_names[];
+extern MYSQL_PLUGIN_IMPORT const char *tx_isolation_names[];
+extern MYSQL_PLUGIN_IMPORT const char *binlog_format_names[];
extern TYPELIB tx_isolation_typelib;
extern TYPELIB myisam_stats_method_typelib;
extern ulong total_ha, total_ha_2pc;
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 03c366a45bf..2347612f850 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -82,9 +82,9 @@ extern query_id_t global_query_id;
inline query_id_t next_query_id() { return global_query_id++; }
/* useful constants */
-extern const key_map key_map_empty;
-extern key_map key_map_full; /* Should be threaded as const */
-extern const char *primary_key_name;
+extern MYSQL_PLUGIN_IMPORT const key_map key_map_empty;
+extern MYSQL_PLUGIN_IMPORT key_map key_map_full; /* Should be threaded as const */
+extern MYSQL_PLUGIN_IMPORT const char *primary_key_name;
#include "mysql_com.h"
#include <violite.h>
@@ -123,8 +123,10 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
"in MySQL %s. Please use %s instead.", (Old), (Ver), (New)); \
} while(0)
-extern CHARSET_INFO *system_charset_info, *files_charset_info ;
-extern CHARSET_INFO *national_charset_info, *table_alias_charset;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset;
enum Derivation
@@ -690,14 +692,19 @@ typedef struct st_sql_list {
}
} SQL_LIST;
-
+#if defined(MYSQL_DYNAMIC_PLUGIN) && defined(_WIN32)
+extern "C" THD *_current_thd_noinline();
+#define _current_thd() _current_thd_noinline()
+#else
extern pthread_key(THD*, THR_THD);
inline THD *_current_thd(void)
{
return my_pthread_getspecific_ptr(THD*,THR_THD);
}
+#endif
#define current_thd _current_thd()
+
/**
The meat of thd_proc_info(THD*, char*), a macro that packs the last
three calling-info parameters.
@@ -1882,8 +1889,12 @@ extern time_t server_start_time, flush_status_time;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern uint mysql_data_home_len;
-extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
- mysql_real_data_home[], mysql_unpacked_real_data_home[];
+
+extern MYSQL_PLUGIN_IMPORT char *mysql_data_home;
+extern char server_version[SERVER_VERSION_LENGTH];
+extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[];
+extern char mysql_unpacked_real_data_home[];
+
extern CHARSET_INFO *character_set_filesystem;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
@@ -1891,10 +1902,13 @@ extern char *opt_mysql_tmpdir, mysql_charsets_dir[],
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
extern int mysql_unpacked_real_data_home_len;
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
-extern MY_TMPDIR mysql_tmpdir_list;
+extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
extern const LEX_STRING command_name[];
-extern const char *first_keyword, *my_localhost, *delayed_user, *binary_keyword;
-extern const char **errmesg; /* Error messages */
+
+extern const char *first_keyword, *delayed_user, *binary_keyword;
+extern MYSQL_PLUGIN_IMPORT const char *my_localhost;
+extern MYSQL_PLUGIN_IMPORT const char **errmesg; /* Error messages */
+
extern const char *myisam_recover_options_str;
extern const char *in_left_expr_name, *in_additional_cond, *in_having_cond;
extern const char * const TRG_EXT;
@@ -1908,8 +1922,8 @@ extern Le_creator le_creator;
extern char language[FN_REFLEN];
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
-extern char reg_ext[FN_EXTLEN];
-extern uint reg_ext_length;
+extern MYSQL_PLUGIN_IMPORT char reg_ext[FN_EXTLEN];
+extern MYSQL_PLUGIN_IMPORT uint reg_ext_length;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
@@ -1929,7 +1943,8 @@ extern ulong slave_open_temp_tables;
extern ulong query_cache_size, query_cache_min_res_unit;
extern ulong slow_launch_threads, slow_launch_time;
extern ulong table_cache_size, table_def_size;
-extern ulong max_connections,max_connect_errors, connect_timeout;
+extern MYSQL_PLUGIN_IMPORT ulong max_connections;
+extern ulong max_connect_errors, connect_timeout;
extern ulong slave_net_timeout, slave_trans_retries;
extern uint max_user_connections;
extern ulong what_to_log,flush_time;
@@ -1943,7 +1958,7 @@ extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size;
extern ulong back_log;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
-extern ulong specialflag;
+extern ulong MYSQL_PLUGIN_IMPORT specialflag;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
extern ulong current_pid;
@@ -1956,7 +1971,7 @@ extern uint protocol_version, mysqld_port, dropping_tables;
extern uint delay_key_write_options;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
-extern uint lower_case_table_names;
+extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
extern bool opt_endinfo, using_udf_functions;
@@ -1964,7 +1979,7 @@ extern my_bool locked_in_memory;
extern bool opt_using_transactions;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
-extern bool mysqld_embedded;
+extern MYSQL_PLUGIN_IMPORT bool mysqld_embedded;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
extern bool opt_large_files, server_id_supplied;
@@ -2003,7 +2018,7 @@ extern uint opt_large_page_size;
extern char *opt_logname, *opt_slow_logname;
extern const char *log_output_str;
-extern MYSQL_BIN_LOG mysql_bin_log;
+extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log;
extern LOGGER logger;
extern TABLE_LIST general_log, slow_log;
extern FILE *bootstrap_file;
@@ -2011,13 +2026,14 @@ extern int bootstrap_error;
extern FILE *stderror_file;
extern pthread_key(MEM_ROOT**,THR_MALLOC);
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
- LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
+ LOCK_mapped_file,LOCK_user_locks, LOCK_status,
LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
LOCK_global_system_variables, LOCK_user_conn,
LOCK_prepared_stmt_count,
LOCK_bytes_sent, LOCK_bytes_received, LOCK_connection_count;
+extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count;
#ifdef HAVE_OPENSSL
extern pthread_mutex_t LOCK_des_key_file;
#endif
@@ -2037,7 +2053,7 @@ extern const String my_null_string;
extern SHOW_VAR status_vars[];
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
-extern struct system_variables global_system_variables;
+extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables;
#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
#ifdef MYSQL_SERVER
extern struct system_variables max_system_variables;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 85139eb8b09..8453f8e28d6 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -6787,7 +6787,7 @@ The minimum value for this variable is 4096.",
(uchar**) &opt_plugin_dir_ptr, (uchar**) &opt_plugin_dir_ptr, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"plugin-load", OPT_PLUGIN_LOAD,
- "Optional colon-separated list of plugins to load, where each plugin is "
+ "Optional semicolon-separated list of plugins to load, where each plugin is "
"identified as name=library, where name is the plugin name and library "
"is the plugin library in plugin_dir.",
(uchar**) &opt_plugin_load, (uchar**) &opt_plugin_load, 0,
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index a9c399e15de..3f568566c89 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -757,6 +757,12 @@ void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
*xid = *(MYSQL_XID *) &thd->transaction.xid_state.xid;
}
+#ifdef _WIN32
+extern "C" THD *_current_thd_noinline(void)
+{
+ return my_pthread_getspecific_ptr(THD*,THR_THD);
+}
+#endif
/*
Init common variables that has to be reset on start and on change_user
*/
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 09841edc480..f52d5fae76f 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -91,7 +91,7 @@ enum enum_mark_columns
extern char internal_table_name[2];
extern char empty_c_string[1];
-extern const char **errmesg;
+extern MYSQL_PLUGIN_IMPORT const char **errmesg;
#define TC_LOG_PAGE_SIZE 8192
#define TC_LOG_MIN_SIZE (3*TC_LOG_PAGE_SIZE)
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 0d267111dad..22df77afeb3 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -86,7 +86,7 @@ struct list_node :public Sql_alloc
};
-extern list_node end_of_list;
+extern MYSQL_PLUGIN_IMPORT list_node end_of_list;
class base_list :public Sql_alloc
{
diff --git a/sql/sql_profile.h b/sql/sql_profile.h
index b5537487d26..245959e0953 100644
--- a/sql/sql_profile.h
+++ b/sql/sql_profile.h
@@ -16,25 +16,12 @@
#ifndef _SQL_PROFILE_H
#define _SQL_PROFILE_H
-#if __STDC_VERSION__ < 199901L
-# if __GNUC__ >= 2
-# define __func__ __FUNCTION__
-# else
-# define __func__ _unknown_func_
-extern const char * const _unknown_func_;
-# endif
-#elif defined(_MSC_VER)
-# if _MSC_VER < 1300
-# define __func__ _unknown_func_
-extern const char * const _unknown_func_;
-# else
-# define __func__ __FUNCTION__
-# endif
-#elif defined(__BORLANDC__)
-# define __func__ __FUNC__
+#ifndef __func__
+#ifdef __FUNCTION__
+#define __func__ __FUNCTION__
#else
-# define __func__ _unknown_func_
-extern const char * const _unknown_func_;
+#define __func__ "unknown function"
+#endif
#endif
extern ST_FIELD_INFO query_profile_statistics_info[];