Merged use-lmo.

This commit renames our fork of Mo to Lmo, since the two have diverged
a huge deal. The merged branch streamlined Lmo a great deal as well,
for maintainability.
This commit is contained in:
Brian Fraser
2013-02-11 21:19:56 -03:00
56 changed files with 8158 additions and 4952 deletions

View File

@@ -3001,7 +3001,7 @@ sub check_table {
die "I need a $arg argument" unless $args{$arg};
}
my ($dbh, $db, $tbl) = @args{@required_args};
my $q = $self->{Quoter};
my $q = $self->{Quoter} || 'Quoter';
my $db_tbl = $q->quote($db, $tbl);
PTDEBUG && _d('Checking', $db_tbl);
@@ -3211,24 +3211,26 @@ use Time::Local qw(timegm timelocal);
use Digest::MD5 qw(md5_hex);
use B qw();
require Exporter;
our @ISA = qw(Exporter);
our %EXPORT_TAGS = ();
our @EXPORT = ();
our @EXPORT_OK = qw(
micro_t
percentage_of
secs_to_time
time_to_secs
shorten
ts
parse_timestamp
unix_timestamp
any_unix_timestamp
make_checksum
crc32
encode_json
);
BEGIN {
require Exporter;
our @ISA = qw(Exporter);
our %EXPORT_TAGS = ();
our @EXPORT = ();
our @EXPORT_OK = qw(
micro_t
percentage_of
secs_to_time
time_to_secs
shorten
ts
parse_timestamp
unix_timestamp
any_unix_timestamp
make_checksum
crc32
encode_json
);
}
our $mysql_ts = qr/(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)(\.\d+)?/;
our $proper_ts = qr/(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)(\.\d+)?/;
@@ -4434,61 +4436,6 @@ sub fingerprint {
my ($explain) = @args{@required_args};
}
sub sparkline {
my ( $self, %args ) = @_;
my @required_args = qw(explain);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless defined $args{$arg};
}
my ($explain) = @args{@required_args};
PTDEBUG && _d("Making sparkline for", Dumper($explain));
my $access_code = {
'ALL' => 'a',
'const' => 'c',
'eq_ref' => 'e',
'fulltext' => 'f',
'index' => 'i',
'index_merge' => 'm',
'range' => 'n',
'ref_or_null' => 'o',
'ref' => 'r',
'system' => 's',
'unique_subquery' => 'u',
};
my $sparkline = '';
my ($T, $F); # Using temporary, Using filesort
foreach my $tbl ( @$explain ) {
my $code;
if ( defined $tbl->{type} ) {
$code = $access_code->{$tbl->{type}} || "?";
$code = uc $code if $tbl->{Extra}->{'Using index'};
}
else {
$code = '-'
};
$sparkline .= $code;
$T = 1 if $tbl->{Extra}->{'Using temporary'};
$F = 1 if $tbl->{Extra}->{'Using filesort'};
}
if ( $T || $F ) {
if ( $explain->[-1]->{Extra}->{'Using temporary'}
|| $explain->[-1]->{Extra}->{'Using filesort'} ) {
$sparkline .= ">" . ($T ? "T" : "") . ($F ? "F" : "");
}
else {
$sparkline = ($T ? "T" : "") . ($F ? "F" : "") . ">$sparkline";
}
}
PTDEBUG && _d("sparkline:", $sparkline);
return $sparkline;
}
sub _d {
my ($package, undef, $line) = caller 0;
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }