diff options
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_search.c | 5 | ||||
-rw-r--r-- | myisam/mi_write.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 2c04679ed4c..938062d977d 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -107,8 +107,9 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, } else { - if (nextflag & SEARCH_FIND && (!(keyinfo->flag & HA_NOSAME) - || key_len) && nod_flag) + if ((nextflag & SEARCH_FIND) && nod_flag && + ((keyinfo->flag & (HA_NOSAME | HA_NULL_PART)) != HA_NOSAME || + key_len)) { if ((error=_mi_search(info,keyinfo,key,key_len,SEARCH_FIND, _mi_kpos(nod_flag,keypos))) >= 0 || diff --git a/myisam/mi_write.c b/myisam/mi_write.c index f31e43e52ab..7b468395166 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -263,7 +263,11 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, if (keyinfo->flag & HA_SORT_ALLOWS_SAME) comp_flag=SEARCH_BIGGER; /* Put after same key */ else if (keyinfo->flag & HA_NOSAME) + { comp_flag=SEARCH_FIND | SEARCH_UPDATE; /* No dupplicates */ + if (keyinfo->flag & HA_NULL_ARE_EQUAL) + comp_flag|= SEARCH_NULL_ARE_EQUAL; + } else comp_flag=SEARCH_SAME; /* Keys in rec-pos order */ |