Re: FETCH FIRST clause WITH TIES option - Mailing list pgsql-hackers

From Erik Rijkers
Subject Re: FETCH FIRST clause WITH TIES option
Date
Msg-id d2c91f26f526cf9e0735cff600ff0e4b@xs4all.nl
Whole thread Raw
In response to Re: FETCH FIRST clause WITH TIES option  (Surafel Temesgen <surafel3000@gmail.com>)
Responses Re: FETCH FIRST clause WITH TIES option  (Surafel Temesgen <surafel3000@gmail.com>)
List pgsql-hackers
On 2019-07-01 19:38, Surafel Temesgen wrote:
> Thank you for informing. attach is a rebased patch against current 
> master
> [...]
> [fetch_first_with_ties_v10.patch]

Hi Surafel,

The patch applies OK, make check is OK, compiles OK.

But I get:

TRAP: FailedAssertion("!(!(((slot)->tts_flags & (1 << 1)) != 0))", File: 
"execTuples.c", Line: 491)

when running a variant ('fetch 1' instead of 'fetch 2') of the test SQL 
against src/test/regress/data/onek.data:

(in the script below the location of the file 'onek.data' will have to 
be changed)

--------------------- 8< ---------------------
#!/bin/bash

echo "
drop   table if exists onek ;
create table onek (
unique1      int4,
unique2      int4,
two          int4,
four         int4,
ten          int4,
twenty       int4,
hundred      int4,
thousand     int4,
twothousand  int4,
fivethous    int4,
tenthous     int4,
odd          int4,
even         int4,
stringu1     name,
stringu2     name,
string4      name
);

copy onek from 
'/home/aardvark/pg_stuff/pg_sandbox/pgsql.fetch_first_with_ties/src/test/regress/data/onek.data';

create index               onek_unique1 on onek using btree(unique1 
int4_ops);
create index onek_unique2  on onek using btree(unique2 int4_ops);
create index onek_hundred  on onek using btree(hundred int4_ops);
create index onek_stringu1 on onek using btree(stringu1 name_ops);

-- OK:
select  * from onek
where thousand < 5 order by thousand
fetch first 1 rows only
;

-- crashes:
select  * from onek
where thousand < 5 order by thousand
fetch first 1 rows with ties
;

" | psql -qXa
--------------------- 8< ---------------------

Can you have a look?


thanks,

Erik Rijkers





pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Problem with default partition pruning
Next
From: Amit Langote
Date:
Subject: Re: Run-time pruning for ModifyTable