diff options
author | unknown <monty@mashka.mysql.fi> | 2002-08-05 18:10:53 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-08-05 18:10:53 +0300 |
commit | 7fc5f6d1e575ac39b850fa371f47e91f1c671c84 (patch) | |
tree | 35b9b7d0d96ac96efa5d2dc6ab3a58ef497f1a6a /myisam | |
parent | 3c649c075b8061ab3a76d719427518e5457e8b9c (diff) | |
download | mariadb-git-7fc5f6d1e575ac39b850fa371f47e91f1c671c84.tar.gz |
Fixed bug with GROUP BY on NULL fields.
(Merge of code from 4.0)
Docs/manual.texi:
Changelog
include/my_base.h:
Fixed bug with GROUP BY on NULL fields.
include/mysql_com.h:
Fixed bug with GROUP BY on NULL fields.
myisam/mi_search.c:
Fixed bug with GROUP BY on NULL fields.
myisam/mi_write.c:
Fixed bug with GROUP BY on NULL fields.
mysql-test/r/group_by.result:
Fixed bug with GROUP BY on NULL fields.
mysql-test/t/group_by.test:
Fixed bug with GROUP BY on NULL fields.
sql/sql_base.cc:
Removed some not-needed comments in the trace file
sql/sql_select.cc:
Fixed bug with GROUP BY on NULL fields.
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 */ |