summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysqltest.c9
-rw-r--r--client/sql_string.cc15
3 files changed, 17 insertions, 11 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 20f87d5cdcd..88ddd40fa68 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2247,8 +2247,10 @@ static char **new_mysql_completion (const char *text, int start, int end);
if not.
*/
-#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
+#if defined(USE_NEW_READLINE_INTERFACE)
char *no_completion(const char*,int)
+#elif defined(USE_LIBEDIT_INTERFACE)
+int no_completion(const char*,int)
#else
char *no_completion()
#endif
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 62ec5a88599..d7fbb6f1f18 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -1385,8 +1385,15 @@ void show_diff(DYNAMIC_STRING* ds,
/* determine if we have diff on Windows
needs special processing due to return values
on that OS
+ This test is only done on Windows since it's only needed there
+ in order to correctly detect non-availibility of 'diff', and
+ the way it's implemented does not work with default 'diff' on Solaris.
*/
+#ifdef __WIN__
have_diff = diff_check();
+#else
+ have_diff = 1;
+#endif
if (have_diff)
{
@@ -1410,7 +1417,7 @@ void show_diff(DYNAMIC_STRING* ds,
"2>&1",
NULL) > 1) /* Most "diff" tools return >1 if error */
{
- have_diff= 1;
+ have_diff= 0;
}
}
}
diff --git a/client/sql_string.cc b/client/sql_string.cc
index 7767711e62f..321bddbf69a 100644
--- a/client/sql_string.cc
+++ b/client/sql_string.cc
@@ -71,25 +71,22 @@ bool String::realloc(uint32 alloc_length)
char *new_ptr;
if (alloced)
{
- if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
- {
- Ptr=new_ptr;
- Alloced_length=len;
- }
- else
- return TRUE; // Signal error
+ if (!(new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
+ return TRUE; // Signal error
}
else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME))))
{
+ if (str_length > len - 1)
+ str_length= 0;
if (str_length) // Avoid bugs in memcpy on AIX
memcpy(new_ptr,Ptr,str_length);
new_ptr[str_length]=0;
- Ptr=new_ptr;
- Alloced_length=len;
alloced=1;
}
else
return TRUE; // Signal error
+ Ptr= new_ptr;
+ Alloced_length= len;
}
Ptr[alloc_length]=0; // This make other funcs shorter
return FALSE;