diff options
Diffstat (limited to 'libmysql')
-rw-r--r--[-rwxr-xr-x] | libmysql/CMakeLists.txt | 6 | ||||
-rw-r--r-- | libmysql/Makefile.am | 1 | ||||
-rw-r--r-- | libmysql/Makefile.shared | 8 | ||||
-rw-r--r-- | libmysql/client_settings.h | 2 | ||||
-rw-r--r-- | libmysql/dll.c | 23 | ||||
-rw-r--r-- | libmysql/errmsg.c | 3 | ||||
-rw-r--r-- | libmysql/get_password.c | 8 | ||||
-rw-r--r-- | libmysql/libmysql.c | 20 | ||||
-rw-r--r-- | libmysql/manager.c | 4 |
9 files changed, 28 insertions, 47 deletions
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index db4368a3534..7d4dcc1e919 100755..100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -15,6 +15,8 @@ # Need to set USE_TLS, since __declspec(thread) approach to thread local # storage does not work properly in DLLs. +INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") @@ -67,3 +69,7 @@ TARGET_LINK_LIBRARIES(libmysql mysys strings wsock32) ADD_EXECUTABLE(myTest mytest.c) TARGET_LINK_LIBRARIES(myTest libmysql) + +IF(EMBED_MANIFESTS) + MYSQL_EMBED_MANIFEST("myTest" "asInvoker") +ENDIF(EMBED_MANIFESTS) diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index 38680c98d53..ebfe15774ff 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -70,6 +70,7 @@ link_sources: @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc net.c ; \ rm -f password.c; \ @LN_CP_F@ $(top_srcdir)/sql/password.c password.c + echo timestamp > link_sources # This part requires GNUmake # diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index dc6d658fcdf..c24c6ab52db 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -79,8 +79,11 @@ target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \ $(sql_cmn_objects) $(vio_objects) $(sqlobjects) target_ldflags = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@ vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo + +BUILT_SOURCES = link_sources + CLEANFILES = $(target_libadd) $(SHLIBOBJS) \ - $(target) + $(target) $(BUILT_SOURCES) DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DDEFAULT_HOME_ENV=MYSQL_HOME \ @@ -103,8 +106,7 @@ clean-local: `echo $(vio_objects) | sed "s;\.lo;.c;g"` \ `echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \ $(CHARSET_SRCS) $(CHARSET_OBJS) \ - $(mystringsextra) $(mysysheaders) $(vioheaders)\ - ../linked_libmysql_sources ../linked_libmysql_r_sources \ + $(mystringsextra) $(mysysheaders) $(vioheaders) \ net.c conf_to_src_SOURCES = conf_to_src.c diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index b67fbbc03af..4bc4bda5b63 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -41,7 +41,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); -void mysql_detach_stmt_list(LIST **stmt_list); +void mysql_detach_stmt_list(LIST **stmt_list, const char *func_name); MYSQL * cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, diff --git a/libmysql/dll.c b/libmysql/dll.c index b0e4b9cab3b..f5db0bb4669 100644 --- a/libmysql/dll.c +++ b/libmysql/dll.c @@ -112,26 +112,3 @@ int _export FAR PASCAL libmain(HANDLE hModule,short cbHeapSize, } #endif - -#ifdef OS2 - -/* - This function is called automatically by _DLL_InitTerm - Every dll runtime enviroment is not tz enabled, so tzset() - must be called to enable TZ handling - Also timezone is fixed. -*/ - -extern "C" unsigned long _System DllMain(unsigned long modhandle, - unsigned long flag) -{ - if (flag == 0) { - tzset(); /* Set tzname */ - time_t currentTime = time(NULL); - struct tm *ts = localtime(¤tTime); - if (ts->tm_isdst > 0) - _timezone -= 3600; - } -} - -#endif diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index 59089d5ec18..e7f495d1f43 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -83,6 +83,7 @@ const char *client_errors[]= "Attempt to read a row while there is no result set associated with the statement", "This feature is not implemented yet", "Lost connection to MySQL server at '%s', system error: %d", + "Statement closed indirectly because of a preceeding %s() call", "" }; @@ -147,6 +148,7 @@ const char *client_errors[]= "Attempt to read a row while there is no result set associated with the statement", "This feature is not implemented yet", "Lost connection to MySQL server at '%s', system error: %d", + "Statement closed indirectly because of a preceeding %s() call", "" }; @@ -209,6 +211,7 @@ const char *client_errors[]= "Attempt to read a row while there is no result set associated with the statement", "This feature is not implemented yet", "Lost connection to MySQL server at '%s', system error: %d", + "Statement closed indirectly because of a preceeding %s() call", "" }; #endif diff --git a/libmysql/get_password.c b/libmysql/get_password.c index e55e77320f0..4c251677a66 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -36,7 +36,7 @@ #include <pwd.h> #endif /* HAVE_PWD_H */ #else /* ! HAVE_GETPASS */ -#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(__NETWARE__) #include <sys/ioctl.h> #ifdef HAVE_TERMIOS_H /* For tty-password */ #include <termios.h> @@ -65,7 +65,7 @@ #define getpass(A) getpassphrase(A) #endif -#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined( __WIN__) || defined(__NETWARE__) /* were just going to fake it here and get input from the keyboard */ #ifdef __NETWARE__ @@ -75,7 +75,7 @@ #define _cputs(A) putstring(A) #endif -char *get_tty_password(char *opt_message) +char *get_tty_password(const char *opt_message) { char to[80]; char *pos=to,*end=to+sizeof(to)-1; @@ -159,7 +159,7 @@ static void get_password(char *to,uint length,int fd,bool echo) #endif /* ! HAVE_GETPASS */ -char *get_tty_password(char *opt_message) +char *get_tty_password(const char *opt_message) { #ifdef HAVE_GETPASS char *passbuff; diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e426d2c549e..3d734ef7378 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -180,10 +180,8 @@ void STDCALL mysql_server_end() if (!org_my_init_done) { my_end(MY_DONT_FREE_DBUG); -#ifndef THREAD - /* Remove TRACING, if enabled by mysql_debug() */ + /* Remove TRACING, if enabled by mysql_debug() */ DBUG_POP(); -#endif } else { @@ -270,16 +268,12 @@ mysql_debug(const char *debug __attribute__((unused))) { #ifndef DBUG_OFF char *env; - if (_db_on_) - return; /* Already using debugging */ if (debug) { - DEBUGGER_ON; DBUG_PUSH(debug); } else if ((env = getenv("MYSQL_DEBUG"))) { - DEBUGGER_ON; DBUG_PUSH(env); #if !defined(_WINVER) && !defined(WINVER) puts("\n-------------------------------------------------------"); @@ -719,7 +713,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, The server will close all statements no matter was the attempt to change user successful or not. */ - mysql_detach_stmt_list(&mysql->stmts); + mysql_detach_stmt_list(&mysql->stmts, "mysql_change_user"); if (rc == 0) { /* Free old connect information */ @@ -748,7 +742,7 @@ void read_user_name(char *name) strmake(name, str ? str : "UNKNOWN_USER", USERNAME_LENGTH); } -#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2) +#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) void read_user_name(char *name) { @@ -2539,7 +2533,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt) DBUG_RETURN(1); } - net_clear(net); /* Sets net->write_pos */ + net_clear(net, 1); /* Sets net->write_pos */ /* Reserve place for null-marker bytes */ null_count= (stmt->param_count+7) /8; if (my_realloc_str(net, null_count + 1)) @@ -2810,11 +2804,11 @@ my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, { switch (attr_type) { case STMT_ATTR_UPDATE_MAX_LENGTH: - *(unsigned long *) value= stmt->update_max_length; + *(my_bool*) value= stmt->update_max_length; break; case STMT_ATTR_CURSOR_TYPE: *(ulong*) value= stmt->flags; - break; + break; case STMT_ATTR_PREFETCH_ROWS: *(ulong*) value= stmt->prefetch_rows; break; @@ -2876,7 +2870,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt) if (!mysql) { - set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate); + /* Error is already set in mysql_detatch_stmt_list */ DBUG_RETURN(1); } diff --git a/libmysql/manager.c b/libmysql/manager.c index 631bfa26cb2..a88c63123b0 100644 --- a/libmysql/manager.c +++ b/libmysql/manager.c @@ -35,9 +35,7 @@ #include <signal.h> #include <errno.h> -#if defined(OS2) -# include <sys/un.h> -#elif defined(__NETWARE__) +#if defined(__NETWARE__) #include <netdb.h> #include <sys/select.h> #include <sys/utsname.h> |