line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pgtools::Fingerprint; |
2
|
1
|
|
|
1
|
|
35695
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
342
|
use parent qw(Class::Accessor); |
|
1
|
|
|
|
|
227
|
|
|
1
|
|
|
|
|
4
|
|
5
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(file query)); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use File::Spec; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub exec { |
10
|
|
|
|
|
|
|
my ($self, $query, $filename) = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
if($query ne "") { |
13
|
|
|
|
|
|
|
$query = &symbolize_query($self, $query); |
14
|
|
|
|
|
|
|
&print_queries($self, $query); |
15
|
|
|
|
|
|
|
return; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
$filename = File::Spec->rel2abs($filename); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
open(my $in, '<', $filename) or die "$!"; |
20
|
|
|
|
|
|
|
while(<$in>) { |
21
|
|
|
|
|
|
|
chomp $_; |
22
|
|
|
|
|
|
|
$_ = &symbolize_query($self, $_); |
23
|
|
|
|
|
|
|
&print_queries($self, $_); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub symbolize_query { |
28
|
|
|
|
|
|
|
my ($self, $q) = @_; |
29
|
|
|
|
|
|
|
$q =~ s/([\s<>=])([-\+])?[.0123456789]+/$1?/g; |
30
|
|
|
|
|
|
|
$q =~ s/(true|false)/?/ig; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return $q; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub print_queries { |
36
|
|
|
|
|
|
|
my ($self, $query) = @_; |
37
|
|
|
|
|
|
|
print $query."\n"; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|