Select queries do not escape the GROUP BY fields

Created on 8 January 2021, almost 4 years ago
Updated 7 February 2023, almost 2 years ago

Problem/Motivation

Views aggregate queries do not escape the fields that is argument of the aggregation function, nor of the GROUP BY part.

See example below, from Drupal\Tests\views\Kernel\QueryGroupByTest:

SELECT "entity_test"."id" AS "id", "entity_test"."langcode" AS "entity_test_langcode", MIN(entity_test.name) AS "entity_test_name", MIN(entity_test.id) AS "id_1"\n
FROM\n
{entity_test} "entity_test"\n
GROUP BY entity_test.id, entity_test_langcode\n
LIMIT 10 OFFSET 0

it is mixing up quoted and non quoted identifiers, now all identifiers should be quoted.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Fixed

Version

9.5

Component
Database 

Last updated 3 days ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024