diff options
Diffstat (limited to 'myisam/ft_update.c')
-rw-r--r-- | myisam/ft_update.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/myisam/ft_update.c b/myisam/ft_update.c index 1c16a77ab5b..7cfce1158fc 100644 --- a/myisam/ft_update.c +++ b/myisam/ft_update.c @@ -37,9 +37,8 @@ static FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf, byte *pos; uint i; - i=info->s->keyinfo[keynr].keysegs-FT_SEGS; keyseg=info->s->keyinfo[keynr].seg; - while(i--) + for (i=info->s->keyinfo[keynr].keysegs-FT_SEGS ; i-- ; ) { uint len; @@ -61,10 +60,12 @@ static FT_WORD * _mi_ft_parserecord(MI_INFO *info, uint keynr, byte *keybuf, } else len=keyseg->length; - - parsed=ft_parse(parsed, pos, len); - if (parsed==NULL) return NULL; + if (!(parsed=ft_parse(parsed, pos, len))) + return NULL; } + /* Handle the case where all columns are NULL */ + if (!parsed && !(parsed=ft_parse(0, "", 0))) + return NULL; return ft_linearize(info, keynr, keybuf, parsed); } |