1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

overlay support for mysql-test-run and mysqltest

mysql-test-run auto-disables all optional plugins.


mysql-test/include/default_client.cnf:
  no @OPT.plugindir anymore
mysql-test/include/default_mysqld.cnf:
  don't disable plugins manually - mtr can do it better
mysql-test/suite/innodb/t/innodb_bug47167.test:
  mtr now uses suite-dir as an include path
mysql-test/suite/innodb/t/innodb_file_format.test:
  mtr now uses suite-dir as an include path
mysql-test/t/partition_binlog.test:
  this test uses partitions
storage/example/mysql-test/mtr/t/source.result:
  update results. as mysqltest includes the correct overlayed include
storage/innobase/handler/ha_innodb.cc:
  the assert is wrong
This commit is contained in:
Sergei Golubchik
2012-02-23 07:50:11 +01:00
parent ae0a7cfd5f
commit c39877071a
98 changed files with 1264 additions and 531 deletions

View File

@ -93,11 +93,7 @@ static my_bool get_one_option(int optid, const struct my_option *,
C_MODE_END C_MODE_END
enum { enum {
OPT_PS_PROTOCOL=OPT_MAX_CLIENT_OPTION, OPT_SP_PROTOCOL, OPT_LOG_DIR=OPT_MAX_CLIENT_OPTION, OPT_RESULT_FORMAT_VERSION
OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_MAX_CONNECT_RETRIES,
OPT_MAX_CONNECTIONS, OPT_MARK_PROGRESS, OPT_LOG_DIR,
OPT_TAIL_LINES, OPT_RESULT_FORMAT_VERSION,
OPT_MY_CONNECT_TIMEOUT, OPT_NON_BLOCKING_API
}; };
static int record= 0, opt_sleep= -1; static int record= 0, opt_sleep= -1;
@ -105,7 +101,7 @@ static char *opt_db= 0, *opt_pass= 0;
const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./"; const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./";
static char *shared_memory_base_name=0; static char *shared_memory_base_name=0;
const char *opt_logdir= ""; const char *opt_logdir= "";
const char *opt_include= 0, *opt_charsets_dir; const char *opt_prologue= 0, *opt_charsets_dir;
static int opt_port= 0; static int opt_port= 0;
static int opt_max_connect_retries; static int opt_max_connect_retries;
static int opt_result_format_version; static int opt_result_format_version;
@ -216,7 +212,6 @@ static struct st_test_file file_stack[16];
static struct st_test_file* cur_file; static struct st_test_file* cur_file;
static struct st_test_file* file_stack_end; static struct st_test_file* file_stack_end;
static CHARSET_INFO *charset_info= &my_charset_latin1; /* Default charset */ static CHARSET_INFO *charset_info= &my_charset_latin1; /* Default charset */
static const char *embedded_server_groups[]= static const char *embedded_server_groups[]=
@ -242,7 +237,9 @@ static ulonglong timer_now(void);
static ulong connection_retry_sleep= 100000; /* Microseconds */ static ulong connection_retry_sleep= 100000; /* Microseconds */
static char *opt_plugin_dir= 0; static const char *opt_plugin_dir;
static const char *opt_suite_dir, *opt_overlay_dir;
static size_t suite_dir_len, overlay_dir_len;
/* Precompiled re's */ /* Precompiled re's */
static my_regex_t ps_re; /* the query can be run using PS protocol */ static my_regex_t ps_re; /* the query can be run using PS protocol */
@ -2866,40 +2863,128 @@ void eval_expr(VAR *v, const char *p, const char **p_end,
} }
int open_file(const char *name) bool open_and_set_current(const char *name)
{
FILE *opened= fopen(name, "rb");
if (!opened)
return false;
cur_file++;
cur_file->file= opened;
cur_file->file_name= my_strdup(name, MYF(MY_FAE));
cur_file->lineno=1;
return true;
}
void open_file(const char *name)
{ {
char buff[FN_REFLEN]; char buff[FN_REFLEN];
size_t length; size_t length;
const char *curname= cur_file->file_name;
DBUG_ENTER("open_file"); DBUG_ENTER("open_file");
DBUG_PRINT("enter", ("name: %s", name)); DBUG_PRINT("enter", ("name: %s", name));
/* Extract path from current file and try it as base first */
if (dirname_part(buff, cur_file->file_name, &length))
{
strxmov(buff, buff, name, NullS);
if (access(buff, F_OK) == 0){
DBUG_PRINT("info", ("The file exists"));
name= buff;
}
}
if (!test_if_hard_path(name))
{
strxmov(buff, opt_basedir, name, NullS);
name=buff;
}
fn_format(buff, name, "", "", MY_UNPACK_FILENAME);
if (cur_file == file_stack_end) if (cur_file == file_stack_end)
die("Source directives are nesting too deep"); die("Source directives are nesting too deep");
cur_file++;
if (!(cur_file->file = fopen(buff, "rb"))) if (test_if_hard_path(name))
{ {
cur_file--; if (open_and_set_current(name))
die("Could not open '%s' for reading, errno: %d", buff, errno); DBUG_VOID_RETURN;
} }
cur_file->file_name= my_strdup(buff, MYF(MY_FAE)); else
cur_file->lineno=1; {
DBUG_RETURN(0); /*
if overlay-dir is specified, and the file is located somewhere
under overlay-dir or under suite-dir, the search works as follows:
0.let suffix be current file dirname relative to siute-dir or overlay-dir
1.try in overlay-dir/suffix
2.try in suite-dir/suffix
3.try in overlay-dir
4.try in suite-dir
5.try in basedir
consider an example: 'rty' overlay of the 'qwe' suite,
file qwe/include/some.inc contains the line
--source thing.inc
we look for it in this order:
0.suffix is "include/"
1.try in rty/include/thing.inc
2.try in qwe/include/thing.inc
3.try in try/thing.inc | this is useful when t/a.test has
4.try in qwe/thing.inc | source include/b.inc;
5.try in mysql-test/include/thing.inc
otherwise the search is as follows
1.try in current file dirname
3.try in overlay-dir (if any)
4.try in suite-dir
5.try in basedir
*/
bool in_overlay= opt_overlay_dir &&
!strncmp(curname, opt_overlay_dir, overlay_dir_len);
bool in_suiteir= opt_overlay_dir && !in_overlay &&
!strncmp(curname, opt_suite_dir, suite_dir_len);
if (in_overlay || in_suiteir)
{
size_t prefix_len = in_overlay ? overlay_dir_len : suite_dir_len;
char buf2[FN_REFLEN], *suffix= buf2 + prefix_len;
dirname_part(buf2, curname, &length);
/* 1. first we look in the overlay dir */
strxnmov(buff, sizeof(buff), opt_overlay_dir, suffix, name, NullS);
/*
Overlayed rty/include/thing.inc can contain the line
--source thing.inc
which would mean to include qwe/include/thing.inc.
But it looks like including "itself", so don't try to open the file,
if buff contains the same file name as curname.
*/
if (strcmp(buff, curname) && open_and_set_current(buff))
DBUG_VOID_RETURN;
/* 2. if that failed, we look in the suite dir */
strxnmov(buff, sizeof(buff), opt_suite_dir, suffix, name, NullS);
/* buff can not be equal to curname, as a file can never include itself */
if (open_and_set_current(buff))
DBUG_VOID_RETURN;
}
else
{
/* 1. try in current file dirname */
dirname_part(buff, curname, &length);
strxnmov(buff, sizeof(buff), buff, name, NullS);
if (open_and_set_current(buff))
DBUG_VOID_RETURN;
}
/* 3. now, look in the overlay dir */
if (opt_overlay_dir)
{
strxmov(buff, opt_overlay_dir, name, NullS);
if (open_and_set_current(buff))
DBUG_VOID_RETURN;
}
/* 4. if that failed - look in the suite dir */
strxmov(buff, opt_suite_dir, name, NullS);
if (open_and_set_current(buff))
DBUG_VOID_RETURN;
/* 5. the last resort - look in the base dir */
strxnmov(buff, sizeof(buff), opt_basedir, name, NullS);
if (open_and_set_current(buff))
DBUG_VOID_RETURN;
}
die("Could not open '%s' for reading, errno: %d", name, errno);
DBUG_VOID_RETURN;
} }
@ -6584,13 +6669,13 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"basedir", 'b', "Basedir for tests.", &opt_basedir, {"basedir", 'b', "Basedir for tests.", &opt_basedir,
&opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", 0,
"Directory for character set files.", &opt_charsets_dir, "Directory for character set files.", &opt_charsets_dir,
&opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"compress", 'C', "Use the compressed server/client protocol.", {"compress", 'C', "Use the compressed server/client protocol.",
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.", {"cursor-protocol", 0, "Use cursors for prepared statements.",
&cursor_protocol, &cursor_protocol, 0, &cursor_protocol, &cursor_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"database", 'D', "Database to use.", &opt_db, &opt_db, 0, {"database", 'D', "Database to use.", &opt_db, &opt_db, 0,
@ -6602,27 +6687,27 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", {"debug-check", 0, "Check memory and open file usage at exit.",
&debug_check_flag, &debug_check_flag, 0, &debug_check_flag, &debug_check_flag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", {"debug-info", 0, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag, &debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", &opt_host, &opt_host, 0, {"host", 'h', "Connect to host.", &opt_host, &opt_host, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"include", 'i', "Include SQL before each test case.", &opt_include, {"prologue", 0, "Include SQL before each test case.", &opt_prologue,
&opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_prologue, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"logdir", OPT_LOG_DIR, "Directory for log files", &opt_logdir, {"logdir", OPT_LOG_DIR, "Directory for log files", &opt_logdir,
&opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mark-progress", OPT_MARK_PROGRESS, {"mark-progress", 0,
"Write line number and elapsed time to <testname>.progress.", "Write line number and elapsed time to <testname>.progress.",
&opt_mark_progress, &opt_mark_progress, 0, &opt_mark_progress, &opt_mark_progress, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"max-connect-retries", OPT_MAX_CONNECT_RETRIES, {"max-connect-retries", 0,
"Maximum number of attempts to connect to server.", "Maximum number of attempts to connect to server.",
&opt_max_connect_retries, &opt_max_connect_retries, 0, &opt_max_connect_retries, &opt_max_connect_retries, 0,
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0}, GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
{"max-connections", OPT_MAX_CONNECTIONS, {"max-connections", 0,
"Max number of open connections to server", "Max number of open connections to server",
&opt_max_connections, &opt_max_connections, 0, &opt_max_connections, &opt_max_connections, 0,
GET_INT, REQUIRED_ARG, DEFAULT_MAX_CONN, 8, 5120, 0, 0, 0}, GET_INT, REQUIRED_ARG, DEFAULT_MAX_CONN, 8, 5120, 0, 0, 0},
@ -6637,11 +6722,11 @@ static struct my_option my_long_options[] =
#endif #endif
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
&opt_port, &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &opt_port, &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ps-protocol", OPT_PS_PROTOCOL, {"ps-protocol", 0,
"Use prepared-statement protocol for communication.", "Use prepared-statement protocol for communication.",
&ps_protocol, &ps_protocol, 0, &ps_protocol, &ps_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"non-blocking-api", OPT_NON_BLOCKING_API, {"non-blocking-api", 0,
"Use the non-blocking client API for communication.", "Use the non-blocking client API for communication.",
&non_blocking_api_enabled, &non_blocking_api_enabled, 0, &non_blocking_api_enabled, &non_blocking_api_enabled, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -6661,7 +6746,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-file", 'F', "Read embedded server arguments from file.", {"server-file", 'F', "Read embedded server arguments from file.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, {"shared-memory-base-name", 0,
"Base name of shared memory.", &shared_memory_base_name, "Base name of shared memory.", &shared_memory_base_name,
&shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
@ -6673,11 +6758,11 @@ static struct my_option my_long_options[] =
{"socket", 'S', "The socket file to use for connection.", {"socket", 'S', "The socket file to use for connection.",
&unix_sock, &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, &unix_sock, &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
{"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.", {"sp-protocol", 0, "Use stored procedures for select.",
&sp_protocol, &sp_protocol, 0, &sp_protocol, &sp_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
{"tail-lines", OPT_TAIL_LINES, {"tail-lines", 0,
"Number of lines of the result to include in a failure report.", "Number of lines of the result to include in a failure report.",
&opt_tail_lines, &opt_tail_lines, 0, &opt_tail_lines, &opt_tail_lines, 0,
GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0}, GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
@ -6693,16 +6778,20 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", {"version", 'V', "Output version information and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.", {"view-protocol", 0, "Use views for select.",
&view_protocol, &view_protocol, 0, &view_protocol, &view_protocol, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT, {"connect_timeout", 0,
"Number of seconds before connection timeout.", "Number of seconds before connection timeout.",
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG, &opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
120, 0, 3600 * 12, 0, 0, 0}, 120, 0, 3600 * 12, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", {"plugin_dir", 0, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0, &opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"overlay-dir", 0, "Overlay directory.", &opt_overlay_dir,
&opt_overlay_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"suite-dir", 0, "Suite directory.", &opt_suite_dir,
&opt_suite_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
@ -6908,6 +6997,11 @@ int parse_args(int argc, char **argv)
memcpy(global_subst_to, comma+1, strlen(comma)); memcpy(global_subst_to, comma+1, strlen(comma));
} }
if (!opt_suite_dir)
opt_suite_dir= "./";
suite_dir_len= strlen(opt_suite_dir);
overlay_dir_len= opt_overlay_dir ? strlen(opt_overlay_dir) : 0;
if (!record) if (!record)
{ {
/* Check that the result file exists */ /* Check that the result file exists */
@ -8738,9 +8832,9 @@ int main(int argc, char **argv)
set_current_connection(con); set_current_connection(con);
if (opt_include) if (opt_prologue)
{ {
open_file(opt_include); open_file(opt_prologue);
} }
verbose_msg("Start processing test commands from '%s' ...", cur_file->file_name); verbose_msg("Start processing test commands from '%s' ...", cur_file->file_name);

View File

@ -133,7 +133,6 @@ and values - with templating extensions. They are
to values in the [ENV] group of my.cnf file. to values in the [ENV] group of my.cnf file.
Via the OPT group one can refer to special values: Via the OPT group one can refer to special values:
@OPT.plugindir - a path to plugindir
@OPT.vardir - a path to vardir @OPT.vardir - a path to vardir
@OPT.port - a new port number is reserved out of the pool. It will not @OPT.port - a new port number is reserved out of the pool. It will not
match any other port number used by this test run. match any other port number used by this test run.

View File

@ -1,6 +1,5 @@
# Check if ipv6 is available. # Check if ipv6 is available.
# #
# The real test is done in the mysql-test-run.pl # The real check is done in the suite.pm
# (it has to be done *before* mysqld is started) # (it has to be done *before* mysqld is started)
# This file only signals mysql-test-run.pl that ipv6 support is needed
# #

View File

@ -4,7 +4,7 @@
# #
[client] [client]
plugin-dir=@OPT.plugindir plugin-dir=@mysqld.1.plugin-dir
[mysql] [mysql]
default-character-set=latin1 default-character-set=latin1

View File

@ -23,21 +23,19 @@ character-set-server= latin1
# disconnects when test servers are put under load see BUG#28359 # disconnects when test servers are put under load see BUG#28359
connect-timeout= 60 connect-timeout= 60
plugin-dir=@OPT.plugindir
secure-file-priv= @OPT.vardir secure-file-priv= @OPT.vardir
log-basename=mysqld log-basename=mysqld
debug-no-sync debug-no-sync
# Retry bind as this may fail on busy server
port-open-timeout=10
log-bin-trust-function-creators=1 log-bin-trust-function-creators=1
key_buffer_size= 1M key_buffer_size= 1M
sort_buffer= 256K sort_buffer= 256K
max_heap_table_size= 1M max_heap_table_size= 1M
loose-skip-innodb
loose-skip-pbxt
loose-skip-federated
loose-skip-feedback
loose-feedback-user-info= mysql-test loose-feedback-user-info= mysql-test
loose-innodb_data_file_path= ibdata1:10M:autoextend loose-innodb_data_file_path= ibdata1:10M:autoextend
@ -61,3 +59,20 @@ loose-performance-schema-max-table-instances=500
loose-performance-schema-max-table-handles=1000 loose-performance-schema-max-table-handles=1000
binlog-direct-non-transactional-updates binlog-direct-non-transactional-updates
# here, at the end of [mysqld] group mtr will automatically disable
# all optional plugins.
[embedded]
# mtr automatically adds [embedded] group at the end and copies [mysqld]
# and [mysqld.1] groups into it.
# but we want [server] group to be after [mysqld] (and its copies).
# create a non-empty [embedded] group here, to force it before [server]
local-infile
[server]
# Aria is optional, but it must be enabled if it's used for temporary
# tables. Let's enable it in the [server] group, because this group
# is read after [mysqld] and [embedded]
loose-aria

View File

@ -1,3 +1,9 @@
#
# suite.pm will make sure that all tests including this file
# will be skipped unless this is a debug build.
#
# The test below is redundant
-- require r/have_debug.require -- require r/have_debug.require
disable_query_log; disable_query_log;
select (version() like '%debug%') as debug; select (version() like '%debug%') as debug;

View File

@ -2,11 +2,17 @@
ignore-builtin-innodb ignore-builtin-innodb
plugin-load=$HA_INNODB_SO plugin-load=$HA_INNODB_SO
innodb innodb
innodb-cmpmem
innodb-trx
[xtradb_plugin] [xtradb_plugin]
ignore-builtin-innodb ignore-builtin-innodb
plugin-load=$HA_XTRADB_SO plugin-load=$HA_XTRADB_SO
innodb innodb
innodb-cmpmem
innodb-trx
[xtradb] [xtradb]
innodb innodb
innodb-cmpmem
innodb-trx

View File

@ -1,3 +1,9 @@
#
# suite.pm will make sure that all tests including this file
# will be skipped unless innodb or xtradb is enabled
#
# The test below is redundant
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`) if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
{ {
--skip Test requires InnoDB. --skip Test requires InnoDB.

View File

@ -0,0 +1 @@
--enable-partition

View File

@ -74,5 +74,8 @@ BEGIN
mysql.time_zone_transition_type, mysql.time_zone_transition_type,
mysql.user; mysql.user;
-- verify that no plugin changed its disabled/enabled state
SELECT * FROM INFORMATION_SCHEMA.PLUGINS;
END|| END||

View File

@ -1,3 +1,9 @@
#
# suite.pm will make sure that all tests including this file
# will be skipped unless this is an embedded test run
#
# The test below is redundant
-- require r/not_embedded.require -- require r/not_embedded.require
disable_query_log; disable_query_log;
select version() like '%embedded%' as 'have_embedded'; select version() like '%embedded%' as 'have_embedded';

View File

@ -164,9 +164,6 @@ sub value {
return $option->value(); return $option->value();
} }
sub auto { 0 };
# #
# Return value for an option if it exist # Return value for an option if it exist
# #
@ -191,8 +188,6 @@ sub new {
bless My::Config::Group->new($group_name), $class; bless My::Config::Group->new($group_name), $class;
} }
sub auto { 1 };
# #
# Return value for an option in the group, fail if it does not exist # Return value for an option in the group, fail if it does not exist
# #
@ -218,8 +213,6 @@ use strict;
use warnings; use warnings;
use Carp; use Carp;
sub auto { 1 };
sub new { sub new {
my ($class, $group_name)= @_; my ($class, $group_name)= @_;
bless My::Config::Group->new($group_name), $class; bless My::Config::Group->new($group_name), $class;
@ -442,6 +435,17 @@ sub groups {
} }
#
# Return a list with "real" groups in config, those
# that should be written to a my.cnf file, those that contain options.
# Same as groups() but without auto-generated groups like ENV or OPT.
#
sub option_groups {
my ($self)= @_;
return ( grep { ref $_ eq 'My::Config::Group' } @{$self->{groups}} );
}
# #
# Return a list of all the groups in config # Return a list of all the groups in config
# starting with the given string # starting with the given string

View File

@ -31,8 +31,19 @@ use File::Basename;
# #
# Rules to run first of all # Rules to run first of all
# #
sub add_opt_values {
my ($self, $config)= @_;
# add auto-options
$config->insert('OPT', 'port' => sub { fix_port($self, $config) });
$config->insert('OPT', 'vardir' => sub { $self->{ARGS}->{vardir} });
$config->insert('mysqld', "loose-skip-$_" => undef) for (@::optional_plugins);
}
my @pre_rules= my @pre_rules=
( (
\&add_opt_values,
); );
@ -230,9 +241,10 @@ my @mysqld_rules=
{ 'port' => \&fix_port }, { 'port' => \&fix_port },
{ 'socket' => \&fix_socket }, { 'socket' => \&fix_socket },
{ '#log-error' => \&fix_log_error }, { '#log-error' => \&fix_log_error },
{ 'general-log' => sub { return 1; } }, { 'general-log' => 1 },
{ 'plugin-dir' => sub { $::plugindir } },
{ 'general-log-file' => \&fix_log }, { 'general-log-file' => \&fix_log },
{ 'slow-query-log' => sub { return 1; } }, { 'slow-query-log' => 1 },
{ 'slow-query-log-file' => \&fix_log_slow_queries }, { 'slow-query-log-file' => \&fix_log_slow_queries },
{ '#user' => sub { return shift->{ARGS}->{user} || ""; } }, { '#user' => sub { return shift->{ARGS}->{user} || ""; } },
{ '#password' => sub { return shift->{ARGS}->{password} || ""; } }, { '#password' => sub { return shift->{ARGS}->{password} || ""; } },
@ -432,7 +444,7 @@ sub post_check_embedded_group {
my $first_mysqld= $config->first_like('mysqld.') or my $first_mysqld= $config->first_like('mysqld.') or
croak "Can't run with embedded, config has no mysqld"; croak "Can't run with embedded, config has no mysqld";
my @no_copy = my %no_copy = map { $_ => 1 }
( (
'#log-error', # Embedded server writes stderr to mysqltest's log file '#log-error', # Embedded server writes stderr to mysqltest's log file
'slave-net-timeout', # Embedded server are not build with replication 'slave-net-timeout', # Embedded server are not build with replication
@ -441,7 +453,7 @@ sub post_check_embedded_group {
foreach my $option ( $mysqld->options(), $first_mysqld->options() ) { foreach my $option ( $mysqld->options(), $first_mysqld->options() ) {
# Don't copy options whose name is in "no_copy" list # Don't copy options whose name is in "no_copy" list
next if grep ( $option->name() eq $_, @no_copy); next if $no_copy{$option->name()};
$config->insert('embedded', $option->name(), $option->value()) $config->insert('embedded', $option->name(), $option->value())
} }
@ -632,19 +644,11 @@ sub new_config {
testname => $args->{testname}, testname => $args->{testname},
}, $class; }, $class;
# add auto-options # Run pre rules
$config->insert('OPT', 'port' => sub { fix_port($self, $config) }); foreach my $rule ( @pre_rules ) {
$config->insert('OPT', 'vardir' => sub { $self->{ARGS}->{vardir} }); &$rule($self, $config);
$config->insert('OPT', 'plugindir' => sub { $::plugindir });
{
# Run pre rules
foreach my $rule ( @pre_rules ) {
&$rule($self, $config);
}
} }
$self->run_section_rules($config, $self->run_section_rules($config,
'cluster_config\.\w*$', 'cluster_config\.\w*$',
@cluster_config_rules); @cluster_config_rules);

View File

@ -64,7 +64,7 @@ sub my_find_bin {
# ------------------------------------------------------- # -------------------------------------------------------
# Find and return the first executable # Find and return the first executable
# ------------------------------------------------------- # -------------------------------------------------------
foreach my $path (my_find_paths($base, $paths, $names, $bin_extension)) { foreach my $path (my_build_path_list($base, $paths, $names, $bin_extension)) {
return $path if ( -x $path or (IS_WINDOWS and -f $path) ); return $path if ( -x $path or (IS_WINDOWS and -f $path) );
} }
if (defined $required and $required == NOT_REQUIRED){ if (defined $required and $required == NOT_REQUIRED){
@ -98,7 +98,7 @@ sub my_find_file {
# ------------------------------------------------------- # -------------------------------------------------------
# Find and return the first executable # Find and return the first executable
# ------------------------------------------------------- # -------------------------------------------------------
foreach my $path (my_find_paths($base, $paths, $names, $bin_extension)) { foreach my $path (my_build_path_list($base, $paths, $names, $bin_extension)) {
return $path if ( -f $path ); return $path if ( -f $path );
} }
if (defined $required and $required == NOT_REQUIRED){ if (defined $required and $required == NOT_REQUIRED){
@ -110,8 +110,9 @@ sub my_find_file {
# #
# my_find_dir - find the first existing directory in one of # my_find_dir - find the existing directories in one of
# the given paths # the given paths. Returns the first found in the scalar context
# and all of them in the list context.
# #
# Example: # Example:
# my $charset_set= my_find_dir($basedir, # my $charset_set= my_find_dir($basedir,
@ -127,20 +128,22 @@ sub my_find_file {
# #
sub my_find_dir { sub my_find_dir {
my ($base, $paths, $dirs, $required)= @_; my ($base, $paths, $dirs, $required)= @_;
croak "usage: my_find_dir(<base>, <paths>[, <dirs>])" croak "usage: my_find_dir(<base>, <paths>[, <dirs>[, <required>]])"
unless (@_ == 3 or @_ == 2); unless (@_ >= 2 and @_ <= 4);
# ------------------------------------------------------- my @all;
# Find and return the first directory foreach my $path (my_build_path_list($base, $paths, $dirs)) {
# ------------------------------------------------------- next unless -d $path;
foreach my $path (my_find_paths($base, $paths, $dirs)) { return $path unless wantarray;
return $path if ( -d $path ); push @all, $path;
} }
return @all if @all;
return wantarray ? () : "" if defined $required and $required == NOT_REQUIRED;
find_error($base, $paths, $dirs); find_error($base, $paths, $dirs);
} }
sub my_find_paths { sub my_build_path_list {
my ($base, $paths, $names, $extension)= @_; my ($base, $paths, $names, $extension)= @_;
# Convert the arguments into two normal arrays to ease # Convert the arguments into two normal arrays to ease
@ -237,7 +240,7 @@ sub find_error {
croak "** ERROR: Could not find ", croak "** ERROR: Could not find ",
commify(fnuttify(@names)), " in ", commify(fnuttify(@names)), " in ",
commify(fnuttify(my_find_paths($base, $paths, $names))), "\n"; commify(fnuttify(my_build_path_list($base, $paths, $names))), "\n";
} }
1; 1;

View File

@ -7,9 +7,11 @@ sub config_files { () }
sub servers { () } sub servers { () }
sub skip_combinations { () } sub skip_combinations { () }
sub new { bless { } }
sub list_cases { sub list_cases {
my ($self, $testdir) = @_; my ($self, $testdir) = @_;
opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); opendir(TESTDIR, $testdir) or return ();
my (@cases) = grep { s/\.test$// } readdir TESTDIR; my (@cases) = grep { s/\.test$// } readdir TESTDIR;
closedir TESTDIR; closedir TESTDIR;
@cases; @cases;

View File

@ -40,7 +40,7 @@ sub copy {
my $copy= My::Test->new(); my $copy= My::Test->new();
while (my ($key, $value) = each(%$self)) { while (my ($key, $value) = each(%$self)) {
if (ref $value eq "ARRAY") { if (ref $value eq "ARRAY") {
push(@{$copy->{$key}}, @$value); $copy->{$key} = [ @$value ];
} else { } else {
$copy->{$key}= $value; $copy->{$key}= $value;
} }

View File

@ -36,7 +36,6 @@ our $binlog_format;
our $enable_disabled; our $enable_disabled;
our $default_storage_engine; our $default_storage_engine;
our $opt_with_ndbcluster_only; our $opt_with_ndbcluster_only;
our $defaults_file;
sub collect_option { sub collect_option {
my ($opt, $value)= @_; my ($opt, $value)= @_;
@ -109,7 +108,7 @@ sub collect_test_cases ($$$$) {
{ {
foreach my $suite (split(",", $suites)) foreach my $suite (split(",", $suites))
{ {
push(@$cases, collect_one_suite($suite, $opt_cases, $opt_skip_test_list)); push(@$cases, collect_one_suite($suite, $opt_cases));
} }
} }
@ -137,7 +136,7 @@ sub collect_test_cases ($$$$) {
$sname= "main" if !$opt_reorder and !$sname; $sname= "main" if !$opt_reorder and !$sname;
mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname; mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname;
# If suite was part of name, find it there, may come with combinations # If suite was part of name, find it there, may come with combinations
my @this_case = collect_one_suite($sname, [ $tname ]); my @this_case = collect_one_suite($sname, [ $test_name_spec ]);
if (@this_case) if (@this_case)
{ {
push (@$cases, @this_case); push (@$cases, @this_case);
@ -152,9 +151,6 @@ sub collect_test_cases ($$$$) {
if ( $opt_reorder ) if ( $opt_reorder )
{ {
# Reorder the test cases in an order that will make them faster to run
my %sort_criteria;
# Make a mapping of test name to a string that represents how that test # Make a mapping of test name to a string that represents how that test
# should be sorted among the other tests. Put the most important criterion # should be sorted among the other tests. Put the most important criterion
# first, then a sub-criterion, then sub-sub-criterion, etc. # first, then a sub-criterion, then sub-sub-criterion, etc.
@ -163,9 +159,12 @@ sub collect_test_cases ($$$$) {
my @criteria = (); my @criteria = ();
# #
# Append the criteria for sorting, in order of importance. # Collect the criteria for sorting, in order of importance.
# Note that criteria are also used in mysql-test-run.pl to
# schedule tests to workers, and it preferres tests that have
# *identical* criteria. That is, test name is *not* part of
# the criteria, but it's part of the sorting function below.
# #
push @criteria, ($tinfo->{'long_test'} ? "long" : "short");
push(@criteria, $tinfo->{template_path}); push(@criteria, $tinfo->{template_path});
for (qw(master_opt slave_opt)) { for (qw(master_opt slave_opt)) {
# Group test with equal options together. # Group test with equal options together.
@ -173,11 +172,15 @@ sub collect_test_cases ($$$$) {
my $opts= $tinfo->{$_} ? $tinfo->{$_} : []; my $opts= $tinfo->{$_} ? $tinfo->{$_} : [];
push(@criteria, join("!", sort @{$opts}) . "~"); push(@criteria, join("!", sort @{$opts}) . "~");
} }
push @criteria, $tinfo->{name};
$tinfo->{criteria}= join(" ", @criteria); $tinfo->{criteria}= join(" ", @criteria);
} }
@$cases = sort { $a->{criteria} cmp $b->{criteria} } @$cases; @$cases = sort { # ORDER BY
$b->{skip} <=> $a->{skip} || # skipped DESC,
$a->{criteria} cmp $b->{criteria} || # criteria ASC,
$b->{long_test} <=> $a->{long_test} || # long_test DESC,
$a->{name} cmp $b->{name} # name ASC
} @$cases;
} }
return $cases; return $cases;
@ -214,8 +217,12 @@ sub split_testname {
mtr_error("Illegal format of test name: $test_name"); mtr_error("Illegal format of test name: $test_name");
} }
my %skip_combinations; our %file_to_tags;
my %file_combinations; our %file_to_master_opts;
our %file_to_slave_opts;
our %file_combinations;
our %skip_combinations;
our %file_in_overlay;
sub load_suite_object { sub load_suite_object {
my ($suitename, $suitedir) = @_; my ($suitename, $suitedir) = @_;
@ -225,11 +232,11 @@ sub load_suite_object {
$suite= do "$suitedir/suite.pm"; $suite= do "$suitedir/suite.pm";
unless (ref $suite) { unless (ref $suite) {
my $comment = $suite; my $comment = $suite;
$suite = do 'My/Suite.pm'; $suite = My::Suite->new();
$suite->{skip} = $comment; $suite->{skip} = $comment;
} }
} else { } else {
$suite = do 'My/Suite.pm'; $suite = My::Suite->new();
} }
$suites{$suitename} = $suite; $suites{$suitename} = $suite;
@ -238,7 +245,12 @@ sub load_suite_object {
# with only one lookup # with only one lookup
my %suite_skiplist = $suite->skip_combinations(); my %suite_skiplist = $suite->skip_combinations();
while (my ($file, $skiplist) = each %suite_skiplist) { while (my ($file, $skiplist) = each %suite_skiplist) {
$skip_combinations{"$suitedir/$file => $_"} = 1 for (@$skiplist); $file =~ s/\.\w+$/\.combinations/;
if (ref $skiplist) {
$skip_combinations{"$suitedir/$file => $_"} = 1 for (@$skiplist);
} else {
$skip_combinations{"$suitedir/$file"} = $skiplist;
}
} }
} }
return $suites{$suitename}; return $suites{$suitename};
@ -246,36 +258,36 @@ sub load_suite_object {
# returns a pair of (suite, suitedir) # returns a pair of (suite, suitedir)
sub find_suite_of_file($) { sub load_suite_for_file($) {
my ($file) = @_; my ($file) = @_;
return ($2, $1) return load_suite_object($2, $1)
if $file =~ m@^(.*/(?:storage|plugin)/\w+/mysql-test/(\w+))/@; if $file =~ m@^(.*/(?:storage|plugin)/\w+/mysql-test/(\w+))/@;
return ($2, $1) if $file =~ m@^(.*/mysql-test/suite/(\w+))/@; return load_suite_object($2, $1) if $file =~ m@^(.*/mysql-test/suite/(\w+))/@;
return ('main', $1) if $file =~ m@^(.*/mysql-test)/@; return load_suite_object('main', $1) if $file =~ m@^(.*/mysql-test)/@;
mtr_error("Cannot determine suite for $file"); mtr_error("Cannot determine suite for $file");
} }
sub combinations_from_file($) sub combinations_from_file($$)
{ {
my ($filename) = @_; my ($in_overlay, $filename) = @_;
return () if @::opt_combinations or not -f $filename;
# check the suite object, and load its %skip_combinations
my $suite = load_suite_object(find_suite_of_file($filename));
return () if $suite->{skip}; # XXX
# Read combinations file in my.cnf format
mtr_verbose("Read combinations file");
my $config= My::Config->new($filename);
my @combs; my @combs;
foreach my $group ($config->groups()) { if ($skip_combinations{$filename}) {
next if $group->auto(); @combs = ({ skip => $skip_combinations{$filename} });
my $comb= { name => $group->name() }; } else {
next if $skip_combinations{"$filename => $comb->{name}"}; # XXX return () if @::opt_combinations or not -f $filename;
foreach my $option ( $group->options() ) { # Read combinations file in my.cnf format
push(@{$comb->{comb_opt}}, $option->option()); mtr_verbose("Read combinations file");
my $config= My::Config->new($filename);
foreach my $group ($config->option_groups()) {
my $comb= { name => $group->name(), comb_opt => [] };
next if $skip_combinations{"$filename => $comb->{name}"};
foreach my $option ( $group->options() ) {
push(@{$comb->{comb_opt}}, $option->option());
}
$comb->{in_overlay} = 1 if $in_overlay;
push @combs, $comb;
} }
push @combs, $comb; @combs = ({ skip => 'Requires: ' . basename($filename, '.combinations') }) unless @combs;
} }
@combs; @combs;
} }
@ -302,12 +314,14 @@ sub collect_one_suite
{ {
my $suitename= shift; # Test suite name my $suitename= shift; # Test suite name
my $opt_cases= shift; my $opt_cases= shift;
my $opt_skip_test_list= shift; my $over;
my @cases; # Array of hash
($suitename, $over) = split '-', $suitename;
mtr_verbose("Collecting: $suitename"); mtr_verbose("Collecting: $suitename");
my $suitedir= "$::glob_mysql_test_dir"; # Default my $suitedir= $::glob_mysql_test_dir; # Default
my @overlays = ();
if ( $suitename ne "main" ) if ( $suitename ne "main" )
{ {
# Allow suite to be path to "some dir" if $suitename has at least # Allow suite to be path to "some dir" if $suitename has at least
@ -319,62 +333,108 @@ sub collect_one_suite
} }
else else
{ {
$suitedir= my_find_dir($::basedir, @overlays = my_find_dir($::basedir,
["share/mysql-test/suite", ["mysql-test/suite",
"share/mysql/mysql-test/suite", "storage/*/mysql-test",
"mysql-test/suite", "plugin/*/mysql-test"],
"mysql-test", [$suitename]);
# Look in storage engine specific suite dirs #
"storage/*/mtr", # XXX at the moment, for simplicity, we will not fully support one plugin
# Look in plugin specific suite dir # overlaying a suite of another plugin. Only suites in the main
"plugin/$suitename/tests", # mysql-test directory can be safely overlayed. To be fixed, when needed.
], # To fix it we'll need a smarter overlay detection (that is, detection of
[$suitename]); # what is an overlay and what is the "original" suite) than simply
# "prefer directories with more files".
#
if ($overlays[0] !~ m@/mysql-test/suite/$suitename$@) {
# prefer directories with more files
@overlays = sort { scalar(<$a/*>) <=> scalar(<$b/*>) } @overlays;
}
$suitedir = shift @overlays;
} }
mtr_verbose("suitedir: $suitedir"); } else {
@overlays = my_find_dir($::basedir,
["storage/*/mysql-test",
"plugin/*/mysql-test"],
['main'], NOT_REQUIRED);
} }
mtr_verbose("suitedir: $suitedir");
mtr_verbose("overlays: @overlays") if @overlays;
my $testdir= "$suitedir/t"; # we always need to process the parent suite, even if we won't use any
my $resdir= "$suitedir/r"; # test from it.
my @cases= process_suite($suitename, undef, $suitedir,
$over ? [ '*BOGUS*' ] : $opt_cases);
# Check if t/ exists # when working with overlays we cannot use global caches like
if (-d $testdir){ # %file_to_tags. Because the same file may have different tags
# t/ exists # with and without overlays. For example, when a.test includes
# b.inc, which includes c.inc, and an overlay replaces c.inc.
if ( -d $resdir ) # In this case b.inc may have different tags in the overlay,
{ # despite the fact that b.inc itself is not replaced.
# r/exists for (@overlays) {
} local %file_to_tags = ();
else local %file_to_master_opts = ();
{ local %file_to_slave_opts = ();
# No r/, use t/ as result dir local %file_combinations = ();
$resdir= $testdir; local %file_in_overlay = ();
}
die unless m@/(?:storage|plugin)/(\w+)/mysql-test/\w+$@;
next unless defined $over and ($over eq '' or $over eq $1);
push @cases,
# don't add cases that take *all* data from the parent suite
grep { $_->{in_overlay} } process_suite($suitename, $1, $_, $opt_cases);
} }
else { return @cases;
# No t/ dir => there can' be any r/ dir }
mtr_error("Can't have r/ dir without t/") if -d $resdir;
# No t/ or r/ => use suitedir sub process_suite {
$resdir= $testdir= $suitedir; my ($basename, $overname, $suitedir, $opt_cases) = @_;
my $suitename;
my $parent;
if ($overname) {
$parent = $suites{$basename};
die unless $parent;
$suitename = $basename . '-' . $overname;
} else {
$suitename = $basename;
} }
mtr_verbose("testdir: $testdir");
mtr_verbose("resdir: $resdir");
my $suite = load_suite_object($suitename, $suitedir); my $suite = load_suite_object($suitename, $suitedir);
# #
# Read suite config files, unless it was done aleady # Read suite config files, unless it was done aleady
# #
unless (defined $suite->{dir}) { unless (defined $suite->{name}) {
$suite->{dir} = $suitedir; $suite->{name} = $suitename;
$suite->{tdir} = $testdir; $suite->{dir} = $suitedir;
$suite->{rdir} = $resdir;
# First, we need to find where the test files and result files are.
# test files are usually in a t/ dir inside suite dir. Or directly in the
# suite dir. result files are in a r/ dir or in the suite dir.
# Overlay uses t/ and r/ if and only if its parent does.
if ($parent) {
$suite->{parent} = $parent;
my $tdir = $parent->{tdir};
my $rdir = $parent->{rdir};
substr($tdir, 0, length $parent->{dir}) = $suitedir;
substr($rdir, 0, length $parent->{dir}) = $suitedir;
$suite->{tdir} = $tdir if -d $tdir;
$suite->{rdir} = $rdir if -d $rdir;
} else {
my $tdir= "$suitedir/t";
my $rdir= "$suitedir/r";
$suite->{tdir} = -d $tdir ? $tdir : $suitedir;
$suite->{rdir} = -d $rdir ? $rdir : $suite->{tdir};
}
mtr_verbose("testdir: " . $suite->{tdir});
mtr_verbose( "resdir: " . $suite->{rdir});
# disabled.def # disabled.def
parse_disabled("$testdir/disabled.def", $suitename); parse_disabled($suite->{dir} .'/disabled.def', $suitename);
# combinations # combinations
if (@::opt_combinations) if (@::opt_combinations)
@ -390,121 +450,53 @@ sub collect_one_suite
} }
else else
{ {
my @combs = combinations_from_file("$suitedir/combinations"); my @combs;
@combs = combinations_from_file($parent, "$suitedir/combinations")
unless $suite->{skip};
$suite->{combinations} = [ @combs ]; $suite->{combinations} = [ @combs ];
# in overlays it's a union of parent's and overlay's files.
unshift @{$suite->{combinations}}, @{$parent->{combinations}} if $parent;
} }
# suite.opt # suite.opt
# in overlays it's a union of parent's and overlay's files.
$suite->{opts} = [ opts_from_file("$suitedir/suite.opt") ]; $suite->{opts} = [ opts_from_file("$suitedir/suite.opt") ];
$suite->{in_overlay} = 1 if $parent and @{$suite->{opts}};
unshift @{$suite->{opts}}, @{$parent->{opts}} if $parent;
$suite->{cases} = [ $suite->list_cases($suite->{tdir}) ];
} }
my @case_names= $suite->list_cases($testdir); my %all_cases;
%all_cases = map { $_ => $parent->{tdir} } @{$parent->{cases}} if $parent;
if ( @$opt_cases ) $all_cases{$_} = $suite->{tdir} for @{$suite->{cases}};
{
my (%case_names)= map { $_ => 1 } @case_names;
@case_names= ();
my @cases;
if (@$opt_cases) {
# Collect in specified order # Collect in specified order
foreach my $test_name_spec ( @$opt_cases ) foreach my $test_name_spec ( @$opt_cases )
{ {
my ($sname, $tname)= split_testname($test_name_spec); my ($sname, $tname)= split_testname($test_name_spec);
# Check correct suite if suitename is defined # Check correct suite if suitename is defined
next if (defined $sname and $suitename ne $sname); next if defined $sname and $sname ne $suitename
and $sname ne "$basename-";
if (not $case_names{$tname}) next unless $all_cases{$tname};
{ push @cases, collect_one_test_case($suite, $all_cases{$tname}, $tname);
# This is only an error if suite was specified, otherwise it }
# could exist in another suite } else {
mtr_error("Test '$tname' was not found in suite '$sname'") for (sort keys %all_cases)
if $sname; {
# Skip tests that do not match the --do-test= filter
next; next if $do_test_reg and not /$do_test_reg/o;
} push @cases, collect_one_test_case($suite, $all_cases{$_}, $_);
push @case_names, $tname;
} }
} }
foreach (@case_names) @cases;
{
# Skip tests that do not match the --do-test= filter
next if ($do_test_reg and not $_ =~ /$do_test_reg/o);
push @cases, collect_one_test_case($suitename, $_);
}
# Return empty list if no testcases found
return if (@cases == 0);
optimize_cases(\@cases);
return @cases;
} }
#
# Loop through all test cases
# - optimize which test to run by skipping unnecessary ones
# - update settings if necessary
#
sub optimize_cases {
my ($cases)= @_;
my @new_cases= ();
foreach my $tinfo ( @$cases )
{
push @new_cases, $tinfo;
# Skip processing if already marked as skipped
next if $tinfo->{skip};
# =======================================================
# Check that engine selected by
# --default-storage-engine=<engine> is supported
# =======================================================
#
# mandatory engines cannot be disabled with --skip-FOO.
# That is, --FOO switch does not exist, and mtr cannot detect
# if the engine is available.
#
my %mandatory_engines = ('myisam' => 1, 'memory' => 1, 'csv' => 1);
foreach my $opt ( @{$tinfo->{master_opt}} ) {
my $default_engine=
mtr_match_prefix($opt, "--default-storage-engine=");
# Allow use of uppercase, convert to all lower case
$default_engine =~ tr/A-Z/a-z/;
if (defined $default_engine){
#print " $tinfo->{name}\n";
#print " - The test asked to use '$default_engine'\n";
#my $engine_value= $::mysqld_variables{$default_engine};
#print " - The mysqld_variables says '$engine_value'\n";
if ( ! exists $::mysqld_variables{$default_engine} and
! exists $mandatory_engines{$default_engine} )
{
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}=
"'$default_engine' not supported";
}
$tinfo->{'ndb_test'}= 1
if ( $default_engine =~ /^ndb/i );
}
}
}
@$cases= @new_cases;
}
# #
# Read options from the given opt file and append them as an array # Read options from the given opt file and append them as an array
# to $tinfo->{$opt_name} # to $tinfo->{$opt_name}
@ -549,6 +541,12 @@ sub make_combinations($@)
my ($test, @combinations) = @_; my ($test, @combinations) = @_;
return ($test) if $test->{'skip'} or not @combinations; return ($test) if $test->{'skip'} or not @combinations;
if ($combinations[0]->{skip}) {
$test->{skip} = 1;
$test->{comment} = $combinations[0]->{skip} unless $test->{comment};
die unless @combinations == 1;
return ($test);
}
foreach my $comb (@combinations) foreach my $comb (@combinations)
{ {
@ -578,6 +576,8 @@ sub make_combinations($@)
# Add combination name short name # Add combination name short name
push @{$new_test->{combinations}}, $comb->{name}; push @{$new_test->{combinations}}, $comb->{name};
$new_test->{in_overlay} = 1 if $comb->{in_overlay};
# Add the new test to new test cases list # Add the new test to new test cases list
push(@cases, $new_test); push(@cases, $new_test);
} }
@ -585,6 +585,23 @@ sub make_combinations($@)
} }
sub find_file_in_dirs
{
my ($tinfo, $slot, $filename) = @_;
my $parent = $tinfo->{suite}->{parent};
my $f = $tinfo->{suite}->{$slot} . '/' . $filename;
if (-f $f) {
$tinfo->{in_overlay} = 1 if $parent;
return $f;
}
return undef unless $parent;
$f = $parent->{$slot} . '/' . $filename;
return -f $f ? $f : undef;
}
############################################################################## ##############################################################################
# #
# Collect information about a single test case # Collect information about a single test case
@ -592,15 +609,13 @@ sub make_combinations($@)
############################################################################## ##############################################################################
sub collect_one_test_case { sub collect_one_test_case {
my $suitename= shift; my $suite = shift;
my $tname= shift; my $tpath = shift;
my $tname = shift;
my $name = "$suitename.$tname"; my $suitename = $suite->{name};
my $suite = $suites{$suitename}; my $name = "$suitename.$tname";
my $suitedir = $suite->{dir}; my $filename = "$tpath/${tname}.test";
my $testdir = $suite->{tdir};
my $resdir = $suite->{rdir};
my $filename = "$testdir/${tname}.test";
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Set defaults # Set defaults
@ -611,6 +626,7 @@ sub collect_one_test_case {
shortname => $tname, shortname => $tname,
path => $filename, path => $filename,
suite => $suite, suite => $suite,
in_overlay => $suite->{in_overlay},
master_opt => [ @{$suite->{opts}} ], master_opt => [ @{$suite->{opts}} ],
slave_opt => [ @{$suite->{opts}} ], slave_opt => [ @{$suite->{opts}} ],
); );
@ -618,8 +634,8 @@ sub collect_one_test_case {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Skip some tests but include in list, just mark them as skipped # Skip some tests but include in list, just mark them as skipped
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
if ( $skip_test_reg and ($tname =~ /$skip_test_reg/o || if ( $skip_test_reg and ($tname =~ /$skip_test_reg/o or
$name =~ /$skip_test/o)) $name =~ /$skip_test_reg/o))
{ {
$tinfo->{'skip'}= 1; $tinfo->{'skip'}= 1;
return $tinfo; return $tinfo;
@ -629,34 +645,41 @@ sub collect_one_test_case {
# Check for disabled tests # Check for disabled tests
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
my $disable = $disabled{".$tname"} || $disabled{$name}; my $disable = $disabled{".$tname"} || $disabled{$name};
if ($disable) if (not defined $disable and $suite->{parent}) {
$disable = $disabled{$suite->{parent}->{name} . ".$tname"};
}
if (defined $disable)
{ {
$tinfo->{comment}= $disable; $tinfo->{comment}= $disable;
if ( $enable_disabled ) if ( $enable_disabled )
{ {
# User has selected to run all disabled tests # User has selected to run all disabled tests
mtr_report(" - $tinfo->{name} wil be run although it's been disabled\n", mtr_report(" - $tinfo->{name} wil be run although it's been disabled\n",
" due to '$tinfo->{comment}'"); " due to '$disable'");
} }
else else
{ {
$tinfo->{'skip'}= 1; $tinfo->{'skip'}= 1;
$tinfo->{'disable'}= 1; # Sub type of 'skip' $tinfo->{'disable'}= 1; # Sub type of 'skip'
return $tinfo;
# we can stop test file processing early if the test if disabled, but
# only if we're not in the overlay. for overlays we want to know exactly
# whether the test is ignored (in_overlay=0) or disabled.
return $tinfo unless $suite->{parent};
} }
} }
if ($suite->{skip}) { if ($suite->{skip}) {
$tinfo->{skip}= 1; $tinfo->{skip}= 1;
$tinfo->{comment}= $suite->{skip}; $tinfo->{comment}= $suite->{skip} unless $tinfo->{comment};
return $tinfo; return $tinfo unless $suite->{parent};
} }
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Check for test specific config file # Check for test specific config file
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
my $test_cnf_file= "$testdir/$tname.cnf"; my $test_cnf_file= find_file_in_dirs($tinfo, tdir => "$tname.cnf");
if ( -f $test_cnf_file ) { if ($test_cnf_file ) {
# Specifies the configuration file to use for this test # Specifies the configuration file to use for this test
$tinfo->{'template_path'}= $test_cnf_file; $tinfo->{'template_path'}= $test_cnf_file;
} }
@ -664,8 +687,8 @@ sub collect_one_test_case {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# master sh # master sh
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
my $master_sh= "$testdir/$tname-master.sh"; my $master_sh= find_file_in_dirs($tinfo, tdir => "$tname-master.sh");
if ( -f $master_sh ) if ($master_sh)
{ {
if ( IS_WIN32PERL ) if ( IS_WIN32PERL )
{ {
@ -682,8 +705,8 @@ sub collect_one_test_case {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# slave sh # slave sh
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
my $slave_sh= "$testdir/$tname-slave.sh"; my $slave_sh= find_file_in_dirs($tinfo, tdir => "$tname-slave.sh");
if ( -f $slave_sh ) if ($slave_sh)
{ {
if ( IS_WIN32PERL ) if ( IS_WIN32PERL )
{ {
@ -697,8 +720,8 @@ sub collect_one_test_case {
} }
} }
my ($master_opts, $slave_opts)= my ($master_opts, $slave_opts)= tags_from_test_file($tinfo);
tags_from_test_file($tinfo, $filename, $suitedir); $tinfo->{in_overlay} = 1 if $file_in_overlay{$filename};
if ( $tinfo->{'big_test'} and ! $::opt_big_test ) if ( $tinfo->{'big_test'} and ! $::opt_big_test )
{ {
@ -760,41 +783,19 @@ sub collect_one_test_case {
} }
} }
if ( $tinfo->{'need_ipv6'} )
{
# This is a test that needs ssl
if ( ! $::have_ipv6 ) {
# IPv6 is not supported, skip it
$tinfo->{'skip'}= 1;
$tinfo->{'comment'}= "No IPv6";
return $tinfo;
}
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Find config file to use if not already selected in <testname>.opt file # Find config file to use if not already selected in <testname>.opt file
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
if (defined $defaults_file) { if (not $tinfo->{template_path} )
# Using same config file for all tests
$tinfo->{template_path}= $defaults_file;
}
elsif (! $tinfo->{template_path} )
{ {
my $config= "$suitedir/my.cnf"; my $config= find_file_in_dirs($tinfo, dir => 'my.cnf');
if (! -f $config ) if (not $config)
{ {
# assume default.cnf will be used
$config= "include/default_my.cnf";
# Suite has no config, autodetect which one to use # Suite has no config, autodetect which one to use
if ( $tinfo->{rpl_test} ){ if ($tinfo->{rpl_test}) {
$config= "suite/rpl/my.cnf"; $config= "suite/rpl/my.cnf";
if ( $tinfo->{ndb_test} ){ } else {
$config= "suite/rpl_ndb/my.cnf"; $config= "include/default_my.cnf";
}
}
elsif ( $tinfo->{ndb_test} ){
$config= "suite/ndb/my.cnf";
} }
} }
$tinfo->{template_path}= $config; $tinfo->{template_path}= $config;
@ -816,34 +817,86 @@ sub collect_one_test_case {
} }
for $tinfo (@cases) { for $tinfo (@cases) {
#
# Now we find a result file for every test file. It's a bit complicated.
# For a test foobar.test in the combination pair {aa,bb}, and in the
# overlay "rty" to the suite "qwe", in other words, for the
# that that mtr prints as
# ...
# qwe-rty.foobar 'aa,bb' [ pass ]
# ...
# the result can be expected in
# * either .rdiff or .result file
# * either in the overlay or in the original suite
# * with or without combinations in the file name.
# which means any of the following 15 file names can be used:
#
# 1 rty/r/foo,aa,bb.result
# 2 rty/r/foo,aa,bb.rdiff
# 3 qwe/r/foo,aa,bb.result
# 4 qwe/r/foo,aa,bb.rdiff
# 5 rty/r/foo,aa.result
# 6 rty/r/foo,aa.rdiff
# 7 qwe/r/foo,aa.result
# 8 qwe/r/foo,aa.rdiff
# 9 rty/r/foo,bb.result
# 10 rty/r/foo,bb.rdiff
# 11 qwe/r/foo,bb.result
# 12 qwe/r/foo,bb.rdiff
# 13 rty/r/foo.result
# 14 rty/r/foo.rdiff
# 15 qwe/r/foo.result
#
# They are listed, precisely, in the order of preference.
# mtr will walk that list from top to bottom and the first file that
# is found will be used.
#
# If this found file is a .rdiff, mtr continues walking down the list
# until the first .result file is found.
# A .rdiff is applied to that .result.
#
my $re ='';
if ($tinfo->{combinations}) { if ($tinfo->{combinations}) {
my $re = '(?:' . join('|', @{$tinfo->{combinations}}) . ')'; $re = '(?:' . join('|', @{$tinfo->{combinations}}) . ')';
my $found = 0; }
for (<$resdir/$tname,*.{rdiff,result}>) { my $resdirglob = $suite->{rdir};
my ($combs, $ext) = m@$tname((?:,$re)+)\.(rdiff|result)$@ or next; $resdirglob.= ',' . $suite->{parent}->{rdir} if $suite->{parent};
my @commas = ($combs =~ m/,/g);
# prefer the most specific result file my %files;
if (@commas > $found) { for (<{$resdirglob}/$tname*.{rdiff,result}>) {
$found = @commas; my ($path, $combs, $ext) =
$tinfo->{result_file} = $_; m@^(.*)/$tname((?:,$re)*)\.(rdiff|result)$@ or next;
if ($ext eq 'rdiff' and not $::exe_patch) { my @combs = sort split /,/, $combs;
$tinfo->{skip} = 1; $files{$_} = join '~', ( # sort files by
$tinfo->{comment} = "requires patch executable"; 99 - scalar(@combs), # number of combinations DESC
} join(',', sort @combs), # combination names ASC
$path eq $suite->{rdir} ? 1 : 2, # overlay first
$ext eq 'result' ? 1 : 2 # result before rdiff
);
}
my @results = sort { $files{$a} cmp $files{$b} } keys %files;
if (@results) {
my $result_file = shift @results;
$tinfo->{result_file} = $result_file;
if ($result_file =~ /\.rdiff$/) {
shift @results while $results[0] =~ /\.rdiff$/;
mtr_error ("$result_file has no corresponding .result file")
unless @results;
$tinfo->{base_result} = $results[0];
if (not $::exe_patch) {
$tinfo->{skip} = 1;
$tinfo->{comment} = "requires patch executable";
} }
} }
} } else {
# No .result file exist
unless (defined $tinfo->{result_file}) { # Remember the path where it should be
my $result_file= "$resdir/$tname.result"; # saved in case of --record
if (-f $result_file) { $tinfo->{record_file}= $suite->{rdir} . "/$tname.result";
$tinfo->{result_file}= $result_file;
} else {
# No .result file exist
# Remember the path where it should be
# saved in case of --record
$tinfo->{record_file}= $result_file;
}
} }
} }
@ -856,16 +909,11 @@ my $tags_map= {'big_test' => ['big_test', 1],
'have_multi_ndb' => ['ndb_test', 1], 'have_multi_ndb' => ['ndb_test', 1],
'master-slave' => ['rpl_test', 1], 'master-slave' => ['rpl_test', 1],
'ndb_master-slave' => ['rpl_test', 1, 'ndb_test', 1], 'ndb_master-slave' => ['rpl_test', 1, 'ndb_test', 1],
'check_ipv6' => ['need_ipv6', 1],
'long_test' => ['long_test', 1], 'long_test' => ['long_test', 1],
}; };
my $tags_regex_string= join('|', keys %$tags_map); my $tags_regex_string= join('|', keys %$tags_map);
my $tags_regex= qr:include/($tags_regex_string)\.inc:o; my $tags_regex= qr:include/($tags_regex_string)\.inc:o;
my %file_to_tags;
my %file_to_master_opts;
my %file_to_slave_opts;
# Get various tags from a file, recursively scanning also included files. # Get various tags from a file, recursively scanning also included files.
# And get options from .opt file, also recursively for included files. # And get options from .opt file, also recursively for included files.
# Return a list of [TAG_TO_SET, VALUE_TO_SET_TO] of found tags. # Return a list of [TAG_TO_SET, VALUE_TO_SET_TO] of found tags.
@ -875,7 +923,7 @@ my %file_to_slave_opts;
# We need to be a bit careful about speed here; previous version of this code # We need to be a bit careful about speed here; previous version of this code
# took forever to scan the full test suite. # took forever to scan the full test suite.
sub get_tags_from_file($$) { sub get_tags_from_file($$) {
my ($file, $suitedir)= @_; my ($file, $suite)= @_;
return @{$file_to_tags{$file}} if exists $file_to_tags{$file}; return @{$file_to_tags{$file}} if exists $file_to_tags{$file};
@ -887,6 +935,25 @@ sub get_tags_from_file($$) {
my $slave_opts= []; my $slave_opts= [];
my @combinations; my @combinations;
my $over = defined $suite->{parent};
my $sdir = $suite->{dir};
my $pdir = $suite->{parent}->{dir} if $over;
my $in_overlay = 0;
my $suffix = $file;
my @prefix = ('');
# to be able to look up all auxillary files in the overlay
# we split the file path in a prefix and a suffix
if ($file =~ m@^$sdir/(.*)$@) {
$suffix = $1;
@prefix = ("$sdir/");
push @prefix, "$pdir/" if $over;
$in_overlay = $over;
} elsif ($over and $file =~ m@^$pdir/(.*)$@) {
$suffix = $1;
@prefix = map { "$_/" } $sdir, $pdir;
}
while (my $line= <$F>) while (my $line= <$F>)
{ {
# Ignore comments. # Ignore comments.
@ -906,20 +973,23 @@ sub get_tags_from_file($$) {
if ($line =~ /^(--)?[[:space:]]*source[[:space:]]+([^;[:space:]]+)/) if ($line =~ /^(--)?[[:space:]]*source[[:space:]]+([^;[:space:]]+)/)
{ {
my $include= $2; my $include= $2;
# Sourced file may exist relative to test file, or in global location. # The rules below must match open_file() function of mysqltest.cc
# Note that for the purpose of tag collection we ignore # Note that for the purpose of tag collection we ignore
# non-existing files, and let mysqltest handle the error # non-existing files, and let mysqltest handle the error
# (e.g. mysqltest.test needs this) # (e.g. mysqltest.test needs this)
for my $sourced_file (dirname($file) . '/' . $include, for ((map { dirname("$_$suffix") } @prefix),
$suitedir . '/' . $include, $sdir, $pdir, $::glob_mysql_test_dir)
$::glob_mysql_test_dir . '/' . $include)
{ {
next unless defined $_;
my $sourced_file = "$_/$include";
next if $sourced_file eq $file;
if (-e $sourced_file) if (-e $sourced_file)
{ {
push @$tags, get_tags_from_file($sourced_file, $suitedir); push @$tags, get_tags_from_file($sourced_file, $suite);
push @$master_opts, @{$file_to_master_opts{$sourced_file}}; push @$master_opts, @{$file_to_master_opts{$sourced_file}};
push @$slave_opts, @{$file_to_slave_opts{$sourced_file}}; push @$slave_opts, @{$file_to_slave_opts{$sourced_file}};
push @combinations, @{$file_combinations{$sourced_file}}; push @combinations, @{$file_combinations{$sourced_file}};
$file_in_overlay{$file} ||= $file_in_overlay{$sourced_file};
last; last;
} }
} }
@ -929,30 +999,48 @@ sub get_tags_from_file($$) {
# Add options from main file _after_ those of any includes; this allows a # Add options from main file _after_ those of any includes; this allows a
# test file to override options set by includes (eg. rpl.rpl_ddl uses this # test file to override options set by includes (eg. rpl.rpl_ddl uses this
# to enable innodb, then disable innodb in the slave. # to enable innodb, then disable innodb in the slave.
my $file_no_ext= $file; $suffix =~ s/\.\w+$//;
$file_no_ext =~ s/\.\w+$//;
my @common_opts= opts_from_file("$file_no_ext.opt");
push @$master_opts, @common_opts, opts_from_file("$file_no_ext-master.opt");
push @$slave_opts, @common_opts, opts_from_file("$file_no_ext-slave.opt");
push @combinations, [ combinations_from_file("$file_no_ext.combinations") ]; for (qw(.opt -master.opt -slave.opt)) {
my @res;
push @res, opts_from_file("$prefix[1]$suffix$_") if $over;
if (-f "$prefix[0]$suffix$_") {
$in_overlay = $over;
push @res, opts_from_file("$prefix[0]$suffix$_");
}
push @$master_opts, @res unless /slave/;
push @$slave_opts, @res unless /master/;
}
# for combinations we need to make sure that its suite object is loaded,
# even if this file does not belong to a current suite!
my $comb_file = "$suffix.combinations";
$suite = load_suite_for_file($comb_file) if $prefix[0] eq '';
my @comb;
unless ($suite->{skip}) {
@comb = combinations_from_file($over, "$prefix[0]$comb_file");
push @comb, combinations_from_file(undef, "$prefix[1]$comb_file") if $over;
}
push @combinations, [ @comb ];
# Save results so we can reuse without parsing if seen again. # Save results so we can reuse without parsing if seen again.
$file_to_tags{$file}= $tags; $file_to_tags{$file}= $tags;
$file_to_master_opts{$file}= $master_opts; $file_to_master_opts{$file}= $master_opts;
$file_to_slave_opts{$file}= $slave_opts; $file_to_slave_opts{$file}= $slave_opts;
$file_combinations{$file}= [ uniq(@combinations) ]; $file_combinations{$file}= [ uniq(@combinations) ];
$file_in_overlay{$file} = 1 if $in_overlay;
return @{$tags}; return @{$tags};
} }
sub tags_from_test_file { sub tags_from_test_file {
my ($tinfo, $file, $suitedir)= @_; my ($tinfo)= @_;
my $file = $tinfo->{path};
# a suite may generate tests that don't map to real *.test files # a suite may generate tests that don't map to real *.test files
# see unit suite for an example. # see unit suite for an example.
return ([], []) unless -f $file; return ([], []) unless -f $file;
for (get_tags_from_file($file, $suitedir)) for (get_tags_from_file($file, $tinfo->{suite}))
{ {
$tinfo->{$_->[0]}= $_->[1]; $tinfo->{$_->[0]}= $_->[1];
} }
@ -973,7 +1061,7 @@ sub opts_from_file ($) {
return () unless -f $file; return () unless -f $file;
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); open(FILE, '<', $file) or mtr_error("can't open file \"$file\": $!");
my @args; my @args;
while ( <FILE> ) while ( <FILE> )
{ {

View File

@ -161,7 +161,7 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite. # executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
my $DEFAULT_SUITES= join(',', qw( my $DEFAULT_SUITES= join(',', map { "$_-" } qw(
main main
binlog binlog
federated federated
@ -208,7 +208,6 @@ my $opt_ssl;
my $opt_skip_ssl; my $opt_skip_ssl;
my @opt_skip_test_list; my @opt_skip_test_list;
our $opt_ssl_supported; our $opt_ssl_supported;
our $have_ipv6;
my $opt_ps_protocol; my $opt_ps_protocol;
my $opt_sp_protocol; my $opt_sp_protocol;
my $opt_cursor_protocol; my $opt_cursor_protocol;
@ -339,9 +338,8 @@ my $exe_ndb_mgmd;
my $exe_ndb_waiter; my $exe_ndb_waiter;
my $exe_ndb_mgm; my $exe_ndb_mgm;
our $debug_compiled_binaries;
our %mysqld_variables; our %mysqld_variables;
our @optional_plugins;
my $source_dist= 0; my $source_dist= 0;
@ -432,11 +430,11 @@ sub main {
{ {
# Run the mysqld to find out what features are available # Run the mysqld to find out what features are available
collect_mysqld_features(); collect_mysqld_features();
mysql_install_db(default_mysqld(), "$opt_vardir/install.db");
} }
check_ndbcluster_support(\%mysqld_variables); check_ndbcluster_support();
check_ssl_support(\%mysqld_variables); check_ssl_support();
check_ipv6_support(); check_debug_support();
check_debug_support(\%mysqld_variables);
executable_setup(); executable_setup();
@ -1860,8 +1858,6 @@ sub set_build_thread_ports($) {
sub collect_mysqld_features { sub collect_mysqld_features {
my $found_variable_list_start= 0;
# #
# Execute "mysqld --no-defaults --help --verbose" to get a # Execute "mysqld --no-defaults --help --verbose" to get a
# list of all features and settings # list of all features and settings
@ -1878,6 +1874,7 @@ sub collect_mysqld_features {
mtr_add_arg($args, "--basedir=%s", $basedir); mtr_add_arg($args, "--basedir=%s", $basedir);
mtr_add_arg($args, "--lc-messages-dir=%s", $path_language); mtr_add_arg($args, "--lc-messages-dir=%s", $path_language);
mtr_add_arg($args, "--skip-grant-tables"); mtr_add_arg($args, "--skip-grant-tables");
mtr_add_arg($args, "--log-warnings=0");
for (@opt_extra_mysqld_opt) { for (@opt_extra_mysqld_opt) {
mtr_add_arg($args, $_) unless /^--binlog-format\b/; mtr_add_arg($args, $_) unless /^--binlog-format\b/;
} }
@ -1896,70 +1893,40 @@ sub collect_mysqld_features {
my $exe_mysqld= find_mysqld($bindir); my $exe_mysqld= find_mysqld($bindir);
my $cmd= join(" ", $exe_mysqld, @$args); my $cmd= join(" ", $exe_mysqld, @$args);
my $list= `$cmd`;
mtr_verbose("cmd: $cmd"); mtr_verbose("cmd: $cmd");
foreach my $line (split('\n', $list)) my $list= `$cmd`;
{
# First look for version
if ( !$mysql_version_id )
{
# Look for version
my $exe_name= basename($exe_mysqld);
mtr_verbose("exe_name: $exe_name");
if ( $line =~ /^\S*$exe_name\s\sVer\s([0-9]*)\.([0-9]*)\.([0-9]*)([^\s]*)/ )
{
#print "Major: $1 Minor: $2 Build: $3\n";
$mysql_version_id= $1*10000 + $2*100 + $3;
#print "mysql_version_id: $mysql_version_id\n";
mtr_report("MariaDB Version $1.$2.$3");
$mysql_version_extra= $4;
}
}
else
{
if (!$found_variable_list_start)
{
# Look for start of variables list
if ( $line =~ /[\-]+\s[\-]+/ )
{
$found_variable_list_start= 1;
}
}
else
{
# Put variables into hash
if ( $line =~ /^([\S]+)[ \t]+(.*?)\r?$/ )
{
my $name= $1;
my $value=$2;
$name =~ s/_/-/g;
# print "$name=\"$value\"\n";
$mysqld_variables{$name}= $value;
}
else
{
# The variable list is ended with a blank line
if ( $line =~ /^[\s]*$/ )
{
last;
}
else
{
# Send out a warning, we should fix the variables that has no
# space between variable name and it's value
# or should it be fixed width column parsing? It does not
# look like that in function my_print_variables in my_getopt.c
mtr_warning("Could not parse variable list line : $line");
}
}
}
}
}
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
mtr_error("Could not find variabes list") unless $found_variable_list_start;
# to simplify the parsing, we'll merge all nicely formatted --help texts
$list =~ s/\n {22}(\S)/ $1/g;
my @list= split '\n', $list;
mtr_error("Could not find version of MariaDB")
unless shift(@list) =~ /^$exe_mysqld\s+Ver\s(\d+)\.(\d+)\.(\d+)(\S*)/;
$mysql_version_id= $1*10000 + $2*100 + $3;
$mysql_version_extra= $4;
mtr_report("MariaDB Version $1.$2.$3$4");
for (@list)
{
# first part of the help - command-line options.
if (/Copyright/ .. /^-{30,}/) {
# here we want to detect all not mandatory plugins
# they are listed in the --help output as
# --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load).
push @optional_plugins, $1
if /^ --([-a-z0-9]+)\[=name\] +Enable or disable \w+ plugin. Possible values are ON, OFF, FORCE/;
next;
}
last if /^$/; # then goes a list of variables, it ends with an empty line
# Put a variable into hash
/^([\S]+)[ \t]+(.*?)\r?$/ or die "Could not parse mysqld --help: $_\n";
$mysqld_variables{$1}= $2;
}
mtr_error("Could not find variabes list") unless %mysqld_variables;
} }
@ -2789,9 +2756,7 @@ sub check_running_as_root () {
} }
sub check_ssl_support ($) { sub check_ssl_support {
my $mysqld_variables= shift;
if ($opt_skip_ssl) if ($opt_skip_ssl)
{ {
mtr_report(" - skipping SSL"); mtr_report(" - skipping SSL");
@ -2800,7 +2765,7 @@ sub check_ssl_support ($) {
return; return;
} }
if ( ! $mysqld_variables->{'ssl'} ) if ( ! $mysqld_variables{'ssl'} )
{ {
if ( $opt_ssl) if ( $opt_ssl)
{ {
@ -2816,29 +2781,15 @@ sub check_ssl_support ($) {
$opt_ssl_supported= 1; $opt_ssl_supported= 1;
} }
sub check_ipv6_support { sub check_debug_support {
use Socket; if (defined $mysqld_variables{'debug-dbug'})
$have_ipv6 = socket SOCK, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
close SOCK;
}
sub check_debug_support ($) {
my $mysqld_variables= shift;
my $debug_var= $mysqld_variables->{'debug'};
if ( !$debug_var || $debug_var eq "disabled")
{ {
#mtr_report(" - binaries are not debug compiled"); mtr_report(" - binaries are debug compiled");
$debug_compiled_binaries= 0; }
elsif ($opt_debug_server)
if ( $opt_debug_server ) {
{ mtr_error("Can't use --debug[-server], binary does not support it");
mtr_error("Can't use --debug[-server], binary does not support it");
}
return;
} }
mtr_report(" - binaries are debug compiled");
$debug_compiled_binaries= 1;
} }
@ -2901,8 +2852,7 @@ sub vs_config_dirs ($$) {
} }
sub check_ndbcluster_support ($) { sub check_ndbcluster_support {
my $mysqld_variables= shift;
# Check if this is MySQL Cluster, ie. mysql version string ends # Check if this is MySQL Cluster, ie. mysql version string ends
# with -ndb-Y.Y.Y[-status] # with -ndb-Y.Y.Y[-status]
@ -3396,8 +3346,6 @@ sub initialize_servers {
{ {
remove_stale_vardir(); remove_stale_vardir();
setup_vardir(); setup_vardir();
mysql_install_db(default_mysqld(), "$opt_vardir/install.db");
} }
} }
} }
@ -3490,10 +3438,7 @@ sub mysql_install_db {
mtr_add_arg($args, "--basedir=%s", $install_basedir); mtr_add_arg($args, "--basedir=%s", $install_basedir);
mtr_add_arg($args, "--datadir=%s", $install_datadir); mtr_add_arg($args, "--datadir=%s", $install_datadir);
mtr_add_arg($args, "--default-storage-engine=myisam"); mtr_add_arg($args, "--default-storage-engine=myisam");
mtr_add_arg($args, "--loose-skip-innodb"); mtr_add_arg($args, "--skip-$_") for @optional_plugins;
mtr_add_arg($args, "--loose-skip-pbxt");
mtr_add_arg($args, "--loose-skip-ndbcluster");
mtr_add_arg($args, "--loose-skip-aria");
mtr_add_arg($args, "--disable-sync-frm"); mtr_add_arg($args, "--disable-sync-frm");
mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/"); mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/");
mtr_add_arg($args, "--core-file"); mtr_add_arg($args, "--core-file");
@ -3719,23 +3664,27 @@ sub do_before_run_mysqltest($)
# Remove old files produced by mysqltest # Remove old files produced by mysqltest
die "unsupported result file name $resfile, stoping" unless die "unsupported result file name $resfile, stoping" unless
$resfile =~ /^(.*)\.(rdiff|result)$/; $resfile =~ /^(.*?)((?:,\w+)*)\.(rdiff|result)$/;
my $base_file= $1; my ($base_file, $suites, $ext)= ($1, $2, $3);
# if the result file is a diff, make a proper result file # if the result file is a diff, make a proper result file
if ($2 eq 'rdiff') { if ($ext eq 'rdiff') {
my $base_result = $tinfo->{base_result};
my $resdir= dirname($resfile); my $resdir= dirname($resfile);
# we'll use a separate extension for generated result files # we'll use a separate extension for generated result files
# to be able to distinguish them from manually created version # to be able to distinguish them from manually created
# controlled results, and to ignore them in bzr. # version-controlled results, and to ignore them in bzr.
my $dest = "$base_file.result~"; my $dest = "$base_file$suites.result~";
my @cmd = ($exe_patch, qw/--binary -r - -f -s -o/,
$dest, $base_result, $resfile);
if (-w $resdir) { if (-w $resdir) {
# don't rebuild a file if it's up to date # don't rebuild a file if it's up to date
unless (-e $dest and -M $dest < -M $resfile) { unless (-e $dest and -M $dest < -M $resfile
run_system("$exe_patch -o $dest -i $resfile -r - -f -s -d $resdir"); and -M $dest < -M $base_result) {
run_system(@cmd);
} }
} else { } else {
$dest = $opt_tmpdir . '/' . basename($dest); $cmd[-3] = $dest = $opt_tmpdir . '/' . basename($dest);
run_system("$exe_patch -o $dest -i $resfile -r - -f -s -d $resdir"); run_system(@cmd);
} }
$tinfo->{result_file} = $dest; $tinfo->{result_file} = $dest;
} }
@ -4064,7 +4013,7 @@ sub mycnf_create {
my ($config) = @_; my ($config) = @_;
my $res; my $res;
foreach my $group ($config->groups()) { foreach my $group ($config->option_groups()) {
$res .= "[$group->{name}]\n"; $res .= "[$group->{name}]\n";
foreach my $option ($group->options()) { foreach my $option ($group->options()) {
@ -4176,6 +4125,7 @@ sub run_testcase ($$) {
} else { } else {
delete($ENV{'TZ'}); delete($ENV{'TZ'});
} }
$ENV{MTR_SUITE_DIR} = $tinfo->{suite}->{dir};
mtr_verbose("Setting timezone: $timezone"); mtr_verbose("Setting timezone: $timezone");
if ( ! using_extern() ) if ( ! using_extern() )
@ -5228,10 +5178,9 @@ sub report_failure_and_restart ($) {
} }
sub run_system($) { sub run_system(@) {
my ($script)= @_; mtr_verbose("Running '$_[0]'");
mtr_verbose("Running '$script'"); my $ret= system(@_) >> 8;
my $ret= system($script) >> 8;
return $ret; return $ret;
} }
@ -5285,19 +5234,6 @@ sub mysqld_arguments ($$$) {
mtr_add_arg($args, "--user=root"); mtr_add_arg($args, "--user=root");
} }
if ( $opt_valgrind_mysqld )
{
if ( $mysql_version_id < 50100 )
{
mtr_add_arg($args, "--skip-bdb");
}
}
mtr_add_arg($args, "--loose-skip-safemalloc");
mtr_add_arg($args, "%s--disable-sync-frm");
# Retry bind as this may fail on busy server
mtr_add_arg($args, "%s--port-open-timeout=10");
# On some old linux kernels, aio on tmpfs is not supported # On some old linux kernels, aio on tmpfs is not supported
# Remove this if/when Bug #58421 fixes this in the server # Remove this if/when Bug #58421 fixes this in the server
if ($^O eq "linux" && $opt_mem) if ($^O eq "linux" && $opt_mem)
@ -5305,7 +5241,7 @@ sub mysqld_arguments ($$$) {
mtr_add_arg($args, "--loose-skip-innodb-use-native-aio"); mtr_add_arg($args, "--loose-skip-innodb-use-native-aio");
} }
if (!using_extern() and $mysql_version_id >= 50106 && !$opt_user_args) if (!using_extern() and !$opt_user_args)
{ {
# Turn on logging to file # Turn on logging to file
mtr_add_arg($args, "%s--log-output=file"); mtr_add_arg($args, "%s--log-output=file");
@ -5909,6 +5845,14 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "%s", $_) for @args_saved; mtr_add_arg($args, "%s", $_) for @args_saved;
} }
my $suite = $tinfo->{suite};
if ($suite->{parent}) {
mtr_add_arg($args, "--overlay-dir=%s/", $suite->{dir});
mtr_add_arg($args, "--suite-dir=%s/", $suite->{parent}->{dir});
} else {
mtr_add_arg($args, "--suite-dir=%s/", $suite->{dir});
}
mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'}); mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
# Number of lines of resut to include in failure report # Number of lines of resut to include in failure report

View File

@ -366,7 +366,7 @@ $dollar
drop table t1; drop table t1;
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 MariaDB 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 MariaDB 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: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2 mysqltest: At line 1: Could not open 'non_existingFile' for reading, errno: 2
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:

View File

@ -0,0 +1,12 @@
--- r/plugin_innodb.result 2011-10-21 23:35:26.000000000 +0200
+++ r/plugin_innodb.reject 2012-02-08 13:59:19.000000000 +0100
@@ -4,6 +4,9 @@
alter table mysql.plugin engine=innodb;
restart
create table t1(a int) engine=example;
+Warnings:
+Warning 1286 Unknown storage engine 'example'
+Warning 1266 Using storage engine MyISAM for table 't1'
select * from t1;
a
drop table t1;

View File

@ -0,0 +1,326 @@
--- r/range_vs_index_merge_innodb.result 2011-11-23 22:19:38.000000000 +0100
+++ r/range_vs_index_merge_innodb.reject 2012-02-08 13:04:41.000000000 +0100
@@ -50,14 +50,14 @@
WHERE (Population >= 100000 OR Name LIKE 'P%') AND Country='CAN' OR
(Population < 100000 OR Name Like 'T%') AND Country='ARG';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population,Country,Name Country 3 NULL 106 Using index condition; Using where
+1 SIMPLE City range Population,Country,Name Country 3 NULL 106 Using where
EXPLAIN
SELECT * FROM City
WHERE Population < 200000 AND Name LIKE 'P%' AND
(Population > 300000 OR Name LIKE 'T%') AND
(Population < 100000 OR Name LIKE 'Pa%');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population,Name Name 35 NULL 235 Using index condition; Using where
+1 SIMPLE City range Population,Name Name 35 NULL 235 Using where
EXPLAIN
SELECT * FROM City
WHERE Population > 100000 AND Name LIKE 'Aba%' OR
@@ -70,12 +70,12 @@
SELECT * FROM City
WHERE (Population > 101000 AND Population < 115000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 458 Using index condition
+1 SIMPLE City range Population Population 4 NULL 458 Using where
EXPLAIN
SELECT * FROM City
WHERE (Population > 101000 AND Population < 102000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 38 Using index condition
+1 SIMPLE City range Population Population 4 NULL 38 Using where
EXPLAIN
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'F'));
@@ -92,7 +92,7 @@
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'F'))
AND (Population > 101000 AND Population < 102000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population,Country,Name Population 4 NULL 38 Using index condition; Using where
+1 SIMPLE City range Population,Country,Name Population 4 NULL 38 Using where
SELECT * FROM City USE INDEX ()
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'F'))
AND (Population > 101000 AND Population < 115000);
@@ -172,37 +172,37 @@
EXPLAIN
SELECT * FROM City WHERE (Name < 'Ac');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 23 Using index condition
+1 SIMPLE City range Name Name 35 NULL 23 Using where
EXPLAIN
SELECT * FROM City WHERE (Name < 'Bb');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 373 Using index condition
+1 SIMPLE City range Name Name 35 NULL 373 Using where
EXPLAIN
SELECT * FROM City WHERE (Country > 'A' AND Country < 'B');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Country Country 3 NULL 106 Using index condition
+1 SIMPLE City range Country Country 3 NULL 106 Using where
EXPLAIN
SELECT * FROM City WHERE (Name BETWEEN 'P' AND 'Pb');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 71 Using index condition
+1 SIMPLE City range Name Name 35 NULL 71 Using where
EXPLAIN
SELECT * FROM City WHERE (Name BETWEEN 'P' AND 'S');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 384 Using index condition
+1 SIMPLE City range Name Name 35 NULL 384 Using where
EXPLAIN
SELECT * FROM City WHERE (Population > 101000 AND Population < 110000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 327 Using index condition
+1 SIMPLE City range Population Population 4 NULL 327 Using where
EXPLAIN
SELECT * FROM City WHERE (Population > 103000 AND Population < 104000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 36 Using index condition
+1 SIMPLE City range Population Population 4 NULL 36 Using where
EXPLAIN
SELECT * FROM City
WHERE (Name < 'Ac' AND (Country > 'A' AND Country < 'B')) OR
(Name BETWEEN 'P' AND 'Pb' AND (Population > 101000 AND Population < 110000));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population,Country,Name Name 35 NULL 94 Using index condition; Using where
+1 SIMPLE City range Population,Country,Name Name 35 NULL 94 Using where
EXPLAIN
SELECT * FROM City
WHERE (Name < 'Ac' AND (Country > 'A' AND Country < 'B')) OR
@@ -328,34 +328,34 @@
EXPLAIN
SELECT * FROM City WHERE (ID < 10) OR (ID BETWEEN 100 AND 110);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 20 Using index condition; Using where
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 20 Using where
EXPLAIN
SELECT * FROM City WHERE (ID < 200) OR (ID BETWEEN 100 AND 200);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 200 Using index condition; Using where
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 200 Using where
EXPLAIN
SELECT * FROM City WHERE (ID < 600) OR (ID BETWEEN 900 AND 1500);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 1198 Using index condition; Using where
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 1198 Using where
EXPLAIN
SELECT * FROM City WHERE Country > 'A' AND Country < 'ARG';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Country Country 3 NULL 19 Using index condition
+1 SIMPLE City range Country Country 3 NULL 19 Using where
EXPLAIN
SELECT * FROM City WHERE Name LIKE 'H%' OR Name LIKE 'P%' ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 394 Using index condition; Using where
+1 SIMPLE City range Name Name 35 NULL 394 Using where
EXPLAIN
SELECT * FROM City WHERE Name LIKE 'Ha%' OR Name LIKE 'Pa%' ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 133 Using index condition; Using where
+1 SIMPLE City range Name Name 35 NULL 133 Using where
EXPLAIN
SELECT * FROM City
WHERE ((ID < 10) AND (Name LIKE 'H%' OR (Country > 'A' AND Country < 'ARG')))
OR ((ID BETWEEN 100 AND 110) AND
(Name LIKE 'P%' OR (Population > 103000 AND Population < 104000)));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 20 Using index condition; Using where
+1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 20 Using where
EXPLAIN
SELECT * FROM City
WHERE ((ID < 800) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG')))
@@ -369,7 +369,7 @@
OR ((ID BETWEEN 100 AND 200) AND
(Name LIKE 'Pa%' OR (Population > 103000 AND Population < 104000)));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 200 Using index condition; Using where
+1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 200 Using where
SELECT * FROM City USE INDEX ()
WHERE ((ID < 10) AND (Name LIKE 'H%' OR (Country > 'A' AND Country < 'ARG')))
OR ((ID BETWEEN 100 AND 110) AND
@@ -577,39 +577,39 @@
EXPLAIN
SELECT * FROM City WHERE Population > 101000 AND Population < 102000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 38 Using index condition
+1 SIMPLE City range Population Population 4 NULL 38 Using where
EXPLAIN
SELECT * FROM City WHERE Population > 101000 AND Population < 110000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 327 Using index condition
+1 SIMPLE City range Population Population 4 NULL 327 Using where
EXPLAIN
SELECT * FROM City WHERE Country < 'C';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Country Country 3 NULL 446 Using index condition
+1 SIMPLE City range Country Country 3 NULL 446 Using where
EXPLAIN
SELECT * FROM City WHERE Country < 'AGO';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Country Country 3 NULL 5 Using index condition
+1 SIMPLE City range Country Country 3 NULL 5 Using where
EXPLAIN
SELECT * FROM City WHERE Name BETWEEN 'P' AND 'S';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 384 Using index condition
+1 SIMPLE City range Name Name 35 NULL 384 Using where
EXPLAIN
SELECT * FROM City WHERE Name BETWEEN 'P' AND 'Pb';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 71 Using index condition
+1 SIMPLE City range Name Name 35 NULL 71 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 3400 AND 3800;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 400 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 400 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 3790 AND 3800;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using where
EXPLAIN
SELECT * FROM City WHERE Name LIKE 'P%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 235 Using index condition
+1 SIMPLE City range Name Name 35 NULL 235 Using where
EXPLAIN
SELECT * FROM City
WHERE ((Population > 101000 AND Population < 102000) AND
@@ -680,23 +680,23 @@
EXPLAIN
SELECT * FROM City WHERE Name LIKE 'Pas%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 8 Using index condition
+1 SIMPLE City range Name Name 35 NULL 8 Using where
EXPLAIN
SELECT * FROM City WHERE Name LIKE 'P%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 235 Using index condition
+1 SIMPLE City range Name Name 35 NULL 235 Using where
EXPLAIN
SELECT * FROM City WHERE (Population > 101000 AND Population < 103000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 80 Using index condition
+1 SIMPLE City range Population Population 4 NULL 80 Using where
EXPLAIN
SELECT * FROM City WHERE Country='USA';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City ref Country,CountryPopulation Country 3 const 274 Using index condition
+1 SIMPLE City ref Country,CountryPopulation Country 3 const 274 Using where
EXPLAIN
SELECT * FROM City WHERE Country='FIN';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City ref Country,CountryPopulation Country 3 const 7 Using index condition
+1 SIMPLE City ref Country,CountryPopulation Country 3 const 7 Using where
EXPLAIN
SELECT * FROM City
WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'Pas%')
@@ -708,7 +708,7 @@
WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'P%')
AND Country='FIN';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City ref Population,Country,Name,CountryPopulation Country 3 const 7 Using index condition; Using where
+1 SIMPLE City ref Population,Country,Name,CountryPopulation Country 3 const 7 Using where
SELECT * FROM City
WHERE ((Population > 101000 AND Population < 103000) OR Name LIKE 'Pas%')
AND Country='USA';
@@ -753,51 +753,51 @@
EXPLAIN
SELECT * FROM City WHERE Country='USA';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 274 Using index condition
+1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 274 Using where
EXPLAIN
SELECT * FROM City WHERE Country='FIN';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 7 Using index condition
+1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 7 Using where
EXPLAIN
SELECT * FROM City WHERE Country='BRA';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 250 Using index condition
+1 SIMPLE City ref Country,CountryPopulation,CountryName Country 3 const 250 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 3790 AND 3800;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 4025 AND 4035;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 4028 AND 4032;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 5 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 5 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 3500 AND 3800;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 300 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 300 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 4000 AND 4300;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 80 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 80 Using where
EXPLAIN
SELECT * FROM City WHERE ID BETWEEN 250 and 260 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using index condition
+1 SIMPLE City range PRIMARY PRIMARY 4 NULL 11 Using where
EXPLAIN
SELECT * FROM City WHERE (Population > 101000 AND Population < 102000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 38 Using index condition
+1 SIMPLE City range Population Population 4 NULL 38 Using where
EXPLAIN
SELECT * FROM City WHERE (Population > 101000 AND Population < 103000);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population Population 4 NULL 80 Using index condition
+1 SIMPLE City range Population Population 4 NULL 80 Using where
EXPLAIN
SELECT * FROM City WHERE Name LIKE 'Pa%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Name Name 35 NULL 71 Using index condition
+1 SIMPLE City range Name Name 35 NULL 71 Using where
EXPLAIN
SELECT * FROM City
WHERE ((Population > 101000 AND Population < 102000) OR
@@ -818,7 +818,7 @@
ID BETWEEN 3500 AND 3800) AND Country='FIN'
AND (Name BETWEEN 'P' AND 'T' OR ID BETWEEN 4000 AND 4300);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City ref PRIMARY,Population,Country,Name,CountryPopulation,CountryName Country 3 const 7 Using index condition; Using where
+1 SIMPLE City ref PRIMARY,Population,Country,Name,CountryPopulation,CountryName Country 3 const 7 Using where
SELECT * FROM City USE INDEX ()
WHERE ((Population > 101000 AND Population < 102000) OR
ID BETWEEN 3790 AND 3800) AND Country='USA'
@@ -950,14 +950,14 @@
ID BETWEEN 3500 AND 3800) AND Country='USA'
AND (Name LIKE 'P%' OR ID BETWEEN 4000 AND 4300);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName 38 NULL 18 Using index condition; Using where
+1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName 38 NULL 18 Using where
EXPLAIN
SELECT * FROM City
WHERE ((Population > 101000 AND Population < 11000) OR
ID BETWEEN 3500 AND 3800) AND Country='USA'
AND (Name LIKE 'Pho%' OR ID BETWEEN 4000 AND 4300);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName Name 35 NULL 1 Using index condition; Using where
+1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName Name 35 NULL 1 Using where
SELECT * FROM City USE INDEX ()
WHERE ((Population > 101000 AND Population < 11000) OR
ID BETWEEN 3500 AND 3800) AND Country='USA'
@@ -1422,7 +1422,7 @@
WHERE t1.a>300 AND t1.c!=0 AND t1.b>=350 AND t1.b<=400 AND
(t1.c=0 OR t1.a=500);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,idx PRIMARY 4 NULL 1 Using index condition; Using where
+1 SIMPLE t1 range PRIMARY,idx PRIMARY 4 NULL 1 Using where
SELECT * FROM t1
WHERE t1.a>300 AND t1.c!=0 AND t1.b>=350 AND t1.b<=400 AND
(t1.c=0 OR t1.a=500);

View File

@ -5,12 +5,31 @@ package My::Suite::Main;
sub skip_combinations { sub skip_combinations {
my @combinations; my @combinations;
# disable innodb/xtradb combinatons for configurations that were not built
push @combinations, 'innodb_plugin' unless $ENV{HA_INNODB_SO}; push @combinations, 'innodb_plugin' unless $ENV{HA_INNODB_SO};
push @combinations, 'xtradb_plugin' unless $ENV{HA_XTRADB_SO}; push @combinations, 'xtradb_plugin' unless $ENV{HA_XTRADB_SO};
push @combinations, 'xtradb' unless $::mysqld_variables{'innodb'} eq "ON"; push @combinations, 'xtradb' unless $::mysqld_variables{'innodb'} eq "ON";
( 'include/have_innodb.combinations' => [ @combinations ] ) my %skip = ( 'include/have_innodb.combinations' => [ @combinations ]);
# as a special case, disable certain include files as a whole
$skip{'include/not_embedded.inc'} = 'Not run for embedded server'
if $::opt_embedded_server;
$skip{'include/have_debug.inc'} = 'Requires debug build'
unless defined $::mysqld_variables{'debug-dbug'};
$skip{'include/not_windows.inc'} = 'Requires not Windows' if IS_WINDOWS;
# disable tests that use ipv6, if unsupported
use Socket;
$skip{'include/check_ipv6.inc'} = 'No IPv6'
unless socket SOCK, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
close SOCK;
%skip;
} }
bless { }; bless { };

View File

@ -1,8 +1,6 @@
[old] [old]
--federated plugin-load=$HA_FEDERATED_SO
--plugin-load=$HA_FEDERATED_SO
[X] [X]
--federated plugin-load=$HA_FEDERATEDX_SO
--plugin-load=$HA_FEDERATEDX_SO

View File

@ -1 +1 @@
--plugin-load=$HA_FEDERATEDX_SO --plugin-load=$HA_FEDERATEDX_SO --federated

View File

@ -3,6 +3,7 @@
!include include/default_client.cnf !include include/default_client.cnf
[mysqld.1] [mysqld.1]
federated
#log-bin= master-bin #log-bin= master-bin
[mysqld.2] [mysqld.2]

View File

@ -13,7 +13,6 @@
# 2008-06-06 mleich Create this variant for the embedded server # 2008-06-06 mleich Create this variant for the embedded server
# #
--source include/have_innodb.inc
--source include/have_xtradb.inc --source include/have_xtradb.inc
if (`SELECT VERSION() NOT LIKE '%embedded%'`) if (`SELECT VERSION() NOT LIKE '%embedded%'`)

View File

@ -3,12 +3,13 @@
# #
# this file deletes old innodb files and restarts mysqld # this file deletes old innodb files and restarts mysqld
# #
source include/not_embedded.inc;
let $_server_id= `SELECT @@server_id`; let $_server_id= `SELECT @@server_id`;
let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect; let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect;
let $datadir= `SELECT @@datadir`; let $datadir= `SELECT @@datadir`;
exec echo "wait" > $_expect_file_name; exec echo "wait" > $_expect_file_name;
shutdown_server 10; # give it 10 seconds to die shutdown_server;
remove_file $datadir/ib_logfile0; remove_file $datadir/ib_logfile0;
remove_file $datadir/ib_logfile1; remove_file $datadir/ib_logfile1;
remove_file $datadir/ibdata1; remove_file $datadir/ibdata1;

View File

@ -4,7 +4,7 @@
# originally "innodb_file_format_check") with a user-Defined Variable. # originally "innodb_file_format_check") with a user-Defined Variable.
--source include/not_embedded.inc --source include/not_embedded.inc
--source suite/innodb/include/restart_and_reinit.inc --source include/restart_and_reinit.inc
# Save the value (Antelope) in 'innodb_file_format_max' to # Save the value (Antelope) in 'innodb_file_format_max' to
# 'old_innodb_file_format_max' # 'old_innodb_file_format_max'

View File

@ -1,5 +1,5 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--source suite/innodb/include/restart_and_reinit.inc --source include/restart_and_reinit.inc
let $innodb_file_format_orig=`select @@innodb_file_format`; let $innodb_file_format_orig=`select @@innodb_file_format`;

View File

@ -0,0 +1,5 @@
[c1]
allow-suspicious-udfs
[c2]
disable-local-infile

View File

@ -0,0 +1 @@
select @@local_infile;

View File

@ -0,0 +1 @@
let $a=1;

View File

@ -0,0 +1,3 @@
select 1;
1
1

View File

@ -0,0 +1,5 @@
#
# this tests how mtr handles a test that has no combinations in the
# parent suite and one combination in the overlay.
#
select 1;

View File

@ -0,0 +1,2 @@
select "proxy";
source combs.inc;

View File

@ -0,0 +1,3 @@
select "<>";
<>
<>

View File

@ -0,0 +1,4 @@
#
# Test file that includes itself. See self.test in the example overlay
#
eval select "<$a>";

View File

@ -0,0 +1,11 @@
--- suite/mtr/t/simple.result 2012-02-04 12:13:41.000000000 +0100
+++ suite/mtr/t/simple,infile,verbose.reject 2012-02-04 12:16:10.000000000 +0100
@@ -3,7 +3,7 @@
proxy
select @@local_infile;
@@local_infile
-1
+0
select @@old;
@@old
0

View File

@ -0,0 +1,11 @@
--- suite/mtr/t/simple,old.result 2012-02-04 12:13:25.000000000 +0100
+++ suite/mtr/t/simple,old,infile.reject 2012-02-04 12:13:59.000000000 +0100
@@ -3,7 +3,7 @@
proxy
select @@local_infile;
@@local_infile
-1
+0
select @@old;
@@old
1

View File

@ -0,0 +1,9 @@
select "proxy";
proxy
proxy
select @@local_infile;
@@local_infile
1
select @@old;
@@old
1

View File

@ -0,0 +1,5 @@
[s1]
verbose
[s2]
old

View File

@ -0,0 +1,9 @@
select "proxy";
proxy
proxy
select @@local_infile;
@@local_infile
1
select @@old;
@@old
0

View File

@ -0,0 +1,15 @@
#
# This tests the following:
# simple.test has two combinations (in simple.combinations).
# it includes combs.inc (indirectly, via proxy.inc) with two more combinations
# thus it should run 4 times
#
# combs.combinations is overlayed in the example overlay, adding one more
# combination. Thus simple.test must run two more times in the mtr-example.
#
# Note that neither simple.test nor proxy.inc are touched by the overlay,
# mtr needs to propagate "affected by the overlay" flag up the
# inclusion chain.
#
source proxy.inc;
select @@old;

View File

@ -0,0 +1,3 @@
select 1;
1
1

View File

@ -0,0 +1,5 @@
#
# the test is present in the mtr suite and is not affected by the example
# overlay. It should run only once.
#
select 1;

View File

@ -0,0 +1,3 @@
select 1;
1
1

View File

@ -0,0 +1,8 @@
#
# The inc.inc file is overlayed in the example overlay. mtr should correctly
# detect that this test needs to run for mtr-example. And mysqltest
# needs to use the correct version of inc.inc depending on whether it
# runs the parent suite or the overlay.
#
source inc.inc;
eval select $a;

View File

@ -0,0 +1,4 @@
select @@local_infile;
select @@max_error_count;
@@max_error_count
64

View File

@ -0,0 +1,10 @@
#
# This test has two combinations in the mtr suite (from combs.combinations)
# and one combination from mtr-example (overlayed combs.combinations).
# But it also has test2.opt file in the overlay. Thus it will run
# two times in the parent suite, and three times in the overlay.
#
--disable_result_log
source combs.inc;
--enable_result_log
select @@max_error_count;

View File

@ -0,0 +1,3 @@
select 1;
1
1

View File

@ -0,0 +1,6 @@
#
# There is testsh-master.sh in the example overlay. That makes the test
# "affected by the overlay" and it will run twice: for the parent suite and
# for the overlay.
#
select 1;

View File

@ -0,0 +1,3 @@
select 1;
1
1

View File

@ -0,0 +1,8 @@
#
# this suite is overlayed in heap and myisam.
# mtr2-heap has my.cnf, mtr2-myisam has suite.opt
# it means that all tests from the mtr2 suite will run
# three times - once for the parent suite, and once for each overlay.
# even if the test files are not overlayed.
#
select 1;

View File

@ -1,5 +1,5 @@
--source include/big_test.inc --source include/big_test.inc
--source include/have_innodb.inc --source include/have_xtradb.inc
drop table if exists t1; drop table if exists t1;
# #

View File

@ -2,7 +2,12 @@ package My::Suite::Plugins;
@ISA = qw(My::Suite); @ISA = qw(My::Suite);
$ENV{PAM_SETUP_FOR_MTR}=1 if -e '/etc/pam.d/mariadb_mtr'; sub skip_combinations {
my %skip;
$skip{'t/pam.test'} = 'No pam setup for mtr'
unless -e '/etc/pam.d/mariadb_mtr';
%skip;
}
bless { }; bless { };

View File

@ -5,10 +5,6 @@ if (!$AUTH_PAM_SO) {
skip No pam auth plugin; skip No pam auth plugin;
} }
if (!$PAM_SETUP_FOR_MTR) {
skip No pam setup for mtr;
}
eval install plugin pam soname '$AUTH_PAM_SO'; eval install plugin pam soname '$AUTH_PAM_SO';
create user test_pam identified via pam using 'mariadb_mtr'; create user test_pam identified via pam using 'mariadb_mtr';
create user pam_test; create user pam_test;

View File

@ -10,8 +10,6 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_log_bin.inc --source include/have_log_bin.inc
# Dynamic loading of Example does not work on Windows currently.
--source include/not_windows.inc
--source include/have_example_plugin.inc --source include/have_example_plugin.inc
# Initialize replication. # Initialize replication.
@ -21,7 +19,8 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
--echo Get binlog position before install plugin. --echo Get binlog position before install plugin.
let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1); let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
--echo Install example engine. --echo Install example engine.
INSTALL PLUGIN example SONAME 'ha_example.so'; --replace_regex /\.dll/.so/
eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
--echo Get binlog position after install plugin. --echo Get binlog position after install plugin.
let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1); let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
--echo Compute the difference of the binlog positions. --echo Compute the difference of the binlog positions.

View File

@ -19,6 +19,10 @@ call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received w
enable_query_log; enable_query_log;
connection master; connection master;
# wait for dying connections (if any) to disappear
let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
--source include/wait_condition.inc
# After fix of BUG#45848, semi-sync slave should not create any extra # After fix of BUG#45848, semi-sync slave should not create any extra
# connections on master, save the count of connections before start # connections on master, save the count of connections before start
# semi-sync slave for comparison below. # semi-sync slave for comparison below.
@ -166,8 +170,7 @@ show status like 'Rpl_semi_sync_master_yes_tx';
# After fix of BUG#45848, semi-sync slave should not create any extra # After fix of BUG#45848, semi-sync slave should not create any extra
# connections on master. # connections on master.
let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
replace_result $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE; replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE;
eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0'; eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
let $i=300; let $i=300;

View File

@ -2,7 +2,7 @@
[source src1] [source src1]
type = xmlpipe2 type = xmlpipe2
xmlpipe_command = cat suite/sphinx/testdata.xml xmlpipe_command = cat @ENV.MTR_SUITE_DIR/testdata.xml
[index test1] [index test1]
source = src1 source = src1

View File

@ -1 +1 @@
--plugin-load=$HA_SPHINX_SO --plugin-load=$HA_SPHINX_SO --sphinx

View File

@ -1,5 +1,5 @@
if (!$HA_ARCHIVE_SO) { if (!$HA_ARCHIVE_SO) {
--skip Need example plugin --skip Need archive plugin
} }
CREATE TABLE t1(a int) ENGINE=ARCHIVE; CREATE TABLE t1(a int) ENGINE=ARCHIVE;

View File

@ -1,6 +1,7 @@
# This test uses grants, which can't get tested for embedded server # This test uses grants, which can't get tested for embedded server
-- source include/big_test.inc -- source include/big_test.inc
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_xtradb.inc
# check that CSV engine was compiled in, as the result of the test depends # check that CSV engine was compiled in, as the result of the test depends
# on the presence of the log tables (which are CSV-based). # on the presence of the log tables (which are CSV-based).

View File

@ -1,4 +1,5 @@
--source include/have_log_bin.inc --source include/have_log_bin.inc
--source include/have_partition.inc
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;

View File

@ -61,7 +61,7 @@ CREATE TABLE time_zone_leap_second ( Transition_time bigint signed NOT NULL,
# Run the mysql_fix_privilege_tables.sql using "mysql --force" # Run the mysql_fix_privilege_tables.sql using "mysql --force"
--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/log/system_mysql_db_fix40123.log 2>&1 --exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
-- enable_query_log -- enable_query_log
-- enable_result_log -- enable_result_log

View File

@ -67,7 +67,7 @@ CREATE TABLE servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) N
INSERT INTO servers VALUES ('test','localhost','test','root','', 0,'','mysql','root'); INSERT INTO servers VALUES ('test','localhost','test','root','', 0,'','mysql','root');
# Run the mysql_fix_privilege_tables.sql using "mysql --force" # Run the mysql_fix_privilege_tables.sql using "mysql --force"
--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/log/system_mysql_db_fix50030.log 2>&1 --exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
-- enable_query_log -- enable_query_log
-- enable_result_log -- enable_result_log

View File

@ -86,7 +86,7 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b
CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
# Run the mysql_fix_privilege_tables.sql using "mysql --force" # Run the mysql_fix_privilege_tables.sql using "mysql --force"
--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES > $MYSQLTEST_VARDIR/log/system_mysql_db_fix50117.log 2>&1 --exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES
-- enable_query_log -- enable_query_log
-- enable_result_log -- enable_result_log

View File

@ -155,7 +155,7 @@ redo:
if ((plugin= my_plugin_lock_by_name(thd, name, MYSQL_STORAGE_ENGINE_PLUGIN))) if ((plugin= my_plugin_lock_by_name(thd, name, MYSQL_STORAGE_ENGINE_PLUGIN)))
{ {
handlerton *hton= plugin_data(plugin, handlerton *); handlerton *hton= plugin_data(plugin, handlerton *);
if (!(hton->flags & HTON_NOT_USER_SELECTABLE)) if (hton && !(hton->flags & HTON_NOT_USER_SELECTABLE))
return plugin; return plugin;
/* /*

View File

@ -0,0 +1,2 @@
These tests don't have anything to do with the EXAMPLE engine itself,
but they show how mysql-test handles overlays

View File

@ -0,0 +1,2 @@
[c3o]
table-cache=32

View File

@ -0,0 +1 @@
let $a=2;

View File

@ -0,0 +1,2 @@
[new]
--ansi

View File

@ -0,0 +1,4 @@
select @@local_infile;
select 1;
1
1

View File

@ -0,0 +1,8 @@
#
# This test exists only in the overlay. It will run only for the overlay
# and not for the parent suite.
#
--disable_result_log
source suite/mtr/t/combs.inc;
--enable_result_log
select 1;

View File

@ -0,0 +1,6 @@
select "<1>";
<1>
<1>
select "<2>";
<2>
<2>

View File

@ -0,0 +1,8 @@
#
# A test that includes itself. But really it includes the
# self.test from the parent suite, not itself.
#
let $a=1;
source self.test;
let $a=2;
source self.test;

View File

@ -0,0 +1,3 @@
select 2;
2
2

View File

@ -0,0 +1,4 @@
select @@local_infile;
select @@max_error_count;
@@max_error_count
32

View File

@ -0,0 +1 @@
--max-error-count=32

View File

@ -0,0 +1,8 @@
--- /usr/home/serg/Abk/mysql/5.1/mysql-test/suite/mtr/t/test2.result 2012-02-04 21:15:14.000000000 +0100
+++ /usr/home/serg/Abk/mysql/5.1/mysql-test/suite/mtr/t/test2.reject 2012-02-04 21:31:45.000000000 +0100
@@ -1,4 +1,4 @@
select @@local_infile;
select @@max_error_count;
@@max_error_count
-64
+32

View File

@ -0,0 +1 @@
true

View File

@ -0,0 +1,2 @@
These tests don't have anything to do with the engine itself,
but they test how mysql-test handles overlays

View File

@ -0,0 +1 @@
!include include/default_my.cnf

View File

@ -7553,7 +7553,6 @@ ha_innobase::records_in_range(
mem_heap_t* heap; mem_heap_t* heap;
DBUG_ENTER("records_in_range"); DBUG_ENTER("records_in_range");
DBUG_ASSERT(min_key || max_key);
ut_a(prebuilt->trx == thd_to_trx(ha_thd())); ut_a(prebuilt->trx == thd_to_trx(ha_thd()));

View File

@ -0,0 +1,2 @@
These tests don't have anything to do with the engine itself,
but they test how mysql-test handles overlays

View File

@ -0,0 +1 @@
--old