TT#187700 Support regex in exceptions

Currently we have diff in all tables of 'mysql' schema:
========================
Schema1: transactional=1
Schema2: page_checksum=1 transactional=1
========================

This is harmless diff investigated in TT#108653

So to skip all the specific entities instead of comparing every element
just use regex matching.

This is logical cherry-pick from
4c8443a182 without new exceptions.

Change-Id: I2c6e2bc369ee785d952fe43f97086f30afa282f0
mr8.5.10
Mykola Malkov 4 years ago
parent bcd499426d
commit 61c2fc8128

@ -14,10 +14,12 @@ use Carp;
# schema-name - name of the schema
# element-name - name of the element (table, index, etc)
# element-attribute - engine for the table, is_nullable for the column, etc
# Perl regex can be used here
# F.e.:
# views/ldap/ldap_entries/view_definition
# For columns: columns/<schema-name>/<table-name>_<column-name>
# columns/billing/table1_column1/is_nullable
# tables/mysql/.+/create_options
my @diff_exceptions = qw(
views/ldap/ldap_entries/view_definition
);
@ -233,19 +235,13 @@ __USAGE__
}
sub is_exception {
my ($exceptions, $type, $schema, $element, $attr) = @_;
my $exceptions, $type, $schema, $element, $attr) = @_;
$attr //= '';
foreach my $exception (@{$exceptions}) {
# 'views/ldap/ldap_entries/view_definition'
my ($e_type, $e_schema, $e_element, $e_attr) = split( /\//, $exception );
$e_attr //= '';
if ( lc($element) eq lc($e_element)
and lc($type) eq lc($e_type)
and lc($schema) eq lc($e_schema)
and lc($attr) eq lc($e_attr) )
{
print {*STDERR} "Exception found: $e_type/$e_schema/$e_element/$e_attr\n";
if ( lc("$type/$schema/$element/$attr") =~ $exception ) {
print {*STDERR} "Exception found: $exception\n";
return 1;
}
}

Loading…
Cancel
Save