1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

local merge

This commit is contained in:
Tor Didriksen
2011-09-26 14:29:27 +02:00
12 changed files with 380 additions and 92 deletions

View File

@ -238,9 +238,9 @@ GetOptions("server-host=s", "server-logs-dir=s", "server-port=s",
"test-duration=i", "test-suffix=s", "check-tests-file",
"verbose", "log-error-details", "cleanup", "mysqltest=s",
# OBN: (changing 'abort-on-error' to numberic for WL-4626/4685)
"abort-on-error=i" => \$opt_abort_on_error, "help") || usage();
"abort-on-error=i" => \$opt_abort_on_error, "help") || usage(1);
usage() if ($opt_help);
usage(0) if ($opt_help);
#$opt_abort_on_error=1;
@ -1131,6 +1131,7 @@ sub sig_TERM_handler
sub usage
{
my $retcode= shift;
print <<EOF;
The MySQL Stress suite Ver $stress_suite_version
@ -1234,7 +1235,7 @@ perl mysql-stress-test.pl \
--cleanup \
EOF
exit(0);
exit($retcode);
}

View File

@ -181,6 +181,8 @@ our @opt_combinations;
our @opt_extra_mysqld_opt;
our @opt_mysqld_envs;
my $opt_stress;
my $opt_compress;
my $opt_ssl;
my $opt_skip_ssl;
@ -222,10 +224,13 @@ our %gprof_dirs;
our $glob_debugger= 0;
our $opt_gdb;
our $opt_client_gdb;
my $opt_boot_gdb;
our $opt_dbx;
our $opt_client_dbx;
my $opt_boot_dbx;
our $opt_ddd;
our $opt_client_ddd;
my $opt_boot_ddd;
our $opt_manual_gdb;
our $opt_manual_dbx;
our $opt_manual_ddd;
@ -423,8 +428,8 @@ sub main {
}
$ENV{MTR_PARALLEL} = $opt_parallel;
if ($opt_parallel > 1 && $opt_start_exit) {
mtr_warning("Parallel and --start-and-exit cannot be combined\n" .
if ($opt_parallel > 1 && ($opt_start_exit || $opt_stress)) {
mtr_warning("Parallel cannot be used with --start-and-exit or --stress\n" .
"Setting parallel to 1");
$opt_parallel= 1;
}
@ -654,8 +659,9 @@ sub run_test_server ($$$) {
my $core_file= $File::Find::name;
my $core_name= basename($core_file);
if ($core_name =~ /^core/ or # Starting with core
(IS_WINDOWS and $core_name =~ /\.dmp$/)){
# Name beginning with core, not ending in .gz
if (($core_name =~ /^core/ and $core_name !~ /\.gz$/)
or (IS_WINDOWS and $core_name =~ /\.dmp$/)){
# Ending with .dmp
mtr_report(" - found '$core_name'",
"($num_saved_cores/$opt_max_save_core)");
@ -1098,14 +1104,17 @@ sub command_line_setup {
'gdb' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
'boot-gdb' => \$opt_boot_gdb,
'manual-debug' => \$opt_manual_debug,
'ddd' => \$opt_ddd,
'client-ddd' => \$opt_client_ddd,
'manual-ddd' => \$opt_manual_ddd,
'boot-ddd' => \$opt_boot_ddd,
'dbx' => \$opt_dbx,
'client-dbx' => \$opt_client_dbx,
'manual-dbx' => \$opt_manual_dbx,
'debugger=s' => \$opt_debugger,
'boot-dbx' => \$opt_boot_dbx,
'client-debugger=s' => \$opt_client_debugger,
'strace-client:s' => \$opt_strace_client,
'max-save-core=i' => \$opt_max_save_core,
@ -1174,6 +1183,7 @@ sub command_line_setup {
'report-times' => \$opt_report_times,
'result-file' => \$opt_resfile,
'unit-tests!' => \$opt_ctest,
'stress=s' => \$opt_stress,
'help|h' => \$opt_usage,
# list-options is internal, not listed in help
@ -1627,6 +1637,22 @@ sub command_line_setup {
mtr_error("--wait-all can only be used with --start options");
}
# --------------------------------------------------------------------------
# Gather stress-test options and modify behavior
# --------------------------------------------------------------------------
if ($opt_stress)
{
$opt_stress=~ s/,/ /g;
$opt_user_args= 1;
mtr_error("--stress cannot be combined with named ordinary suites or tests")
if $opt_suites || @opt_cases;
$opt_suites="stress";
@opt_cases= ("wrapper");
$ENV{MST_OPTIONS}= $opt_stress;
$opt_ctest= 0;
}
# --------------------------------------------------------------------------
# Check timeout arguments
# --------------------------------------------------------------------------
@ -2359,6 +2385,12 @@ sub environment_setup {
$ENV{'MYSQL_PLUGIN'}= $exe_mysql_plugin;
$ENV{'MYSQL_EMBEDDED'}= $exe_mysql_embedded;
my $exe_mysqld= find_mysqld($basedir);
$ENV{'MYSQLD'}= $exe_mysqld;
my $extra_opts= join (" ", @opt_extra_mysqld_opt);
$ENV{'MYSQLD_CMD'}= "$exe_mysqld --defaults-group-suffix=.1 ".
"--defaults-file=$path_config_file $extra_opts";
# ----------------------------------------------------
# bug25714 executable may _not_ exist in
# some versions, test using it should be skipped
@ -3234,6 +3266,19 @@ sub mysql_install_db {
# ----------------------------------------------------------------------
my $bootstrap_sql_file= "$opt_vardir/tmp/bootstrap.sql";
if ($opt_boot_gdb) {
gdb_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(),
$bootstrap_sql_file);
}
if ($opt_boot_dbx) {
dbx_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(),
$bootstrap_sql_file);
}
if ($opt_boot_ddd) {
ddd_arguments(\$args, \$exe_mysqld_bootstrap, $mysqld->name(),
$bootstrap_sql_file);
}
my $path_sql= my_find_file($install_basedir,
["mysql", "sql/share", "share/mysql",
"share", "scripts"],
@ -4152,6 +4197,11 @@ sub extract_server_log ($$) {
else
{
push(@lines, $line);
if (scalar(@lines) > 1000000) {
$Ferr = undef;
mtr_warning("Too much log from test, bailing out from extracting");
return ();
}
}
}
else
@ -5556,19 +5606,21 @@ sub gdb_arguments {
my $args= shift;
my $exe= shift;
my $type= shift;
my $input= shift;
# Write $args to gdb init file
my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args;
my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
unlink($gdb_init_file);
# Put $args into a single string
my $str= join(" ", @$$args);
my $runline= $input ? "run $str < $input" : "run $str";
# write init file for mysqld or client
mtr_tofile($gdb_init_file,
"set args $str\n" .
"break main\n" .
"run");
$runline);
if ( $opt_manual_gdb )
{
@ -5607,20 +5659,22 @@ sub ddd_arguments {
my $args= shift;
my $exe= shift;
my $type= shift;
my $input= shift;
# Write $args to ddd init file
my $str= join " ", map { s/"/\\"/g; "\"$_\""; } @$$args;
my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file
unlink($gdb_init_file);
# Put $args into a single string
my $str= join(" ", @$$args);
my $runline= $input ? "run $str < $input" : "run $str";
# write init file for mysqld or client
mtr_tofile($gdb_init_file,
"file $$exe\n" .
"set args $str\n" .
"break main\n" .
"run");
$runline);
if ( $opt_manual_ddd )
{
@ -5656,14 +5710,16 @@ sub dbx_arguments {
my $args= shift;
my $exe= shift;
my $type= shift;
my $input= shift;
# Put $args into a single string
my $str= join " ", @$$args;
my $runline= $input ? "run $str < $input" : "run $str";
if ( $opt_manual_dbx ) {
print "\nTo start dbx for $type, type in another window:\n";
print "cd $glob_mysql_test_dir; dbx -c \"stop in main; " .
"run $str\" $$exe\n";
"$runline\" $$exe\n";
# Indicate the exe should not be started
$$exe= undef;
@ -5682,7 +5738,7 @@ sub dbx_arguments {
mtr_add_arg($$args, "dbx");
mtr_add_arg($$args, "-c");
mtr_add_arg($$args, "stop in main; run $str");
mtr_add_arg($$args, "stop in main; $runline");
mtr_add_arg($$args, "$$exe");
$$exe= "xterm";
@ -6128,6 +6184,8 @@ Misc options
nounit-tests Do not run unit tests. Normally run if configured
and if not running named tests/suites
unit-tests Run unit tests even if they would otherwise not be run
stress=ARGS Run stress test, providing options to
mysql-stress-test.pl. Options are separated by comma.
Some options that control enabling a feature for normal test runs,
can be turned off by prepending 'no' to the option, e.g. --notimer.

View File

@ -151,6 +151,10 @@ select 1146 as "after_!errno_masked_error" ;
after_!errno_masked_error
1146
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1000...
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
is empty
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nonsense' at line 1
is empty
garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
ER_PARSE_ERROR
@ -160,6 +164,28 @@ after_--enable_abort_on_error
select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146: 'Table 'test.t1' doesn't exist', instead of 1064...
garbage;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
select 2;
select 3;
3
3
select 5;
ERROR 42S02: Table 'test.t1' doesn't exist
select 7;
7
7
mysqltest: At line 1: End of line junk detected: "OCNE"
connect con1,localhost,root,,;
select 5 from t1;
lower
case
name
abc
xyz
is empty
is empty
"Yes it's empty"
hello
hello
;;;;;;;;
@ -332,7 +358,7 @@ insert into t1 values ('$dollar');
$dollar
`select 42`
drop table t1;
mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1
mysqltest: At line 1: query 'let $var2= `failing query`' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1
mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
@ -864,7 +890,7 @@ mysqltest: At line 1: Could not find column 'column_not_exists' in the result of
mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
value= No such row
mysqltest: At line 1: Error running query 'SHOW COLNS FROM t1': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLNS FROM t1' at line 1
mysqltest: At line 1: query 'let $value= query_get_value(SHOW COLNS FROM t1, Field, 1)' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLNS FROM t1' at line 1
Field Type Null Key Default Extra
a int(11) YES -><- NULL

View File

@ -1 +1,2 @@
--plugin_dir=$FEDERATED_PLUGIN_DIR
--loose-federated=ON

View File

@ -0,0 +1,19 @@
CREATE TABLE t2(a int);
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
Warnings:
Warning 1286 Unknown storage engine 'FEDERATED'
Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN federated SONAME 'FEDERATED_PLUGIN';
INSTALL PLUGIN FEDERATED SONAME 'FEDERATED_PLUGIN';
ERROR HY000: Function 'FEDERATED' already exists
UNINSTALL PLUGIN federated;
INSTALL PLUGIN federated SONAME 'FEDERATED_PLUGIN';
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
UNINSTALL PLUGIN federated;
UNINSTALL PLUGIN federated;
ERROR 42000: PLUGIN federated does not exist
DROP TABLE t2;

View File

@ -1,24 +1,37 @@
--source include/not_windows.inc
--source include/have_federated_plugin.inc
--skip federated plugin is disabled
# Uninstall will not uninstall if ps has been used
--disable_ps_protocol
CREATE TABLE t1(a int) ENGINE=FEDERATED;
connect (master,localhost,root,,test,$MASTER_MYPORT,);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,);
connection master;
CREATE TABLE t2(a int);
connection slave;
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
INSTALL PLUGIN federated SONAME 'ha_federated.so';
--error 1125
INSTALL PLUGIN FEDERATED SONAME 'ha_federated.so';
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
eval INSTALL PLUGIN federated SONAME '$FEDERATED_PLUGIN';
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
--error ER_UDF_EXISTS
eval INSTALL PLUGIN FEDERATED SONAME '$FEDERATED_PLUGIN';
UNINSTALL PLUGIN federated;
INSTALL PLUGIN federated SONAME 'ha_federated.so';
CREATE TABLE t1(a int) ENGINE=FEDERATED;
--replace_result $FEDERATED_PLUGIN FEDERATED_PLUGIN
eval INSTALL PLUGIN federated SONAME '$FEDERATED_PLUGIN';
CREATE TABLE t1(a int) ENGINE=FEDERATED
CONNECTION='mysql://root@localhost:$MASTER_MYPORT/test/t2';
DROP TABLE t1;
UNINSTALL PLUGIN federated;
--error ER_SP_DOES_NOT_EXIST
UNINSTALL PLUGIN federated;
connection master;
DROP TABLE t2;

View File

@ -0,0 +1,29 @@
#
# This is a wrapper "pseudo" test for mtr --stress execution.
# It should not be run directly (will be skipped)
# Do not create a result file!
#
if (!$MST_OPTIONS) {
skip Only to be run with mtr --stress;
}
# echo Running MST with options $MST_OPTIONS;
perl;
my ($mtest)= split " ", $ENV{MYSQL_TEST};
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mtest.inc") or die;
print FILE "let \$MYSQLTEST_BIN= $mtest;\n";
close FILE;
EOF
--source $MYSQL_TMP_DIR/mtest.inc
--remove_file $MYSQL_TMP_DIR/mtest.inc
exec perl mysql-stress-test.pl --mysqltest=$MYSQLTEST_BIN
--server-port=$MASTER_MYPORT --server-socket=$MASTER_MYSOCK
--server-user=root --cleanup
--server-logs-dir=$MYSQLTEST_VARDIR/log
--stress-basedir=$MYSQLTEST_VARDIR
$MST_OPTIONS
;

View File

@ -11,7 +11,5 @@ There should be *no* long test name listed below:
select variable_name as `There should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
There should be *no* variables listed below:
INNODB_LARGE_PREFIX
INNODB_LARGE_PREFIX
drop table t1;
drop table t2;

View File

@ -45,7 +45,6 @@ use File::Basename;
my $plugindir_ini= "$ENV{PLUGIN_DIR}/daemon_example.ini";
my $notfound= "";
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
print FILE "let \$MYSQLD= $mysqld;\n";
print FILE "let \$MYSQLD_BASEDIR= $mysqld_basedir;\n";
print FILE "let \$MYSQL_MY_PRINT_DEFAULTS_BASEDIR= $my_print_defaults_basedir;\n";
if ((!-e $daemonexample_ini) || (!-r $daemonexample_ini))

View File

@ -5,21 +5,6 @@
source include/not_embedded.inc;
source include/not_windows.inc;
# We need to use a plain "mysqld" without any other options to trigger
# the bug. In particular, it seems that passing --bootstrap does not
# trigger the bug. To do that, we extract the "command name" from the
# MYSQLD_BOOTSTRAP_CMD variable and store that in a file, which we
# then load into the test case.
perl;
my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
print FILE "let \$MYSQLD= $mysqld;\n";
close FILE;
EOF
source $MYSQL_TMP_DIR/mysqld.inc;
# All these tests refer to configuration files that do not exist
--error 1
@ -44,4 +29,3 @@ exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
--error 1
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
remove_file $MYSQL_TMP_DIR/mysqld.inc;

View File

@ -353,6 +353,14 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
exit(2);
EOF
# ----------------------------------------------------------------------------
# Check backtick and query_get_value, result should be empty
# ----------------------------------------------------------------------------
let $empty= `garbage`;
echo $empty is empty;
let $empty= query_get_value(nonsense, blabla, 1);
echo $empty is empty;
# ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno
# ----------------------------------------------------------------------------
@ -383,6 +391,71 @@ select 3 from t1 ;
--error 1
--exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test --enable and --disable with ONCE
# ----------------------------------------------------------------------------
--disable_abort_on_error ONCE
garbage;
--disable_abort_on_error ONCE
--remove_file DoesNotExist
--disable_result_log
select 2;
--enable_result_log ONCE
select 3;
select 5;
--enable_result_log
# ----------------------------------------------------------------------------
# Test cumulative ONCE
# ----------------------------------------------------------------------------
--disable_abort_on_error ONCE
--disable_query_log ONCE
select 3 from t1;
select 7;
--error 1
--exec echo "--disable_info OCNE" | $MYSQL_TEST 2>&1
--enable_connect_log ONCE
connect (con1,localhost,root,,);
connection default;
disconnect con1;
# ----------------------------------------------------------------------------
# Test ONCE can be combined with --error or modifiers like lowercase
# ----------------------------------------------------------------------------
--disable_result_log ONCE
--error ER_NO_SUCH_TABLE
select 5 from t1;
--disable_query_log ONCE
--lowercase_result
select "CASE" as "LOWER";
--sorted_result
--disable_query_log ONCE
select "xyz" as name union select "abc" as name order by name desc;
# ----------------------------------------------------------------------------
# Test --error with backtick operator or query_get_value
# ----------------------------------------------------------------------------
--error 0,ER_NO_SUCH_TABLE
let $empty= `SELECT foo from bar`;
echo $empty is empty;
--error 0,ER_BAD_FIELD_ERROR
let $empty= query_get_value(SELECT bar as foo, baz, 1);
echo $empty is empty;
--error 0,ER_NO_SUCH_TABLE
if (!`SELECT foo from bar`) {
echo "Yes it's empty";
}
# ----------------------------------------------------------------------------
# Test comments
@ -952,10 +1025,9 @@ while ($outer)
--source $MYSQLTEST_VARDIR/tmp/sourced.inc
--error ER_NO_SUCH_TABLE
SELECT * from nowhere;
--disable_abort_on_error
--disable_abort_on_error ONCE
# Statement giving a different error, to make sure we don't mask it
SELECT * FROM nowhere else;
--enable_abort_on_error
}
dec $outer;
inc $ifval;
@ -1104,9 +1176,8 @@ system echo "hej" > /dev/null;
--error 1
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
--disable_abort_on_error
--disable_abort_on_error ONCE
system NonExistsinfComamdn 2> /dev/null;
--enable_abort_on_error
# ----------------------------------------------------------------------------
@ -2517,10 +2588,9 @@ INSERT INTO t1 SELECT f1 - 64 FROM t1;
INSERT INTO t1 SELECT f1 - 128 FROM t1;
INSERT INTO t1 SELECT f1 - 256 FROM t1;
INSERT INTO t1 SELECT f1 - 512 FROM t1;
--disable_result_log
--disable_result_log ONCE
--sorted_result
SELECT * FROM t1;
--enable_result_log
DROP TABLE t1;
# ----------------------------------------------------------------------------
@ -2568,11 +2638,9 @@ SELECT 0 as "WILL NOT lower case
--exec $MYSQL_TEST --help 2>&1 > /dev/null
--exec $MYSQL_TEST --version 2>&1 > /dev/null
--enable_query_log
--disable_abort_on_error
--disable_abort_on_error ONCE
--error 1
--exec $MYSQL_TEST a b c 2>&1 > /dev/null
--enable_abort_on_error
--enable_query_log
# ----------------------------------------------------------------------------
# test for query_get_value