Skip to content

Commit 08972b4

Browse files
committed
Fix issue #22240
Create short name for Database Lock name
1 parent dac1ea5 commit 08972b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/Magento/Framework/Lock/Backend/Database.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\Exception\AlreadyExistsException;
1414
use Magento\Framework\Exception\InputException;
1515
use Magento\Framework\Phrase;
16+
use Magento\Framework\DB\ExpressionConverter;
1617

1718
/**
1819
* Implementation of the lock manager on the basis of MySQL.
@@ -166,7 +167,8 @@ public function isLocked(string $name): bool
166167
*/
167168
private function addPrefix(string $name): string
168169
{
169-
$name = $this->getPrefix() . '|' . $name;
170+
$prefix = $this->getPrefix() . '|';
171+
$name = ExpressionConverter::shortenEntityName($prefix . $name, $prefix);
170172

171173
if (strlen($name) > 64) {
172174
throw new InputException(new Phrase('Lock name too long: %1...', [substr($name, 0, 64)]));

0 commit comments

Comments
 (0)