Change record status: 
Project: 
Introduced in branch: 
9.2.x
Introduced in version: 
9.2.0
Description: 

Passing a Drupal\Core\Database\StatementInterface object to Drupal\Core\Database\Connection::query() is deprecated in Drupal 9.2 and will be enforced in Drupal 10.0. The method now only allows string values for the parameter $query.

This is deprecated:

  $db = \Drupal\Core\Database\Database::getConnection();
  $stmt = $db->prepareStatement('SELECT * FROM {test}', []);
  $result = $db->query($stmt);

Calling the method Drupal\Core\Database\Connection::query() like this is fully supported:

  $db = \Drupal\Core\Database\Database::getConnection();
  $result = $db->query('SELECT * FROM {test}');
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done