--- 1349080-459.patch 2021-01-06 16:05:21.918662700 +0100 +++ 1349080-477.patch 2021-01-06 16:10:07.213708200 +0100 @@ -1,5 +1,5 @@ diff --git a/core/modules/node/src/NodeGrantDatabaseStorage.php b/core/modules/node/src/NodeGrantDatabaseStorage.php -index 347916e235..d8a4eb7bd7 100644 +index 155c480b8e..39609890e7 100644 --- a/core/modules/node/src/NodeGrantDatabaseStorage.php +++ b/core/modules/node/src/NodeGrantDatabaseStorage.php @@ -3,6 +3,7 @@ @@ -43,7 +43,7 @@ if (!($table instanceof SelectInterface) && $table == $base_table) { @@ -191,7 +205,26 @@ public function alterQuery($query, array $tables, $op, AccountInterface $account // Now handle entities. - $subquery->where("$nalias.$field = na.nid"); + $subquery->where("[$nalias].[$field] = [na].[nid]"); - $query->exists($subquery); + if (empty($tableinfo['join type']) || empty($tables_ref[$nalias]['join type'])) {