Fix backend crash in parsing incorrect tsquery.

Per report from Jon Rosebaugh <jon@inklesspen.com>
This commit is contained in:
Teodor Sigaev 2007-02-12 14:14:33 +00:00
parent eb19144894
commit 44655290cc
1 changed files with 2 additions and 0 deletions

View File

@ -159,12 +159,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
(state->buf)++; /* can safely ++, t_iseq guarantee
* that pg_mblen()==1 */
*val = (int4) '!';
state->state = WAITOPERAND;
return OPR;
}
else if (t_iseq(state->buf, '('))
{
state->count++;
(state->buf)++;
state->state = WAITOPERAND;
return OPEN;
}
else if (t_iseq(state->buf, ':'))