diff options
author | unknown <serg@serg.mylan> | 2003-06-09 22:28:15 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2003-06-09 22:28:15 +0200 |
commit | ba35872ae874952f44c39740d5f1b0eca4a0c144 (patch) | |
tree | f3bc6f285029de462832dc19c46897943ea90d7d /myisam/mi_delete.c | |
parent | 0bb5b9eadddfc911bfaa7c6ee69db92fc7785c94 (diff) | |
parent | 00320d3790d063932784993b0370a177cd02a4cd (diff) | |
download | mariadb-git-ba35872ae874952f44c39740d5f1b0eca4a0c144.tar.gz |
Merge bk-internal:/home/bk/mysql-4.1/
into serg.mylan:/usr/home/serg/Abk/mysql-4.1
myisam/mi_delete.c:
Auto merged
Diffstat (limited to 'myisam/mi_delete.c')
-rw-r--r-- | myisam/mi_delete.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c index 36dd0d2d62c..97d2f531f6f 100644 --- a/myisam/mi_delete.c +++ b/myisam/mi_delete.c @@ -33,7 +33,7 @@ static int underflow(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *anc_buff, static uint remove_key(MI_KEYDEF *keyinfo,uint nod_flag,uchar *keypos, uchar *lastkey,uchar *page_end, my_off_t *next_block); -static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo, +static int _mi_ck_real_delete(register MI_INFO *info,MI_KEYDEF *keyinfo, uchar *key, uint key_length, my_off_t *root); @@ -188,6 +188,7 @@ static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo, } err: my_afree((gptr) root_buff); + DBUG_PRINT("exit",("Return: %d",error)); DBUG_RETURN(error); } /* _mi_ck_real_delete */ @@ -234,6 +235,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, if (subkeys >= 0) { /* normal word, one-level tree structure */ + DBUG_PRINT("info",("FT1")); flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key,USE_WHOLE_KEY, comp_flag, &keypos, lastkey, &last_key); /* fall through to normal delete */ @@ -250,11 +252,13 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, if (subkeys == -1) { /* the last entry in sub-tree */ + DBUG_PRINT("info",("FT2: the last entry")); _mi_dispose(info, keyinfo, root); /* fall through to normal delete */ } else { + DBUG_PRINT("info",("FT2: going down")); keyinfo=&info->s->ft2_keyinfo; kpos-=keyinfo->keylength; /* we'll modify key entry 'in vivo' */ key+=off; @@ -265,6 +269,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, ft_intXstore(kpos, subkeys); if (!ret_value) ret_value=_mi_write_keypage(info,keyinfo,page,anc_buff); + DBUG_PRINT("exit",("Return: %d",ret_value)); DBUG_RETURN(ret_value); } } @@ -279,6 +284,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, { DBUG_PRINT("error",("Couldn't allocate memory")); my_errno=ENOMEM; + DBUG_PRINT("exit",("Return: %d",-1)); DBUG_RETURN(-1); } if (!_mi_fetch_keypage(info,keyinfo,leaf_page,leaf_buff,0)) @@ -304,14 +310,20 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, tmp=remove_key(keyinfo,nod_flag,keypos,lastkey,anc_buff+length, &next_block); if (tmp == 0) + { + DBUG_PRINT("exit",("Return: %d",0)); DBUG_RETURN(0); + } length-= tmp; mi_putint(anc_buff,length,nod_flag); if (!nod_flag) { /* On leaf page */ if (_mi_write_keypage(info,keyinfo,page,anc_buff)) + { + DBUG_PRINT("exit",("Return: %d",-1)); DBUG_RETURN(-1); + } /* Page will be update later if we return 1 */ DBUG_RETURN(test(length <= (info->quick_mode ? MI_MIN_KEYBLOCK_LENGTH : (uint) keyinfo->underflow_block_length))); @@ -348,6 +360,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, DBUG_DUMP("page",(byte*) anc_buff,mi_getint(anc_buff)); } my_afree((byte*) leaf_buff); + DBUG_PRINT("exit",("Return: %d",ret_value)); DBUG_RETURN(ret_value); err: my_afree((byte*) leaf_buff); |