mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
fixed 5.7 tests for pt-query-digest and pt-show-grants and tweaked SqlMode for global
This commit is contained in:
@@ -39,14 +39,21 @@ use Data::Dumper;
|
||||
# SqlModes object
|
||||
|
||||
sub new {
|
||||
my ( $class, $dbh ) = @_;
|
||||
my ( $class, $dbh, %args ) = @_;
|
||||
die "I need a database handle" unless $dbh;
|
||||
|
||||
my $global = $args{'global'} ? 'GLOBAL' : '';
|
||||
|
||||
my $self = {
|
||||
dbh => $dbh,
|
||||
global => $global,
|
||||
original_modes_string => '',
|
||||
};
|
||||
|
||||
return bless $self, $class;
|
||||
bless $self, $class;
|
||||
|
||||
$self->{original_modes_string} = $self->get_modes_string();
|
||||
return $self;
|
||||
}
|
||||
|
||||
# Sub: add
|
||||
@@ -71,7 +78,7 @@ sub add {
|
||||
|
||||
my $sql_mode_string = join ",", keys %$curr_modes;
|
||||
|
||||
$self->{dbh}->do("set sql_mode = '$sql_mode_string'") || return 0;
|
||||
$self->{dbh}->do("set $self->{global} sql_mode = '$sql_mode_string'") || return 0;
|
||||
|
||||
PTDEBUG && _d('sql_mode changed to: ', $sql_mode_string);
|
||||
return $curr_modes;
|
||||
@@ -99,7 +106,7 @@ sub del {
|
||||
|
||||
my $sql_mode_string = join ",", keys %$curr_modes;
|
||||
|
||||
$self->{dbh}->do("set sql_mode = '$sql_mode_string'") || return 0;
|
||||
$self->{dbh}->do("SET $self->{global} sql_mode = '$sql_mode_string'") || return 0;
|
||||
|
||||
PTDEBUG && _d('sql_mode changed to: ', $sql_mode_string);
|
||||
return $curr_modes || 1;
|
||||
@@ -149,6 +156,40 @@ sub get_modes {
|
||||
return \%modes;
|
||||
}
|
||||
|
||||
# Sub: get_modes_string
|
||||
# get current set of sql modes as string
|
||||
#
|
||||
# Required Arguments:
|
||||
# none
|
||||
#
|
||||
# Returns:
|
||||
# sql_modes as a string (coma separated values)
|
||||
sub get_modes_string {
|
||||
my ( $self ) = @_;
|
||||
|
||||
my (undef, $sql_mode_string) = $self->{dbh}->selectrow_array("show variables like 'sql_mode'");
|
||||
|
||||
return $sql_mode_string;
|
||||
}
|
||||
|
||||
# Sub: restore_original_modes
|
||||
# resets sql_mode to the state it was when object was created
|
||||
#
|
||||
# Required Arguments:
|
||||
# none
|
||||
#
|
||||
# Returns:
|
||||
# original sql_mode as a string
|
||||
sub restore_original_modes {
|
||||
my ( $self ) = @_;
|
||||
|
||||
$self->{dbh}->do("SET $self->{global} sql_mode = '$self->{original_modes_string}'");
|
||||
|
||||
return $self->{original_modes_string};
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub _d {
|
||||
my ($package, undef, $line) = caller 0;
|
||||
@_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
|
||||
|
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/columns_priv.MYD
Normal file
0
sandbox/servers/5.7/data/mysql/columns_priv.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/columns_priv.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/columns_priv.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/columns_priv.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/columns_priv.frm
Normal file
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/db.MYD
Normal file
0
sandbox/servers/5.7/data/mysql/db.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/db.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/db.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/db.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/db.frm
Normal file
Binary file not shown.
2
sandbox/servers/5.7/data/mysql/db.opt
Normal file
2
sandbox/servers/5.7/data/mysql/db.opt
Normal file
@@ -0,0 +1,2 @@
|
||||
default-character-set=latin1
|
||||
default-collation=latin1_swedish_ci
|
0
sandbox/servers/5.7/data/mysql/event.MYD
Normal file
0
sandbox/servers/5.7/data/mysql/event.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/event.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/event.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/event.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/event.frm
Normal file
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/func.MYD
Normal file
0
sandbox/servers/5.7/data/mysql/func.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/func.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/func.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/func.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/func.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/general_log.CSM
Normal file
BIN
sandbox/servers/5.7/data/mysql/general_log.CSM
Normal file
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/general_log.CSV
Normal file
0
sandbox/servers/5.7/data/mysql/general_log.CSV
Normal file
|
BIN
sandbox/servers/5.7/data/mysql/general_log.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/general_log.frm
Normal file
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/ndb_binlog_index.MYD
Normal file
0
sandbox/servers/5.7/data/mysql/ndb_binlog_index.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/ndb_binlog_index.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/ndb_binlog_index.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/ndb_binlog_index.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/ndb_binlog_index.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/proc.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/proc.MYD
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/proc.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/proc.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/proc.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/proc.frm
Normal file
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/procs_priv.MYD
Normal file
0
sandbox/servers/5.7/data/mysql/procs_priv.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/procs_priv.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/procs_priv.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/procs_priv.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/procs_priv.frm
Normal file
Binary file not shown.
1
sandbox/servers/5.7/data/mysql/proxies_priv.MYD
Normal file
1
sandbox/servers/5.7/data/mysql/proxies_priv.MYD
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD>localhost root U<>[h
|
BIN
sandbox/servers/5.7/data/mysql/proxies_priv.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/proxies_priv.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/proxies_priv.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/proxies_priv.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/slow_log.CSM
Normal file
BIN
sandbox/servers/5.7/data/mysql/slow_log.CSM
Normal file
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/slow_log.CSV
Normal file
0
sandbox/servers/5.7/data/mysql/slow_log.CSV
Normal file
|
BIN
sandbox/servers/5.7/data/mysql/slow_log.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/slow_log.frm
Normal file
Binary file not shown.
0
sandbox/servers/5.7/data/mysql/tables_priv.MYD
Normal file
0
sandbox/servers/5.7/data/mysql/tables_priv.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/tables_priv.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/tables_priv.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/tables_priv.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/tables_priv.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/user.MYD
Normal file
BIN
sandbox/servers/5.7/data/mysql/user.MYD
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/user.MYI
Normal file
BIN
sandbox/servers/5.7/data/mysql/user.MYI
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/mysql/user.frm
Normal file
BIN
sandbox/servers/5.7/data/mysql/user.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/accounts.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/accounts.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/cond_instances.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/cond_instances.frm
Normal file
Binary file not shown.
2
sandbox/servers/5.7/data/performance_schema/db.opt
Normal file
2
sandbox/servers/5.7/data/performance_schema/db.opt
Normal file
@@ -0,0 +1,2 @@
|
||||
default-character-set=utf8
|
||||
default-collation=utf8_general_ci
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/file_instances.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/file_instances.frm
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/global_status.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/global_status.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/global_variables.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/global_variables.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/host_cache.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/host_cache.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/hosts.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/hosts.frm
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/metadata_locks.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/metadata_locks.frm
Normal file
Binary file not shown.
BIN
sandbox/servers/5.7/data/performance_schema/mutex_instances.frm
Normal file
BIN
sandbox/servers/5.7/data/performance_schema/mutex_instances.frm
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user