pgsql: Unbreak index optimization for LIKE on bytea

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: Unbreak index optimization for LIKE on bytea

Peter Eisentraut-3
Unbreak index optimization for LIKE on bytea

The same code is used to handle both text and bytea, but bytea is not
collation-aware, so we shouldn't call get_collation_isdeterministic()
in that case, since that will error out with an invalid collation.

Reported-by: Jeevan Chalke <[hidden email]>
Discussion: https://www.postgresql.org/message-id/flat/CAM2%2B6%3DWaf3qJ1%3DyVTUH8_yG-SC0xcBMY%2BSFLhvKKNnWNXSUDBw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/abb9c63b2c00109183cdb9f588d2f23fc383ed38

Modified Files
--------------
src/backend/utils/adt/like_support.c  |  4 +++-
src/test/regress/expected/strings.out | 16 ++++++++++++++++
src/test/regress/sql/strings.sql      | 13 +++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)