line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pgtools::Fingerprint; |
2
|
1
|
|
|
1
|
|
35769
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
339
|
use parent qw(Class::Accessor); |
|
1
|
|
|
|
|
255
|
|
|
1
|
|
|
|
|
3
|
|
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
|
|
|
|
|
|
|
|