Re: Wrong Results from SP-GiST with Collations
От | Peter Geoghegan |
---|---|
Тема | Re: Wrong Results from SP-GiST with Collations |
Дата | |
Msg-id | CAH2-WzkUksjq9M=OFvY4nd4ywA4BGAyBBBpFSEjLyhjWq8YYMw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Wrong Results from SP-GiST with Collations (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Wrong Results from SP-GiST with Collations
|
Список | pgsql-bugs |
On Mon, Apr 16, 2018 at 11:51 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > You're on to something, but I think the bug is in > spg_text_leaf_consistent, which thinks it can do collation-aware > comparisons like this: > > r = varstr_cmp(fullValue, Min(queryLen, fullLen), > VARDATA_ANY(query), Min(queryLen, fullLen), > PG_GET_COLLATION()); Ah. Those arguments make that code completely broken. > and then the bit below about > > if (r == 0) > { > if (queryLen > fullLen) > r = -1; > else if (queryLen < fullLen) > r = 1; > } > > needs to move into the "non-collation-aware" branch. Right. Alternatively, you could actually call varstr_cmp() within the "non-collation-aware" branch. -- Peter Geoghegan
В списке pgsql-bugs по дате отправления: