diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_strfunc.cc | 3 | ||||
-rw-r--r-- | sql/my_json_writer.h | 5 | ||||
-rw-r--r-- | sql/mysql_install_db.cc | 3 | ||||
-rw-r--r-- | sql/mysql_upgrade_service.cc | 6 | ||||
-rw-r--r-- | sql/mysqld.cc | 13 | ||||
-rw-r--r-- | sql/nt_servc.cc | 9 | ||||
-rw-r--r-- | sql/nt_servc.h | 6 | ||||
-rw-r--r-- | sql/signal_handler.cc | 2 | ||||
-rw-r--r-- | sql/slave.cc | 2 | ||||
-rw-r--r-- | sql/sql_alloc.h | 6 | ||||
-rw-r--r-- | sql/sql_class.h | 3 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 | ||||
-rw-r--r-- | sql/sql_sequence.cc | 6 | ||||
-rw-r--r-- | sql/sys_vars.cc | 5 | ||||
-rw-r--r-- | sql/sys_vars.ic | 1 | ||||
-rw-r--r-- | sql/threadpool_generic.cc | 8 | ||||
-rw-r--r-- | sql/threadpool_win.cc | 5 | ||||
-rw-r--r-- | sql/udf_example.c | 13 |
18 files changed, 42 insertions, 56 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 90d762c0191..7c32fde72fe 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2189,9 +2189,8 @@ char *Item_func_password::alloc(THD *thd, const char *password, String *Item_func_encrypt::val_str(String *str) { DBUG_ASSERT(fixed == 1); - String *res =args[0]->val_str(str); - #ifdef HAVE_CRYPT + String *res =args[0]->val_str(str); char salt[3],*salt_ptr; if ((null_value=args[0]->null_value)) return 0; diff --git a/sql/my_json_writer.h b/sql/my_json_writer.h index c4b528ae10d..3c127bd178c 100644 --- a/sql/my_json_writer.h +++ b/sql/my_json_writer.h @@ -173,6 +173,10 @@ public: class Json_writer_nesting_guard { +#ifdef DBUG_OFF +public: + Json_writer_nesting_guard(Json_writer *) {} +#else Json_writer* writer; int indent_level; public: @@ -185,6 +189,7 @@ public: { DBUG_ASSERT(indent_level == writer->indent_level); } +#endif }; diff --git a/sql/mysql_install_db.cc b/sql/mysql_install_db.cc index b4af5cc79ed..c76b279048b 100644 --- a/sql/mysql_install_db.cc +++ b/sql/mysql_install_db.cc @@ -442,7 +442,6 @@ static int set_directory_permissions(const char *dir, const char *os_user) ACL* pOldDACL; SECURITY_DESCRIPTOR* pSD= NULL; EXPLICIT_ACCESS ea={0}; - BOOL isWellKnownSID= FALSE; WELL_KNOWN_SID_TYPE wellKnownSidType = WinNullSid; PSID pSid= NULL; @@ -509,7 +508,7 @@ static int set_directory_permissions(const char *dir, const char *os_user) ea.grfInheritance= CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE; ea.Trustee.TrusteeType= TRUSTEE_IS_UNKNOWN; ACL* pNewDACL= 0; - DWORD err= SetEntriesInAcl(1,&ea,pOldDACL,&pNewDACL); + SetEntriesInAcl(1,&ea,pOldDACL,&pNewDACL); if (pNewDACL) { SetSecurityInfo(hDir,SE_FILE_OBJECT,DACL_SECURITY_INFORMATION,NULL, NULL, diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc index 2f242bebb0d..599f4a40ea0 100644 --- a/sql/mysql_upgrade_service.cc +++ b/sql/mysql_upgrade_service.cc @@ -51,7 +51,7 @@ static char *opt_service; static SC_HANDLE service; static SC_HANDLE scm; HANDLE mysqld_process; // mysqld.exe started for upgrade -DWORD initial_service_state= -1; // initial state of the service +DWORD initial_service_state= UINT_MAX; // initial state of the service HANDLE logfile_handle; /* @@ -126,7 +126,7 @@ static void die(const char *fmt, ...) Stop service that we started, if it was not initally running at program start. */ - if (initial_service_state != -1 && initial_service_state != SERVICE_RUNNING) + if (initial_service_state != UINT_MAX && initial_service_state != SERVICE_RUNNING) { SERVICE_STATUS service_status; ControlService(service, SERVICE_CONTROL_STOP, &service_status); @@ -252,7 +252,7 @@ void stop_mysqld_service() Remeber initial state of the service, we will restore it on exit. */ - if(initial_service_state == -1) + if(initial_service_state == UINT_MAX) initial_service_state= ssp.dwCurrentState; switch(ssp.dwCurrentState) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0d225dec151..b21d50a20fe 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2510,10 +2510,9 @@ static void set_user(const char *user, struct passwd *user_info_arg) allow_coredumps(); } - +#if !defined(__WIN__) static void set_effective_user(struct passwd *user_info_arg) { -#if !defined(__WIN__) DBUG_ASSERT(user_info_arg != 0); if (setregid((gid_t)-1, user_info_arg->pw_gid) == -1) { @@ -2526,9 +2525,8 @@ static void set_effective_user(struct passwd *user_info_arg) unireg_abort(1); } allow_coredumps(); -#endif } - +#endif /** Change root user if started with @c --chroot . */ static void set_root(const char *path) @@ -6191,10 +6189,10 @@ int mysqld_main(int argc, char **argv) ****************************************************************************/ #if defined(__WIN__) && !defined(EMBEDDED_LIBRARY) -int mysql_service(void *p) +void mysql_service(void *p) { if (my_thread_init()) - return 1; + abort(); if (use_opt_args) win_main(opt_argc, opt_argv); @@ -6202,7 +6200,6 @@ int mysql_service(void *p) win_main(Service.my_argc, Service.my_argv); my_thread_end(); - return 0; } @@ -6253,7 +6250,7 @@ default_service_handling(char **argv, the option name) should be quoted if it contains a string. */ *pos++= ' '; - if (opt_delim= strchr(extra_opt, '=')) + if ((opt_delim= strchr(extra_opt, '='))) { size_t length= ++opt_delim - extra_opt; pos= strnmov(pos, extra_opt, length); diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc index 654383c3320..9c754763aab 100644 --- a/sql/nt_servc.cc +++ b/sql/nt_servc.cc @@ -73,18 +73,18 @@ NTService::~NTService() */ -long NTService::Init(LPCSTR szInternName,void *ServiceThread) +long NTService::Init(LPCSTR szInternName, THREAD_FC ServiceThread) { pService = this; - fpServiceThread = (THREAD_FC)ServiceThread; + fpServiceThread = ServiceThread; ServiceName = new char[lstrlen(szInternName)+1]; lstrcpy(ServiceName,szInternName); SERVICE_TABLE_ENTRY stb[] = { - { (char *)szInternName,(LPSERVICE_MAIN_FUNCTION) ServiceMain} , + { (char *)szInternName, ServiceMain} , { NULL, NULL } }; @@ -219,7 +219,6 @@ void NTService::ServiceMain(DWORD argc, LPTSTR *argv) // registration function if (!(pService->hServiceStatusHandle = RegisterServiceCtrlHandler(pService->ServiceName, - (LPHANDLER_FUNCTION) NTService::ServiceCtrlHandler))) goto error; @@ -280,7 +279,7 @@ void NTService::SetSlowStarting(unsigned long timeout) BOOL NTService::StartService() { // Start the real service's thread (application) - if (!(hThreadHandle = (HANDLE) _beginthread((THREAD_FC)fpServiceThread,0, + if (!(hThreadHandle = (HANDLE) _beginthread(fpServiceThread,0, (void *) this))) return FALSE; bRunning = TRUE; diff --git a/sql/nt_servc.h b/sql/nt_servc.h index c8b64515b31..8ba29519c8f 100644 --- a/sql/nt_servc.h +++ b/sql/nt_servc.h @@ -46,7 +46,7 @@ class NTService DWORD dwState; //init service entry point - long Init(LPCSTR szInternName,void *ServiceThread); + long Init(LPCSTR szInternName,THREAD_FC ServiceThread); //application shutdown event void SetShutdownEvent(HANDLE hEvent){ hShutdownEvent=hEvent; } @@ -99,8 +99,8 @@ class NTService void StopService(); BOOL StartService(); - static void ServiceMain(DWORD argc, LPTSTR *argv); - static void ServiceCtrlHandler (DWORD ctrlCode); + static void WINAPI ServiceMain(DWORD argc, LPTSTR *argv); + static void WINAPI ServiceCtrlHandler (DWORD ctrlCode); void Exit(DWORD error); BOOL SetStatus (DWORD dwCurrentState,DWORD dwWin32ExitCode, diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 0452e181e22..cdda49c5796 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -88,7 +88,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) tm.tm_hour, tm.tm_min, tm.tm_sec); if (opt_expect_abort #ifdef _WIN32 - && sig == EXCEPTION_BREAKPOINT /* __debugbreak in my_sigabrt_hander() */ + && sig == (int)EXCEPTION_BREAKPOINT /* __debugbreak in my_sigabrt_hander() */ #else && sig == SIGABRT #endif diff --git a/sql/slave.cc b/sql/slave.cc index 86c9105e1a6..bf70db66f35 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -7951,7 +7951,7 @@ static bool get_row_event_stmt_end(const char* buf, The term 4 below signifies that master is of 'an intermediate source', see Rows_log_event::Rows_log_event. */ - flag_start += RW_MAPID_OFFSET + (post_header_len == 6) ? 4 : RW_FLAGS_OFFSET; + flag_start += RW_MAPID_OFFSET + ((post_header_len == 6) ? 4 : RW_FLAGS_OFFSET); return (uint2korr(flag_start) & Rows_log_event::STMT_END_F) != 0; } diff --git a/sql/sql_alloc.h b/sql/sql_alloc.h index e7cda5b2abf..c3bee260817 100644 --- a/sql/sql_alloc.h +++ b/sql/sql_alloc.h @@ -27,13 +27,11 @@ class Sql_alloc public: static void *operator new(size_t size) throw () { - DBUG_ASSERT(size < UINT_MAX32); - return thd_alloc(thd_get_current_thd(), uint(size)); + return thd_alloc(thd_get_current_thd(), size); } static void *operator new[](size_t size) throw () { - DBUG_ASSERT(size < UINT_MAX32); - return thd_alloc(thd_get_current_thd(), uint(size)); + return thd_alloc(thd_get_current_thd(), size); } static void *operator new[](size_t size, MEM_ROOT *mem_root) throw () { return alloc_root(mem_root, size); } diff --git a/sql/sql_class.h b/sql/sql_class.h index 4722f3f5989..f026e2243ab 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -5125,7 +5125,6 @@ class select_insert :public select_result_interceptor { class select_create: public select_insert { - ORDER *group; TABLE_LIST *create_table; Table_specification_st *create_info; TABLE_LIST *select_tables; @@ -5806,7 +5805,7 @@ class multi_update :public select_result_interceptor { TABLE_LIST *all_tables; /* query/update command tables */ List<TABLE_LIST> *leaves; /* list of leves of join table tree */ - TABLE_LIST *update_tables, *table_being_updated; + TABLE_LIST *update_tables; TABLE **tmp_tables, *main_table, *table_to_update; TMP_TABLE_PARAM *tmp_table_param; ha_rows updated, found; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index c0ee0057016..ad97e70bdd8 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -142,14 +142,12 @@ class READ_INFO { File file; String data; /* Read buffer */ uint fixed_length; /* Length of the fixed length record */ - uint max_length; /* Max length of row */ Term_string m_field_term; /* FIELDS TERMINATED BY 'string' */ Term_string m_line_term; /* LINES TERMINATED BY 'string' */ Term_string m_line_start; /* LINES STARTING BY 'string' */ int enclosed_char,escape_char; int *stack,*stack_pos; bool found_end_of_line,start_of_line,eof; - NET *io_net; int level; /* for load xml */ bool getbyte(char *to) diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index 0f8f7dbefb7..cc0691f92cf 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -50,12 +50,12 @@ static Field_definition sequence_structure[]= { {"next_not_cached_value", 21, &type_handler_longlong, {STRING_WITH_LEN("")}, FL}, - {"minimum_value", 21, &type_handler_longlong, STRING_WITH_LEN(""), FL}, - {"maximum_value", 21, &type_handler_longlong, STRING_WITH_LEN(""), FL}, + {"minimum_value", 21, &type_handler_longlong, {STRING_WITH_LEN("")}, FL}, + {"maximum_value", 21, &type_handler_longlong, {STRING_WITH_LEN("")}, FL}, {"start_value", 21, &type_handler_longlong, {STRING_WITH_LEN("start value when sequences is created or value if RESTART is used")}, FL}, {"increment", 21, &type_handler_longlong, {STRING_WITH_LEN("increment value")}, FL}, - {"cache_size", 21, &type_handler_longlong, STRING_WITH_LEN(""), + {"cache_size", 21, &type_handler_longlong, {STRING_WITH_LEN("")}, FL | UNSIGNED_FLAG}, {"cycle_option", 1, &type_handler_tiny, {STRING_WITH_LEN("0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed")}, FL | UNSIGNED_FLAG }, diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 291f13d27f8..de9806ab289 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -4642,14 +4642,13 @@ static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type) oldval= logger.get_log_file_handler()->is_open(); log_type= QUERY_LOG_GENERAL; } - else if (self == &Sys_slow_query_log) + else { + DBUG_ASSERT(self == &Sys_slow_query_log); newvalptr= &global_system_variables.sql_log_slow; oldval= logger.get_slow_log_file_handler()->is_open(); log_type= QUERY_LOG_SLOW; } - else - DBUG_ASSERT(FALSE); newval= *newvalptr; if (oldval == newval) diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic index e012cd48ecb..e04e09e9bc6 100644 --- a/sql/sys_vars.ic +++ b/sql/sys_vars.ic @@ -1567,7 +1567,6 @@ public: */ class Sys_var_pluginlist: public sys_var { - int plugin_type; public: Sys_var_pluginlist(const char *name_arg, const char *comment, int flag_args, ptrdiff_t off, size_t size, diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc index 04a72034e5e..a306822b1f1 100644 --- a/sql/threadpool_generic.cc +++ b/sql/threadpool_generic.cc @@ -178,7 +178,7 @@ connection_queue_t; const int NQUEUES=2; /* We have high and low priority queues*/ -struct thread_group_t +struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) thread_group_t { mysql_mutex_t mutex; connection_queue_t queues[NQUEUES]; @@ -196,7 +196,7 @@ struct thread_group_t int shutdown_pipe[2]; bool shutdown; bool stalled; -} MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE); +}; static thread_group_t *all_groups; static uint group_count; @@ -1499,7 +1499,7 @@ void TP_connection_generic::set_io_timeout(int timeout_sec) } - +#ifndef HAVE_IOCP /** Handle a (rare) special case,where connection needs to migrate to a different group because group_count has changed @@ -1534,7 +1534,7 @@ static int change_group(TP_connection_generic *c, mysql_mutex_unlock(&new_group->mutex); return ret; } - +#endif int TP_connection_generic::start_io() { diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc index adaca08982f..012f7c5a439 100644 --- a/sql/threadpool_win.cc +++ b/sql/threadpool_win.cc @@ -92,9 +92,6 @@ static void CALLBACK work_callback(PTP_CALLBACK_INSTANCE instance, PVOID context static void CALLBACK shm_read_callback(PTP_CALLBACK_INSTANCE instance, PVOID Context, PTP_WAIT wait,TP_WAIT_RESULT wait_result); -static void CALLBACK shm_close_callback(PTP_CALLBACK_INSTANCE instance, - PVOID Context, PTP_WAIT wait,TP_WAIT_RESULT wait_result); - static void pre_callback(PVOID context, PTP_CALLBACK_INSTANCE instance); /* Get current time as Windows time */ @@ -151,8 +148,8 @@ TP_connection_win::TP_connection_win(CONNECT *c) : timeout(ULONGLONG_MAX), callback_instance(0), io(0), - shm_read(0), timer(0), + shm_read(0), work(0) { } diff --git a/sql/udf_example.c b/sql/udf_example.c index afe3c5592bc..6db2b5e737a 100644 --- a/sql/udf_example.c +++ b/sql/udf_example.c @@ -112,6 +112,11 @@ ** */ +#ifdef _WIN32 +/* Silence warning about deprecated functions , gethostbyname etc*/ +#define _WINSOCK_DEPRECATED_NO_WARNINGS +#endif + #ifdef STANDARD /* STANDARD is defined, don't use any mysql functions */ #include <stdlib.h> @@ -139,14 +144,6 @@ typedef long long longlong; #include <mysql.h> #include <ctype.h> -#ifdef _WIN32 -/* inet_aton needs winsock library */ -#pragma comment(lib, "ws2_32") -#if _MSC_VER -/* Silence warning about deprecated functions , gethostbyname etc*/ -#pragma warning(disable : 4996) -#endif -#endif #ifdef HAVE_DLOPEN |