Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)
Date
Msg-id 20000.1470260376@sss.pgh.pa.us
Whole thread Raw
In response to [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)  (Andreas Seltenreich <seltenreich@gmx.de>)
Responses Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
Andreas Seltenreich <seltenreich@gmx.de> writes:
> the following statement triggers an assertion in tsearch:

> select ts_delete(array_to_tsvector('{smith,smith,smith}'::text[]),  '{smith,smith}'::text[]);
> -- TRAP: FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)

Confirmed here.  I notice that the output of array_to_tsvector() is
already fishy in this example:

regression=# select array_to_tsvector('{smith,smith,smith}'::text[]);   array_to_tsvector    
-------------------------'smith' 'smith' 'smith'
(1 row)

Shouldn't those have been merged together?  You certainly don't get
results like that from other tsvector-producing operations:

regression=# select to_tsvector('smith smith smith'); to_tsvector  
---------------'smith':1,2,3
(1 row)
regression=# select 'smith smith smith'::tsvector;tsvector 
----------'smith'
(1 row)

However, that does not seem to be the proximate cause of the crash
in ts_delete, because this non-duplicated case still crashes:

select ts_delete(array_to_tsvector('{smith,smithx,smithy}'::text[]),  '{smith,smith}'::text[]);

It kinda looks like you need more than one deletion request for
the first entry in the sorted tsvector, because for example
{smith,foo,toolbox} works but not {smith,too,toolbox}.

I'm thinking there are two distinct bugs here.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Cache Hash Index meta page.
Next
From: Tom Lane
Date:
Subject: Re: [sqlsmith] FailedAssertion("!(k == indices_count)", File: "tsvector_op.c", Line: 511)