The file EntityResourceTestBase.php uses a static query.

$cache_items = $this->container->get('database')
      ->query("SELECT cid, data FROM {cache_dynamic_page_cache} WHERE cid LIKE :pattern", [
        ':pattern' => '%[route]=rest.%',
      ])
      ->fetchAllAssoc('cid');

SQL Server uses square brackets as an escape character in LIKE clauses. The following would be equivalent, yet allow contrib database drivers to alter the query as needed.

$cache_items = $this->container->get('database')
      ->select('cache_dynamic_page_cache', 'c')
      ->fields('c', ['cid', 'data'])
      ->condition('c.cid', '%[route]=rest.%', 'LIKE')
      ->execute()
      ->fetchAllAssoc('cid');
CommentFileSizeAuthor
#4 3122605-4.patch1.05 KBbeakerboy
#2 3122605-2.patch1.05 KBbeakerboy

Comments

Beakerboy created an issue. See original summary.

beakerboy’s picture

Status: Active » Needs review
StatusFileSize
new1.05 KB

Patch included

beakerboy’s picture

Assigned: beakerboy » Unassigned
beakerboy’s picture

StatusFileSize
new1.05 KB

Patch for 8.8.x

daffie’s picture

Category: Feature request » Task
Status: Needs review » Reviewed & tested by the community

I think that we best can place this issue as a task.

The patch looks good and fixed the problem for SQL Server.
The query does not change, only from static to dynamic.
For me it is RTBC.

  • catch committed 85319eb on 9.1.x
    Issue #3122605 by Beakerboy, daffie: EntityResourceTestBase.php uses a...

  • catch committed 630e18e on 9.0.x
    Issue #3122605 by Beakerboy, daffie: EntityResourceTestBase.php uses a...

  • catch committed 80c9285 on 8.9.x
    Issue #3122605 by Beakerboy, daffie: EntityResourceTestBase.php uses a...

  • catch committed 37f44bc on 8.8.x
    Issue #3122605 by Beakerboy, daffie: EntityResourceTestBase.php uses a...
catch’s picture

Version: 9.0.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Fixed

Committe/pushed to 9.1.x and cherry-picked all the way down to 8.8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.