From 5cde0ca744b72dfd36f4ed0a13269b1d3f48de54 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 10 Aug 2010 18:36:04 +0400 Subject: [PATCH 1/4] created *-all build scripts that build with ndb (as -max scripts don't) --- BUILD/SETUP.sh | 7 +++---- BUILD/compile-amd64-debug-all | 7 +++++++ BUILD/compile-pentium-debug-all | 10 ++++++++++ BUILD/compile-pentium64-debug-all | 12 ++++++++++++ mysql-test/mysql-test-run.pl | 1 + 5 files changed, 33 insertions(+), 4 deletions(-) create mode 100755 BUILD/compile-amd64-debug-all create mode 100755 BUILD/compile-pentium-debug-all create mode 100755 BUILD/compile-pentium64-debug-all diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index fe572562750..b888ac03ef3 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -91,8 +91,8 @@ path=`dirname $0` get_make_parallel_flag # SSL library to use.--with-ssl will select our bundled yaSSL -# implementation of SSL. To use openSSl you will nee too point out -# the location of openSSL headers and lbs on your system. +# implementation of SSL. To use OpenSSL you will need to specify +# the location of OpenSSL headers and libs on your system. # Ex --with-ssl=/usr SSL_LIBRARY=--with-ssl @@ -182,8 +182,7 @@ max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max" max_no_qc_configs="$SSL_LIBRARY --with-plugins=max --without-query-cache" max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server --with-libevent" max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server --with-libevent" -# Disable NDB in maria max builds -max_configs=$max_no_ndb_configs +all_configs="$SSL_LIBRARY --with-plugins=max --with-plugin-ndbcluster --with-embedded-server --with-libevent" # # CPU and platform specific compilation flags. diff --git a/BUILD/compile-amd64-debug-all b/BUILD/compile-amd64-debug-all new file mode 100755 index 00000000000..b8b2ed05402 --- /dev/null +++ b/BUILD/compile-amd64-debug-all @@ -0,0 +1,7 @@ +#! /bin/sh +path=`dirname $0` +. "$path/SETUP.sh" +extra_flags="$amd64_cflags $debug_cflags" +extra_configs="$amd64_configs $debug_configs $all_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-all b/BUILD/compile-pentium-debug-all new file mode 100755 index 00000000000..710ce8af63c --- /dev/null +++ b/BUILD/compile-pentium-debug-all @@ -0,0 +1,10 @@ +#! /bin/sh + +path=`dirname $0` +set -- "$@" --with-debug=full +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $all_configs $error_inject --with-experimental-collations" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-debug-all b/BUILD/compile-pentium64-debug-all new file mode 100755 index 00000000000..7824f7ad47f --- /dev/null +++ b/BUILD/compile-pentium64-debug-all @@ -0,0 +1,12 @@ +#! /bin/sh + +path=`dirname $0` +set -- "$@" --with-debug=full +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $all_configs" + +extra_configs="$extra_configs " +CC="$CC --pipe" +. "$path/FINISH.sh" diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 190020a817c..e0af128cd04 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4039,6 +4039,7 @@ sub extract_warning_lines ($) { qr/Now setting lower_case_table_names to [02]/, qr/Setting lower_case_table_names=2/, qr/You have forced lower_case_table_names to 0/, + qr/Plugin 'ndbcluster' will be forced to shutdow/, qr/deprecated/, qr/Slave SQL thread retried transaction/, qr/Slave \(additional info\)/, From b87a73773913ebdcfdacb2d8b8704958bc0e93f2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 14 Aug 2010 18:44:45 +0400 Subject: [PATCH 2/4] missing DBUG_RETURNs --- mysys/my_getwd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c index e6b867e2753..a18c296a7e1 100644 --- a/mysys/my_getwd.c +++ b/mysys/my_getwd.c @@ -51,7 +51,7 @@ int my_getwd(char * buf, size_t size, myf MyFlags) (long) buf, (uint) size, MyFlags)); if (size < 1) - return(-1); + DBUG_RETURN(-1); if (curr_dir[0]) /* Current pos is saved here */ VOID(strmake(buf,&curr_dir[0],size-1)); @@ -59,12 +59,12 @@ int my_getwd(char * buf, size_t size, myf MyFlags) { #if defined(HAVE_GETCWD) if (size < 2) - return(-1); + DBUG_RETURN(-1); if (!getcwd(buf,(uint) (size-2)) && MyFlags & MY_WME) { my_errno=errno; my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno); - return(-1); + DBUG_RETURN(-1); } #elif defined(HAVE_GETWD) { @@ -74,12 +74,12 @@ int my_getwd(char * buf, size_t size, myf MyFlags) } #elif defined(VMS) if (size < 2) - return(-1); + DBUG_RETURN(-1); if (!getcwd(buf,size-2,1) && MyFlags & MY_WME) { my_errno=errno; my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno); - return(-1); + DBUG_RETURN(-1); } intern_filename(buf,buf); #else From 8da7be63027403c5b82eda378842142cdcbad95c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 17 Aug 2010 11:14:46 +0400 Subject: [PATCH 3/4] generalization of mtr to support suite.pm extensions: * no automatic --loose-skip-innodb added by mtr based on the test name. instead loose-skip-innodb is now in the default_mysqld.cnf * have_innodb_plugin.inc is changed to give a verbose "skip" message (instead of "require: true") * My::Suite class. It's support in mtr, and everywhere * support for suite.pm * when sorting tests, take combinations into account * support for SUITENAME_COMBINATIONS * no special treatment for innodb_plugin in mtr_cases.pm * two special pre-created config groups: ENV and OPT * allow option names to start from # * allow magic option to have an argument * remove dead code * fix @-substitution to works as expected * new processes take the value of $opt_verbose automatically, no need to pass it to a constructor * innodb_plugin suite uses suite.pm and combinations file to test as much as possible (innodb plugin, xtradb plugin, xtradb static - whatever available) * besides test-master.opt and test-slave.opt a test.opt file is also loaded, both for master and slave * .opt files for all included files are loaded too * progress report in the xterm titlebar --- mysql-test/Makefile.am | 5 +- mysql-test/README.suites | 136 +++++ mysql-test/include/default_my.cnf | 3 - mysql-test/include/default_mysqld.cnf | 5 +- .../include/have_binlog_format_mixed.opt | 1 + mysql-test/include/have_binlog_format_row.opt | 1 + .../include/have_binlog_format_statement.opt | 2 + mysql-test/include/have_exampledb.inc | 4 - mysql-test/include/have_innodb.inc | 9 +- mysql-test/include/have_innodb.opt | 1 + mysql-test/include/have_innodb_plugin.inc | 9 +- mysql-test/include/have_log_bin-master.opt | 1 + mysql-test/include/have_log_bin-slave.opt | 1 + mysql-test/include/have_log_bin.inc | 2 + mysql-test/include/have_pbxt.opt | 1 + mysql-test/lib/My/Config.pm | 131 +++-- mysql-test/lib/My/ConfigFactory.pm | 54 +- mysql-test/lib/My/Handles.pm | 0 mysql-test/lib/My/SafeProcess.pm | 2 +- mysql-test/lib/My/Suite.pm | 10 + mysql-test/lib/My/Test.pm | 6 + mysql-test/lib/mtr_cases.pm | 214 ++------ mysql-test/lib/mtr_report.pm | 6 +- mysql-test/mysql-test-run.pl | 512 +++++++++--------- mysql-test/r/exampledb.result | 8 - mysql-test/r/warnings_engine_disabled.result | 17 +- .../suite/binlog/t/binlog_base64_flag.test | 1 + .../suite/binlog/t/binlog_old_versions.test | 1 + .../t/binlog_row_mix_innodb_myisam-master.opt | 2 +- .../t/binlog_stm_mix_innodb_myisam-master.opt | 2 +- .../federated/federated_innodb-slave.opt | 2 +- mysql-test/suite/federated/my.cnf | 3 +- mysql-test/suite/funcs_1/t/is_columns_is.test | 1 + mysql-test/suite/innodb/t/innodb-master.opt | 2 +- .../t/innodb-semi-consistent-master.opt | 2 +- .../innodb_autoinc_lock_mode_zero-master.opt | 2 +- .../suite/innodb/t/innodb_bug30919-master.opt | 2 +- .../suite/innodb/t/innodb_bug39438-master.opt | 2 +- .../suite/innodb/t/innodb_bug52663-master.opt | 2 +- .../suite/innodb/t/innodb_bug53674-master.opt | 2 +- .../suite/innodb/t/innodb_bug53674.test | 1 + .../t/innodb_lock_wait_timeout_1-master.opt | 2 +- .../suite/innodb/t/innodb_misc1-master.opt | 2 +- .../suite/innodb/t/innodb_mysql-master.opt | 2 +- .../innodb/t/innodb_mysql_rbk-master.opt | 2 +- .../t/innodb_timeout_rollback-master.opt | 2 +- mysql-test/suite/innodb_plugin/combinations | 12 + mysql-test/suite/innodb_plugin/suite.pm | 17 + .../t/innodb-consistent-master.opt | 2 +- .../suite/innodb_plugin/t/innodb-master.opt | 2 +- .../t/innodb-semi-consistent-master.opt | 2 +- .../t/innodb-use-sys-malloc-master.opt | 2 +- .../innodb_autoinc_lock_mode_zero-master.opt | 2 +- .../t/innodb_bug30919-master.opt | 2 +- .../t/innodb_bug39438-master.opt | 2 +- .../t/innodb_bug42101-nonzero-master.opt | 2 +- .../t/innodb_bug53674-master.opt | 2 +- .../t/innodb_lock_wait_timeout_1-master.opt | 2 +- .../innodb_plugin/t/innodb_mysql-master.opt | 2 +- .../t/innodb_mysql_rbk-master.opt | 2 +- .../t/innodb_timeout_rollback-master.opt | 2 +- .../ndb_team/t/rpl_ndb_mix_innodb-master.opt | 2 +- .../t/partition_debug_sync_innodb-master.opt | 2 +- .../t/partition_special_innodb-master.opt | 2 +- mysql-test/suite/pbxt/my.cnf | 1 + mysql-test/suite/pbxt/t/suite.opt | 1 - ...percona_innodb_doublewrite_file-master.opt | 2 +- .../rpl/r/rpl_row_basic_11bugs-master.opt | 2 +- .../rpl/r/rpl_row_basic_11bugs-slave.opt | 2 +- mysql-test/suite/rpl/rpl_1slave_base.cnf | 3 - .../t/rpl_begin_commit_rollback-master.opt | 2 +- .../rpl/t/rpl_begin_commit_rollback-slave.opt | 2 +- .../suite/rpl/t/rpl_circular_for_4_hosts.cnf | 8 +- .../rpl/t/rpl_concurrency_error-master.opt | 2 +- mysql-test/suite/rpl/t/rpl_ddl-slave.opt | 1 + .../suite/rpl/t/rpl_deadlock_innodb-slave.opt | 2 +- mysql-test/suite/rpl/t/rpl_innodb-master.opt | 2 +- .../rpl/t/rpl_innodb_bug28430-master.opt | 2 +- .../suite/rpl/t/rpl_innodb_bug28430-slave.opt | 2 +- .../rpl/t/rpl_start_stop_slave-slave.opt | 2 +- mysql-test/suite/rpl/t/rpl_trigger.test | 9 +- mysql-test/suite/rpl/t/rpl_typeconv-slave.opt | 2 +- .../suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt | 2 +- .../suite/rpl_ndb/t/rpl_ndb_2other-slave.opt | 2 +- .../suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf | 4 - .../rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt | 2 +- .../rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt | 2 +- ..._ndb_mixed_engines_transactions-master.opt | 2 +- ...l_ndb_mixed_engines_transactions-slave.opt | 2 +- .../rpl_ndb/t/rpl_ndb_mixed_tables-master.opt | 2 +- .../rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt | 2 +- .../rpl_ndb/t/rpl_ndb_stm_innodb-master.opt | 2 +- .../sys_vars/t/autocommit_func-master.opt | 2 +- .../character_set_filesystem_func-master.opt | 2 +- .../suite/sys_vars/t/identity_func-master.opt | 2 +- .../innodb_autoinc_lock_mode_func-master.opt | 2 +- .../sys_vars/t/last_insert_id_func-master.opt | 2 +- .../t/max_binlog_cache_size_func-master.opt | 2 +- .../t/storage_engine_basic-master.opt | 2 +- .../sys_vars/t/tx_isolation_func-master.opt | 4 +- mysql-test/t/bug46760-master.opt | 4 +- .../t/concurrent_innodb_safelog-master.opt | 2 +- .../t/concurrent_innodb_unsafelog-master.opt | 4 +- mysql-test/t/connect.cnf | 2 +- mysql-test/t/exampledb.test | 22 - mysql-test/t/partition_innodb-master.opt | 2 +- ...artition_innodb_semi_consistent-master.opt | 2 +- mysql-test/t/pool_of_threads.cnf | 2 +- mysql-test/t/sp_trans_log.test | 2 +- mysql-test/t/unsafe_binlog_innodb-master.opt | 2 +- mysql-test/t/warnings_engine_disabled.test | 19 +- 111 files changed, 708 insertions(+), 681 deletions(-) create mode 100644 mysql-test/README.suites create mode 100644 mysql-test/include/have_binlog_format_mixed.opt create mode 100644 mysql-test/include/have_binlog_format_row.opt create mode 100644 mysql-test/include/have_binlog_format_statement.opt delete mode 100644 mysql-test/include/have_exampledb.inc create mode 100644 mysql-test/include/have_innodb.opt create mode 100644 mysql-test/include/have_log_bin-master.opt create mode 100644 mysql-test/include/have_log_bin-slave.opt create mode 100644 mysql-test/include/have_pbxt.opt mode change 100755 => 100644 mysql-test/lib/My/Handles.pm create mode 100644 mysql-test/lib/My/Suite.pm delete mode 100644 mysql-test/r/exampledb.result create mode 100644 mysql-test/suite/innodb_plugin/combinations create mode 100644 mysql-test/suite/innodb_plugin/suite.pm delete mode 100644 mysql-test/suite/pbxt/t/suite.opt create mode 100644 mysql-test/suite/rpl/t/rpl_ddl-slave.opt delete mode 100644 mysql-test/t/exampledb.test diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 4ea634688fe..7a0d4c2d6fc 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -63,13 +63,14 @@ nobase_test_DATA = \ lib/My/SafeProcess.pm \ lib/My/File/Path.pm \ lib/My/SysInfo.pm \ + lib/My/Suite.pm \ lib/My/CoreDump.pm \ lib/My/SafeProcess/Base.pm \ lib/My/SafeProcess/safe_process.pl SUBDIRS = lib/My/SafeProcess -EXTRA_DIST = README \ +EXTRA_DIST = README README.suites \ $(test_SCRIPTS) \ $(nobase_test_DATA) @@ -101,7 +102,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \ suite/ndb suite/ndb/t suite/ndb/r \ suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \ suite/parts suite/parts/t suite/parts/r suite/parts/inc \ - suite/pbxt/t suite/pbxt/r \ + suite/pbxt/t suite/pbxt/r suite/pbxt \ suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \ suite/innodb_plugin suite/innodb_plugin/t suite/innodb_plugin/r suite/innodb_plugin/include \ suite/percona \ diff --git a/mysql-test/README.suites b/mysql-test/README.suites new file mode 100644 index 00000000000..d8f39cbc39f --- /dev/null +++ b/mysql-test/README.suites @@ -0,0 +1,136 @@ +These are the assorted notes that will be turned into a manual eventually. + +========================== +Tests are organized in suites. +A "suite" is a subdirectory inside, one of, + + /mysql-test/suite + /mysql-test + /share/mysql-test/suite + /share/mysql-test + /share/mysql/mysql-test/suite + /share/mysql/mysql-test + /storage/*/mysql-test-suites + +This is supposed to cover running mtr from a source directory and installed. + +========================== +A suite contains *.test and *.result files. They can be in the t/ and r/ +subdirectories under the suitedir or directly in the suitedir +(that is suitedir/t/*.test or suitedir/*.test, same for *.result)) + +========================== +A suite can contain a suite.opt file - at the same location where .test +files are. As usual, the .opt file can use $-substitutions for the +environment variables. + +Usually, using my.cnf template (see below) is preferrable. +========================== +A suite can have suite.pm file in the suitedir. It must declare a +package that inherits from My::Suite. + +The suite.pm needs to have @ISA=qw(My::Suite) and it must end +with bless {}; - that is it must return an object of that class. + +A suite class can define config_files() and servers() methods. + +A config_files method returns a list of additional config files (besides +my.cnf), that this suite needs to be created. For every file it specifies +a function that will create it, when given a My::Config object. For example: + + sub config_files { ( 'config.ini' => \&write_ini, + 'new.conf' => \&do_new_conf ) } + +A servers method returns a list of processes that needs to be started for +this suite. A process is specified as a pair (regex, hash). A regex must +match a section in the my.cnf template (for example, qr/mysqld\./ corresponds +to all mysqld processes), a hash contains these options: + + SORT => a number, processes are started in the order of increasing SORT + values (and stopped in the reverse order). mysqld has number 300. + START => a function to start a process. It takes two arguments, + My::Config::Group and My::Test. If START is undefined the process + will not be started. + WAIT => a function waits for the process to be started. It takes + My::Config::Group as an argument. Internallys mtr first invokes + START for all processes, then WAIT for all started processes. + +example: sub servers { ( qr/^foo$/ => { SORT => 200, + START => \&start_foo, + WAIT => \&wait_foo } ) } + +See sphinx suite for an example. + +========================== +A suite can have my.cnf template file in the suitedir. +A my.cnf template uses a normal my.cnf syntax - groups, options, +and values - with templating extensions. They are + +* There can be groups with non-standard names, not used by mysqld. + These groups may be used by the suite.pm file somehow. + For example, they can be written to the additional config files. + See sphinx suite for an example. + +* There can be ENV group. It sets values for the environment variables. + +* Values can refer to each other - they will be expanded as needed. + A reference to a value of an option looks like @groupname.optionname. + For example + + [mysqld.2] + master-port= @mysqld.1.port + + it sets the master-port in the mysqld.2 group to the value of + port in the mysqld.1 group. + +* An option name may start from '#'. In the resulting my.cnf it will look + like a comment, but it still can be referred to. For example: + + [example] + #foo = localhost:@mysqld.1.port + bar = http://@example.#foo/index.html + +* There are two special - in this regard - groups. + + Via the ENV group one can refer to any environment variable, not only + to values in the [ENV] group of my.cnf file. + + Via the OPT group one can refer to special values: + @OPT.vardir - a path to vardir + @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. + See sphinx suite for an example. + +Most probably a suite my.cnf will need to start from + + !include include/default_my.cnf + +and then modify the configuration as necessary. +========================== + +A suite can have combinations file in the suitedir. It uses my.cnf syntax +but it cannot use @-substitutions. Instead, it can use $-substitutions for +the environment variables. Because the combination options will not be +merged to a my.cnf, but will be added to the command line. Example: + + [conf1] + opt1=val1 + + [conf2] + opt1=val2 + opt2=$HAVE_SOMETHING + +Such a file will cause every test from the suite to be run twice - once +with mysqld using --opt1=val1 and the other one with mysqld using +--opt1=val2 --opt2=$HAVE_SOMETHING + +One can limit mtr run to a subset of combinations by setting environment +variable SUITENAME_COMBINATIONS to the ':'-separated set of combination +names. E.g. + + RPL_COMBINATIONS=mix:row ./mtr --suite rpl + +See innodb_plugin suite for an example of how suite.pm may set this variable +to exclude unsupported configurations. +========================== + diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index d77fee0e200..17a418ff7b5 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -6,9 +6,6 @@ # Run the master.sh script before starting this process #!run-master-sh -log-bin= master-bin - - [mysqlbinlog] disable-force-if-open diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index c93762f6c25..e46c3bc3c17 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -13,9 +13,10 @@ key_buffer_size= 1M sort_buffer= 256K max_heap_table_size= 1M +loose-skip-innodb +loose-skip-pbxt + loose-innodb_data_file_path= ibdata1:10M:autoextend slave-net-timeout=120 -log-bin=mysqld-bin - diff --git a/mysql-test/include/have_binlog_format_mixed.opt b/mysql-test/include/have_binlog_format_mixed.opt new file mode 100644 index 00000000000..01cf3e0520f --- /dev/null +++ b/mysql-test/include/have_binlog_format_mixed.opt @@ -0,0 +1 @@ +--binlog-format=mixed diff --git a/mysql-test/include/have_binlog_format_row.opt b/mysql-test/include/have_binlog_format_row.opt new file mode 100644 index 00000000000..83ed8522e72 --- /dev/null +++ b/mysql-test/include/have_binlog_format_row.opt @@ -0,0 +1 @@ +--binlog-format=row diff --git a/mysql-test/include/have_binlog_format_statement.opt b/mysql-test/include/have_binlog_format_statement.opt new file mode 100644 index 00000000000..0dac5e9fb9c --- /dev/null +++ b/mysql-test/include/have_binlog_format_statement.opt @@ -0,0 +1,2 @@ +--binlog-format=statement + diff --git a/mysql-test/include/have_exampledb.inc b/mysql-test/include/have_exampledb.inc deleted file mode 100644 index db3985e3c7c..00000000000 --- a/mysql-test/include/have_exampledb.inc +++ /dev/null @@ -1,4 +0,0 @@ -disable_query_log; ---require r/true.require -select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'example'; -enable_query_log; diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc index 8944cc46f3e..c3c8b5cc4f2 100644 --- a/mysql-test/include/have_innodb.inc +++ b/mysql-test/include/have_innodb.inc @@ -1,4 +1,5 @@ -disable_query_log; ---require r/true.require -select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb'; -enable_query_log; +if (!`SELECT count(*) FROM information_schema.engines WHERE + (support = 'YES' OR support = 'DEFAULT') AND + engine = 'innodb'`){ + skip Needs innodb engine; +} diff --git a/mysql-test/include/have_innodb.opt b/mysql-test/include/have_innodb.opt new file mode 100644 index 00000000000..48457b17309 --- /dev/null +++ b/mysql-test/include/have_innodb.opt @@ -0,0 +1 @@ +--loose-innodb diff --git a/mysql-test/include/have_innodb_plugin.inc b/mysql-test/include/have_innodb_plugin.inc index 6b5fc29d459..5f67fb1f97d 100644 --- a/mysql-test/include/have_innodb_plugin.inc +++ b/mysql-test/include/have_innodb_plugin.inc @@ -1,4 +1,5 @@ -disable_query_log; ---require r/true.require -SELECT (plugin_library LIKE 'ha_innodb_plugin%' OR plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active'; -enable_query_log; +if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS + WHERE PLUGIN_NAME = 'innodb' AND PLUGIN_STATUS = 'active' AND + (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%' OR PLUGIN_DESCRIPTION LIKE '%xtradb%')`) { + skip Need InnoDB plugin or XtraDB; +} diff --git a/mysql-test/include/have_log_bin-master.opt b/mysql-test/include/have_log_bin-master.opt new file mode 100644 index 00000000000..9ce5d80d7e8 --- /dev/null +++ b/mysql-test/include/have_log_bin-master.opt @@ -0,0 +1 @@ +--log-bin=master-bin diff --git a/mysql-test/include/have_log_bin-slave.opt b/mysql-test/include/have_log_bin-slave.opt new file mode 100644 index 00000000000..92012982830 --- /dev/null +++ b/mysql-test/include/have_log_bin-slave.opt @@ -0,0 +1 @@ +--log-bin=slave-bin diff --git a/mysql-test/include/have_log_bin.inc b/mysql-test/include/have_log_bin.inc index 369af9b8e1d..e51205d25ad 100644 --- a/mysql-test/include/have_log_bin.inc +++ b/mysql-test/include/have_log_bin.inc @@ -6,6 +6,8 @@ # # source include/have_log_bin.inc; +source include/not_embedded.inc; + -- require r/have_log_bin.require disable_query_log; show variables like 'log_bin'; diff --git a/mysql-test/include/have_pbxt.opt b/mysql-test/include/have_pbxt.opt new file mode 100644 index 00000000000..54ba9495053 --- /dev/null +++ b/mysql-test/include/have_pbxt.opt @@ -0,0 +1 @@ +--loose-pbxt diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index f8416e3df3a..0955c1bb190 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -6,7 +6,6 @@ use strict; use warnings; use Carp; - sub new { my ($class, $option_name, $option_value)= @_; my $self= bless { name => $option_name, @@ -61,7 +60,7 @@ sub insert { $option->{value}= $value; } else { - my $option= My::Config::Option->new($option_name, $value); + $option= My::Config::Option->new($option_name, $value); # Insert option in list push(@{$self->{options}}, $option); # Insert option in hash @@ -163,6 +162,62 @@ sub if_exist { return $option->value(); } +package My::Config::Group::ENV; +our @ISA=qw(My::Config::Group); + +use strict; +use warnings; +use Carp; + +sub new { + my ($class, $group_name)= @_; + bless My::Config::Group->new($group_name), $class; +} + +# +# Return value for an option in the group, fail if it does not exist +# +sub value { + my ($self, $option_name)= @_; + my $option= $self->option($option_name); + + if (! defined($option) and defined $ENV{$option_name}) { + my $value= $ENV{$option_name}; + $option= My::Config::Option->new($option_name, $value); + } + + croak "No option named '$option_name' in group '$self->{name}'" + if ! defined($option); + + return $option->value(); +} + +package My::Config::Group::OPT; +our @ISA=qw(My::Config::Group); + +use strict; +use warnings; +use Carp; + +sub new { + my ($class, $group_name)= @_; + bless My::Config::Group->new($group_name), $class; +} + +sub options { + my ($self)= @_; + () +} + +sub value { + my ($self, $option_name)= @_; + my $option= $self->option($option_name); + + croak "No option named '$option_name' in group '$self->{name}'" + if ! defined($option); + + return $option->value()->(); +} package My::Config; @@ -182,7 +237,10 @@ sub new { my ($class, $path)= @_; my $group_name= undef; - my $self= bless { groups => [] }, $class; + my $self= bless { groups => [ + My::Config::Group::ENV->new('ENV'), + My::Config::Group::OPT->new('OPT'), + ] }, $class; my $F= IO::File->new($path, "<") or croak "Could not open '$path': $!"; @@ -199,19 +257,13 @@ sub new { } # Magic #! comments - elsif ( $line =~ /^#\!/) { - my $magic= $line; + elsif ( $line =~ /^(#\!\S+)(?:\s*(.*?)\s*)?$/) { + my ($magic, $arg)= ($1, $2); croak "Found magic comment '$magic' outside of group" unless $group_name; #print "$magic\n"; - $self->insert($group_name, $magic, undef); - } - - # Comments - elsif ( $line =~ /^#/ || $line =~ /^;/) { - # Skip comment - next; + $self->insert($group_name, $magic, $arg); } # Empty lines @@ -236,7 +288,7 @@ sub new { } #