mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 22:19:44 +00:00
Fix lib tests for MySQL 5.0.
This commit is contained in:
@@ -467,9 +467,6 @@ rm_tmpdir() {
|
||||
|
||||
set -u
|
||||
|
||||
CMD_PIDOF="$(which pidof)"
|
||||
CMD_PGREP="$(which pgrep)"
|
||||
|
||||
_seq() {
|
||||
local i="$1"
|
||||
awk "BEGIN { for(i=1; i<=$i; i++) print i; }"
|
||||
@@ -629,7 +626,7 @@ collect() {
|
||||
local d="$1" # directory to save results in
|
||||
local p="$2" # prefix for each result file
|
||||
|
||||
local mysqld_pid=$(_pidof mysqld | head -n1)
|
||||
local mysqld_pid=$(_pidof mysqld | awk '{print $1; exit;}')
|
||||
|
||||
if [ "$CMD_PMAP" -a "$mysqld_pid" ]; then
|
||||
if $CMD_PMAP --help 2>&1 | grep -- -x >/dev/null 2>&1 ; then
|
||||
|
@@ -45,7 +45,7 @@ collect() {
|
||||
local p="$2" # prefix for each result file
|
||||
|
||||
# Get pidof mysqld.
|
||||
local mysqld_pid=$(_pidof mysqld | head -n1)
|
||||
local mysqld_pid=$(_pidof mysqld | awk '{print $1; exit;}')
|
||||
|
||||
# Get memory allocation info before anything else.
|
||||
if [ "$CMD_PMAP" -a "$mysqld_pid" ]; then
|
||||
|
21
t/lib/Cxn.t
21
t/lib/Cxn.t
@@ -83,11 +83,12 @@ test_var_val(
|
||||
test => 'Default wait_timeout',
|
||||
);
|
||||
|
||||
my $set_calls = 0;
|
||||
my $cxn = make_cxn(
|
||||
dsn_string => 'h=127.1,P=12345,u=msandbox,p=msandbox',
|
||||
set => sub {
|
||||
my ($dbh) = @_;
|
||||
$dbh->do("SET unique_checks=0");
|
||||
$set_calls++;
|
||||
$dbh->do("SET \@a := \@a + 1");
|
||||
},
|
||||
);
|
||||
@@ -122,11 +123,10 @@ test_var_val(
|
||||
test => 'Sets --set-vars',
|
||||
);
|
||||
|
||||
test_var_val(
|
||||
$cxn->dbh(),
|
||||
'unique_checks',
|
||||
'OFF',
|
||||
test => 'Calls set callback',
|
||||
is(
|
||||
$set_calls,
|
||||
1,
|
||||
'Calls set callback'
|
||||
);
|
||||
|
||||
$cxn->dbh()->do("SET \@a := 1");
|
||||
@@ -172,11 +172,10 @@ test_var_val(
|
||||
test => 'Reconnect sets --set-vars',
|
||||
);
|
||||
|
||||
test_var_val(
|
||||
$cxn->dbh(),
|
||||
'unique_checks',
|
||||
'OFF',
|
||||
test => 'Reconnect calls set callback',
|
||||
is(
|
||||
$set_calls,
|
||||
2,
|
||||
'Reconnect calls set callback'
|
||||
);
|
||||
|
||||
test_var_val(
|
||||
|
@@ -41,7 +41,8 @@ SKIP: {
|
||||
ok(
|
||||
no_diff(
|
||||
$tp->get_create_table($dbh, 'sakila', 'actor'),
|
||||
"$sample/sakila.actor",
|
||||
$sandbox_version ge '5.1' ? "$sample/sakila.actor"
|
||||
: "$sample/sakila.actor-5.0",
|
||||
cmd_output => 1,
|
||||
),
|
||||
"get_create_table(sakila.actor)"
|
||||
|
@@ -15,9 +15,10 @@ use PerconaTest;
|
||||
my ($tool) = $PROGRAM_NAME =~ m/([\w-]+)\.t$/;
|
||||
push @ARGV, "$trunk/t/lib/bash/*.sh" unless @ARGV;
|
||||
|
||||
$ENV{BIN_DIR} = "$trunk/bin";
|
||||
$ENV{LIB_DIR} = "$trunk/lib/bash";
|
||||
$ENV{T_LIB_DIR} = "$trunk/t/lib";
|
||||
$ENV{BIN_DIR} = "$trunk/bin";
|
||||
$ENV{LIB_DIR} = "$trunk/lib/bash";
|
||||
$ENV{T_LIB_DIR} = "$trunk/t/lib";
|
||||
$ENV{SANDBOX_VERSION} = "$sandbox_version";
|
||||
|
||||
system("$trunk/util/test-bash-functions $trunk/t/lib/samples/bash/dummy.sh @ARGV");
|
||||
|
||||
|
@@ -62,12 +62,16 @@ cmd_ok \
|
||||
"innodbstatus2"
|
||||
|
||||
cmd_ok \
|
||||
"grep -q 'error log seems to be /tmp/12345/data/mysqld.log' $p-output" \
|
||||
"grep -q 'error log seems to be .*/mysqld.log' $p-output" \
|
||||
"Finds MySQL error log"
|
||||
|
||||
cmd_ok \
|
||||
"grep -q 'Status information:' $p-log_error" \
|
||||
"debug"
|
||||
if [[ "$SANDBOX_VERSION" > "5.0" ]]; then
|
||||
cmd_ok \
|
||||
"grep -q 'Status information:' $p-log_error" \
|
||||
"debug"
|
||||
else
|
||||
is "1" "1" "SKIP Can't determine MySQL 5.0 error log"
|
||||
fi
|
||||
|
||||
cmd_ok \
|
||||
"grep -q 'COMMAND[ ]\+PID[ ]\+USER' $p-lsof" \
|
||||
|
@@ -37,7 +37,7 @@ CREATE TABLE `user` (
|
||||
`max_updates` int(11) unsigned NOT NULL default '0',
|
||||
`max_connections` int(11) unsigned NOT NULL default '0',
|
||||
`max_user_connections` int(11) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`Host`,`User`)
|
||||
PRIMARY KEY (`Host`,`User`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
|
||||
|
||||
|
||||
|
8
t/lib/samples/tables/sakila.actor-5.0
Normal file
8
t/lib/samples/tables/sakila.actor-5.0
Normal file
@@ -0,0 +1,8 @@
|
||||
CREATE TABLE `actor` (
|
||||
`actor_id` smallint(5) unsigned NOT NULL auto_increment,
|
||||
`first_name` varchar(45) NOT NULL,
|
||||
`last_name` varchar(45) NOT NULL,
|
||||
`last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`actor_id`),
|
||||
KEY `idx_actor_last_name` (`last_name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8
|
Reference in New Issue
Block a user