Skip to content

Commit 4d423ca

Browse files
author
Ivan Gavryshko
committed
MAGETWO-43906: Long database prefix length breaks setup
- fixed
1 parent 1d97cd9 commit 4d423ca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setup/src/Magento/Setup/Validator/DbValidator.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class DbValidator
1717
{
18+
19+
const DB_PREFIX_LENGTH = 10;
20+
1821
/**
1922
* DB connection factory
2023
*
@@ -47,6 +50,12 @@ public function checkDatabaseTablePrefix($prefix)
4750
throw new \InvalidArgumentException('Please correct the table prefix format.');
4851
}
4952

53+
if (strlen($prefix) > self::DB_PREFIX_LENGTH) {
54+
throw new \InvalidArgumentException(
55+
'Table prefix length can\'t be more then ' . self::DB_PREFIX_LENGTH . ' characters.'
56+
);
57+
}
58+
5059
return true;
5160
}
5261

0 commit comments

Comments
 (0)