david@gravitext.com writes:
> I am doing some (fuzz) testing of full text queries and managed to
> generate the following case which causes a SEGFAULT on PostgreSQL 9.6
> beta1 and beta2:
> select to_tsquery('!(a & !b) & c') as tsquery
> This weird query outputs the following on 9.5.2, instead of crashing:
> "!( !'b' ) & 'c'"
Note that while crashing is certainly not good, the pre-9.6 behavior
can hardly be called correct either. What happened to 'a'?
Also, it looks like this is specific to to_tsquery; if you just feed
the same thing to tsqueryin, it seems fine with it:
# select '!(a & !b) & c'::tsquery;
tsquery
-----------------------
!( 'a' & !'b' ) & 'c'
(1 row)
regards, tom lane