diff options
178 files changed, 3564 insertions, 2042 deletions
@@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=29 +MYSQL_VERSION_PATCH=30 MYSQL_VERSION_EXTRA= diff --git a/client/mysql.cc b/client/mysql.cc index 70c0815ea76..ad792abc23f 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2312,17 +2312,19 @@ static bool add_line(String &buffer,char *line,char *in_string, { uint length=(uint) (out-line); - if (!truncated && - (length < 9 || - my_strnncoll (charset_info, - (uchar *)line, 9, (const uchar *) "delimiter", 9))) + if (!truncated && (length < 9 || + my_strnncoll (charset_info, (uchar *)line, 9, + (const uchar *) "delimiter", 9) || + (*in_string || *ml_comment))) { /* Don't add a new line in case there's a DELIMITER command to be added to the glob buffer (e.g. on processing a line like "<command>;DELIMITER <non-eof>") : similar to how a new line is not added in the case when the DELIMITER is the first command - entered with an empty glob buffer. + entered with an empty glob buffer. However, if the delimiter is + part of a string or a comment, the new line should be added. (e.g. + SELECT '\ndelimiter\n';\n) */ *out++='\n'; length++; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 777e68902dd..2dae59af9ea 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2430,6 +2430,8 @@ int main(int argc, char** argv) else load_processor.init_by_cur_dir(); + fprintf(result_file, "/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;\n"); + fprintf(result_file, "/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n"); @@ -2480,6 +2482,8 @@ int main(int argc, char** argv) "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); + fprintf(result_file, "/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;\n"); + if (tmpdir.list) free_tmpdir(&tmpdir); if (result_file != stdout) diff --git a/client/mysqldump.c b/client/mysqldump.c index c4dda927c68..11bb74ae1d7 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2298,7 +2298,6 @@ static uint dump_routines_for_db(char *db) const char *routine_type[]= {"FUNCTION", "PROCEDURE"}; char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3]; char *routine_name; - char *query_str; int i; FILE *sql_file= md_result_file; MYSQL_RES *routine_res, *routine_list_res; @@ -2392,17 +2391,6 @@ static uint dump_routines_for_db(char *db) fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n", routine_type[i], routine_name); - query_str= cover_definer_clause(row[2], strlen(row[2]), - C_STRING_WITH_LEN("50020"), - C_STRING_WITH_LEN("50003"), - C_STRING_WITH_LEN(" FUNCTION")); - - if (!query_str) - query_str= cover_definer_clause(row[2], strlen(row[2]), - C_STRING_WITH_LEN("50020"), - C_STRING_WITH_LEN("50003"), - C_STRING_WITH_LEN(" PROCEDURE")); - if (mysql_num_fields(routine_res) >= 6) { if (switch_db_collation(sql_file, db_name_buff, ";", @@ -2440,9 +2428,9 @@ static uint dump_routines_for_db(char *db) fprintf(sql_file, "DELIMITER ;;\n" - "/*!50003 %s */;;\n" + "%s ;;\n" "DELIMITER ;\n", - (const char *) (query_str != NULL ? query_str : row[2])); + (const char *) row[2]); restore_sql_mode(sql_file, ";"); @@ -2457,7 +2445,6 @@ static uint dump_routines_for_db(char *db) } } - my_free(query_str); } } /* end of routine printing */ mysql_free_result(routine_res); diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp index c1ee61d043e..c7dbaf86071 100644 --- a/extra/yassl/src/handshake.cpp +++ b/extra/yassl/src/handshake.cpp @@ -767,8 +767,14 @@ int DoProcessReply(SSL& ssl) while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) { // each message in record, can be more than 1 if not encrypted - if (ssl.getSecurity().get_parms().pending_ == false) // cipher on + if (ssl.getSecurity().get_parms().pending_ == false) { // cipher on + // sanity check for malicious/corrupted/illegal input + if (buffer.get_remaining() < hdr.length_) { + ssl.SetError(bad_input); + return 0; + } decrypt_message(ssl, buffer, hdr.length_); + } mySTL::auto_ptr<Message> msg(mf.CreateObject(hdr.type_)); if (!msg.get()) { diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h index 57b67f1416d..a7fd3e8a2c6 100644 --- a/include/mysql/service_my_snprintf.h +++ b/include/mysql/service_my_snprintf.h @@ -49,6 +49,7 @@ string will be quoted according to MySQL identifier quoting rules. Both <width> and <precision> can be specified as numbers or '*'. + If an asterisk is used, an argument of type int is consumed. <length modifier> can be 'l', 'll', or 'z'. diff --git a/include/thread_pool_priv.h b/include/thread_pool_priv.h index 78526894e21..84c7faa2e2b 100644 --- a/include/thread_pool_priv.h +++ b/include/thread_pool_priv.h @@ -61,6 +61,7 @@ uint thd_get_net_read_write(THD *thd); void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var); ulong thd_get_net_wait_timeout(THD *thd); my_socket thd_get_fd(THD *thd); +int thd_store_globals(THD* thd); THD *first_global_thread(); THD *next_global_thread(THD *thd); diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index 01139677b7d..9878ab1c07d 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. Copyright (c) 2011, 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2012" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2013" /* This define specifies copyright notice which is displayed by every MySQL diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index d065e8935c2..c0ee12fbd23 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -154,8 +154,10 @@ ENDMACRO() FILE(GLOB infiles "collections/*.in") FOREACH(collin ${infiles}) STRING(REPLACE ".in" "" collection ${collin}) + STRING(REPLACE ".in" ".done" colldone ${collin}) # Only generate file once - IF(NOT EXISTS ${collection}) + IF(NOT EXISTS ${colldone}) PROCESS_COLLECTION_INCLUDE(${collin} ${collection}) + FILE(APPEND ${colldone} "${collin}\n") ENDIF() ENDFOREACH() diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily index e8b15acb34d..665da0d152c 100644 --- a/mysql-test/collections/default.daily +++ b/mysql-test/collections/default.daily @@ -1,5 +1,5 @@ -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --skip-test-list=collections/disabled-daily.list --unit-tests +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --skip-test-list=collections/disabled-daily.list perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol --skip-test-list=collections/disabled-daily.list diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 1f4d29968a5..56b8feb6739 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -18,9 +18,4 @@ rpl.rpl_row_sp011 @solaris # Bug#11753919 2011-07-25 sven Several sys_vars.max_sp_recursion_depth_func @solaris # Bug#11753919 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wait_timeout_func fails -# BUG #59055 : All ndb tests should be removed from the repository -# Leaving the sys_vars tests for now. sys_vars.all_vars.test fails on removing ndb tests -sys_vars.ndb_log_update_as_write_basic -sys_vars.have_ndbcluster_basic -sys_vars.ndb_log_updated_only_basic sys_vars.rpl_init_slave_func # Bug#12535301 2011-05-09 andrei sys_vars.rpl_init_slave_func mismatches in daily-5.5 diff --git a/mysql-test/collections/default.push b/mysql-test/collections/default.push index c8402aecd75..e1781d5082c 100644 --- a/mysql-test/collections/default.push +++ b/mysql-test/collections/default.push @@ -1,5 +1,6 @@ -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=ps_row --vardir=var-ps_row --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=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental --skip-ndb -perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --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=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb +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-test-list=collections/disabled-per-push.list +perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list +perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental +perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list +perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental + diff --git a/mysql-test/collections/default.release.in b/mysql-test/collections/default.release.in index 0e3ad30671b..8833086fad9 100644 --- a/mysql-test/collections/default.release.in +++ b/mysql-test/collections/default.release.in @@ -4,14 +4,14 @@ # include default.daily # include default.weekly -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-ndbcluster --skip-rpl --report-features --debug-server -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --skip-ndbcluster --report-features -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --skip-ndbcluster --ps-protocol +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-rpl --report-features --debug-server +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl --skip-ndbcluster +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-nist_ps --suite=nist --ps-protocol diff --git a/mysql-test/include/get_binlog_dump_thread_id.inc b/mysql-test/include/get_binlog_dump_thread_id.inc deleted file mode 100644 index bfc8506b39e..00000000000 --- a/mysql-test/include/get_binlog_dump_thread_id.inc +++ /dev/null @@ -1,22 +0,0 @@ ---exec $MYSQL test -e "show processlist" > $MYSQLTEST_VARDIR/tmp/bl_dump_thread_id ---disable_warnings -drop table if exists t999; ---enable_warnings -# Create a table to hold the process list -create temporary table t999( - id int, - user char(255), - host char(255), - db char(255), - Command char(255), - time int, - State char(255), - info char(255) -); -# Load processlist into table, headers will create seom warnings ---disable_warnings ---replace_result $MYSQLTEST_VARDIR "." -eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/bl_dump_thread_id" into table t999; ---enable_warnings -let $id = `select Id from t999 where Command="Binlog Dump"`; -drop table t999; diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 810096805c8..95e23756c30 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -29,4 +29,4 @@ INSTALL(TARGETS my_safe_process DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/Safe IF(WIN32) INSTALL(TARGETS my_safe_kill DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) ENDIF() -INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) +INSTALL(FILES Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test) diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index ffe11417e7d..f41a77ff6ac 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -153,12 +153,19 @@ int main(int argc, char* const argv[] ) pid_t own_pid= getpid(); pid_t parent_pid= getppid(); bool nocore = false; + struct sigaction sa,sa_abort; + sa.sa_handler= handle_signal; + sa.sa_flags= SA_NOCLDSTOP; + sigemptyset(&sa.sa_mask); + + sa_abort.sa_handler= handle_abort; + sigemptyset(&sa_abort.sa_mask); /* Install signal handlers */ - signal(SIGTERM, handle_signal); - signal(SIGINT, handle_signal); - signal(SIGCHLD, handle_signal); - signal(SIGABRT, handle_abort); + sigaction(SIGTERM, &sa,NULL); + sigaction(SIGINT, &sa,NULL); + sigaction(SIGCHLD, &sa,NULL); + sigaction(SIGABRT, &sa_abort,NULL); sprintf(safe_process_name, "safe_process[%ld]", (long) own_pid); diff --git a/mysql-test/lib/My/SafeProcess/safe_process.pl b/mysql-test/lib/My/SafeProcess/safe_process.pl deleted file mode 100644 index de844e010a1..00000000000 --- a/mysql-test/lib/My/SafeProcess/safe_process.pl +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/perl -# -*- cperl -*- - -# Copyright (c) 2007, 2011, Oracle and/or its affiliates -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -use strict; -use warnings; - -use lib 'lib'; -use My::SafeProcess::Base; -use POSIX qw(WNOHANG); - -########################################################################### -# Util functions -########################################################################### - -# -#Print message to stderr -# -my $verbose= 0; -sub message { - if ($verbose > 0){ - use Time::localtime; - my $tm= localtime(); - my $timestamp= sprintf("%02d%02d%02d %2d:%02d:%02d", - $tm->year % 100, $tm->mon+1, $tm->mday, - $tm->hour, $tm->min, $tm->sec); - print STDERR $timestamp, " monitor[$$]: ", @_, "\n"; - } -} - - -########################################################################### -# Main program -########################################################################### - -my $terminated= 0; - -# Protect against being killed in the middle -# of child creation, just set the terminated flag -# to make sure the child will be killed off -# when program is ready to do that -$SIG{TERM}= sub { message("!Got signal @_"); $terminated= 1; }; -$SIG{INT}= sub { message("!Got signal @_"); $terminated= 1; }; - -my $parent_pid= getppid(); - -my $found_double_dash= 0; -while (my $arg= shift(@ARGV)){ - - if ($arg =~ /^--$/){ - $found_double_dash= 1; - last; - } - elsif ($arg =~ /^--verbose$/){ - $verbose= 1; - } - else { - die "Unknown option: $arg"; - } -} - -my $path= shift(@ARGV); # Executable - -die "usage:\n" . - " safe_process.pl [opts] -- <path> [<args> [...<args_n>]]" - unless defined $path || $found_double_dash; - - -message("started"); -#message("path: '$path'"); -message("parent: $parent_pid"); - -# Start process to monitor -my $child_pid= - create_process( - path => $path, - args => \@ARGV, - setpgrp => 1, - ); -message("Started child $child_pid"); - -eval { - sub handle_signal { - $terminated= 1; - message("Got signal @_"); - - # Ignore all signals - foreach my $name (keys %SIG){ - $SIG{$name}= 'IGNORE'; - } - - die "signaled\n"; - }; - local $SIG{TERM}= \&handle_signal; - local $SIG{INT}= \&handle_signal; - local $SIG{CHLD}= sub { - message("Got signal @_"); - kill('KILL', -$child_pid); - my $ret= waitpid($child_pid, 0); - if ($? & 127){ - exit(65); # Killed by signal - } - exit($? >> 8); - }; - - # Monitoring loop - while(!$terminated) { - - # Check if parent is still alive - if (kill(0, $parent_pid) < 1){ - message("Parent is not alive anymore"); - last; - } - - # Wait for child to terminate but wakeup every - # second to also check that parent is still alive - my $ret_pid; - $ret_pid= waitpid($child_pid, &WNOHANG); - if ($ret_pid == $child_pid) { - # Process has exited, collect return status - my $ret_code= $? >> 8; - message("Child exit: $ret_code"); - # Exit with exit status of the child - exit ($ret_code); - } - sleep(1); - } -}; -if ( $@ ) { - # The monitoring loop should have been - # broken by handle_signal - warn "Unexpected: $@" unless ( $@ =~ /signaled/ ); -} - -# Use negative pid in order to kill the whole -# process group -# -my $ret= kill('KILL', -$child_pid); -message("Killed child: $child_pid, ret: $ret"); -if ($ret > 0) { - message("Killed child: $child_pid"); - # Wait blocking for the child to return - my $ret_pid= waitpid($child_pid, 0); - if ($ret_pid != $child_pid){ - message("unexpected pid $ret_pid returned from waitpid($child_pid)"); - } -} - -message("DONE!"); -exit (1); - - diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index a8db67f1e67..32ec24da492 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -769,18 +769,11 @@ sub collect_one_test_case { if ( $tinfo->{'ndb_test'} ) { # This is a NDB test - if ( $::opt_skip_ndbcluster == 2 ) + if ( $::ndbcluster_enabled == 0) { - # Ndb is not supported, skip it + # ndbcluster is disabled $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "No ndbcluster support or ndb tests not enabled"; - return $tinfo; - } - elsif ( $::opt_skip_ndbcluster ) - { - # All ndb test's should be skipped - $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "No ndbcluster"; + $tinfo->{'comment'}= "ndbcluster disabled"; return $tinfo; } } diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index e68ac783369..9ab82c454ed 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -28,7 +28,7 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line mtr_warning mtr_error mtr_debug mtr_verbose mtr_verbose_restart mtr_report_test_passed mtr_report_test_skipped mtr_print - mtr_report_test); + mtr_report_test isotime); use mtr_match; use My::Platform; @@ -106,6 +106,8 @@ sub mtr_report_test_passed ($) { $tinfo->{'result'}= 'MTR_RES_PASSED'; mtr_report_test($tinfo); + + resfile_global("endtime ", isotime (time)); } @@ -550,4 +552,12 @@ sub mtr_verbose_restart (@) { } +# Used by --result-file for for formatting times + +sub isotime($) { + my ($sec,$min,$hr,$day,$mon,$yr)= gmtime($_[0]); + return sprintf "%d-%02d-%02dT%02d:%02d:%02dZ", + $yr+1900, $mon+1, $day, $hr, $min, $sec; +} + 1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e2331e2e454..78116574a28 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -333,8 +333,9 @@ sub check_timeout ($) { return testcase_timeout($_[0]) / 10; } our $opt_warnings= 1; -our $opt_include_ndbcluster= 0; -our $opt_skip_ndbcluster= 1; +our $ndbcluster_enabled= 0; +my $opt_include_ndbcluster= 0; +my $opt_skip_ndbcluster= 0; my $exe_ndbd; my $exe_ndbmtd; @@ -361,14 +362,6 @@ my $opt_stop_keep_alive= $ENV{MTR_STOP_KEEP_ALIVE}; select(STDOUT); $| = 1; # Automatically flush STDOUT -# Used by --result-file for for formatting times - -sub isotime($) { - my ($sec,$min,$hr,$day,$mon,$yr)= gmtime($_[0]); - return sprintf "%d-%02d-%02dT%02d:%02d:%02dZ", - $yr+1900, $mon+1, $day, $hr, $min, $sec; -} - main(); @@ -393,26 +386,6 @@ sub main { if (!$opt_suites) { $opt_suites= $DEFAULT_SUITES; - - # Check for any extra suites to enable based on the path name - my %extra_suites= - ( - "mysql-5.1-new-ndb" => "ndb_team", - "mysql-5.1-new-ndb-merge" => "ndb_team", - "mysql-5.1-telco-6.2" => "ndb_team", - "mysql-5.1-telco-6.2-merge" => "ndb_team", - "mysql-5.1-telco-6.3" => "ndb_team", - "mysql-6.0-ndb" => "ndb_team", - ); - - foreach my $dir ( reverse splitdir($basedir) ) { - my $extra_suite= $extra_suites{$dir}; - if (defined $extra_suite) { - mtr_report("Found extra suite: $extra_suite"); - $opt_suites= "$extra_suite,$opt_suites"; - last; - } - } } mtr_report("Using suites: $opt_suites") unless @opt_cases; @@ -762,6 +735,10 @@ sub run_test_server ($$$) { else { mtr_report("\nRetrying test $tname, ". "attempt($retries/$opt_retry)...\n"); + #saving the log file as filename.failed in case of retry + my $worker_logdir= $result->{savedir}; + my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; + rename $log_file_name,$log_file_name.".failed"; delete($result->{result}); $result->{retries}= $retries+1; $result->write_test($sock, 'TESTCASE'); @@ -1138,7 +1115,7 @@ sub command_line_setup { # Control what test suites or cases to run 'force+' => \$opt_force, 'with-ndbcluster-only' => \&collect_option, - 'include-ndbcluster' => \$opt_include_ndbcluster, + 'ndb|include-ndbcluster' => \$opt_include_ndbcluster, 'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster, 'suite|suites=s' => \$opt_suites, 'skip-rpl' => \&collect_option, @@ -1580,7 +1557,6 @@ sub command_line_setup { # -------------------------------------------------------------------------- if ( $opt_embedded_server ) { - $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster $opt_skip_ssl= 1; # Turn off use of SSL # Turn off use of bin log @@ -2036,7 +2012,7 @@ sub executable_setup () { $exe_mysql_embedded= mtr_exe_maybe_exists("$basedir/libmysqld/examples/mysql_embedded"); - if ( ! $opt_skip_ndbcluster ) + if ( $ndbcluster_enabled ) { # Look for single threaded NDB $exe_ndbd= @@ -2298,7 +2274,7 @@ sub environment_setup { # -------------------------------------------------------------------------- # Add the path where libndbclient can be found # -------------------------------------------------------------------------- - if ( !$opt_skip_ndbcluster ) + if ( $ndbcluster_enabled ) { push(@ld_library_paths, "$basedir/storage/ndb/src/.libs"); } @@ -2391,7 +2367,7 @@ sub environment_setup { # ---------------------------------------------------- # Setup env for NDB # ---------------------------------------------------- - if ( ! $opt_skip_ndbcluster ) + if ( $ndbcluster_enabled ) { $ENV{'NDB_MGM'}= my_find_bin($bindir, @@ -2822,7 +2798,7 @@ sub fix_vs_config_dir () { $opt_vs_config=""; - for (<$bindir/sql/*/mysqld.exe>) { + for (<$bindir/sql/*/mysqld.exe>) { #/ if (-M $_ < $modified) { $modified = -M _; @@ -2864,37 +2840,87 @@ sub vs_config_dirs ($$) { sub check_ndbcluster_support { - # Check if this is MySQL Cluster, ie. mysql version string ends - # with -ndb-Y.Y.Y[-status] - if ( defined $mysql_version_extra && - $mysql_version_extra =~ /^-ndb-/ ) + my $ndbcluster_supported = 0; + if ($mysqld_variables{'ndb-connectstring'}) { - mtr_report(" - MySQL Cluster"); - # Enable ndb engine and add more test suites - $opt_include_ndbcluster = 1; - $DEFAULT_SUITES.=",ndb"; + $ndbcluster_supported = 1; } - if ($opt_include_ndbcluster) + if ($opt_skip_ndbcluster && $opt_include_ndbcluster) { - $opt_skip_ndbcluster= 0; + # User is ambivalent. Theoretically the arg which was + # given last on command line should win, but that order is + # unknown at this time. + mtr_error("Ambigous command, both --include-ndbcluster " . + " and --skip-ndbcluster was specified"); } - if ($opt_skip_ndbcluster) + # Check if this is MySQL Cluster, ie. mysql version string ends + # with -ndb-Y.Y.Y[-status] + if ( defined $mysql_version_extra && + $mysql_version_extra =~ /-ndb-([0-9]*)\.([0-9]*)\.([0-9]*)/ ) { - mtr_report(" - skipping ndbcluster"); - return; - } + # MySQL Cluster tree + mtr_report(" - MySQL Cluster detected"); - if ( ! $mysqld_variables{'ndb-connectstring'} ) - { - #mtr_report(" - skipping ndbcluster, mysqld not compiled with ndbcluster"); - $opt_skip_ndbcluster= 2; - return; + if ($opt_skip_ndbcluster) + { + mtr_report(" - skipping ndbcluster(--skip-ndbcluster)"); + return; + } + + if (!$ndbcluster_supported) + { + # MySQL Cluster tree, but mysqld was not compiled with + # ndbcluster -> fail unless --skip-ndbcluster was used + mtr_error("This is MySQL Cluster but mysqld does not " . + "support ndbcluster. Use --skip-ndbcluster to " . + "force mtr to run without it."); + } + + # mysqld was compiled with ndbcluster -> auto enable } + else + { + # Not a MySQL Cluster tree + if (!$ndbcluster_supported) + { + if ($opt_include_ndbcluster) + { + mtr_error("Could not detect ndbcluster support ". + "requested with --include-ndbcluster"); + } + + # Silently skip, mysqld was compiled without ndbcluster + # which is the default case + return; + } - mtr_report(" - using ndbcluster when necessary, mysqld supports it"); + if ($opt_skip_ndbcluster) + { + # Compiled with ndbcluster but ndbcluster skipped + mtr_report(" - skipping ndbcluster(--skip-ndbcluster)"); + return; + } + + + # Not a MySQL Cluster tree, enable ndbcluster + # if --include-ndbcluster was used + if ($opt_include_ndbcluster) + { + # enable ndbcluster + } + else + { + mtr_report(" - skipping ndbcluster(disabled by default)"); + return; + } + } + mtr_report(" - enabling ndbcluster"); + $ndbcluster_enabled= 1; + # Add MySQL Cluster test suites + $DEFAULT_SUITES.=",ndb,ndb_binlog,rpl_ndb,ndb_rpl,ndb_memcache"; return; } diff --git a/mysql-test/r/bug13633383.result b/mysql-test/r/bug13633383.result index 89b522724f9..3b533f89df2 100644 --- a/mysql-test/r/bug13633383.result +++ b/mysql-test/r/bug13633383.result @@ -4,18 +4,18 @@ CREATE TABLE t1 ( `a` int(11) DEFAULT NULL, `col432` bit(8) DEFAULT NULL, -`col433` multipoint DEFAULT NULL, -`col434` polygon DEFAULT NULL, +`col433` geometry DEFAULT NULL, +`col434` geometry DEFAULT NULL, `col435` decimal(50,17) unsigned DEFAULT NULL, `col436` geometry NOT NULL, `col437` tinyblob NOT NULL, -`col438` multipolygon DEFAULT NULL, +`col438` geometry DEFAULT NULL, `col439` mediumblob NOT NULL, `col440` tinyblob NOT NULL, `col441` double unsigned DEFAULT NULL ); CREATE TABLE t2 ( -`a` multipoint DEFAULT NULL, +`a` geometry DEFAULT NULL, `col460` date DEFAULT NULL, `col461` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col462` date NOT NULL, @@ -31,7 +31,7 @@ CREATE TABLE t3 ( `col579` bit(38) NOT NULL, `col580` varchar(93) NOT NULL, `col581` datetime DEFAULT NULL, -`col583` multipolygon DEFAULT NULL, +`col583` geometry DEFAULT NULL, `col584` bit(47) NOT NULL ); set session sort_buffer_size= 32768; diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result index 0d858424715..fbed2ac1565 100644 --- a/mysql-test/r/ddl_i18n_koi8r.result +++ b/mysql-test/r/ddl_i18n_koi8r.result @@ -734,7 +734,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p1`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -751,7 +751,7 @@ COLLATION(_utf8 'текÑÑ‚') AS c6, @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -768,7 +768,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p2`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -785,7 +785,7 @@ COLLATION(_utf8 'текÑÑ‚') AS c6, @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -810,7 +810,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p3`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT ÐÁÒÁÍ1 CHAR(10), OUT ÐÁÒÁÍ2 CHAR(10)) BEGIN @@ -827,7 +827,7 @@ COLLATION(_utf8 'текÑÑ‚') AS c6, @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -844,7 +844,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p4`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT ÐÁÒÁÍ1 CHAR(10) CHARACTER SET utf8, OUT ÐÁÒÁÍ2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -861,7 +861,7 @@ COLLATION(_utf8 'текÑÑ‚') AS c6, @@character_set_client AS c8; SET ÐÁÒÁÍ1 = 'a'; SET ÐÁÒÁÍ2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result index fb32d229040..98da459dafc 100644 --- a/mysql-test/r/ddl_i18n_utf8.result +++ b/mysql-test/r/ddl_i18n_utf8.result @@ -734,7 +734,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p1`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`( INOUT парам1 CHAR(10), OUT парам2 CHAR(10)) BEGIN @@ -751,7 +751,7 @@ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6, @@character_set_client AS c8; SET парам1 = 'a'; SET парам2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -768,7 +768,7 @@ ALTER DATABASE `mysqltest1` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p2`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`( INOUT парам1 CHAR(10) CHARACTER SET utf8, OUT парам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -785,7 +785,7 @@ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6, @@character_set_client AS c8; SET парам1 = 'a'; SET парам2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -810,7 +810,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p3`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p3`( INOUT парам1 CHAR(10), OUT парам2 CHAR(10)) BEGIN @@ -827,7 +827,7 @@ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6, @@character_set_client AS c8; SET парам1 = 'a'; SET парам2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -844,7 +844,7 @@ ALTER DATABASE `mysqltest2` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `p4`( +CREATE DEFINER=`root`@`localhost` PROCEDURE `p4`( INOUT парам1 CHAR(10) CHARACTER SET utf8, OUT парам2 CHAR(10) CHARACTER SET utf8) BEGIN @@ -861,7 +861,7 @@ COLLATION(_koi8r 'ÔÅËÓÔ') AS c6, @@character_set_client AS c8; SET парам1 = 'a'; SET парам2 = 'b'; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index c6b8bf73a6f..363a4700ee6 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -441,3 +441,16 @@ ERROR 21000: Subquery returns more than 1 row DROP TABLE t1, t2; DROP VIEW v1, v2; set optimizer_switch=@save_derived_optimizer_switch; +create table t1 (n bigint(20) unsigned, d1 datetime, d2 datetime, key (d1)); +insert t1 values (2085,'2012-01-01 00:00:00','2013-01-01 00:00:00'); +insert t1 values (2084,'2012-02-01 00:00:00','2013-01-01 00:00:00'); +insert t1 values (2088,'2012-03-01 00:00:00','2013-01-01 00:00:00'); +select * from ( +select n, d1, d2, @result := 0 as result +from t1 +where d1 < '2012-12-12 12:12:12' and n in (2085, 2084) order by d2 asc +) as calculated_result; +n d1 d2 result +2085 2012-01-01 00:00:00 2013-01-01 00:00:00 0 +2084 2012-02-01 00:00:00 2013-01-01 00:00:00 0 +drop table t1; diff --git a/mysql-test/r/group_min_max_innodb.result b/mysql-test/r/group_min_max_innodb.result index 0e7841e979d..320c4b2b750 100644 --- a/mysql-test/r/group_min_max_innodb.result +++ b/mysql-test/r/group_min_max_innodb.result @@ -70,7 +70,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index; Using temporary explain select distinct f1, f2 from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary +1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index drop table t1; create table t1(pk int primary key) engine=innodb; create view v1 as select pk from t1 where pk < 20; diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result index bb455f2b39a..618ce7e540b 100644 --- a/mysql-test/r/join_cache.result +++ b/mysql-test/r/join_cache.result @@ -5595,7 +5595,7 @@ DROP TABLE t1,t2,t3; # CREATE TABLE t1 ( col269 decimal(31,10) unsigned DEFAULT NULL, -col280 multipoint DEFAULT NULL, +col280 geometry DEFAULT NULL, col281 tinyint(1) DEFAULT NULL, col282 time NOT NULL, col284 datetime DEFAULT NULL, diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 64c61d4ee36..c969b237293 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2291,19 +2291,19 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 TRANSACTIONAL=1 drop table t1; CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t1; Table Checksum -test.t1 326284887 +test.t1 310616673 CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t2 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t2; Table Checksum -test.t2 326284887 +test.t2 310616673 CREATE TABLE t3 select * from t1; checksum table t3; Table Checksum -test.t3 326284887 +test.t3 310616673 drop table t1,t2,t3; create table t1 (a1 int,a2 int,a3 int,a4 int,a5 int,a6 int,a7 int,a8 int,a9 int,a10 int,a11 int,a12 int,a13 int,a14 int,a15 int,a16 int,a17 int,a18 int,a19 int,a20 int,a21 int,a22 int,a23 int,a24 int,a25 int,a26 int,a27 int,a28 int,a29 int,a30 int,a31 int,a32 int, key(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32)) engine=myisam; @@ -2337,25 +2337,6 @@ h+0 d + 0 e g + 0 1 1 3 0 1 1 4 0 DROP TABLE t1; -# -# Test of BUG#35570 CHECKSUM TABLE unreliable if LINESTRING field -# (same content / differen checksum) -# -CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)")); -checksum table t1; -Table Checksum -test.t1 326284887 -CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)")); -checksum table t2; -Table Checksum -test.t2 326284887 -CREATE TABLE t3 select * from t1; -checksum table t3; -Table Checksum -test.t3 326284887 -drop table t1,t2,t3; CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), (6,'0'),(7,'0'); diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index e0670f7d643..4d2ac25a0eb 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -513,5 +513,7 @@ create database `aa``bb````cc`; DATABASE() aa`bb``cc drop database `aa``bb````cc`; +a +>>\ndelimiter\n<< End of tests diff --git a/mysql-test/r/mysqlbinlog-innodb.result b/mysql-test/r/mysqlbinlog-innodb.result index 41d15bc32d3..a5865fe4fac 100644 --- a/mysql-test/r/mysqlbinlog-innodb.result +++ b/mysql-test/r/mysqlbinlog-innodb.result @@ -19,6 +19,7 @@ a 1 2 FLUSH LOGS; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -50,6 +51,8 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -81,5 +84,6 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; DROP DATABASE test2; DROP TABLE t1; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 33904dfd9bd..823c7dc8629 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -14,6 +14,7 @@ insert into t1 values ("Alas"); flush logs; --- Local -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -95,8 +96,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Broken LOAD DATA -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -131,8 +134,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- --database -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -186,8 +191,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- --start-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -213,8 +220,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Remote -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -296,8 +305,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Broken LOAD DATA -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -332,8 +343,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- --database -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -387,8 +400,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- --start-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -414,8 +429,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- reading stdin -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -435,6 +452,8 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -453,6 +472,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; drop table t1,t2; flush logs; flush logs; @@ -495,6 +515,7 @@ call p1(); drop procedure p1; call p1(); ERROR 42000: PROCEDURE test.p1 does not exist +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -517,6 +538,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; call p1(); 1 1 @@ -545,6 +567,7 @@ C3BF D0AA drop table t1; flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -634,6 +657,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; CREATE TABLE t1 (c1 CHAR(10)); FLUSH LOGS; INSERT INTO t1 VALUES ('0123456789'); @@ -721,6 +745,7 @@ RESET MASTER; FLUSH LOGS; # # Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified exists +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -772,8 +797,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified does not exist +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -806,8 +833,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified exists +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -846,8 +875,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Test if the 'SAVEPOINT', 'ROLLBACK TO' are output if the database specified does not exist +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -873,6 +904,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; End of 5.0 tests End of 5.1 tests # Expect deprecation warning. diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 7b650addd3d..e3d5df479b3 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2791,8 +2791,8 @@ UNLOCK TABLES; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) -RETURN a+b */;; +CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) +RETURN a+b ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -2808,11 +2808,11 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1 +CREATE DEFINER=`root`@`localhost` FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1 begin set f1= concat( 'hello', f1 ); return f1; -end */;; +end ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -2828,8 +2828,8 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER="root"@"localhost"*/ /*!50003 PROCEDURE "a'b"() -select 1 */;; +CREATE DEFINER="root"@"localhost" PROCEDURE "a'b"() +select 1 ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -2845,8 +2845,8 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) -BEGIN SELECT a+b INTO c; end */;; +CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) +BEGIN SELECT a+b INTO c; end ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -2862,10 +2862,10 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `bug9056_proc2`(OUT a INT) +CREATE DEFINER=`root`@`localhost` PROCEDURE `bug9056_proc2`(OUT a INT) BEGIN select sum(id) from t1 into a; -END */;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -3851,8 +3851,8 @@ create procedure mysqldump_test_db.sp1() select 'hello'; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = '' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50020 DEFINER=`user1`@`%`*/ /*!50003 PROCEDURE `sp1`() -select 'hello' */;; +CREATE DEFINER=`user1`@`%` PROCEDURE `sp1`() +select 'hello' ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 68d2364986d..ae4bd68a435 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -18,6 +18,7 @@ master-bin.000001 # User var # # @`var2`=_binary 0x61 COLLATE binary master-bin.000001 # Query # # use `test`; insert into t1 values (@var1),(@var2) master-bin.000001 # Query # # COMMIT flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -56,4 +57,5 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index f84995cac3b..26eab9f141d 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -29,6 +29,7 @@ a 1 3 ==== Test --base64-output=never on a binlog with row events ==== +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -51,6 +52,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; ==== Test non-matching FD event and Row event ==== BINLOG ' 4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result index 806cf74479e..b86e715869f 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result @@ -15,6 +15,7 @@ set timestamp=@a+1; insert into t1 values(null, "f"); --- Local -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -85,8 +86,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- offset -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -154,8 +157,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -203,8 +208,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -245,8 +252,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start and stop positions --- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -271,8 +280,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -320,8 +331,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -362,9 +375,11 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Local with 2 binlogs on command line -- flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -456,8 +471,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- offset -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -546,8 +563,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -616,8 +635,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -702,8 +723,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -772,8 +795,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -814,8 +839,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Remote -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -886,8 +913,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- offset -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -955,8 +984,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1003,8 +1034,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1045,8 +1078,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start and stop positions --- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1070,8 +1105,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1119,8 +1156,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1161,8 +1200,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Remote with 2 binlogs on command line -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1254,8 +1295,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- offset -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1344,8 +1387,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1413,8 +1458,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1498,8 +1545,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- start-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1568,8 +1617,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- stop-datetime -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1610,8 +1661,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- to-last-log -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1692,6 +1745,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- end of test -- drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index 84a6d6c3baf..fc22085496d 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -328,6 +328,7 @@ INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -4135,3 +4136,4 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result index 31d7ee0df98..8e75d203ecc 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result @@ -2245,6 +2245,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -3786,6 +3787,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # @@ -3868,6 +3870,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -4077,6 +4080,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # @@ -4235,6 +4239,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -4746,6 +4751,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # @@ -4796,6 +4802,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -4853,6 +4860,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result index c268d20c87d..b4ea8551ca6 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result @@ -2245,6 +2245,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -3808,6 +3809,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # @@ -3890,6 +3892,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -4105,6 +4108,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # @@ -4263,6 +4267,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -4784,6 +4789,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # @@ -4834,6 +4840,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -4893,6 +4900,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result index 5d08a1095a9..77e096dd065 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result @@ -124,6 +124,7 @@ FLUSH LOGS; # # Call mysqlbinlog to display the log file contents. # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -463,6 +464,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # Cleanup. # diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result index a305f39fb16..7060343616e 100644 --- a/mysql-test/suite/binlog/r/binlog_row_annotate.result +++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result @@ -60,6 +60,7 @@ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 # - INSERT INTO test2.t2 VALUES (1), (2), (3) # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map) ##################################################################################### +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -280,12 +281,14 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # ##################################################################################### # mysqlbinlog --database=test1 # The following Annotate should appear in this output: # - DELETE test1.t1, test2.t2 FROM <...> ##################################################################################### +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -425,11 +428,13 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # ##################################################################################### # mysqlbinlog --skip-annotate-row-events # No Annotates should appear in this output ##################################################################################### +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -636,6 +641,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # ##################################################################################### # mysqlbinlog --read-from-remote-server @@ -646,6 +652,7 @@ ROLLBACK /* added by mysqlbinlog */; # - INSERT INTO test2.t2 VALUES (1), (2), (3) # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map) ##################################################################################### +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -866,12 +873,14 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # ##################################################################################### # mysqlbinlog --read-from-remote-server --database=test1 # The following Annotate should appear in this output: # - DELETE test1.t1, test2.t2 FROM <...> ##################################################################################### +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1011,11 +1020,13 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # ##################################################################################### # mysqlbinlog --read-from-remote-server --skip-annotate-row-events # No Annotates should appear in this output ##################################################################################### +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1217,3 +1228,4 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result index f0519a9d724..f5d19d08a29 100644 --- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result @@ -10,6 +10,7 @@ master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -32,4 +33,5 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; drop table t2; diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result index 08919db5ed1..74565d976e4 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result +++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result @@ -28,6 +28,7 @@ flush logs; # --rewrite-db = test1->new_test1 # --rewrite-db = test3->new_test3 # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -215,6 +216,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # # mysqlbinlog output # --base64-output = decode-rows @@ -222,6 +224,7 @@ ROLLBACK /* added by mysqlbinlog */; # --rewrite-db = test3->new_test3 # --read-from-remote-server # +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -409,6 +412,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; DROP DATABASE test1; DROP DATABASE test2; DROP DATABASE test3; diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index 3207b9c2180..3a5c3ac4b02 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -10,6 +10,7 @@ master-bin.000001 # User var # # @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ master-bin.000001 # Query # # use `test`; insert into t2 values (@v) master-bin.000001 # Query # # COMMIT flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -37,4 +38,5 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; drop table t2; diff --git a/mysql-test/suite/engines/funcs/disabled.def b/mysql-test/suite/engines/funcs/disabled.def index 2d8ea2d4ff8..c43b0c92bc9 100644 --- a/mysql-test/suite/engines/funcs/disabled.def +++ b/mysql-test/suite/engines/funcs/disabled.def @@ -70,7 +70,6 @@ rpl_replicate_ignore_db : Result Difference Due To Change In .inc file rpl000017 : Result Difference Due To Change In .inc file rpl_skip_error : Result Difference Due To Change In .inc file -rpl_row_until : Test Present in rpl suite as well . Test Fails table with t2 table not found. rpl_loaddata_s : Test Present in rpl suite as well . Test Fails due to bin log truncation. rpl_log_pos : Test Present in rpl suite as well . Test Fails due to bin log truncation. rpl_row_NOW : Result Difference Due To Change In .inc file @@ -96,4 +95,3 @@ rpl_relayspace : Result Difference Due To Change In .inc file rpl_row_inexist_tbl : Result Difference Due To Change In .inc file rpl_sp : Result Difference Due To Change In .inc file rpl_rbr_to_sbr : Result Difference Due To Change In .inc file -rpl_row_until : Test Timesout diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_until.result b/mysql-test/suite/engines/funcs/r/rpl_row_until.result index d8637578ecc..5629f5c8cdd 100644 --- a/mysql-test/suite/engines/funcs/r/rpl_row_until.result +++ b/mysql-test/suite/engines/funcs/r/rpl_row_until.result @@ -1,212 +1,60 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -stop slave; -create table t1(n int not null auto_increment primary key); -insert into t1 values (1),(2),(3),(4); -drop table t1; -create table t2(n int not null auto_increment primary key); -insert into t2 values (1),(2); -insert into t2 values (3),(4); -drop table t2; -start slave until master_log_file='master-bin.000001', master_log_pos=311; -select * from t1; +include/master-slave.inc +[connection master] +CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2),(3),(4); +DROP TABLE t1; +CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t2 VALUES (1),(2); +INSERT INTO t2 VALUES (3),(4); +DROP TABLE t2; +include/stop_slave.inc +RESET SLAVE; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1 +include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t1; n 1 2 3 4 -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running # -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos 311 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; -select * from t1; -n 1 -n 2 -n 3 -n 4 -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running # -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-no-such-bin.000001 -Until_Log_Pos 291 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; -select * from t2; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running # -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Relay -Until_Log_File slave-relay-bin.000004 -Until_Log_Pos 728 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -start slave; -stop slave; -start slave until master_log_file='master-bin.000001', master_log_pos=740; -show slave status; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port MASTER_MYPORT -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File slave-relay-bin.000004 -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition Master -Until_Log_File master-bin.000001 -Until_Log_Pos 740 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno 0 -Last_IO_Error -Last_SQL_Errno 0 -Last_SQL_Error -Replicate_Ignore_Server_Ids -Master_Server_Id 1 -start slave until master_log_file='master-bin', master_log_pos=561; +include/check_slave_param.inc [Exec_Master_Log_Pos] +START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; +include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t1; +n +1 +2 +3 +4 +include/check_slave_param.inc [Exec_Master_Log_Pos] +START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2 +include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t2; +n +1 +2 +include/check_slave_param.inc [Exec_Master_Log_Pos] +START SLAVE; +include/wait_for_slave_to_start.inc +include/stop_slave.inc +START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2 +include/wait_for_slave_param.inc [Until_Log_Pos] +include/wait_for_slave_sql_to_stop.inc +include/check_slave_param.inc [Exec_Master_Log_Pos] +START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS, RELAY_LOG_POS=RELAY_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until master_log_file='master-bin.000001'; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until relay_log_file='slave-relay-bin.000002'; +START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009'; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; +START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=MASTER_LOG_POS; ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL -start slave sql_thread; -start slave until master_log_file='master-bin.000001', master_log_pos=740; +START SLAVE; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS; Warnings: -Level Note -Code 1254 -Message Slave is already running +Note 1254 Slave is already running +include/stop_slave.inc +RESET SLAVE; +include/rpl_end.inc diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_until.test b/mysql-test/suite/engines/funcs/t/rpl_row_until.test index ccd9ce11637..bf38bd487ea 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_row_until.test +++ b/mysql-test/suite/engines/funcs/t/rpl_row_until.test @@ -2,90 +2,126 @@ -- source include/have_binlog_format_row.inc -- source include/master-slave.inc -# Test is dependent on binlog positions +# Note: The test is dependent on binlog positions -# prepare version for substitutions -let $VERSION=`select version()`; +# Create some events on master +connection master; +CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2),(3),(4); +DROP TABLE t1; +# Save master log position for query DROP TABLE t1 +save_master_pos; +let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7); +let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 7); -# stop slave before he will start replication also sync with master -# for avoiding undetermenistic behaviour +CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +# Save master log position for query CREATE TABLE t2 save_master_pos; -connection slave; -sync_with_master; -stop slave; +let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8); + +INSERT INTO t2 VALUES (1),(2); +save_master_pos; +# Save master log position for query INSERT INTO t2 VALUES (1),(2); +let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12); +sync_slave_with_master; + +# Save relay log position for query INSERT INTO t2 VALUES (1),(2); +let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1); connection master; -# create some events on master -create table t1(n int not null auto_increment primary key); -insert into t1 values (1),(2),(3),(4); -drop table t1; -create table t2(n int not null auto_increment primary key); -insert into t2 values (1),(2); -insert into t2 values (3),(4); -drop table t2; - -# try to replicate all queries until drop of t1 +INSERT INTO t2 VALUES (3),(4); +DROP TABLE t2; +# Save master log position for query INSERT INTO t2 VALUES (1),(2); +let $master_pos_drop_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 17); +sync_slave_with_master; + +--source include/stop_slave.inc +# Reset slave. +RESET SLAVE; +--disable_query_log +eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT; +--enable_query_log + +# Try to replicate all queries until drop of t1 connection slave; -start slave until master_log_file='master-bin.000001', master_log_pos=311; -sleep 2; -wait_for_slave_to_stop; -# here table should be still not deleted -select * from t1; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 # -show slave status; - -# this should fail right after start -start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291; +echo START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_drop_t1; +--disable_query_log +eval START SLAVE UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_drop_t1; +--enable_query_log +--source include/wait_for_slave_sql_to_stop.inc + +# Here table should be still not deleted +SELECT * FROM t1; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_drop_t1 +--source include/check_slave_param.inc + +# This should fail right after start +--replace_result 291 MASTER_LOG_POS +START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291; +--source include/wait_for_slave_sql_to_stop.inc # again this table should be still not deleted -select * from t1; -sleep 2; -wait_for_slave_to_stop; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 # -show slave status; - -# try replicate all up to and not including the second insert to t2; -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728; -sleep 2; -wait_for_slave_to_stop; -select * from t2; ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT ---replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 # -show slave status; +SELECT * FROM t1; + +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_drop_t1 +--source include/check_slave_param.inc + +# Try replicate all up to and not including the second insert to t2; +echo START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2; +--disable_query_log +eval START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=$relay_pos_insert1_t2; +--enable_query_log +--source include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t2; + +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_insert1_t2 +--source include/check_slave_param.inc # clean up -start slave; +START SLAVE; +--source include/wait_for_slave_to_start.inc connection master; -save_master_pos; -connection slave; -sync_with_master; -stop slave; +sync_slave_with_master; +--source include/stop_slave.inc -# this should stop immediately as we are already there -start slave until master_log_file='master-bin.000001', master_log_pos=740; -sleep 2; -wait_for_slave_to_stop; +# This should stop immediately as we are already there +echo START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=master_pos_create_t2; +--disable_query_log +eval START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='$master_log_file', MASTER_LOG_POS=$master_pos_create_t2; +--enable_query_log +let $slave_param= Until_Log_Pos; +let $slave_param_value= $master_pos_create_t2; +--source include/wait_for_slave_param.inc +--source include/wait_for_slave_sql_to_stop.inc # here the sql slave thread should be stopped ---vertical_results ---replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 ---replace_column 1 # 7 # 9 # 22 # 23 # 33 # -show slave status; +--let $slave_param= Exec_Master_Log_Pos +--let $slave_param_value= $master_pos_drop_t2 +--source include/check_slave_param.inc #testing various error conditions +--replace_result 561 MASTER_LOG_POS --error 1277 -start slave until master_log_file='master-bin', master_log_pos=561; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561; +--replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS --error 1277 -start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12; --error 1277 -start slave until master_log_file='master-bin.000001'; +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001'; --error 1277 -start slave until relay_log_file='slave-relay-bin.000002'; +START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000009'; +--replace_result 561 MASTER_LOG_POS --error 1277 -start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; +START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561; # Warning should be given for second command -start slave sql_thread; -start slave until master_log_file='master-bin.000001', master_log_pos=740; +START SLAVE; +--replace_result 740 MASTER_LOG_POS +START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740; + +--source include/stop_slave.inc +# Clear slave IO error. +RESET SLAVE; + +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def index 0e7cd067056..8cae44a3607 100644 --- a/mysql-test/suite/innodb/disabled.def +++ b/mysql-test/suite/innodb/disabled.def @@ -10,4 +10,3 @@ # ############################################################################## -innodb_bug12400341: variable innodb_trx_rseg_n_slots_debug is removed in MariaDB diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index 48390b14a82..5b0fccbe615 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -956,7 +956,7 @@ Table Op Msg_type Msg_text test.t1 check status OK explain select * from t1 where b like 'adfd%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL b NULL NULL NULL 15 Using where +1 SIMPLE t1 range b b 769 NULL 11 Using where drop table t1; set global innodb_file_per_table=on; set global innodb_file_format='Barracuda'; diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result new file mode 100644 index 00000000000..6279f85f676 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result @@ -0,0 +1,17 @@ +CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts"); +CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); +# Create and populate the table to be corrupted +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; +INSERT INTO t1 (b) VALUES ('corrupt me'); +INSERT INTO t1 (b) VALUES ('corrupt me'); +# Restart server to flush buffers +# Corrupt the table +Munged a string. +Munged a string. +# Write file to make mysql-test-run.pl expect crash and restart +SELECT * FROM t1; +ERROR HY000: Lost connection to MySQL server during query +# Turn on reconnect +# Wait for server to fully start +# Cleanup +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb_bug14676111.result b/mysql-test/suite/innodb/r/innodb_bug14676111.result new file mode 100644 index 00000000000..ebecd1d00cb --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug14676111.result @@ -0,0 +1,53 @@ +drop table if exists t1; +CREATE TABLE t1 (a int not null primary key) engine=InnoDB; +set global innodb_limit_optimistic_insert_debug = 2; +insert into t1 values (1); +insert into t1 values (5); +insert into t1 values (4); +insert into t1 values (3); +insert into t1 values (2); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; +DATA_LENGTH / 16384 +10.0000 +delete from t1 where a=4; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; +DATA_LENGTH / 16384 +8.0000 +delete from t1 where a=5; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; +DATA_LENGTH / 16384 +5.0000 +set global innodb_limit_optimistic_insert_debug = 10000; +delete from t1 where a=2; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; +DATA_LENGTH / 16384 +3.0000 +insert into t1 values (2); +delete from t1 where a=2; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; +DATA_LENGTH / 16384 +2.0000 +insert into t1 values (2); +delete from t1 where a=2; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; +DATA_LENGTH / 16384 +1.0000 +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb_bug47777.result b/mysql-test/suite/innodb/r/innodb_bug47777.result index fbba47edcfc..6625c400d84 100644 --- a/mysql-test/suite/innodb/r/innodb_bug47777.result +++ b/mysql-test/suite/innodb/r/innodb_bug47777.result @@ -3,11 +3,11 @@ insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)')); select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); count(*) 1 -update bug47777 set c2=GeomFromText('POINT(1 1)'); +update bug47777 set c2=GeomFromText('linestring(1 1)'); select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); count(*) 0 -select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)'); +select count(*) from bug47777 where c2 = GeomFromText('linestring(1 1)'); count(*) 1 drop table bug47777; diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index be2b4b28f6a..b2df98bbfa6 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -343,7 +343,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index; Using temporary explain select distinct f1, f2 from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary +1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index drop table t1; CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20), INDEX (name)); diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index cea9055b873..cb96b71c912 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -1,4 +1,8 @@ -- source include/have_innodb.inc +if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.1.8-29.3 or earlier +} let $MYSQLD_DATADIR= `select @@datadir`; diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt b/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt new file mode 100644 index 00000000000..6b82baca147 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt @@ -0,0 +1 @@ +--innodb_file_per_table=1 --skip-stack-trace --skip-core-file diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test new file mode 100644 index 00000000000..ee3519c53fc --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test @@ -0,0 +1,75 @@ +# +# Test opening a corrupted table. +# + +# Don't test under valgrind, memory leaks will occur +source include/not_valgrind.inc; +# Avoid CrashReporter popup on Mac +source include/not_crashrep.inc; +# Don't test under embedded +source include/not_embedded.inc; +# Require InnoDB +source include/have_innodb.inc; + +CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts"); +CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); + +--echo # Create and populate the table to be corrupted +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB; +INSERT INTO t1 (b) VALUES ('corrupt me'); +--disable_query_log +--let $i = 10 +while ($i) +{ + INSERT INTO t1 (b) VALUES (REPEAT('abcdefghijklmnopqrstuvwxyz', 100)); + dec $i; +} +--enable_query_log +INSERT INTO t1 (b) VALUES ('corrupt me'); + +--echo # Restart server to flush buffers +source include/restart_mysqld.inc; + +--echo # Corrupt the table +let $MYSQLD_DATADIR=`select @@datadir`; +let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd; + +perl; +use strict; +use warnings; +use Fcntl qw(:DEFAULT :seek); + +my $ibd_file = $ENV{'t1_IBD'}; + +my $chunk; +my $len; + +sysopen IBD_FILE, $ibd_file, O_RDWR || die "Unable to open $ibd_file"; + +while ($len = sysread IBD_FILE, $chunk, 1024) +{ + if ($chunk =~ s/corrupt me/korrupt me/) + { + print "Munged a string.\n"; + sysseek IBD_FILE, -$len, SEEK_CUR; + syswrite IBD_FILE, $chunk, $len; + } +} + +close IBD_FILE; +EOF + +--echo # Write file to make mysql-test-run.pl expect crash and restart +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--error 2013 +SELECT * FROM t1; + +--echo # Turn on reconnect +--enable_reconnect + +--echo # Wait for server to fully start +--source include/wait_until_connected_again.inc + +--echo # Cleanup +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_bug14676111.test b/mysql-test/suite/innodb/t/innodb_bug14676111.test new file mode 100644 index 00000000000..fadd111fdc9 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug14676111.test @@ -0,0 +1,128 @@ +# Test for bug #14676111: WRONG PAGE_LEVEL WRITTEN FOR UPPER THAN FATHER PAGE AT BTR_LIFT_PAGE_UP() + +-- source include/have_innodb.inc +-- source include/have_debug.inc + +if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG'`) +{ + --skip Test requires InnoDB built with UNIV_DEBUG definition. +} + +--disable_query_log +set @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug; +--enable_query_log +--disable_warnings +drop table if exists t1; +--enable_warnings + +CREATE TABLE t1 (a int not null primary key) engine=InnoDB; + +let $wait_condition= + SELECT VARIABLE_VALUE < 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS + WHERE VARIABLE_NAME = 'INNODB_PURGE_TRX_ID_AGE'; + +# +# make 4 leveled straight tree +# +set global innodb_limit_optimistic_insert_debug = 2; +insert into t1 values (1); +insert into t1 values (5); +#current tree form +# (1, 5) + +insert into t1 values (4); +#records in a page is limited to 2 artificially. root rise occurs +#current tree form +# (1, 5) +#(1, 4) (5) + +insert into t1 values (3); +#current tree form +# (1, 5) +# (1, 4) (5) +#(1, 3) (4) (5) + +insert into t1 values (2); +#current tree form +# (1, 5) +# (1, 4) (5) +# (1, 3) (4) (5) +#(1, 2) (3) (4) (5) + +analyze table t1; +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; + +delete from t1 where a=4; +--source include/wait_condition.inc +#deleting 1 record of 2 records don't cause merge artificially. +#current tree form +# (1, 5) +# (1) (5) +# (1, 3) (5) +#(1, 2) (3) (5) + +analyze table t1; +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; + +delete from t1 where a=5; +--source include/wait_condition.inc +#deleting 1 record of 2 records don't cause merge artificially. +#current tree form +# (1) +# (1) +# (1, 3) <- lift up this level next, when deleting node ptr +#(1, 2) (3) <- merged next + +analyze table t1; +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; + +# +# cause merge at level 0 +# + +#disable the artificial limitation of records in a page +set global innodb_limit_optimistic_insert_debug = 10000; +delete from t1 where a=2; +--source include/wait_condition.inc +#merge page occurs. and lift up occurs. +#current tree form +# (1) +# (1) +# (1, 3) + +analyze table t1; +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; + +insert into t1 values (2); +#current tree form +# (1) +# (1) <- lift up this level next, because it is not root +# (1, 2, 3) + +delete from t1 where a=2; +--source include/wait_condition.inc +#current tree form +# (1) +# (1, 3) + +analyze table t1; +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; + +insert into t1 values (2); +#current tree form +# (1) +# (1, 2, 3) <- lift up this level next, because the father is root + +delete from t1 where a=2; +--source include/wait_condition.inc +#current tree form +# (1, 3) + +analyze table t1; +select DATA_LENGTH / 16384 from information_schema.TABLES where TABLE_SCHEMA = 'test' and TABLE_NAME = 't1'; + +drop table t1; + +--disable_query_log +set global innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb_bug47777.test b/mysql-test/suite/innodb/t/innodb_bug47777.test index d00509c3814..575d84b97e9 100644 --- a/mysql-test/suite/innodb/t/innodb_bug47777.test +++ b/mysql-test/suite/innodb/t/innodb_bug47777.test @@ -14,11 +14,11 @@ insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)')); select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); # Update table bug47777 should be successful. -update bug47777 set c2=GeomFromText('POINT(1 1)'); +update bug47777 set c2=GeomFromText('linestring(1 1)'); # Verify the row get updated successfully. The original -# c2 value should be changed to GeomFromText('POINT(1 1)'). +# c2 value should be changed to GeomFromText('linestring(1 1)'). select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'); -select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)'); +select count(*) from bug47777 where c2 = GeomFromText('linestring(1 1)'); drop table bug47777; diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test index 3ae5be3aa30..f602876347d 100644 --- a/mysql-test/suite/innodb/t/innodb_mysql.test +++ b/mysql-test/suite/innodb/t/innodb_mysql.test @@ -9,6 +9,10 @@ -- source include/not_staging.inc -- source include/have_innodb.inc -- source include/have_query_cache.inc +if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.1.8-29.3 or earlier +} let $engine_type= InnoDB; let $other_engine_type= MEMORY; diff --git a/mysql-test/suite/maria/maria-gis-rtree-dynamic.result b/mysql-test/suite/maria/maria-gis-rtree-dynamic.result index f4593f2f10a..ee7135c4851 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-dynamic.result +++ b/mysql-test/suite/maria/maria-gis-rtree-dynamic.result @@ -766,35 +766,35 @@ SPATIAL KEY (line) ) row_format=dynamic; ALTER TABLE t1 DISABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES -("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), -("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), -("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), -("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), -("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), -("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), -("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), -("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), -("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), -("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), -("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), -("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), -("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), -("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), -("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), -("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), -("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), -("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), -("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), -("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), -("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), -("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), -("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), -("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), -("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), -("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), -("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), -("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), -("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); +("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), +("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")), +("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")), +("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), +("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), +("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")), +("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")), +("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")), +("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")), +("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")), +("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")), +("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")), +("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")), +("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")), +("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")), +("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")), +("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), +("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), +("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")), +("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")), +("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")), +("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")), +("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")), +("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), +("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")), +("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")), +("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")), +("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")), +("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)")); ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); drop table t1; diff --git a/mysql-test/suite/maria/maria-gis-rtree-dynamic.test b/mysql-test/suite/maria/maria-gis-rtree-dynamic.test index 166c88cab36..668d393d0b8 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-dynamic.test +++ b/mysql-test/suite/maria/maria-gis-rtree-dynamic.test @@ -135,35 +135,35 @@ CREATE TABLE t1 ( ALTER TABLE t1 DISABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES - ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), - ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), - ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), - ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), - ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), - ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), - ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), - ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), - ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), - ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), - ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), - ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), - ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), - ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), - ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), - ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), - ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), - ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), - ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), - ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), - ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), - ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), - ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), - ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), - ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), - ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), - ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), - ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), - ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); + ("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), + ("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")), + ("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")), + ("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), + ("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), + ("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")), + ("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")), + ("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")), + ("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")), + ("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")), + ("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")), + ("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")), + ("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")), + ("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")), + ("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")), + ("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")), + ("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), + ("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), + ("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")), + ("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")), + ("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")), + ("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")), + ("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")), + ("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), + ("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")), + ("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")), + ("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")), + ("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")), + ("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)")); ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); diff --git a/mysql-test/suite/maria/maria-gis-rtree-trans.result b/mysql-test/suite/maria/maria-gis-rtree-trans.result index c4e773c7e0a..dba56204172 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-trans.result +++ b/mysql-test/suite/maria/maria-gis-rtree-trans.result @@ -766,35 +766,35 @@ SPATIAL KEY (line) ) transactional=1 row_format=page; ALTER TABLE t1 DISABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES -("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), -("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), -("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), -("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), -("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), -("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), -("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), -("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), -("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), -("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), -("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), -("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), -("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), -("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), -("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), -("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), -("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), -("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), -("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), -("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), -("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), -("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), -("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), -("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), -("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), -("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), -("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), -("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), -("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); +("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), +("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")), +("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")), +("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), +("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), +("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")), +("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")), +("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")), +("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")), +("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")), +("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")), +("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")), +("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")), +("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")), +("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")), +("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")), +("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), +("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), +("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")), +("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")), +("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")), +("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")), +("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")), +("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), +("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")), +("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")), +("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")), +("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")), +("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)")); ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); drop table t1; diff --git a/mysql-test/suite/maria/maria-gis-rtree-trans.test b/mysql-test/suite/maria/maria-gis-rtree-trans.test index ec1573c3e29..73f129d8df9 100644 --- a/mysql-test/suite/maria/maria-gis-rtree-trans.test +++ b/mysql-test/suite/maria/maria-gis-rtree-trans.test @@ -138,35 +138,35 @@ CREATE TABLE t1 ( ALTER TABLE t1 DISABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES - ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), - ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), - ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), - ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), - ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), - ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), - ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), - ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), - ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), - ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), - ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), - ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), - ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), - ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), - ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), - ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), - ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), - ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), - ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), - ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), - ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), - ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), - ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), - ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), - ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), - ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), - ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), - ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), - ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); + ("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), + ("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")), + ("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")), + ("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), + ("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), + ("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")), + ("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")), + ("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")), + ("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")), + ("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")), + ("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")), + ("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")), + ("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")), + ("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")), + ("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")), + ("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")), + ("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), + ("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), + ("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")), + ("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")), + ("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")), + ("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")), + ("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")), + ("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), + ("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")), + ("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")), + ("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")), + ("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")), + ("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)")); ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); diff --git a/mysql-test/suite/maria/maria-gis-rtree.result b/mysql-test/suite/maria/maria-gis-rtree.result index 430f240d83e..1a7b08169dc 100644 --- a/mysql-test/suite/maria/maria-gis-rtree.result +++ b/mysql-test/suite/maria/maria-gis-rtree.result @@ -766,35 +766,35 @@ SPATIAL KEY (line) ) transactional=0 row_format=page; ALTER TABLE t1 DISABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES -("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), -("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), -("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), -("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), -("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), -("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), -("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), -("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), -("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), -("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), -("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), -("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), -("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), -("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), -("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), -("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), -("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), -("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), -("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), -("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), -("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), -("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), -("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), -("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), -("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), -("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), -("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), -("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), -("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); +("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), +("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")), +("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")), +("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), +("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), +("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")), +("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")), +("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")), +("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")), +("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")), +("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")), +("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")), +("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")), +("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")), +("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")), +("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")), +("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), +("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), +("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")), +("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")), +("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")), +("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")), +("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")), +("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), +("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")), +("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")), +("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")), +("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")), +("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)")); ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); drop table t1; diff --git a/mysql-test/suite/maria/maria-gis-rtree.test b/mysql-test/suite/maria/maria-gis-rtree.test index beffbfc99fe..a3845adb7b9 100644 --- a/mysql-test/suite/maria/maria-gis-rtree.test +++ b/mysql-test/suite/maria/maria-gis-rtree.test @@ -135,35 +135,35 @@ CREATE TABLE t1 ( ALTER TABLE t1 DISABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES - ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), - ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), - ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), - ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), - ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), - ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), - ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), - ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), - ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), - ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), - ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), - ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), - ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), - ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), - ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), - ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), - ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), - ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), - ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), - ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), - ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), - ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), - ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), - ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), - ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), - ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), - ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), - ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), - ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); + ("Aadaouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), + ("Aadassiye", "pp", GeomFromText("LINESTRING(35.816667 36.216667)")), + ("Aadbel", "pp", GeomFromText("LINESTRING(34.533333 36.100000)")), + ("Aadchit", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), + ("Aadchite", "pp", GeomFromText("LINESTRING(33.347222 35.423611)")), + ("Aadchit el Qoussair", "pp", GeomFromText("LINESTRING(33.283333 35.483333)")), + ("Aaddaye", "pp", GeomFromText("LINESTRING(36.716667 40.833333)")), + ("'Aadeissa", "pp", GeomFromText("LINESTRING(32.823889 35.698889)")), + ("Aaderup", "pp", GeomFromText("LINESTRING(55.216667 11.766667)")), + ("Qalaat Aades", "pp", GeomFromText("LINESTRING(33.503333 35.377500)")), + ("A ad'ino", "pp", GeomFromText("LINESTRING(54.812222 38.209167)")), + ("Aadi Noia", "pp", GeomFromText("LINESTRING(13.800000 39.833333)")), + ("Aad La Macta", "pp", GeomFromText("LINESTRING(35.779444 -0.129167)")), + ("Aadland", "pp", GeomFromText("LINESTRING(60.366667 5.483333)")), + ("Aadliye", "pp", GeomFromText("LINESTRING(33.366667 36.333333)")), + ("Aadloun", "pp", GeomFromText("LINESTRING(33.403889 35.273889)")), + ("Aadma", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), + ("Aadma Asundus", "pp", GeomFromText("LINESTRING(58.798333 22.663889)")), + ("Aadmoun", "pp", GeomFromText("LINESTRING(34.150000 35.650000)")), + ("Aadneram", "pp", GeomFromText("LINESTRING(59.016667 6.933333)")), + ("Aadneskaar", "pp", GeomFromText("LINESTRING(58.083333 6.983333)")), + ("Aadorf", "pp", GeomFromText("LINESTRING(47.483333 8.900000)")), + ("Aadorp", "pp", GeomFromText("LINESTRING(52.366667 6.633333)")), + ("Aadouane", "pp", GeomFromText("LINESTRING(32.816667 35.983333)")), + ("Aadoui", "pp", GeomFromText("LINESTRING(34.450000 35.983333)")), + ("Aadouiye", "pp", GeomFromText("LINESTRING(34.583333 36.183333)")), + ("Aadouss", "pp", GeomFromText("LINESTRING(33.512500 35.601389)")), + ("Aadra", "pp", GeomFromText("LINESTRING(33.616667 36.500000)")), + ("Aadzi", "pp", GeomFromText("LINESTRING(38.100000 64.850000)")); ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); diff --git a/mysql-test/suite/maria/maria-recovery-rtree-ft.result b/mysql-test/suite/maria/maria-recovery-rtree-ft.result index 030421ae06a..5c6c791d8f6 100644 --- a/mysql-test/suite/maria/maria-recovery-rtree-ft.result +++ b/mysql-test/suite/maria/maria-recovery-rtree-ft.result @@ -4,7 +4,7 @@ create database mysqltest; use mysqltest; * shut down mysqld, removed logs, restarted it CREATE TABLE t1 ( -line LINESTRING NOT NULL, +line POINT NOT NULL, kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', name VARCHAR(32) ,SPATIAL key (line) diff --git a/mysql-test/suite/maria/maria-recovery-rtree-ft.test b/mysql-test/suite/maria/maria-recovery-rtree-ft.test index 11050ad676a..7112c00e5b7 100644 --- a/mysql-test/suite/maria/maria-recovery-rtree-ft.test +++ b/mysql-test/suite/maria/maria-recovery-rtree-ft.test @@ -31,7 +31,7 @@ use mysqltest; let $mms_tables=2; CREATE TABLE t1 ( - line LINESTRING NOT NULL, + line POINT NOT NULL, kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', name VARCHAR(32) ,SPATIAL key (line) diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 888c1c10c5e..0de42a9e7fe 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2167,19 +2167,19 @@ t1 CREATE TABLE `t1` ( ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 TRANSACTIONAL=1 drop table t1; CREATE TABLE t1 (line LINESTRING NOT NULL) engine=aria; -INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t1; Table Checksum -test.t1 326284887 +test.t1 310616673 CREATE TABLE t2 (line LINESTRING NOT NULL) engine=aria; -INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t2 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t2; Table Checksum -test.t2 326284887 +test.t2 310616673 CREATE TABLE t3 select * from t1; checksum table t3; Table Checksum -test.t3 326284887 +test.t3 310616673 drop table t1,t2,t3; End of 5.1 tests create table t2(a varchar(255),key(a))engine=aria row_format=dynamic transactional=0; diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index 6ebcf08d952..3fa7d755fe4 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -1437,10 +1437,10 @@ drop table t1; # CREATE TABLE t1 (line LINESTRING NOT NULL) engine=aria; -INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t1; CREATE TABLE t2 (line LINESTRING NOT NULL) engine=aria; -INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t2 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t2; CREATE TABLE t3 select * from t1; checksum table t3; diff --git a/mysql-test/suite/parts/r/partition_alter4_innodb.result b/mysql-test/suite/parts/r/partition_alter4_innodb.result index 5d3143e35bb..b0f340664b7 100644 --- a/mysql-test/suite/parts/r/partition_alter4_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter4_innodb.result @@ -37566,7 +37566,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -38026,7 +38026,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -38497,7 +38497,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -38969,7 +38969,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -39435,7 +39435,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -39907,7 +39907,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -40384,7 +40384,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -40859,7 +40859,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -41324,7 +41324,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -41784,7 +41784,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -42255,7 +42255,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -42727,7 +42727,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -43193,7 +43193,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -43665,7 +43665,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -44142,7 +44142,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -44617,7 +44617,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION part_1,part_2; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -52582,7 +52582,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -53042,7 +53042,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -53513,7 +53513,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -53985,7 +53985,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -54451,7 +54451,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -54923,7 +54923,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -55400,7 +55400,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template @@ -55875,7 +55875,7 @@ SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; ALTER TABLE t1 OPTIMIZE PARTITION ALL; Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. test.t1 optimize status OK INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result new file mode 100644 index 00000000000..e89b15e524a --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result @@ -0,0 +1,63 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.performance_timers; +count(*) +5 +select count(*) from performance_schema.setup_consumers; +count(*) +8 +select count(*) > 0 from performance_schema.setup_instruments; +count(*) > 0 +1 +select count(*) from performance_schema.setup_timers; +count(*) +1 +select * from performance_schema.cond_instances; +select * from performance_schema.events_waits_current; +select * from performance_schema.events_waits_history; +select * from performance_schema.events_waits_history_long; +select * from performance_schema.events_waits_summary_by_instance; +select * from performance_schema.events_waits_summary_by_thread_by_event_name; +select * from performance_schema.events_waits_summary_global_by_event_name; +select * from performance_schema.file_instances; +select * from performance_schema.file_summary_by_event_name; +select * from performance_schema.file_summary_by_instance; +select * from performance_schema.mutex_instances; +select * from performance_schema.performance_timers; +select * from performance_schema.rwlock_instances; +select * from performance_schema.setup_consumers; +select * from performance_schema.setup_instruments; +select * from performance_schema.setup_timers; +select * from performance_schema.threads; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 0 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 10000 +performance_schema_max_rwlock_classes 30 +performance_schema_max_rwlock_instances 10000 +performance_schema_max_table_handles 1000 +performance_schema_max_table_instances 500 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_events_waits_history_size"; +Variable_name Value +performance_schema_events_waits_history_size 0 +select count(*) from performance_schema.events_waits_history; +count(*) +0 +truncate table performance_schema.events_waits_history; diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result new file mode 100644 index 00000000000..98172539625 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result @@ -0,0 +1,63 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.performance_timers; +count(*) +5 +select count(*) from performance_schema.setup_consumers; +count(*) +8 +select count(*) > 0 from performance_schema.setup_instruments; +count(*) > 0 +1 +select count(*) from performance_schema.setup_timers; +count(*) +1 +select * from performance_schema.cond_instances; +select * from performance_schema.events_waits_current; +select * from performance_schema.events_waits_history; +select * from performance_schema.events_waits_history_long; +select * from performance_schema.events_waits_summary_by_instance; +select * from performance_schema.events_waits_summary_by_thread_by_event_name; +select * from performance_schema.events_waits_summary_global_by_event_name; +select * from performance_schema.file_instances; +select * from performance_schema.file_summary_by_event_name; +select * from performance_schema.file_summary_by_instance; +select * from performance_schema.mutex_instances; +select * from performance_schema.performance_timers; +select * from performance_schema.rwlock_instances; +select * from performance_schema.setup_consumers; +select * from performance_schema.setup_instruments; +select * from performance_schema.setup_timers; +select * from performance_schema.threads; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 0 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 10000 +performance_schema_max_rwlock_classes 30 +performance_schema_max_rwlock_instances 10000 +performance_schema_max_table_handles 1000 +performance_schema_max_table_instances 500 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_events_waits_history_long_size"; +Variable_name Value +performance_schema_events_waits_history_long_size 0 +select count(*) from performance_schema.events_waits_history_long; +count(*) +0 +truncate table performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/start_server_nothing.result b/mysql-test/suite/perfschema/r/start_server_nothing.result new file mode 100644 index 00000000000..0933b18306b --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_nothing.result @@ -0,0 +1,122 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.performance_timers; +count(*) +5 +select count(*) from performance_schema.setup_consumers; +count(*) +8 +select count(*) > 0 from performance_schema.setup_instruments; +count(*) > 0 +0 +select count(*) from performance_schema.setup_timers; +count(*) +1 +select * from performance_schema.cond_instances; +select * from performance_schema.events_waits_current; +select * from performance_schema.events_waits_history; +select * from performance_schema.events_waits_history_long; +select * from performance_schema.events_waits_summary_by_instance; +select * from performance_schema.events_waits_summary_by_thread_by_event_name; +select * from performance_schema.events_waits_summary_global_by_event_name; +select * from performance_schema.file_instances; +select * from performance_schema.file_summary_by_event_name; +select * from performance_schema.file_summary_by_instance; +select * from performance_schema.mutex_instances; +select * from performance_schema.performance_timers; +select * from performance_schema.rwlock_instances; +select * from performance_schema.setup_consumers; +select * from performance_schema.setup_instruments; +select * from performance_schema.setup_timers; +select * from performance_schema.threads; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 0 +performance_schema_events_waits_history_size 0 +performance_schema_max_cond_classes 0 +performance_schema_max_cond_instances 0 +performance_schema_max_file_classes 0 +performance_schema_max_file_handles 0 +performance_schema_max_file_instances 0 +performance_schema_max_mutex_classes 0 +performance_schema_max_mutex_instances 0 +performance_schema_max_rwlock_classes 0 +performance_schema_max_rwlock_instances 0 +performance_schema_max_table_handles 1000 +performance_schema_max_table_instances 500 +performance_schema_max_thread_classes 0 +performance_schema_max_thread_instances 0 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 0 +performance_schema_events_waits_history_size 0 +performance_schema_max_cond_classes 0 +performance_schema_max_cond_instances 0 +performance_schema_max_file_classes 0 +performance_schema_max_file_handles 0 +performance_schema_max_file_instances 0 +performance_schema_max_mutex_classes 0 +performance_schema_max_mutex_instances 0 +performance_schema_max_rwlock_classes 0 +performance_schema_max_rwlock_instances 0 +performance_schema_max_table_handles 1000 +performance_schema_max_table_instances 500 +performance_schema_max_thread_classes 0 +performance_schema_max_thread_instances 0 +select * from performance_schema.setup_instruments; +NAME ENABLED TIMED +select TIMER_NAME from performance_schema.performance_timers; +TIMER_NAME +CYCLE +NANOSECOND +MICROSECOND +MILLISECOND +TICK +select * from performance_schema.setup_consumers; +NAME ENABLED +events_waits_current YES +events_waits_history YES +events_waits_history_long YES +events_waits_summary_by_thread_by_event_name YES +events_waits_summary_by_event_name YES +events_waits_summary_by_instance YES +file_summary_by_event_name YES +file_summary_by_instance YES +select NAME from performance_schema.setup_timers; +NAME +wait +select * from performance_schema.cond_instances; +NAME OBJECT_INSTANCE_BEGIN +select * from performance_schema.events_waits_current; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +select * from performance_schema.events_waits_history; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +select * from performance_schema.events_waits_history_long; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +select * from performance_schema.events_waits_summary_by_instance; +EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +select * from performance_schema.events_waits_summary_by_thread_by_event_name; +THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +select * from performance_schema.events_waits_summary_global_by_event_name; +EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +select * from performance_schema.file_instances; +FILE_NAME EVENT_NAME OPEN_COUNT +select * from performance_schema.file_summary_by_event_name; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +select * from performance_schema.file_summary_by_instance; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +select * from performance_schema.mutex_instances; +NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID +select * from performance_schema.rwlock_instances; +NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT +select * from performance_schema.threads; +THREAD_ID PROCESSLIST_ID NAME diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history-master.opt b/mysql-test/suite/perfschema/t/start_server_no_waits_history-master.opt new file mode 100644 index 00000000000..334f805e2d5 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history-master.opt @@ -0,0 +1,2 @@ +--loose-enable-performance-schema +--loose-performance_schema_events_waits_history_size=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history.test b/mysql-test/suite/perfschema/t/start_server_no_waits_history.test new file mode 100644 index 00000000000..2ee7dba2526 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history.test @@ -0,0 +1,14 @@ +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect no history +show variables like "performance_schema_events_waits_history_size"; +select count(*) from performance_schema.events_waits_history; + +# Valid operation, edge case +truncate table performance_schema.events_waits_history; + diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history_long-master.opt b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long-master.opt new file mode 100644 index 00000000000..ca6699f8111 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long-master.opt @@ -0,0 +1,2 @@ +--loose-enable-performance-schema +--loose-performance_schema_events_waits_history_long_size=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test new file mode 100644 index 00000000000..e393304a94d --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_waits_history_long.test @@ -0,0 +1,14 @@ +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect no history long +show variables like "performance_schema_events_waits_history_long_size"; +select count(*) from performance_schema.events_waits_history_long; + +# Valid operation, edge case +truncate table performance_schema.events_waits_history_long; + diff --git a/mysql-test/suite/perfschema/t/start_server_nothing-master.opt b/mysql-test/suite/perfschema/t/start_server_nothing-master.opt new file mode 100644 index 00000000000..529d3a1703b --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_nothing-master.opt @@ -0,0 +1,19 @@ +--loose-enable-performance-schema + +--loose-performance_schema_events_waits_history_long_size=0 +--loose-performance_schema_events_waits_history_size=0 + +--loose-performance_schema_max_mutex_classes=0 +--loose-performance_schema_max_rwlock_classes=0 +--loose-performance_schema_max_cond_classes=0 +--loose-performance_schema_max_file_classes=0 +--loose-performance_schema_max_thread_classes=0 + +--loose-performance_schema_max_mutex_instances=0 +--loose-performance_schema_max_rwlock_instances=0 +--loose-performance_schema_max_cond_instances=0 +--loose-performance_schema_max_file_instances=0 +--loose-performance_schema_max_thread_instances=0 + +--loose-performance_schema_max_file_handles=0 + diff --git a/mysql-test/suite/perfschema/t/start_server_nothing.test b/mysql-test/suite/perfschema/t/start_server_nothing.test new file mode 100644 index 00000000000..b2deae35ba6 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_nothing.test @@ -0,0 +1,30 @@ +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +show variables like "performance_schema%"; + +# Not empty +select * from performance_schema.setup_instruments; +select TIMER_NAME from performance_schema.performance_timers; +select * from performance_schema.setup_consumers; +select NAME from performance_schema.setup_timers; + +# All empty +select * from performance_schema.cond_instances; +select * from performance_schema.events_waits_current; +select * from performance_schema.events_waits_history; +select * from performance_schema.events_waits_history_long; +select * from performance_schema.events_waits_summary_by_instance; +select * from performance_schema.events_waits_summary_by_thread_by_event_name; +select * from performance_schema.events_waits_summary_global_by_event_name; +select * from performance_schema.file_instances; +select * from performance_schema.file_summary_by_event_name; +select * from performance_schema.file_summary_by_instance; +select * from performance_schema.mutex_instances; +select * from performance_schema.rwlock_instances; +select * from performance_schema.threads; + diff --git a/mysql-test/suite/rpl/disabled.def b/mysql-test/suite/rpl/disabled.def index a45fdb47ae6..9eb5f57c7be 100644 --- a/mysql-test/suite/rpl/disabled.def +++ b/mysql-test/suite/rpl/disabled.def @@ -13,5 +13,4 @@ rpl_row_create_table : Bug#11759274 2010-02-27 andrei failed different way than earlier with bug#45576 rpl_spec_variables : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock -rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result index 1cf8b87f68d..e09960e848e 100644 --- a/mysql-test/suite/rpl/r/rpl_bug31076.result +++ b/mysql-test/suite/rpl/r/rpl_bug31076.result @@ -35,6 +35,7 @@ KEY `event_id` (`event_id`), KEY `visit_id` (`visit_id`), KEY `data` (`data`) ) ENGINE=MyISAM AUTO_INCREMENT=33900731 DEFAULT CHARSET=latin1; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; BINLOG ' @@ -47,6 +48,7 @@ Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC '/*!*/; SET INSERT_ID=21231039/*!*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; use track/*!*/; SET TIMESTAMP=1190087942/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result index fbe4ba28409..e03257b8901 100644 --- a/mysql-test/suite/rpl/r/rpl_hrtime.result +++ b/mysql-test/suite/rpl/r/rpl_hrtime.result @@ -26,6 +26,7 @@ a b c 0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65 drop table t1; include/rpl_end.inc +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -95,3 +96,4 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result index bbc57006d0d..f904561b722 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev382.result +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -154,6 +154,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f\'le.txt' INTO TABLE `db1``; select 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!") ;file_id=# master-bin.000001 # Query # # COMMIT +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -197,6 +198,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; SELECT * FROM `db1``; select 'oops!'`.`t``1`; a`1 b`2 c`3 fo\o bar |b"a'z! @@ -246,6 +248,7 @@ master-bin.000001 # User var # # @```c`=-123450123456789012345678901234567890123 master-bin.000001 # User var # # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci master-bin.000001 # Query # # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98)) master-bin.000001 # Query # # COMMIT +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -291,6 +294,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; SELECT * FROM `db1``; select 'oops!'`.t1 ORDER BY a1; a1 a2 a3 a4 b c d -9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -337,6 +341,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query # # BEGIN master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES(1) master-bin.000002 # Query # # COMMIT +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -363,5 +368,6 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_report_port.result b/mysql-test/suite/rpl/r/rpl_report_port.result index 6a9ac341780..2f422c8b577 100644 --- a/mysql-test/suite/rpl/r/rpl_report_port.result +++ b/mysql-test/suite/rpl/r/rpl_report_port.result @@ -2,10 +2,12 @@ include/master-slave.inc [connection master] include/rpl_restart_server.inc [server_number=2 parameters: --report-port=9000] include/start_slave.inc +include/wait_for_slave_param.inc [Slave_IO_State] [Slave restarted with the report-port set to some value] include/assert.inc [The value shown for the slave's port number is user specified port number which is the value set for report-port.] include/rpl_restart_server.inc [server_number=2] include/start_slave.inc +include/wait_for_slave_param.inc [Slave_IO_State] [Slave restarted with the report-port set to the value of slave's port number] include/assert.inc [The default value shown for the slave's port number is the actual port number of the slave.] include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result index 1a4d5c7574d..1489af830cc 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result @@ -150,6 +150,7 @@ c1 c3 c4 c5 5 2006-02-22 00:00:00 Tested in Texas 11 --- Test 2 position test -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -170,8 +171,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Test 3 First Remote test -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -201,6 +204,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Test 4 Second Remote test -- DROP TABLE t1; @@ -274,6 +278,7 @@ c1 c3 c4 c5 5 2006-02-22 00:00:00 Tested in Texas 11 --- Test 5 LOAD DATA -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -281,8 +286,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Test 6 reading stdin -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -312,8 +319,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Test 7 reading stdin w/position -- +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -334,6 +343,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; --- Test 8 switch internal charset -- stop slave; diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 8a2a88a8c90..2f5052f0180 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -652,6 +652,7 @@ show function status like '%mysqltestbug36570%'; Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation test mysqltestbug36570_f1 FUNCTION root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci flush logs; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; @@ -1178,6 +1179,7 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; use test; drop procedure mysqltestbug36570_p1; drop procedure ` mysqltestbug36570_p2`; diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test index 028ca32636a..4e9517fbf2a 100644 --- a/mysql-test/suite/rpl/t/rpl_bug31076.test +++ b/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -40,6 +40,7 @@ CREATE TABLE `visits_events` ( KEY `data` (`data`) ) ENGINE=MyISAM AUTO_INCREMENT=33900731 DEFAULT CHARSET=latin1; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; --delimiter /*!*/; @@ -119,6 +120,7 @@ SET INSERT_ID=21231039/*!*/; # 9c90ded 2d 63 6f 6e 6e 65 63 74 6f 72 2d 6a 61 76 61 2d |.connector.java.| # 9c90dfd 33 2e 30 2e 31 37 2d 67 61 2e 7a 69 70 |3.0.17.ga.zip| # Query thread_id=28278824 exec_time=0 error_code=0 +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; use track/*!*/; SET TIMESTAMP=1190087942/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; diff --git a/mysql-test/suite/rpl/t/rpl_report_port.test b/mysql-test/suite/rpl/t/rpl_report_port.test index 12c34ce01b1..6e728a678ad 100644 --- a/mysql-test/suite/rpl/t/rpl_report_port.test +++ b/mysql-test/suite/rpl/t/rpl_report_port.test @@ -32,6 +32,9 @@ connection master; connection slave; --source include/start_slave.inc +--let $slave_param= Slave_IO_State +--let $slave_param_value= Waiting for master to send event +--source include/wait_for_slave_param.inc --echo [Slave restarted with the report-port set to some value] connection master; @@ -52,6 +55,9 @@ connection master; connection slave; --source include/start_slave.inc +--let $slave_param= Slave_IO_State +--let $slave_param_value= Waiting for master to send event +--source include/wait_for_slave_param.inc connection master; sync_slave_with_master; diff --git a/mysql-test/suite/sys_vars/disabled.def b/mysql-test/suite/sys_vars/disabled.def index 1ae495e4863..596191d09b6 100644 --- a/mysql-test/suite/sys_vars/disabled.def +++ b/mysql-test/suite/sys_vars/disabled.def @@ -10,6 +10,5 @@ # ############################################################################## -innodb_trx_rseg_n_slots_debug_basic: variable innodb_trx_rseg_n_slots_debug is removed in MariaDB innodb_flush_checkpoint_debug_basic: removed from XtraDB-26.0 diff --git a/mysql-test/suite/sys_vars/r/innodb_limit_optimistic_insert_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_limit_optimistic_insert_debug_basic.result new file mode 100644 index 00000000000..3d4f401aad1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_limit_optimistic_insert_debug_basic.result @@ -0,0 +1,58 @@ +SET @start_global_value = @@global.innodb_limit_optimistic_insert_debug; +SELECT @start_global_value; +@start_global_value +0 +select @@global.innodb_limit_optimistic_insert_debug; +@@global.innodb_limit_optimistic_insert_debug +0 +select @@session.innodb_limit_optimistic_insert_debug; +ERROR HY000: Variable 'innodb_limit_optimistic_insert_debug' is a GLOBAL variable +show global variables like 'innodb_limit_optimistic_insert_debug'; +Variable_name Value +innodb_limit_optimistic_insert_debug 0 +show session variables like 'innodb_limit_optimistic_insert_debug'; +Variable_name Value +innodb_limit_optimistic_insert_debug 0 +select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG 0 +set global innodb_limit_optimistic_insert_debug=1; +select @@global.innodb_limit_optimistic_insert_debug; +@@global.innodb_limit_optimistic_insert_debug +1 +select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG 1 +select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG 1 +set @@global.innodb_limit_optimistic_insert_debug=0; +select @@global.innodb_limit_optimistic_insert_debug; +@@global.innodb_limit_optimistic_insert_debug +0 +select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG 0 +set session innodb_limit_optimistic_insert_debug='some'; +ERROR HY000: Variable 'innodb_limit_optimistic_insert_debug' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_limit_optimistic_insert_debug='some'; +ERROR HY000: Variable 'innodb_limit_optimistic_insert_debug' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_limit_optimistic_insert_debug=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_limit_optimistic_insert_debug' +set global innodb_limit_optimistic_insert_debug='foo'; +ERROR 42000: Incorrect argument type to variable 'innodb_limit_optimistic_insert_debug' +set global innodb_limit_optimistic_insert_debug=-2; +Warnings: +Warning 1292 Truncated incorrect innodb_limit_optimistic_insert_d value: '-2' +set global innodb_limit_optimistic_insert_debug=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_limit_optimistic_insert_debug' +SET @@global.innodb_limit_optimistic_insert_debug = @start_global_value; +SELECT @@global.innodb_limit_optimistic_insert_debug; +@@global.innodb_limit_optimistic_insert_debug +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result b/mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result new file mode 100644 index 00000000000..1bd078dfd7e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_print_all_deadlocks_basic.result @@ -0,0 +1,22 @@ +SELECT @@innodb_print_all_deadlocks; +@@innodb_print_all_deadlocks +0 +SET GLOBAL innodb_print_all_deadlocks=1; +CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB; +INSERT INTO t1 VALUES (123); +CREATE TABLE t2 (c2 INT, PRIMARY KEY (c2)) ENGINE=INNODB; +INSERT INTO t2 VALUES (456); +BEGIN; +SELECT * FROM t1 FOR UPDATE; +c1 +123 +BEGIN; +SELECT * FROM t2 FOR UPDATE; +c2 +456 +SELECT * FROM t2 FOR UPDATE; +SELECT * FROM t1 FOR UPDATE; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t2; +DROP TABLE t1; +SET GLOBAL innodb_print_all_deadlocks=default; diff --git a/mysql-test/suite/sys_vars/r/innodb_trx_purge_view_update_only_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_trx_purge_view_update_only_debug_basic.result new file mode 100644 index 00000000000..1779cbb48df --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_trx_purge_view_update_only_debug_basic.result @@ -0,0 +1,62 @@ +SET @start_global_value = @@global.innodb_trx_purge_view_update_only_debug; +SELECT @start_global_value; +@start_global_value +0 +select @@global.innodb_trx_purge_view_update_only_debug in (0, 1); +@@global.innodb_trx_purge_view_update_only_debug in (0, 1) +1 +select @@global.innodb_trx_purge_view_update_only_debug; +@@global.innodb_trx_purge_view_update_only_debug +0 +select @@session.innodb_trx_purge_view_update_only_debug; +ERROR HY000: Variable 'innodb_trx_purge_view_update_only_debug' is a GLOBAL variable +show global variables like 'innodb_trx_purge_view_update_only_debug'; +Variable_name Value +innodb_trx_purge_view_update_only_debug OFF +show session variables like 'innodb_trx_purge_view_update_only_debug'; +Variable_name Value +innodb_trx_purge_view_update_only_debug OFF +select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG OFF +select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG OFF +set global innodb_trx_purge_view_update_only_debug=1; +select @@global.innodb_trx_purge_view_update_only_debug; +@@global.innodb_trx_purge_view_update_only_debug +1 +select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG ON +select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG ON +set @@global.innodb_trx_purge_view_update_only_debug=0; +select @@global.innodb_trx_purge_view_update_only_debug; +@@global.innodb_trx_purge_view_update_only_debug +0 +select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG OFF +select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG OFF +set session innodb_trx_purge_view_update_only_debug='some'; +ERROR HY000: Variable 'innodb_trx_purge_view_update_only_debug' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_trx_purge_view_update_only_debug='some'; +ERROR HY000: Variable 'innodb_trx_purge_view_update_only_debug' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_trx_purge_view_update_only_debug=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_purge_view_update_only_debug' +set global innodb_trx_purge_view_update_only_debug='foo'; +ERROR 42000: Variable 'innodb_trx_purge_view_update_only_debug' can't be set to the value of 'foo' +set global innodb_trx_purge_view_update_only_debug=-2; +ERROR 42000: Variable 'innodb_trx_purge_view_update_only_debug' can't be set to the value of '-2' +set global innodb_trx_purge_view_update_only_debug=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_purge_view_update_only_debug' +set global innodb_trx_purge_view_update_only_debug=2; +ERROR 42000: Variable 'innodb_trx_purge_view_update_only_debug' can't be set to the value of '2' +SET @@global.innodb_trx_purge_view_update_only_debug = @start_global_value; +SELECT @@global.innodb_trx_purge_view_update_only_debug; +@@global.innodb_trx_purge_view_update_only_debug +0 diff --git a/mysql-test/suite/sys_vars/r/ndb_log_update_as_write_basic.result b/mysql-test/suite/sys_vars/r/ndb_log_update_as_write_basic.result deleted file mode 100644 index 6353fba2b7c..00000000000 --- a/mysql-test/suite/sys_vars/r/ndb_log_update_as_write_basic.result +++ /dev/null @@ -1,14 +0,0 @@ -SET @global_start_value = @@global.ndb_log_update_as_write; -ERROR HY000: Unknown system variable 'ndb_log_update_as_write' -SELECT @@global.ndb_log_update_as_write; -ERROR HY000: Unknown system variable 'ndb_log_update_as_write' -'Bug: The value is not a system variable or atleast not supported in version 5.1.22' -'#--------------------FN_DYNVARS_102_01------------------------#' -'#---------------------FN_DYNVARS_102_02-------------------------#' -'#--------------------FN_DYNVARS_102_03------------------------#' -'#--------------------FN_DYNVARS_102_04-------------------------#' -'#-------------------FN_DYNVARS_102_05----------------------------#' -'#----------------------FN_DYNVARS_102_06------------------------#' -'#----------------------FN_DYNVARS_102_07------------------------#' -'#---------------------FN_DYNVARS_102_08-------------------------#' -'#---------------------FN_DYNVARS_102_09----------------------#' diff --git a/mysql-test/suite/sys_vars/r/ndb_log_updated_only_basic.result b/mysql-test/suite/sys_vars/r/ndb_log_updated_only_basic.result deleted file mode 100644 index 38abb7cc263..00000000000 --- a/mysql-test/suite/sys_vars/r/ndb_log_updated_only_basic.result +++ /dev/null @@ -1,14 +0,0 @@ -SET @global_start_value = @@global.ndb_log_updated_only; -ERROR HY000: Unknown system variable 'ndb_log_updated_only' -SELECT @@global.ndb_log_updated_only; -ERROR HY000: Unknown system variable 'ndb_log_updated_only' -'Bug: The value is not a system variable or atleast not supported in version 5.1.22' -'#--------------------FN_DYNVARS_103_01------------------------#' -'#---------------------FN_DYNVARS_103_02-------------------------#' -'#--------------------FN_DYNVARS_103_03------------------------#' -'#--------------------FN_DYNVARS_103_04-------------------------#' -'#-------------------FN_DYNVARS_103_05----------------------------#' -'#----------------------FN_DYNVARS_103_06------------------------#' -'#----------------------FN_DYNVARS_103_07------------------------#' -'#---------------------FN_DYNVARS_103_08-------------------------#' -'#---------------------FN_DYNVARS_103_09----------------------#' diff --git a/mysql-test/suite/sys_vars/r/pseudo_slave_mode_basic.result b/mysql-test/suite/sys_vars/r/pseudo_slave_mode_basic.result new file mode 100644 index 00000000000..c98dd338909 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pseudo_slave_mode_basic.result @@ -0,0 +1,119 @@ +SET @session_start_value = @@session.pseudo_slave_mode; +SELECT @session_start_value; +@session_start_value +0 +'#--------------------FN_DYNVARS_156_01------------------------#' +SET @@session.pseudo_slave_mode = 0; +Warnings: +Warning 1231 'pseudo_slave_mode' change was ineffective. +SET @@session.pseudo_slave_mode = DEFAULT; +Warnings: +Warning 1231 'pseudo_slave_mode' change was ineffective. +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +0 +SET @@session.pseudo_slave_mode = 1; +SET @@session.pseudo_slave_mode = DEFAULT; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +0 +'#---------------------FN_DYNVARS_156_02-------------------------#' +SET pseudo_slave_mode = 1; +SELECT @@pseudo_slave_mode; +@@pseudo_slave_mode +1 +SELECT session.pseudo_slave_mode; +ERROR 42S02: Unknown table 'session' in field list +SELECT local.pseudo_slave_mode; +ERROR 42S02: Unknown table 'local' in field list +SET session pseudo_slave_mode = 0; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +0 +'#--------------------FN_DYNVARS_156_03------------------------#' +SET @@session.pseudo_slave_mode = 0; +Warnings: +Warning 1231 'pseudo_slave_mode' change was ineffective. +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +0 +SET @@session.pseudo_slave_mode = 1; +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +1 +'#--------------------FN_DYNVARS_156_04-------------------------#' +SET @@session.pseudo_slave_mode = -1; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of '-1' +SET @@session.pseudo_slave_mode = 2; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of '2' +SET @@session.pseudo_slave_mode = "T"; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of 'T' +SET @@session.pseudo_slave_mode = "Y"; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of 'Y' +SET @@session.pseudo_slave_mode = TRÜE; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of 'TRÜE' +SET @@session.pseudo_slave_mode = ÕN; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of 'ÕN' +SET @@session.pseudo_slave_mode = OF; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of 'OF' +SET @@session.pseudo_slave_mode = ÓFF; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of 'ÓFF' +SET @@session.pseudo_slave_mode = '¹'; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of '¹' +SET @@session.pseudo_slave_mode = NO; +ERROR 42000: Variable 'pseudo_slave_mode' can't be set to the value of 'NO' +'#-------------------FN_DYNVARS_156_05----------------------------#' +SET @@global.pseudo_slave_mode = 0; +ERROR HY000: Variable 'pseudo_slave_mode' is a SESSION variable and can't be used with SET GLOBAL +SELECT @@global.pseudo_slave_mode; +ERROR HY000: Variable 'pseudo_slave_mode' is a SESSION variable +'#----------------------FN_DYNVARS_156_06------------------------#' +SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='pseudo_slave_mode'; +count(VARIABLE_VALUE) +1 +'#----------------------FN_DYNVARS_156_07------------------------#' +SELECT IF(@@session.pseudo_slave_mode, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='pseudo_slave_mode'; +IF(@@session.pseudo_slave_mode, "ON", "OFF") = VARIABLE_VALUE +1 +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +1 +SELECT VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='pseudo_slave_mode'; +VARIABLE_VALUE +ON +'#---------------------FN_DYNVARS_156_08-------------------------#' +SET @@session.pseudo_slave_mode = OFF; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +0 +SET @@session.pseudo_slave_mode = ON; +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +1 +'#---------------------FN_DYNVARS_156_09----------------------#' +SET @@session.pseudo_slave_mode = TRUE; +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +1 +SET @@session.pseudo_slave_mode = FALSE; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +0 +SET @@session.pseudo_slave_mode = @session_start_value; +Warnings: +Warning 1231 'pseudo_slave_mode' change was ineffective. +SELECT @@session.pseudo_slave_mode; +@@session.pseudo_slave_mode +0 diff --git a/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test new file mode 100644 index 00000000000..26a5c8534a1 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test @@ -0,0 +1,54 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.1.8-29.3 or earlier +} + +SET @start_global_value = @@global.innodb_limit_optimistic_insert_debug; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.innodb_limit_optimistic_insert_debug; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_limit_optimistic_insert_debug; +show global variables like 'innodb_limit_optimistic_insert_debug'; +show session variables like 'innodb_limit_optimistic_insert_debug'; +select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug'; +select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug'; + +# +# show that it's writable +# +set global innodb_limit_optimistic_insert_debug=1; +select @@global.innodb_limit_optimistic_insert_debug; +select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug'; +select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug'; +set @@global.innodb_limit_optimistic_insert_debug=0; +select @@global.innodb_limit_optimistic_insert_debug; +select * from information_schema.global_variables where variable_name='innodb_limit_optimistic_insert_debug'; +select * from information_schema.session_variables where variable_name='innodb_limit_optimistic_insert_debug'; +--error ER_GLOBAL_VARIABLE +set session innodb_limit_optimistic_insert_debug='some'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_limit_optimistic_insert_debug='some'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_limit_optimistic_insert_debug=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_limit_optimistic_insert_debug='foo'; +set global innodb_limit_optimistic_insert_debug=-2; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_limit_optimistic_insert_debug=1e1; + +# +# Cleanup +# + +SET @@global.innodb_limit_optimistic_insert_debug = @start_global_value; +SELECT @@global.innodb_limit_optimistic_insert_debug; diff --git a/mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test b/mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test new file mode 100644 index 00000000000..56755b523e6 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_print_all_deadlocks_basic.test @@ -0,0 +1,52 @@ +# +# innodb_print_all_deadlocks +# + +-- source include/have_innodb.inc +if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.1.8-29.3 or earlier +} + +SELECT @@innodb_print_all_deadlocks; + +SET GLOBAL innodb_print_all_deadlocks=1; + +CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB; +INSERT INTO t1 VALUES (123); + +CREATE TABLE t2 (c2 INT, PRIMARY KEY (c2)) ENGINE=INNODB; +INSERT INTO t2 VALUES (456); + +-- connect (con1,localhost,root,,) +-- connect (con2,localhost,root,,) + +-- connection con1 +BEGIN; +SELECT * FROM t1 FOR UPDATE; + +-- connection con2 +BEGIN; +SELECT * FROM t2 FOR UPDATE; + +-- connection con1 +-- send +SELECT * FROM t2 FOR UPDATE; + +-- connection con2 +let $wait_condition= +SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST +WHERE state = 'Sending data' AND info = 'SELECT * FROM t2 FOR UPDATE'; +-- source include/wait_condition.inc +-- error ER_LOCK_DEADLOCK +SELECT * FROM t1 FOR UPDATE; + +-- connection default + +-- disconnect con1 +-- disconnect con2 + +DROP TABLE t2; +DROP TABLE t1; + +SET GLOBAL innodb_print_all_deadlocks=default; diff --git a/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test new file mode 100644 index 00000000000..249bb50f64d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test @@ -0,0 +1,58 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.1.8-29.3 or earlier +} + +SET @start_global_value = @@global.innodb_trx_purge_view_update_only_debug; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.innodb_trx_purge_view_update_only_debug in (0, 1); +select @@global.innodb_trx_purge_view_update_only_debug; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_trx_purge_view_update_only_debug; +show global variables like 'innodb_trx_purge_view_update_only_debug'; +show session variables like 'innodb_trx_purge_view_update_only_debug'; +select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug'; + +# +# show that it's writable +# +set global innodb_trx_purge_view_update_only_debug=1; +select @@global.innodb_trx_purge_view_update_only_debug; +select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +set @@global.innodb_trx_purge_view_update_only_debug=0; +select @@global.innodb_trx_purge_view_update_only_debug; +select * from information_schema.global_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_purge_view_update_only_debug'; +--error ER_GLOBAL_VARIABLE +set session innodb_trx_purge_view_update_only_debug='some'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_trx_purge_view_update_only_debug='some'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_purge_view_update_only_debug=1.1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_trx_purge_view_update_only_debug='foo'; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_trx_purge_view_update_only_debug=-2; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_purge_view_update_only_debug=1e1; +--error ER_WRONG_VALUE_FOR_VAR +set global innodb_trx_purge_view_update_only_debug=2; + +# +# Cleanup +# + +SET @@global.innodb_trx_purge_view_update_only_debug = @start_global_value; +SELECT @@global.innodb_trx_purge_view_update_only_debug; diff --git a/mysql-test/suite/sys_vars/t/ndb_log_update_as_write_basic.test b/mysql-test/suite/sys_vars/t/ndb_log_update_as_write_basic.test deleted file mode 100644 index e616a807a38..00000000000 --- a/mysql-test/suite/sys_vars/t/ndb_log_update_as_write_basic.test +++ /dev/null @@ -1,216 +0,0 @@ -############## mysql-test\t\ndb_log_update_as_write_basic.test ############### -# # -# Variable Name: ndb_log_update_as_write # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_update_as_write # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### -############## mysql-test\t\ndb_log_update_as_write_basic.test ################ -# # -# Variable Name: ndb_log_update_as_write # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_update_as_write # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ -################# mysql-test\t\ndb_log_update_as_write_basic.test ###### -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable # -# ndb_log_update_as_write that check behavior of this # -# variable with valid values, invalid values, # -# accessing variable with scope that is # -# allowed and with scope that is now allowed. # -# Scope: Global # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system # -# -variables.html # -# # -######################################################################## - ---source include/load_sysvars.inc - -######################################################################## -# START OF ndb_log_update_as_write TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of ndb_log_update_as_write in a temporary variable # -################################################################################ - - ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SET @global_start_value = @@global.ndb_log_update_as_write; ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SELECT @@global.ndb_log_update_as_write; - ---echo 'Bug: The value is not a system variable or atleast not supported in version 5.1.22' - - ---echo '#--------------------FN_DYNVARS_102_01------------------------#' -######################################################################## -# Display the DEFAULT value of ndb_log_update_as_write # -######################################################################## - -#SET @@ndb_log_update_as_write = 0; -#SET @@ndb_log_update_as_write = DEFAULT; -#SELECT @@ndb_log_update_as_write; -# -#SET @@ndb_log_update_as_write = 1; -#SET @@ndb_log_update_as_write = DEFAULT; -#SELECT @@ndb_log_update_as_write; - - ---echo '#---------------------FN_DYNVARS_102_02-------------------------#' -############################################################################# -# Check if ndb_log_update_as_write can be accessed with and without @@ sign # -############################################################################# - -#SET ndb_log_update_as_write = 1; -#SELECT @@ndb_log_update_as_write; -#--Error ER_UNKNOWN_TABLE -#SELECT global.ndb_log_update_as_write; -# -#SET global ndb_log_update_as_write = 1; -#SELECT @@global.ndb_log_update_as_write; - - ---echo '#--------------------FN_DYNVARS_102_03------------------------#' -######################################################################## -# Change the value of ndb_log_update_as_write to a valid value # -######################################################################## - -#SET @@global.ndb_log_update_as_write = 0; -#SELECT @@global.ndb_log_update_as_write; -#SET @@global.ndb_log_update_as_write = 1; -#SELECT @@global.ndb_log_update_as_write; -## a value of 2 is used to just flush logs and then shutdown cold. -#SET @@global.ndb_log_update_as_write = 2; -#SELECT @@global.ndb_log_update_as_write; - ---echo '#--------------------FN_DYNVARS_102_04-------------------------#' -########################################################################### -# Change the value of ndb_log_update_as_write to invalid value # -########################################################################### - -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = -1; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = TRU; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = TRUE_F; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = FALS; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = OON; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = ONN; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = OOFF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = 0FF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = ' 1'; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_update_as_write = "0 "; - - - ---echo '#-------------------FN_DYNVARS_102_05----------------------------#' -########################################################################### -# Test if accessing session ndb_log_update_as_write gives error # -########################################################################### - -#--Error ER_LOCAL_VARIABLE -#SET @@session.ndb_log_update_as_write = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@ndb_log_update_as_write = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@local.ndb_log_update_as_write = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@session.ndb_log_update_as_write; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@local.ndb_log_update_as_write; - ---echo '#----------------------FN_DYNVARS_102_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -#SELECT count(VARIABLE_VALUE) AS res_is_0 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='ndb_log_update_as_write'; - - ---echo '#----------------------FN_DYNVARS_102_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -#SELECT @@global.ndb_log_update_as_write = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='ndb_log_update_as_write'; - - ---echo '#---------------------FN_DYNVARS_102_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -#SET @@ndb_log_update_as_write = OFF; -#SELECT @@ndb_log_update_as_write; -#SET @@ndb_log_update_as_write = ON; -#SELECT @@ndb_log_update_as_write; - ---echo '#---------------------FN_DYNVARS_102_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -#SET @@ndb_log_update_as_write = TRUE; -#SELECT @@ndb_log_update_as_write; -#SET @@ndb_log_update_as_write = 'FALSE'; -#SELECT @@ndb_log_update_as_write; - -############################## -# Restore initial value # -############################## - -#SET @@ndb_log_update_as_write = @global_start_value; -#SELECT @@ndb_log_update_as_write; - -######################################################################## -# END OF ndb_log_update_as_write TESTS # -######################################################################## diff --git a/mysql-test/suite/sys_vars/t/ndb_log_updated_only_basic.test b/mysql-test/suite/sys_vars/t/ndb_log_updated_only_basic.test deleted file mode 100644 index c00ecf2e2fa..00000000000 --- a/mysql-test/suite/sys_vars/t/ndb_log_updated_only_basic.test +++ /dev/null @@ -1,216 +0,0 @@ -############## mysql-test\t\ndb_log_updated_only_basic.test ############### -# # -# Variable Name: ndb_log_updated_only # -# Scope: GLOBAL # -# Access Type: Dynamic # -# Data Type: boolean # -# Default Value: # -# Range: # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_updated_only # -# that checks the behavior of this variable in the following ways# -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -############################################################################### -############## mysql-test\t\ndb_log_updated_only_basic.test ################ -# # -# Variable Name: ndb_log_updated_only # -# Scope: GLOBAL & SESSION # -# Access Type: Dynamic # -# Data Type: Numeric # -# Default Value: 1 # -# Range: 1 - 65536 # -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable ndb_log_updated_only # -# that checks the behavior of this variable in the following ways # -# * Default Value # -# * Valid & Invalid values # -# * Scope & Access method # -# * Data Integrity # -# # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/ # -# server-system-variables.html # -# # -################################################################################ -################# mysql-test\t\ndb_log_updated_only_basic.test ######### -# # -# # -# Creation Date: 2008-02-07 # -# Author: Rizwan Maredia # -# # -# Description: Test Cases of Dynamic System Variable # -# ndb_log_updated_only that check behavior of this # -# variable with valid values, invalid values, # -# accessing variable with scope that is # -# allowed and with scope that is now allowed. # -# Scope: Global # -# Reference: http://dev.mysql.com/doc/refman/5.1/en/server-system # -# -variables.html # -# # -######################################################################## - ---source include/load_sysvars.inc - -######################################################################## -# START OF ndb_log_updated_only TESTS # -######################################################################## - - -################################################################################ -# Saving initial value of ndb_log_updated_only in a temporary variable # -################################################################################ - - ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SET @global_start_value = @@global.ndb_log_updated_only; ---Error ER_UNKNOWN_SYSTEM_VARIABLE -SELECT @@global.ndb_log_updated_only; - ---echo 'Bug: The value is not a system variable or atleast not supported in version 5.1.22' - - ---echo '#--------------------FN_DYNVARS_103_01------------------------#' -######################################################################## -# Display the DEFAULT value of ndb_log_updated_only # -######################################################################## - -#SET @@ndb_log_updated_only = 0; -#SET @@ndb_log_updated_only = DEFAULT; -#SELECT @@ndb_log_updated_only; -# -#SET @@ndb_log_updated_only = 1; -#SET @@ndb_log_updated_only = DEFAULT; -#SELECT @@ndb_log_updated_only; - - ---echo '#---------------------FN_DYNVARS_103_02-------------------------#' -############################################################################# -# Check if ndb_log_updated_only can be accessed with and without @@ sign # -############################################################################# - -#SET ndb_log_updated_only = 1; -#SELECT @@ndb_log_updated_only; -#--Error ER_UNKNOWN_TABLE -#SELECT global.ndb_log_updated_only; -# -#SET global ndb_log_updated_only = 1; -#SELECT @@global.ndb_log_updated_only; - - ---echo '#--------------------FN_DYNVARS_103_03------------------------#' -######################################################################## -# Change the value of ndb_log_updated_only to a valid value # -######################################################################## - -#SET @@global.ndb_log_updated_only = 0; -#SELECT @@global.ndb_log_updated_only; -#SET @@global.ndb_log_updated_only = 1; -#SELECT @@global.ndb_log_updated_only; -## a value of 2 is used to just flush logs and then shutdown cold. -#SET @@global.ndb_log_updated_only = 2; -#SELECT @@global.ndb_log_updated_only; - ---echo '#--------------------FN_DYNVARS_103_04-------------------------#' -########################################################################### -# Change the value of ndb_log_updated_only to invalid value # -########################################################################### - -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = -1; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = TRU; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = TRUE_F; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = FALS; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = OON; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = ONN; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = OOFF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = 0FF; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = ' 1'; -#--Error ER_WRONG_VALUE_FOR_VAR -#SET @@global.ndb_log_updated_only = "0 "; - - - ---echo '#-------------------FN_DYNVARS_103_05----------------------------#' -########################################################################### -# Test if accessing session ndb_log_updated_only gives error # -########################################################################### - -#--Error ER_LOCAL_VARIABLE -#SET @@session.ndb_log_updated_only = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@ndb_log_updated_only = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SET @@local.ndb_log_updated_only = 0; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@session.ndb_log_updated_only; -#--Error ER_INCORRECT_GLOBAL_LOCAL_VAR -#SELECT @@local.ndb_log_updated_only; - ---echo '#----------------------FN_DYNVARS_103_06------------------------#' -######################################################################### -# Check if the value in SESSION Table contains variable value # -######################################################################### - -#SELECT count(VARIABLE_VALUE) AS res_is_0 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='ndb_log_updated_only'; - - ---echo '#----------------------FN_DYNVARS_103_07------------------------#' -######################################################################### -# Check if the value in GLOBAL Table matches value in variable # -######################################################################### - -#SELECT @@global.ndb_log_updated_only = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='ndb_log_updated_only'; - - ---echo '#---------------------FN_DYNVARS_103_08-------------------------#' -################################################################### -# Check if ON and OFF values can be used on variable # -################################################################### - -#SET @@ndb_log_updated_only = OFF; -#SELECT @@ndb_log_updated_only; -#SET @@ndb_log_updated_only = ON; -#SELECT @@ndb_log_updated_only; - ---echo '#---------------------FN_DYNVARS_103_09----------------------#' -################################################################### -# Check if TRUE and FALSE values can be used on variable # -################################################################### - -#SET @@ndb_log_updated_only = TRUE; -#SELECT @@ndb_log_updated_only; -#SET @@ndb_log_updated_only = 'FALSE'; -#SELECT @@ndb_log_updated_only; - -############################## -# Restore initial value # -############################## - -#SET @@ndb_log_updated_only = @global_start_value; -#SELECT @@ndb_log_updated_only; - -######################################################################## -# END OF ndb_log_updated_only TESTS # -######################################################################## diff --git a/mysql-test/suite/sys_vars/t/pseudo_slave_mode_basic.test b/mysql-test/suite/sys_vars/t/pseudo_slave_mode_basic.test new file mode 100644 index 00000000000..3ef39bb8667 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pseudo_slave_mode_basic.test @@ -0,0 +1,168 @@ +####################### mysql-test\t\pseudo_slave_mode_basic.test ################### +# # +# Variable Name: pseudo_slave_mode # +# Scope: SESSION # +# Access Type: Dynamic # +# Data Type: boolean # +# Default Value: # +# Valid Values: 0,1 # +# # +# # +# Creation Date: 2012-11-16 # +# # +# Description: Test Cases of Dynamic System Variable pseudo_slave_mode # +# that checks the behavior of this variable in the following ways# +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.5/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +######################################################################## +# START OF pseudo_slave_mode TESTS # +######################################################################## + + +############################################################################## +# Saving initial value of pseudo_slave_mode in a temporary variable # +############################################################################## + +SET @session_start_value = @@session.pseudo_slave_mode; +SELECT @session_start_value; + +--echo '#--------------------FN_DYNVARS_156_01------------------------#' +######################################################################## +# Display the DEFAULT value of pseudo_slave_mode # +######################################################################## + +SET @@session.pseudo_slave_mode = 0; +SET @@session.pseudo_slave_mode = DEFAULT; +SELECT @@session.pseudo_slave_mode; + +SET @@session.pseudo_slave_mode = 1; +SET @@session.pseudo_slave_mode = DEFAULT; +SELECT @@session.pseudo_slave_mode; + + +--echo '#---------------------FN_DYNVARS_156_02-------------------------#' +############################################################################# +# Check if pseudo_slave_mode can be accessed with and without @@ sign # +############################################################################# + +SET pseudo_slave_mode = 1; +SELECT @@pseudo_slave_mode; + +--Error ER_UNKNOWN_TABLE +SELECT session.pseudo_slave_mode; + +--Error ER_UNKNOWN_TABLE +SELECT local.pseudo_slave_mode; + +SET session pseudo_slave_mode = 0; +SELECT @@session.pseudo_slave_mode; + + +--echo '#--------------------FN_DYNVARS_156_03------------------------#' +######################################################################## +# change the value of pseudo_slave_mode to a valid value # +######################################################################## + +SET @@session.pseudo_slave_mode = 0; +SELECT @@session.pseudo_slave_mode; +SET @@session.pseudo_slave_mode = 1; +SELECT @@session.pseudo_slave_mode; + + +--echo '#--------------------FN_DYNVARS_156_04-------------------------#' +########################################################################### +# Change the value of pseudo_slave_mode to invalid value # +########################################################################### + +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = -1; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = 2; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = "T"; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = "Y"; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = TRÜE; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = ÕN; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = OF; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = ÓFF; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = '¹'; +--Error ER_WRONG_VALUE_FOR_VAR +SET @@session.pseudo_slave_mode = NO; + + +--echo '#-------------------FN_DYNVARS_156_05----------------------------#' +########################################################################### +# Test if accessing global pseudo_slave_mode gives error # +########################################################################### + +--error ER_LOCAL_VARIABLE +SET @@global.pseudo_slave_mode = 0; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@global.pseudo_slave_mode; + +--echo '#----------------------FN_DYNVARS_156_06------------------------#' +######################################################################### +# Check if the value in SESSION Table contains variable value # +######################################################################### + +SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='pseudo_slave_mode'; + +--echo '#----------------------FN_DYNVARS_156_07------------------------#' +######################################################################### +# Check if the value in SESSION Table matches value in variable # +######################################################################### + +SELECT IF(@@session.pseudo_slave_mode, "ON", "OFF") = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='pseudo_slave_mode'; +SELECT @@session.pseudo_slave_mode; +SELECT VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='pseudo_slave_mode'; + +--echo '#---------------------FN_DYNVARS_156_08-------------------------#' +################################################################### +# Check if ON and OFF values can be used on variable # +################################################################### + +SET @@session.pseudo_slave_mode = OFF; +SELECT @@session.pseudo_slave_mode; +SET @@session.pseudo_slave_mode = ON; +SELECT @@session.pseudo_slave_mode; + +--echo '#---------------------FN_DYNVARS_156_09----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@session.pseudo_slave_mode = TRUE; +SELECT @@session.pseudo_slave_mode; +SET @@session.pseudo_slave_mode = FALSE; +SELECT @@session.pseudo_slave_mode; + +############################## +# Restore initial value # +############################## + +SET @@session.pseudo_slave_mode = @session_start_value; +SELECT @@session.pseudo_slave_mode; + +############################################################### +# END OF pseudo_slave_mode TESTS # +############################################################### diff --git a/mysql-test/t/bug13633383.test b/mysql-test/t/bug13633383.test index 72eb2f81c98..e31d4a8c9f6 100644 --- a/mysql-test/t/bug13633383.test +++ b/mysql-test/t/bug13633383.test @@ -5,19 +5,19 @@ CREATE TABLE t1 ( `a` int(11) DEFAULT NULL, `col432` bit(8) DEFAULT NULL, - `col433` multipoint DEFAULT NULL, - `col434` polygon DEFAULT NULL, + `col433` geometry DEFAULT NULL, + `col434` geometry DEFAULT NULL, `col435` decimal(50,17) unsigned DEFAULT NULL, `col436` geometry NOT NULL, `col437` tinyblob NOT NULL, - `col438` multipolygon DEFAULT NULL, + `col438` geometry DEFAULT NULL, `col439` mediumblob NOT NULL, `col440` tinyblob NOT NULL, `col441` double unsigned DEFAULT NULL ); CREATE TABLE t2 ( - `a` multipoint DEFAULT NULL, + `a` geometry DEFAULT NULL, `col460` date DEFAULT NULL, `col461` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col462` date NOT NULL, @@ -34,7 +34,7 @@ CREATE TABLE t3 ( `col579` bit(38) NOT NULL, `col580` varchar(93) NOT NULL, `col581` datetime DEFAULT NULL, - `col583` multipolygon DEFAULT NULL, + `col583` geometry DEFAULT NULL, `col584` bit(47) NOT NULL ); diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 4cf5cccc254..381c87c635c 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -343,3 +343,18 @@ SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2); DROP TABLE t1, t2; DROP VIEW v1, v2; set optimizer_switch=@save_derived_optimizer_switch; + +# +# MDEV-614 lp:1050806 - different result for a query using subquery between 5.5.25 and 5.5.27 +# MySQL Bug#66845 Wrong result (extra row) on a FROM subquery with a variable and ORDER BY +# +create table t1 (n bigint(20) unsigned, d1 datetime, d2 datetime, key (d1)); +insert t1 values (2085,'2012-01-01 00:00:00','2013-01-01 00:00:00'); +insert t1 values (2084,'2012-02-01 00:00:00','2013-01-01 00:00:00'); +insert t1 values (2088,'2012-03-01 00:00:00','2013-01-01 00:00:00'); +select * from ( + select n, d1, d2, @result := 0 as result + from t1 + where d1 < '2012-12-12 12:12:12' and n in (2085, 2084) order by d2 asc +) as calculated_result; +drop table t1; diff --git a/mysql-test/t/group_min_max_innodb.test b/mysql-test/t/group_min_max_innodb.test index 7038eb2ff47..fd50e12090e 100644 --- a/mysql-test/t/group_min_max_innodb.test +++ b/mysql-test/t/group_min_max_innodb.test @@ -5,6 +5,10 @@ # --source include/have_innodb.inc +if (`select plugin_auth_version <= "1.1.8-29.3" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB 1.1.8-29.3 or earlier +} --disable_warnings drop view if exists v1; diff --git a/mysql-test/t/join_cache.test b/mysql-test/t/join_cache.test index 9b04c264faf..2d06c3e2a30 100644 --- a/mysql-test/t/join_cache.test +++ b/mysql-test/t/join_cache.test @@ -3594,7 +3594,7 @@ DROP TABLE t1,t2,t3; CREATE TABLE t1 ( col269 decimal(31,10) unsigned DEFAULT NULL, - col280 multipoint DEFAULT NULL, + col280 geometry DEFAULT NULL, col281 tinyint(1) DEFAULT NULL, col282 time NOT NULL, col284 datetime DEFAULT NULL, diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 4199d98073c..8323890b028 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1536,10 +1536,10 @@ drop table t1; # CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t1 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t1; CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)")); +INSERT INTO t2 VALUES (GeomFromText("LINESTRING(0 0)")); checksum table t2; CREATE TABLE t3 select * from t1; checksum table t3; @@ -1582,22 +1582,6 @@ SELECT h+0, d + 0, e, g + 0 FROM t1; DROP TABLE t1; ---echo # ---echo # Test of BUG#35570 CHECKSUM TABLE unreliable if LINESTRING field ---echo # (same content / differen checksum) ---echo # - -CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)")); -checksum table t1; -CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam; -INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)")); -checksum table t2; -CREATE TABLE t3 select * from t1; -checksum table t3; -drop table t1,t2,t3; - - # # BUG#47073 - valgrind errs, corruption,failed repair of partition, # low myisam_sort_buffer_size diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 76d980dee30..cad5b67c363 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -593,6 +593,15 @@ create database `aa``bb````cc`; --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/backticks.sql drop database `aa``bb````cc`; +# +# MySQL Bug#13639125 DELIMITER STRIPS THE NEXT NEW LINE IN A SQL STATEMENT +# +--write_file $MYSQLTEST_VARDIR/tmp/13639125.sql +select ">> +delimiter +<<" as a; +EOF +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/13639125.sql --echo --echo End of tests diff --git a/mysys/errors.c b/mysys/errors.c index bf7299ce4c6..4f8f6f26c2a 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -107,12 +107,12 @@ void init_glob_errs() void wait_for_free_space(const char *filename, int errors) { if (errors == 0) - my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH), + my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH | ME_JUST_WARNING), filename,my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC); if (!(errors % MY_WAIT_GIVE_USER_A_MESSAGE)) my_printf_error(EE_DISK_FULL, "Retry in %d secs. Message reprinted in %d secs", - MYF(ME_BELL | ME_NOREFRESH), + MYF(ME_BELL | ME_NOREFRESH | ME_JUST_WARNING), MY_WAIT_FOR_USER_TO_FIX_PANIC, MY_WAIT_GIVE_USER_A_MESSAGE * MY_WAIT_FOR_USER_TO_FIX_PANIC ); (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC); diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index a51d94f8e73..5bbafeb9945 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. Copyright (c) 2012, Monty Program Ab This program is free software; you can redistribute it and/or modify @@ -12,7 +12,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ #include "mysys_priv.h" #include <m_string.h> @@ -452,10 +453,10 @@ char *intern_filename(char *to, const char *from) char buff[FN_REFLEN + 1]; if (from == to) { /* Dirname may destroy from */ - strmov(buff,from); + (void) strnmov(buff, from, FN_REFLEN); from=buff; } length= dirname_part(to, from, &to_length); /* Copy dirname & fix chars */ - (void) strmov(to + to_length,from+length); + (void) strnmov(to + to_length, from + length, FN_REFLEN - to_length); return (to); } /* intern_filename */ diff --git a/mysys/my_lib.c b/mysys/my_lib.c index b42a3d55d93..71969f23d85 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,7 +11,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ /* TODO: check for overun of memory for names. */ @@ -96,7 +97,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) MEM_ROOT *names_storage; DIR *dirp; struct dirent *dp; - char tmp_path[FN_REFLEN+1],*tmp_file; + char tmp_path[FN_REFLEN + 2], *tmp_file; char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1]; DBUG_ENTER("my_dir"); @@ -197,10 +198,11 @@ char * directory_file_name (char * dst, const char *src) { /* Process as Unix format: just remove test the final slash. */ char *end; + DBUG_ASSERT(strlen(src) < (FN_REFLEN + 1)); if (src[0] == 0) src= (char*) "."; /* Use empty as current */ - end=strmov(dst, src); + end= strnmov(dst, src, FN_REFLEN + 1); if (end[-1] != FN_LIBCHAR) { end[0]=FN_LIBCHAR; /* Add last '/' */ diff --git a/mysys/thr_rwlock.c b/mysys/thr_rwlock.c index 17fafecd8fd..dd6c625a286 100644 --- a/mysys/thr_rwlock.c +++ b/mysys/thr_rwlock.c @@ -24,7 +24,7 @@ static BOOL have_srwlock= FALSE; /* Prototypes and function pointers for windows functions */ typedef VOID (WINAPI* srw_func) (PSRWLOCK SRWLock); -typedef BOOL (WINAPI* srw_bool_func) (PSRWLOCK SRWLock); +typedef BOOLEAN (WINAPI* srw_bool_func) (PSRWLOCK SRWLock); static srw_func my_InitializeSRWLock; static srw_func my_AcquireSRWLockExclusive; diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs index 568053f4cf5..6e243832e12 100644 --- a/packaging/WiX/custom_ui.wxs +++ b/packaging/WiX/custom_ui.wxs @@ -2,7 +2,7 @@ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<!--
- Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" Disabled="yes" />
<Control Id="Description" Type="Text" X="135" Y="80" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)" />
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgTitle)" />
- <Control Id="CopyrightText" Type="Text" X="135" Y="200" Width="220" Height="40" Transparent="yes" Text="Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved." />
+ <Control Id="CopyrightText" Type="Text" X="135" Y="200" Width="220" Height="40" Transparent="yes" Text="Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved." />
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
</Dialog>
diff --git a/packaging/rpm-uln/mysql.spec.sh b/packaging/rpm-uln/mysql.spec.sh index 8b25b160be1..3e2c5c3f11c 100644 --- a/packaging/rpm-uln/mysql.spec.sh +++ b/packaging/rpm-uln/mysql.spec.sh @@ -508,21 +508,28 @@ mkdir release # TODO / FIXME: Do we need "scriptstub"? gcc $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/mysql\"" %{SOURCE4} -# TODO / FIXME: "libmysqld.so" should have been produced above - WORK in PROGRESS +# TODO / FIXME: "libmysqld.so" should have been produced above # regular build will make libmysqld.a but not libmysqld.so :-( cd release mkdir libmysqld/work cd libmysqld/work -ar -x ../libmysqld.a -rm rpl_utility.cc.o sql_binlog.cc.o # Try-and-Error: These modules cause unresolved references -gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.0 -o libmysqld.so.0.0.1 \ - *.o \ +# "libmysqld" provides the same ABI as "libmysqlclient", but it implements the server: +# The shared object is identified by the full version, +# for linkage selection the first two levels are sufficient so that upgrades are possible +# (see "man ld", option "-soname"). +SO_FULL='%{mysql_version}' +SO_USE=`echo $SO_FULL | sed -e 's/\([0-9]\.[0-9]\)\.[0-9]*/\1/'` +# These two modules should pull everything else which is needed: +ar -x ../libmysqld.a client.c.o signal_handler.cc.o +gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.$SO_USE -o libmysqld.so.$SO_FULL \ + *.o ../libmysqld.a \ -lpthread -lcrypt -laio -lnsl -lssl -lcrypto -lz -lrt -lstdc++ -lm -lc # this is to check that we built a complete library cp %{SOURCE9} . -ln -s libmysqld.so.0.0.1 libmysqld.so.0 -gcc -I../../include -I../../../%{src_dir}/include $CFLAGS mysql-embedded-check.c libmysqld.so.0 -LD_LIBRARY_PATH=. ldd ./a.out +PROGNAME=`basename %{SOURCE9} .c` +ln -s libmysqld.so.$SO_FULL libmysqld.so.$SO_USE +gcc -I../../include -I../../../%{src_dir}/include $CFLAGS -o $PROGNAME %{SOURCE9} libmysqld.so.$SO_USE +LD_LIBRARY_PATH=. ldd $PROGNAME cd ../.. cd .. @@ -618,9 +625,11 @@ mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/my install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.a -install -m 0755 release/libmysqld/work/libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0.0.1 -ln -s libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0 -ln -s libmysqld.so.0 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so +SO_FULL='%{mysql_version}' +SO_USE=`echo $SO_FULL | sed -e 's/\([0-9]\.[0-9]\)\.[0-9]*/\1/'` +install -m 0755 release/libmysqld/work/libmysqld.so.$SO_FULL ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.$SO_FULL +ln -s libmysqld.so.$SO_FULL ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.$SO_USE +ln -s libmysqld.so.$SO_USE ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1* @@ -964,6 +973,12 @@ fi %{_mandir}/man1/mysql_client_test.1* %changelog +* Thu Dec 7 2012 Joerg Bruehe <joerg.bruehe@oracle.com> +- Change the way in which "libmysqld.so" is created: Using all object modules + was wrong, gcc / ld can resolve the dependencies from "libmysqld.a". + Also, identify the ".so" version from the MySQL version, "0.0.1" was wrong. + Bug#15972480 + * Tue Sep 18 2012 Joerg Bruehe <joerg.bruehe@oracle.com> - Restrict the vendor check to Oracle: There is no history here which we have to allow for. diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index f49f885bf5a..4f503def01d 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -585,7 +585,7 @@ then log_notice "Logging to '$err_log'." logging=file - if [ ! -e "$err_log" ]; then # if error log already exists, + if [ ! -f "$err_log" ]; then # if error log already exists, touch "$err_log" # we just append. otherwise, chmod "$fmode" "$err_log" # fix the permissions here! fi @@ -805,7 +805,7 @@ do eval_log_error "$cmd" - if [ $want_syslog -eq 0 -a ! -e "$err_log" ]; then + if [ $want_syslog -eq 0 -a ! -f "$err_log" ]; then touch "$err_log" # hypothetical: log was renamed but not chown $user "$err_log" # flushed yet. we'd recreate it with chmod "$fmode" "$err_log" # wrong owner next time we log, so set diff --git a/sql/field.cc b/sql/field.cc index 8ed3f787d79..7da46d6b383 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -204,7 +204,7 @@ static enum_field_types field_types_merge_rules [FIELDTYPE_NUM][FIELDTYPE_NUM]= //MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP MYSQL_TYPE_LONG, MYSQL_TYPE_VARCHAR, //MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24 - MYSQL_TYPE_LONGLONG, MYSQL_TYPE_INT24, + MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONG, //MYSQL_TYPE_DATE MYSQL_TYPE_TIME MYSQL_TYPE_VARCHAR, MYSQL_TYPE_VARCHAR, //MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR @@ -235,7 +235,7 @@ static enum_field_types field_types_merge_rules [FIELDTYPE_NUM][FIELDTYPE_NUM]= //MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP MYSQL_TYPE_FLOAT, MYSQL_TYPE_VARCHAR, //MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24 - MYSQL_TYPE_FLOAT, MYSQL_TYPE_INT24, + MYSQL_TYPE_FLOAT, MYSQL_TYPE_FLOAT, //MYSQL_TYPE_DATE MYSQL_TYPE_TIME MYSQL_TYPE_VARCHAR, MYSQL_TYPE_VARCHAR, //MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR @@ -266,7 +266,7 @@ static enum_field_types field_types_merge_rules [FIELDTYPE_NUM][FIELDTYPE_NUM]= //MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP MYSQL_TYPE_DOUBLE, MYSQL_TYPE_VARCHAR, //MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24 - MYSQL_TYPE_DOUBLE, MYSQL_TYPE_INT24, + MYSQL_TYPE_DOUBLE, MYSQL_TYPE_DOUBLE, //MYSQL_TYPE_DATE MYSQL_TYPE_TIME MYSQL_TYPE_VARCHAR, MYSQL_TYPE_VARCHAR, //MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR @@ -297,7 +297,7 @@ static enum_field_types field_types_merge_rules [FIELDTYPE_NUM][FIELDTYPE_NUM]= //MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP, //MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24 - MYSQL_TYPE_LONGLONG, MYSQL_TYPE_INT24, + MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONGLONG, //MYSQL_TYPE_DATE MYSQL_TYPE_TIME MYSQL_TYPE_NEWDATE, MYSQL_TYPE_TIME, //MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 4cf66daf315..b10de0362f2 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3826,6 +3826,7 @@ int ha_partition::truncate_partition(Alter_info *alter_info, bool *binlog_stmt) part, sub_elem->partition_name)); if ((error= m_file[part]->ha_truncate())) break; + sub_elem->part_state= PART_NORMAL; } while (++j < num_subparts); } else @@ -4423,6 +4424,7 @@ bool ha_partition::init_record_priority_queue() { if (bitmap_is_set(&m_part_info->used_partitions, i)) { + DBUG_PRINT("info", ("init rec-buf for part %u", i)); int2store(ptr, i); ptr+= m_rec_length + PARTITION_BYTES_IN_POS; } @@ -5317,11 +5319,27 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order) m_top_entry= NO_CURRENT_PART_ID; queue_remove_all(&m_queue); - DBUG_PRINT("info", ("m_part_spec.start_part %d", m_part_spec.start_part)); - for (i= m_part_spec.start_part; i <= m_part_spec.end_part; i++) + /* + Position part_rec_buf_ptr to point to the first used partition >= + start_part. There may be partitions marked by used_partitions, + but is before start_part. These partitions has allocated record buffers + but is dynamically pruned, so those buffers must be skipped. + */ + uint first_used_part= bitmap_get_first_set(&m_part_info->used_partitions); + for (; first_used_part < m_part_spec.start_part; first_used_part++) + { + if (bitmap_is_set(&(m_part_info->used_partitions), first_used_part)) + part_rec_buf_ptr+= m_rec_length + PARTITION_BYTES_IN_POS; + } + DBUG_PRINT("info", ("m_part_spec.start_part %u first_used_part %u", + m_part_spec.start_part, first_used_part)); + for (i= first_used_part; i <= m_part_spec.end_part; i++) { if (!(bitmap_is_set(&(m_part_info->used_partitions), i))) continue; + DBUG_PRINT("info", ("reading from part %u (scan_type: %u)", + i, m_index_scan_type)); + DBUG_ASSERT(i == uint2korr(part_rec_buf_ptr)); uchar *rec_buf_ptr= part_rec_buf_ptr + PARTITION_BYTES_IN_POS; int error; handler *file= m_file[i]; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 3e64e3969e4..fec6998d0ce 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -241,15 +241,15 @@ static uint collect_cmp_types(Item **items, uint nitems, bool skip_nulls= FALSE) items[i]->cmp_type() == ROW_RESULT) && cmp_row_type(items[0], items[i])) return 0; - found_types|= 1<< (uint)item_cmp_type(left_result, - items[i]->cmp_type()); + found_types|= 1U << (uint)item_cmp_type(left_result, + items[i]->cmp_type()); } /* Even if all right-hand items are NULLs and we are skipping them all, we need at least one type bit in the found_type bitmask. */ if (skip_nulls && !found_types) - found_types= 1 << (uint)left_result; + found_types= 1U << (uint)left_result; return found_types; } @@ -2824,12 +2824,12 @@ Item *Item_func_case::find_item(String *str) cmp_type= item_cmp_type(left_result_type, args[i]->cmp_type()); DBUG_ASSERT(cmp_type != ROW_RESULT); DBUG_ASSERT(cmp_items[(uint)cmp_type]); - if (!(value_added_map & (1<<(uint)cmp_type))) + if (!(value_added_map & (1U << (uint)cmp_type))) { cmp_items[(uint)cmp_type]->store_value(args[first_expr_num]); if ((null_value=args[first_expr_num]->null_value)) return else_expr_num != -1 ? args[else_expr_num] : 0; - value_added_map|= 1<<(uint)cmp_type; + value_added_map|= 1U << (uint)cmp_type; } if (!cmp_items[(uint)cmp_type]->cmp(args[i]) && !args[i]->null_value) return args[i + 1]; @@ -3036,10 +3036,10 @@ void Item_func_case::fix_length_and_dec() return; Item *date_arg= 0; - if (found_types & (1 << TIME_RESULT)) + if (found_types & (1U << TIME_RESULT)) date_arg= find_date_time_item(args, arg_count, 0); - if (found_types & (1 << STRING_RESULT)) + if (found_types & (1U << STRING_RESULT)) { /* If we'll do string comparison, we also need to aggregate @@ -3080,7 +3080,7 @@ void Item_func_case::fix_length_and_dec() for (i= 0; i <= (uint)TIME_RESULT; i++) { - if (found_types & (1 << i) && !cmp_items[i]) + if (found_types & (1U << i) && !cmp_items[i]) { DBUG_ASSERT((Item_result)i != ROW_RESULT); @@ -3936,7 +3936,7 @@ void Item_func_in::fix_length_and_dec() } for (i= 0; i <= (uint)TIME_RESULT; i++) { - if (found_types & 1 << i) + if (found_types & (1U << i)) { (type_cnt)++; cmp_type= (Item_result) i; @@ -4063,14 +4063,14 @@ void Item_func_in::fix_length_and_dec() } else { - if (found_types & (1 << TIME_RESULT)) + if (found_types & (1U << TIME_RESULT)) date_arg= find_date_time_item(args, arg_count, 0); - if (found_types & (1 << STRING_RESULT) && + if (found_types & (1U << STRING_RESULT) && agg_arg_charsets_for_comparison(cmp_collation, args, arg_count)) return; for (i= 0; i <= (uint) TIME_RESULT; i++) { - if (found_types & (1 << i) && !cmp_items[i]) + if (found_types & (1U << i) && !cmp_items[i]) { if (!cmp_items[i] && !(cmp_items[i]= cmp_item::get_comparator((Item_result)i, date_arg, @@ -4156,12 +4156,12 @@ longlong Item_func_in::val_int() Item_result cmp_type= item_cmp_type(left_result_type, args[i]->cmp_type()); in_item= cmp_items[(uint)cmp_type]; DBUG_ASSERT(in_item); - if (!(value_added_map & (1 << (uint)cmp_type))) + if (!(value_added_map & (1U << (uint)cmp_type))) { in_item->store_value(args[0]); if ((null_value= args[0]->null_value)) return 0; - value_added_map|= 1 << (uint)cmp_type; + value_added_map|= 1U << (uint)cmp_type; } if (!in_item->cmp(args[i]) && !args[i]->null_value) return (longlong) (!negated); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index dbc4f9818d5..152b50da616 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1852,7 +1852,8 @@ bool Item_allany_subselect::transform_into_max_min(JOIN *join) print_where(item, "rewrite with MIN/MAX", QT_ORDINARY);); save_allow_sum_func= thd->lex->allow_sum_func; - thd->lex->allow_sum_func|= 1 << thd->lex->current_select->nest_level; + thd->lex->allow_sum_func|= + (nesting_map)1 << thd->lex->current_select->nest_level; /* Item_sum_(max|min) can't substitute other item => we can use 0 as reference, also Item_sum_(max|min) can't be fixed after creation, so diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 04358ac8c45..72e0e637d38 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -152,9 +152,10 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) If it is there under a construct where it is not allowed we report an error. */ - invalid= !(allow_sum_func & (1 << max_arg_level)); + invalid= !(allow_sum_func & ((nesting_map)1 << max_arg_level)); } - else if (max_arg_level >= 0 || !(allow_sum_func & (1 << nest_level))) + else if (max_arg_level >= 0 || + !(allow_sum_func & ((nesting_map)1 << nest_level))) { /* The set function can be aggregated only in outer subqueries. @@ -163,7 +164,8 @@ bool Item_sum::check_sum_func(THD *thd, Item **ref) */ if (register_sum_func(thd, ref)) return TRUE; - invalid= aggr_level < 0 && !(allow_sum_func & (1 << nest_level)); + invalid= aggr_level < 0 && + !(allow_sum_func & ((nesting_map)1 << nest_level)); if (!invalid && thd->variables.sql_mode & MODE_ANSI) invalid= aggr_level < 0 && max_arg_level < nest_level; } @@ -311,14 +313,15 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) sl && sl->nest_level > max_arg_level; sl= sl->master_unit()->outer_select() ) { - if (aggr_level < 0 && (allow_sum_func & (1 << sl->nest_level))) + if (aggr_level < 0 && + (allow_sum_func & ((nesting_map)1 << sl->nest_level))) { /* Found the most nested subquery where the function can be aggregated */ aggr_level= sl->nest_level; aggr_sel= sl; } } - if (sl && (allow_sum_func & (1 << sl->nest_level))) + if (sl && (allow_sum_func & ((nesting_map)1 << sl->nest_level))) { /* We reached the subquery of level max_arg_level and checked @@ -559,7 +562,7 @@ void Item_sum::update_used_tables () used_tables_cache&= PSEUDO_TABLE_BITS; // the aggregate function is aggregated into its local context - used_tables_cache |= (1 << aggr_sel->join->table_count) - 1; + used_tables_cache|= ((table_map)1 << aggr_sel->join->tables) - 1; } because if we do it, table elimination will assume that - constructs like "COUNT(*)" use columns from all tables diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 5a824e48b7b..723429f107a 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -2704,8 +2704,12 @@ int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len) node.parent= data->parent; // Set parent for the new node to old parent data->parent= numnodes; // Remember current node as new parent + DBUG_ASSERT(data->level <= MAX_LEVEL); data->pos[data->level]= numnodes; - node.level= data->level++; + if (data->level < MAX_LEVEL) + node.level= data->level++; + else + return MY_XML_ERROR; node.type= st->current_node_type; // TAG or ATTR node.beg= attr; node.end= attr + len; diff --git a/sql/log_event.cc b/sql/log_event.cc index d5cfa9367c5..44ff00f9b25 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -4713,10 +4713,21 @@ do_server_version_split(char* version, for (uint i= 0; i<=2; i++) { number= strtoul(p, &r, 10); - split_versions->ver[i]= (uchar) number; - DBUG_ASSERT(number < 256); // fit in uchar + /* + It is an invalid version if any version number greater than 255 or + first number is not followed by '.'. + */ + if (number < 256 && (*r == '.' || i != 0)) + split_versions->ver[i]= (uchar) number; + else + { + split_versions->ver[0]= 0; + split_versions->ver[1]= 0; + split_versions->ver[2]= 0; + break; + } + p= r; - DBUG_ASSERT(!((i == 0) && (*r != '.'))); // should be true in practice if (*r == '.') p++; // skip the dot } @@ -4734,7 +4745,6 @@ do_server_version_split(char* version, into 'server_version_split': X.Y.Zabc (X,Y,Z numbers, a not a digit) -> {X,Y,Z} X.Yabc -> {X,Y,0} - Xabc -> {X,0,0} 'server_version_split' is then used for lookups to find if the server which created this event has some known bug. */ diff --git a/sql/log_event.h b/sql/log_event.h index 2c2e1dcd8b9..99c9a0fb1d7 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -1081,7 +1081,7 @@ public: return thd ? thd->db : 0; } #else - Log_event() : temp_buf(0) {} + Log_event() : temp_buf(0), flags(0) {} /* avoid having to link mysqlbinlog against libpthread */ static Log_event* read_log_event(IO_CACHE* file, const Format_description_log_event @@ -2417,12 +2417,26 @@ public: #ifdef MYSQL_SERVER bool write(IO_CACHE* file); #endif - bool is_valid() const + bool header_is_valid() const { return ((common_header_len >= ((binlog_version==1) ? OLD_HEADER_LEN : LOG_EVENT_MINIMAL_HEADER_LEN)) && (post_header_len != NULL)); } + + bool version_is_valid() const + { + /* It is invalid only when all version numbers are 0 */ + return !(server_version_split.ver[0] == 0 && + server_version_split.ver[1] == 0 && + server_version_split.ver[2] == 0); + } + + bool is_valid() const + { + return header_is_valid() && version_is_valid(); + } + int get_data_size() { /* diff --git a/sql/mdl.h b/sql/mdl.h index af7d75c1297..68f24a7a0e8 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -242,8 +242,14 @@ public: const char *db, const char *name) { m_ptr[0]= (char) mdl_namespace; - m_db_name_length= (uint16) (strmov(m_ptr + 1, db) - m_ptr - 1); - m_length= (uint16) (strmov(m_ptr + m_db_name_length + 2, name) - m_ptr + 1); + /* + It is responsibility of caller to ensure that db and object names + are not longer than NAME_LEN. Still we play safe and try to avoid + buffer overruns. + */ + m_db_name_length= (uint16) (strmake(m_ptr + 1, db, NAME_LEN) - m_ptr - 1); + m_length= (uint16) (strmake(m_ptr + m_db_name_length + 2, name, NAME_LEN) - + m_ptr + 1); } void mdl_key_init(const MDL_key *rhs) { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 14737cd69bb..872ab8a54ca 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1296,6 +1296,7 @@ static void clean_up(bool print_message); static int test_if_case_insensitive(const char *dir_name); #ifndef EMBEDDED_LIBRARY +static bool pid_file_created= false; static void usage(void); static void start_signal_handler(void); static void close_server_sock(); @@ -1304,6 +1305,7 @@ static void wait_for_signal_thread_to_end(void); static void create_pid_file(); static void mysqld_exit(int exit_code) __attribute__((noreturn)); #endif +static void delete_pid_file(myf flags); static void end_ssl(); @@ -1808,7 +1810,6 @@ void clean_up(bool print_message) item_user_lock_free(); lex_free(); /* Free some memory */ item_create_cleanup(); - free_charsets(); if (!opt_noacl) { #ifdef HAVE_DLOPEN @@ -1855,10 +1856,8 @@ void clean_up(bool print_message) debug_sync_end(); #endif /* defined(ENABLED_DEBUG_SYNC) */ -#if !defined(EMBEDDED_LIBRARY) - if (!opt_bootstrap) - mysql_file_delete(key_file_pid, pidfile_name, MYF(0)); // This may not always exist -#endif + delete_pid_file(MYF(0)); + if (print_message && my_default_lc_messages && server_start_time) sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname); cleanup_errmsgs(); @@ -1872,6 +1871,7 @@ void clean_up(bool print_message) sys_var_end(); my_atomic_rwlock_destroy(&global_query_id_lock); my_atomic_rwlock_destroy(&thread_running_lock); + free_charsets(); mysql_mutex_lock(&LOCK_thread_count); DBUG_PRINT("quit", ("got thread count lock")); ready_to_exit=1; @@ -4885,9 +4885,7 @@ int mysqld_main(int argc, char **argv) (void) pthread_kill(signal_thread, MYSQL_KILL_SIGNAL); - - if (!opt_bootstrap) - mysql_file_delete(key_file_pid, pidfile_name, MYF(MY_WME)); // Not needed anymore + delete_pid_file(MYF(MY_WME)); if (unix_sock != INVALID_SOCKET) unlink(mysqld_unix_port); @@ -8296,13 +8294,14 @@ static void create_pid_file() if ((file= mysql_file_create(key_file_pid, pidfile_name, 0664, O_WRONLY | O_TRUNC, MYF(MY_WME))) >= 0) { - char buff[21], *end; + char buff[MAX_BIGINT_WIDTH + 1], *end; end= int10_to_str((long) getpid(), buff, 10); *end++= '\n'; if (!mysql_file_write(file, (uchar*) buff, (uint) (end-buff), MYF(MY_WME | MY_NABP))) { mysql_file_close(file, MYF(0)); + pid_file_created= true; return; } mysql_file_close(file, MYF(0)); @@ -8312,6 +8311,26 @@ static void create_pid_file() } #endif /* EMBEDDED_LIBRARY */ + +/** + Remove the process' pid file. + + @param flags file operation flags +*/ + +static void delete_pid_file(myf flags) +{ +#ifndef EMBEDDED_LIBRARY + if (pid_file_created) + { + mysql_file_delete(key_file_pid, pidfile_name, flags); + pid_file_created= false; + } +#endif /* EMBEDDED_LIBRARY */ + return; +} + + /** Clear most status variables. */ void refresh_status(THD *thd) { diff --git a/sql/opt_range.cc b/sql/opt_range.cc index cb25ca7760e..e8753b7870c 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -12078,7 +12078,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) cur_parts have bits set for only used keyparts. */ ulonglong all_parts, cur_parts; - all_parts= (1<<max_key_part) - 1; + all_parts= (1ULL << max_key_part) - 1; cur_parts= used_key_parts_map.to_ulonglong() >> 1; if (all_parts != cur_parts) goto next_index; diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 069fac1c3ec..c83e52fe26b 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -878,8 +878,13 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * DBUG_ENTER("table_def::create_conversion_table"); List<Create_field> field_list; - - for (uint col= 0 ; col < size() ; ++col) + /* + At slave, columns may differ. So we should create + min(columns@master, columns@slave) columns in the + conversion table. + */ + uint const cols_to_create= min(target_table->s->fields, size()); + for (uint col= 0 ; col < cols_to_create; ++col) { Create_field *field_def= (Create_field*) alloc_root(thd->mem_root, sizeof(Create_field)); diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index c65e56edbe0..631c4271eb5 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -739,6 +739,11 @@ send_result_message: case HA_ADMIN_TRY_ALTER: { + uint save_flags; + Alter_info *alter_info= &lex->alter_info; + + /* Store the original value of alter_info->flags */ + save_flags= alter_info->flags; /* This is currently used only by InnoDB. ha_innobase::optimize() answers "try with alter", so here we close the table, do an ALTER TABLE, @@ -746,10 +751,19 @@ send_result_message: We have to end the row, so analyze could return more rows. */ protocol->store(STRING_WITH_LEN("note"), system_charset_info); - protocol->store(STRING_WITH_LEN( - "Table does not support optimize, doing recreate + analyze instead"), - system_charset_info); - if (protocol->write()) + if(alter_info->flags & ALTER_ADMIN_PARTITION) + { + protocol->store(STRING_WITH_LEN( + "Table does not support optimize on partitions. All partitions " + "will be rebuilt and analyzed."),system_charset_info); + } + else + { + protocol->store(STRING_WITH_LEN( + "Table does not support optimize, doing recreate + analyze instead"), + system_charset_info); + } + if (protocol->write()) goto err; DBUG_PRINT("info", ("HA_ADMIN_TRY_ALTER, trying analyze...")); TABLE_LIST *save_next_local= table->next_local, @@ -768,6 +782,11 @@ send_result_message: table->mdl_request.ticket= NULL; DEBUG_SYNC(thd, "ha_admin_open_ltable"); table->mdl_request.set_type(MDL_SHARED_WRITE); + /* + Reset the ALTER_ADMIN_PARTITION bit in alter_info->flags + to force analyze on all partitions. + */ + alter_info->flags &= ~(ALTER_ADMIN_PARTITION); if ((table->table= open_ltable(thd, table, lock_type, 0))) { result_code= table->table->file->ha_analyze(thd, check_opt); @@ -778,6 +797,7 @@ send_result_message: } else result_code= -1; // open failed + alter_info->flags= save_flags; } /* Start a new row for the final status row */ protocol->prepare_for_resend(); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index c76f2d43279..277e07b9c49 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -326,12 +326,9 @@ uint create_table_def_key(THD *thd, char *key, const TABLE_LIST *table_list, bool tmp_table) { - char *db_end= strnmov(key, table_list->db, MAX_DBKEY_LENGTH - 2); - *db_end++= '\0'; - char *table_end= strnmov(db_end, table_list->table_name, - key + MAX_DBKEY_LENGTH - 1 - db_end); - *table_end++= '\0'; - uint key_length= (uint) (table_end-key); + uint key_length= create_table_def_key(key, table_list->db, + table_list->table_name); + if (tmp_table) { int4store(key + key_length, thd->server_id); @@ -832,13 +829,10 @@ void release_table_share(TABLE_SHARE *share) TABLE_SHARE *get_cached_table_share(const char *db, const char *table_name) { char key[SAFE_NAME_LEN*2+2]; - TABLE_LIST table_list; uint key_length; mysql_mutex_assert_owner(&LOCK_open); - table_list.db= (char*) db; - table_list.table_name= (char*) table_name; - key_length= create_table_def_key((THD*) 0, key, &table_list, 0); + key_length= create_table_def_key(key, db, table_name); return (TABLE_SHARE*) my_hash_search(&table_def_cache, (uchar*) key, key_length); } @@ -3237,7 +3231,7 @@ err_unlock: TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name) { char key[MAX_DBKEY_LENGTH]; - uint key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1; + uint key_length= create_table_def_key(key, db, table_name); for (TABLE *table= list; table ; table=table->next) { @@ -6122,17 +6116,27 @@ TABLE *open_table_uncached(THD *thd, const char *path, const char *db, } -bool rm_temporary_table(handlerton *base, char *path) +/** + Delete a temporary table. + + @param base Handlerton for table to be deleted. + @param path Path to the table to be deleted (i.e. path + to its .frm without an extension). + + @retval false - success. + @retval true - failure. +*/ + +bool rm_temporary_table(handlerton *base, const char *path) { bool error=0; handler *file; - char *ext; + char frm_path[FN_REFLEN + 1]; DBUG_ENTER("rm_temporary_table"); - strmov(ext= strend(path), reg_ext); - if (mysql_file_delete(key_file_frm, path, MYF(0))) + strxnmov(frm_path, sizeof(frm_path) - 1, path, reg_ext, NullS); + if (mysql_file_delete(key_file_frm, frm_path, MYF(0))) error=1; /* purecov: inspected */ - *ext= 0; // remove extension file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base); if (file && file->ha_delete_table(path)) { @@ -8078,7 +8082,8 @@ bool setup_fields(THD *thd, Item **ref_pointer_array, thd->mark_used_columns= mark_used_columns; DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns)); if (allow_sum_func) - thd->lex->allow_sum_func|= 1 << thd->lex->current_select->nest_level; + thd->lex->allow_sum_func|= + (nesting_map)1 << thd->lex->current_select->nest_level; thd->where= THD::DEFAULT_WHERE; save_is_item_list_lookup= thd->lex->current_select->is_item_list_lookup; thd->lex->current_select->is_item_list_lookup= 0; @@ -9383,7 +9388,7 @@ void tdc_remove_table(THD *thd, enum_tdc_remove_table_type remove_type, thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)); - key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1; + key_length= create_table_def_key(key, db, table_name); if ((share= (TABLE_SHARE*) my_hash_search(&table_def_cache,(uchar*) key, key_length))) @@ -9497,12 +9502,14 @@ open_new_frm(THD *thd, TABLE_SHARE *share, const char *alias, { LEX_STRING pathstr; File_parser *parser; - char path[FN_REFLEN]; + char path[FN_REFLEN+1]; DBUG_ENTER("open_new_frm"); /* Create path with extension */ - pathstr.length= (uint) (strxmov(path, share->normalized_path.str, reg_ext, - NullS)- path); + pathstr.length= (uint) (strxnmov(path, sizeof(path) - 1, + share->normalized_path.str, + reg_ext, + NullS) - path); pathstr.str= path; if ((parser= sql_parse_prepare(&pathstr, mem_root, 1))) diff --git a/sql/sql_base.h b/sql/sql_base.h index 45d41777fea..21a2ff322f0 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -81,6 +81,31 @@ uint cached_table_definitions(void); uint create_table_def_key(THD *thd, char *key, const TABLE_LIST *table_list, bool tmp_table); + +/** + Create a table cache key for non-temporary table. + + @param key Buffer for key (must be at least NAME_LEN*2+2 bytes). + @param db Database name. + @param table_name Table name. + + @return Length of key. + + @sa create_table_def_key(thd, char *, table_list, bool) +*/ + +inline uint +create_table_def_key(char *key, const char *db, const char *table_name) +{ + /* + In theory caller should ensure that both db and table_name are + not longer than NAME_LEN bytes. In practice we play safe to avoid + buffer overruns. + */ + return (uint)(strmake(strmake(key, db, NAME_LEN) + 1, table_name, + NAME_LEN) - key + 1); +} + TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key, uint key_length, uint db_flags, int *error, my_hash_value_type hash_value); @@ -158,7 +183,7 @@ thr_lock_type read_lock_type_for_table(THD *thd, TABLE_LIST *table_list); my_bool mysql_rm_tmp_tables(void); -bool rm_temporary_table(handlerton *base, char *path); +bool rm_temporary_table(handlerton *base, const char *path); void close_tables_for_reopen(THD *thd, TABLE_LIST **tables, const MDL_savepoint &start_of_statement_svp); TABLE_LIST *find_table_in_list(TABLE_LIST *table, diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 191cc4e01c8..0d28e9adb6f 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -3123,8 +3123,8 @@ void Query_cache::invalidate_table(THD *thd, TABLE_LIST *table_list) char key[MAX_DBKEY_LENGTH]; uint key_length; - key_length=(uint) (strmov(strmov(key,table_list->db)+1, - table_list->table_name) -key)+ 1; + key_length= create_table_def_key(key, table_list->db, + table_list->table_name); // We don't store temporary tables => no key_length+=4 ... invalidate_table(thd, (uchar *)key, key_length); @@ -3242,8 +3242,8 @@ Query_cache::register_tables_from_list(THD *thd, TABLE_LIST *tables_used, DBUG_PRINT("qcache", ("view: %s db: %s", tables_used->view_name.str, tables_used->view_db.str)); - key_length= (uint) (strmov(strmov(key, tables_used->view_db.str) + 1, - tables_used->view_name.str) - key) + 1; + key_length= create_table_def_key(key, tables_used->view_db.str, + tables_used->view_name.str); /* There are not callback function for for VIEWs */ @@ -4287,15 +4287,14 @@ my_bool Query_cache::move_by_type(uchar **border, case Query_cache_block::RES_CONT: case Query_cache_block::RESULT: { - DBUG_PRINT("qcache", ("block 0x%lx RES* (%d)", (ulong) block, - (int) block->type)); - if (*border == 0) - break; - Query_cache_block *query_block = block->result()->parent(), - *next = block->next, - *prev = block->prev; - Query_cache_block::block_type type = block->type; - BLOCK_LOCK_WR(query_block); + DBUG_PRINT("qcache", ("block 0x%lx RES* (%d)", (ulong) block,
+ (int) block->type));
+ if (*border == 0)
+ break;
+ Query_cache_block *query_block= block->result()->parent();
+ BLOCK_LOCK_WR(query_block);
+ Query_cache_block *next= block->next, *prev= block->prev;
+ Query_cache_block::block_type type= block->type; ulong len = block->length, used = block->used; Query_cache_block *pprev = block->pprev, *pnext = block->pnext, @@ -4457,8 +4456,9 @@ uint Query_cache::filename_2_table_key (char *key, const char *path, *db_length= (filename - dbname) - 1; DBUG_PRINT("qcache", ("table '%-.*s.%s'", *db_length, dbname, filename)); - DBUG_RETURN((uint) (strmov(strmake(key, dbname, *db_length) + 1, - filename) -key) + 1); + DBUG_RETURN((uint) (strmake(strmake(key, dbname, + min(*db_length, NAME_LEN)) + 1, + filename, NAME_LEN) - key) + 1); } /**************************************************************************** diff --git a/sql/sql_class.cc b/sql/sql_class.cc index df71b78ada0..c5005c8ad5c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1850,6 +1850,19 @@ void THD::cleanup_after_query() stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0; auto_inc_intervals_in_cur_stmt_for_binlog.empty(); rand_used= 0; +#ifndef EMBEDDED_LIBRARY + /* + Clean possible unused INSERT_ID events by current statement. + is_update_query() is needed to ignore SET statements: + Statements that don't update anything directly and don't + used stored functions. This is mostly necessary to ignore + statements in binlog between SET INSERT_ID and DML statement + which is intended to consume its event (there can be other + SET statements between them). + */ + if ((rli_slave || rli_fake) && is_update_query(lex->sql_command)) + auto_inc_intervals_forced.empty(); +#endif } if (first_successful_insert_id_in_cur_stmt > 0) { @@ -4467,9 +4480,14 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state) bool xid_cache_insert(XID_STATE *xid_state) { mysql_mutex_lock(&LOCK_xid_cache); - DBUG_ASSERT(my_hash_search(&xid_cache, xid_state->xid.key(), - xid_state->xid.key_length())==0); - my_bool res=my_hash_insert(&xid_cache, (uchar*)xid_state); + if (my_hash_search(&xid_cache, xid_state->xid.key(), + xid_state->xid.key_length())) + { + mysql_mutex_unlock(&LOCK_xid_cache); + my_error(ER_XAER_DUPID, MYF(0)); + return true; + } + bool res= my_hash_insert(&xid_cache, (uchar*)xid_state); mysql_mutex_unlock(&LOCK_xid_cache); return res; } diff --git a/sql/sql_class.h b/sql/sql_class.h index cff6acbb9c9..3ce49c52a86 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -574,6 +574,9 @@ typedef struct system_variables ulong wt_timeout_long, wt_deadlock_search_depth_long; double long_query_time_double; + + my_bool pseudo_slave_mode; + } SV; /** diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 631825f0527..57820784b8d 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1262,6 +1262,8 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) if (thd->lex->mi.pos) { + if (thd->lex->mi.relay_log_pos) + slave_errno=ER_BAD_SLAVE_UNTIL_COND; mi->rli.until_condition= Relay_log_info::UNTIL_MASTER_POS; mi->rli.until_log_pos= thd->lex->mi.pos; /* @@ -1273,6 +1275,8 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) } else if (thd->lex->mi.relay_log_pos) { + if (thd->lex->mi.pos) + slave_errno=ER_BAD_SLAVE_UNTIL_COND; mi->rli.until_condition= Relay_log_info::UNTIL_RELAY_POS; mi->rli.until_log_pos= thd->lex->mi.relay_log_pos; strmake(mi->rli.until_log_name, thd->lex->mi.relay_log_name, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4fb05fe71c8..38b9b643d10 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012 Oracle and/or its affiliates. +/* Copyright (c) 2000, 2013 Oracle and/or its affiliates. Copyright (c) 2009, 2013 Monty Program Ab. This program is free software; you can redistribute it and/or modify @@ -553,25 +553,25 @@ inline int setup_without_group(THD *thd, Item **ref_pointer_array, ORDER *group, bool *hidden_group_fields) { int res; - nesting_map save_allow_sum_func=thd->lex->allow_sum_func ; + st_select_lex *const select= thd->lex->current_select; + nesting_map save_allow_sum_func= thd->lex->allow_sum_func; /* Need to save the value, so we can turn off only any new non_agg_field_used additions coming from the WHERE */ - const bool saved_non_agg_field_used= - thd->lex->current_select->non_agg_field_used(); + const bool saved_non_agg_field_used= select->non_agg_field_used(); DBUG_ENTER("setup_without_group"); - thd->lex->allow_sum_func&= ~(1 << thd->lex->current_select->nest_level); + thd->lex->allow_sum_func&= ~((nesting_map)1 << select->nest_level); res= setup_conds(thd, tables, leaves, conds); /* it's not wrong to have non-aggregated columns in a WHERE */ - thd->lex->current_select->set_non_agg_field_used(saved_non_agg_field_used); + select->set_non_agg_field_used(saved_non_agg_field_used); - thd->lex->allow_sum_func|= 1 << thd->lex->current_select->nest_level; + thd->lex->allow_sum_func|= (nesting_map)1 << select->nest_level; res= res || setup_order(thd, ref_pointer_array, tables, fields, all_fields, order); - thd->lex->allow_sum_func&= ~(1 << thd->lex->current_select->nest_level); + thd->lex->allow_sum_func&= ~((nesting_map)1 << select->nest_level); res= res || setup_group(thd, ref_pointer_array, tables, fields, all_fields, group, hidden_group_fields); thd->lex->allow_sum_func= save_allow_sum_func; @@ -720,7 +720,7 @@ JOIN::prepare(Item ***rref_pointer_array, { nesting_map save_allow_sum_func= thd->lex->allow_sum_func; thd->where="having clause"; - thd->lex->allow_sum_func|= 1 << select_lex_arg->nest_level; + thd->lex->allow_sum_func|= (nesting_map)1 << select_lex_arg->nest_level; select_lex->having_fix_field= 1; /* Wrap alone field in HAVING clause in case it will be outer field of subquery @@ -2187,6 +2187,7 @@ JOIN::exec() { List<Item> *columns_list= &fields_list; int tmp_error; + DBUG_ENTER("JOIN::exec"); thd_proc_info(thd, "executing"); @@ -5438,7 +5439,8 @@ best_access_path(JOIN *join, in ReuseRangeEstimateForRef-3. */ if (table->quick_keys.is_set(key) && - (const_part & ((1 << table->quick_key_parts[key])-1)) == + (const_part & + (((key_part_map)1 << table->quick_key_parts[key])-1)) == (((key_part_map)1 << table->quick_key_parts[key])-1) && table->quick_n_ranges[key] == 1 && records > (double) table->quick_rows[key]) @@ -5602,7 +5604,8 @@ best_access_path(JOIN *join, */ if (table->quick_keys.is_set(key) && table->quick_key_parts[key] <= max_key_part && - const_part & (1 << table->quick_key_parts[key]) && + const_part & + ((key_part_map)1 << table->quick_key_parts[key]) && table->quick_n_ranges[key] == 1 + test(ref_or_null_part & const_part) && records > (double) table->quick_rows[key]) @@ -7933,7 +7936,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, j->ref.items[i]=keyuse->val; // Save for cond removal j->ref.cond_guards[i]= keyuse->cond_guard; if (keyuse->null_rejecting) - j->ref.null_rejecting |= 1 << i; + j->ref.null_rejecting|= (key_part_map)1 << i; keyuse_uses_no_tables= keyuse_uses_no_tables && !keyuse->used_tables; if (!keyuse->val->used_tables() && !thd->lex->describe) { // Compare against constant @@ -8209,7 +8212,7 @@ static void add_not_null_conds(JOIN *join) { for (uint keypart= 0; keypart < tab->ref.key_parts; keypart++) { - if (tab->ref.null_rejecting & (1 << keypart)) + if (tab->ref.null_rejecting & ((key_part_map)1 << keypart)) { Item *item= tab->ref.items[keypart]; Item *notnull; @@ -14604,11 +14607,11 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields, } else { - recinfo->null_bit= 1 << (null_count & 7); + recinfo->null_bit= (uint8)1 << (null_count & 7); recinfo->null_pos= null_count/8; } field->move_field(pos,null_flags+null_count/8, - 1 << (null_count & 7)); + (uint8)1 << (null_count & 7)); null_count++; } else @@ -15056,7 +15059,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list) { cur_field->move_field(field_pos, (uchar*) null_pos, null_bit); null_bit<<= 1; - if (null_bit == (1 << 8)) + if (null_bit == (uint)1 << 8) { ++null_pos; null_bit= 1; @@ -19103,17 +19106,29 @@ create_sort_index(THD *thd, JOIN *join, ORDER *order, if (!keep_quick) { select->cleanup(); - /* - The select object should now be ready for the next use. If it - is re-used then there exists a backup copy of this join tab - which has the pointer to it. The join tab will be restored in - JOIN::reset(). So here we just delete the pointer to it. - */ - tab->select= NULL; - // If we deleted the quick select object we need to clear quick_keys + + // If we deleted the quick object we need to clear quick_keys table->quick_keys.clear_all(); table->intersect_keys.clear_all(); } + else + { + // Need to close the index scan in order to re-use the handler + tab->select->quick->range_end(); + } + + /* + The select object is now ready for the next use. To avoid that + the select object is used when reading the records in sorted + order we set the pointer to it to NULL. The select pointer will + be restored from the saved_select pointer when this select + operation is completed (@see JOIN::exec). This ensures that it + will be re-used when filesort is used by subqueries that are + executed multiple times. + */ + tab->saved_select= tab->select; + tab->select= NULL; + // Restore the output resultset table->sort.io_cache= tablesort_result_cache; } diff --git a/sql/sql_select.h b/sql/sql_select.h index bac29b96c5a..f52e9c45613 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1,8 +1,8 @@ #ifndef SQL_SELECT_INCLUDED #define SQL_SELECT_INCLUDED -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. - Copyright (c) 2008-2011 Monty Program Ab +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2008, 2013, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 330c28ebbd8..f75d1bafdd3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -648,13 +648,6 @@ uint build_tmptable_filename(THD* thd, char *buff, size_t bufflen) struct st_global_ddl_log { - /* - We need to adjust buffer size to be able to handle downgrades/upgrades - where IO_SIZE has changed. We'll set the buffer size such that we can - handle that the buffer size was upto 4 times bigger in the version - that wrote the DDL log. - */ - char file_entry_buf[4*IO_SIZE]; char file_name_str[FN_REFLEN]; char *file_name; DDL_LOG_MEMORY_ENTRY *first_free; @@ -682,51 +675,60 @@ mysql_mutex_t LOCK_gdl; #define DDL_LOG_NUM_ENTRY_POS 0 #define DDL_LOG_NAME_LEN_POS 4 #define DDL_LOG_IO_SIZE_POS 8 +#define DDL_LOG_HEADER_SIZE 12 -/* - Read one entry from ddl log file - SYNOPSIS - read_ddl_log_file_entry() - entry_no Entry number to read - RETURN VALUES - TRUE Error - FALSE Success +/** + Read one entry from ddl log file. + @param[out] file_entry_buf Buffer to read into + @param entry_no Entry number to read + @param size Number of bytes of the entry to read + + @return Operation status + @retval true Error + @retval false Success */ -static bool read_ddl_log_file_entry(uint entry_no) +static bool read_ddl_log_file_entry(uchar *file_entry_buf, + uint entry_no, + uint size) { bool error= FALSE; File file_id= global_ddl_log.file_id; - uchar *file_entry_buf= (uchar*)global_ddl_log.file_entry_buf; uint io_size= global_ddl_log.io_size; DBUG_ENTER("read_ddl_log_file_entry"); + DBUG_ASSERT(io_size >= size); - if (mysql_file_pread(file_id, file_entry_buf, io_size, io_size * entry_no, - MYF(MY_WME)) != io_size) + if (mysql_file_pread(file_id, file_entry_buf, size, io_size * entry_no, + MYF(MY_WME)) != size) error= TRUE; DBUG_RETURN(error); } -/* - Write one entry from ddl log file - SYNOPSIS - write_ddl_log_file_entry() - entry_no Entry number to write - RETURN VALUES - TRUE Error - FALSE Success +/** + Write one entry to ddl log file. + + @param file_entry_buf Buffer to write + @param entry_no Entry number to write + @param size Number of bytes of the entry to write + + @return Operation status + @retval true Error + @retval false Success */ -static bool write_ddl_log_file_entry(uint entry_no) +static bool write_ddl_log_file_entry(uchar *file_entry_buf, + uint entry_no, + uint size) { bool error= FALSE; File file_id= global_ddl_log.file_id; - char *file_entry_buf= (char*)global_ddl_log.file_entry_buf; + uint io_size= global_ddl_log.io_size; DBUG_ENTER("write_ddl_log_file_entry"); + DBUG_ASSERT(io_size >= size); - if (mysql_file_pwrite(file_id, (uchar*)file_entry_buf, - IO_SIZE, IO_SIZE * entry_no, MYF(MY_WME)) != IO_SIZE) + if (mysql_file_pwrite(file_id, file_entry_buf, size, + io_size * entry_no, MYF(MY_WME)) != size) error= TRUE; DBUG_RETURN(error); } @@ -745,17 +747,20 @@ static bool write_ddl_log_header() { uint16 const_var; bool error= FALSE; + uchar file_entry_buf[DDL_LOG_HEADER_SIZE]; DBUG_ENTER("write_ddl_log_header"); + DBUG_ASSERT((DDL_LOG_NAME_POS + 3 * global_ddl_log.name_len) + <= global_ddl_log.io_size); - int4store(&global_ddl_log.file_entry_buf[DDL_LOG_NUM_ENTRY_POS], + int4store(&file_entry_buf[DDL_LOG_NUM_ENTRY_POS], global_ddl_log.num_entries); - const_var= FN_LEN; - int4store(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_LEN_POS], + const_var= global_ddl_log.name_len; + int4store(&file_entry_buf[DDL_LOG_NAME_LEN_POS], (ulong) const_var); - const_var= IO_SIZE; - int4store(&global_ddl_log.file_entry_buf[DDL_LOG_IO_SIZE_POS], + const_var= global_ddl_log.io_size; + int4store(&file_entry_buf[DDL_LOG_IO_SIZE_POS], (ulong) const_var); - if (write_ddl_log_file_entry(0UL)) + if (write_ddl_log_file_entry(file_entry_buf, 0UL, DDL_LOG_HEADER_SIZE)) { sql_print_error("Error writing ddl log header"); DBUG_RETURN(TRUE); @@ -795,18 +800,20 @@ static inline void create_ddl_log_file_name(char *file_name) static uint read_ddl_log_header() { - char *file_entry_buf= (char*)global_ddl_log.file_entry_buf; + char file_entry_buf[DDL_LOG_HEADER_SIZE]; char file_name[FN_REFLEN]; uint entry_no; bool successful_open= FALSE; DBUG_ENTER("read_ddl_log_header"); + DBUG_ASSERT(global_ddl_log.io_size <= IO_SIZE); create_ddl_log_file_name(file_name); if ((global_ddl_log.file_id= mysql_file_open(key_file_global_ddl_log, file_name, O_RDWR | O_BINARY, MYF(0))) >= 0) { - if (read_ddl_log_file_entry(0UL)) + if (read_ddl_log_file_entry((uchar *) file_entry_buf, 0UL, + DDL_LOG_HEADER_SIZE)) { /* Write message into error log */ sql_print_error("Failed to read ddl log file in recovery"); @@ -819,8 +826,6 @@ static uint read_ddl_log_header() entry_no= uint4korr(&file_entry_buf[DDL_LOG_NUM_ENTRY_POS]); global_ddl_log.name_len= uint4korr(&file_entry_buf[DDL_LOG_NAME_LEN_POS]); global_ddl_log.io_size= uint4korr(&file_entry_buf[DDL_LOG_IO_SIZE_POS]); - DBUG_ASSERT(global_ddl_log.io_size <= - sizeof(global_ddl_log.file_entry_buf)); } else { @@ -835,30 +840,22 @@ static uint read_ddl_log_header() } -/* - Read a ddl log entry - SYNOPSIS - read_ddl_log_entry() - read_entry Number of entry to read - out:entry_info Information from entry - RETURN VALUES - TRUE Error - FALSE Success - DESCRIPTION - Read a specified entry in the ddl log +/** + Set ddl log entry struct from buffer + @param read_entry Entry number + @param file_entry_buf Buffer to use + @param ddl_log_entry Entry to be set + + @note Pointers in ddl_log_entry will point into file_entry_buf! */ -bool read_ddl_log_entry(uint read_entry, DDL_LOG_ENTRY *ddl_log_entry) +static void set_ddl_log_entry_from_buf(uint read_entry, + uchar *file_entry_buf, + DDL_LOG_ENTRY *ddl_log_entry) { - char *file_entry_buf= (char*)&global_ddl_log.file_entry_buf; uint inx; uchar single_char; - DBUG_ENTER("read_ddl_log_entry"); - - if (read_ddl_log_file_entry(read_entry)) - { - DBUG_RETURN(TRUE); - } + DBUG_ENTER("set_ddl_log_entry_from_buf"); ddl_log_entry->entry_pos= read_entry; single_char= file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]; ddl_log_entry->entry_type= (enum ddl_log_entry_code)single_char; @@ -866,14 +863,14 @@ bool read_ddl_log_entry(uint read_entry, DDL_LOG_ENTRY *ddl_log_entry) ddl_log_entry->action_type= (enum ddl_log_action_code)single_char; ddl_log_entry->phase= file_entry_buf[DDL_LOG_PHASE_POS]; ddl_log_entry->next_entry= uint4korr(&file_entry_buf[DDL_LOG_NEXT_ENTRY_POS]); - ddl_log_entry->name= &file_entry_buf[DDL_LOG_NAME_POS]; + ddl_log_entry->name= (char*) &file_entry_buf[DDL_LOG_NAME_POS]; inx= DDL_LOG_NAME_POS + global_ddl_log.name_len; - ddl_log_entry->from_name= &file_entry_buf[inx]; + ddl_log_entry->from_name= (char*) &file_entry_buf[inx]; inx+= global_ddl_log.name_len; - ddl_log_entry->handler_name= &file_entry_buf[inx]; - DBUG_RETURN(FALSE); + ddl_log_entry->handler_name= (char*) &file_entry_buf[inx]; + DBUG_VOID_RETURN; } - + /* Initialise ddl log @@ -1076,6 +1073,7 @@ static bool get_free_ddl_log_entry(DDL_LOG_MEMORY_ENTRY **active_entry, DDL_LOG_MEMORY_ENTRY *first_used= global_ddl_log.first_used; DBUG_ENTER("get_free_ddl_log_entry"); + mysql_mutex_assert_owner(&LOCK_gdl); if (global_ddl_log.first_free == NULL) { if (!(used_entry= (DDL_LOG_MEMORY_ENTRY*)my_malloc( @@ -1133,34 +1131,36 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, DDL_LOG_MEMORY_ENTRY **active_entry) { bool error, write_header; + char file_entry_buf[IO_SIZE]; DBUG_ENTER("write_ddl_log_entry"); if (init_ddl_log()) { DBUG_RETURN(TRUE); } - global_ddl_log.file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]= + memset(file_entry_buf, 0, sizeof(file_entry_buf)); + file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]= (char)DDL_LOG_ENTRY_CODE; - global_ddl_log.file_entry_buf[DDL_LOG_ACTION_TYPE_POS]= + file_entry_buf[DDL_LOG_ACTION_TYPE_POS]= (char)ddl_log_entry->action_type; - global_ddl_log.file_entry_buf[DDL_LOG_PHASE_POS]= 0; - int4store(&global_ddl_log.file_entry_buf[DDL_LOG_NEXT_ENTRY_POS], + file_entry_buf[DDL_LOG_PHASE_POS]= 0; + int4store(&file_entry_buf[DDL_LOG_NEXT_ENTRY_POS], ddl_log_entry->next_entry); - DBUG_ASSERT(strlen(ddl_log_entry->name) < FN_LEN); - strmake(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS], - ddl_log_entry->name, FN_LEN - 1); + DBUG_ASSERT(strlen(ddl_log_entry->name) < global_ddl_log.name_len); + strmake(&file_entry_buf[DDL_LOG_NAME_POS], ddl_log_entry->name, + global_ddl_log.name_len - 1); if (ddl_log_entry->action_type == DDL_LOG_RENAME_ACTION || ddl_log_entry->action_type == DDL_LOG_REPLACE_ACTION) { - DBUG_ASSERT(strlen(ddl_log_entry->from_name) < FN_LEN); - strmake(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + FN_LEN], - ddl_log_entry->from_name, FN_LEN - 1); + DBUG_ASSERT(strlen(ddl_log_entry->from_name) < global_ddl_log.name_len); + strmake(&file_entry_buf[DDL_LOG_NAME_POS + global_ddl_log.name_len], + ddl_log_entry->from_name, global_ddl_log.name_len - 1); } else - global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + FN_LEN]= 0; - DBUG_ASSERT(strlen(ddl_log_entry->handler_name) < FN_LEN); - strmake(&global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS + (2*FN_LEN)], - ddl_log_entry->handler_name, FN_LEN - 1); + file_entry_buf[DDL_LOG_NAME_POS + global_ddl_log.name_len]= 0; + DBUG_ASSERT(strlen(ddl_log_entry->handler_name) < global_ddl_log.name_len); + strmake(&file_entry_buf[DDL_LOG_NAME_POS + (2*global_ddl_log.name_len)], + ddl_log_entry->handler_name, global_ddl_log.name_len - 1); if (get_free_ddl_log_entry(active_entry, &write_header)) { DBUG_RETURN(TRUE); @@ -1168,14 +1168,15 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, error= FALSE; DBUG_PRINT("ddl_log", ("write type %c next %u name '%s' from_name '%s' handler '%s'", - (char) global_ddl_log.file_entry_buf[DDL_LOG_ACTION_TYPE_POS], + (char) file_entry_buf[DDL_LOG_ACTION_TYPE_POS], ddl_log_entry->next_entry, - (char*) &global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS], - (char*) &global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS - + FN_LEN], - (char*) &global_ddl_log.file_entry_buf[DDL_LOG_NAME_POS - + (2*FN_LEN)])); - if (write_ddl_log_file_entry((*active_entry)->entry_pos)) + (char*) &file_entry_buf[DDL_LOG_NAME_POS], + (char*) &file_entry_buf[DDL_LOG_NAME_POS + + global_ddl_log.name_len], + (char*) &file_entry_buf[DDL_LOG_NAME_POS + + (2*global_ddl_log.name_len)])); + if (write_ddl_log_file_entry((uchar*) file_entry_buf, + (*active_entry)->entry_pos, IO_SIZE)) { error= TRUE; sql_print_error("Failed to write entry_no = %u", @@ -1225,13 +1226,14 @@ bool write_execute_ddl_log_entry(uint first_entry, DDL_LOG_MEMORY_ENTRY **active_entry) { bool write_header= FALSE; - char *file_entry_buf= (char*)global_ddl_log.file_entry_buf; + char file_entry_buf[IO_SIZE]; DBUG_ENTER("write_execute_ddl_log_entry"); if (init_ddl_log()) { DBUG_RETURN(TRUE); } + memset(file_entry_buf, 0, sizeof(file_entry_buf)); if (!complete) { /* @@ -1245,12 +1247,7 @@ bool write_execute_ddl_log_entry(uint first_entry, } else file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]= (char)DDL_IGNORE_LOG_ENTRY_CODE; - file_entry_buf[DDL_LOG_ACTION_TYPE_POS]= 0; /* Ignored for execute entries */ - file_entry_buf[DDL_LOG_PHASE_POS]= 0; int4store(&file_entry_buf[DDL_LOG_NEXT_ENTRY_POS], first_entry); - file_entry_buf[DDL_LOG_NAME_POS]= 0; - file_entry_buf[DDL_LOG_NAME_POS + FN_LEN]= 0; - file_entry_buf[DDL_LOG_NAME_POS + 2*FN_LEN]= 0; if (!(*active_entry)) { if (get_free_ddl_log_entry(active_entry, &write_header)) @@ -1258,7 +1255,9 @@ bool write_execute_ddl_log_entry(uint first_entry, DBUG_RETURN(TRUE); } } - if (write_ddl_log_file_entry((*active_entry)->entry_pos)) + if (write_ddl_log_file_entry((uchar*) file_entry_buf, + (*active_entry)->entry_pos, + IO_SIZE)) { sql_print_error("Error writing execute entry in ddl log"); release_ddl_log_memory_entry(*active_entry); @@ -1303,10 +1302,16 @@ bool write_execute_ddl_log_entry(uint first_entry, bool deactivate_ddl_log_entry(uint entry_no) { - char *file_entry_buf= (char*)global_ddl_log.file_entry_buf; + uchar file_entry_buf[DDL_LOG_NAME_POS]; DBUG_ENTER("deactivate_ddl_log_entry"); - if (!read_ddl_log_file_entry(entry_no)) + + /* + Only need to read and write the first bytes of the entry, where + ENTRY_TYPE, ACTION_TYPE and PHASE reside. Using DDL_LOG_NAME_POS + to include all info except for the names. + */ + if (!read_ddl_log_file_entry(file_entry_buf, entry_no, DDL_LOG_NAME_POS)) { if (file_entry_buf[DDL_LOG_ENTRY_TYPE_POS] == DDL_LOG_ENTRY_CODE) { @@ -1324,7 +1329,7 @@ bool deactivate_ddl_log_entry(uint entry_no) { DBUG_ASSERT(0); } - if (write_ddl_log_file_entry(entry_no)) + if (write_ddl_log_file_entry(file_entry_buf, entry_no, DDL_LOG_NAME_POS)) { sql_print_error("Error in deactivating log entry. Position = %u", entry_no); @@ -1385,6 +1390,7 @@ void release_ddl_log_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry) DDL_LOG_MEMORY_ENTRY *next_log_entry= log_entry->next_log_entry; DDL_LOG_MEMORY_ENTRY *prev_log_entry= log_entry->prev_log_entry; DBUG_ENTER("release_ddl_log_memory_entry"); + mysql_mutex_assert_owner(&LOCK_gdl); global_ddl_log.first_free= log_entry; log_entry->next_log_entry= first_free; @@ -1414,24 +1420,26 @@ bool execute_ddl_log_entry(THD *thd, uint first_entry) { DDL_LOG_ENTRY ddl_log_entry; uint read_entry= first_entry; + uchar file_entry_buf[IO_SIZE]; DBUG_ENTER("execute_ddl_log_entry"); mysql_mutex_lock(&LOCK_gdl); do { - if (read_ddl_log_entry(read_entry, &ddl_log_entry)) + if (read_ddl_log_file_entry(file_entry_buf, read_entry, IO_SIZE)) { - /* Write to error log and continue with next log entry */ + /* Print the error to the log and continue with next log entry */ sql_print_error("Failed to read entry = %u from ddl log", read_entry); break; } + set_ddl_log_entry_from_buf(read_entry, file_entry_buf, &ddl_log_entry); DBUG_ASSERT(ddl_log_entry.entry_type == DDL_LOG_ENTRY_CODE || ddl_log_entry.entry_type == DDL_IGNORE_LOG_ENTRY_CODE); if (execute_ddl_log_action(thd, &ddl_log_entry)) { - /* Write to error log and continue with next log entry */ + /* Print the error to the log and continue with next log entry */ sql_print_error("Failed to execute action for entry = %u from ddl log", read_entry); break; @@ -1476,13 +1484,14 @@ void execute_ddl_log_recovery() uint num_entries, i; THD *thd; DDL_LOG_ENTRY ddl_log_entry; + uchar *file_entry_buf; + uint io_size; char file_name[FN_REFLEN]; DBUG_ENTER("execute_ddl_log_recovery"); /* Initialise global_ddl_log struct */ - bzero(global_ddl_log.file_entry_buf, sizeof(global_ddl_log.file_entry_buf)); global_ddl_log.inited= FALSE; global_ddl_log.recovery_phase= TRUE; global_ddl_log.io_size= IO_SIZE; @@ -1497,14 +1506,23 @@ void execute_ddl_log_recovery() thd->store_globals(); num_entries= read_ddl_log_header(); + io_size= global_ddl_log.io_size; + file_entry_buf= (uchar*) my_malloc(io_size, MYF(0)); + if (!file_entry_buf) + { + sql_print_error("Failed to allocate buffer for recover ddl log"); + DBUG_VOID_RETURN; + } for (i= 1; i < num_entries + 1; i++) { - if (read_ddl_log_entry(i, &ddl_log_entry)) + if (read_ddl_log_file_entry(file_entry_buf, i, io_size)) { sql_print_error("Failed to read entry no = %u from ddl log", i); continue; } + + set_ddl_log_entry_from_buf(i, file_entry_buf, &ddl_log_entry); if (ddl_log_entry.entry_type == DDL_LOG_EXECUTE_CODE) { if (execute_ddl_log_entry(thd, ddl_log_entry.next_entry)) @@ -1519,6 +1537,7 @@ void execute_ddl_log_recovery() (void) mysql_file_delete(key_file_global_ddl_log, file_name, MYF(0)); global_ddl_log.recovery_phase= FALSE; delete thd; + my_free(file_entry_buf); /* Remember that we don't have a THD */ my_pthread_setspecific_ptr(THR_THD, 0); DBUG_VOID_RETURN; @@ -1535,14 +1554,16 @@ void execute_ddl_log_recovery() void release_ddl_log() { - DDL_LOG_MEMORY_ENTRY *free_list= global_ddl_log.first_free; - DDL_LOG_MEMORY_ENTRY *used_list= global_ddl_log.first_used; + DDL_LOG_MEMORY_ENTRY *free_list; + DDL_LOG_MEMORY_ENTRY *used_list; DBUG_ENTER("release_ddl_log"); if (!global_ddl_log.do_release) DBUG_VOID_RETURN; mysql_mutex_lock(&LOCK_gdl); + free_list= global_ddl_log.first_free; + used_list= global_ddl_log.first_used; while (used_list) { DDL_LOG_MEMORY_ENTRY *tmp= used_list->next_log_entry; diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 0c0742b3805..f39901a6ca5 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -85,7 +85,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, *set_warning= 1; } else - found|= ((longlong) 1 << (find - 1)); + found|= 1ULL << (find - 1); if (pos >= end) break; start= pos + mblen; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index c1c6e142706..76486dcca71 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -3823,9 +3823,67 @@ static Sys_var_ulong Sys_debug_binlog_fsync_sleep( CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); #endif + static Sys_var_harows Sys_expensive_subquery_limit( "expensive_subquery_limit", "The maximum number of rows a subquery may examine in order to be " "executed during optimization and used for constant optimization", SESSION_VAR(expensive_subquery_limit), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, HA_POS_ERROR), DEFAULT(100), BLOCK_SIZE(1)); + +static bool check_pseudo_slave_mode(sys_var *self, THD *thd, set_var *var) +{ + longlong previous_val= thd->variables.pseudo_slave_mode; + longlong val= (longlong) var->save_result.ulonglong_value; + bool rli_fake= false; + +#ifndef EMBEDDED_LIBRARY + rli_fake= thd->rli_fake ? true : false; +#endif + + if (rli_fake) + { + if (!val) + { +#ifndef EMBEDDED_LIBRARY + delete thd->rli_fake; + thd->rli_fake= NULL; +#endif + } + else if (previous_val && val) + goto ineffective; + else if (!previous_val && val) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WRONG_VALUE_FOR_VAR, + "'pseudo_slave_mode' is already ON."); + } + else + { + if (!previous_val && !val) + goto ineffective; + else if (previous_val && !val) + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WRONG_VALUE_FOR_VAR, + "Slave applier execution mode not active, " + "statement ineffective."); + } + goto end; + +ineffective: + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WRONG_VALUE_FOR_VAR, + "'pseudo_slave_mode' change was ineffective."); + +end: + return FALSE; +} +static Sys_var_mybool Sys_pseudo_slave_mode( + "pseudo_slave_mode", + "SET pseudo_slave_mode= 0,1 are commands that mysqlbinlog " + "adds to beginning and end of binary log dumps. While zero " + "value indeed disables, the actual enabling of the slave " + "applier execution mode is done implicitly when a " + "Format_description_event is sent through the session.", + SESSION_ONLY(pseudo_slave_mode), NO_CMD_LINE, DEFAULT(FALSE), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_pseudo_slave_mode)); + diff --git a/sql/transaction.cc b/sql/transaction.cc index 3359decbcd5..1623cd57d77 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -567,15 +567,19 @@ bool trans_xa_start(THD *thd) my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]); else if (thd->locked_tables_mode || thd->in_active_multi_stmt_transaction()) my_error(ER_XAER_OUTSIDE, MYF(0)); - else if (xid_cache_search(thd->lex->xid)) - my_error(ER_XAER_DUPID, MYF(0)); else if (!trans_begin(thd)) { DBUG_ASSERT(thd->transaction.xid_state.xid.is_null()); thd->transaction.xid_state.xa_state= XA_ACTIVE; thd->transaction.xid_state.rm_error= 0; thd->transaction.xid_state.xid.set(thd->lex->xid); - xid_cache_insert(&thd->transaction.xid_state); + if (xid_cache_insert(&thd->transaction.xid_state)) + { + thd->transaction.xid_state.xa_state= XA_NOTR; + thd->transaction.xid_state.xid.null(); + trans_rollback(thd); + DBUG_RETURN(true); + } DBUG_RETURN(FALSE); } @@ -661,6 +665,16 @@ bool trans_xa_commit(THD *thd) if (!thd->transaction.xid_state.xid.eq(thd->lex->xid)) { + /* + xid_state.in_thd is always true beside of xa recovery procedure. + Note, that there is no race condition here between xid_cache_search + and xid_cache_delete, since we always delete our own XID + (thd->lex->xid == thd->transaction.xid_state.xid). + The only case when thd->lex->xid != thd->transaction.xid_state.xid + and xid_state->in_thd == 0 is in the function + xa_cache_insert(XID, xa_states), which is called before starting + client connections, and thus is always single-threaded. + */ XID_STATE *xs= xid_cache_search(thd->lex->xid); res= !xs || xs->in_thd; if (res) diff --git a/sql/tztime.cc b/sql/tztime.cc index 8194367a7f9..0e793290bba 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1856,7 +1856,7 @@ static Time_zone* tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) { TABLE *table= 0; - TIME_ZONE_INFO *tz_info; + TIME_ZONE_INFO *tz_info= NULL; Tz_names_entry *tmp_tzname; Time_zone *return_val= 0; int res; @@ -1866,7 +1866,8 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) uchar keybuff[32]; Field *field; String abbr(buff, sizeof(buff), &my_charset_latin1); - char *alloc_buff, *tz_name_buff; + char *alloc_buff= NULL; + char *tz_name_buff= NULL; /* Temporary arrays that are used for loading of data for filling TIME_ZONE_INFO structure @@ -1886,22 +1887,6 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) DBUG_ENTER("tz_load_from_open_tables"); - /* Prepare tz_info for loading also let us make copy of time zone name */ - if (!(alloc_buff= (char*) alloc_root(&tz_storage, sizeof(TIME_ZONE_INFO) + - tz_name->length() + 1))) - { - sql_print_error("Out of memory while loading time zone description"); - return 0; - } - tz_info= (TIME_ZONE_INFO *)alloc_buff; - bzero(tz_info, sizeof(TIME_ZONE_INFO)); - tz_name_buff= alloc_buff + sizeof(TIME_ZONE_INFO); - /* - By writing zero to the end we guarantee that we can call ptr() - instead of c_ptr() for time zone name. - */ - strmake(tz_name_buff, tz_name->ptr(), tz_name->length()); - /* Let us find out time zone id by its name (there is only one index and it is specifically for this purpose). diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index e705d1dd615..f5b96989811 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -909,10 +909,11 @@ int ha_archive::write_row(uchar *buf) table->timestamp_field->set_time(); mysql_mutex_lock(&share->mutex); - if (!share->archive_write_open) - if (init_archive_writer()) - DBUG_RETURN(errno); - + if (!share->archive_write_open && init_archive_writer()) + { + rc= errno; + goto error; + } if (table->next_number_field && record == table->record[0]) { @@ -992,7 +993,6 @@ int ha_archive::write_row(uchar *buf) error: mysql_mutex_unlock(&share->mutex); my_free(read_buf); - DBUG_RETURN(rc); } diff --git a/storage/heap/hp_delete.c b/storage/heap/hp_delete.c index d00ac94a918..a01db50a478 100644 --- a/storage/heap/hp_delete.c +++ b/storage/heap/hp_delete.c @@ -105,7 +105,7 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, const uchar *record, uchar *recpos, int flag) { - ulong blength,pos2,pos_hashnr,lastpos_hashnr; + ulong blength, pos2, pos_hashnr, lastpos_hashnr, key_pos; HASH_INFO *lastpos,*gpos,*pos,*pos3,*empty,*last_ptr; HP_SHARE *share=info->s; DBUG_ENTER("hp_delete_key"); @@ -117,9 +117,9 @@ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, last_ptr=0; /* Search after record with key */ - pos= hp_find_hash(&keyinfo->block, - hp_mask(hp_rec_hashnr(keyinfo, record), blength, - share->records + 1)); + key_pos= hp_mask(hp_rec_hashnr(keyinfo, record), blength, share->records + 1); + pos= hp_find_hash(&keyinfo->block, key_pos); + gpos = pos3 = 0; while (pos->ptr_to_rec != recpos) diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c index 1f4d8126be6..24ff78df7c0 100644 --- a/storage/innobase/btr/btr0btr.c +++ b/storage/innobase/btr/btr0btr.c @@ -3094,6 +3094,8 @@ btr_lift_page_up( buf_block_t* blocks[BTR_MAX_LEVELS]; ulint n_blocks; /*!< last used index in blocks[] */ ulint i; + ibool lift_father_up = FALSE; + buf_block_t* block_orig = block; ut_ad(btr_page_get_prev(page, mtr) == FIL_NULL); ut_ad(btr_page_get_next(page, mtr) == FIL_NULL); @@ -3104,11 +3106,13 @@ btr_lift_page_up( { btr_cur_t cursor; - mem_heap_t* heap = mem_heap_create(100); - ulint* offsets; + ulint* offsets = NULL; + mem_heap_t* heap = mem_heap_create( + sizeof(*offsets) + * (REC_OFFS_HEADER_SIZE + 1 + 1 + index->n_fields)); buf_block_t* b; - offsets = btr_page_get_father_block(NULL, heap, index, + offsets = btr_page_get_father_block(offsets, heap, index, block, mtr, &cursor); father_block = btr_cur_get_block(&cursor); father_page_zip = buf_block_get_page_zip(father_block); @@ -3132,6 +3136,29 @@ btr_lift_page_up( blocks[n_blocks++] = b = btr_cur_get_block(&cursor); } + if (n_blocks && page_level == 0) { + /* The father page also should be the only on its level (not + root). We should lift up the father page at first. + Because the leaf page should be lifted up only for root page. + The freeing page is based on page_level (==0 or !=0) + to choose segment. If the page_level is changed ==0 from !=0, + later freeing of the page doesn't find the page allocation + to be freed.*/ + + lift_father_up = TRUE; + block = father_block; + page = buf_block_get_frame(block); + page_level = btr_page_get_level(page, mtr); + + ut_ad(btr_page_get_prev(page, mtr) == FIL_NULL); + ut_ad(btr_page_get_next(page, mtr) == FIL_NULL); + ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); + + father_block = blocks[0]; + father_page_zip = buf_block_get_page_zip(father_block); + father_page = buf_block_get_frame(father_block); + } + mem_heap_free(heap); } @@ -3139,6 +3166,7 @@ btr_lift_page_up( /* Make the father empty */ btr_page_empty(father_block, father_page_zip, index, page_level, mtr); + page_level++; /* Copy the records to the father page one by one. */ if (0 @@ -3171,7 +3199,7 @@ btr_lift_page_up( lock_update_copy_and_discard(father_block, block); /* Go upward to root page, decrementing levels by one. */ - for (i = 0; i < n_blocks; i++, page_level++) { + for (i = lift_father_up ? 1 : 0; i < n_blocks; i++, page_level++) { page_t* page = buf_block_get_frame(blocks[i]); page_zip_des_t* page_zip= buf_block_get_page_zip(blocks[i]); @@ -3193,7 +3221,7 @@ btr_lift_page_up( ut_ad(page_validate(father_page, index)); ut_ad(btr_check_node_ptr(index, father_block, mtr)); - return(father_block); + return(lift_father_up ? block_orig : father_block); } /*************************************************************//** diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c index 1f92de245b1..955be01f032 100644 --- a/storage/innobase/btr/btr0cur.c +++ b/storage/innobase/btr/btr0cur.c @@ -97,6 +97,11 @@ srv_refresh_innodb_monitor_stats(). Referenced by srv_printf_innodb_monitor(). */ UNIV_INTERN ulint btr_cur_n_sea_old = 0; +#ifdef UNIV_DEBUG +/* Flag to limit optimistic insert records */ +UNIV_INTERN uint btr_cur_limit_optimistic_insert_debug = 0; +#endif /* UNIV_DEBUG */ + /** In the optimistic insert, if the insert does not fit, but this much space can be released by page reorganize, then it is reorganized */ #define BTR_CUR_PAGE_REORGANIZE_LIMIT (UNIV_PAGE_SIZE / 32) @@ -1273,6 +1278,9 @@ btr_cur_optimistic_insert( } } + LIMIT_OPTIMISTIC_INSERT_DEBUG(page_get_n_recs(page), + goto fail); + /* If there have been many consecutive inserts, and we are on the leaf level, check if we have to split the page to reserve enough free space for future updates of records. */ diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c index 1af019dfc45..2406980196e 100644 --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -370,6 +370,33 @@ buf_get_total_list_len( } /********************************************************************//** +Get total list size in bytes from all buffer pools. */ +UNIV_INTERN +void +buf_get_total_list_size_in_bytes( +/*=============================*/ + buf_pools_list_size_t* buf_pools_list_size) /*!< out: list sizes + in all buffer pools */ +{ + ulint i; + ut_ad(buf_pools_list_size); + memset(buf_pools_list_size, 0, sizeof(*buf_pools_list_size)); + + for (i = 0; i < srv_buf_pool_instances; i++) { + buf_pool_t* buf_pool; + + buf_pool = buf_pool_from_array(i); + /* We don't need mutex protection since this is + for statistics purpose */ + buf_pools_list_size->LRU_bytes += buf_pool->stat.LRU_bytes; + buf_pools_list_size->unzip_LRU_bytes += + UT_LIST_GET_LEN(buf_pool->unzip_LRU) * UNIV_PAGE_SIZE; + buf_pools_list_size->flush_list_bytes += + buf_pool->stat.flush_list_bytes; + } +} + +/********************************************************************//** Get total buffer pool statistics. */ UNIV_INTERN void @@ -1657,34 +1684,24 @@ buf_page_make_young( } /********************************************************************//** -Sets the time of the first access of a page and moves a page to the -start of the buffer pool LRU list if it is too old. This high-level -function can be used to prevent an important page from slipping -out of the buffer pool. */ +Moves a page to the start of the buffer pool LRU list if it is too old. +This high-level function can be used to prevent an important page from +slipping out of the buffer pool. */ static void -buf_page_set_accessed_make_young( -/*=============================*/ - buf_page_t* bpage, /*!< in/out: buffer block of a +buf_page_make_young_if_needed( +/*==========================*/ + buf_page_t* bpage) /*!< in/out: buffer block of a file page */ - unsigned access_time) /*!< in: bpage->access_time - read under mutex protection, - or 0 if unknown */ { +#ifdef UNIV_DEBUG buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); - ut_ad(!buf_pool_mutex_own(buf_pool)); +#endif /* UNIV_DEBUG */ ut_a(buf_page_in_file(bpage)); if (buf_page_peek_if_too_old(bpage)) { - buf_pool_mutex_enter(buf_pool); - buf_LRU_make_block_young(bpage); - buf_pool_mutex_exit(buf_pool); - } else if (!access_time) { - ulint time_ms = ut_time_ms(); - buf_pool_mutex_enter(buf_pool); - buf_page_set_accessed(bpage, time_ms); - buf_pool_mutex_exit(buf_pool); + buf_page_make_young(bpage); } } @@ -1797,7 +1814,6 @@ buf_page_get_zip( buf_page_t* bpage; mutex_t* block_mutex; ibool must_read; - unsigned access_time; buf_pool_t* buf_pool = buf_pool_get(space, offset); buf_pool->stat.n_page_gets++; @@ -1865,13 +1881,14 @@ err_exit: got_block: must_read = buf_page_get_io_fix(bpage) == BUF_IO_READ; - access_time = buf_page_is_accessed(bpage); buf_pool_mutex_exit(buf_pool); + buf_page_set_accessed(bpage); + mutex_exit(block_mutex); - buf_page_set_accessed_make_young(bpage, access_time); + buf_page_make_young_if_needed(bpage); #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ut_a(!bpage->file_page_was_freed); @@ -2458,22 +2475,29 @@ wait_until_unfixed: UNIV_MEM_INVALID(bpage, sizeof *bpage); - mutex_exit(&block->mutex); - mutex_exit(&buf_pool->zip_mutex); buf_pool->n_pend_unzip++; - buf_pool_mutex_exit(buf_pool); + access_time = buf_page_is_accessed(&block->page); + mutex_exit(&block->mutex); + mutex_exit(&buf_pool->zip_mutex); + buf_page_free_descriptor(bpage); - /* Decompress the page and apply buffered operations - while not holding buf_pool->mutex or block->mutex. */ + /* Decompress the page while not holding + buf_pool->mutex or block->mutex. */ success = buf_zip_decompress(block, srv_use_checksums); ut_a(success); if (UNIV_LIKELY(!recv_no_ibuf_operations)) { - ibuf_merge_or_delete_for_page(block, space, offset, - zip_size, TRUE); + if (access_time) { +#ifdef UNIV_IBUF_COUNT_DEBUG + ut_a(ibuf_count_get(space, offset) == 0); +#endif /* UNIV_IBUF_COUNT_DEBUG */ + } else { + ibuf_merge_or_delete_for_page( + block, space, offset, zip_size, TRUE); + } } /* Unfix and unlatch the block. */ @@ -2550,16 +2574,17 @@ wait_until_unfixed: ut_a(mode == BUF_GET_POSSIBLY_FREED || !block->page.file_page_was_freed); #endif - mutex_exit(&block->mutex); + buf_pool_mutex_exit(buf_pool); /* Check if this is the first access to the page */ - access_time = buf_page_is_accessed(&block->page); - buf_pool_mutex_exit(buf_pool); + buf_page_set_accessed(&block->page); - if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) { - buf_page_set_accessed_make_young(&block->page, access_time); + mutex_exit(&block->mutex); + + if (mode != BUF_PEEK_IF_IN_POOL) { + buf_page_make_young_if_needed(&block->page); } #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG @@ -2610,7 +2635,7 @@ wait_until_unfixed: mtr_memo_push(mtr, block, fix_type); - if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL) && !access_time) { + if (mode != BUF_PEEK_IF_IN_POOL && !access_time) { /* In the case of a first access, try to apply linear read-ahead */ @@ -2662,15 +2687,13 @@ buf_page_optimistic_get( buf_block_buf_fix_inc(block, file, line); - mutex_exit(&block->mutex); + access_time = buf_page_is_accessed(&block->page); - /* Check if this is the first access to the page. - We do a dirty read on purpose, to avoid mutex contention. - This field is only used for heuristic purposes; it does not - affect correctness. */ + buf_page_set_accessed(&block->page); - access_time = buf_page_is_accessed(&block->page); - buf_page_set_accessed_make_young(&block->page, access_time); + mutex_exit(&block->mutex); + + buf_page_make_young_if_needed(&block->page); ut_ad(!ibuf_inside(mtr) || ibuf_page(buf_block_get_space(block), @@ -2722,7 +2745,7 @@ buf_page_optimistic_get( #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ut_a(block->page.file_page_was_freed == FALSE); #endif - if (UNIV_UNLIKELY(!access_time)) { + if (!access_time) { /* In the case of a first access, try to apply linear read-ahead */ @@ -2785,24 +2808,14 @@ buf_page_get_known_nowait( buf_block_buf_fix_inc(block, file, line); + buf_page_set_accessed(&block->page); + mutex_exit(&block->mutex); buf_pool = buf_pool_from_block(block); - if (mode == BUF_MAKE_YOUNG && buf_page_peek_if_too_old(&block->page)) { - buf_pool_mutex_enter(buf_pool); - buf_LRU_make_block_young(&block->page); - buf_pool_mutex_exit(buf_pool); - } else if (!buf_page_is_accessed(&block->page)) { - /* Above, we do a dirty read on purpose, to avoid - mutex contention. The field buf_page_t::access_time - is only used for heuristic purposes. Writes to the - field must be protected by mutex, however. */ - ulint time_ms = ut_time_ms(); - - buf_pool_mutex_enter(buf_pool); - buf_page_set_accessed(&block->page, time_ms); - buf_pool_mutex_exit(buf_pool); + if (mode == BUF_MAKE_YOUNG) { + buf_page_make_young_if_needed(&block->page); } ut_ad(!ibuf_inside(mtr) || mode == BUF_KEEP_OLD); @@ -2965,6 +2978,7 @@ buf_page_init( ulint offset, /*!< in: offset of the page within space in units of a page */ ulint fold, /*!< in: buf_page_address_fold(space,offset) */ + ulint zip_size,/*!< in: compressed page size, or 0 */ buf_block_t* block) /*!< in/out: block to init */ { buf_page_t* hash_page; @@ -3027,6 +3041,9 @@ buf_page_init( ut_d(block->page.in_page_hash = TRUE); HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, &block->page); + if (zip_size) { + page_zip_set_size(&block->page.zip, zip_size); + } } /********************************************************************//** @@ -3128,7 +3145,7 @@ err_exit: ut_ad(buf_pool_from_bpage(bpage) == buf_pool); - buf_page_init(buf_pool, space, offset, fold, block); + buf_page_init(buf_pool, space, offset, fold, zip_size, block); /* The block must be put to the LRU list, to the old blocks */ buf_LRU_add_block(bpage, TRUE/* to old blocks */); @@ -3146,8 +3163,6 @@ err_exit: buf_page_set_io_fix(bpage, BUF_IO_READ); if (UNIV_UNLIKELY(zip_size)) { - page_zip_set_size(&block->page.zip, zip_size); - /* buf_pool->mutex may be released and reacquired by buf_buddy_alloc(). Thus, we must release block->mutex in order not to @@ -3240,7 +3255,8 @@ err_exit: HASH_INSERT(buf_page_t, hash, buf_pool->page_hash, fold, bpage); - /* The block must be put to the LRU list, to the old blocks */ + /* The block must be put to the LRU list, to the old blocks + The zip_size is already set into the page zip */ buf_LRU_add_block(bpage, TRUE/* to old blocks */); #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG buf_LRU_insert_zip_clean(bpage); @@ -3284,7 +3300,6 @@ buf_page_create( buf_block_t* block; ulint fold; buf_block_t* free_block = NULL; - ulint time_ms = ut_time_ms(); buf_pool_t* buf_pool = buf_pool_get(space, offset); ut_ad(mtr); @@ -3332,7 +3347,7 @@ buf_page_create( mutex_enter(&block->mutex); - buf_page_init(buf_pool, space, offset, fold, block); + buf_page_init(buf_pool, space, offset, fold, zip_size, block); /* The block must be put to the LRU list */ buf_LRU_add_block(&block->page, FALSE); @@ -3350,8 +3365,6 @@ buf_page_create( buf_page_set_io_fix(&block->page, BUF_IO_READ); rw_lock_x_lock(&block->lock); - - page_zip_set_size(&block->page.zip, zip_size); mutex_exit(&block->mutex); /* buf_pool->mutex may be released and reacquired by buf_buddy_alloc(). Thus, we must release block->mutex @@ -3375,12 +3388,12 @@ buf_page_create( rw_lock_x_unlock(&block->lock); } - buf_page_set_accessed(&block->page, time_ms); - buf_pool_mutex_exit(buf_pool); mtr_memo_push(mtr, block, MTR_MEMO_BUF_FIX); + buf_page_set_accessed(&block->page); + mutex_exit(&block->mutex); /* Delete possible entries for the page from the insert buffer: diff --git a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c index 7cd09d6675e..c385dc793ab 100644 --- a/storage/innobase/buf/buf0flu.c +++ b/storage/innobase/buf/buf0flu.c @@ -79,6 +79,23 @@ static ulint buf_lru_flush_page_count = 0; /* @} */ +/******************************************************************//** +Increases flush_list size in bytes with zip_size for compressed page, +UNIV_PAGE_SIZE for uncompressed page in inline function */ +static inline +void +incr_flush_list_size_in_bytes( +/*==========================*/ + buf_block_t* block, /*!< in: control block */ + buf_pool_t* buf_pool) /*!< in: buffer pool instance */ +{ + ulint zip_size; + ut_ad(buf_flush_list_mutex_own(buf_pool)); + zip_size = page_zip_get_size(&block->page.zip); + buf_pool->stat.flush_list_bytes += zip_size ? zip_size : UNIV_PAGE_SIZE; + ut_ad(buf_pool->stat.flush_list_bytes <= buf_pool->curr_pool_size); +} + #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG /******************************************************************//** Validates the flush list. @@ -308,6 +325,7 @@ buf_flush_insert_into_flush_list( ut_d(block->page.in_flush_list = TRUE); block->page.oldest_modification = lsn; UT_LIST_ADD_FIRST(list, buf_pool->flush_list, &block->page); + incr_flush_list_size_in_bytes(block, buf_pool); #ifdef UNIV_DEBUG_VALGRIND { @@ -412,6 +430,8 @@ buf_flush_insert_sorted_into_flush_list( prev_b, &block->page); } + incr_flush_list_size_in_bytes(block, buf_pool); + #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG ut_a(buf_flush_validate_low(buf_pool)); #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ @@ -504,6 +524,7 @@ buf_flush_remove( buf_page_t* bpage) /*!< in: pointer to the block in question */ { buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); + ulint zip_size; ut_ad(buf_pool_mutex_own(buf_pool)); ut_ad(mutex_own(buf_page_get_mutex(bpage))); @@ -542,6 +563,9 @@ buf_flush_remove( because we assert on in_flush_list in comparison function. */ ut_d(bpage->in_flush_list = FALSE); + zip_size = page_zip_get_size(&bpage->zip); + buf_pool->stat.flush_list_bytes -= zip_size ? zip_size : UNIV_PAGE_SIZE; + bpage->oldest_modification = 0; #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c index 60894cae6ad..b3e282d24b2 100644 --- a/storage/innobase/buf/buf0lru.c +++ b/storage/innobase/buf/buf0lru.c @@ -151,6 +151,23 @@ buf_LRU_block_free_hashed_page( be in a state where it can be freed */ /******************************************************************//** +Increases LRU size in bytes with zip_size for compressed page, +UNIV_PAGE_SIZE for uncompressed page in inline function */ +static inline +void +incr_LRU_size_in_bytes( +/*===================*/ + buf_page_t* bpage, /*!< in: control block */ + buf_pool_t* buf_pool) /*!< in: buffer pool instance */ +{ + ulint zip_size; + ut_ad(buf_pool_mutex_own(buf_pool)); + zip_size = page_zip_get_size(&bpage->zip); + buf_pool->stat.LRU_bytes += zip_size ? zip_size : UNIV_PAGE_SIZE; + ut_ad(buf_pool->stat.LRU_bytes <= buf_pool->curr_pool_size); +} + +/******************************************************************//** Determines if the unzip_LRU list should be used for evicting a victim instead of the general LRU list. @return TRUE if should use unzip_LRU */ @@ -1356,6 +1373,7 @@ buf_LRU_remove_block( buf_page_t* bpage) /*!< in: control block */ { buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); + ulint zip_size; ut_ad(buf_pool); ut_ad(bpage); @@ -1391,6 +1409,9 @@ buf_LRU_remove_block( UT_LIST_REMOVE(LRU, buf_pool->LRU, bpage); ut_d(bpage->in_LRU_list = FALSE); + zip_size = page_zip_get_size(&bpage->zip); + buf_pool->stat.LRU_bytes -= zip_size ? zip_size : UNIV_PAGE_SIZE; + buf_unzip_LRU_remove_block_if_needed(bpage); /* If the LRU list is so short that LRU_old is not defined, @@ -1451,7 +1472,10 @@ buf_unzip_LRU_add_block( } /******************************************************************//** -Adds a block to the LRU list end. */ +Adds a block to the LRU list end. Please make sure that the zip_size is +already set into the page zip when invoking the function, so that we +can get correct zip_size from the buffer page when adding a block +into LRU */ UNIV_INLINE void buf_LRU_add_block_to_end_low( @@ -1470,6 +1494,8 @@ buf_LRU_add_block_to_end_low( UT_LIST_ADD_LAST(LRU, buf_pool->LRU, bpage); ut_d(bpage->in_LRU_list = TRUE); + incr_LRU_size_in_bytes(bpage, buf_pool); + if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) { ut_ad(buf_pool->LRU_old); @@ -1498,7 +1524,10 @@ buf_LRU_add_block_to_end_low( } /******************************************************************//** -Adds a block to the LRU list. */ +Adds a block to the LRU list. Please make sure that the zip_size is +already set into the page zip when invoking the function, so that we +can get correct zip_size from the buffer page when adding a block +into LRU */ UNIV_INLINE void buf_LRU_add_block_low( @@ -1540,6 +1569,8 @@ buf_LRU_add_block_low( ut_d(bpage->in_LRU_list = TRUE); + incr_LRU_size_in_bytes(bpage, buf_pool); + if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) { ut_ad(buf_pool->LRU_old); @@ -1567,7 +1598,10 @@ buf_LRU_add_block_low( } /******************************************************************//** -Adds a block to the LRU list. */ +Adds a block to the LRU list. Please make sure that the zip_size is +already set into the page zip when invoking the function, so that we +can get correct zip_size from the buffer page when adding a block +into LRU */ UNIV_INTERN void buf_LRU_add_block( @@ -1753,6 +1787,8 @@ alloc: UT_LIST_INSERT_AFTER(LRU, buf_pool->LRU, prev_b, b); + incr_LRU_size_in_bytes(b, buf_pool); + if (buf_page_is_old(b)) { buf_pool->LRU_old_len++; if (UNIV_UNLIKELY diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c index 22f0d4456d5..208d013e82d 100644 --- a/storage/innobase/dict/dict0load.c +++ b/storage/innobase/dict/dict0load.c @@ -2328,7 +2328,8 @@ dict_load_foreigns( ibool check_charsets) /*!< in: TRUE=check charset compatibility */ { - char tuple_buf[DTUPLE_EST_ALLOC(1)]; + ulint tuple_buf[(DTUPLE_EST_ALLOC(1) + sizeof(ulint) - 1) + / sizeof(ulint)]; btr_pcur_t pcur; dtuple_t* tuple; dfield_t* dfield; diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c index 8fe33459994..2f875663039 100644 --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -1466,7 +1466,7 @@ fil_space_get_size( ut_ad(fil_system); - fil_mutex_enter_and_prepare_for_io(id); + mutex_enter(&fil_system->mutex); space = fil_space_get_by_id(id); @@ -1481,6 +1481,23 @@ fil_space_get_size( ut_a(1 == UT_LIST_GET_LEN(space->chain)); + mutex_exit(&fil_system->mutex); + + /* It is possible that the space gets evicted at this point + before the fil_mutex_enter_and_prepare_for_io() acquires + the fil_system->mutex. Check for this after completing the + call to fil_mutex_enter_and_prepare_for_io(). */ + fil_mutex_enter_and_prepare_for_io(id); + + /* We are still holding the fil_system->mutex. Check if + the space is still in memory cache. */ + space = fil_space_get_by_id(id); + + if (space == NULL) { + mutex_exit(&fil_system->mutex); + return(0); + } + node = UT_LIST_GET_FIRST(space->chain); /* It must be a single-table tablespace and we have not opened @@ -1518,7 +1535,7 @@ fil_space_get_flags( return(0); } - fil_mutex_enter_and_prepare_for_io(id); + mutex_enter(&fil_system->mutex); space = fil_space_get_by_id(id); @@ -1533,6 +1550,23 @@ fil_space_get_flags( ut_a(1 == UT_LIST_GET_LEN(space->chain)); + mutex_exit(&fil_system->mutex); + + /* It is possible that the space gets evicted at this point + before the fil_mutex_enter_and_prepare_for_io() acquires + the fil_system->mutex. Check for this after completing the + call to fil_mutex_enter_and_prepare_for_io(). */ + fil_mutex_enter_and_prepare_for_io(id); + + /* We are still holding the fil_system->mutex. Check if + the space is still in memory cache. */ + space = fil_space_get_by_id(id); + + if (space == NULL) { + mutex_exit(&fil_system->mutex); + return(0); + } + node = UT_LIST_GET_FIRST(space->chain); /* It must be a single-table tablespace and we have not opened @@ -2702,7 +2736,7 @@ retry: mutex_exit(&fil_system->mutex); #ifndef UNIV_HOTBACKUP - if (success) { + if (success && !recv_recovery_on) { mtr_t mtr; mtr_start(&mtr); @@ -4947,3 +4981,28 @@ fil_close(void) fil_system = NULL; } + +/****************************************************************//** +Generate redo logs for swapping two .ibd files */ +UNIV_INTERN +void +fil_mtr_rename_log( +/*===============*/ + ulint old_space_id, /*!< in: tablespace id of the old + table. */ + const char* old_name, /*!< in: old table name */ + ulint new_space_id, /*!< in: tablespace id of the new + table */ + const char* new_name, /*!< in: new table name */ + const char* tmp_name) /*!< in: temp table name used while + swapping */ +{ + mtr_t mtr; + mtr_start(&mtr); + fil_op_write_log(MLOG_FILE_RENAME, old_space_id, + 0, 0, old_name, tmp_name, &mtr); + fil_op_write_log(MLOG_FILE_RENAME, new_space_id, + 0, 0, new_name, old_name, &mtr); + mtr_commit(&mtr); +} + diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 7c036d3b601..8d433f68d78 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -603,8 +603,12 @@ innobase_commit_low( static SHOW_VAR innodb_status_variables[]= { {"buffer_pool_pages_data", (char*) &export_vars.innodb_buffer_pool_pages_data, SHOW_LONG}, + {"buffer_pool_bytes_data", + (char*) &export_vars.innodb_buffer_pool_bytes_data, SHOW_LONG}, {"buffer_pool_pages_dirty", (char*) &export_vars.innodb_buffer_pool_pages_dirty, SHOW_LONG}, + {"buffer_pool_bytes_dirty", + (char*) &export_vars.innodb_buffer_pool_bytes_dirty, SHOW_LONG}, {"buffer_pool_pages_flushed", (char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG}, {"buffer_pool_pages_free", @@ -695,6 +699,12 @@ static SHOW_VAR innodb_status_variables[]= { (char*) &export_vars.innodb_rows_updated, SHOW_LONG}, {"truncated_status_writes", (char*) &export_vars.innodb_truncated_status_writes, SHOW_LONG}, +#ifdef UNIV_DEBUG + {"purge_trx_id_age", + (char*) &export_vars.innodb_purge_trx_id_age, SHOW_LONG}, + {"purge_view_trx_id_age", + (char*) &export_vars.innodb_purge_view_trx_id_age, SHOW_LONG}, +#endif /* UNIV_DEBUG */ {NullS, NullS, SHOW_LONG} }; @@ -1064,6 +1074,8 @@ convert_error_code_to_mysql( return(HA_ERR_INDEX_CORRUPT); case DB_UNDO_RECORD_TOO_BIG: return(HA_ERR_UNDO_REC_TOO_BIG); + case DB_OUT_OF_MEMORY: + return(HA_ERR_OUT_OF_MEM); } } @@ -1241,16 +1253,6 @@ innobase_get_lower_case_table_names(void) return(lower_case_table_names); } -#if defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN) -extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list; -/*******************************************************************//** -Map an OS error to an errno value. The OS error number is stored in -_doserrno and the mapped value is stored in errno) */ -extern "C" -void __cdecl -_dosmaperr( - unsigned long); /*!< in: OS error value */ - /*********************************************************************//** Creates a temporary file. @return temporary file descriptor, or < 0 on error */ @@ -1259,92 +1261,16 @@ int innobase_mysql_tmpfile(void) /*========================*/ { - int fd; /* handle of opened file */ - HANDLE osfh; /* OS handle of opened file */ - char* tmpdir; /* point to the directory - where to create file */ - TCHAR path_buf[MAX_PATH - 14]; /* buffer for tmp file path. - The length cannot be longer - than MAX_PATH - 14, or - GetTempFileName will fail. */ - char filename[MAX_PATH]; /* name of the tmpfile */ - DWORD fileaccess = GENERIC_READ /* OS file access */ - | GENERIC_WRITE - | DELETE; - DWORD fileshare = FILE_SHARE_READ /* OS file sharing mode */ - | FILE_SHARE_WRITE - | FILE_SHARE_DELETE; - DWORD filecreate = CREATE_ALWAYS; /* OS method of open/create */ - DWORD fileattrib = /* OS file attribute flags */ - FILE_ATTRIBUTE_NORMAL - | FILE_FLAG_DELETE_ON_CLOSE - | FILE_ATTRIBUTE_TEMPORARY - | FILE_FLAG_SEQUENTIAL_SCAN; - - DBUG_ENTER("innobase_mysql_tmpfile"); - - tmpdir = my_tmpdir(&mysql_tmpdir_list); - - /* The tmpdir parameter can not be NULL for GetTempFileName. */ - if (!tmpdir) { - uint ret; - - /* Use GetTempPath to determine path for temporary files. */ - ret = GetTempPath(sizeof(path_buf), path_buf); - if (ret > sizeof(path_buf) || (ret == 0)) { - - _dosmaperr(GetLastError()); /* map error */ - DBUG_RETURN(-1); - } - - tmpdir = path_buf; - } - - /* Use GetTempFileName to generate a unique filename. */ - if (!GetTempFileName(tmpdir, "ib", 0, filename)) { - - _dosmaperr(GetLastError()); /* map error */ - DBUG_RETURN(-1); - } - - DBUG_PRINT("info", ("filename: %s", filename)); - - /* Open/Create the file. */ - osfh = CreateFile(filename, fileaccess, fileshare, NULL, - filecreate, fileattrib, NULL); - if (osfh == INVALID_HANDLE_VALUE) { - - /* open/create file failed! */ - _dosmaperr(GetLastError()); /* map error */ - DBUG_RETURN(-1); - } - - do { - /* Associates a CRT file descriptor with the OS file handle. */ - fd = _open_osfhandle((intptr_t) osfh, 0); - } while (fd == -1 && errno == EINTR); + int fd2 = -1; + File fd; - if (fd == -1) { - /* Open failed, close the file handle. */ + DBUG_EXECUTE_IF( + "innobase_tmpfile_creation_failure", + return(-1); + ); - _dosmaperr(GetLastError()); /* map error */ - CloseHandle(osfh); /* no need to check if - CloseHandle fails */ - } + fd = mysql_tmpfile("ib"); - DBUG_RETURN(fd); -} -#else -/*********************************************************************//** -Creates a temporary file. -@return temporary file descriptor, or < 0 on error */ -extern "C" UNIV_INTERN -int -innobase_mysql_tmpfile(void) -/*========================*/ -{ - int fd2 = -1; - File fd = mysql_tmpfile("ib"); if (fd >= 0) { /* Copy the file descriptor, so that the additional resources allocated by create_temp_file() can be freed by invoking @@ -1388,7 +1314,6 @@ innobase_mysql_tmpfile(void) } return(fd2); } -#endif /* defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN) */ /*********************************************************************//** Wrapper around MySQL's copy_and_convert function. @@ -11773,13 +11698,30 @@ static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold, "trigger a readahead.", NULL, NULL, 56, 0, 64, 0); -#ifdef UNIV_DEBUG_never +#ifdef UNIV_DEBUG static MYSQL_SYSVAR_UINT(trx_rseg_n_slots_debug, trx_rseg_n_slots_debug, - PLUGIN_VAR_RQCMDARG, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_NOCMDOPT, "Debug flags for InnoDB to limit TRX_RSEG_N_SLOTS for trx_rsegf_undo_find_free()", NULL, NULL, 0, 0, 1024, 0); + +static MYSQL_SYSVAR_UINT(limit_optimistic_insert_debug, + btr_cur_limit_optimistic_insert_debug, PLUGIN_VAR_RQCMDARG, + "Artificially limit the number of records per B-tree page (0=unlimited).", + NULL, NULL, 0, 0, UINT_MAX32, 0); + +static MYSQL_SYSVAR_BOOL(trx_purge_view_update_only_debug, + srv_purge_view_update_only_debug, PLUGIN_VAR_NOCMDOPT, + "Pause actual purging any delete-marked records, but merely update the purge view. " + "It is to create artificially the situation the purge view have been updated " + "but the each purges were not done yet.", + NULL, NULL, FALSE); #endif /* UNIV_DEBUG */ +static MYSQL_SYSVAR_BOOL(print_all_deadlocks, srv_print_all_deadlocks, + PLUGIN_VAR_OPCMDARG, + "Print all deadlocks to MySQL error log (off by default)", + NULL, NULL, FALSE); + static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(autoextend_increment), @@ -11849,9 +11791,12 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(purge_threads), MYSQL_SYSVAR(purge_batch_size), MYSQL_SYSVAR(rollback_segments), -#ifdef UNIV_DEBUG_never /* disable this flag. --innodb-trx becomes ambiguous */ +#ifdef UNIV_DEBUG MYSQL_SYSVAR(trx_rseg_n_slots_debug), + MYSQL_SYSVAR(limit_optimistic_insert_debug), + MYSQL_SYSVAR(trx_purge_view_update_only_debug), #endif /* UNIV_DEBUG */ + MYSQL_SYSVAR(print_all_deadlocks), NULL }; diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 451e37f2136..cdd5078c262 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -101,8 +101,6 @@ innobase_col_to_mysql( ut_ad(flen >= len); ut_ad(DATA_MBMAXLEN(col->mbminmaxlen) >= DATA_MBMINLEN(col->mbminmaxlen)); - ut_ad(DATA_MBMAXLEN(col->mbminmaxlen) - > DATA_MBMINLEN(col->mbminmaxlen) || flen == len); memcpy(dest, data, len); break; diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 6819f2bc2c5..283a6eec852 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -805,6 +805,11 @@ srv_printf_innodb_monitor(). */ extern ulint btr_cur_n_sea_old; #endif /* !UNIV_HOTBACKUP */ +#ifdef UNIV_DEBUG +/* Flag to limit optimistic insert records */ +extern uint btr_cur_limit_optimistic_insert_debug; +#endif /* UNIV_DEBUG */ + #ifndef UNIV_NONINL #include "btr0cur.ic" #endif diff --git a/storage/innobase/include/btr0cur.ic b/storage/innobase/include/btr0cur.ic index e31f77c77eb..5fc4651ca13 100644 --- a/storage/innobase/include/btr0cur.ic +++ b/storage/innobase/include/btr0cur.ic @@ -27,6 +27,16 @@ Created 10/16/1994 Heikki Tuuri #include "btr0btr.h" #ifdef UNIV_DEBUG +# define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE)\ +if (btr_cur_limit_optimistic_insert_debug\ + && (NREC) >= (ulint)btr_cur_limit_optimistic_insert_debug) {\ + CODE;\ +} +#else +# define LIMIT_OPTIMISTIC_INSERT_DEBUG(NREC, CODE) +#endif /* UNIV_DEBUG */ + +#ifdef UNIV_DEBUG /*********************************************************//** Returns the page cursor component of a tree cursor. @return pointer to page cursor component */ @@ -146,6 +156,9 @@ btr_cur_compress_recommendation( page = btr_cur_get_page(cursor); + LIMIT_OPTIMISTIC_INSERT_DEBUG(page_get_n_recs(page) * 2, + return(FALSE)); + if ((page_get_data_size(page) < BTR_CUR_PAGE_COMPRESS_LIMIT) || ((btr_page_get_next(page, mtr) == FIL_NULL) && (btr_page_get_prev(page, mtr) == FIL_NULL))) { diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index fd8620eab3b..b7f6eae3f09 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -198,6 +198,15 @@ struct buf_pool_info_struct{ typedef struct buf_pool_info_struct buf_pool_info_t; +/** The occupied bytes of lists in all buffer pools */ +struct buf_pools_list_size_struct { + ulint LRU_bytes; /*!< LRU size in bytes */ + ulint unzip_LRU_bytes; /*!< unzip_LRU size in bytes */ + ulint flush_list_bytes; /*!< flush_list size in bytes */ +}; + +typedef struct buf_pools_list_size_struct buf_pools_list_size_t; + #ifndef UNIV_HOTBACKUP /********************************************************************//** Acquire mutex on all buffer pool instances */ @@ -1024,8 +1033,7 @@ UNIV_INLINE void buf_page_set_accessed( /*==================*/ - buf_page_t* bpage, /*!< in/out: control block */ - ulint time_ms) /*!< in: ut_time_ms() */ + buf_page_t* bpage) /*!< in/out: control block */ __attribute__((nonnull)); /*********************************************************************//** Gets the buf_block_t handle of a buffered file block if an uncompressed @@ -1334,6 +1342,14 @@ buf_get_total_list_len( ulint* free_len, /*!< out: length of all free lists */ ulint* flush_list_len);/*!< out: length of all flush lists */ /********************************************************************//** +Get total list size in bytes from all buffer pools. */ +UNIV_INTERN +void +buf_get_total_list_size_in_bytes( +/*=============================*/ + buf_pools_list_size_t* buf_pools_list_size); /*!< out: list sizes + in all buffer pools */ +/********************************************************************//** Get total buffer pool statistics. */ UNIV_INTERN void @@ -1504,10 +1520,11 @@ struct buf_page_struct{ to read this for heuristic purposes without holding any mutex or latch */ - unsigned access_time:32; /*!< time of first access, or - 0 if the block was never accessed - in the buffer pool */ /* @} */ + unsigned access_time; /*!< time of first access, or + 0 if the block was never accessed + in the buffer pool. Protected by + block mutex */ # if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG ibool file_page_was_freed; /*!< this is set to TRUE when fsp @@ -1685,6 +1702,8 @@ struct buf_pool_stat_struct{ young because the first access was not long enough ago, in buf_page_peek_if_too_old() */ + ulint LRU_bytes; /*!< LRU size in bytes */ + ulint flush_list_bytes;/*!< flush_list size in bytes */ }; /** Statistics of buddy blocks of a given size. */ diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 84c0ab9d610..bcbe454b037 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -614,18 +614,18 @@ UNIV_INLINE void buf_page_set_accessed( /*==================*/ - buf_page_t* bpage, /*!< in/out: control block */ - ulint time_ms) /*!< in: ut_time_ms() */ + buf_page_t* bpage) /*!< in/out: control block */ { #ifdef UNIV_DEBUG buf_pool_t* buf_pool = buf_pool_from_bpage(bpage); - ut_ad(buf_pool_mutex_own(buf_pool)); + ut_ad(!buf_pool_mutex_own(buf_pool)); + ut_ad(mutex_own(buf_page_get_mutex(bpage))); #endif ut_a(buf_page_in_file(bpage)); if (!bpage->access_time) { /* Make this the time of the first access. */ - bpage->access_time = time_ms; + bpage->access_time = ut_time_ms(); } } diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h index 9ecb9de2afe..0e08f455800 100644 --- a/storage/innobase/include/buf0lru.h +++ b/storage/innobase/include/buf0lru.h @@ -149,7 +149,10 @@ buf_LRU_block_free_non_file_page( /*=============================*/ buf_block_t* block); /*!< in: block, must not contain a file page */ /******************************************************************//** -Adds a block to the LRU list. */ +Adds a block to the LRU list. Please make sure that the zip_size is +already set into the page zip when invoking the function, so that we +can get correct zip_size from the buffer page when adding a block +into LRU */ UNIV_INTERN void buf_LRU_add_block( diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index 757dd815c5e..7ec2cb6cf36 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved. +Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -459,36 +459,18 @@ dtype_get_fixed_size_low( } else if (!comp) { return(len); } else { - /* We play it safe here and ask MySQL for - mbminlen and mbmaxlen. Although - mbminlen and mbmaxlen are - initialized if and only if prtype - is (in one of the 3 functions in this file), - it could be that none of these functions - has been called. */ - +#ifdef UNIV_DEBUG ulint i_mbminlen, i_mbmaxlen; innobase_get_cset_width( dtype_get_charset_coll(prtype), &i_mbminlen, &i_mbmaxlen); - if (UNIV_UNLIKELY - (DATA_MBMINMAXLEN(i_mbminlen, i_mbmaxlen) - != mbminmaxlen)) { - - ut_print_timestamp(stderr); - fprintf(stderr, " InnoDB: " - "mbminlen=%lu, " - "mbmaxlen=%lu, " - "type->mbminlen=%lu, " - "type->mbmaxlen=%lu\n", - (ulong) i_mbminlen, - (ulong) i_mbmaxlen, - (ulong) DATA_MBMINLEN(mbminmaxlen), - (ulong) DATA_MBMAXLEN(mbminmaxlen)); - } - if (i_mbminlen == i_mbmaxlen) { + ut_ad(DATA_MBMINMAXLEN(i_mbminlen, i_mbmaxlen) + == mbminmaxlen); +#endif /* UNIV_DEBUG */ + if (DATA_MBMINLEN(mbminmaxlen) + == DATA_MBMAXLEN(mbminmaxlen)) { return(len); } } diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index ed47ccff052..a804c261447 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -734,6 +734,21 @@ fil_tablespace_is_being_deleted( /*============================*/ ulint id); /*!< in: space id */ +/****************************************************************//** +Generate redo logs for swapping two .ibd files */ +UNIV_INTERN +void +fil_mtr_rename_log( +/*===============*/ + ulint old_space_id, /*!< in: tablespace id of the old + table. */ + const char* old_name, /*!< in: old table name */ + ulint new_space_id, /*!< in: tablespace id of the new + table */ + const char* new_name, /*!< in: new table name */ + const char* tmp_name); /*!< in: temp table name used while + swapping */ + typedef struct fil_space_struct fil_space_t; #endif diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index 29fdc3bbe97..b2a622296e0 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -797,14 +797,22 @@ lock_rec_get_page_no( remains set when the waiting lock is granted, or if the lock is inherited to a neighboring record */ -#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION)&LOCK_MODE_MASK +#define LOCK_CONV_BY_OTHER 4096 /*!< this bit is set when the lock is created + by other transaction */ +#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION|LOCK_CONV_BY_OTHER)&LOCK_MODE_MASK # error #endif -#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION)&LOCK_TYPE_MASK +#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION|LOCK_CONV_BY_OTHER)&LOCK_TYPE_MASK # error #endif /* @} */ +/** Checks if this is a waiting lock created by lock->trx itself. +@param type_mode lock->type_mode +@return whether it is a waiting lock belonging to lock->trx */ +#define lock_is_wait_not_by_other(type_mode) \ + ((type_mode & (LOCK_CONV_BY_OTHER | LOCK_WAIT)) == LOCK_WAIT) + /** Lock operation struct */ typedef struct lock_op_struct lock_op_t; /** Lock operation struct */ diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h index 10b74d18c13..98bf889b996 100644 --- a/storage/innobase/include/rem0rec.h +++ b/storage/innobase/include/rem0rec.h @@ -362,24 +362,6 @@ rec_get_offsets_func( rec_get_offsets_func(rec,index,offsets,n,heap,__FILE__,__LINE__) /******************************************************//** -Determine the offset to each field in a leaf-page record -in ROW_FORMAT=COMPACT. This is a special case of -rec_init_offsets() and rec_get_offsets_func(). */ -UNIV_INTERN -void -rec_init_offsets_comp_ordinary( -/*===========================*/ - const rec_t* rec, /*!< in: physical record in - ROW_FORMAT=COMPACT */ - ulint extra, /*!< in: number of bytes to reserve - between the record header and - the data payload - (usually REC_N_NEW_EXTRA_BYTES) */ - const dict_index_t* index, /*!< in: record descriptor */ - ulint* offsets);/*!< in/out: array of offsets; - in: n=rec_offs_n_fields(offsets) */ - -/******************************************************//** The following function determines the offsets to each field in the record. It can reuse a previously allocated array. */ UNIV_INTERN @@ -644,8 +626,48 @@ rec_copy( /*=====*/ void* buf, /*!< in: buffer */ const rec_t* rec, /*!< in: physical record */ - const ulint* offsets);/*!< in: array returned by rec_get_offsets() */ + const ulint* offsets)/*!< in: array returned by rec_get_offsets() */ + __attribute__((nonnull)); #ifndef UNIV_HOTBACKUP +/**********************************************************//** +Determines the size of a data tuple prefix in a temporary file. +@return total size */ +UNIV_INTERN +ulint +rec_get_converted_size_temp( +/*========================*/ + const dict_index_t* index, /*!< in: record descriptor */ + const dfield_t* fields, /*!< in: array of data fields */ + ulint n_fields,/*!< in: number of data fields */ + ulint* extra) /*!< out: extra size */ + __attribute__((warn_unused_result, nonnull)); + +/******************************************************//** +Determine the offset to each field in temporary file. +@see rec_convert_dtuple_to_temp() */ +UNIV_INTERN +void +rec_init_offsets_temp( +/*==================*/ + const rec_t* rec, /*!< in: temporary file record */ + const dict_index_t* index, /*!< in: record descriptor */ + ulint* offsets)/*!< in/out: array of offsets; + in: n=rec_offs_n_fields(offsets) */ + __attribute__((nonnull)); + +/*********************************************************//** +Builds a temporary file record out of a data tuple. +@see rec_init_offsets_temp() */ +UNIV_INTERN +void +rec_convert_dtuple_to_temp( +/*=======================*/ + rec_t* rec, /*!< out: record */ + const dict_index_t* index, /*!< in: record descriptor */ + const dfield_t* fields, /*!< in: array of data fields */ + ulint n_fields) /*!< in: number of fields */ + __attribute__((nonnull)); + /**************************************************************//** Copies the first n fields of a physical record to a new physical record in a buffer. @@ -680,21 +702,6 @@ rec_fold( __attribute__((pure)); #endif /* !UNIV_HOTBACKUP */ /*********************************************************//** -Builds a ROW_FORMAT=COMPACT record out of a data tuple. */ -UNIV_INTERN -void -rec_convert_dtuple_to_rec_comp( -/*===========================*/ - rec_t* rec, /*!< in: origin of record */ - ulint extra, /*!< in: number of bytes to - reserve between the record - header and the data payload - (normally REC_N_NEW_EXTRA_BYTES) */ - const dict_index_t* index, /*!< in: record descriptor */ - ulint status, /*!< in: status bits of the record */ - const dfield_t* fields, /*!< in: array of data fields */ - ulint n_fields);/*!< in: number of data fields */ -/*********************************************************//** Builds a physical record out of a data tuple and stores it into the given buffer. @return pointer to the origin of physical record */ @@ -727,10 +734,7 @@ UNIV_INTERN ulint rec_get_converted_size_comp_prefix( /*===============================*/ - const dict_index_t* index, /*!< in: record descriptor; - dict_table_is_comp() is - assumed to hold, even if - it does not */ + const dict_index_t* index, /*!< in: record descriptor */ const dfield_t* fields, /*!< in: array of data fields */ ulint n_fields,/*!< in: number of data fields */ ulint* extra); /*!< out: extra size */ diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 5290ef5fe11..e2d061969f3 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -265,6 +265,10 @@ extern ulint srv_fatal_semaphore_wait_threshold; #define SRV_SEMAPHORE_WAIT_EXTENSION 7200 extern ulint srv_dml_needed_delay; +#ifdef UNIV_DEBUG +extern my_bool srv_purge_view_update_only_debug; +#endif /* UNIV_DEBUG */ + extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, query threads, and lock table: we allocate it from dynamic memory to get it to the @@ -333,6 +337,9 @@ extern ulint srv_buf_pool_flushed; reading of a disk page */ extern ulint srv_buf_pool_reads; +/** print all user-level transactions deadlocks to mysqld stderr */ +extern my_bool srv_print_all_deadlocks; + /** Status variables to be passed to MySQL */ typedef struct export_var_struct export_struc; @@ -700,7 +707,9 @@ struct export_var_struct{ ulint innodb_data_reads; /*!< I/O read requests */ ulint innodb_buffer_pool_pages_total; /*!< Buffer pool size */ ulint innodb_buffer_pool_pages_data; /*!< Data pages */ + ulint innodb_buffer_pool_bytes_data; /*!< File bytes used */ ulint innodb_buffer_pool_pages_dirty; /*!< Dirty data pages */ + ulint innodb_buffer_pool_bytes_dirty; /*!< File bytes modified */ ulint innodb_buffer_pool_pages_misc; /*!< Miscellanous pages */ ulint innodb_buffer_pool_pages_free; /*!< Free pages */ #ifdef UNIV_DEBUG @@ -742,6 +751,11 @@ struct export_var_struct{ ulint innodb_rows_updated; /*!< srv_n_rows_updated */ ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */ ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */ +#ifdef UNIV_DEBUG + ulint innodb_purge_trx_id_age; /*!< max_trx_id - purged trx_id */ + ulint innodb_purge_view_trx_id_age; /*!< rw_max_trx_id + - purged view's min trx_id */ +#endif /* UNIV_DEBUG */ }; /** Thread slot in the thread table */ diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h index 2bd9e64476b..1e8acd65e01 100644 --- a/storage/innobase/include/trx0purge.h +++ b/storage/innobase/include/trx0purge.h @@ -156,6 +156,10 @@ struct trx_purge_struct{ than this */ undo_no_t purge_undo_no; /*!< Purge has advanced past all records whose undo number is less than this */ +#ifdef UNIV_DEBUG + trx_id_t done_trx_no; /* Indicate 'purge pointer' which have + purged already accurately. */ +#endif /* UNIV_DEBUG */ /*-----------------------------*/ ibool next_stored; /*!< TRUE if the info of the next record to purge is stored below: if yes, then diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index 0b0b4b8d04c..800f4359c8a 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -49,9 +49,10 @@ Created 1/20/1994 Heikki Tuuri #define _IB_TO_STR(s) #s #define IB_TO_STR(s) _IB_TO_STR(s) -#define INNODB_VERSION_MAJOR 1 -#define INNODB_VERSION_MINOR 1 -#define INNODB_VERSION_BUGFIX 8 +#include <mysql_version.h> + +#define INNODB_VERSION_MAJOR MYSQL_MAJOR_VERSION +#define INNODB_VERSION_MINOR MYSQL_MINOR_VERSION /* The following is the InnoDB version as shown in SELECT plugin_version FROM information_schema.plugins; @@ -62,10 +63,7 @@ component, i.e. we show M.N.P as M.N */ #define INNODB_VERSION_SHORT \ (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR) -#define INNODB_VERSION_STR \ - IB_TO_STR(INNODB_VERSION_MAJOR) "." \ - IB_TO_STR(INNODB_VERSION_MINOR) "." \ - IB_TO_STR(INNODB_VERSION_BUGFIX) +#define INNODB_VERSION_STR MYSQL_SERVER_VERSION #define REFMAN "http://dev.mysql.com/doc/refman/" \ IB_TO_STR(MYSQL_MAJOR_VERSION) "." \ diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index 66ec18aeee7..a72be540c1b 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -789,12 +789,16 @@ lock_reset_lock_and_trx_wait( /*=========================*/ lock_t* lock) /*!< in: record lock */ { - ut_ad((lock->trx)->wait_lock == lock); ut_ad(lock_get_wait(lock)); /* Reset the back pointer in trx to this waiting lock request */ - (lock->trx)->wait_lock = NULL; + if (!(lock->type_mode & LOCK_CONV_BY_OTHER)) { + ut_ad((lock->trx)->wait_lock == lock); + (lock->trx)->wait_lock = NULL; + } else { + ut_ad(lock_get_type_low(lock) == LOCK_REC); + } lock->type_mode &= ~LOCK_WAIT; } @@ -1430,9 +1434,9 @@ lock_rec_has_expl( while (lock) { if (lock->trx == trx + && !lock_is_wait_not_by_other(lock->type_mode) && lock_mode_stronger_or_eq(lock_get_mode(lock), precise_mode & LOCK_MODE_MASK) - && !lock_get_wait(lock) && (!lock_rec_get_rec_not_gap(lock) || (precise_mode & LOCK_REC_NOT_GAP) || heap_no == PAGE_HEAP_NO_SUPREMUM) @@ -1730,7 +1734,7 @@ lock_rec_create( HASH_INSERT(lock_t, hash, lock_sys->rec_hash, lock_rec_fold(space, page_no), lock); - if (UNIV_UNLIKELY(type_mode & LOCK_WAIT)) { + if (lock_is_wait_not_by_other(type_mode)) { lock_set_lock_and_trx_wait(lock, trx); } @@ -1761,10 +1765,11 @@ lock_rec_enqueue_waiting( const buf_block_t* block, /*!< in: buffer block containing the record */ ulint heap_no,/*!< in: heap number of the record */ + lock_t* lock, /*!< in: lock object; NULL if a new + one should be created. */ dict_index_t* index, /*!< in: index of record */ que_thr_t* thr) /*!< in: query thread */ { - lock_t* lock; trx_t* trx; ut_ad(mutex_own(&kernel_mutex)); @@ -1799,9 +1804,17 @@ lock_rec_enqueue_waiting( ut_ad(0); } - /* Enqueue the lock request that will wait to be granted */ - lock = lock_rec_create(type_mode | LOCK_WAIT, - block, heap_no, index, trx); + if (lock == NULL) { + /* Enqueue the lock request that will wait to be granted */ + lock = lock_rec_create(type_mode | LOCK_WAIT, + block, heap_no, index, trx); + } else { + ut_ad(lock->type_mode & LOCK_WAIT); + ut_ad(lock->type_mode & LOCK_CONV_BY_OTHER); + + lock->type_mode &= ~LOCK_CONV_BY_OTHER; + lock_set_lock_and_trx_wait(lock, trx); + } /* Check if a deadlock occurs: if yes, remove the lock request and return an error code */ @@ -2046,6 +2059,7 @@ lock_rec_lock_slow( que_thr_t* thr) /*!< in: query thread */ { trx_t* trx; + lock_t* lock; ut_ad(mutex_own(&kernel_mutex)); ut_ad((LOCK_MODE_MASK & mode) != LOCK_S @@ -2060,7 +2074,27 @@ lock_rec_lock_slow( trx = thr_get_trx(thr); - if (lock_rec_has_expl(mode, block, heap_no, trx)) { + lock = lock_rec_has_expl(mode, block, heap_no, trx); + if (lock) { + if (lock->type_mode & LOCK_CONV_BY_OTHER) { + /* This lock or lock waiting was created by the other + transaction, not by the transaction (trx) itself. + So, the transaction (trx) should treat it collectly + according as whether granted or not. */ + + if (lock->type_mode & LOCK_WAIT) { + /* This lock request was not granted yet. + Should wait for granted. */ + + goto enqueue_waiting; + } else { + /* This lock request was already granted. + Just clearing the flag. */ + + lock->type_mode &= ~LOCK_CONV_BY_OTHER; + } + } + /* The trx already has a strong enough lock on rec: do nothing */ @@ -2070,8 +2104,10 @@ lock_rec_lock_slow( the queue, as this transaction does not have a lock strong enough already granted on the record, we have to wait. */ + ut_ad(lock == NULL); +enqueue_waiting: return(lock_rec_enqueue_waiting(mode, block, heap_no, - index, thr)); + lock, index, thr)); } else if (!impl) { /* Set the requested lock on the record */ @@ -2213,7 +2249,8 @@ lock_grant( TRX_QUE_LOCK_WAIT state, and there is no need to end the lock wait for it */ - if (lock->trx->que_state == TRX_QUE_LOCK_WAIT) { + if (!(lock->type_mode & LOCK_CONV_BY_OTHER) + && lock->trx->que_state == TRX_QUE_LOCK_WAIT) { trx_end_lock_wait(lock->trx); } } @@ -2230,6 +2267,7 @@ lock_rec_cancel( { ut_ad(mutex_own(&kernel_mutex)); ut_ad(lock_get_type_low(lock) == LOCK_REC); + ut_ad(!(lock->type_mode & LOCK_CONV_BY_OTHER)); /* Reset the bit (there can be only one set bit) in the lock bitmap */ lock_rec_reset_nth_bit(lock, lock_rec_find_set_bit(lock)); @@ -2372,8 +2410,12 @@ lock_rec_reset_and_release_wait( lock = lock_rec_get_first(block, heap_no); while (lock != NULL) { - if (lock_get_wait(lock)) { + if (lock_is_wait_not_by_other(lock->type_mode)) { lock_rec_cancel(lock); + } else if (lock_get_wait(lock)) { + /* just reset LOCK_WAIT */ + lock_rec_reset_nth_bit(lock, heap_no); + lock_reset_lock_and_trx_wait(lock); } else { lock_rec_reset_nth_bit(lock, heap_no); } @@ -3261,6 +3303,80 @@ lock_rec_restore_from_page_infimum( /*=========== DEADLOCK CHECKING ======================================*/ +/*********************************************************************//** +rewind(3) the file used for storing the latest detected deadlock and +print a heading message to stderr if printing of all deadlocks to stderr +is enabled. */ +UNIV_INLINE +void +lock_deadlock_start_print() +/*=======================*/ +{ + rewind(lock_latest_err_file); + ut_print_timestamp(lock_latest_err_file); + + if (srv_print_all_deadlocks) { + fprintf(stderr, "InnoDB: transactions deadlock detected, " + "dumping detailed information.\n"); + ut_print_timestamp(stderr); + } +} + +/*********************************************************************//** +Print a message to the deadlock file and possibly to stderr. */ +UNIV_INLINE +void +lock_deadlock_fputs( +/*================*/ + const char* msg) /*!< in: message to print */ +{ + fputs(msg, lock_latest_err_file); + + if (srv_print_all_deadlocks) { + fputs(msg, stderr); + } +} + +/*********************************************************************//** +Print transaction data to the deadlock file and possibly to stderr. */ +UNIV_INLINE +void +lock_deadlock_trx_print( +/*====================*/ + trx_t* trx, /*!< in: transaction */ + ulint max_query_len) /*!< in: max query length to print, or 0 to + use the default max length */ +{ + trx_print(lock_latest_err_file, trx, max_query_len); + + if (srv_print_all_deadlocks) { + trx_print(stderr, trx, max_query_len); + } +} + +/*********************************************************************//** +Print lock data to the deadlock file and possibly to stderr. */ +UNIV_INLINE +void +lock_deadlock_lock_print( +/*=====================*/ + const lock_t* lock) /*!< in: record or table type lock */ +{ + if (lock_get_type_low(lock) == LOCK_REC) { + lock_rec_print(lock_latest_err_file, lock); + + if (srv_print_all_deadlocks) { + lock_rec_print(stderr, lock); + } + } else { + lock_table_print(lock_latest_err_file, lock); + + if (srv_print_all_deadlocks) { + lock_table_print(stderr, lock); + } + } +} + /********************************************************************//** Checks if a lock request results in a deadlock. @return TRUE if a deadlock was detected and we chose trx as a victim; @@ -3304,30 +3420,25 @@ retry: /* If the lock search exceeds the max step or the max depth, the current trx will be the victim. Print its information. */ - rewind(lock_latest_err_file); - ut_print_timestamp(lock_latest_err_file); + lock_deadlock_start_print(); - fputs("TOO DEEP OR LONG SEARCH IN THE LOCK TABLE" - " WAITS-FOR GRAPH, WE WILL ROLL BACK" - " FOLLOWING TRANSACTION \n", - lock_latest_err_file); + lock_deadlock_fputs( + "TOO DEEP OR LONG SEARCH IN THE LOCK TABLE" + " WAITS-FOR GRAPH, WE WILL ROLL BACK" + " FOLLOWING TRANSACTION \n\n" + "*** TRANSACTION:\n"); - fputs("\n*** TRANSACTION:\n", lock_latest_err_file); - trx_print(lock_latest_err_file, trx, 3000); + lock_deadlock_trx_print(trx, 3000); - fputs("*** WAITING FOR THIS LOCK TO BE GRANTED:\n", - lock_latest_err_file); + lock_deadlock_fputs( + "*** WAITING FOR THIS LOCK TO BE GRANTED:\n"); + + lock_deadlock_lock_print(lock); - if (lock_get_type(lock) == LOCK_REC) { - lock_rec_print(lock_latest_err_file, lock); - } else { - lock_table_print(lock_latest_err_file, lock); - } break; case LOCK_VICTIM_IS_START: - fputs("*** WE ROLL BACK TRANSACTION (2)\n", - lock_latest_err_file); + lock_deadlock_fputs("*** WE ROLL BACK TRANSACTION (2)\n"); break; default: @@ -3442,45 +3553,33 @@ lock_deadlock_recursive( point: a deadlock detected; or we have searched the waits-for graph too long */ - FILE* ef = lock_latest_err_file; + lock_deadlock_start_print(); - rewind(ef); - ut_print_timestamp(ef); + lock_deadlock_fputs("\n*** (1) TRANSACTION:\n"); - fputs("\n*** (1) TRANSACTION:\n", ef); + lock_deadlock_trx_print(wait_lock->trx, 3000); - trx_print(ef, wait_lock->trx, 3000); + lock_deadlock_fputs( + "*** (1) WAITING FOR THIS LOCK" + " TO BE GRANTED:\n"); - fputs("*** (1) WAITING FOR THIS LOCK" - " TO BE GRANTED:\n", ef); + lock_deadlock_lock_print(wait_lock); - if (lock_get_type_low(wait_lock) == LOCK_REC) { - lock_rec_print(ef, wait_lock); - } else { - lock_table_print(ef, wait_lock); - } + lock_deadlock_fputs("*** (2) TRANSACTION:\n"); - fputs("*** (2) TRANSACTION:\n", ef); + lock_deadlock_trx_print(lock->trx, 3000); - trx_print(ef, lock->trx, 3000); + lock_deadlock_fputs( + "*** (2) HOLDS THE LOCK(S):\n"); - fputs("*** (2) HOLDS THE LOCK(S):\n", ef); + lock_deadlock_lock_print(lock); - if (lock_get_type_low(lock) == LOCK_REC) { - lock_rec_print(ef, lock); - } else { - lock_table_print(ef, lock); - } + lock_deadlock_fputs( + "*** (2) WAITING FOR THIS LOCK" + " TO BE GRANTED:\n"); - fputs("*** (2) WAITING FOR THIS LOCK" - " TO BE GRANTED:\n", ef); + lock_deadlock_lock_print(start->wait_lock); - if (lock_get_type_low(start->wait_lock) - == LOCK_REC) { - lock_rec_print(ef, start->wait_lock); - } else { - lock_table_print(ef, start->wait_lock); - } #ifdef UNIV_DEBUG if (lock_print_waits) { fputs("Deadlock detected\n", @@ -3503,8 +3602,8 @@ lock_deadlock_recursive( as a victim to try to avoid deadlocking our recursion starting point transaction */ - fputs("*** WE ROLL BACK TRANSACTION (1)\n", - ef); + lock_deadlock_fputs( + "*** WE ROLL BACK TRANSACTION (1)\n"); wait_lock->trx->was_chosen_as_deadlock_victim = TRUE; @@ -3589,6 +3688,7 @@ lock_table_create( ut_ad(table && trx); ut_ad(mutex_own(&kernel_mutex)); + ut_ad(!(type_mode & LOCK_CONV_BY_OTHER)); if ((type_mode & LOCK_MODE_MASK) == LOCK_AUTO_INC) { ++table->n_waiting_or_granted_auto_inc_locks; @@ -4142,6 +4242,7 @@ lock_cancel_waiting_and_release( lock_t* lock) /*!< in: waiting lock request */ { ut_ad(mutex_own(&kernel_mutex)); + ut_ad(!(lock->type_mode & LOCK_CONV_BY_OTHER)); if (lock_get_type_low(lock) == LOCK_REC) { @@ -5183,7 +5284,7 @@ lock_rec_insert_check_and_lock( err = lock_rec_enqueue_waiting(LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION, block, next_rec_heap_no, - index, thr); + NULL, index, thr); } else { err = DB_SUCCESS; } @@ -5259,10 +5360,23 @@ lock_rec_convert_impl_to_expl( if (!lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP, block, heap_no, impl_trx)) { + ulint type_mode = (LOCK_REC | LOCK_X + | LOCK_REC_NOT_GAP); + + /* If the delete-marked record was locked already, + we should reserve lock waiting for impl_trx as + implicit lock. Because cannot lock at this moment.*/ + + if (rec_get_deleted_flag(rec, rec_offs_comp(offsets)) + && lock_rec_other_has_conflicting( + LOCK_X | LOCK_REC_NOT_GAP, block, + heap_no, impl_trx)) { + + type_mode |= (LOCK_WAIT | LOCK_CONV_BY_OTHER); + } lock_rec_add_to_queue( - LOCK_REC | LOCK_X | LOCK_REC_NOT_GAP, - block, heap_no, index, impl_trx); + type_mode, block, heap_no, index, impl_trx); } } } diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c index 03ba4d12cd0..c4ad94a4906 100644 --- a/storage/innobase/log/log0recv.c +++ b/storage/innobase/log/log0recv.c @@ -965,8 +965,11 @@ recv_parse_or_apply_log_rec_body( not NULL, then the log record is applied to the page, and the log record should be complete then */ - mtr_t* mtr) /*!< in: mtr or NULL; should be non-NULL + mtr_t* mtr, /*!< in: mtr or NULL; should be non-NULL if and only if block is non-NULL */ + ulint space_id) + /*!< in: tablespace id obtained by + parsing initial log record */ { dict_index_t* index = NULL; page_t* page; @@ -1238,8 +1241,11 @@ recv_parse_or_apply_log_rec_body( ut_ad(!page || page_type != FIL_PAGE_TYPE_ALLOCATED); ptr = mlog_parse_string(ptr, end_ptr, page, page_zip); break; - case MLOG_FILE_CREATE: case MLOG_FILE_RENAME: + ptr = fil_op_log_parse_or_replay(ptr, end_ptr, type, + space_id, 0); + break; + case MLOG_FILE_CREATE: case MLOG_FILE_DELETE: case MLOG_FILE_CREATE2: ptr = fil_op_log_parse_or_replay(ptr, end_ptr, type, 0, 0); @@ -1611,7 +1617,8 @@ recv_recover_page_func( recv_parse_or_apply_log_rec_body(recv->type, buf, buf + recv->len, - block, &mtr); + block, &mtr, + recv_addr->space); end_lsn = recv->start_lsn + recv->len; mach_write_to_8(FIL_PAGE_LSN + page, end_lsn); @@ -2078,7 +2085,7 @@ recv_parse_log_rec( #endif /* UNIV_LOG_LSN_DEBUG */ new_ptr = recv_parse_or_apply_log_rec_body(*type, new_ptr, end_ptr, - NULL, NULL); + NULL, NULL, *space); if (UNIV_UNLIKELY(new_ptr == NULL)) { return(0); diff --git a/storage/innobase/rem/rem0rec.c b/storage/innobase/rem/rem0rec.c index 30fc28561fa..6bd40c54a0c 100644 --- a/storage/innobase/rem/rem0rec.c +++ b/storage/innobase/rem/rem0rec.c @@ -167,7 +167,6 @@ rec_get_n_extern_new( { const byte* nulls; const byte* lens; - dict_field_t* field; ulint null_mask; ulint n_extern; ulint i; @@ -188,10 +187,13 @@ rec_get_n_extern_new( /* read the lengths of fields 0..n */ do { - ulint len; + const dict_field_t* field + = dict_index_get_nth_field(index, i); + const dict_col_t* col + = dict_field_get_col(field); + ulint len; - field = dict_index_get_nth_field(index, i); - if (!(dict_field_get_col(field)->prtype & DATA_NOT_NULL)) { + if (!(col->prtype & DATA_NOT_NULL)) { /* nullable field => read the null flag */ if (UNIV_UNLIKELY(!(byte) null_mask)) { @@ -209,8 +211,6 @@ rec_get_n_extern_new( if (UNIV_UNLIKELY(!field->fixed_len)) { /* Variable-length field: read the length */ - const dict_col_t* col - = dict_field_get_col(field); len = *lens--; /* If the maximum length of the field is up to 255 bytes, the actual length is always @@ -239,16 +239,15 @@ rec_get_n_extern_new( Determine the offset to each field in a leaf-page record in ROW_FORMAT=COMPACT. This is a special case of rec_init_offsets() and rec_get_offsets_func(). */ -UNIV_INTERN +UNIV_INLINE __attribute__((nonnull)) void rec_init_offsets_comp_ordinary( /*===========================*/ const rec_t* rec, /*!< in: physical record in ROW_FORMAT=COMPACT */ - ulint extra, /*!< in: number of bytes to reserve - between the record header and - the data payload - (usually REC_N_NEW_EXTRA_BYTES) */ + ibool temp, /*!< in: whether to use the + format for temporary files in + index creation */ const dict_index_t* index, /*!< in: record descriptor */ ulint* offsets)/*!< in/out: array of offsets; in: n=rec_offs_n_fields(offsets) */ @@ -256,27 +255,38 @@ rec_init_offsets_comp_ordinary( ulint i = 0; ulint offs = 0; ulint any_ext = 0; - const byte* nulls = rec - (extra + 1); + const byte* nulls = temp + ? rec - 1 + : rec - (1 + REC_N_NEW_EXTRA_BYTES); const byte* lens = nulls - UT_BITS_IN_BYTES(index->n_nullable); - dict_field_t* field; ulint null_mask = 1; #ifdef UNIV_DEBUG - /* We cannot invoke rec_offs_make_valid() here, because it can hold - that extra != REC_N_NEW_EXTRA_BYTES. Similarly, rec_offs_validate() - will fail in that case, because it invokes rec_get_status(). */ + /* We cannot invoke rec_offs_make_valid() here if temp=TRUE. + Similarly, rec_offs_validate() will fail in that case, because + it invokes rec_get_status(). */ offsets[2] = (ulint) rec; offsets[3] = (ulint) index; #endif /* UNIV_DEBUG */ + ut_ad(temp || dict_table_is_comp(index->table)); + + if (temp && dict_table_is_comp(index->table)) { + /* No need to do adjust fixed_len=0. We only need to + adjust it for ROW_FORMAT=REDUNDANT. */ + temp = FALSE; + } + /* read the lengths of fields 0..n */ do { - ulint len; + const dict_field_t* field + = dict_index_get_nth_field(index, i); + const dict_col_t* col + = dict_field_get_col(field); + ulint len; - field = dict_index_get_nth_field(index, i); - if (!(dict_field_get_col(field)->prtype - & DATA_NOT_NULL)) { + if (!(col->prtype & DATA_NOT_NULL)) { /* nullable field => read the null flag */ if (UNIV_UNLIKELY(!(byte) null_mask)) { @@ -296,10 +306,9 @@ rec_init_offsets_comp_ordinary( null_mask <<= 1; } - if (UNIV_UNLIKELY(!field->fixed_len)) { + if (!field->fixed_len + || (temp && !dict_col_get_fixed_size(col, temp))) { /* Variable-length field: read the length */ - const dict_col_t* col - = dict_field_get_col(field); len = *lens--; /* If the maximum length of the field is up to 255 bytes, the actual length is always @@ -393,9 +402,8 @@ rec_init_offsets( = dict_index_get_n_unique_in_tree(index); break; case REC_STATUS_ORDINARY: - rec_init_offsets_comp_ordinary(rec, - REC_N_NEW_EXTRA_BYTES, - index, offsets); + rec_init_offsets_comp_ordinary( + rec, FALSE, index, offsets); return; } @@ -766,17 +774,19 @@ rec_get_nth_field_offs_old( /**********************************************************//** Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT. @return total size */ -UNIV_INTERN +UNIV_INLINE __attribute__((warn_unused_result, nonnull(1,2))) ulint -rec_get_converted_size_comp_prefix( -/*===============================*/ +rec_get_converted_size_comp_prefix_low( +/*===================================*/ const dict_index_t* index, /*!< in: record descriptor; dict_table_is_comp() is assumed to hold, even if it does not */ const dfield_t* fields, /*!< in: array of data fields */ ulint n_fields,/*!< in: number of data fields */ - ulint* extra) /*!< out: extra size */ + ulint* extra, /*!< out: extra size */ + ibool temp) /*!< in: whether this is a + temporary file record */ { ulint extra_size; ulint data_size; @@ -785,15 +795,25 @@ rec_get_converted_size_comp_prefix( ut_ad(fields); ut_ad(n_fields > 0); ut_ad(n_fields <= dict_index_get_n_fields(index)); + ut_ad(!temp || extra); - extra_size = REC_N_NEW_EXTRA_BYTES + extra_size = temp + ? UT_BITS_IN_BYTES(index->n_nullable) + : REC_N_NEW_EXTRA_BYTES + UT_BITS_IN_BYTES(index->n_nullable); data_size = 0; + if (temp && dict_table_is_comp(index->table)) { + /* No need to do adjust fixed_len=0. We only need to + adjust it for ROW_FORMAT=REDUNDANT. */ + temp = FALSE; + } + /* read the lengths of fields 0..n */ for (i = 0; i < n_fields; i++) { const dict_field_t* field; ulint len; + ulint fixed_len; const dict_col_t* col; field = dict_index_get_nth_field(index, i); @@ -809,8 +829,14 @@ rec_get_converted_size_comp_prefix( continue; } - ut_ad(len <= col->len || col->mtype == DATA_BLOB); + ut_ad(len <= col->len || col->mtype == DATA_BLOB + || (col->len == 0 && col->mtype == DATA_VARCHAR)); + fixed_len = field->fixed_len; + if (temp && fixed_len + && !dict_col_get_fixed_size(col, temp)) { + fixed_len = 0; + } /* If the maximum length of a variable-length field is up to 255 bytes, the actual length is always stored in one byte. If the maximum length is more than 255 @@ -818,11 +844,20 @@ rec_get_converted_size_comp_prefix( 0..127. The length will be encoded in two bytes when it is 128 or more, or when the field is stored externally. */ - if (field->fixed_len) { - ut_ad(len == field->fixed_len); + if (fixed_len) { +#ifdef UNIV_DEBUG + ulint mbminlen = DATA_MBMINLEN(col->mbminmaxlen); + ulint mbmaxlen = DATA_MBMAXLEN(col->mbminmaxlen); + + ut_ad(len <= fixed_len); + + ut_ad(!mbmaxlen || len >= mbminlen + * (fixed_len / mbmaxlen)); + /* dict_index_add_col() should guarantee this */ ut_ad(!field->prefix_len - || field->fixed_len == field->prefix_len); + || fixed_len == field->prefix_len); +#endif /* UNIV_DEBUG */ } else if (dfield_is_ext(&fields[i])) { ut_ad(col->len >= 256 || col->mtype == DATA_BLOB); extra_size += 2; @@ -839,7 +874,7 @@ rec_get_converted_size_comp_prefix( data_size += len; } - if (UNIV_LIKELY_NULL(extra)) { + if (extra) { *extra = extra_size; } @@ -847,6 +882,23 @@ rec_get_converted_size_comp_prefix( } /**********************************************************//** +Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT. +@return total size */ +UNIV_INTERN +ulint +rec_get_converted_size_comp_prefix( +/*===============================*/ + const dict_index_t* index, /*!< in: record descriptor */ + const dfield_t* fields, /*!< in: array of data fields */ + ulint n_fields,/*!< in: number of data fields */ + ulint* extra) /*!< out: extra size */ +{ + ut_ad(dict_table_is_comp(index->table)); + return(rec_get_converted_size_comp_prefix_low( + index, fields, n_fields, extra, FALSE)); +} + +/**********************************************************//** Determines the size of a data tuple in ROW_FORMAT=COMPACT. @return total size */ UNIV_INTERN @@ -890,8 +942,8 @@ rec_get_converted_size_comp( return(ULINT_UNDEFINED); } - return(size + rec_get_converted_size_comp_prefix(index, fields, - n_fields, extra)); + return(size + rec_get_converted_size_comp_prefix_low( + index, fields, n_fields, extra, FALSE)); } /***********************************************************//** @@ -1068,19 +1120,18 @@ rec_convert_dtuple_to_rec_old( /*********************************************************//** Builds a ROW_FORMAT=COMPACT record out of a data tuple. */ -UNIV_INTERN +UNIV_INLINE __attribute__((nonnull)) void rec_convert_dtuple_to_rec_comp( /*===========================*/ rec_t* rec, /*!< in: origin of record */ - ulint extra, /*!< in: number of bytes to - reserve between the record - header and the data payload - (normally REC_N_NEW_EXTRA_BYTES) */ const dict_index_t* index, /*!< in: record descriptor */ - ulint status, /*!< in: status bits of the record */ const dfield_t* fields, /*!< in: array of data fields */ - ulint n_fields)/*!< in: number of data fields */ + ulint n_fields,/*!< in: number of data fields */ + ulint status, /*!< in: status bits of the record */ + ibool temp) /*!< in: whether to use the + format for temporary files in + index creation */ { const dfield_t* field; const dtype_t* type; @@ -1092,31 +1143,44 @@ rec_convert_dtuple_to_rec_comp( ulint n_node_ptr_field; ulint fixed_len; ulint null_mask = 1; - ut_ad(extra == 0 || dict_table_is_comp(index->table)); - ut_ad(extra == 0 || extra == REC_N_NEW_EXTRA_BYTES); + ut_ad(temp || dict_table_is_comp(index->table)); ut_ad(n_fields > 0); - switch (UNIV_EXPECT(status, REC_STATUS_ORDINARY)) { - case REC_STATUS_ORDINARY: + if (temp) { + ut_ad(status == REC_STATUS_ORDINARY); ut_ad(n_fields <= dict_index_get_n_fields(index)); n_node_ptr_field = ULINT_UNDEFINED; - break; - case REC_STATUS_NODE_PTR: - ut_ad(n_fields == dict_index_get_n_unique_in_tree(index) + 1); - n_node_ptr_field = n_fields - 1; - break; - case REC_STATUS_INFIMUM: - case REC_STATUS_SUPREMUM: - ut_ad(n_fields == 1); - n_node_ptr_field = ULINT_UNDEFINED; - break; - default: - ut_error; - return; + nulls = rec - 1; + if (dict_table_is_comp(index->table)) { + /* No need to do adjust fixed_len=0. We only + need to adjust it for ROW_FORMAT=REDUNDANT. */ + temp = FALSE; + } + } else { + nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1); + + switch (UNIV_EXPECT(status, REC_STATUS_ORDINARY)) { + case REC_STATUS_ORDINARY: + ut_ad(n_fields <= dict_index_get_n_fields(index)); + n_node_ptr_field = ULINT_UNDEFINED; + break; + case REC_STATUS_NODE_PTR: + ut_ad(n_fields + == dict_index_get_n_unique_in_tree(index) + 1); + n_node_ptr_field = n_fields - 1; + break; + case REC_STATUS_INFIMUM: + case REC_STATUS_SUPREMUM: + ut_ad(n_fields == 1); + n_node_ptr_field = ULINT_UNDEFINED; + break; + default: + ut_error; + return; + } } end = rec; - nulls = rec - (extra + 1); lens = nulls - UT_BITS_IN_BYTES(index->n_nullable); /* clear the SQL-null flags */ memset(lens + 1, 0, nulls - lens); @@ -1162,6 +1226,10 @@ rec_convert_dtuple_to_rec_comp( ifield = dict_index_get_nth_field(index, i); fixed_len = ifield->fixed_len; + if (temp && fixed_len + && !dict_col_get_fixed_size(ifield->col, temp)) { + fixed_len = 0; + } /* If the maximum length of a variable-length field is up to 255 bytes, the actual length is always stored in one byte. If the maximum length is more than 255 @@ -1169,8 +1237,17 @@ rec_convert_dtuple_to_rec_comp( 0..127. The length will be encoded in two bytes when it is 128 or more, or when the field is stored externally. */ if (fixed_len) { - ut_ad(len == fixed_len); +#ifdef UNIV_DEBUG + ulint mbminlen = DATA_MBMINLEN( + ifield->col->mbminmaxlen); + ulint mbmaxlen = DATA_MBMAXLEN( + ifield->col->mbminmaxlen); + + ut_ad(len <= fixed_len); + ut_ad(!mbmaxlen || len >= mbminlen + * (fixed_len / mbmaxlen)); ut_ad(!dfield_is_ext(field)); +#endif /* UNIV_DEBUG */ } else if (dfield_is_ext(field)) { ut_ad(ifield->col->len >= 256 || ifield->col->mtype == DATA_BLOB); @@ -1222,8 +1299,7 @@ rec_convert_dtuple_to_rec_new( rec = buf + extra_size; rec_convert_dtuple_to_rec_comp( - rec, REC_N_NEW_EXTRA_BYTES, index, status, - dtuple->fields, dtuple->n_fields); + rec, index, dtuple->fields, dtuple->n_fields, status, FALSE); /* Set the info bits of the record */ rec_set_info_and_status_bits(rec, dtuple_get_info_bits(dtuple)); @@ -1285,6 +1361,54 @@ rec_convert_dtuple_to_rec( return(rec); } +#ifndef UNIV_HOTBACKUP +/**********************************************************//** +Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT. +@return total size */ +UNIV_INTERN +ulint +rec_get_converted_size_temp( +/*========================*/ + const dict_index_t* index, /*!< in: record descriptor */ + const dfield_t* fields, /*!< in: array of data fields */ + ulint n_fields,/*!< in: number of data fields */ + ulint* extra) /*!< out: extra size */ +{ + return(rec_get_converted_size_comp_prefix_low( + index, fields, n_fields, extra, TRUE)); +} + +/******************************************************//** +Determine the offset to each field in temporary file. +@see rec_convert_dtuple_to_temp() */ +UNIV_INTERN +void +rec_init_offsets_temp( +/*==================*/ + const rec_t* rec, /*!< in: temporary file record */ + const dict_index_t* index, /*!< in: record descriptor */ + ulint* offsets)/*!< in/out: array of offsets; + in: n=rec_offs_n_fields(offsets) */ +{ + rec_init_offsets_comp_ordinary(rec, TRUE, index, offsets); +} + +/*********************************************************//** +Builds a temporary file record out of a data tuple. +@see rec_init_offsets_temp() */ +UNIV_INTERN +void +rec_convert_dtuple_to_temp( +/*=======================*/ + rec_t* rec, /*!< out: record */ + const dict_index_t* index, /*!< in: record descriptor */ + const dfield_t* fields, /*!< in: array of data fields */ + ulint n_fields) /*!< in: number of fields */ +{ + rec_convert_dtuple_to_rec_comp(rec, index, fields, n_fields, + REC_STATUS_ORDINARY, TRUE); +} + /**************************************************************//** Copies the first n fields of a physical record to a data tuple. The fields are copied to the memory heap. */ @@ -1495,6 +1619,7 @@ rec_copy_prefix_to_buf( return(*buf + (rec - (lens + 1))); } +#endif /* UNIV_HOTBACKUP */ /***************************************************************//** Validates the consistency of an old-style physical record. diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c index 18486514267..21afa9eff0d 100644 --- a/storage/innobase/row/row0ins.c +++ b/storage/innobase/row/row0ins.c @@ -2254,7 +2254,10 @@ row_ins_index_entry( err = row_ins_index_entry_low(BTR_MODIFY_LEAF, index, entry, n_ext, thr); if (err != DB_FAIL) { - + if (index == dict_table_get_first_index(index->table) + && thr_get_trx(thr)->mysql_thd != 0) { + DEBUG_SYNC_C("row_ins_clust_index_entry_leaf_after"); + } return(err); } diff --git a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c index 7c9fb8812e6..d34ad467588 100644 --- a/storage/innobase/row/row0merge.c +++ b/storage/innobase/row/row0merge.c @@ -298,6 +298,7 @@ row_merge_buf_add( for (i = 0; i < n_fields; i++, field++, ifield++) { const dict_col_t* col; ulint col_no; + ulint fixed_len; const dfield_t* row_field; ulint len; @@ -346,9 +347,30 @@ row_merge_buf_add( ut_ad(len <= col->len || col->mtype == DATA_BLOB); - if (ifield->fixed_len) { - ut_ad(len == ifield->fixed_len); + fixed_len = ifield->fixed_len; + if (fixed_len && !dict_table_is_comp(index->table) + && DATA_MBMINLEN(col->mbminmaxlen) + != DATA_MBMAXLEN(col->mbminmaxlen)) { + /* CHAR in ROW_FORMAT=REDUNDANT is always + fixed-length, but in the temporary file it is + variable-length for variable-length character + sets. */ + fixed_len = 0; + } + + if (fixed_len) { +#ifdef UNIV_DEBUG + ulint mbminlen = DATA_MBMINLEN(col->mbminmaxlen); + ulint mbmaxlen = DATA_MBMAXLEN(col->mbminmaxlen); + + /* len should be between size calcualted base on + mbmaxlen and mbminlen */ + ut_ad(len <= fixed_len); + ut_ad(!mbmaxlen || len >= mbminlen + * (fixed_len / mbmaxlen)); + ut_ad(!dfield_is_ext(field)); +#endif /* UNIV_DEBUG */ } else if (dfield_is_ext(field)) { extra_size += 2; } else if (len < 128 @@ -369,12 +391,11 @@ row_merge_buf_add( ulint size; ulint extra; - size = rec_get_converted_size_comp(index, - REC_STATUS_ORDINARY, - entry, n_fields, &extra); + size = rec_get_converted_size_temp( + index, entry, n_fields, &extra); - ut_ad(data_size + extra_size + REC_N_NEW_EXTRA_BYTES == size); - ut_ad(extra_size + REC_N_NEW_EXTRA_BYTES == extra); + ut_ad(data_size + extra_size == size); + ut_ad(extra_size == extra); } #endif /* UNIV_DEBUG */ @@ -578,14 +599,9 @@ row_merge_buf_write( ulint extra_size; const dfield_t* entry = buf->tuples[i]; - size = rec_get_converted_size_comp(index, - REC_STATUS_ORDINARY, - entry, n_fields, - &extra_size); + size = rec_get_converted_size_temp( + index, entry, n_fields, &extra_size); ut_ad(size >= extra_size); - ut_ad(extra_size >= REC_N_NEW_EXTRA_BYTES); - extra_size -= REC_N_NEW_EXTRA_BYTES; - size -= REC_N_NEW_EXTRA_BYTES; /* Encode extra_size + 1 */ if (extra_size + 1 < 0x80) { @@ -598,9 +614,8 @@ row_merge_buf_write( ut_ad(b + size < block[1]); - rec_convert_dtuple_to_rec_comp(b + extra_size, 0, index, - REC_STATUS_ORDINARY, - entry, n_fields); + rec_convert_dtuple_to_temp(b + extra_size, index, + entry, n_fields); b += size; @@ -704,6 +719,8 @@ row_merge_read( ib_uint64_t ofs = ((ib_uint64_t) offset) * sizeof *buf; ibool success; + DBUG_EXECUTE_IF("row_merge_read_failure", return(FALSE);); + #ifdef UNIV_DEBUG if (row_merge_print_block_read) { fprintf(stderr, "row_merge_read fd=%d ofs=%lu\n", @@ -750,6 +767,8 @@ row_merge_write( (ulint) (ofs >> 32), buf_len); + DBUG_EXECUTE_IF("row_merge_write_failure", return(FALSE);); + #ifdef UNIV_DEBUG if (row_merge_print_block_write) { fprintf(stderr, "row_merge_write fd=%d ofs=%lu\n", @@ -862,7 +881,7 @@ err_exit: *mrec = *buf + extra_size; - rec_init_offsets_comp_ordinary(*mrec, 0, index, offsets); + rec_init_offsets_temp(*mrec, index, offsets); data_size = rec_offs_data_size(offsets); @@ -881,7 +900,7 @@ err_exit: *mrec = b + extra_size; - rec_init_offsets_comp_ordinary(*mrec, 0, index, offsets); + rec_init_offsets_temp(*mrec, index, offsets); data_size = rec_offs_data_size(offsets); ut_ad(extra_size + data_size < sizeof *buf); @@ -2214,7 +2233,7 @@ row_merge_drop_temp_indexes(void) /*********************************************************************//** Creates temperary merge files, and if UNIV_PFS_IO defined, register the file descriptor with Performance Schema. -@return File descriptor */ +@return file descriptor, or -1 on failure */ UNIV_INLINE int row_merge_file_create_low(void) @@ -2236,12 +2255,19 @@ row_merge_file_create_low(void) #ifdef UNIV_PFS_IO register_pfs_file_open_end(locker, fd); #endif + if (fd < 0) { + fprintf(stderr, + "InnoDB: Error: Cannot create temporary merge file\n"); + return(-1); + } return(fd); } + /*********************************************************************//** -Create a merge file. */ -static -void +Create a merge file. +@return file descriptor, or -1 on failure */ +static __attribute__((nonnull, warn_unused_result)) +int row_merge_file_create( /*==================*/ merge_file_t* merge_file) /*!< out: merge file structure */ @@ -2249,6 +2275,7 @@ row_merge_file_create( merge_file->fd = row_merge_file_create_low(); merge_file->offset = 0; merge_file->n_rec = 0; + return(merge_file->fd); } /*********************************************************************//** @@ -2494,6 +2521,28 @@ row_merge_rename_tables( goto err_exit; } + /* Generate the redo logs for file operations */ + fil_mtr_rename_log(old_table->space, old_name, + new_table->space, new_table->name, tmp_name); + + /* What if the redo logs are flushed to disk here? This is + tested with following crash point */ + DBUG_EXECUTE_IF("bug14669848_precommit", log_buffer_flush_to_disk(); + DBUG_SUICIDE();); + + /* File operations cannot be rolled back. So, before proceeding + with file operations, commit the dictionary changes.*/ + trx_commit_for_mysql(trx); + + /* If server crashes here, the dictionary in InnoDB and MySQL + will differ. The .ibd files and the .frm files must be swapped + manually by the administrator. No loss of data. */ + DBUG_EXECUTE_IF("bug14669848", DBUG_SUICIDE();); + + /* Ensure that the redo logs are flushed to disk. The config + innodb_flush_log_at_trx_commit must not affect this. */ + log_buffer_flush_to_disk(); + /* The following calls will also rename the .ibd data files if the tables are stored in a single-table tablespace */ @@ -2665,7 +2714,7 @@ row_merge_build_indexes( ulint block_size; ulint i; ulint error; - int tmpfd; + int tmpfd = -1; ut_ad(trx); ut_ad(old_table); @@ -2682,13 +2731,31 @@ row_merge_build_indexes( block_size = 3 * sizeof *block; block = os_mem_alloc_large(&block_size); + /* Initialize all the merge file descriptors, so that we + don't call row_merge_file_destroy() on uninitialized + merge file descriptor */ + + for (i = 0; i < n_indexes; i++) { + merge_files[i].fd = -1; + } + for (i = 0; i < n_indexes; i++) { - row_merge_file_create(&merge_files[i]); + if (row_merge_file_create(&merge_files[i]) < 0) + { + error = DB_OUT_OF_MEMORY; + goto func_exit; + } } tmpfd = row_merge_file_create_low(); + if (tmpfd < 0) + { + error = DB_OUT_OF_MEMORY; + goto func_exit; + } + /* Reset the MySQL row buffer that is used when reporting duplicate keys. */ innobase_rec_reset(table); diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 7e1d18d41b6..73da6215f0d 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -4140,6 +4140,13 @@ end: trx->error_state = DB_SUCCESS; trx_general_rollback_for_mysql(trx, NULL); trx->error_state = DB_SUCCESS; + } else { + if (old_is_tmp && !new_is_tmp) { + /* After ALTER TABLE the table statistics + needs to be rebuilt. It will be rebuilt + when the table is loaded again. */ + table->stat_initialized = FALSE; + } } } diff --git a/storage/innobase/row/row0umod.c b/storage/innobase/row/row0umod.c index 9e5fb8686c6..3c933c87b27 100644 --- a/storage/innobase/row/row0umod.c +++ b/storage/innobase/row/row0umod.c @@ -519,6 +519,7 @@ row_undo_mod_upd_del_sec( ulint err = DB_SUCCESS; ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC); + ut_ad(!node->undo_row); heap = mem_heap_create(1024); while (node->index != NULL) { @@ -580,6 +581,8 @@ row_undo_mod_del_mark_sec( dict_index_t* index; ulint err; + ut_ad(!node->undo_row); + heap = mem_heap_create(1024); while (node->index != NULL) { diff --git a/storage/innobase/row/row0undo.c b/storage/innobase/row/row0undo.c index a1c1d72f8c6..74fc1baf1d2 100644 --- a/storage/innobase/row/row0undo.c +++ b/storage/innobase/row/row0undo.c @@ -216,7 +216,7 @@ row_undo_search_clust_to_pcur( node->row = row_build(ROW_COPY_DATA, clust_index, rec, offsets, NULL, ext, node->heap); - if (node->update) { + if (node->rec_type == TRX_UNDO_UPD_EXIST_REC) { node->undo_row = dtuple_copy(node->row, node->heap); row_upd_replace(node->undo_row, &node->undo_ext, clust_index, node->update, node->heap); diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index df89156baae..5872ff2c437 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -58,6 +58,8 @@ Created 10/8/1995 Heikki Tuuri *******************************************************/ /* Dummy comment */ +#include "m_string.h" /* for my_sys.h */ +#include "my_sys.h" /* DEBUG_SYNC_C */ #include "srv0srv.h" #include "ut0mem.h" @@ -83,6 +85,7 @@ Created 10/8/1995 Heikki Tuuri #include "ha_prototypes.h" #include "trx0i_s.h" #include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */ +#include "read0read.h" #include "mysql/plugin.h" #include "mysql/service_thd_wait.h" @@ -356,6 +359,9 @@ UNIV_INTERN lint srv_conc_n_threads = 0; InnoDB */ UNIV_INTERN ulint srv_conc_n_waiting_threads = 0; +/* print all user-level transactions deadlocks to mysqld stderr */ +UNIV_INTERN my_bool srv_print_all_deadlocks = FALSE; + typedef struct srv_conc_slot_struct srv_conc_slot_t; struct srv_conc_slot_struct{ os_event_t event; /*!< event to wait */ @@ -1568,6 +1574,10 @@ srv_suspend_mysql_thread( trx = thr_get_trx(thr); + if (trx->mysql_thd != 0) { + DEBUG_SYNC_C("srv_suspend_mysql_thread_enter"); + } + os_event_set(srv_lock_timeout_thread_event); mutex_enter(&kernel_mutex); @@ -2006,13 +2016,15 @@ void srv_export_innodb_status(void) /*==========================*/ { - buf_pool_stat_t stat; - ulint LRU_len; - ulint free_len; - ulint flush_list_len; + buf_pool_stat_t stat; + buf_pools_list_size_t buf_pools_list_size; + ulint LRU_len; + ulint free_len; + ulint flush_list_len; buf_get_total_stat(&stat); buf_get_total_list_len(&LRU_len, &free_len, &flush_list_len); + buf_get_total_list_size_in_bytes(&buf_pools_list_size); mutex_enter(&srv_innodb_monitor_mutex); @@ -2041,7 +2053,12 @@ srv_export_innodb_status(void) export_vars.innodb_buffer_pool_read_ahead_evicted = stat.n_ra_pages_evicted; export_vars.innodb_buffer_pool_pages_data = LRU_len; + export_vars.innodb_buffer_pool_bytes_data = + buf_pools_list_size.LRU_bytes + + buf_pools_list_size.unzip_LRU_bytes; export_vars.innodb_buffer_pool_pages_dirty = flush_list_len; + export_vars.innodb_buffer_pool_bytes_dirty = + buf_pools_list_size.flush_list_bytes; export_vars.innodb_buffer_pool_pages_free = free_len; #ifdef UNIV_DEBUG export_vars.innodb_buffer_pool_pages_latched @@ -2087,6 +2104,23 @@ srv_export_innodb_status(void) export_vars.innodb_rows_deleted = srv_n_rows_deleted; export_vars.innodb_truncated_status_writes = srv_truncated_status_writes; +#ifdef UNIV_DEBUG + if (trx_sys->max_trx_id < purge_sys->done_trx_no) { + export_vars.innodb_purge_trx_id_age = 0; + } else { + export_vars.innodb_purge_trx_id_age = + trx_sys->max_trx_id - purge_sys->done_trx_no; + } + + if (!purge_sys->view + || trx_sys->max_trx_id < purge_sys->view->up_limit_id) { + export_vars.innodb_purge_view_trx_id_age = 0; + } else { + export_vars.innodb_purge_view_trx_id_age = + trx_sys->max_trx_id - purge_sys->view->up_limit_id; + } +#endif /* UNIV_DEBUG */ + mutex_exit(&srv_innodb_monitor_mutex); } @@ -2773,6 +2807,26 @@ loop: for (i = 0; i < 10; i++) { ulint cur_time = ut_time_ms(); +#ifdef UNIV_DEBUG + if (btr_cur_limit_optimistic_insert_debug + && srv_n_purge_threads == 0) { + /* If btr_cur_limit_optimistic_insert_debug is enabled + and no purge_threads, purge opportunity is increased + by x100 (1purge/100msec), to speed up debug scripts + which should wait for purged. */ + next_itr_time -= 900; + + srv_main_thread_op_info = "master purging"; + + srv_master_do_purge(); + + if (srv_fast_shutdown && srv_shutdown_state > 0) { + + goto background_loop; + } + } +#endif /* UNIV_DEBUG */ + /* ALTER TABLE in MySQL requires on Unix that the table handler can drop tables lazily after there no longer are SELECT queries to them. */ diff --git a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c index 96f01ea81b5..719851218c3 100644 --- a/storage/innobase/trx/trx0purge.c +++ b/storage/innobase/trx/trx0purge.c @@ -61,6 +61,10 @@ UNIV_INTERN mysql_pfs_key_t trx_purge_latch_key; UNIV_INTERN mysql_pfs_key_t purge_sys_bh_mutex_key; #endif /* UNIV_PFS_MUTEX */ +#ifdef UNIV_DEBUG +UNIV_INTERN my_bool srv_purge_view_update_only_debug; +#endif /* UNIV_DEBUG */ + /*****************************************************************//** Checks if trx_id is >= purge_view: then it is guaranteed that its update undo log still exists in the system. @@ -236,6 +240,7 @@ trx_purge_sys_create( purge_sys->purge_trx_no = 0; purge_sys->purge_undo_no = 0; purge_sys->next_stored = FALSE; + ut_d(purge_sys->done_trx_no = 0); rw_lock_create(trx_purge_latch_key, &purge_sys->latch, SYNC_PURGE_LATCH); @@ -656,6 +661,12 @@ trx_purge_truncate_if_arr_empty(void) { static ulint count; +#ifdef UNIV_DEBUG + if (purge_sys->arr->n_used == 0) { + purge_sys->done_trx_no = purge_sys->purge_trx_no; + } +#endif /* UNIV_DEBUG */ + if (!(++count % TRX_SYS_N_RSEGS) && purge_sys->arr->n_used == 0) { trx_purge_truncate_history(); @@ -1173,6 +1184,12 @@ trx_purge( rw_lock_x_unlock(&(purge_sys->latch)); +#ifdef UNIV_DEBUG + if (srv_purge_view_update_only_debug) { + return(0); + } +#endif + purge_sys->state = TRX_PURGE_ON; purge_sys->handle_limit = purge_sys->n_pages_handled + limit; diff --git a/storage/innobase/trx/trx0rec.c b/storage/innobase/trx/trx0rec.c index 2f1389ae263..f80f58493aa 100644 --- a/storage/innobase/trx/trx0rec.c +++ b/storage/innobase/trx/trx0rec.c @@ -36,6 +36,7 @@ Created 3/26/1996 Heikki Tuuri #ifndef UNIV_HOTBACKUP #include "dict0dict.h" #include "ut0mem.h" +#include "read0read.h" #include "row0ext.h" #include "row0upd.h" #include "que0que.h" @@ -1634,6 +1635,25 @@ trx_undo_prev_version_build( if (row_upd_changes_field_size_or_external(index, offsets, update)) { ulint n_ext; + /* We should confirm the existence of disowned external data, + if the previous version record is delete marked. If the trx_id + of the previous record is seen by purge view, we should treat + it as missing history, because the disowned external data + might be purged already. + + The inherited external data (BLOBs) can be freed (purged) + after trx_id was committed, provided that no view was started + before trx_id. If the purge view can see the committed + delete-marked record by trx_id, no transactions need to access + the BLOB. */ + + if ((update->info_bits & REC_INFO_DELETED_FLAG) + && read_view_sees_trx_id(purge_sys->view, trx_id)) { + /* treat as a fresh insert, not to + cause assertion error at the caller. */ + return(DB_SUCCESS); + } + /* We have to set the appropriate extern storage bits in the old version of the record: the extern bits in rec for those fields that update does NOT update, as well as the bits for diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 438057e22df..22225303bae 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -349,6 +349,12 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) } else if (pos->type == HA_KEYTYPE_BINARY) pos->charset= &my_charset_bin; + if (!(share->keyinfo[i].flag & HA_SPATIAL) && + pos->start > share->base.reclength) + { + my_errno= HA_ERR_CRASHED; + goto err; + } } if (share->keyinfo[i].flag & HA_SPATIAL) { diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 968cb9624a6..01fa10de7a3 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -949,9 +949,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, ("Found too long binary packed key: %u of %u at 0x%lx", length, keyinfo->maxlength, (long) *page_pos)); DBUG_DUMP("key", *page_pos, 16); - mi_print_error(keyinfo->share, HA_ERR_CRASHED); - my_errno=HA_ERR_CRASHED; - DBUG_RETURN(0); /* Wrong key */ + goto crashed; /* Wrong key */ } /* Key is packed against prev key, take prefix from prev key. */ from= key; @@ -994,6 +992,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, if (from == from_end) { from=page; from_end=page_end; } length+= (uint) ((*key++ = *from++)); } + if (length > keyseg->length) + goto crashed; } else length=keyseg->length; @@ -1033,15 +1033,18 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, if (from_end != page_end) { DBUG_PRINT("error",("Error when unpacking key")); - mi_print_error(keyinfo->share, HA_ERR_CRASHED); - my_errno=HA_ERR_CRASHED; - DBUG_RETURN(0); /* Error */ + goto crashed; /* Error */ } /* Copy data pointer and, if appropriate, key block pointer. */ memcpy((uchar*) key,(uchar*) from,(size_t) length); *page_pos= from+length; } DBUG_RETURN((uint) (key-start_key)+keyseg->length); + + crashed: + mi_print_error(keyinfo->share, HA_ERR_CRASHED); + my_errno= HA_ERR_CRASHED; + DBUG_RETURN(0); } diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc index b6cadf9e61c..a941f815dca 100644 --- a/storage/perfschema/pfs_events_waits.cc +++ b/storage/perfschema/pfs_events_waits.cc @@ -93,6 +93,9 @@ static inline void copy_events_waits(PFS_events_waits *dest, */ void insert_events_waits_history(PFS_thread *thread, PFS_events_waits *wait) { + if (unlikely(events_waits_history_per_thread == 0)) + return; + uint index= thread->m_waits_history_index; /* @@ -120,6 +123,9 @@ void insert_events_waits_history(PFS_thread *thread, PFS_events_waits *wait) */ void insert_events_waits_history_long(PFS_events_waits *wait) { + if (unlikely(events_waits_history_long_size == 0)) + return; + uint index= PFS_atomic::add_u32(&events_waits_history_long_index, 1); index= index % events_waits_history_long_size; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 269bf8436a0..3bc49cfa751 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -13043,9 +13043,9 @@ static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold, "trigger a readahead.", NULL, NULL, 56, 0, 64, 0); -#ifdef UNIV_DEBUG_never +#ifdef UNIV_DEBUG static MYSQL_SYSVAR_UINT(trx_rseg_n_slots_debug, trx_rseg_n_slots_debug, - PLUGIN_VAR_RQCMDARG, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_NOCMDOPT, "Debug flags for InnoDB to limit TRX_RSEG_N_SLOTS for trx_rsegf_undo_find_free()", NULL, NULL, 0, 0, 1024, 0); #endif /* UNIV_DEBUG */ @@ -13331,7 +13331,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(purge_threads), MYSQL_SYSVAR(purge_batch_size), MYSQL_SYSVAR(rollback_segments), -#ifdef UNIV_DEBUG_never /* disable this flag. --innodb-trx becomes ambiguous */ +#ifdef UNIV_DEBUG MYSQL_SYSVAR(trx_rseg_n_slots_debug), #endif /* UNIV_DEBUG */ MYSQL_SYSVAR(corrupt_table_action), diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 55d907acf1c..3ac4156da22 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -343,6 +343,7 @@ start: print_arr[idx].length--; DBUG_ASSERT(*fmt == '$' && print_arr[idx].length < MAX_ARGS); args_arr[print_arr[idx].length].arg_type= 'd'; + args_arr[print_arr[idx].length].have_longlong= 0; print_arr[idx].flags|= LENGTH_ARG; arg_count= max(arg_count, print_arr[idx].length + 1); fmt++; @@ -361,6 +362,7 @@ start: print_arr[idx].width--; DBUG_ASSERT(*fmt == '$' && print_arr[idx].width < MAX_ARGS); args_arr[print_arr[idx].width].arg_type= 'd'; + args_arr[print_arr[idx].width].have_longlong= 0; print_arr[idx].flags|= WIDTH_ARG; arg_count= max(arg_count, print_arr[idx].width + 1); fmt++; diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 2d629c766e8..bac22fc96a9 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -370,7 +370,6 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ Summary: MySQL - Shared libraries Group: Applications/Databases Provides: MySQL-shared -Conflicts: mysql-libs mysql-libs-advanced Obsoletes: MySQL-shared-standard MySQL-shared-pro Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared |