Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a196adac
Commit
a196adac
authored
Nov 29, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert bad merge, should have used local code
parent
9e96081e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
64 deletions
+65
-64
mysql-test/lib/mtr_cases.pl
mysql-test/lib/mtr_cases.pl
+65
-64
No files found.
mysql-test/lib/mtr_cases.pl
View file @
a196adac
...
@@ -345,73 +345,74 @@ sub collect_one_suite($)
...
@@ -345,73 +345,74 @@ sub collect_one_suite($)
# Read combinations for this suite and build testcases x combinations
# Read combinations for this suite and build testcases x combinations
# if any combinations exists
# if any combinations exists
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
if
(
0
and
$combinations
&&
$begin_index
<=
$#
{
@$cases
})
if
(
!
$::opt_skip_combination
)
{
{
my
$end_index
=
$#
{
@$cases
};
my
@combinations
;
my
$is_copy
;
my
$combination_file
=
"
$suitedir
/combinations
";
# Keep original master/slave options
#print "combination_file: $combination_file\n";
my
@orig_opts
;
if
(
@::opt_combinations
)
for
(
my
$idx
=
$begin_index
;
$idx
<=
$end_index
;
$idx
++
)
{
{
# take the combination from command-line
foreach
my
$param
(('
master_opt
','
slave_opt
','
slave_mi
'))
mtr_verbose
("
Take the combination from command line
");
{
foreach
my
$combination
(
@::opt_combinations
)
{
@
{
$orig_opts
[
$idx
]{
$param
}}
=
@
{
$cases
->
[
$idx
]
->
{
$param
}};
my
$comb
=
{};
$comb
->
{
name
}
=
$combination
;
push
(
@
{
$comb
->
{
comb_opt
}},
$combination
);
push
(
@combinations
,
$comb
);
}
}
elsif
(
-
f
$combination_file
)
{
# Read combinations file in my.cnf format
mtr_verbose
("
Read combinations file
");
my
$config
=
My::
Config
->
new
(
$combination_file
);
foreach
my
$group
(
$config
->
groups
())
{
my
$comb
=
{};
$comb
->
{
name
}
=
$group
->
name
();
foreach
my
$option
(
$group
->
options
()
)
{
push
(
@
{
$comb
->
{
comb_opt
}},
$option
->
name
()
.
"
=
"
.
$option
->
value
());
}
push
(
@combinations
,
$comb
);
}
}
}
}
my
$comb_index
=
1
;
# Copy original test cases
if
(
@combinations
)
foreach
my
$comb_set
(
@$combinations
)
{
{
print
"
- adding combinations
\n
";
for
(
my
$idx
=
$begin_index
;
$idx
<=
$end_index
;
$idx
++
)
#print_testcases(@cases);
my
@new_cases
;
foreach
my
$comb
(
@combinations
)
{
{
my
$test
=
$cases
->
[
$idx
];
foreach
my
$test
(
@cases
)
my
$copied_test
=
{};
{
foreach
my
$param
(
keys
%
{
$test
})
#print $test->{name}, " ", $comb, "\n";
{
my
$new_test
=
{};
# Scalar. Copy as is.
$copied_test
->
{
$param
}
=
$test
->
{
$param
};
while
(
my
(
$key
,
$value
)
=
each
(
%
$test
))
{
# Array. Copy reference instead itself
if
(
ref
$value
eq
"
ARRAY
")
{
if
(
$param
=~
/(master_opt|slave_opt|slave_mi)/
)
push
(
@
{
$new_test
->
{
$key
}},
@$value
);
{
}
else
{
my
$new_arr
=
[]
;
$new_test
->
{
$key
}
=
$value
;
@$new_arr
=
@
{
$orig_opts
[
$idx
]{
$param
}};
}
$copied_test
->
{
$param
}
=
$new_arr
;
}
}
elsif
(
$param
=~
/(comment|combinations)/
)
# Append the combination options to master_opt and slave_opt
{
push
(
@
{
$new_test
->
{
master_opt
}},
@
{
$comb
->
{
comb_opt
}});
$copied_test
->
{
$param
}
=
'';
push
(
@
{
$new_test
->
{
slave_opt
}},
@
{
$comb
->
{
comb_opt
}});
}
}
# Add combination name shrt name
if
(
$is_copy
)
$new_test
->
{
combination
}
=
$comb
->
{
name
};
{
push
(
@$cases
,
$copied_test
);
# Add the new test to new test cases list
$test
=
$cases
->
[
$#
{
@$cases
}];
push
(
@new_cases
,
$new_test
);
}
}
foreach
my
$comb_opt
(
split
(
/ /
,
$comb_set
))
}
{
#print_testcases(@new_cases);
push
(
@
{
$test
->
{'
master_opt
'}},
$comb_opt
);
@cases
=
@new_cases
;
push
(
@
{
$test
->
{'
slave_opt
'}},
$comb_opt
);
#print_testcases(@cases);
# Enable rpl if added option is --binlog-format and test case supports that
}
if
(
$comb_opt
=~
/^--binlog-format=.+$/
)
{
my
@opt_pairs
=
split
(
/=/
,
$comb_opt
);
if
(
$test
->
{'
binlog_format
'}
=~
/^$opt_pairs[1]$/
||
$test
->
{'
binlog_format
'}
eq
'')
{
$test
->
{'
skip
'}
=
0
;
$test
->
{'
comment
'}
=
'';
}
else
{
$test
->
{'
skip
'}
=
1
;
$test
->
{'
comment
'}
=
"
Requiring binlog format '
$test
->{'binlog_format'}'
";;
}
}
}
$test
->
{'
combination
'}
=
$comb_set
;
}
$is_copy
=
1
;
$comb_index
++
;
}
}
}
optimize_cases
(
\
@cases
);
optimize_cases
(
\
@cases
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment