- Status changed to Needs review
over 1 year ago 1:14pm 3 May 2023 - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago 30,310 pass, 8 fail - last update
over 1 year ago 30,306 pass, 11 fail The last submitted patch, 22: 3079534-21_psql-views-join-id.patch, failed testing. View results β
- Status changed to Needs work
about 1 year ago 1:48pm 30 September 2023 - π²π½Mexico luisnicg
Complementing #12
In addition to performance issues, I got duplicated rows in different views, for example, I got duplicated results after filtering users by mail in /admin/people.I would recommend validating the database type before doing the CAST, since this only happens with "pgsql", then validate the type of the field (if entity type exists) and validate if the field doesn't have "id" as sub-string (assuming all ids are INT)
I solve my specific issue with this https://www.drupal.org/project/flag/issues/2929733#comment-12836956 π SQL query error on PostgreSQL 9.5 when try to list Bookmarks Active
- π²π½Mexico luisnicg
Based on my previous comment I've created this patch.
- π²π½Mexico luisnicg
I have placed strrpos params wrong, patch was updated.
- π§πͺBelgium xdequinze Brussels
The last patch didn't work for me, using Drupal 9.5.11.
I updated to make it working. - Status changed to Needs review
10 months ago 5:14pm 15 January 2024 - last update
10 months ago 30,374 pass - last update
10 months ago 26,030 pass, 1,832 fail - last update
10 months ago Build Successful - π¨π¦Canada Liam Morland Ontario, CA π¨π¦
This improved patch casts to
text
instead ofbigint
. This fixes additional failures I was having. - last update
10 months ago 26,021 pass, 1,827 fail - last update
10 months ago Build Successful - π¨π¦Canada Liam Morland Ontario, CA π¨π¦
I have updated the tests so that they pass with the changes.
- π¨π¦Canada joseph.olstad
@Liam Morland, while the tests are passing on the merge request, it's not apparent which database system is being tested. It would be good to just make sure that MariaDB/Mysql/Sqlite are also passing and also all versions of PostgreSQL. With the MR test, it wasn't obvious which setup was being tested (maybe I'm missing something?).
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
I have run the tests on all the platforms available in the pipelines. They have all passed.
- π³π±Netherlands Lendude Amsterdam
Can we use \Drupal\views\Plugin\views\join\CastedIntFieldJoin for this and avoid adding pgsql specific code to base plugins?
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
It looks like it will be deprecated: π [PP-1] Deprecate and remove Drupal\views\Plugin\views\join\CastedIntFieldJoin Postponed .
By its name, it sounds like it would cast to
int
. The merge request has it casting totext
because entity identifiers are not always integers. - π¨π¦Canada Liam Morland Ontario, CA π¨π¦
Current changes without the test updates.
- last update
10 months ago 25,855 pass, 1,777 fail - last update
10 months ago 25,865 pass, 1,773 fail - πΊπΈUnited States smustgrave
Hiding patches for clarity.
Leaving in NR as seems desire is/was to move pgsql specific code out of base
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
Where would you suggest this code be put?
- π¨π¦Canada joseph.olstad
@smustgrave , the approach suggsested to move pgsql specific code out of base was deprecated.
see comment #35
[#307953-35] - Status changed to Needs work
10 months ago 7:05am 31 January 2024 - π³π±Netherlands Lendude Amsterdam
Well if there is a use for it, we can always undeprecate it (or in this case, never deprecate it in the first place), or if it needs a string version of this we should add a string version and put it in the pgsql module where this seems to belong (is PostgreSQL the exception here or is MySQL? How does SQLite handle this?)
Also, I think the general consensus is that int joins are more performant than string joins, so what performance impact does casting everything to a string have? We should check.
How is this handled outside Views? It's not like Views is the only place you can make joins. Is there maybe some method we could/should add to the database drivers that handles this?
I would like to see test coverage added that actually shows we need this, so something that would fail without this fix. All the modified test coverage changes only show that the ':text' is added and this doesn't break existing queries.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
At the moment, Postgres is the exception, though I think that it is doing it more correct under the SQL standard. I don't know what SQLite does.
I ran into this problem as described in #2864440: PostgreSQL problems on entity_id of type varchar with flagging and flag_count tables β . Other related issues describe how this has surfaced.
The problem is that
id
columns can be either string or integer. If there is a way to of knowing which it is then it could use integer casting when that is possible.