summaryrefslogtreecommitdiff
path: root/mysys/hash.c
diff options
context:
space:
mode:
authormonty@tik.mysql.com <>2000-11-13 23:55:10 +0200
committermonty@tik.mysql.com <>2000-11-13 23:55:10 +0200
commit7a013339f84c48ea6194a35d9c00d0d549466b1d (patch)
tree6689cb755cdb6ba0fb4cc6fbb215d75b175228d2 /mysys/hash.c
parentcb1d81f650df9fc3ec5965cf2dfbcb1fd8559d31 (diff)
downloadmariadb-git-7a013339f84c48ea6194a35d9c00d0d549466b1d.tar.gz
Bug fixes, TRUNCATE, safer passwords on command line and connect timeout
Diffstat (limited to 'mysys/hash.c')
-rw-r--r--mysys/hash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/hash.c b/mysys/hash.c
index a6181443a42..9c6497c7717 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -374,10 +374,11 @@ my_bool hash_delete(HASH *hash,byte *record)
uint blength,pos2,pos_hashnr,lastpos_hashnr,idx,empty_index;
HASH_LINK *data,*lastpos,*gpos,*pos,*pos3,*empty;
DBUG_ENTER("hash_delete");
+ if (!hash->records)
+ DBUG_RETURN(1);
blength=hash->blength;
data=dynamic_element(&hash->array,0,HASH_LINK*);
-
/* Search after record with key */
pos=data+ hash_mask(rec_hashnr(hash,record),blength,hash->records);
gpos = 0;