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.

Change-Id: I3b9a38c3fbf055724139cbf4b476117b90edbefe
mr11.0
Mykola Malkov 3 years ago
parent d6f5861edf
commit 4c8443a182

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

Loading…
Cancel
Save