summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--isam/_search.c2
-rw-r--r--sql/item_strfunc.cc3
-rw-r--r--sql/sql_acl.cc4
-rw-r--r--sql/sql_select.cc2
4 files changed, 6 insertions, 5 deletions
diff --git a/isam/_search.c b/isam/_search.c
index 93a08ea2b0d..c005e9ddb69 100644
--- a/isam/_search.c
+++ b/isam/_search.c
@@ -119,7 +119,7 @@ int _nisam_search(register N_INFO *info, register N_KEYDEF *keyinfo, uchar *key,
{
keypos=_nisam_get_last_key(info,keyinfo,buff,lastkey,keypos);
if ((nextflag & SEARCH_LAST) &&
- _nisam_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND))
+ _nisam_key_cmp(keyinfo->seg, lastkey, key, key_len, SEARCH_FIND))
{
my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */
goto err;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 9e37a5a18e5..ff01d841e78 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1094,7 +1094,8 @@ String *Item_func_database::val_str(String *str)
String *Item_func_user::val_str(String *str)
{
THD *thd=current_thd;
- if (!(thd->user) || // for system threads (e.g. replication thread)
+ // For a replication thread user may be a null pointer (To be fixed)
+ if (!thd->user ||
str->copy((const char*) thd->user,(uint) strlen(thd->user)) ||
str->append('@') ||
str->append(thd->host ? thd->host : thd->ip ? thd->ip : ""))
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f36e39b0645..554417322a4 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -206,10 +206,10 @@ int acl_init(bool dont_read_acl_tables)
"Found old style password for user '%s'. Ignoring user. (You may want to restart using --old-protocol)",
user.user ? user.user : ""); /* purecov: tested */
}
- else if (length % 8) // This holds true for passwords
+ else if (length % 8 || length > 16)
{
sql_print_error(
- "Found invalid password for user: '%s@%s'; Ignoring user",
+ "Found invalid password for user: '%s'@'%s'; Ignoring user",
user.user ? user.user : "",
user.host.hostname ? user.host.hostname : ""); /* purecov: tested */
continue; /* purecov: tested */
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b9e9c0a14fa..1230dffcaa9 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -5333,7 +5333,7 @@ create_sort_index(JOIN_TAB *tab,ORDER *order,ha_rows select_limit)
Impossible range (for example lookup on NULL on not null field)
Create empty result set
*/
- if (!(table->record_pointers= my_malloc(1, MYF(MY_WME))))
+ if (!(table->record_pointers= (byte*) my_malloc(1, MYF(MY_WME))))
goto err;
table->found_records= 0;
goto end;