Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
postgresql db driver
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Mar 2015 at 09:55 UTC
Updated:
29 Dec 2025 at 22:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
grom358 commentedSo this test fails due to the PHP PDO pgsql driver with doing a LIKE query on a bytea field. There is an attempt at workaround already there but it does not work.
Comment #2
grom358 commentedI tried doing the CONVERT_FROM inside the Connection class but to no success. So patched the query for this single test. Really we shouldn't be using serialized PHP. See #839444: Make serializer customizable for Cache\DatabaseBackend
Comment #4
bzrudi71 commented@grom358: Thanks a lot! There is already a (broken) patch available #2238253: Add bindValue to a PDO::PARAM_* type in database query arguments that might fix bytea selects. If we can't get that one working I think we should just change the test to unserialize first.
Comment #5
grom358 commentedUse PHP to filter the log messages.
So in Postgres 9 they added the Hex format for bytea. ::text with PDO driver will use the hex format and hence using a LIKE on ::text for bytea fields doesn't work for postgres 9
What other places is the preg_replace hack used on LIKE conditions?
Comment #6
grom358 commentedComment #7
daffie commentedIt all looks good to me.
I can confirm that the test fails for postgreSQL and with the patch the test passes for postgreSQL.
So for me it is RTBC.
Comment #8
bzrudi71 commentedSetting back to needs review because we should check if this is fixed by #2238253: Add bindValue to a PDO::PARAM_* type in database query arguments first, @grom358 did a patch reroll. If it doesn't pass, the patch in this issue is the way to go and this can be set to RTBC again :-)
Comment #9
bzrudi71 commentedSadly no pass with #2238253: Add bindValue to a PDO::PARAM_* type in database query arguments applied. We do nowhere a bytea select in core but within this test, so the patch here is the way to go and we should leave bytea select open as a feature request. Back to RTBC.
Comment #10
alexpottLet's add a comment as to why this method is as complex as it is.
Comment #11
bzrudi71 commentedAdded comment.
Comment #12
bzrudi71 commentedComment #13
daffie commentedLooks good to me.
Comment #15
catchComment looks good. I don't see a nice way to fix this without a lot more changes. Committed/pushed to 8.0.x, thanks!
Comment #17
quietone commented