Commit 44655290 authored by Teodor Sigaev's avatar Teodor Sigaev

Fix backend crash in parsing incorrect tsquery.

Per report from Jon Rosebaugh <jon@inklesspen.com>
parent eb191448
...@@ -159,12 +159,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2 ...@@ -159,12 +159,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
(state->buf)++; /* can safely ++, t_iseq guarantee (state->buf)++; /* can safely ++, t_iseq guarantee
* that pg_mblen()==1 */ * that pg_mblen()==1 */
*val = (int4) '!'; *val = (int4) '!';
state->state = WAITOPERAND;
return OPR; return OPR;
} }
else if (t_iseq(state->buf, '(')) else if (t_iseq(state->buf, '('))
{ {
state->count++; state->count++;
(state->buf)++; (state->buf)++;
state->state = WAITOPERAND;
return OPEN; return OPEN;
} }
else if (t_iseq(state->buf, ':')) else if (t_iseq(state->buf, ':'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment