PT-144 Fixed Constraint name is too long

This commit is contained in:
Carlos Salguero
2017-05-23 12:33:55 -03:00
parent 43b50f8a8c
commit 38702783a4
3 changed files with 105 additions and 0 deletions

View File

@@ -10215,6 +10215,8 @@ sub create_new_table {
);
my $constraint_pattern = qr((CONSTRAINT `__|CONSTRAINT `_|CONSTRAINT `));
$sql =~ s/$constraint_pattern/$search_dict{$1}/gm;
# Limit constraint name to 64 characters
$sql =~ s/CONSTRAINT `([^`]{1,64})[^`]*` (.*)/ CONSTRAINT `$1` $2/gm;
if ( $o->get('default-engine') ) {
$sql =~ s/\s+ENGINE=\S+//;