diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/CMakeLists.txt | 5 | ||||
-rw-r--r-- | client/mysql.cc | 5 | ||||
-rw-r--r-- | client/mysqltest.cc | 2 | ||||
-rw-r--r-- | client/sql_string.cc | 10 |
4 files changed, 15 insertions, 7 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index e36659d74bf..80c5bbd1c9f 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -64,7 +64,10 @@ MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c) SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS") TARGET_LINK_LIBRARIES(mysqlslap mysqlclient) -ADD_EXECUTABLE(echo echo.c) +# "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/". +IF(WIN32) + MYSQL_ADD_EXECUTABLE(echo echo.c) +ENDIF(WIN32) SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap PROPERTIES HAS_CXX TRUE) diff --git a/client/mysql.cc b/client/mysql.cc index a985c135361..14473ba4b51 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -93,6 +93,7 @@ extern "C" { #else #include <readline/readline.h> #define HAVE_READLINE +#define USE_POPEN #endif //int vidattr(long unsigned int attrs); // Was missing in sun curses } @@ -108,10 +109,6 @@ extern "C" { #define cmp_database(cs,A,B) strcmp((A),(B)) #endif -#if !defined(__WIN__) && !defined(THREAD) -#define USE_POPEN -#endif - #include "completion_hash.h" #define PROMPT_CHAR '\\' diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 8416432ffe1..ddc8105abec 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -6244,8 +6244,10 @@ get_one_option(int optid, const struct my_option *opt, char *argument) print_version(); exit(0); case OPT_MYSQL_PROTOCOL: +#ifndef EMBEDDED_LIBRARY opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); +#endif break; case '?': usage(); diff --git a/client/sql_string.cc b/client/sql_string.cc index 6b749409a64..dec6ac94eb2 100644 --- a/client/sql_string.cc +++ b/client/sql_string.cc @@ -31,9 +31,12 @@ ** String functions *****************************************************************************/ -bool String::real_alloc(uint32 arg_length) +bool String::real_alloc(uint32 length) { - arg_length=ALIGN_SIZE(arg_length+1); + uint32 arg_length= ALIGN_SIZE(length + 1); + DBUG_ASSERT(arg_length > length); + if (arg_length <= length) + return TRUE; /* Overflow */ str_length=0; if (Alloced_length < arg_length) { @@ -56,6 +59,9 @@ bool String::real_alloc(uint32 arg_length) bool String::realloc(uint32 alloc_length) { uint32 len=ALIGN_SIZE(alloc_length+1); + DBUG_ASSERT(len > alloc_length); + if (len <= alloc_length) + return TRUE; /* Overflow */ if (Alloced_length < len) { char *new_ptr; |