diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php index 61fd621..e633659 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php @@ -21,33 +21,7 @@ public function orderRandom() { } /** - * Overrides SelectQuery::orderBy(). - * - * PostgreSQL adheres strictly to the SQL-92 standard and requires that when - * using DISTINCT or GROUP BY conditions, fields and expressions that are - * ordered on also need to be selected. This is a best effort implementation - * to handle the cases that can be automated by adding the field if it is not - * yet selected. - * - * @code - * $query = db_select('example', 'e'); - * $query->join('example_revision', 'er', 'e.vid = er.vid'); - * $query - * ->distinct() - * ->fields('e') - * ->orderBy('timestamp'); - * @endcode - * - * In this query, it is not possible (without relying on the schema) to know - * whether timestamp belongs to example_revision and needs to be added or - * belongs to node and is already selected. Queries like this will need to be - * corrected in the original query by adding an explicit call to - * SelectQuery::addField() or SelectQuery::fields(). - * - * Since this has a small performance impact, both by the additional - * processing in this function and in the database that needs to return the - * additional fields, this is done as an override instead of implementing it - * directly in SelectQuery::orderBy(). + * {@inheritdoc} */ public function orderBy($field, $direction = 'ASC') { // Only allow ASC and DESC, default to ASC. diff --git a/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php b/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php index b6fea3f..a5535b4 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php @@ -173,7 +173,7 @@ function testInsertSelectFields() { } /** - * Tests that the INSERT INTO ... SELECT (fields) ... with ORDER BY. + * Tests INSERT INTO ... SELECT (fields) ... with ORDER BY. */ function testInsertSelectFieldsOrderby() { $query = db_select('test', 't')