Skip to content
Snippets Groups Projects
Unverified Commit 660152c4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2921665 by RoSk0, daffie: PostgreSQL: Optimize getting maxIdentifierLength

parent 925b4b56
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -68,7 +68,9 @@ protected function ensureIdentifiersLength($identifier) {
// Retrieve the max identifier length which is usually 63 characters
// but can be altered before PostgreSQL is compiled so we need to check.
$this->maxIdentifierLength = $this->connection->query("SHOW max_identifier_length")->fetchField();
if (empty($this->maxIdentifierLength)) {
$this->maxIdentifierLength = $this->connection->query("SHOW max_identifier_length")->fetchField();
}
if (strlen($identifierName) > $this->maxIdentifierLength) {
$saveIdentifier = '"drupal_' . $this->hashBase64($identifierName) . '_' . $args[2] . '"';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment