diff options
author | unknown <msvensson@pilot.mysql.com> | 2007-11-01 11:02:28 +0100 |
---|---|---|
committer | unknown <msvensson@pilot.mysql.com> | 2007-11-01 11:02:28 +0100 |
commit | d58971bc5dc87af07fdcb5f8f7a707aa0742a07d (patch) | |
tree | bfff98a1463711e24c5ee68c0a8a06e01392a1d9 /mysql-test/lib | |
parent | c42376b4ba37c8425604611a35637d4bd58d12a1 (diff) | |
download | mariadb-git-d58971bc5dc87af07fdcb5f8f7a707aa0742a07d.tar.gz |
Bug#27753 enable mysql-test-run.pl to ignore tests based on wildcard
- Fix problem in first implementation
mysql-test/lib/mtr_cases.pl:
Prepend a ^ to the regex only if _all_ charactersin the pattern are normal
Diffstat (limited to 'mysql-test/lib')
-rw-r--r-- | mysql-test/lib/mtr_cases.pl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 5aabb7f8863..b9943fb6cfa 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -32,16 +32,14 @@ my $skip_test; sub init_pattern { my ($from, $what)= @_; - if ( $from =~ /[a-z0-9]/ ) { + if ( $from =~ /^[a-z0-9]$/ ) { # Does not contain any regex, make the pattern match # beginning of string $from= "^$from"; } - else { - # Check that pattern is a valid regex - eval { "" =~/$from/; 1 } or - mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); - } + # Check that pattern is a valid regex + eval { "" =~/$from/; 1 } or + mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); return $from; } |