Re: 回覆: 回复: Core dump happens when execute sql CREATE VIEW v1(c1) AS (SELECT ('4' COLLATE "C")::INT FROM generate_series(1, 10));
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Yulin PEI <ypeiae@connect.ust.hk>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-04-19T16:47:38Z
Lists: pgsql-hackers
Yulin PEI <ypeiae@connect.ust.hk> writes:
> Let's look at your patch:
> ```
> // node is ('1' COLLATE "C")
> // targetType is varbit and it is non-collatable
> if (IsA(node, CollateExpr) && type_is_collatable(targetTypeId))
> {
> // we will not reach here.
That's not the committed patch, though. I realized after posting
it that it didn't maintain the same behavior in coerce_type as
coerce_to_target_type. But the actually-committed fix does, and
as I said, what you're suggesting seems equivalent though a bit
messier.
regards, tom lane
Commits
-
Remove no-longer-relevant test case.
- cf0020080a3d 14.0 landed
-
Fix old bug with coercing the result of a COLLATE expression.
- c402b02b9fb5 14.0 landed
- fb2cca828ec8 11.12 landed
- a6158a4d9c2e 9.6.22 landed
- 8a7bd1e6cba3 13.3 landed
- 4b0aecee8a7d 10.17 landed
- 27011bcffa74 12.7 landed