Re: PostgreSQL 10: Segmentation fault when using GROUPING SETS with all unsortable columns - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: PostgreSQL 10: Segmentation fault when using GROUPING SETS with all unsortable columns
Date
Msg-id 87zi33f8pq.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to PostgreSQL 10: Segmentation fault when using GROUPING SETS with allunsortable columns  (Huong Dangminh <huo-dangminh@ys.jp.nec.com>)
Responses Re: PostgreSQL 10: Segmentation fault when using GROUPING SETS with all unsortable columns  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
RE: PostgreSQL 10: Segmentation fault when using GROUPING SETS withall unsortable columns  (Huong Dangminh <huo-dangminh@ys.jp.nec.com>)
List pgsql-hackers
>>>>> "Huong" == Huong Dangminh <huo-dangminh@ys.jp.nec.com> writes:

 Huong> Hi,

 Huong> I have found a case which could get segmentation fault when
 Huong> using GROUPING SETS. It occurs when columns in GROUPING SETS are
 Huong> all unsortable but hashable.

Yes, mea culpa. will fix.

BTW, you should have reported this as a bug via the pgsql-bugs list or
the bug submission form.

 Huong> Attached grouping_sets_segv.zip include module to reproduce this
 Huong> problem.

A much simpler way to reproduce it is to use one of the builtin types
that isn't sortable (I tend to use xid for testing).

 Huong> Not yet fully understand the related commit, but I think it is
 Huong> fine to put ERRCODE_FEATURE_NOT_SUPPORTED error from
 Huong> preprocess_grouping_sets when all columns in GROUPING SETS are
 Huong> unsortable. Is that right?

No, that's definitely wrong. The intent is to be able to generate a
hashed path in this case, it's just the logic that tries to prefer
sorting to hashing when the input arrives already sorted is doing the
wrong thing for unsortable data.

-- 
Andrew (irc:RhodiumToad)


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: possibly to automatic detection of bad variable types in plans?
Next
From: Christoph Berg
Date:
Subject: Re: [PoC PATCH] Parallel dump to /dev/null