From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Seltenreich <seltenreich@gmx.de>
Cc: Oleg Bartunov <obartunov@gmail.com>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [sqlsmith] Failed assertion in TS_phrase_execute
Date: Sat, 26 Nov 2016 13:51:17 -0500
Message-ID: <14732.1480186277@sss.pgh.pa.us> (raw)
In-Reply-To: <87eg1y2s3x.fsf@credativ.de>
References: <87eg1y2s3x.fsf@credativ.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Andreas Seltenreich <seltenreich@gmx.de> writes:
> the query below triggers an assertion in TS_phrase_execute. Testing was
> done on master at dbdfd11.
> -- TRAP: FailedAssertion("!(curitem->qoperator.oper == 4)", File: "tsvector_op.c", Line: 1432)
> select 'moscow' @@
> ts_rewrite('moscow', 'moscow',
> ts_rewrite(
> tsquery_phrase('moscow','moscow'),
> 'moscow',
> $$ 'sanct' & 'peter'$$));
Hmm. If you run the ts_rewrite alone, it prints
regression=# select ts_rewrite('moscow', 'moscow',
ts_rewrite(
tsquery_phrase('moscow','moscow'),
'moscow',
$$ 'sanct' & 'peter'$$));
ts_rewrite
-------------------------------------------------
( 'sanct' & 'peter' ) <-> ( 'sanct' & 'peter' )
(1 row)
and if you put that in explicitly, all's well:
regression=# select 'moscow' @@ $$( 'sanct' & 'peter' ) <-> ( 'sanct' & 'peter' )$$::tsquery;
?column?
----------
f
(1 row)
but I notice that some normalization seems to be getting done by
tsqueryin:
regression=# select $$( 'sanct' & 'peter' ) <-> ( 'sanct' & 'peter' )$$::tsquery;
tsquery
--------------------------------------------------------------------------------
-------
'sanct' <-> 'sanct' & 'peter' <-> 'sanct' & 'sanct' <-> 'peter' & 'peter' <-> '
peter'
(1 row)
so this seems to boil down to ts_rewrite failing to apply required
normalization. Or maybe the normalization shouldn't be required.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, seltenreich@gmx.de, obartunov@gmail.com, teodor@sigaev.ru
Subject: Re: [sqlsmith] Failed assertion in TS_phrase_execute
In-Reply-To: <14732.1480186277@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox