--- /core/lib/Drupal/Core/Database/Connection.php +++ /core/lib/Drupal/Core/Database/Connection.php @@ -1153,7 +1153,11 @@ */ public function escapeTable($table) { if (!isset($this->escapedTables[$table])) { - $this->escapedTables[$table] = preg_replace('/[^A-Za-z0-9_.]+/', '', $table); + $escaped = preg_replace('/[^A-Za-z0-9_.-]+/', '', $table); + [$start_quote, $end_quote] = $this->identifierQuotes; + // Add quotes to every value between separators if it's present. + $this->escapedTables[$table] = strpos($escaped, '.') === FALSE ? + $escaped : $start_quote . str_replace('.', $end_quote . '.' . $start_quote, $escaped) . $end_quote; } return $this->escapedTables[$table]; }