diff options
author | Joerg Bruehe <joerg@mysql.com> | 2010-09-10 20:48:13 +0200 |
---|---|---|
committer | Joerg Bruehe <joerg@mysql.com> | 2010-09-10 20:48:13 +0200 |
commit | f6bddff896d985f7895522e1a56d0eb38ae15605 (patch) | |
tree | d672649465fcb9292a9de5dafb534308e0adb2fb /client | |
parent | afe9d44c3a8b981f9d06e9f1e5f520ec38f657cb (diff) | |
parent | e6a3c8c458bc626f8c7977868afdb6b9ae8019c3 (diff) | |
download | mariadb-git-f6bddff896d985f7895522e1a56d0eb38ae15605.tar.gz |
Automerge (most) changes of the 5.5.6-rc release build to main 5.5.
This is not the final merge!
Diffstat (limited to 'client')
-rw-r--r-- | client/CMakeLists.txt | 5 | ||||
-rw-r--r-- | client/sql_string.cc | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 771ebf290f1..e39e8d7178a 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/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; |