From: Mattias Jonsson Date: February 17 2012 10:48am Subject: bzr push into mysql-trunk branch (mattias.jonsson:3920) WL#4305 List-Archive: http://lists.mysql.com/commits/142942 Message-Id: <201202171048.q1HAmSwo008984@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3920 Mattias Jonsson 2012-02-17 [merge] WL#4305 - merge with updated mysql-trunk Added mysql-trunk-wl4305.push test collection which is a copy of default.push + partitions-big-debug from default.weekly removed: mysql-test/suite/parts/t/partition_debug-master.opt mysql-test/suite/parts/t/partition_debug_myisam-master.opt added: mysql-test/collections/mysql-trunk-wl4305.push modified: mysql-test/suite/parts/r/partition_debug_innodb.result mysql-test/suite/parts/r/partition_debug_myisam.result mysql-test/suite/parts/t/partition_debug_innodb-master.opt mysql-test/suite/perfschema/r/dml_setup_instruments.result sql/ha_partition.cc sql/ha_partition.h sql/handler.cc sql/handler.h sql/mysqld.cc sql/mysqld.h sql/partition_info.cc sql/sql_base.cc sql/sql_partition.cc sql/sql_partition.h sql/sql_partition_admin.cc sql/sql_table.cc sql/sql_tmp_table.cc sql/table.cc sql/table.h storage/archive/azio.c storage/archive/ha_archive.cc storage/archive/ha_archive.h storage/example/ha_example.cc storage/example/ha_example.h storage/innobase/handler/ha_innodb.cc storage/innobase/handler/ha_innodb.h storage/myisam/ha_myisam.cc === added file 'mysql-test/collections/mysql-trunk-wl4305.push' --- a/mysql-test/collections/mysql-trunk-wl4305.push 1970-01-01 00:00:00 +0000 +++ b/mysql-test/collections/mysql-trunk-wl4305.push revid:mattias.jonsson@stripped @@ -0,0 +1,7 @@ +perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list --unit-tests +perl mysql-test-run.pl --timer --force --parallel=auto --comment=main_ps_row --vardir=var-main-ps_row --suite=main --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list +perl mysql-test-run.pl --timer --force --parallel=auto --comment=main_embedded --vardir=var-main_emebbed --suite=main --embedded --experimental=collections/default.experimental --skip-ndb +perl mysql-test-run.pl --timer --force --parallel=auto --comment=innodb_4k_size --vardir=var-innodb-4k --experimental=collections/default.experimental --skip-ndb --suite=innodb --mysqld=--innodb-page-size=4k + +# From default.weekly: +perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=60 --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions-debug-big --vardir=var-parts-debug-big --suite=parts === added file 'mysql-test/suite/binlog/r/binlog_server_start_options.result' --- a/mysql-test/suite/binlog/r/binlog_server_start_options.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/binlog/r/binlog_server_start_options.result revid:mattias.jonsson@stripped @@ -0,0 +1 @@ +End of test binlog.binlog_server_start_options.test === added file 'mysql-test/suite/binlog/t/binlog_server_start_options.test' --- a/mysql-test/suite/binlog/t/binlog_server_start_options.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/binlog/t/binlog_server_start_options.test revid:mattias.jonsson@stripped @@ -0,0 +1,119 @@ +############################################################ +# Tests startup options for mysql server pertaining binlog +# This test doesnot require (as of now) to be run for all +# the binlogging format as server startup in the cases +# below are independent of the format. We therefore run this +# test in only statement format. +############################################################ +--source include/have_binlog_format_statement.inc + +#------------------------------------------------------------------# +# BUG 11766817 - 60030: CRASH ON MYSQLD STARTUP WHEN USING LOG-BIN # +#------------------------------------------------------------------# + +#fetch the basedir from the already started server +--let MYSQL_BASEDIR= `select @@basedir` + +--perl + use strict; + my $vardir= $ENV{'MYSQLTEST_VARDIR'} or die ('MYSQLTEST_VARDIR not set! Aborting!\n'); + my $cnf1= $vardir.'cnf_1.cnf'; + my $basedir= $ENV{'MYSQL_BASEDIR'} or die "Basedir not set"; + +# check if mysqld exists in basedir/sql folder or in basedir/bin + my $share_folder =$basedir."/sql/share/"; + if(-e $share_folder) + { + $basedir=$basedir."/sql/"; + } + +#create a new datadir if there is none else remove and create a new one. + unless(-e $basedir."/data") + { + mkdir($basedir."/data", 0777) or die "Can't make data directory: $!"; + } + else + { +# Ideally this section should not execute as this means that the default +# datadir exists which is not possible in the current scenario. + use File::Path; + rmtree($basedir."/data"); + use strict; + mkdir($basedir."/data", 0777) or die "Can't make data directory: $!"; + } + +#create cnf_1 file + my $content= "[mysqld]\n"; + $content.="basedir=$basedir\n"; + $content.="socket=socket-5620.sock\n"; + $content.="log-error=error.log\n"; + $content.="port=5620\n"; + $content.="user=root\n"; + $content.="core\n"; + $content.="log-bin\n"; + open(FILE_CNF, ">$cnf1") or die("Unable to create $cnf1: $!\n"); + print FILE_CNF $content; + close(FILE_CNF); + +#export the cnf path to mtr + open(FILE_INC, '>include/cnf_include.inc'); + print FILE_INC '--let $CNF1'." = $cnf1\n"; + close(FILE_INC); +EOF + +--source include/cnf_include.inc +--error 1 +--exec $MYSQLD --defaults-file=$CNF1 + +#--------------------------------------------------------------------------------------------# +# BUG 12929941 - SEGFAULT IN STRMAKE/CONVERT_DIRNAME WHEN USING --RELAY-LOG=SLAVE-RELAY-BIN # +#--------------------------------------------------------------------------------------------# + +--perl + use strict; + +# Initialize the variables + my $vardir= $ENV{'MYSQLTEST_VARDIR'} or die ('MYSQLTEST_VARDIR not set! Aborting!\n'); + my $basedir= $ENV{'MYSQL_BASEDIR'} or die "Basedir not set: $!\n"; + +# check if mysqld exists in basedir/sql folder or in basedir/bin + my $share_folder =$basedir."/sql/share/\0"; + if(-e $share_folder) + { + $basedir=$basedir."/sql/"; + } + +#create cnf_2 file. + my $cnf2= $vardir.'cnf_2.cnf'; + my $content= "[mysqld]\n"; + $content.="basedir=$basedir\n"; + $content.="port=5620\n"; + $content.="core\n"; + open(FILE_CNF, ">$cnf2") or die("Unable to create $cnf2: $!\n"); + print FILE_CNF $content; + close(FILE_CNF); + +#export the cnf path and "actual basedir" to mtr + open(FILE_INC, '>include/cnf_include.inc'); + print FILE_INC '--let $CNF2'." = $cnf2\n"; + print FILE_INC '--let REAL_BASEDIR'."=$basedir\n"; + close(FILE_INC); +EOF + +--source include/cnf_include.inc +--error 1 +--exec $MYSQLD --defaults-file=$CNF2 --relay-log=slave-relay-bin + +#cleanup +--perl + use File::Path; + my $basedir= $ENV{'REAL_BASEDIR'}; + rmtree($basedir."/data/"); +EOF + +--remove_file include/cnf_include.inc +--remove_file $CNF1 +--remove_file $CNF2 + +--echo End of test binlog.binlog_server_start_options.test + === modified file 'mysys/mf_format.c' --- a/mysys/mf_format.c revid:mattias.jonsson@stripped +++ b/mysys/mf_format.c revid:mattias.jonsson@stripped @@ -40,11 +40,13 @@ char * fn_format(char * to, const char * name+=(length=dirname_part(dev, (startpos=(char *) name), &dev_length)); if (length == 0 || (flag & MY_REPLACE_DIR)) { + DBUG_ASSERT(dir != NULL); /* Use given directory */ convert_dirname(dev,dir,NullS); /* Fix to this OS */ } else if ((flag & MY_RELATIVE_PATH) && !test_if_hard_path(dev)) { + DBUG_ASSERT(dir != NULL); /* Put 'dir' before the given path */ strmake(buff,dev,sizeof(buff)-1); pos=convert_dirname(dev,dir,NullS); === modified file 'sql/handler.cc' --- a/sql/handler.cc revid:mattias.jonsson@stripped +++ b/sql/handler.cc revid:mattias.jonsson@stripped @@ -4633,7 +4633,8 @@ handler::multi_range_read_info_const(uin else { DBUG_EXECUTE_IF("crash_records_in_range", DBUG_SUICIDE();); - DBUG_ASSERT(min_endp || max_endp); + // Fails - reintroduce when fixed + // DBUG_ASSERT(min_endp || max_endp); if (HA_POS_ERROR == (rows= this->records_in_range(keyno, min_endp, max_endp))) { === modified file 'sql/mysqld.cc' --- a/sql/mysqld.cc revid:mattias.jonsson@stripped +++ b/sql/mysqld.cc revid:mattias.jonsson@stripped @@ -3206,6 +3206,15 @@ rpl_make_log_name(const char *opt, const char *base= opt ? opt : def; unsigned int options= MY_REPLACE_EXT | MY_UNPACK_FILENAME | MY_SAFE_PATH; + + /* mysql_real_data_home_ptr may be null if no value of datadir has been + specified through command-line or througha cnf file. If that is the + case we make mysql_real_data_home_ptr point to mysql_real_data_home + which, in that case holds the default path for data-dir. + */ + if(mysql_real_data_home_ptr == NULL) + mysql_real_data_home_ptr= mysql_real_data_home; + if (fn_format(buff, base, mysql_real_data_home_ptr, ext, options)) DBUG_RETURN(strdup(buff)); else === modified file 'sql/opt_range.cc' --- a/sql/opt_range.cc revid:mattias.jonsson@stripped +++ b/sql/opt_range.cc revid:mattias.jonsson@stripped @@ -4825,7 +4825,8 @@ static double ror_scan_selectivity(const rec_per_key[tuple_arg->part])) // (3) { DBUG_EXECUTE_IF("crash_records_in_range", DBUG_SUICIDE();); - DBUG_ASSERT(min_range.length > 0); + // Fails - reintroduce when fixed + // DBUG_ASSERT(min_range.length > 0); records= (table->file-> records_in_range(scan->keynr, &min_range, &max_range)); } === modified file 'sql/sql_binlog.cc' --- a/sql/sql_binlog.cc revid:mattias.jonsson@stripped +++ b/sql/sql_binlog.cc revid:mattias.jonsson@stripped @@ -159,7 +159,13 @@ void mysql_client_binlog_statement(THD* Relay_log_info *rli= thd->rli_fake; if (!rli) { - if ((rli= Rpl_info_factory::create_rli(INFO_REPOSITORY_FILE, FALSE))) + /* + We create a Relay_log_info object with a INFO_REPOSITORY_DUMMY because + to process a BINLOG command a real repository is not necessary. In the + future, we need to improve the code around the BINLOG command as only a + small part of the object is required to execute it. / Alfranio + */ + if ((rli= Rpl_info_factory::create_rli(INFO_REPOSITORY_DUMMY, FALSE))) { thd->rli_fake= rli; rli->info_thd= thd; @@ -306,18 +312,20 @@ void mysql_client_binlog_statement(THD* } } - DBUG_PRINT("info",("binlog base64 execution finished successfully")); my_ok(thd); end: - if ((error || err) && rli->rows_query_ev) + if (rli) { - delete rli->rows_query_ev; - rli->rows_query_ev= NULL; + if ((error || err) && rli->rows_query_ev) + { + delete rli->rows_query_ev; + rli->rows_query_ev= NULL; + } + rli->slave_close_thread_tables(thd); } thd->variables.option_bits= thd_options; - rli->slave_close_thread_tables(thd); my_free(buf); DBUG_VOID_RETURN; } === modified file 'storage/innobase/include/univ.i' --- a/storage/innobase/include/univ.i revid:mattias.jonsson@stripped +++ b/storage/innobase/include/univ.i revid:mattias.jonsson@stripped @@ -455,6 +455,8 @@ typedef unsigned long long int ullint; /** The 'undefined' value for a ulint */ #define ULINT_UNDEFINED ((ulint)(-1)) +#define ULONG_UNDEFINED ((ulong)(-1)) + /** The 'undefined' value for a ib_uint64_t */ #define UINT64_UNDEFINED ((ib_uint64_t)(-1)) === modified file 'storage/innobase/srv/srv0start.cc' --- a/storage/innobase/srv/srv0start.cc revid:mattias.jonsson@stripped +++ b/storage/innobase/srv/srv0start.cc revid:mattias.jonsson@stripped @@ -2181,7 +2181,7 @@ innobase_start_or_create_for_mysql(void) if (srv_available_undo_logs == ULINT_UNDEFINED) { /* Can only happen if force recovery is set. */ ut_a(srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO); - srv_undo_logs = ULINT_UNDEFINED; + srv_undo_logs = ULONG_UNDEFINED; } /* Create the thread which watches the timeouts for lock waits */ === modified file 'storage/innobase/trx/trx0trx.cc' --- a/storage/innobase/trx/trx0trx.cc revid:mattias.jonsson@stripped +++ b/storage/innobase/trx/trx0trx.cc revid:mattias.jonsson@stripped @@ -624,7 +624,7 @@ UNIV_INLINE trx_rseg_t* trx_assign_rseg( /*============*/ - ulint max_undo_logs, /*!< in: maximum number of UNDO logs to use */ + ulong max_undo_logs, /*!< in: maximum number of UNDO logs to use */ ulint n_tablespaces) /*!< in: number of rollback tablespaces */ { ulint i; @@ -632,7 +632,7 @@ trx_assign_rseg( static ulint latest_rseg = 0; if (srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO) { - ut_a(max_undo_logs == ULINT_UNDEFINED); + ut_a(max_undo_logs == ULONG_UNDEFINED); return(NULL); } No bundle (reason: useless for push emails).