Re: FETCH FIRST clause WITH TIES option

From: Erik Rijkers <er(at)xs4all(dot)nl>
To: Surafel Temesgen <surafel3000(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, David Steele <david(at)pgmasters(dot)net>, Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FETCH FIRST clause WITH TIES option
Date: 2019-07-03 08:23:08
Message-ID: d2c91f26f526cf9e0735cff600ff0e4b@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-07-03 08:40:39 Re: Run-time pruning for ModifyTable
Previous Message Amit Langote 2019-07-03 08:13:00 Re: Problem with default partition pruning