From 31fefa0605302ccbc57309fbf34eaacc34b0b18c Mon Sep 17 00:00:00 2001 From: Amiel Montecillo Date: Sun, 15 Jan 2017 21:06:16 -0800 Subject: [PATCH] Compatibility for older perl versions --- bin/pt-online-schema-change | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 2cce5778..a542bd90 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -10108,7 +10108,8 @@ sub create_new_table { 'CONSTRAINT `_' => 'CONSTRAINT `__', 'CONSTRAINT `' => 'CONSTRAINT `_' ); - $sql =~ s/((?^:CONSTRAINT `__|CONSTRAINT `_|CONSTRAINT `))/$search_dict{$1}/gm; + my $constraint_pattern = qr((CONSTRAINT `__|CONSTRAINT `_|CONSTRAINT `)); + $sql =~ s/$constraint_pattern/$search_dict{$1}/gm; if ( $o->get('default-engine') ) { $sql =~ s/\s+ENGINE=\S+//;