diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php index 72aeafcd42e8a2ffda5167e5a54fa69213970723..e05f10c86eb0e6b2ba969546a66e4424f2c31921 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php @@ -659,11 +659,11 @@ public function getComment($table, $column = NULL) { $condition->condition('column_name', $column); $condition->compile($this->connection, $this); // Don't use {} around information_schema.columns table. - return $this->connection->query("SELECT column_comment as column_comment FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField(); + return $this->connection->query("SELECT column_comment AS column_comment FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField(); } $condition->compile($this->connection, $this); // Don't use {} around information_schema.tables table. - $comment = $this->connection->query("SELECT table_comment as table_comment FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField(); + $comment = $this->connection->query("SELECT table_comment AS table_comment FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField(); // Work-around for MySQL 5.0 bug http://bugs.mysql.com/bug.php?id=11379 return preg_replace('/; InnoDB free:.*$/', '', $comment); } diff --git a/core/lib/Drupal/Core/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php index a34b06e749139a0d90422ed28826b302dc0b13d9..fe932d3bce9b58b3e7efd43663c0c7f52abe5606 100644 --- a/core/lib/Drupal/Core/Database/Schema.php +++ b/core/lib/Drupal/Core/Database/Schema.php @@ -200,7 +200,7 @@ public function findTables($table_expression) { // couldn't use \Drupal::database()->select() here because it would prefix // information_schema.tables and the query would fail. // Don't use {} around information_schema.tables table. - $results = $this->connection->query("SELECT table_name as table_name FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments()); + $results = $this->connection->query("SELECT table_name AS table_name FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments()); foreach ($results as $table) { // Take into account tables that have an individual prefix. if (isset($individually_prefixed_tables[$table->table_name])) { diff --git a/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php b/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php index 2e4280f5a25f26643178c7c18480439b18ac1f19..674eb04d76532242cb8b61f75895595a7395ea45 100644 --- a/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php +++ b/core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php @@ -44,7 +44,7 @@ public function query() { // Add in the property, which is either title or body. Cast the bid to text // so PostgreSQL can make the join. - $query->leftJoin(static::I18N_STRING_TABLE, 'i18n', 'i18n.objectid = CAST(b.bid as CHAR(255))'); + $query->leftJoin(static::I18N_STRING_TABLE, 'i18n', 'i18n.objectid = CAST(b.bid AS CHAR(255))'); $query->condition('i18n.type', 'block'); // Add in the translation for the property. diff --git a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php index 2555b7be8890e3432231fa48b7087275bb1d994f..56da2b3df97f2449fc4a495c572e33bd4e018643 100644 --- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php +++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php @@ -155,7 +155,7 @@ public function preRender(&$values) { } if ($nids) { - $result = $this->database->query("SELECT n.nid, COUNT(c.cid) as num_comments FROM {node} n INNER JOIN {comment_field_data} c ON n.nid = c.entity_id AND c.entity_type = 'node' AND c.default_langcode = 1 + $result = $this->database->query("SELECT n.nid, COUNT(c.cid) AS num_comments FROM {node} n INNER JOIN {comment_field_data} c ON n.nid = c.entity_id AND c.entity_type = 'node' AND c.default_langcode = 1 LEFT JOIN {history} h ON h.nid = n.nid AND h.uid = :h_uid WHERE n.nid IN ( :nids[] ) AND c.changed > GREATEST(COALESCE(h.timestamp, :timestamp1), :timestamp2) AND c.status = :status GROUP BY n.nid", [ ':status' => CommentInterface::PUBLISHED, diff --git a/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php b/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php index 045020d3850e3d0c8ca723ad6302516299f4b24a..2e0767a83b39c0c1087453b9c62fc33513851e01 100644 --- a/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php +++ b/core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php @@ -40,7 +40,7 @@ public function query() { // Add in the property, which is either title or description. Cast the mlid // to text so PostgreSQL can make the join. - $query->leftJoin(static::I18N_STRING_TABLE, 'i18n', 'CAST(ml.mlid as CHAR(255)) = i18n.objectid'); + $query->leftJoin(static::I18N_STRING_TABLE, 'i18n', 'CAST(ml.mlid AS CHAR(255)) = i18n.objectid'); $query->addField('i18n', 'lid'); $query->addField('i18n', 'property'); diff --git a/core/modules/user/src/Plugin/views/field/Roles.php b/core/modules/user/src/Plugin/views/field/Roles.php index c1cd8969e898f4b4250ca84c87e4f346b714d456..27a3ecc015fe36c902f8fa51ed3d7638ce3c9b48 100644 --- a/core/modules/user/src/Plugin/views/field/Roles.php +++ b/core/modules/user/src/Plugin/views/field/Roles.php @@ -73,7 +73,7 @@ public function preRender(&$values) { if ($uids) { $roles = user_roles(); - $result = $this->database->query('SELECT u.entity_id as uid, u.roles_target_id as rid FROM {user__roles} u WHERE u.entity_id IN ( :uids[] ) AND u.roles_target_id IN ( :rids[] )', [':uids[]' => $uids, ':rids[]' => array_keys($roles)]); + $result = $this->database->query('SELECT u.entity_id AS uid, u.roles_target_id AS rid FROM {user__roles} u WHERE u.entity_id IN ( :uids[] ) AND u.roles_target_id IN ( :rids[] )', [':uids[]' => $uids, ':rids[]' => array_keys($roles)]); foreach ($result as $role) { $this->items[$role->uid][$role->rid]['role'] = $roles[$role->rid]->label(); $this->items[$role->uid][$role->rid]['rid'] = $role->rid;