1#################### Perl module starts ####################
2perl;
3my $d_dir = $ENV{'datadir'};
4my $s_pattern = $ENV{'search_pattern'};
5my $filename = $ENV{'ts_name'};
6my $ts_filename="$d_dir/$filename";
7open TS_FILE, "<$ts_filename" or die "$!";
8@lines = <TS_FILE>;
9close TS_FILE;
10
11my $vardir = $ENV{'MYSQLTEST_VARDIR'};
12my $filename="$vardir/tmpfile.txt";
13open(OP_FILE, '>', $filename) or die "$!";
14
15my $found = 0;
16foreach $line (@lines) {
17        chomp( $line );
18        print OP_FILE;
19        if($line =~ /$s_pattern/) {
20                $found=1;
21        }
22}
23
24if ($found == 1) {
25        print OP_FILE "table space is Unencrypted.\n";
26} else {
27        print OP_FILE "table space is Encrypted.\n";
28}
29
30close OP_FILE;
31EOF
32#################### Perl module ends ####################
33
34--echo # Print result
35cat_file $MYSQLTEST_VARDIR/tmpfile.txt;
36
37