diff options
author | unknown <serg@serg.mylan> | 2003-10-02 20:22:29 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2003-10-02 20:22:29 +0200 |
commit | 3205118eaf1ea9a9c22b0b8437fdf5ac06c5ff4a (patch) | |
tree | 4ccd6f1ab67583e81c02d66fd35d83a3d9bee0fe /myisam/mi_delete.c | |
parent | 43a4d55eefaf7409f708377b712ff306c28cc1e1 (diff) | |
download | mariadb-git-3205118eaf1ea9a9c22b0b8437fdf5ac06c5ff4a.tar.gz |
ft1->ft2 auto-conversion on INSERT (WL#725)
Diffstat (limited to 'myisam/mi_delete.c')
-rw-r--r-- | myisam/mi_delete.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c index 2ab5c5d0319..d8e1aef5eb6 100644 --- a/myisam/mi_delete.c +++ b/myisam/mi_delete.c @@ -18,6 +18,7 @@ #include "fulltext.h" #include "rt_index.h" +#include <assert.h> #ifdef __WIN__ #include <errno.h> @@ -231,13 +232,22 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, get_key_full_length_rdonly(off, lastkey); subkeys=ft_sintXkorr(lastkey+off); + DBUG_ASSERT(info->ft1_to_ft2==0 || subkeys >=0); comp_flag=SEARCH_SAME; 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); + if (info->ft1_to_ft2) + { + /* we're in ft1->ft2 conversion mode. Saving key data */ + insert_dynamic(info->ft1_to_ft2, lastkey+off); + } + else + { + /* we need exact match only if not in ft1->ft2 conversion mode */ + flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key,USE_WHOLE_KEY, + comp_flag, &keypos, lastkey, &last_key); + } /* fall through to normal delete */ } else @@ -252,13 +262,11 @@ 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+nod_flag; /* we'll modify key entry 'in vivo' */ key+=off; |