diff options
Diffstat (limited to 'mysql-test')
507 files changed, 18796 insertions, 5428 deletions
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/disabled.def b/mysql-test/disabled.def index 46e20f86ec3..6d84b8ce0f4 100644 --- a/mysql-test/disabled.def +++ b/mysql-test/disabled.def @@ -13,10 +13,10 @@ tablespace : disabled in MariaDB (no TABLESPACE table attribute) events_time_zone : Test is not predictable as it depends on precise timing. lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on Mac OSX read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists -sum_distinct-big : Bug#11764126 2010-11-15 mattiasj was not tested archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 ssl_crl_clients_valid : broken upstream ssl_crl : broken upstream ssl_crl_clrpath : broken upstream +show_explain : Psergey: random timeout in range-checked-for-each record query. 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/include/have_debug_sync.inc b/mysql-test/include/have_debug_sync.inc index 8efec7dad95..dbe6dfddd26 100644 --- a/mysql-test/include/have_debug_sync.inc +++ b/mysql-test/include/have_debug_sync.inc @@ -1,4 +1,4 @@ -if (`SELECT COUNT(*) = 0 FROM information_schema.session_variables WHERE - variable_name = 'debug_sync' AND variable_value LIKE 'ON %'`) { - --skip Needs debug_sync enabled +if (`select count(*) = 0 from information_schema.session_variables where variable_name = 'debug_sync' and variable_value like 'on %'`) +{ + skip debug_sync is not available; } diff --git a/mysql-test/include/have_semisync.inc b/mysql-test/include/have_semisync.inc new file mode 100644 index 00000000000..243fad83717 --- /dev/null +++ b/mysql-test/include/have_semisync.inc @@ -0,0 +1,4 @@ +if (`select count(*) < 2 from information_schema.plugins where plugin_name like 'rpl_semi_sync_%'`) +{ + --skip Test requires semisync plugins +} diff --git a/mysql-test/include/have_semisync.opt b/mysql-test/include/have_semisync.opt new file mode 100644 index 00000000000..2888844cdcd --- /dev/null +++ b/mysql-test/include/have_semisync.opt @@ -0,0 +1,4 @@ +--plugin-load=$SEMISYNC_MASTER_SO +--plugin-load=$SEMISYNC_SLAVE_SO +--loose-rpl-semi-sync-master +--loose-rpl-semi-sync-slave diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc deleted file mode 100644 index 8a1679de636..00000000000 --- a/mysql-test/include/have_semisync_plugin.inc +++ /dev/null @@ -1,15 +0,0 @@ -# -# Check if server has support for loading plugins -# -if (`SELECT @@have_dynamic_loading != 'YES'`) { - --skip Requires dynamic loading -} - -# -# Check if the variable SEMISYNC_MASTER_SO is set -# -if (!$SEMISYNC_MASTER_SO) -{ - skip Need semisync plugins; -} - diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index 87d6698865a..75ba0e43221 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -627,17 +627,12 @@ DROP TABLE t1,t2,t3; create table t1 (a int) engine=innodb; let $MYSQLD_DATADIR= `select @@datadir`; copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/bug29807.frm; ---error 1146 +--error ER_NO_SUCH_TABLE_IN_ENGINE select * from bug29807; drop table t1; ---error 1051 drop table bug29807; -create table bug29807 (a int); -drop table bug29807; ---disable_query_log call mtr.add_suppression("InnoDB: Error: table .test...bug29807. does not exist in the InnoDB internal"); call mtr.add_suppression("Cannot find or open table test\/bug29807 from"); ---enable_query_log # diff --git a/mysql-test/include/support_long_file_names.inc b/mysql-test/include/support_long_file_names.inc new file mode 100644 index 00000000000..1f5b3d7be08 --- /dev/null +++ b/mysql-test/include/support_long_file_names.inc @@ -0,0 +1,37 @@ +--error 0,3 +--perl +my $n = 254 - length($ENV{MYSQLTEST_VARDIR}); +my $name = $ENV{MYSQLTEST_VARDIR} . '/' . sprintf("%0${n}d", $$); +if (!open(LONG_NAME,">$name")) +{ + # We cannot rely either on a particular error code, or error string + # to check that we indeed hit "File name too long". + # Instead, we will try to create a file with a short name + # the same way, in the same location. If it goes all right, + # we will assume the problem was with the file name length + + open(SHORT_NAME,">$ENV{MYSQLTEST_VARDIR}/$$") || + # Even a shorter name could not be created, something else is wrong + die "Could not create file $ENV{MYSQLTEST_VARDIR}/$$: $!"; + close(SHORT_NAME); + unlink("$ENV{MYSQLTEST_VARDIR}/$$"); + exit(3); +} else { + close(LONG_NAME); + unlink($name); + exit(0); +} +EOF + +# If perl exited with error code 0, the check has passed, +# so the calling test will be executed. +# If perl exited with error code 3, it will be caught by +# --error above, and processed by the check below. +# If perl exited with some other error code, something went wrong, +# so the test will fail. + +if ($errno) +{ + --skip Long file names are not supported +} + 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..a82e3ee10b7 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; } } @@ -975,6 +968,8 @@ sub get_tags_from_file($$) { } elsif ($over and $file =~ m@^$pdir/(.*)$@) { $suffix = $1; @prefix = map { "$_/" } $sdir, $pdir; + } else { + $over = 0; # file neither in $sdir nor in $pdir } while (my $line= <$F>) 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 46f2215ffb8..fdf06bfd327 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -208,6 +208,8 @@ our @opt_mysqld_envs; my $opt_stress; +my $opt_dry_run; + my $opt_compress; my $opt_ssl; my $opt_skip_ssl; @@ -334,8 +336,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; @@ -346,7 +349,7 @@ my $exe_ndb_mgm; our %mysqld_variables; our @optional_plugins; -my $source_dist= 0; +my $source_dist= -d "../sql"; my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5); my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20); @@ -362,14 +365,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(); @@ -382,6 +377,8 @@ sub main { # directly before it executes them, like "make test-force-pl" in RPM builds. mtr_report("Logging: $0 ", join(" ", @ARGV)); + $DEFAULT_SUITES.=",sequence,sql_discovery" if $source_dist; + command_line_setup(); # --help will not reach here, so now it's safe to assume we have binaries @@ -394,26 +391,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; @@ -447,6 +424,14 @@ sub main { my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list); mark_time_used('collect'); + if ($opt_dry_run) + { + for (@$tests) { + print $_->fullname(), "\n"; + } + exit 0; + } + if ( $opt_report_features ) { # Put "report features" as the first test to run my $tinfo = My::Test->new @@ -763,6 +748,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'); @@ -1139,7 +1128,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, @@ -1260,6 +1249,7 @@ sub command_line_setup { 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'stress=s' => \$opt_stress, + 'dry-run' => \$opt_dry_run, 'help|h' => \$opt_usage, # list-options is internal, not listed in help @@ -1278,11 +1268,6 @@ sub command_line_setup { report_option('verbose', $opt_verbose); } - if ( -d "../sql" ) - { - $source_dist= 1; - } - # Find the absolute path to the test directory $glob_mysql_test_dir= cwd(); if ($glob_mysql_test_dir =~ / /) @@ -1581,7 +1566,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 @@ -2037,7 +2021,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= @@ -2299,7 +2283,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"); } @@ -2392,7 +2376,7 @@ sub environment_setup { # ---------------------------------------------------- # Setup env for NDB # ---------------------------------------------------- - if ( ! $opt_skip_ndbcluster ) + if ( $ndbcluster_enabled ) { $ENV{'NDB_MGM'}= my_find_bin($bindir, @@ -2823,7 +2807,7 @@ sub fix_vs_config_dir () { $opt_vs_config=""; - for (<$bindir/sql/*/mysqld.exe>) { + for (<$bindir/sql/*/mysqld.exe>) { #/ if (-M $_ < $modified) { $modified = -M _; @@ -2865,37 +2849,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"); + } - mtr_report(" - using ndbcluster when necessary, mysqld supports it"); + # Silently skip, mysqld was compiled without ndbcluster + # which is the default case + return; + } + + 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; } @@ -4751,6 +4785,7 @@ sub extract_warning_lines ($$) { qr|Error: io_setup\(\) failed|, qr|Warning: io_setup\(\) failed|, qr|Warning: io_setup\(\) attempt|, + qr|setrlimit could not change the size of core files to 'infinity';|, ); my $matched_lines= []; @@ -6257,6 +6292,8 @@ Options to control what engine/variation to run all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld + dry-run Don't run any tests, print the list of tests + that were selected for execution Options to control directories to use tmpdir=DIR The directory where temporary files are stored diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index b2cfd079ff5..b6e99952c23 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -415,7 +415,7 @@ alter table t1 drop key a; drop table t1; CREATE TABLE T12207(a int) ENGINE=MYISAM; ALTER TABLE T12207 DISCARD TABLESPACE; -ERROR HY000: Table storage engine for 'T12207' doesn't have this option +ERROR HY000: Storage engine MyISAM of the table `test`.`T12207` doesn't have this option DROP TABLE T12207; create table t1 (a text) character set koi8r; insert into t1 values (_koi8r'ÔÅÓÔ'); @@ -978,7 +978,7 @@ SHOW CREATE TABLE `tt+2`; Table Create Table tt+2 CREATE TEMPORARY TABLE `tt+2` ( `c1` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 DROP TABLE `tt+1`, `tt+2`; CREATE TABLE `#sql1` (c1 INT); CREATE TABLE `@0023sql2` (c1 INT); @@ -1015,12 +1015,12 @@ SHOW CREATE TABLE `#sql2`; Table Create Table #sql2 CREATE TEMPORARY TABLE `#sql2` ( `c1` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 SHOW CREATE TABLE `@0023sql1`; Table Create Table @0023sql1 CREATE TEMPORARY TABLE `@0023sql1` ( `c1` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 DROP TABLE `#sql2`, `@0023sql1`; DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; @@ -1340,3 +1340,43 @@ rename table t2 to t1; execute stmt1; deallocate prepare stmt1; drop table t2; +CREATE TABLE t1 ( +id INT(11) NOT NULL, +x_param INT(11) DEFAULT NULL, +PRIMARY KEY (id) +); +ALTER TABLE t1 ADD COLUMN IF NOT EXISTS id INT, +ADD COLUMN IF NOT EXISTS lol INT AFTER id; +Warnings: +Note 1060 Duplicate column name 'id' +ALTER TABLE t1 ADD COLUMN IF NOT EXISTS lol INT AFTER id; +Warnings: +Note 1060 Duplicate column name 'lol' +ALTER TABLE t1 DROP COLUMN IF EXISTS lol; +ALTER TABLE t1 DROP COLUMN IF EXISTS lol; +Warnings: +Note 1091 Can't DROP 'lol'; check that column/key exists +ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); +ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); +Warnings: +Note 1061 Duplicate key name 'x_param' +ALTER TABLE t1 MODIFY IF EXISTS lol INT; +Warnings: +Note 1054 Unknown column 'lol' in 't1' +DROP INDEX IF EXISTS x_param ON t1; +DROP INDEX IF EXISTS x_param ON t1; +Warnings: +Note 1091 Can't DROP 'x_param'; check that column/key exists +CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); +CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); +Warnings: +Note 1061 Duplicate key name 'x_param1' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `x_param` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `x_param1` (`x_param`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/r/alter_table_trans.result b/mysql-test/r/alter_table_trans.result index 3dd5c00d3d8..6e034e47e76 100644 --- a/mysql-test/r/alter_table_trans.result +++ b/mysql-test/r/alter_table_trans.result @@ -2,5 +2,5 @@ drop table if exists t1,t2; CREATE TABLE t1 (a INT, INDEX(a)) engine=innodb; ALTER TABLE t1 RENAME TO t2, DISABLE KEYS; Warnings: -Note 1031 Table storage engine for 't1' doesn't have this option +Note 1031 Storage engine InnoDB of the table `test`.`t1` doesn't have this option DROP TABLE t2; 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/cache_temporal_4265.result b/mysql-test/r/cache_temporal_4265.result new file mode 100644 index 00000000000..1b4b3c2c4aa --- /dev/null +++ b/mysql-test/r/cache_temporal_4265.result @@ -0,0 +1,10 @@ +create table t1 (a date); +insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04'); +set debug_dbug='d,str_to_datetime_warn'; +select * from t1 where a > date_add('2000-01-01', interval 5 day); +a +2001-02-03 +2002-03-04 +Warnings: +Note 1003 2000-01-01 +drop table t1; diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 23417b16698..31f1d57f916 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -268,37 +268,37 @@ cast(010203101112.121314 as datetime) 0001-02-03 10:11:12 select cast(120010203101112.121314 as datetime); cast(120010203101112.121314 as datetime) -NULL +0000-00-00 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '120010203101112.121314' select cast(cast(1.1 as decimal) as datetime); cast(cast(1.1 as decimal) as datetime) -NULL +0000-00-00 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '1' select cast(cast(-1.1 as decimal) as datetime); cast(cast(-1.1 as decimal) as datetime) -NULL +0000-00-00 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '-1' select cast('0' as date); cast('0' as date) -NULL +0000-00-00 Warnings: Warning 1292 Incorrect datetime value: '0' select cast('' as date); cast('' as date) -NULL +0000-00-00 Warnings: Warning 1292 Incorrect datetime value: '' select cast('0' as datetime); cast('0' as datetime) -NULL +0000-00-00 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '0' select cast('' as datetime); cast('' as datetime) -NULL +0000-00-00 00:00:00 Warnings: Warning 1292 Incorrect datetime value: '' select cast('0' as time); @@ -306,7 +306,7 @@ cast('0' as time) 00:00:00 select cast('' as time); cast('' as time) -NULL +00:00:00 Warnings: Warning 1292 Truncated incorrect time value: '' select cast(NULL as DATE); @@ -323,13 +323,13 @@ cast(NULL as BINARY) NULL select cast(cast(120010203101112.121314 as double) as datetime); cast(cast(120010203101112.121314 as double) as datetime) -NULL +0000-00-00 00:00:00 select cast(cast(1.1 as double) as datetime); cast(cast(1.1 as double) as datetime) 0000-00-00 00:00:01 select cast(cast(-1.1 as double) as datetime); cast(cast(-1.1 as double) as datetime) -NULL +0000-00-00 00:00:00 explain extended select cast(10 as double(5,2)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 7c556354d2e..7e814283d32 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -31,9 +31,9 @@ Warnings: Note 1051 Unknown table 't1' Note 1051 Unknown table 't2' create table t1 (b char(0) not null, index(b)); -ERROR 42000: The used storage engine can't index column 'b' +ERROR 42000: The storage engine MyISAM can't index column `b` create table t1 (a int not null,b text) engine=heap; -ERROR 42000: The used table type doesn't support BLOB/TEXT columns +ERROR 42000: Storage engine MEMORY doesn't support BLOB/TEXT columns drop table if exists t1; Warnings: Note 1051 Unknown table 't1' @@ -1899,25 +1899,36 @@ create table t3 (a int) row_format=page; drop table t1,t2,t3; # -- End of Bug#45829 -# new table creation/renaming blocked if old encoded table present -create table `t-1` (a int) engine=myisam; -insert into `t-1` values (1); +create table `#mysql50#t-1` (a int) engine=myisam; +insert into `#mysql50#t-1` values (1); show tables; Tables_in_test -t-1 -flush tables; -convert table files in mysql 5.0 file name encoding +#mysql50#t-1 +create table `t-1` (a int); show tables; Tables_in_test #mysql50#t-1 -create table `t-1` (a int); -ERROR 42S01: Table '#mysql50#t-1' already exists +t-1 +select * from `t-1`; +a +select * from `#mysql50#t-1`; +a +1 +drop table `t-1`; create table t1 (a int); alter table t1 rename `t-1`; -ERROR 42S01: Table '#mysql50#t-1' already exists +show tables; +Tables_in_test +#mysql50#t-1 +t-1 +drop table `t-1`; +create table t1 (a int); rename table t1 to `t-1`; -ERROR 42S01: Table '#mysql50#t-1' already exists -drop table `#mysql50#t-1`, t1; +show tables; +Tables_in_test +#mysql50#t-1 +t-1 +drop table `#mysql50#t-1`, `t-1`; End of 5.1 tests diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 7f69fd1a5a4..3bbd25cbbcc 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -521,7 +521,7 @@ TIME_FORMAT("25:00:00", '%l %p') 1 AM SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896); DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896) -NULL +1151414896 Warnings: Warning 1292 Incorrect datetime value: '%Y-%m-%d %H:%i:%s' select str_to_date('04 /30/2004', '%m /%d/%Y'); 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/derived_view.result b/mysql-test/r/derived_view.result index bce1da10e35..40420a15c25 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -2164,6 +2164,57 @@ a set optimizer_switch=@save3912_optimizer_switch; drop table t1, t2, t3; # +# MDEV-4209: equi-join on BLOB column from materialized view +# or derived table +# +set @save_optimizer_switch=@@optimizer_switch; +set optimizer_switch='derived_with_keys=on'; +CREATE TABLE t1 (c1 text, c2 int); +INSERT INTO t1 VALUES ('a',1), ('c',3), ('g',7), ('d',4), ('c',3); +CREATE TABLE t2 (c1 text, c2 int); +INSERT INTO t2 VALUES ('b',2), ('c',3); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; +EXPLAIN EXTENDED +SELECT v1.c1, v1.c2 FROM v1, t2 WHERE v1.c1=t2.c1 AND v1.c2=t2.c2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 2 100.00 Using where +2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 +Warnings: +Note 1003 select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where ((`v1`.`c1` = `test`.`t2`.`c1`) and (`v1`.`c2` = `test`.`t2`.`c2`)) +SELECT v1.c1, v1.c2 FROM v1, t2 WHERE v1.c1=t2.c1 AND v1.c2=t2.c2; +c1 c2 +c 3 +c 3 +EXPLAIN EXTENDED +SELECT t2.c1, t2.c2 FROM (SELECT c1 g, MAX(c2) m FROM t1 GROUP BY c1) t, t2 +WHERE t.g=t2.c1 AND t.m=t2.c2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 2 100.00 Using where +2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort +Warnings: +Note 1003 select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from (select `test`.`t1`.`c1` AS `g`,max(`test`.`t1`.`c2`) AS `m` from `test`.`t1` group by `test`.`t1`.`c1`) `t` join `test`.`t2` where ((`t`.`g` = `test`.`t2`.`c1`) and (`t`.`m` = `test`.`t2`.`c2`)) +SELECT t2.c1, t2.c2 FROM (SELECT c1 g, MAX(c2) m FROM t1 GROUP BY c1) t, t2 +WHERE t.g=t2.c1 AND t.m=t2.c2; +c1 c2 +c 3 +EXPLAIN EXTENDED +SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) +2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 +Warnings: +Note 1003 select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2`,`test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where (`v1`.`c1` = `test`.`t2`.`c1`) +SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1; +c1 c2 c1 c2 +c 3 c 3 +c 3 c 3 +DROP VIEW v1; +DROP TABLE t1,t2; +set optimizer_switch=@save_optimizer_switch; +# # end of 5.3 tests # set optimizer_switch=@exit_optimizer_switch; diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result index db3aa770499..55309e54fb3 100644 --- a/mysql-test/r/drop.result +++ b/mysql-test/r/drop.result @@ -142,9 +142,9 @@ create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ERROR 42000: Incorrect table name '#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12345' show tables; Tables_in_mysqltestbug26703 +#mysql50#abc`def aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1234 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -#mysql50#abc`def use test; drop database mysqltestbug26703; End of 5.1 tests diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 925fb38a0f8..172179bd7f4 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -182,13 +182,13 @@ select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212 AS unsigned int),1) as unsigned) AS `column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int)` +Note 1003 select column_get(column_create(1,1212 AS unsigned int),1 as unsigned) AS `column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned int)` explain extended select column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212 AS unsigned int),1) as unsigned) AS `column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned)` +Note 1003 select column_get(column_create(1,1212 AS unsigned int),1 as unsigned) AS `column_get(column_create(1, 1212 AS unsigned int), 1 as unsigned)` select column_get(column_create(1, 1212 AS decimal), 1 as unsigned int); column_get(column_create(1, 1212 AS decimal), 1 as unsigned int) 1212 @@ -261,13 +261,13 @@ select column_get(column_create(1, 1212 AS int), 1 as int); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212 AS int),1) as signed) AS `column_get(column_create(1, 1212 AS int), 1 as int)` +Note 1003 select column_get(column_create(1,1212 AS int),1 as signed) AS `column_get(column_create(1, 1212 AS int), 1 as int)` explain extended select column_get(column_create(1, 1212 AS int), 1 as signed int); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212 AS int),1) as signed) AS `column_get(column_create(1, 1212 AS int), 1 as signed int)` +Note 1003 select column_get(column_create(1,1212 AS int),1 as signed) AS `column_get(column_create(1, 1212 AS int), 1 as signed int)` select column_get(column_create(1, -1212 AS int), 1 as int); column_get(column_create(1, -1212 AS int), 1 as int) -1212 @@ -368,7 +368,7 @@ select column_get(column_create(1, "1212" AS char charset utf8), 1 as char chars id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,'1212' AS char charset utf8 ),1) as char charset utf8) AS `column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8)` +Note 1003 select column_get(column_create(1,'1212' AS char charset utf8 ),1 as char charset utf8) AS `column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset utf8)` select column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8); column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8) 1212 @@ -428,7 +428,7 @@ select column_get(column_create(1, "1212" AS char charset utf8), 1 as char chars id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,'1212' AS char charset utf8 ),1) as char charset binary) AS `column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary)` +Note 1003 select column_get(column_create(1,'1212' AS char charset utf8 ),1 as char charset binary) AS `column_get(column_create(1, "1212" AS char charset utf8), 1 as char charset binary)` # # column get real # @@ -440,13 +440,13 @@ select column_get(column_create(1, 1212.12 AS double), 1 as double); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as double) AS `column_get(column_create(1, 1212.12 AS double), 1 as double)` +Note 1003 select column_get(column_create(1,1212.12 AS double),1 as double) AS `column_get(column_create(1, 1212.12 AS double), 1 as double)` explain extended select column_get(column_create(1, 1212.12 AS double), 1 as double(6,2)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as double(6,2)) AS `column_get(column_create(1, 1212.12 AS double), 1 as double(6,2))` +Note 1003 select column_get(column_create(1,1212.12 AS double),1 as double(6,2)) AS `column_get(column_create(1, 1212.12 AS double), 1 as double(6,2))` select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as double); column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as double) 1.8446744073709552e19 @@ -521,13 +521,13 @@ select column_get(column_create(1, 1212.12 AS double), 1 as decimal); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as decimal(10,0)) AS `column_get(column_create(1, 1212.12 AS double), 1 as decimal)` +Note 1003 select column_get(column_create(1,1212.12 AS double),1 as decimal(10,0)) AS `column_get(column_create(1, 1212.12 AS double), 1 as decimal)` explain extended select column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select cast(column_get(column_create(1,1212.12 AS double),1) as decimal(6,2)) AS `column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2))` +Note 1003 select column_get(column_create(1,1212.12 AS double),1 as decimal(6,2)) AS `column_get(column_create(1, 1212.12 AS double), 1 as decimal(6,2))` select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal(20,0)); column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as decimal(20,0)) 18446744073709551615 @@ -1336,6 +1336,77 @@ select hex(COLUMN_CREATE(0, 0.0 as decimal)); hex(COLUMN_CREATE(0, 0.0 as decimal)) 000100000004 # +# MDEV-4292: parse error when selecting on views using dynamic column +# +create table t1 (i int, d blob); +create view v1 as select i, column_get(d, 1 as binary) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as char charset binary) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as int) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as signed) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as unsigned int) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as unsigned) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as date) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as date) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as time) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as time) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as datetime) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as datetime) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as decimal) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as decimal(10,0)) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as double) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as double) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +create view v1 as select i, column_get(d, 1 as char) as a from t1; +select * from v1; +i a +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i`,column_get(`t1`.`d`,1 as char charset latin1) AS `a` from `t1` latin1 latin1_swedish_ci +drop view v1; +drop table t1; +# +# end of 5.3 tests +# +# # test of symbolic names # # creation test (names) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index c067ff02574..e6abd44c267 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -699,3 +699,14 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 5.1 tests +CREATE TABLE t1 ( +id int(11) auto_increment, +title varchar(100) default '', +PRIMARY KEY (id), +KEY ind5 (title) +) ENGINE=MyISAM; +CREATE FULLTEXT INDEX IF NOT EXISTS ft1 ON t1(title); +CREATE FULLTEXT INDEX IF NOT EXISTS ft1 ON t1(title); +Warnings: +Note 1061 Duplicate key name 'ft1' +DROP TABLE t1; diff --git a/mysql-test/r/fulltext_derived_4316.result b/mysql-test/r/fulltext_derived_4316.result new file mode 100644 index 00000000000..141202c9842 --- /dev/null +++ b/mysql-test/r/fulltext_derived_4316.result @@ -0,0 +1,8 @@ +create table t1 (ft text) engine=myisam; +insert into t1 values ('test1'),('test2'); +select distinct match(ft) against("test1" in boolean mode) from +(select distinct ft from t1) as t; +match(ft) against("test1" in boolean mode) +1 +0 +drop table t1; diff --git a/mysql-test/r/func_date_add.result b/mysql-test/r/func_date_add.result index a7f2383848d..e8fbba786a4 100644 --- a/mysql-test/r/func_date_add.result +++ b/mysql-test/r/func_date_add.result @@ -96,3 +96,9 @@ b + interval a day 2002-02-04 drop table t1; End of 5.0 tests +create table t1 (a varchar(10)); +insert t1 values ('2000-12-03'),('2008-05-03'); +select * from t1 where case a when adddate( '2012-12-12', 7 ) then true end; +a +drop table t1; +End of 5.5 tests diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 65323257300..c6fa040246a 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1837,10 +1837,10 @@ INSERT INTO t2 VALUES EXPLAIN EXTENDED SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT 3,4) AND a<10; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 range a a 4 NULL 4 100.00 Using where; Using index +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (<cache>(<in_optimizer>((1,2),<exists>(select 3,4 having (((1 = 3) or isnull(3)) and ((2 = 4) or isnull(4)) and <is_not_null_test>(3) and <is_not_null_test>(4))))) and (`test`.`t1`.`a` < 10)) +Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where 0 SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT 3,4) AND a<10; MAX(a) NULL @@ -1851,7 +1851,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 range a a 4 NULL 4 100.00 Using where; Using index; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = 2) and (`test`.`t2`.`a` = 1) and (`test`.`t1`.`a` < 10)) +Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`a` = 1) and (`test`.`t2`.`b` = 2) and (`test`.`t1`.`a` < 10)) SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10; MAX(a) NULL @@ -2090,6 +2090,13 @@ set @@optimizer_switch=@save_optimizer_switch; # Cleanup for BUG#46680 # DROP TABLE IF EXISTS t1,t2,t3,empty1; +create table t1 (i int, d date); +insert into t1 values (1, '2008-10-02'), (2, '2010-12-12'); +select avg(export_set( 3, 'y', sha(i))), group_concat(d) from t1 group by d order by i; +avg(export_set( 3, 'y', sha(i))) group_concat(d) +0 2008-10-02 +0 2010-12-12 +drop table t1; # # Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(), # file .\item_sum.cc, line 587 diff --git a/mysql-test/r/func_group_innodb.result b/mysql-test/r/func_group_innodb.result index 67ea44f187a..9489960d28c 100644 --- a/mysql-test/r/func_group_innodb.result +++ b/mysql-test/r/func_group_innodb.result @@ -217,7 +217,20 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = member_id_to COUNT(*) 518491 2 DROP TABLE t1; -# End of test BUG#12713907 +# +# MDEV-4269: crash when grouping by values() +# +SELECT @@storage_engine INTO @old_engine; +set storage_engine=innodb; +create table y select 1 b; +select 1 from y group by b; +1 +1 +select 1 from y group by values(b); +1 +1 +drop table y; +SET storage_engine=@old_engine; # # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN # diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 55b0f9d3c57..a033c91bc05 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -338,6 +338,227 @@ set optimizer_switch=@optimizer_switch_save; drop view v_merge, vm; drop table t1,tv; # +# GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test +# +# IS_USED_LOCK, IS_FREE_LOCK: the lock is not acquired +# Note: IS_USED_LOCK returns NULL if the lock is unused +select is_used_lock('test'); +is_used_lock('test') +NULL +select is_free_lock('test'); +is_free_lock('test') +1 +# GET_LOCK returns 1 if it manages to acquire a lock +select get_lock('test', 0); +get_lock('test', 0) +1 +# IS_USED_LOCK, IS_FREE_LOCK: the lock is acquired +select is_free_lock('test'); +is_free_lock('test') +0 +select is_used_lock('test') = connection_id(); +is_used_lock('test') = connection_id() +1 +# -> Switching to connection 'con1' +# IS_USED_LOCK, IS_FREE_LOCK: the lock is acquired in another +# connection +select is_used_lock('test') = connection_id(); +is_used_lock('test') = connection_id() +0 +select is_free_lock('test'); +is_free_lock('test') +0 +# GET_LOCK returns 0 if it can't acquire a lock (wait timeout) +select get_lock('test', 0); +get_lock('test', 0) +0 +# RELEASE_LOCK returns 0 if the lock belongs to another connection +select release_lock('test'); +release_lock('test') +0 +# -> Switching to connection 'default' +# RELEASE_LOCK returns 1 if it successfully releases a lock +select release_lock('test'); +release_lock('test') +1 +# RELEASE_LOCK returns NULL if it doesn't release a lock and there is no such lock +select release_lock('test'); +release_lock('test') +NULL +# Test that get_lock() returns NULL if error. +select get_lock('test', 0); +get_lock('test', 0) +1 +# -> Switching to connection 'con1' +create table t1 select connection_id() as id; +select get_lock('test', 7200); +# -> Switching to connection 'default' +select (@id := id) - id from t1; +(@id := id) - id +0 +kill query @id; +# -> Switching to connection 'con1' +get_lock('test', 7200) +NULL +# -> Switching to connection 'default' +# GET_LOCK() works recursively +select get_lock('test', 0); +get_lock('test', 0) +1 +select get_lock('test', 0); +get_lock('test', 0) +1 +select get_lock('test', 0); +get_lock('test', 0) +1 +# RELEASE_LOCK() needs to be called recursively then, too +select release_lock('test'); +release_lock('test') +1 +select release_lock('test'); +release_lock('test') +1 +select release_lock('test'); +release_lock('test') +1 +# Once the last instance of the lock is released, +# the next call returns NULL +select release_lock('test'); +release_lock('test') +1 +# Multiple locks in the same session are OK +select get_lock('test1', 0); +get_lock('test1', 0) +1 +select get_lock('test2', 0); +get_lock('test2', 0) +1 +select get_lock('test3', 0); +get_lock('test3', 0) +1 +select release_lock('test1'); +release_lock('test1') +1 +select release_lock('test2'); +release_lock('test2') +1 +select release_lock('test3'); +release_lock('test3') +1 +# Deadlocks are detected e.g. in case of a mutual wait +select get_lock('test1', 0); +get_lock('test1', 0) +1 +# -> Switching to connection 'con1' +select get_lock('test2', 0); +get_lock('test2', 0) +1 +select get_lock('test1', 7200); +# -> Switching to connection 'default' +select get_lock('test2', 7200); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +select release_lock('test1'); +release_lock('test1') +1 +# -> Switching to connection 'con1' +get_lock('test1', 7200) +1 +select release_lock('test2'); +release_lock('test2') +1 +select release_lock('test1'); +release_lock('test1') +1 +# -> Switching to connection 'default' +# LOCK/UNLOCK TABLES works fine with a user lock. +lock table t1 write; +select get_lock('test', 0); +get_lock('test', 0) +1 +unlock tables; +commit; +select release_lock('test'); +release_lock('test') +1 +# GLOBAL READ LOCK works with fine with user locks +select get_lock('test1', 0); +get_lock('test1', 0) +1 +flush tables with read lock; +select get_lock('test2', 0); +get_lock('test2', 0) +1 +unlock tables; +commit; +select release_lock('test1'); +release_lock('test1') +1 +select release_lock('test2'); +release_lock('test2') +1 +# BEGIN/COMMIT/ROLLBACK don't unlock user locks. +begin; +select get_lock('test1', 0); +get_lock('test1', 0) +1 +select get_lock('test2', 0); +get_lock('test2', 0) +1 +select count(*) from t1; +count(*) +1 +rollback; +select release_lock('test1'); +release_lock('test1') +1 +select release_lock('test2'); +release_lock('test2') +1 +# Deadlocks between user locks and LOCK TABLES locks +# are detected OK. +select get_lock('test', 0); +get_lock('test', 0) +1 +# -> Switching to connection 'con1' +lock table t1 write; +select get_lock('test', 7200); +# -> Switching to connection 'default' +lock table t1 read; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +select release_lock('test'); +release_lock('test') +1 +# -> Switching to connection 'con1' +get_lock('test', 7200) +1 +select release_lock('test'); +release_lock('test') +1 +unlock tables; +# cleanup +drop table t1; +# check too long identifier names +select get_lock(repeat('a', 192), 0); +get_lock(repeat('a', 192), 0) +1 +select is_used_lock(repeat('a', 192)) = connection_id(); +is_used_lock(repeat('a', 192)) = connection_id() +1 +select is_free_lock(repeat('a', 192)); +is_free_lock(repeat('a', 192)) +0 +select release_lock(repeat('a', 192)); +release_lock(repeat('a', 192)) +1 +select get_lock(repeat('a', 193), 0); +ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long +select is_used_lock(repeat('a', 193)); +ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long +select is_free_lock(repeat('a', 193)); +ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long +select release_lock(repeat('a', 193)); +ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long +# # End of 5.5 tests # # diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index fa3d37c08c2..1f20ddc6cbb 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -168,7 +168,7 @@ date("1997-12-31 23:59:59.000001") 1997-12-31 select date("1997-13-31 23:59:59.000001"); date("1997-13-31 23:59:59.000001") -NULL +0000-00-00 Warnings: Warning 1292 Incorrect datetime value: '1997-13-31 23:59:59.000001' select time("1997-12-31 23:59:59.000001"); @@ -176,7 +176,7 @@ time("1997-12-31 23:59:59.000001") 23:59:59.000001 select time("1997-12-31 25:59:59.000001"); time("1997-12-31 25:59:59.000001") -NULL +00:00:00 Warnings: Warning 1292 Truncated incorrect time value: '1997-12-31 25:59:59.000001' select microsecond("1997-12-31 23:59:59.000001"); diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 80729545902..16c0854241f 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2634,6 +2634,31 @@ SELECT * FROM t1; a aaaaaaaaaaaaaa DROP TABLE t1; +SELECT SUBSTRING('1', DAY(FROM_UNIXTIME(-1))); +SUBSTRING('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT LEFT('1', DAY(FROM_UNIXTIME(-1))); +LEFT('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT RIGHT('1', DAY(FROM_UNIXTIME(-1))); +RIGHT('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT REPEAT('1', DAY(FROM_UNIXTIME(-1))); +REPEAT('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT RPAD('hi', DAY(FROM_UNIXTIME(-1)),'?'); +RPAD('hi', DAY(FROM_UNIXTIME(-1)),'?') +NULL +SELECT LPAD('hi', DAY(FROM_UNIXTIME(-1)),'?'); +LPAD('hi', DAY(FROM_UNIXTIME(-1)),'?') +NULL +create table t1 (i int); +insert into t1 values (null),(8); +select group_concat( i ), make_set( i, 'a', 'b' ) field from t1 group by field; +group_concat( i ) field +NULL NULL +8 +drop table t1; End of 5.1 tests Start of 5.4 tests SELECT format(12345678901234567890.123, 3); @@ -2864,9 +2889,6 @@ sha1('P'), Warnings: Warning 1292 Truncated incorrect DECIMAL value: '[.DC2.]' SET @@global.max_allowed_packet:= @tmp_max; -# -# End of 5.5 tests -# SELECT @tmp_max:= @@global.max_allowed_packet; @tmp_max:= @@global.max_allowed_packet 1048576 @@ -2880,3 +2902,15 @@ NULL Warnings: Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated SET @@global.max_allowed_packet:= @tmp_max; +# +# MDEV-4272: DIV operator crashes in Item_func_int_div::val_int +# (incorrect NULL value handling by convert) +# +create table t1(a int) select null; +select 1 div convert(a using utf8) from t1; +1 div convert(a using utf8) +NULL +drop table t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index dd4b73b0b05..e8526ae8f1f 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1781,7 +1781,7 @@ Warnings: Warning 1441 Datetime function: time field overflow select cast('131415.123e0' as time); cast('131415.123e0' as time) -NULL +00:00:00 Warnings: Warning 1292 Truncated incorrect time value: '131415.123e0' select cast('2010-01-02 03:04:05' as datetime) between null and '2010-01-02 03:04:04'; @@ -1801,12 +1801,12 @@ unix_timestamp(null) NULL select truncate(date('2010-40-10'), 6); truncate(date('2010-40-10'), 6) -NULL +0.000000 Warnings: Warning 1292 Incorrect datetime value: '2010-40-10' select extract(month from '2010-40-50'); extract(month from '2010-40-50') -NULL +0 Warnings: Warning 1292 Incorrect datetime value: '2010-40-50' select subtime('0000-00-10 10:10:10', '30 10:00:00'); @@ -1924,3 +1924,15 @@ microsecond('12:00:00.123456') microsecond('2009-12-31 23:59:59.000010') 123456 10 select now(258); ERROR 42000: Too big precision 258 specified for 'now'. Maximum is 6. +SELECT 1 FROM DUAL WHERE YEAR(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE MONTH(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE DAYOFMONTH(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE HOUR(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12')); +1 diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 26787366358..c394aec8851 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -758,7 +758,7 @@ SPATIAL KEY(g) INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); drop table t1; CREATE TABLE t1 ( -line LINESTRING NOT NULL, +line GEOMETRY NOT NULL, kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', name VARCHAR(32), SPATIAL KEY (line) @@ -1553,7 +1553,7 @@ End of 5.0 tests. # Bug #57323/11764487: myisam corruption with insert ignore # and invalid spatial data # -CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL, +CREATE TABLE t1(a POINT NOT NULL, b GEOMETRY NOT NULL, SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM; INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)")); INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error"); diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 30385323502..eb9f1a57c32 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -406,20 +406,20 @@ FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second first second w c o e d t i r 120 120 1 1 0 1 0 1 1 0 120 121 0 0 1 0 0 0 1 0 -120 122 0 1 NULL 0 NULL 0 NULL 0 -120 123 0 1 NULL 0 NULL 0 NULL 0 +120 122 NULL NULL NULL NULL NULL NULL NULL NULL +120 123 NULL NULL NULL NULL NULL NULL NULL NULL 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 1 1 0 -121 122 0 1 NULL 0 NULL 0 NULL 0 -121 123 0 1 NULL 0 NULL 0 NULL 0 -122 120 1 0 NULL 0 NULL 0 NULL 0 -122 121 1 0 NULL 0 NULL 0 NULL 0 -122 122 1 1 NULL 1 NULL 0 NULL 0 -122 123 1 1 NULL 1 NULL 0 NULL 0 -123 120 1 0 NULL 0 NULL 0 NULL 0 -123 121 1 0 NULL 0 NULL 0 NULL 0 -123 122 1 1 NULL 1 NULL 0 NULL 0 -123 123 1 1 NULL 1 NULL 0 NULL 0 +121 122 NULL NULL NULL NULL NULL NULL NULL NULL +121 123 NULL NULL NULL NULL NULL NULL NULL NULL +122 120 NULL NULL NULL NULL NULL NULL NULL NULL +122 121 NULL NULL NULL NULL NULL NULL NULL NULL +122 122 NULL NULL NULL NULL NULL NULL NULL NULL +122 123 NULL NULL NULL NULL NULL NULL NULL NULL +123 120 NULL NULL NULL NULL NULL NULL NULL NULL +123 121 NULL NULL NULL NULL NULL NULL NULL NULL +123 122 NULL NULL NULL NULL NULL NULL NULL NULL +123 123 NULL NULL NULL NULL NULL NULL NULL NULL explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -1047,7 +1047,7 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000 SET @a=POLYFROMWKB(@a); SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; SET @a=POLYFROMWKB(@a); -create table t1(a polygon NOT NULL)engine=myisam; +create table t1(a geometry NOT NULL)engine=myisam; insert into t1 values (geomfromtext("point(0 1)")); insert into t1 values (geomfromtext("point(1 0)")); select * from (select polygon(t1.a) as p from t1 order by t1.a) d; @@ -1063,6 +1063,84 @@ create table t1(a char(32) not null) engine=myisam; create spatial index i on t1 (a); ERROR HY000: Incorrect arguments to SPATIAL INDEX drop table t1; +CREATE TABLE t0 (a BINARY(32) NOT NULL); +CREATE SPATIAL INDEX i on t0 (a); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +INSERT INTO t0 VALUES (1); +CREATE TABLE t1( +col0 BINARY NOT NULL, +col2 TIMESTAMP, +SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t1 ( +col0 BINARY NOT NULL, +col2 TIMESTAMP +) ENGINE=MyISAM; +CREATE SPATIAL INDEX idx0 ON t1(col0); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t2 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 POINT +); +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t3 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 LINESTRING, +SPATIAL INDEX i1 (col1, col2) +); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +DROP TABLE t0, t1, t2; +# +# BUG#12414917 - ISCLOSED() CRASHES ON 64-BIT BUILDS +# +SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20))); +ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20))) +NULL +# +# BUG#12537203 - CRASH WHEN SUBSELECTING GLOBAL VARIABLES IN +# GEOMETRY FUNCTION ARGUMENTS +# +SELECT GEOMETRYCOLLECTION((SELECT @@OLD)); +ERROR 22007: Illegal non geometric '' value found during parsing +# +# MDEV-4252 geometry query crashes server +# +select astext(0x0100000000030000000100000000000010); +astext(0x0100000000030000000100000000000010) +NULL +select astext(st_centroid(0x0100000000030000000100000000000010)); +astext(st_centroid(0x0100000000030000000100000000000010)) +NULL +select astext(st_exteriorring(0x0100000000030000000100000000000010)); +astext(st_exteriorring(0x0100000000030000000100000000000010)) +NULL +select envelope(0x0100000000030000000100000000000010); +envelope(0x0100000000030000000100000000000010) +NULL +select geometryn(0x0100000000070000000100000001030000000200000000000000ffff0000, 1); +geometryn(0x0100000000070000000100000001030000000200000000000000ffff0000, 1) +NULL +select geometryn(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1); +geometryn(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1) +NULL +# +# MDEV-4296 Assertion `n_linear_rings > 0' fails in Gis_polygon::centroid_xy +# +SELECT Centroid( AsBinary( LineString(Point(0,0), Point(0,0), Point(0,0) ))); +Centroid( AsBinary( LineString(Point(0,0), Point(0,0), Point(0,0) ))) +NULL +# +# MDEV-4295 Server crashes in get_point on a query with Area, AsBinary, MultiPoint +# +SELECT Area(AsBinary(MultiPoint(Point(0,9), Point(0,1), Point(2,2)))); +Area(AsBinary(MultiPoint(Point(0,9), Point(0,1), Point(2,2)))) +NULL End of 5.1 tests select ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')); ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')) @@ -1428,6 +1506,7 @@ WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; count(*) 1 DROP DATABASE gis_ogs; +USE test; # # BUG #1043845 st_distance() results are incorrect depending on variable order # @@ -1451,20 +1530,23 @@ geomfromtext('LINESTRING(-95.9673005697771 36.13509598461, -95.9673057475387 36.1344478941074, -95.9673063519371 36. 0.008148695928146028 -USE test; # -# BUG#12414917 - ISCLOSED() CRASHES ON 64-BIT BUILDS +# MDEV-4310 geometry function equals hangs forever. # -SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20))); -ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20))) +create table t1(a geometry not null)engine=myisam; +insert into t1 values(geomfromtext("POINT(0 0)")); +insert into t1 values(geomfromtext("POINT(0 9.2233720368548e18)")); +insert into t1 values(geomfromtext("POINT(0 9.2233720368548e18)")); +select equals(`a`,convert(`a` using utf8)) from `t1`; +equals(`a`,convert(`a` using utf8)) +1 NULL -# -# BUG#12537203 - CRASH WHEN SUBSELECTING GLOBAL VARIABLES IN -# GEOMETRY FUNCTION ARGUMENTS -# -SELECT GEOMETRYCOLLECTION((SELECT @@OLD)); -ERROR 22007: Illegal non geometric '' value found during parsing -End of 5.1 tests +NULL +Warnings: +Warning 1300 Invalid utf8 character string: 'E043' +Warning 1300 Invalid utf8 character string: 'E043' +drop table t1; +End of 5.3 tests # # Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE # @@ -1491,4 +1573,11 @@ SELECT 1 FROM g1 WHERE a >= ANY (SELECT 1 FROM g1 WHERE a = geomfromtext('') OR a) ; 1 DROP TABLE g1; +# +# MDEV-3819 missing constraints for spatial column types +# +create table t1 (pt point); +insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))')); +ERROR 22007: Incorrect POINT value: 'POLYGON' for column 'pt' at row 1 +drop table t1; End of 5.5 tests diff --git a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result index d0b6627cd0b..65ab92c1afd 100644 --- a/mysql-test/r/grant4.result +++ b/mysql-test/r/grant4.result @@ -86,9 +86,9 @@ GRANT SHOW VIEW, SELECT ON v3 to mysqltest_u1@localhost; use mysqltest_db1; ** Connect as restricted user mysqltest_u1. ** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do (authentication is enough). +** but will return no rows SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='t5'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT -def mysqltest_db1 t5 1 mysqltest_db1 i 1 s1 A NULL NULL NULL YES BTREE ** SHOW INDEX FROM t5 will fail because we don't have any privileges on any column combination. SHOW INDEX FROM t5; ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5' diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 085003c7790..a1f19204274 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1946,6 +1946,250 @@ Warning 1292 Truncated incorrect INTEGER value: 'K' Warning 1292 Truncated incorrect INTEGER value: 'jxW<' DROP TABLE t1; SET BIG_TABLES=0; +# +# MDEV-641 LP:1002108 - Wrong result (or crash) from a query with duplicated field in the group list and a limit clause +# Bug#11761078: 53534: INCORRECT 'SELECT SQL_BIG_RESULT...' +# WITH GROUP BY ON DUPLICATED FIELDS +# +CREATE TABLE t1( +col1 int, +UNIQUE INDEX idx (col1)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10), +(11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +EXPLAIN SELECT col1 AS field1, col1 AS field2 +FROM t1 GROUP BY field1, field2;; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL idx 5 NULL 20 Using index; Using temporary; Using filesort +FLUSH STATUS; +SELECT col1 AS field1, col1 AS field2 +FROM t1 GROUP BY field1, field2;; +field1 field2 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +SHOW SESSION STATUS LIKE 'Sort_scan%'; +Variable_name Value +Sort_scan 1 +EXPLAIN SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2 +FROM t1 GROUP BY field1, field2;; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL idx 5 NULL 20 Using index; Using filesort +FLUSH STATUS; +SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2 +FROM t1 GROUP BY field1, field2;; +field1 field2 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +SHOW SESSION STATUS LIKE 'Sort_scan%'; +Variable_name Value +Sort_scan 1 +CREATE VIEW v1 AS SELECT * FROM t1; +SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2 +FROM v1 +GROUP BY field1, field2; +field1 field2 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +SELECT SQL_BIG_RESULT tbl1.col1 AS field1, tbl2.col1 AS field2 +FROM t1 as tbl1, t1 as tbl2 +GROUP BY field1, field2 +LIMIT 3; +field1 field2 +1 1 +1 2 +1 3 +explain +select col1 f1, col1 f2 from t1 order by f2, f1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL idx 5 NULL 20 Using index; Using filesort +select col1 f1, col1 f2 from t1 order by f2, f1; +f1 f2 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +explain +select col1 f1, col1 f2 from t1 group by f2 order by f2, f1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL idx 5 NULL 7 Using index for group-by; Using temporary; Using filesort +select col1 f1, col1 f2 from t1 group by f2 order by f2, f1; +f1 f2 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +explain +select col1 f1, col1 f2 from t1 group by f1, f2 order by f2, f1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL idx 5 NULL 20 Using index; Using temporary; Using filesort +select col1 f1, col1 f2 from t1 group by f1, f2 order by f2, f1; +f1 f2 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +CREATE TABLE t2( +col1 int, +col2 int, +UNIQUE INDEX idx (col1, col2)); +INSERT INTO t2(col1, col2) VALUES +(1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11), +(11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1); +explain +select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2, f3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL idx 10 NULL 20 Using index; Using temporary; Using filesort +select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2, f3; +f1 f2 f3 +1 20 1 +2 19 2 +3 18 3 +4 17 4 +5 16 5 +6 15 6 +7 14 7 +8 13 8 +9 12 9 +10 11 10 +11 10 11 +12 9 12 +13 8 13 +14 7 14 +15 6 15 +16 5 16 +17 4 17 +18 3 18 +19 2 19 +20 1 20 +explain +select col1 f1, col2 f2, col1 f3 from t2 order by f1, f2, f3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL idx 10 NULL 20 Using index; Using filesort +select col1 f1, col2 f2, col1 f3 from t2 order by f1, f2, f3; +f1 f2 f3 +1 20 1 +2 19 2 +3 18 3 +4 17 4 +5 16 5 +6 15 6 +7 14 7 +8 13 8 +9 12 9 +10 11 10 +11 10 11 +12 9 12 +13 8 13 +14 7 14 +15 6 15 +16 5 16 +17 4 17 +18 3 18 +19 2 19 +20 1 20 +DROP VIEW v1; +DROP TABLE t1, t2; # End of 5.1 tests # # LP bug#694450 Wrong result with non-standard GROUP BY + ORDER BY diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result index d1faec7f758..cc7c9c4d364 100644 --- a/mysql-test/r/group_min_max.result +++ b/mysql-test/r/group_min_max.result @@ -1714,7 +1714,7 @@ explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 50.78 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`c` = 'i121') and (`test`.`t1`.`b` = 'a') and (`test`.`t1`.`a2` >= 'b')) +Note 1003 select distinct `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 'a') and (`test`.`t1`.`c` = 'i121') and (`test`.`t1`.`a2` >= 'b')) explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 Using where; Using index for group-by @@ -1731,7 +1731,7 @@ explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 50.61 Using where; Using index Warnings: -Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` = 'i121') and (`test`.`t2`.`b` = 'a') and (`test`.`t2`.`a2` >= 'b')) +Note 1003 select distinct `test`.`t2`.`a1` AS `a1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`b` = 'a') and (`test`.`t2`.`c` = 'i121') and (`test`.`t2`.`a2` >= 'b')) explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by @@ -3187,6 +3187,106 @@ a b drop table t1; End of 5.1 tests # +# MDEV-765 lp:825075 - Wrong result with GROUP BY + multipart key + MIN/MAX loose scan +# +CREATE TABLE t1 (a varchar(1), b varchar(1), KEY (b,a)); +INSERT INTO t1 VALUES +('0',NULL),('9',NULL),('8','c'),('4','d'),('7','d'),(NULL,'f'), +('7','f'),('8','g'),(NULL,'j'); +explain +SELECT max(a) , b FROM t1 WHERE a IS NULL OR b = 'z' GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index b b 8 NULL 9 Using where; Using index +SELECT max(a) , b FROM t1 WHERE a IS NULL OR b = 'z' GROUP BY b; +max(a) b +NULL f +NULL j +explain +SELECT b, min(a) FROM t1 WHERE a = '7' OR b = 'z' GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index b b 8 NULL 9 Using where; Using index +SELECT b, min(a) FROM t1 WHERE a = '7' OR b = 'z' GROUP BY b; +b min(a) +d 7 +f 7 +explain +SELECT b, min(a) FROM t1 WHERE (a = b OR b = 'd' OR b is NULL) GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index b b 8 NULL 9 Using where; Using index +SELECT b, min(a) FROM t1 WHERE (a = b OR b = 'd' OR b is NULL) GROUP BY b; +b min(a) +NULL 0 +d 4 +explain +SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref b b 4 const 1 Using where; Using index +SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; +b min(a) +explain +SELECT b, min(a) FROM t1 WHERE a > '0' AND (b < (a = '7')) GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 8 NULL 9 Using where; Using index +SELECT b, min(a) FROM t1 WHERE a > '0' AND (b < (a = '7')) GROUP BY b; +b min(a) +d 7 +f 7 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'c' +Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DOUBLE value: 'f' +Warning 1292 Truncated incorrect DOUBLE value: 'g' +explain +SELECT b, min(a) FROM t1 WHERE (a > '0' AND (a > '1' OR b = 'd')) GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index b b 8 NULL 9 Using where; Using index +SELECT b, min(a) FROM t1 WHERE (a > '0' AND (a > '1' OR b = 'd')) GROUP BY b; +b min(a) +NULL 9 +c 8 +d 4 +f 7 +g 8 +drop table t1; +# +# MDEV-4140 Wrong result with GROUP BY + multipart key + MIN/MAX loose scan and a subquery +# +CREATE TABLE t1 (a int, b int, KEY (b, a)) ; +INSERT INTO t1 VALUES (0,99),(9,99),(4,0),(7,0),(99,0),(7,0),(8,0),(99,0),(1,0); +CREATE TABLE t2 (c int) ; +INSERT INTO t2 VALUES (0),(1); +EXPLAIN +SELECT MIN(a), b FROM t1 WHERE a > 0 GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL b 10 NULL 10 Using where; Using index for group-by +SELECT MIN(a), b FROM t1 WHERE a > 0 GROUP BY b; +MIN(a) b +1 0 +9 99 +EXPLAIN +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 range NULL b 10 NULL 10 Using where; Using index for group-by +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; +MIN(a) b +1 0 +9 99 +EXPLAIN +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT min(c) FROM t2, t1 t1a, t1 t1b WHERE c = 0 ) GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL b 10 NULL 9 Using where; Using index +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +2 SUBQUERY t1a index NULL b 10 NULL 9 Using index; Using join buffer (flat, BNL join) +2 SUBQUERY t1b index NULL b 10 NULL 9 Using index; Using join buffer (incremental, BNL join) +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT min(c) FROM t2, t1 t1a, t1 t1b WHERE c = 0 ) GROUP BY b; +MIN(a) b +1 0 +9 99 +drop table t1, t2; +End of 5.3 tests +# # WL#3220 (Loose index scan for COUNT DISTINCT) # CREATE TABLE t1 (a INT, b INT, c INT, KEY (a,b)); 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/having.result b/mysql-test/r/having.result index 5961a84cddc..a0a4fc42e2d 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -473,7 +473,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE table2 const PRIMARY PRIMARY 4 const 1 100.00 Using filesort 1 SIMPLE table1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = 9)) group by `test`.`table1`.`f1`,7 having ((7 = 8) and (`test`.`table1`.`f1` >= 6)) +Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where (`test`.`table1`.`f3` = 9) group by `test`.`table1`.`f1`,7 having ((7 = 8) and (`test`.`table1`.`f1` >= 6)) EXPLAIN EXTENDED SELECT table1.f1, table2.f2 FROM t1 AS table1 @@ -485,7 +485,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE table2 const PRIMARY PRIMARY 4 const 1 100.00 Using filesort 1 SIMPLE table1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where ((`test`.`table1`.`f3` = 9)) group by `test`.`table1`.`f1`,7 having (7 = 8) +Note 1003 select `test`.`table1`.`f1` AS `f1`,7 AS `f2` from `test`.`t1` `table1` join `test`.`t1` `table2` where (`test`.`table1`.`f3` = 9) group by `test`.`table1`.`f1`,7 having (7 = 8) DROP TABLE t1; # # Bug#52336 Segfault / crash in 5.1 copy_fields (param=0x9872980) at sql_select.cc:15355 diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result index 3d4fa27859d..c0016a8e5c3 100644 --- a/mysql-test/r/information_schema-big.result +++ b/mysql-test/r/information_schema-big.result @@ -36,6 +36,7 @@ KEY_COLUMN_USAGE CONSTRAINT_SCHEMA PARAMETERS SPECIFIC_SCHEMA PARTITIONS TABLE_SCHEMA PLUGINS PLUGIN_NAME +ALL_PLUGINS PLUGIN_NAME PROCESSLIST ID PROFILING QUERY_ID REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA @@ -88,6 +89,7 @@ KEY_COLUMN_USAGE CONSTRAINT_SCHEMA PARAMETERS SPECIFIC_SCHEMA PARTITIONS TABLE_SCHEMA PLUGINS PLUGIN_NAME +ALL_PLUGINS PLUGIN_NAME PROCESSLIST ID PROFILING QUERY_ID REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index a30fe668490..a7051f275d7 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -46,6 +46,7 @@ table_name not like 'ndb_%' AND table_name not like 'innodb_%' AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%'; select * from v1; c +ALL_PLUGINS CHARACTER_SETS CLIENT_STATISTICS COLLATIONS @@ -802,6 +803,7 @@ information_schema PARTITIONS PARTITION_EXPRESSION information_schema PARTITIONS SUBPARTITION_EXPRESSION information_schema PARTITIONS PARTITION_DESCRIPTION information_schema PLUGINS PLUGIN_DESCRIPTION +information_schema ALL_PLUGINS PLUGIN_DESCRIPTION information_schema PROCESSLIST INFO information_schema ROUTINES DTD_IDENTIFIER information_schema ROUTINES ROUTINE_DEFINITION @@ -1180,7 +1182,7 @@ group by column_type order by num; column_type group_concat(table_schema, '.', table_name) num varchar(27) information_schema.COLUMNS 1 varchar(7) information_schema.ROUTINES,information_schema.VIEWS 2 -varchar(20) information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PROFILING 6 +varchar(20) information_schema.FILES,information_schema.FILES,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.PLUGINS,information_schema.ALL_PLUGINS,information_schema.ALL_PLUGINS,information_schema.ALL_PLUGINS,information_schema.PROFILING 9 create table t1(f1 char(1) not null, f2 char(9) not null) default character set utf8; select CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH from diff --git a/mysql-test/r/information_schema_all_engines.result b/mysql-test/r/information_schema_all_engines.result index 455f2e36ffc..8b1aff8a209 100644 --- a/mysql-test/r/information_schema_all_engines.result +++ b/mysql-test/r/information_schema_all_engines.result @@ -1,6 +1,7 @@ use INFORMATION_SCHEMA; show tables; Tables_in_information_schema +ALL_PLUGINS CHARACTER_SETS CLIENT_STATISTICS COLLATIONS @@ -74,6 +75,7 @@ c2.table_name = t.table_name AND c2.column_name LIKE '%SCHEMA%' ) order by t.table_name; table_name column_name +ALL_PLUGINS PLUGIN_NAME CHARACTER_SETS CHARACTER_SET_NAME CLIENT_STATISTICS CLIENT COLLATIONS COLLATION_NAME @@ -147,6 +149,7 @@ c2.table_name = t.table_name AND c2.column_name LIKE '%SCHEMA%' ) order by t.table_name; table_name column_name +ALL_PLUGINS PLUGIN_NAME CHARACTER_SETS CHARACTER_SET_NAME CLIENT_STATISTICS CLIENT COLLATIONS COLLATION_NAME @@ -205,7 +208,7 @@ USER_PRIVILEGES GRANTEE USER_STATISTICS USER VIEWS TABLE_SCHEMA XTRADB_ADMIN_COMMAND result_message -select 1 as f1 from information_schema.tables where "CHARACTER_SETS"= +select 1 as f1 from information_schema.tables where "ALL_PLUGINS"= (select cast(table_name as char) from information_schema.tables order by table_name limit 1) limit 1; f1 @@ -226,6 +229,7 @@ c2.table_schema='information_schema' and group by c2.column_type order by num limit 1) group by t.table_name order by num1, t.table_name; table_name group_concat(t.table_schema, '.', t.table_name) num1 +ALL_PLUGINS information_schema.ALL_PLUGINS 1 CHARACTER_SETS information_schema.CHARACTER_SETS 1 CLIENT_STATISTICS information_schema.CLIENT_STATISTICS 1 COLLATIONS information_schema.COLLATIONS 1 @@ -288,6 +292,7 @@ VIEWS information_schema.VIEWS 1 +---------------------------------------+ Database: information_schema | Tables | +| ALL_PLUGINS | | CHARACTER_SETS | | CLIENT_STATISTICS | | COLLATIONS | @@ -351,6 +356,7 @@ Database: information_schema +---------------------------------------+ Database: INFORMATION_SCHEMA | Tables | +| ALL_PLUGINS | | CHARACTER_SETS | | CLIENT_STATISTICS | | COLLATIONS | @@ -417,5 +423,5 @@ Wildcard: inf_rmation_schema | information_schema | SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA; table_schema count(*) -information_schema 58 +information_schema 59 mysql 26 diff --git a/mysql-test/r/innodb_ext_key.result b/mysql-test/r/innodb_ext_key.result index 4e441245a39..0da4feaf26f 100644 --- a/mysql-test/r/innodb_ext_key.result +++ b/mysql-test/r/innodb_ext_key.result @@ -731,6 +731,7 @@ CREATE TABLE t2 (b int) ENGINE=MyISAM; INSERT INTO t1 (a) VALUES (4), (6); INSERT INTO t2 (b) VALUES (0), (8); set @save_optimizer_switch=@@optimizer_switch; +set @save_join_cache_level=@@join_cache_level; SET join_cache_level=3; SET optimizer_switch='join_cache_hashed=on'; SET optimizer_switch='join_cache_bka=on'; @@ -742,6 +743,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) SELECT * FROM t1, t2 WHERE b=a; a b +set join_cache_level=@save_join_cache_level; set optimizer_switch=@save_optimizer_switch; DROP TABLE t1,t2; # @@ -772,5 +774,97 @@ INSERT INTO t1 (c2, c3, c4) VALUES (58291525, 2580, 'foobar') ON DUPLICATE KEY UPDATE c4 = VALUES(c4); set optimizer_switch=@save_optimizer_switch; DROP TABLE t1; +# +# Bug mdev-4220: using ref instead of eq_ref +# with extended_keys=on +# (performance regression introduced in the patch for mdev-3851) +# +set @save_optimizer_switch=@@optimizer_switch; +create table t1 (a int not null) engine=innodb; +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 ( +pk int primary key, a int not null, b int, unique(a) +)engine=innodb; +insert into t2 +select +A.a + 10 * B.a, A.a + 10 * B.a, A.a + 10 * B.a +from t1 A, t1 B; +set optimizer_switch='extended_keys=off'; +explain +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 +1 SIMPLE t2 eq_ref a a 4 test.t1.a 1 Using where +flush status; +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +a pk a b +0 0 0 0 +1 1 1 1 +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 10 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 11 +set optimizer_switch='extended_keys=on'; +explain +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 10 +1 SIMPLE t2 eq_ref a a 4 test.t1.a 1 Using where +flush status; +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +a pk a b +0 0 0 0 +1 1 1 1 +show status like 'handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 10 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 11 +drop table t1,t2; +create table t1(a int) engine=myisam; +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2(a int) engine=myisam; +insert into t2 select A.a + 10*B.a + 100*C.a from t1 A, t1 B, t1 C; +create table t3 ( +pk1 int not null, pk2 int not null, col1 int not null, col2 int not null) +engine=innodb; +insert into t3 select a,a,a,a from t2; +alter table t3 add primary key (pk1, pk2); +alter table t3 add key (col1, col2); +set optimizer_switch='extended_keys=off'; +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref col1 col1 8 test.t1.a,test.t1.a # Using index +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref PRIMARY,col1 PRIMARY 4 test.t1.a # Using where +set optimizer_switch='extended_keys=on'; +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref col1 col1 8 test.t1.a,test.t1.a # Using index +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref PRIMARY,col1 col1 12 test.t1.a,test.t1.a,test.t1.a # Using index +drop table t1,t2,t3; +set optimizer_switch=@save_optimizer_switch; set optimizer_switch=@save_ext_key_optimizer_switch; SET SESSION STORAGE_ENGINE=DEFAULT; diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 044e582ceb6..7c41ffec344 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -18,10 +18,10 @@ SET DEBUG_SYNC='now SIGNAL table_altered'; # Complete optimization Table Op Msg_type Msg_text test.t1 optimize note Table does not support optimize, doing recreate + analyze instead -test.t1 optimize error Got error -1 "Internal error < 0 (Not system error)" from storage engine +test.t1 optimize error Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY test.t1 optimize status Operation failed Warnings: -Error 1030 Got error -1 "Internal error < 0 (Not system error)" from storage engine +Error 1030 Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY DROP TABLE t1; SET DEBUG_SYNC='RESET'; # diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index ba16d7dd9de..1d045d0a58d 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1473,3 +1473,44 @@ dog_id dog_id birthday dog_id t_id birthday dog_id t_id birthday a_id dog_id SET optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1,t2,t3,t4,t5; SET optimizer_switch=@save_optimizer_switch; +# +# Bug #35268: Parser can't handle STRAIGHT_JOIN with USING +# +CREATE TABLE t1 (a int); +INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); +CREATE TABLE t2 (a int); +INSERT INTO t2 (a) VALUES (1),(2),(3),(4); +EXPLAIN +SELECT t1.a FROM t1 NATURAL INNER JOIN t2 ORDER BY t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join) +SELECT t1.a FROM t1 NATURAL INNER JOIN t2 ORDER BY t1.a; +a +1 +2 +3 +4 +EXPLAIN +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 USING(a) ORDER BY t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join) +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 USING(a) ORDER BY t1.a; +a +1 +2 +3 +4 +EXPLAIN +SELECT t1.a FROM t1 NATURAL STRAIGHT_JOIN t2 ORDER BY t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join) +SELECT t1.a FROM t1 NATURAL STRAIGHT_JOIN t2 ORDER BY t1.a; +a +1 +2 +3 +4 +DROP TABLE t1,t2; 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/join_nested.result b/mysql-test/r/join_nested.result index dfb1a8c72d3..255714a7236 100644 --- a/mysql-test/r/join_nested.result +++ b/mysql-test/r/join_nested.result @@ -235,7 +235,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t8`.`b` = `test`.`t7`.`b`))) where 1 +Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t7`.`b`) and (`test`.`t6`.`b` < 10))) where 1 SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM (t6, t7) LEFT JOIN @@ -556,7 +556,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and ((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`))))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) where ((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`))) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM t0,t1 @@ -652,7 +652,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and ((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`))))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) SELECT t9.a,t9.b FROM t9; a b @@ -858,7 +858,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00 Using where 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t2`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`b`) and (`test`.`t3`.`b` is not null))) where 1 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t3`.`b` is not null))) where 1 SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b FROM (t3,t4) LEFT JOIN @@ -920,7 +920,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t2`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and ((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`))))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0); INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0); CREATE INDEX idx_b ON t4(b); @@ -972,7 +972,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and ((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`))))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t7`.`b` = `test`.`t5`.`b`)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) INSERT INTO t8 VALUES (-3,12,0), (-1,14,0), (-5,15,0), (-1,11,0), (-4,13,0); CREATE INDEX idx_b ON t8(b); EXPLAIN EXTENDED @@ -1022,7 +1022,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t8`.`a` >= 0) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t7`.`b` = `test`.`t5`.`b`)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t8`.`a` >= 0) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) INSERT INTO t1 VALUES (-1,133,0), (-2,12,0), (-3,11,0), (-5,15,0); CREATE INDEX idx_b ON t1(b); CREATE INDEX idx_a ON t0(a); @@ -1073,7 +1073,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2) and (`test`.`t1`.`a` > 0))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2) and (`test`.`t1`.`a` > 0))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b FROM t0,t1 @@ -1215,7 +1215,7 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 21 Using index 1 SIMPLE t3 index c c 5 NULL 6 Using where; Using index -1 SIMPLE t2 ref b b 5 test.t3.c 2 Using where; Using index +1 SIMPLE t2 ref b b 5 test.t3.c 2 Using index SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; a b c NULL 0 0 @@ -1286,7 +1286,7 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 21 Using index 1 SIMPLE t3 index c c 5 NULL 0 Using where; Using index -1 SIMPLE t2 ref b b 5 test.t3.c 2 Using where; Using index +1 SIMPLE t2 ref b b 5 test.t3.c 2 Using index SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; a b c NULL NULL NULL @@ -1843,7 +1843,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 Using where; Not exists 1 SIMPLE t4 ALL NULL NULL NULL NULL 0 0.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`a`))) left join `test`.`t4` on((`test`.`t4`.`b` = `test`.`t3`.`a`))) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where isnull(`test`.`t3`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on((`test`.`t3`.`b` = `test`.`t1`.`a`)) left join `test`.`t4` on((`test`.`t4`.`b` = `test`.`t3`.`a`))) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where isnull(`test`.`t3`.`a`) DROP TABLE t1,t2,t3,t4; SET optimizer_switch=@save_optimizer_switch; End of 5.0 tests diff --git a/mysql-test/r/join_nested_jcl6.result b/mysql-test/r/join_nested_jcl6.result index 69eb4532c73..c744df9e2fe 100644 --- a/mysql-test/r/join_nested_jcl6.result +++ b/mysql-test/r/join_nested_jcl6.result @@ -246,7 +246,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t8`.`b` = `test`.`t7`.`b`) and (`test`.`t7`.`b` is not null))) where 1 +Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t7`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` is not null))) where 1 SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM (t6, t7) LEFT JOIN @@ -567,7 +567,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) where ((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`))) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM t0,t1 @@ -663,7 +663,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) SELECT t9.a,t9.b FROM t9; a b @@ -869,7 +869,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t2`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`b`) and (`test`.`t3`.`b` is not null))) where 1 +Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`b` = `test`.`t3`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t3`.`b` is not null))) where 1 SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b FROM (t3,t4) LEFT JOIN @@ -931,7 +931,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t2`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t3`.`b` = `test`.`t4`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t9`.`b` = `test`.`t8`.`b`) or isnull(`test`.`t8`.`c`))) INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0); INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0); CREATE INDEX idx_b ON t4(b); @@ -983,7 +983,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) INSERT INTO t8 VALUES (-3,12,0), (-1,14,0), (-5,15,0), (-1,11,0), (-4,13,0); CREATE INDEX idx_b ON t8(b); EXPLAIN EXTENDED @@ -1033,7 +1033,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t8`.`a` >= 0) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` > 0) and (`test`.`t4`.`a` > 0) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t8`.`a` >= 0) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`a` > 0) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) INSERT INTO t1 VALUES (-1,133,0), (-2,12,0), (-3,11,0), (-5,15,0); CREATE INDEX idx_b ON t1(b); CREATE INDEX idx_a ON t0(a); @@ -1082,9 +1082,9 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t8 ref idx_b idx_b 5 test.t7.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t6`.`b` < 10) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t7`.`b` is not null)))) on(((`test`.`t6`.`b` >= 2) and (`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and (((`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t5`.`b` = `test`.`t0`.`b`)) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2) and (`test`.`t1`.`a` > 0))) join `test`.`t9` where ((`test`.`t9`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t0`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(((`test`.`t3`.`a` = 1) and (`test`.`t4`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(((`test`.`t8`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` < 10) and (`test`.`t5`.`b` is not null)))) on(((`test`.`t7`.`b` = `test`.`t5`.`b`) and (`test`.`t6`.`b` >= 2) and (`test`.`t5`.`b` is not null)))) on((((`test`.`t3`.`b` = 2) or isnull(`test`.`t3`.`c`)) and ((`test`.`t6`.`b` = 2) or isnull(`test`.`t6`.`c`)) and ((`test`.`t5`.`b` = `test`.`t0`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t6`.`c`) or isnull(`test`.`t8`.`c`)) and (`test`.`t1`.`a` <> 2) and (`test`.`t1`.`a` > 0))) join `test`.`t9` where ((`test`.`t0`.`a` = 1) and (`test`.`t1`.`b` = `test`.`t0`.`b`) and (`test`.`t9`.`a` = 1) and ((`test`.`t2`.`a` >= 4) or isnull(`test`.`t2`.`c`)) and ((`test`.`t3`.`a` < 5) or isnull(`test`.`t3`.`c`)) and ((`test`.`t4`.`b` = `test`.`t3`.`b`) or isnull(`test`.`t3`.`c`) or isnull(`test`.`t4`.`c`)) and ((`test`.`t5`.`a` >= 2) or isnull(`test`.`t5`.`c`)) and ((`test`.`t6`.`a` >= 4) or isnull(`test`.`t6`.`c`)) and ((`test`.`t7`.`a` <= 2) or isnull(`test`.`t7`.`c`)) and ((`test`.`t8`.`a` < 1) or isnull(`test`.`t8`.`c`)) and ((`test`.`t8`.`b` = `test`.`t9`.`b`) or isnull(`test`.`t8`.`c`))) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b FROM t0,t1 @@ -1226,7 +1226,7 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 21 Using index 1 SIMPLE t3 index c c 5 NULL 6 Using where; Using index -1 SIMPLE t2 ref b b 5 test.t3.c 2 Using where; Using index +1 SIMPLE t2 ref b b 5 test.t3.c 2 Using index SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; a b c NULL 0 0 @@ -1297,7 +1297,7 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 21 Using index 1 SIMPLE t3 index c c 5 NULL 0 Using where; Using index -1 SIMPLE t2 ref b b 5 test.t3.c 2 Using where; Using index +1 SIMPLE t2 ref b b 5 test.t3.c 2 Using index SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c; a b c NULL NULL NULL @@ -1854,7 +1854,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 100.00 Using where; Not exists; Using join buffer (incremental, BNLH join) 1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t3.a 0 0.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`a`))) left join `test`.`t4` on(((`test`.`t4`.`b` = `test`.`t3`.`a`) and (`test`.`t3`.`a` is not null)))) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where isnull(`test`.`t3`.`a`) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on((`test`.`t3`.`b` = `test`.`t1`.`a`)) left join `test`.`t4` on(((`test`.`t4`.`b` = `test`.`t3`.`a`) and (`test`.`t3`.`a` is not null)))) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where isnull(`test`.`t3`.`a`) DROP TABLE t1,t2,t3,t4; SET optimizer_switch=@save_optimizer_switch; End of 5.0 tests diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index fd2a948847c..c28887d4ff2 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -2008,7 +2008,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 100.00 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 100.00 Using index Warnings: -Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where (1) order by 5 +Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where 1 order by 5 SELECT t1.pk FROM t2 JOIN t1 ON t2.pk = t1.a WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5 ORDER BY t1.pk; diff --git a/mysql-test/r/join_outer_innodb.result b/mysql-test/r/join_outer_innodb.result index 650946d8b06..0184e236d14 100644 --- a/mysql-test/r/join_outer_innodb.result +++ b/mysql-test/r/join_outer_innodb.result @@ -183,6 +183,296 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t4 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using join buffer (incremental, BNL join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t6b ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) drop table t1,t2,t3,t4,t5,t6; +# +Bug mdev-4318: view over a complex query with outer joins +# +CREATE TABLE t1 ( +a1 int NOT NULL, a2 int NOT NULL, a3 int DEFAULT NULL, a4 tinyint NOT NULL, +a5 int NOT NULL, a6 tinyint NOT NULL, a7 tinyint(4) DEFAULT NULL, +a8 smallint(6) DEFAULT NULL, a9 smallint(6) DEFAULT NULL, a10 tinyint NOT NULL, +PRIMARY KEY (a1), KEY a2 (a2), KEY a3 (a3), KEY a4 (a4), KEY a6 (a6), +KEY a5 (a5), KEY a7 (a7), KEY a8 (a8), KEY a9 (a9) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES +(3360,5684,2219,1,316832,1,0,NULL,NULL,NULL), +(3362,2754,597,2,316844,1,0,NULL,NULL,NULL), +(3363,369,NULL,1,317295,1,0,NULL,NULL,NULL); +Warnings: +Warning 1048 Column 'a10' cannot be null +Warning 1048 Column 'a10' cannot be null +Warning 1048 Column 'a10' cannot be null +CREATE TABLE t2 ( +b1 int NOT NULL, b2 int NOT NULL, PRIMARY KEY (b1,b2), KEY b2 (b2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE t3 ( +c1 int NOT NULL, PRIMARY KEY (c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t3 VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12), +(1000),(1001),(1002),(1003),(9999); +CREATE TABLE t4 ( +d1 int NOT NULL, PRIMARY KEY (d1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t4 VALUES (5674),(5676),(5680),(5684),(5685); +CREATE TABLE t5 ( +e1 int NOT NULL, e2 varchar(64) NOT NULL, PRIMARY KEY (e1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t5 VALUES +(5684,'51a5de7a9f56314e082094d78f58be082c3cf0c1'), +(5685,'754dc8292cb9f5eb9ade126fe7e961c62412a349'), +(5686,'75eeb33f1c819bac21f6d023b4c5b24185eeda5c'); +CREATE TABLE t6 ( +f1 int NOT NULL, PRIMARY KEY (f1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t6 VALUES (5542),(5620),(5686); +CREATE TABLE t7 ( +g1 tinyint NOT NULL DEFAULT '0', g2 varchar(20) NOT NULL, PRIMARY KEY (g1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t7 VALUES +(1,'60feec2b20ed19f55ad0'),(3,'9ddb18bff7fcbd1e3133'), +(5,'a05599df9222bb160d11'),(7,'e31bae372f7d01df0589'), +(9,'8f8372dd7fc8eb46c8a3'),(11,'f8d0e28529e990a09309'); +CREATE TABLE t8 ( +h1 tinyint NOT NULL, h2 varchar(128) DEFAULT NULL, PRIMARY KEY (h1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t8 VALUES (1,'b'),(2,'c'),(3,'d'),(4,'e'); +CREATE TABLE t9 ( +i1 tinyint NOT NULL, i2 varchar(7) NOT NULL, i3 varchar(128) NOT NULL, +PRIMARY KEY (i1,i2), KEY i2 (i2), KEY i3 (i3) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t9 VALUES +(2,'a','07630d223c7e5f7b1feb19b3caafb0833fd028eb'), +(3,'b','1ca53dcc50b68af86f4b1b4676dbed917b543c30'), +(1,'b','2c01ac36c1ce9a7de66be89f85d8aa5f0052e2e8'), +(4,'a','496c486b3a9edc439477fef7d34cbefdebba86df'), +(3,'a','98bf72d8d467201058a5f69bd7709bfc74a8637e'), +(2,'b','9a45425f6160fb59d7f8a02c721498d4ce945302'), +(4,'b','9c9a7300f3e708f8e430f9f3376d966f5951f583'), +(1,'a','c0af3f076b905f31cbb51af304b9c7ad539e0861'); +CREATE TABLE t10 ( +j1 tinyint NOT NULL, j2 varchar(20) NOT NULL, PRIMARY KEY (j1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t10 VALUES (1,'b'),(2,'c'),(3,'d'); +CREATE TABLE t11 ( +k1 int NOT NULL, k2 datetime DEFAULT NULL, k3 int DEFAULT NULL, +k4 int DEFAULT NULL, PRIMARY KEY (k1), KEY k3 (k3), KEY k4 (k4) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t11 VALUES +(317422,'2013-03-18 11:43:03',1,NULL),(317423,'2013-03-18 11:43:11',1,NULL), +(317424,'2013-03-18 11:52:01',1,1),(317425,'2013-03-18 11:52:01',1,1), +(317426,'2013-03-18 11:56:38',1,1),(317427,'2013-03-18 12:18:25',1,NULL), +(317428,'2013-03-18 12:46:28',1,NULL),(317429,'2013-03-18 12:46:28',1,NULL), +(317430,'2013-03-18 12:46:28',1,NULL),(317431,'2013-03-18 12:46:28',1,NULL), +(317432,'2013-03-18 12:46:28',1,NULL),(317433,'2013-03-18 12:46:28',1,NULL), +(317434,'2013-03-18 12:46:28',1,NULL),(317435,'2013-03-18 12:46:28',1,NULL), +(317436,'2013-03-18 12:46:28',1,NULL),(317437,'2013-03-18 12:46:28',1,NULL), +(317438,'2013-03-18 12:46:28',1,NULL),(317439,'2013-03-18 12:46:28',1,NULL), +(317440,'2013-03-18 12:55:20',1,NULL),(317441,'2013-03-18 12:58:29',1,NULL), +(317442,'2013-03-18 13:06:02',1,NULL),(317443,'2013-03-18 15:23:18',21,NULL); +CREATE TABLE t12 ( +l1 int NOT NULL, l2 varchar(64) NOT NULL, PRIMARY KEY (l1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t12 VALUES +(552,'59a498252ef59f96fbdc13a414abe244d8e8bc30'), +(554,'c6025c7cb2d9dfb1be7ce4a61f35b45bb9e61ba3'), +(555,'b245bcc672082bb6d10794b2b4ac972dd14b1cf5'); +CREATE TABLE t13 ( +m1 int NOT NULL, m2 int NOT NULL, m3 int NOT NULL, +PRIMARY KEY (m1,m2,m3), KEY m3 (m3), KEY m2 (m2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t13 VALUES (3324,43,4),(3332,263,1),(3348,27,3); +CREATE TABLE t14 ( +n1 smallint NOT NULL, n2 varchar(64) NOT NULL, PRIMARY KEY (n1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t14 VALUES +(21,'685bf7ca576af964c7cff564d5e4473b81499b8b'), +(23,'b8e42dab1ab952406b3accfb47089c61478138a8'), +(25,'3fea441e411db8c70bf039b50c8f18f59515be53'), +(27,'998aecc30fd0e0b8a1cac6590e5eccc2d7822223'); +CREATE TABLE t15 ( +o1 smallint NOT NULL, PRIMARY KEY (o1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t15 VALUES (1),(3); +CREATE TABLE t16 ( +p1 smallint NOT NULL, p2 varchar(7) NOT NULL, p3 varchar(64) NOT NULL, +PRIMARY KEY (p1,p2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t16 VALUES +(1,'a','66bdbb389456f3ae97206da115a7b397c31400e8'), +(1,'b','66bdbb389456f3ae97206da115a7b397c31400e8'), +(3,'a','386c10e454278c6e27feb16258089166422f79b4'), +(3,'b','386c10e454278c6e27feb16258089166422f79b4'); +create view v1 as select t3.c1,t5.e2,t1.a1,t14.n2,t16.p3,t10.j2,t7.g2,t11.k2,l3.l2, +t9.i3,t12.l2 AS l_l2,l2.l2 AS l2_l2,l4.l1 AS l4_l1,t6.f1 +from +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +t1 +left join t2 on t1.a1 = t2.b1 +) +left join t3 on t2.b2 = t3.c1 +) +left join t4 on t1.a2 = t4.d1 +) +left join t5 on t4.d1 = t5.e1 +) +left join t6 on t1.a3 = t6.f1 +) +left join t5 e2 on t6.f1 = e2.e1 +) +join t7 on t1.a7 = t7.g1 +) +join t8 on t1.a4 = t8.h1 +) +join t9 on t8.h1 = t9.i1 +) +join t10 on t1.a6 = t10.j1 +) +join t11 on t1.a5 = t11.k1 +) +left join t12 on t11.k3 = t12.l1 +) +left join t12 l2 on t11.k4 = l2.l1 +) +left join t13 on t1.a1 = t13.m1 and t13.m3 = 4 +) +left join t12 l4 on l4.l1 = t13.m2 +) +left join t13 m2 on t1.a1 = m2.m1 and m2.m3 = 3 +) +left join t12 l3 on l3.l1 = m2.m2 +) +left join t14 on t1.a8 = t14.n1 +) +left join t15 on t1.a9 = t15.o1 +) +left join t16 on t15.o1 = t16.p1 +where t1.a10 = 1; +explain select t3.c1,t5.e2,t1.a1,t14.n2,t16.p3,t10.j2,t7.g2,t11.k2,l3.l2, +t9.i3,t12.l2 AS l_l2,l2.l2 AS l2_l2,l4.l1 AS l4_l1,t6.f1 +from +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +( +t1 +left join t2 on t1.a1 = t2.b1 +) +left join t3 on t2.b2 = t3.c1 +) +left join t4 on t1.a2 = t4.d1 +) +left join t5 on t4.d1 = t5.e1 +) +left join t6 on t1.a3 = t6.f1 +) +left join t5 e2 on t6.f1 = e2.e1 +) +join t7 on t1.a7 = t7.g1 +) +join t8 on t1.a4 = t8.h1 +) +join t9 on t8.h1 = t9.i1 +) +join t10 on t1.a6 = t10.j1 +) +join t11 on t1.a5 = t11.k1 +) +left join t12 on t11.k3 = t12.l1 +) +left join t12 l2 on t11.k4 = l2.l1 +) +left join t13 on t1.a1 = t13.m1 and t13.m3 = 4 +) +left join t12 l4 on l4.l1 = t13.m2 +) +left join t13 m2 on t1.a1 = m2.m1 and m2.m3 = 3 +) +left join t12 l3 on l3.l1 = m2.m2 +) +left join t14 on t1.a8 = t14.n1 +) +left join t15 on t1.a9 = t15.o1 +) +left join t16 on t15.o1 = t16.p1 +where t1.a10 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a4,a6,a5,a7 NULL NULL NULL 3 Using where +1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 Using index +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where; Using index +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index +1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where +1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index +1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index +1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1 +1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1 +1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t1.a5 1 +1 SIMPLE t12 eq_ref PRIMARY PRIMARY 4 test.t11.k3 1 Using where +1 SIMPLE l2 eq_ref PRIMARY PRIMARY 4 test.t11.k4 1 Using where +1 SIMPLE t13 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index +1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where; Using index +1 SIMPLE m2 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index +1 SIMPLE l3 eq_ref PRIMARY PRIMARY 4 test.m2.m2 1 Using where +1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where +1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index +1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where +1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) +explain select * from v1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a4,a6,a5,a7 NULL NULL NULL 3 Using where +1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 Using index +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where; Using index +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index +1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where +1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index +1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index +1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1 +1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1 +1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t1.a5 1 +1 SIMPLE t12 eq_ref PRIMARY PRIMARY 4 test.t11.k3 1 Using where +1 SIMPLE l2 eq_ref PRIMARY PRIMARY 4 test.t11.k4 1 Using where +1 SIMPLE t13 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index +1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where; Using index +1 SIMPLE m2 ref PRIMARY,m3 PRIMARY 4 test.t1.a1 1 Using where; Using index +1 SIMPLE l3 eq_ref PRIMARY PRIMARY 4 test.m2.m2 1 Using where +1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where +1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index +1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where +1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) +drop view v1; +drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16; diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result index d891f5c49b2..4efb6126cba 100644 --- a/mysql-test/r/join_outer_jcl6.result +++ b/mysql-test/r/join_outer_jcl6.result @@ -2019,7 +2019,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 100.00 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 100.00 Using index Warnings: -Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where (1) order by 5 +Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where 1 order by 5 SELECT t1.pk FROM t2 JOIN t1 ON t2.pk = t1.a WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5 ORDER BY t1.pk; diff --git a/mysql-test/r/keywords.result b/mysql-test/r/keywords.result index 58cb7430563..a3588017e97 100644 --- a/mysql-test/r/keywords.result +++ b/mysql-test/r/keywords.result @@ -269,3 +269,9 @@ call p2(); DROP PROCEDURE p1; DROP PROCEDURE p2; DROP TABLE t1; +create table option (option int not null); +drop table option; +set option=1; +ERROR HY000: Unknown system variable 'option' +set option option=1; +ERROR HY000: Unknown system variable 'option' diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 76784be1e16..18da8765d4b 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -251,7 +251,7 @@ alter table mysql.slow_log engine=NonExistentEngine; Warnings: Warning 1286 Unknown storage engine 'NonExistentEngine' alter table mysql.slow_log engine=memory; -ERROR HY000: This storage engine cannot be used for log tables +ERROR HY000: Storage engine MEMORY cannot be used for log tables set storage_engine= @save_storage_engine; drop table mysql.slow_log; drop table mysql.general_log; diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index c478d792e52..ac368a06bc9 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -272,7 +272,7 @@ Database Table In_use Name_locked test t_bug44738_uppercase 0 0 # So attempt to create table with the same name should fail. create table t_bug44738_UPPERCASE (i int); -ERROR HY000: Can't find file: 't_bug44738_uppercase' (errno: 2 "No such file or directory") +ERROR HY000: Can't find file: './test/t_bug44738_uppercase.MYI' (errno: 2 "No such file or directory") # And should succeed after FLUSH TABLES. flush tables; create table t_bug44738_UPPERCASE (i int); diff --git a/mysql-test/r/mdev316.result b/mysql-test/r/mdev316.result index 43082769872..78272549e81 100644 --- a/mysql-test/r/mdev316.result +++ b/mysql-test/r/mdev316.result @@ -16,7 +16,7 @@ cast(convert(0x0030 using ucs2) as decimal(5.2)) cast(concat(convert(0x0030 usin 0 0 select cast(convert(_ucs2 0x0030 using latin1) as date), cast(concat(convert(_ucs2 0x0030 using latin1)) as date); cast(convert(_ucs2 0x0030 using latin1) as date) cast(concat(convert(_ucs2 0x0030 using latin1)) as date) -NULL NULL +0000-00-00 0000-00-00 Warnings: Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '0' diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index b2e71faf741..1c94f867a54 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -2850,7 +2850,7 @@ SET DEBUG_SYNC= 'now SIGNAL blocked'; # Reaping: DROP DATABASE db1 # Connection con2 # Reaping: RENAME TABLE db1.t1 TO test.t1 -Got one of the listed errors +ERROR 42S02: Table 'db1.t1' doesn't exist # Connection default CREATE DATABASE db1; CREATE TABLE test.t2 (a INT); diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index b5c85555ed8..5c4261e7d6d 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -580,25 +580,25 @@ select max(b) from t1 where a = 2; max(b) 1 drop table t3,t1,t2; -CREATE TABLE t1 (c1 INT NOT NULL); -CREATE TABLE t2 (c1 INT NOT NULL); -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (2); -CREATE TEMPORARY TABLE t3 (c1 INT NOT NULL) ENGINE=MRG_MYISAM UNION=(t1,t2); -SELECT * FROM t3; -c1 +create table t1 (a int not null); +create table t2 (a int not null); +insert into t1 values (1); +insert into t2 values (2); +create temporary table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +select * from t3; +a 1 2 -CREATE TEMPORARY TABLE t4 (c1 INT NOT NULL); -CREATE TEMPORARY TABLE t5 (c1 INT NOT NULL); -INSERT INTO t4 VALUES (4); -INSERT INTO t5 VALUES (5); -CREATE TEMPORARY TABLE t6 (c1 INT NOT NULL) ENGINE=MRG_MYISAM UNION=(t4,t5); -SELECT * FROM t6; -c1 -4 -5 -DROP TABLE t6, t3, t1, t2, t4, t5; +create temporary table t4 (a int not null); +create temporary table t5 (a int not null); +insert into t4 values (1); +insert into t5 values (2); +create temporary table t6 (a int not null) ENGINE=MERGE UNION=(t4,t5); +select * from t6; +a +1 +2 +drop table t6, t3, t1, t2, t4, t5; create temporary table t1 (a int not null); create temporary table t2 (a int not null); insert into t1 values (1); @@ -996,11 +996,6 @@ m1 CREATE TABLE `m1` ( `a` int(11) DEFAULT NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, m1; -CREATE TABLE t1(a INT, KEY(a)) ENGINE=merge; -SELECT MAX(a) FROM t1; -MAX(a) -NULL -DROP TABLE t1; CREATE TABLE t1(a INT); CREATE TABLE t2(a VARCHAR(10)); CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2); @@ -1935,9 +1930,9 @@ ALTER TABLE t2 UNION=(t3,t1); SELECT * FROM t2; ERROR HY000: Table 't3' is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, t2, t3; -CREATE TABLE t1 (c1 INT) ENGINE=MyISAM; -CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; -CREATE TABLE t3 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2); +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t3 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1, t2); INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (2); SELECT * FROM t3; @@ -2262,7 +2257,7 @@ CREATE TABLE m1(a int)engine=merge union=(t1,t2,t3,t4,t5,t6,t7); SELECT 1 FROM m1; 1 HANDLER m1 OPEN; -ERROR HY000: Table storage engine for 'm1' doesn't have this option +ERROR HY000: Storage engine MRG_MyISAM of the table `test`.`m1` doesn't have this option DROP TABLE m1,t1,t2,t3,t4,t5,t6,t7; SELECT 1 FROM m1; ERROR 42S02: Table 'test.m1' doesn't exist @@ -2400,6 +2395,142 @@ Table Op Msg_type Msg_text test.m1 repair note The storage engine for the table doesn't support repair DROP TABLE m1, t1; End of 5.1 tests +# +# MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg +# +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 ( i int ) engine=myisam; +insert into t2 values (1),(2); +create table t3 (a int, b int, filler char(100), key(a), key(b)) engine=myisam; +create table t4 like t3; +insert into t3 +select A.a+10*B.a+100*C.a, +A.a+10*B.a+100*C.a, +'filler-data-FILLER-DATA-qqq' +from t1 A, t1 B, t1 C where C.a < 5; +insert into t4 +select A.a+10*B.a+100*C.a, +A.a+10*B.a+100*C.a, +'filler-data-FILLER-DATA-qqq' +from t1 A, t1 B, t1 C where C.a >= 5; +create table t5 like t3; +alter table t5 engine=merge; +alter table t5 union(t3, t4); +update t5 set b=999, a=999 where b>950; +explain +select * from t2, t5 where t5.a=999 and t5.b=999; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t5 index_merge a,b a,b 5,5 NULL 6 Using intersect(a,b); Using where; Using join buffer (flat, BNL join) +select * from t2, t5 where t5.a=999 and t5.b=999; +i a b filler +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +drop table t5; +drop table t1,t2,t3,t4; +End of 5.3 tests +CREATE TABLE t1(a INT, KEY(a)) ENGINE=merge; +SELECT MAX(a) FROM t1; +MAX(a) +NULL +DROP TABLE t1; # # An additional test case for Bug#27430 Crash in subquery code # when in PS and table DDL changed after PREPARE @@ -2752,7 +2883,7 @@ Table Create Table m2 CREATE TEMPORARY TABLE `m2` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) SELECT * FROM m2; c1 c2 111 121 @@ -2769,7 +2900,7 @@ Table Create Table m1 CREATE TEMPORARY TABLE `m1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) SELECT * FROM m1; c1 c2 111 121 @@ -2858,7 +2989,7 @@ Table Create Table m1 CREATE TEMPORARY TABLE `m1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT INTO m1 VALUES (511, 521); SELECT * FROM m1; c1 c2 @@ -2909,7 +3040,7 @@ Table Create Table m1 CREATE TEMPORARY TABLE `m1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) # CREATE TABLE m2 SELECT * FROM m1; SHOW CREATE TABLE m2; @@ -2961,7 +3092,7 @@ Table Create Table m2 CREATE TABLE `m2` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) SELECT * FROM m2; c1 c2 111 121 @@ -2987,7 +3118,7 @@ Table Create Table m2 CREATE TEMPORARY TABLE `m2` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) SELECT * FROM m2; c1 c2 111 121 @@ -3157,7 +3288,7 @@ Table Create Table m2 CREATE TEMPORARY TABLE `m2` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) SELECT * FROM m2; c1 c2 111 121 @@ -3174,7 +3305,7 @@ Table Create Table m1 CREATE TEMPORARY TABLE `m1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) SELECT * FROM m1; c1 c2 111 121 @@ -3265,7 +3396,7 @@ Table Create Table m1 CREATE TEMPORARY TABLE `m1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT INTO m1 VALUES (511, 521); SELECT * FROM m1; c1 c2 @@ -3316,7 +3447,7 @@ Table Create Table m1 CREATE TEMPORARY TABLE `m1` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) CREATE TABLE m2 SELECT * FROM m1; ERROR HY000: Table 'm2' was not locked with LOCK TABLES # @@ -3361,14 +3492,14 @@ Table Create Table m2 CREATE TEMPORARY TABLE `m2` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) LOCK TABLE m1 WRITE, m2 WRITE; SHOW CREATE TABLE m2; Table Create Table m2 CREATE TEMPORARY TABLE `m2` ( `c1` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 INSERT_METHOD=LAST UNION=(`t1`,`t2`) SELECT * FROM m2; c1 c2 111 121 @@ -3421,7 +3552,7 @@ CREATE TABLE t2 (c1 int); CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2); START TRANSACTION; HANDLER t3 OPEN; -ERROR HY000: Table storage engine for 't3' doesn't have this option +ERROR HY000: Storage engine MRG_MyISAM of the table `test`.`t3` doesn't have this option DROP TABLE t1, t2, t3; # Connection default. # Disconnecting con1, all mdl_tickets must have been released. diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 55e5db231a9..461673f5b21 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -689,6 +689,58 @@ DROP VIEW v1; DROP FUNCTION f1; DROP TABLE t1; # +# MDEV-4123: Incorrect results after multi-table update or +# assertion `!table || (!table->read_set || +# bitmap_is_set(table->read_set, field_index))' failure +# +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 ( +id int(10) unsigned NOT NULL, +level tinyint(3) unsigned NOT NULL, +PRIMARY KEY (id) +); +INSERT INTO t1 VALUES (2519583,1); +DROP TABLE IF EXISTS t2; +Warnings: +Note 1051 Unknown table 't2' +CREATE TABLE t2 ( +club_id int(11) NOT NULL DEFAULT '0', +profile_id int(11) NOT NULL DEFAULT '0', +member_level_id int(11) NOT NULL DEFAULT '0', +PRIMARY KEY (profile_id,club_id) +); +INSERT INTO t2 VALUES (2,2519583,12); +DROP TABLE IF EXISTS t3; +Warnings: +Note 1051 Unknown table 't3' +CREATE TABLE t3 ( +member_level_id int(11) unsigned NOT NULL DEFAULT '0', +map_level int(11) unsigned NOT NULL DEFAULT '0', +map_status int(11) unsigned NOT NULL DEFAULT '0', +PRIMARY KEY (member_level_id) +); +INSERT INTO t3 VALUES (12,12,1); +CREATE +VIEW v1 AS +select club_id,profile_id, +map_level AS member_level_id,map_status AS member_status +from (t2 tc join t3 map +on(((tc.member_level_id = map.member_level_id) and +(club_id = 2)))); +select level, count(*) as cnt from t1 group by level; +level cnt +1 1 +UPDATE t1 c LEFT JOIN v1 t ON (c.id = t.profile_id AND t.club_id = 2) +SET c.level = IF (t.member_status IS NULL, 1, IF (t.member_status = 1, 2,3)); +select level, count(*) as cnt from t1 group by level; +level cnt +2 1 +drop view v1; +drop table t1,t2,t3; +end of tests +# # BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a # table is updated twice # @@ -742,3 +794,4 @@ SELECT * FROM t2; col_int_key pk_1 pk_2 col_int 1 7 11 4 DROP TABLE t1,t2; +end of 5.5 tests diff --git a/mysql-test/r/myisam-metadata.result b/mysql-test/r/myisam-metadata.result new file mode 100644 index 00000000000..5192253d5d1 --- /dev/null +++ b/mysql-test/r/myisam-metadata.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY, +a VARCHAR(100), +INDEX(a) +) ENGINE=MyISAM; +ALTER TABLE t1 DISABLE KEYS; +ALTER TABLE t1 ENABLE KEYS; +SHOW TABLE STATUS LIKE 't1'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 10 Dynamic 100000 27 # # # 0 NULL # # # latin1_swedish_ci NULL +DROP TABLE t1; diff --git a/mysql-test/r/myisam-system.result b/mysql-test/r/myisam-system.result index 924e7885814..9d5a59459ec 100644 --- a/mysql-test/r/myisam-system.result +++ b/mysql-test/r/myisam-system.result @@ -2,12 +2,18 @@ drop table if exists t1,t2; create table t1 (a int) engine=myisam; drop table if exists t1; Warnings: -Warning 2 Can't find file: 't1' (errno: 2 "No such file or directory") +Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") create table t1 (a int) engine=myisam; +select * from t1; +ERROR HY000: Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") drop table t1; -Got one of the listed errors +Warnings: +Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") create table t1 (a int) engine=myisam; +select * from t1; +ERROR HY000: File './test/t1.MYD' not found (Errcode: 2 "No such file or directory") drop table t1; -Got one of the listed errors +Warnings: +Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") drop table t1; ERROR 42S02: Unknown table 't1' diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 6c0826775ad..2530182ea67 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -618,7 +618,7 @@ t1 1 a 1 a A 1000 NULL NULL YES BTREE alter table t1 engine=heap; alter table t1 disable keys; Warnings: -Note 1031 Table storage engine for 't1' doesn't have this option +Note 1031 Storage engine MEMORY of the table `test`.`t1` doesn't have this option show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t1 1 a 1 a NULL 500 NULL NULL YES HASH @@ -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/mysql_client_test.result b/mysql-test/r/mysql_client_test.result index 7875464ebe2..4ad07b20ab5 100644 --- a/mysql-test/r/mysql_client_test.result +++ b/mysql-test/r/mysql_client_test.result @@ -1,5 +1,6 @@ SET @old_general_log= @@global.general_log; SET @old_slow_query_log= @@global.slow_query_log; +call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'"); ok # cat MYSQL_TMP_DIR/test_wl4435.out.log diff --git a/mysql-test/r/mysql_client_test_nonblock.result b/mysql-test/r/mysql_client_test_nonblock.result index edda7980e97..e37e2132b0c 100644 --- a/mysql-test/r/mysql_client_test_nonblock.result +++ b/mysql-test/r/mysql_client_test_nonblock.result @@ -1,5 +1,6 @@ SET @old_general_log= @@global.general_log; SET @old_slow_query_log= @@global.slow_query_log; +call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'"); ok SET @@global.general_log= @old_general_log; SET @@global.slow_query_log= @old_slow_query_log; 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 63b0ea2a71a..27693b62f51 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/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 10f1691e80a..b28cfd8ef20 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -188,6 +188,7 @@ Table Op Msg_type Msg_text test.v1 check status OK information_schema.routines check note The storage engine for the table doesn't support check drop view v1; +call mtr.add_suppression("Error reading file './test/t1.frm'"); CREATE TABLE t1(a INT) engine=myisam; CREATE TABLE t2(a INT) engine=myisam; test.t1 @@ -204,15 +205,15 @@ t1 v1 show tables; Tables_in_test -t1 #mysql50#v-1 +t1 v1 test.t1 OK show tables; Tables_in_test t1 -v1 v-1 +v1 drop view v1, `v-1`; drop table t1; SET NAMES utf8; diff --git a/mysql-test/r/mysqld--help,win.rdiff b/mysql-test/r/mysqld--help,win.rdiff index 0fa6e41391f..24719fce917 100644 --- a/mysql-test/r/mysqld--help,win.rdiff +++ b/mysql-test/r/mysqld--help,win.rdiff @@ -1,6 +1,6 @@ ---- r/mysqld--help.result 2012-10-25 14:02:57.000000000 +0200 -+++ mysqld--help,win.result~ 2012-10-30 11:37:08.000000000 +0100 -@@ -244,7 +244,6 @@ +--- mysql-test/r/mysqld--help.result 2012-09-08 22:22:06 +0000 ++++ mysql-test/r/mysqld--help.result 2012-10-01 14:03:59 +0000 +@@ -248,7 +248,6 @@ The number of segments in a key cache -L, --language=name Client error messages in given language. May be given as a full path. Deprecated. Use --lc-messages-dir instead. @@ -8,7 +8,7 @@ --lc-messages=name Set the language used for the error messages. -L, --lc-messages-dir=name Directory where error messages are -@@ -437,6 +436,7 @@ +@@ -443,6 +442,7 @@ NULLS_UNEQUAL (default behavior for 4.1 and later), NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables @@ -16,7 +16,7 @@ --net-buffer-length=# Buffer length for TCP/IP and socket communication --net-read-timeout=# -@@ -774,6 +774,9 @@ +@@ -710,6 +710,9 @@ files within specified directory --server-id=# Uniquely identifies the server instance in the community of replication partners @@ -26,7 +26,7 @@ --show-slave-auth-info Show user and password in SHOW SLAVE HOSTS on this master. -@@ -841,6 +844,10 @@ +@@ -777,6 +780,10 @@ Log slow queries to given log file. Defaults logging to 'hostname'-slow.log. Must be enabled to activate other slow log options @@ -37,7 +37,7 @@ --socket=name Socket file to use for connection --sort-buffer-size=# Each thread that needs to do a sort allocates a buffer of -@@ -849,6 +856,7 @@ +@@ -785,6 +792,7 @@ for the complete list of valid sql modes --stack-trace Print a symbolic stack trace on failure (Defaults to on; use --skip-stack-trace to disable.) @@ -45,7 +45,35 @@ --stored-program-cache=# The soft upper limit for number of cached stored routines for one connection. -@@ -889,8 +897,8 @@ +@@ -817,25 +825,11 @@ + values are COMMIT or ROLLBACK. + --thread-cache-size=# + How many threads we should keep in a cache for reuse +- --thread-pool-idle-timeout=# +- Timeout in seconds for an idle thread in the thread +- pool.Worker thread will be shut down after timeout + --thread-pool-max-threads=# + Maximum allowed number of worker threads in the thread + pool +- --thread-pool-oversubscribe=# +- How many additional active worker threads in a group are +- allowed. +- --thread-pool-size=# +- Number of thread groups in the pool. This parameter is +- roughly equivalent to maximum number of concurrently +- executing threads (threads in a waiting state do not +- count as executing). +- --thread-pool-stall-limit=# +- Maximum query execution time in milliseconds,before an +- executing non-yielding thread is considered stalled.If a +- worker thread is stalled, additional worker thread may be +- created to handle remaining clients. ++ --thread-pool-min-threads=# ++ Minimum number of threads in the thread pool. + --thread-stack=# The stack size for each thread + --time-format=name The TIME format (ignored) + --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are +@@ -844,8 +838,8 @@ size, MySQL will automatically convert it to an on-disk MyISAM or Aria table -t, --tmpdir=name Path for temporary files. Several paths may be specified, @@ -56,7 +84,7 @@ --transaction-alloc-block-size=# Allocation block size for transactions to be stored in binary log -@@ -993,7 +1001,6 @@ +@@ -949,7 +943,6 @@ key-cache-block-size 1024 key-cache-division-limit 100 key-cache-segments 0 @@ -64,7 +92,7 @@ lc-messages en_US lc-messages-dir MYSQL_SHAREDIR/ lc-time-names en_US -@@ -1056,6 +1063,7 @@ +@@ -1012,6 +1005,7 @@ myisam-sort-buffer-size 8388608 myisam-stats-method nulls_unequal myisam-use-mmap FALSE @@ -72,7 +100,7 @@ net-buffer-length 16384 net-read-timeout 30 net-retry-count 10 -@@ -1148,6 +1156,8 @@ +@@ -1077,6 +1071,8 @@ secure-auth FALSE secure-file-priv (No default value) server-id 0 @@ -81,7 +109,7 @@ show-slave-auth-info FALSE skip-grant-tables TRUE skip-name-resolve FALSE -@@ -1164,6 +1174,7 @@ +@@ -1093,6 +1089,7 @@ slave-type-conversions slow-launch-time 2 slow-query-log FALSE @@ -89,3 +117,15 @@ sort-buffer-size 2097152 sql-mode stack-trace TRUE +@@ -1109,10 +1106,8 @@ + table-open-cache 400 + tc-heuristic-recover COMMIT + thread-cache-size 0 +-thread-pool-idle-timeout 60 + thread-pool-max-threads 500 +-thread-pool-oversubscribe 3 +-thread-pool-stall-limit 500 ++thread-pool-min-threads 1 + thread-stack 294912 + time-format %H:%i:%s + timed-mutexes FALSE diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 197743d6c6f..699e6764fa9 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -496,8 +496,8 @@ The following options may be given as the first argument: mrr_cost_based, mrr_sort_keys, optimize_join_buffer_size, outer_join_with_cache, partial_match_rowid_merge, partial_match_table_scan, semijoin, semijoin_with_cache, - subquery_cache, table_elimination, extended_keys } and - val is one of {on, off, default} + subquery_cache, table_elimination, extended_keys, + exists_to_in } and val is one of {on, off, default} --performance-schema Enable the performance schema. --performance-schema-accounts-size=# @@ -890,6 +890,25 @@ The following options may be given as the first argument: values are COMMIT or ROLLBACK. --thread-cache-size=# How many threads we should keep in a cache for reuse + --thread-pool-idle-timeout=# + Timeout in seconds for an idle thread in the thread + pool.Worker thread will be shut down after timeout + --thread-pool-max-threads=# + Maximum allowed number of worker threads in the thread + pool + --thread-pool-oversubscribe=# + How many additional active worker threads in a group are + allowed. + --thread-pool-size=# + Number of thread groups in the pool. This parameter is + roughly equivalent to maximum number of concurrently + executing threads (threads in a waiting state do not + count as executing). + --thread-pool-stall-limit=# + Maximum query execution time in milliseconds,before an + executing non-yielding thread is considered stalled.If a + worker thread is stalled, additional worker thread may be + created to handle remaining clients. --thread-stack=# The stack size for each thread --time-format=name The TIME format (ignored) --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are @@ -1192,6 +1211,10 @@ table-definition-cache 400 table-open-cache 400 tc-heuristic-recover COMMIT thread-cache-size 0 +thread-pool-idle-timeout 60 +thread-pool-max-threads 500 +thread-pool-oversubscribe 3 +thread-pool-stall-limit 500 thread-stack 294912 time-format %H:%i:%s timed-mutexes FALSE diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 6b0e044a491..33e10f29201 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/mysqlslap.result b/mysql-test/r/mysqlslap.result index 069c9182de2..38a7b0a694e 100644 --- a/mysql-test/r/mysqlslap.result +++ b/mysql-test/r/mysqlslap.result @@ -234,8 +234,8 @@ test # 'bug58090' database should be present. SHOW DATABASES; Database -information_schema bug58090 +information_schema mtr mysql performance_schema diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 86425825601..c6a806bec80 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2493,3 +2493,25 @@ i 3 4 DROP TABLE t1; +CREATE TABLE t1 ( d DATE NOT NULL) +PARTITION BY RANGE( YEAR(d) ) ( +PARTITION p0 VALUES LESS THAN (1960), +PARTITION p1 VALUES LESS THAN (1970), +PARTITION p2 VALUES LESS THAN (1980), +PARTITION p3 VALUES LESS THAN (1990) +); +ALTER TABLE t1 ADD PARTITION IF NOT EXISTS( +PARTITION `p5` VALUES LESS THAN (2010) +COMMENT 'APSTART \' APEND' +); +ALTER TABLE t1 ADD PARTITION IF NOT EXISTS( +PARTITION `p5` VALUES LESS THAN (2010) +COMMENT 'APSTART \' APEND' +); +Warnings: +Note 1517 Duplicate partition name p5 +alter table t1 drop partition if exists p5; +alter table t1 drop partition if exists p5; +Warnings: +Note 1507 Error in list of partitions to DROP +DROP TABLE t1; diff --git a/mysql-test/r/partition_debug_sync.result b/mysql-test/r/partition_debug_sync.result index ad0f6df5ff2..826bca019d5 100644 --- a/mysql-test/r/partition_debug_sync.result +++ b/mysql-test/r/partition_debug_sync.result @@ -42,21 +42,18 @@ CREATE TABLE t2 b INTEGER NOT NULL, KEY (b)) ENGINE = MYISAM -/*!50100 PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN (2), +PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (100), -PARTITION p3 VALUES LESS THAN MAXVALUE ) */; +PARTITION p3 VALUES LESS THAN MAXVALUE); SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_FOR waiting_for_alter'; SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done'; ALTER TABLE t2 REMOVE PARTITIONING; # Con default -SET SESSION debug_dbug= "+d,sleep_before_no_locks_delete_table"; SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions'; SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter'; SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done'; DROP TABLE IF EXISTS t2; -SET SESSION debug_dbug= "-d,sleep_before_no_locks_delete_table"; # Con 1 ERROR 42S02: Table 'test.t2' doesn't exist SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/r/partition_disabled.result b/mysql-test/r/partition_disabled.result index 2978a3b6d2e..505bec79610 100644 --- a/mysql-test/r/partition_disabled.result +++ b/mysql-test/r/partition_disabled.result @@ -3,7 +3,7 @@ FLUSH TABLES; SELECT * FROM t1; ERROR HY000: The MariaDB server is running with the --skip-partition option so it cannot execute this statement TRUNCATE TABLE t1; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: The MariaDB server is running with the --skip-partition option so it cannot execute this statement ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze Error The MariaDB server is running with the --skip-partition option so it cannot execute this statement diff --git a/mysql-test/r/partition_example.result b/mysql-test/r/partition_example.result index 2129eea0818..7b6e9aa5213 100644 --- a/mysql-test/r/partition_example.result +++ b/mysql-test/r/partition_example.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='5' /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE, PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */ @@ -20,7 +20,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 `VAROPT`='5' /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (1) ENGINE = EXAMPLE, PARTITION p1 VALUES IN (2) ENGINE = EXAMPLE) */ diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result index fa2ef5c6c18..ceade2a793c 100644 --- a/mysql-test/r/partition_innodb_plugin.result +++ b/mysql-test/r/partition_innodb_plugin.result @@ -67,7 +67,7 @@ LOCK TABLE t1 WRITE; # ALTER fails because COMPRESSED/KEY_BLOCK_SIZE # are incompatible with innodb_file_per_table = OFF; ALTER TABLE t1 ADD PARTITION PARTITIONS 1; -ERROR HY000: Got error 140 "Wrong create options" from storage engine +ERROR HY000: Got error 140 "Wrong create options" from storage engine InnoDB t1#P#p0.ibd t1.frm t1.par diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result index f0844c0b407..10586ddc548 100644 --- a/mysql-test/r/partition_myisam.result +++ b/mysql-test/r/partition_myisam.result @@ -102,7 +102,6 @@ FLUSH TABLES; CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check Error Failed to read from the .par file -test.t1 check Error Incorrect information in file: './test/t1.frm' test.t1 check error Corrupt SELECT * FROM t1; ERROR HY000: Failed to read from the .par file diff --git a/mysql-test/r/partition_not_windows.result b/mysql-test/r/partition_not_windows.result index 42dca557b3e..a1da9af675b 100644 --- a/mysql-test/r/partition_not_windows.result +++ b/mysql-test/r/partition_not_windows.result @@ -94,4 +94,4 @@ PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data', PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data', PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data' ); -Got one of the listed errors +ERROR HY000: Can't create/write to file '/not/existent/p0Data/example#P#p0.MYD' (Errcode: 2 "No such file or directory") diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index ec7fd798d4c..f4d473c00d5 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -2235,9 +2235,10 @@ INSERT INTO t1 VALUES (1, '2009-01-01'), (2, NULL); # test with an invalid date, which lead to item->null_value is set. EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-99' AS DATETIME); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 p20090401 ALL NULL NULL NULL NULL 2 Using where Warnings: Warning 1292 Incorrect datetime value: '2009-04-99' +Warning 1292 Incorrect datetime value: '2009-04-99' DROP TABLE t1; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 62864d0f16d..0eb49584c4a 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -35,18 +35,21 @@ PLUGIN_LICENSE GPL LOAD_OPTION ON PLUGIN_MATURITY Experimental PLUGIN_AUTH_VERSION 3.14.15.926 -CREATE TABLE t1(a int) ENGINE=EXAMPLE; +CREATE TABLE t1 (a int) ENGINE=EXAMPLE; +CREATE TABLE t2 (a int) ENGINE=EXAMPLE; +FLUSH TABLES; SELECT * FROM t1; a set global example_ulong_var=500; set global example_enum_var= e1; show status like 'example%'; Variable_name Value -example_func_example enum_var is 0, ulong_var is 500, really +Example_func_example enum_var is 0, ulong_var is 500, really show variables like 'example%'; Variable_name Value example_enum_var e1 example_ulong_var 500 +example_varopt_default 5 UNINSTALL SONAME 'ha_example'; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown @@ -65,6 +68,10 @@ LOAD_OPTION ON PLUGIN_MATURITY Experimental PLUGIN_AUTH_VERSION 0.1 DROP TABLE t1; +select * from information_schema.plugins where plugin_library like 'ha_example%'; +SELECT * FROM t2; +ERROR 42000: Unknown storage engine 'EXAMPLE' +DROP TABLE t2; UNINSTALL PLUGIN EXAMPLE; ERROR 42000: PLUGIN EXAMPLE does not exist UNINSTALL PLUGIN non_exist; @@ -113,7 +120,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL `complex`='c,f,f,f' -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000 `STR`='dskj' `one_or_two`='one' `YESNO`=0 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000 `STR`='dskj' `one_or_two`='one' `YESNO`=0 `VAROPT`='5' drop table t1; SET @OLD_SQL_MODE=@@SQL_MODE; SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS'; @@ -127,20 +134,20 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000000000000000000 `one_or_two`='ttt' `YESNO`=SSS +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=10000000000000000000 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' #alter table alter table t1 ULL=10000000; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `ULL`=10000000 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' `ULL`=10000000 alter table t1 change a a int complex='c,c,c'; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL `complex`='c,c,c' -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `ULL`=10000000 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `one_or_two`='ttt' `YESNO`=SSS `VAROPT`='5' `ULL`=10000000 drop table t1; #illegal value error SET SQL_MODE=''; @@ -155,17 +162,38 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=4660 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ULL`=4660 `VAROPT`='5' +SET example_varopt_default=33; select create_options from information_schema.tables where table_schema='test' and table_name='t1'; create_options -`ULL`=4660 +`ULL`=4660 `VAROPT`='5' ALTER TABLE t1 ULL=DEFAULT; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='5' DROP TABLE t1; +create table t1 (a int) engine=example; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='33' +drop table t1; +create table t1 (a int) engine=example varopt=15; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `varopt`=15 +alter table t1 varopt=default; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `VAROPT`='33' +drop table t1; SET @@SQL_MODE=@OLD_SQL_MODE; select 1; 1 diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index f8ebf65c0c5..356ac76962a 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -224,7 +224,7 @@ NULL # in connection plug_con SELECT @@LOCAL.external_user; @@LOCAL.external_user -'plug'@'%' +plug_dest # in connection default ## cleanup DROP USER plug; diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result index f300ea332cb..aa3a59b4f25 100644 --- a/mysql-test/r/plugin_auth_qa_2.result +++ b/mysql-test/r/plugin_auth_qa_2.result @@ -44,7 +44,7 @@ SELECT @@external_user; NULL exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user -authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%' +authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' externaluser SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string authenticated_as @@ -60,7 +60,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_pas GRANT PROXY ON qa_test_3_dest TO qa_test_3_user; exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user -qa_test_3_dest@% qa_test_3_user@localhost 'qa_test_3_user'@'%' 'qa_test_3_user'@'%' +qa_test_3_dest@% qa_test_3_user@localhost 'qa_test_3_user'@'%' qa_test_3_dest DROP USER qa_test_3_user; DROP USER qa_test_3_dest; === Assign too low values for *length, which should have no effect ==== @@ -70,7 +70,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_pas GRANT PROXY ON qa_test_4_dest TO qa_test_4_user; exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user -qa_test_4_dest@% qa_test_4_user@localhost 'qa_test_4_user'@'%' 'qa_test_4_user'@'%' +qa_test_4_dest@% qa_test_4_user@localhost 'qa_test_4_user'@'%' qa_test_4_dest DROP USER qa_test_4_user; DROP USER qa_test_4_dest; === Assign empty string especially to authenticated_as (in plugin) ==== diff --git a/mysql-test/r/plugin_auth_qa_3.result b/mysql-test/r/plugin_auth_qa_3.result index 656975aca30..dd4fb76ff8d 100644 --- a/mysql-test/r/plugin_auth_qa_3.result +++ b/mysql-test/r/plugin_auth_qa_3.result @@ -4,7 +4,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_pa GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user -qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' 'qa_test_11_user'@'%' +qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' NULL exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: NO) DROP USER qa_test_11_user, qa_test_11_dest; diff --git a/mysql-test/r/ps_11bugs.result b/mysql-test/r/ps_11bugs.result index 56894302505..3bc7039583b 100644 --- a/mysql-test/r/ps_11bugs.result +++ b/mysql-test/r/ps_11bugs.result @@ -120,7 +120,7 @@ create table t1 (a int primary key); insert into t1 values (1); explain select * from t1 where 3 in (select (1+1) union select 1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 3ca0cf8554f..0a8aea94e8a 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -533,7 +533,7 @@ drop table t2; prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; execute stmt1 ; -ERROR HY000: Can't find file: './test/t7' (errno: 2 "No such file or directory") +ERROR 42S02: Table 'test.t7' doesn't exist create table t7 (a int) ; execute stmt1 ; execute stmt1 ; diff --git a/mysql-test/r/quick_select_4161.result b/mysql-test/r/quick_select_4161.result new file mode 100644 index 00000000000..862be6055ce --- /dev/null +++ b/mysql-test/r/quick_select_4161.result @@ -0,0 +1,31 @@ +CREATE TABLE t1 ( +event_date date DEFAULT '0000-00-00' NOT NULL, +type int(11) DEFAULT '0' NOT NULL, +event_id int(11) DEFAULT '0' NOT NULL, +PRIMARY KEY (event_date,type,event_id) +); +INSERT INTO t1 VALUES ('1999-07-10',100100,24), ('1999-07-11',100100,25), +('1999-07-13',100600,0), ('1999-07-13',100600,4), ('1999-07-13',100600,26), +('1999-07-14',100600,10), ('1999-07-15',100600,16), ('1999-07-15',100800,45), +('1999-07-15',101000,47), ('1999-07-16',100800,46), ('1999-07-20',100600,5), +('1999-07-20',100600,27), ('1999-07-21',100600,11), ('1999-07-22',100600,17), +('1999-07-23',100100,39), ('1999-07-24',100100,39), ('1999-07-24',100500,40), +('1999-07-25',100100,39), ('1999-07-27',100600,1), ('1999-07-27',100600,6), +('1999-07-27',100600,28), ('1999-07-28',100600,12), ('1999-07-29',100500,41), +('1999-07-29',100600,18), ('1999-07-30',100500,41), ('1999-07-31',100500,41), +('1999-08-01',100700,34), ('1999-08-03',100600,7), ('1999-08-03',100600,29), +('1999-08-04',100600,13), ('1999-08-05',100500,42), ('1999-08-05',100600,19), +('1999-08-06',100500,42), ('1999-08-07',100500,42), ('1999-08-08',100500,42), +('1999-08-10',100600,2), ('1999-08-10',100600,9), ('1999-08-10',100600,30), +('1999-08-11',100600,14), ('1999-08-12',100600,20), ('1999-08-17',100500,8), +('1999-08-17',100600,31), ('1999-08-18',100600,15), ('1999-08-19',100600,22), +('1999-08-24',100600,3), ('1999-08-24',100600,32), ('1999-08-27',100500,43), +('1999-08-31',100600,33), ('1999-09-17',100100,37), ('1999-09-18',100100,37), +('1999-09-19',100100,37), ('2000-12-18',100700,38); +set debug_sync='inside_make_join_statistics signal killme wait_for done'; +select event_date,type,event_id from t1 WHERE event_date >= "1999-07-01" AND event_date < "1999-07-15" AND (type=100600 OR type=100100) ORDER BY event_date; +set debug_sync='now wait_for killme'; +kill %connection%; +set debug_sync='now signal done'; +Got one of the listed errors +drop table t1; diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result index edf05d0c5d3..7433ab8a0c9 100644 --- a/mysql-test/r/rename.result +++ b/mysql-test/r/rename.result @@ -14,20 +14,20 @@ select * from t1; 1 table 1 1 table 1 rename table t1 to t2; -Got one of the listed errors +ERROR 42S01: Table 't2' already exists rename table t1 to t1; -Got one of the listed errors +ERROR 42S01: Table 't1' already exists rename table t3 to t4, t2 to t3, t1 to t2, t4 to t2; -Got one of the listed errors +ERROR 42S01: Table 't2' already exists show tables like "t_"; Tables_in_test (t_) t1 t2 t3 rename table t3 to t1, t2 to t3, t1 to t2, t4 to t1; -Got one of the listed errors +ERROR 42S01: Table 't1' already exists rename table t3 to t4, t5 to t3, t1 to t2, t4 to t1; -Got one of the listed errors +ERROR 42S02: Table 'test.t5' doesn't exist select * from t1; 1 table 1 1 table 1 diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 80934a4e01f..f94c958a1be 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -405,7 +405,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 6 100.00 Using index 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 12 test.t1.a,const,const 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = 1) and (`test`.`t2`.`b` = 2) and (`test`.`t2`.`a` = `test`.`t1`.`a`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2`.`b` = 2) and (`test`.`t2`.`c` = 1)) SELECT * FROM t1,t2 WHERE (t2.a,(t2.b,t2.c))=(t1.a,(2,1)); a b a b c 1 1 1 2 1 @@ -415,7 +415,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 6 100.00 Using index 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 12 test.t1.a,const,const 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = 1) and (`test`.`t2`.`b` = 2) and (`test`.`t2`.`a` = `test`.`t1`.`a`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t2`.`b` = 2) and (`test`.`t2`.`c` = 1)) SELECT * FROM t1,t2 WHERE t2.a=t1.a AND (t2.b,t2.c)=(2,1); a b a b c 1 1 1 2 1 diff --git a/mysql-test/r/schema.result b/mysql-test/r/schema.result index 809d652053e..bb6dbd65f84 100644 --- a/mysql-test/r/schema.result +++ b/mysql-test/r/schema.result @@ -5,8 +5,8 @@ Database Create Database foo CREATE DATABASE `foo` /*!40100 DEFAULT CHARACTER SET latin1 */ show schemas; Database -information_schema foo +information_schema mtr mysql performance_schema diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 378b20829f3..3d16d37c5f1 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -5302,4 +5302,24 @@ INSERT INTO t2 VALUES (3),(4); SELECT * FROM t1, t2 WHERE a=3 AND a=b; a b drop table t1,t2; +# +# Bug mdev-4250: wrong transformation of WHERE condition with OR +# +CREATE TABLE t1 (pk int PRIMARY KEY, a int); +INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0); +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; +pk a +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where ((0 <> 0)) +DROP TABLE t1; +SELECT * FROM mysql.time_zone +WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1) +AND Time_zone_id = Time_zone_id +OR Time_zone_id <> Time_zone_id ) +AND Use_leap_seconds <> 'N'; +Time_zone_id Use_leap_seconds End of 5.3 tests diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index b5c6f89b87b..467f940c85d 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -5313,6 +5313,26 @@ INSERT INTO t2 VALUES (3),(4); SELECT * FROM t1, t2 WHERE a=3 AND a=b; a b drop table t1,t2; +# +# Bug mdev-4250: wrong transformation of WHERE condition with OR +# +CREATE TABLE t1 (pk int PRIMARY KEY, a int); +INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0); +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; +pk a +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where ((0 <> 0)) +DROP TABLE t1; +SELECT * FROM mysql.time_zone +WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1) +AND Time_zone_id = Time_zone_id +OR Time_zone_id <> Time_zone_id ) +AND Use_leap_seconds <> 'N'; +Time_zone_id Use_leap_seconds End of 5.3 tests set join_cache_level=default; show variables like 'join_cache_level'; diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result index 378b20829f3..3d16d37c5f1 100644 --- a/mysql-test/r/select_pkeycache.result +++ b/mysql-test/r/select_pkeycache.result @@ -5302,4 +5302,24 @@ INSERT INTO t2 VALUES (3),(4); SELECT * FROM t1, t2 WHERE a=3 AND a=b; a b drop table t1,t2; +# +# Bug mdev-4250: wrong transformation of WHERE condition with OR +# +CREATE TABLE t1 (pk int PRIMARY KEY, a int); +INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0); +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; +pk a +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select 2 AS `pk`,0 AS `a` from `test`.`t1` where ((0 <> 0)) +DROP TABLE t1; +SELECT * FROM mysql.time_zone +WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1) +AND Time_zone_id = Time_zone_id +OR Time_zone_id <> Time_zone_id ) +AND Use_leap_seconds <> 'N'; +Time_zone_id Use_leap_seconds End of 5.3 tests diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 1818713d443..2b7439b09e0 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -198,7 +198,7 @@ show create table t2; Table Create Table t2 CREATE TEMPORARY TABLE `t2` ( `a` int(11) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 drop table t2; create table t1 ( test_set set( 'val1', 'val2', 'val3' ) not null default '', diff --git a/mysql-test/r/show_explain.result b/mysql-test/r/show_explain.result index da132a102e2..be0b1c28b06 100644 --- a/mysql-test/r/show_explain.result +++ b/mysql-test/r/show_explain.result @@ -442,9 +442,9 @@ WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using where -2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 Using where +2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -set @show_explain_probe_select_id=2; +set @show_explain_probe_select_id=1; set debug_dbug='+d,show_explain_probe_do_select'; SELECT * FROM t2 WHERE a = (SELECT MAX(a) FROM t2 @@ -453,7 +453,7 @@ WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) show explain for $thr2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using where -2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 Using where +2 SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: Note 1003 SELECT * FROM t2 WHERE a = diff --git a/mysql-test/r/str_to_datetime_457.result b/mysql-test/r/str_to_datetime_457.result index 4fd0d00691c..630be9ffbaa 100644 --- a/mysql-test/r/str_to_datetime_457.result +++ b/mysql-test/r/str_to_datetime_457.result @@ -12,12 +12,12 @@ Warning 1292 Truncated incorrect datetime value: '2012103123595912' Warning 1292 Truncated incorrect datetime value: '20121031235959123' select cast(0 as date), cast('0000-00-00' as date), cast('0' as date); cast(0 as date) cast('0000-00-00' as date) cast('0' as date) -0000-00-00 0000-00-00 NULL +0000-00-00 0000-00-00 0000-00-00 Warnings: Warning 1292 Incorrect datetime value: '0' select extract(hour from '100000:02:03'), extract(hour from '100000:02:03 '); extract(hour from '100000:02:03') extract(hour from '100000:02:03 ') -NULL NULL +0 0 Warnings: Warning 1292 Truncated incorrect time value: '100000:02:03' Warning 1292 Truncated incorrect time value: '100000:02:03 ' diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 5f9376bba89..b3536661125 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -429,7 +429,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` where (1 = (select 1 union select 1)) +Note 1003 select 1 AS `1` from `test`.`t1` where 1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -558,10 +558,10 @@ Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using where; Using index +1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = '1') and (`test`.`t1`.`numreponse` = (select max(`test`.`t1`.`numreponse`) from `test`.`t1` where (`test`.`t1`.`numeropost` = '1')))) +Note 1003 select 3 AS `numreponse` from `test`.`t1` where ((1 = '1')) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -1371,7 +1371,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(sal insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 0 0.00 Using where +1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) @@ -1457,7 +1457,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1500,7 +1500,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` = `test`.`t3`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -2973,7 +2973,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`flag` = 'N')) +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`flag` = 'N') explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index ed07578fa17..1a33fb0c6a3 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -314,7 +314,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery idx idx 5 func 4 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond(((<cache>(`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond(((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond(<is_not_null_test>(`test`.`t1`.`ie1`)) and trigcond(<is_not_null_test>(`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` where ((`test`.`t2`.`b` = 10) and (`test`.`t2`.`a` = 10)) +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond(((<cache>(`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond(((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond(<is_not_null_test>(`test`.`t1`.`ie1`)) and trigcond(<is_not_null_test>(`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` where ((`test`.`t2`.`a` = 10) and (`test`.`t2`.`b` = 10)) drop table t1, t2; create table t1 (oref char(4), grp int, ie int); insert into t1 (oref, grp, ie) values @@ -1416,7 +1416,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where 1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary Warnings: -Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`cona`.`postalStripped` = 'T2H3B2') and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`c`.`idContact` = `test`.`cona`.`idContact`)) set @@optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; # diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result index 4f85f0faaab..5bae1453a5e 100644 --- a/mysql-test/r/subselect3_jcl6.result +++ b/mysql-test/r/subselect3_jcl6.result @@ -324,7 +324,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t1 index_subquery idx idx 5 func 4 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond(((<cache>(`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond(((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond(<is_not_null_test>(`test`.`t1`.`ie1`)) and trigcond(<is_not_null_test>(`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` where ((`test`.`t2`.`b` = 10) and (`test`.`t2`.`a` = 10)) +Note 1003 select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`b`,`test`.`t2`.`oref`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on idx checking NULL where ((`test`.`t1`.`oref` = `test`.`t2`.`oref`) and trigcond(trigcond(((<cache>(`test`.`t2`.`a`) = `test`.`t1`.`ie1`) or isnull(`test`.`t1`.`ie1`)))) and trigcond(trigcond(((<cache>(`test`.`t2`.`b`) = `test`.`t1`.`ie2`) or isnull(`test`.`t1`.`ie2`))))) having (trigcond(<is_not_null_test>(`test`.`t1`.`ie1`)) and trigcond(<is_not_null_test>(`test`.`t1`.`ie2`))))))) AS `Z` from `test`.`t2` where ((`test`.`t2`.`a` = 10) and (`test`.`t2`.`b` = 10)) drop table t1, t2; create table t1 (oref char(4), grp int, ie int); insert into t1 (oref, grp, ie) values @@ -1426,7 +1426,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary Warnings: -Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`cona`.`postalStripped` = 'T2H3B2') and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`c`.`idContact` = `test`.`cona`.`idContact`)) set @@optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; # diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 0d5209d0ec2..ff768886434 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -869,7 +869,7 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2); f1 f2 @@ -960,7 +960,7 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2); f1 f2 @@ -1055,7 +1055,7 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -1146,7 +1146,7 @@ NULL EXPLAIN SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10); f1 f2 @@ -2012,7 +2012,7 @@ FROM t2 JOIN t3 ON t3.f4 = t2.f4 WHERE t3.f1 = 8 GROUP BY 1, 2; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 system NULL NULL NULL NULL 1 Using temporary; Using filesort +1 PRIMARY t3 system NULL NULL NULL NULL 1 Using filesort 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table @@ -2325,5 +2325,19 @@ ORDER BY alias1.b; pk b pk b 1 1 1 1 drop table t1, t2, t3; +# +# MDEV-4144 simple subquery causes full scan instead of range scan +# +CREATE TABLE t1 (id int not null auto_increment, x int not null, primary key(id)); +INSERT INTO t1 (x) VALUES (0),(0),(0); +EXPLAIN +SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; +x +0 +drop table t1; SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; diff --git a/mysql-test/r/subselect_exists2in.result b/mysql-test/r/subselect_exists2in.result new file mode 100644 index 00000000000..efbbe08cede --- /dev/null +++ b/mysql-test/r/subselect_exists2in.result @@ -0,0 +1,865 @@ +drop table if exists t1,t2,t3; +set optimizer_switch='exists_to_in=on'; +# +# LP BUG#884644 exists2in broke name resolution +# +CREATE TABLE t1 (f1 integer); +SELECT * FROM t1 WHERE EXISTS (SELECT NO_SUCH_TABLE.NO_SUCH_FIELD FROM t1); +ERROR 42S22: Unknown column 'NO_SUCH_TABLE.NO_SUCH_FIELD' in 'field list' +drop table t1; +# +# LP BUG#884657 Wrong result with exists2in , correlated subquery +# +CREATE TABLE t1 ( a varchar(1)) ; +INSERT INTO t1 VALUES ('c'),('b'); +CREATE TABLE t2 ( b varchar(1)) ; +INSERT INTO t2 VALUES ('v'),('v'),('c'),(NULL),('x'),('i'),('e'),('p'),('s'),('j'),('z'),('c'),('a'),('q'),('y'),(NULL),('r'),('v'),(NULL),('r'); +CREATE TABLE t3 ( a int NOT NULL , b varchar(1)) ; +INSERT INTO t3 VALUES (29,'c'); +SELECT * +FROM t1, t2 +WHERE EXISTS ( +SELECT a +FROM t3 +WHERE t3.b = t1.a +AND t3.b <> t2.b +); +a b +c v +c v +c x +c i +c e +c p +c s +c j +c z +c a +c q +c y +c r +c v +c r +INSERT INTO t3 VALUES (2,'c'); +alter table t1 add index aa (a); +alter table t3 add index bb (b); +-- EXIST to IN then semijoin (has priority over IN to EXISTS) +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=on,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +a +c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index aa aa 4 NULL 2 100.00 Using index +1 PRIMARY t3 ALL bb NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t3`) where (`test`.`t3`.`b` = `test`.`t1`.`a`) +-- EXIST to IN then IN to EXISTS +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=off,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +a +c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL aa 4 NULL 2 100.00 Using where; Using index +2 DEPENDENT SUBQUERY t3 ALL bb NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(select `test`.`t3`.`b` from `test`.`t3` where (<cache>(`test`.`t1`.`a`) = `test`.`t3`.`b`))) +-- EXIST2IN then MATERIALIZATION +set optimizer_switch='exists_to_in=on,in_to_exists=off,semijoin=off,materialization=on,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +a +c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL aa 4 NULL 2 100.00 Using where; Using index +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (select `test`.`t3`.`b` from `test`.`t3` where 1 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where ((`test`.`t1`.`a` = `<subquery2>`.`b`))))) +-- NO EXIST2IN +set optimizer_switch='exists_to_in=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +a +c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL aa 4 NULL 2 100.00 Using where; Using index +2 DEPENDENT SUBQUERY t3 ALL bb NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`b` = `test`.`t1`.`a`)) +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +drop table t1,t2,t3; +# +# From group_min_max.test +# +create table t1 ( +a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' ' +); +insert into t1 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'), +('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'), +('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'), +('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'), +('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'), +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'), +('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'), +('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'), +('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'), +('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'); +create index idx_t1_0 on t1 (a1); +create index idx_t1_1 on t1 (a1,a2,b,c); +create index idx_t1_2 on t1 (a1,a2,b); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +create table t2 ( +a1 char(64), a2 char(64) not null, b char(16), c char(16), d char(16), dummy char(64) default ' ' +); +insert into t2 select * from t1; +insert into t2 (a1, a2, b, c, d) values +('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'), +('a','a','a',NULL,'xyz'), +('a','a','b',NULL,'xyz'), +('a','b','a',NULL,'xyz'), +('c','a',NULL,'c777','xyz'),('c','a',NULL,'c888','xyz'),('c','a',NULL,'c999','xyz'), +('d','b','b',NULL,'xyz'), +('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'), +('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'), +('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'), +('a','a','a',NULL,'xyz'), +('a','a','b',NULL,'xyz'), +('a','b','a',NULL,'xyz'), +('c','a',NULL,'c777','xyz'),('c','a',NULL,'c888','xyz'),('c','a',NULL,'c999','xyz'), +('d','b','b',NULL,'xyz'), +('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'), +('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'); +create index idx_t2_0 on t2 (a1); +create index idx_t2_1 on t2 (a1,a2,b,c); +create index idx_t2_2 on t2 (a1,a2,b); +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status Table is already up to date +create table t3 ( +a1 char(1), a2 char(1), b char(1), c char(4) not null, d char(3), dummy char(1) default ' ' +); +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); +create index idx_t3_0 on t3 (a1); +create index idx_t3_1 on t3 (a1,a2,b,c); +create index idx_t3_2 on t3 (a1,a2,b); +analyze table t3; +Table Op Msg_type Msg_text +test.t3 analyze status Table is already up to date +explain select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 +where t2.c in (select c from t3 where t3.c > t1.b) and +t2.c > 'b1' ) +group by a1,a2,b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index +2 DEPENDENT SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index +2 DEPENDENT SUBQUERY t3 index NULL idx_t3_1 10 NULL 192 Using where; Using index; FirstMatch(t2); Using join buffer (flat, BNL join) +select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 +where t2.c in (select c from t3 where t3.c > t1.b) and +t2.c > 'b1' ) +group by a1,a2,b; +a1 a2 b c min(c) max(c) +a a a a111 a111 d111 +a a b e112 e112 h112 +a b a i121 i121 l121 +a b b m122 m122 p122 +b a a a211 a211 d211 +b a b e212 e212 h212 +b b a i221 i221 l221 +b b b m222 m222 p222 +c a a a311 a311 d311 +c a b e312 e312 h312 +c b a i321 i321 l321 +c b b m322 m322 p322 +d a a a411 a411 d411 +d a b e412 e412 h412 +d b a i421 i421 l421 +d b b m422 m422 p422 +explain select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 +where t2.c in (select c from t3 where t3.c > t1.c) and +t2.c > 'b1' ) +group by a1,a2,b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index +2 DEPENDENT SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index +2 DEPENDENT SUBQUERY t3 index NULL idx_t3_1 10 NULL 192 Using where; Using index; FirstMatch(t2); Using join buffer (flat, BNL join) +select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 +where t2.c in (select c from t3 where t3.c > t1.c) and +t2.c > 'b1' ) +group by a1,a2,b; +a1 a2 b c min(c) max(c) +a a a a111 a111 d111 +a a b e112 e112 h112 +a b a i121 i121 l121 +a b b m122 m122 p122 +b a a a211 a211 d211 +b a b e212 e212 h212 +b b a i221 i221 l221 +b b b m222 m222 p222 +c a a a311 a311 d311 +c a b e312 e312 h312 +c b a i321 i321 l321 +c b b m322 m322 o322 +d a a a411 a411 d411 +d a b e412 e412 h412 +d b a i421 i421 l421 +d b b m422 m422 o422 +drop table t1, t2, t3; +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (7),(0); +CREATE TABLE t2 ( b INT ); +INSERT INTO t2 VALUES (0),(8); +SELECT * FROM t1 WHERE +EXISTS ( SELECT * FROM t2 WHERE b = a ) +OR a > 0; +a +7 +0 +explain extended +SELECT * FROM t1 WHERE +EXISTS ( SELECT * FROM t2 WHERE b = a ) +OR a > 0; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (select `test`.`t2`.`b` from `test`.`t2` where 1 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where ((`test`.`t1`.`a` = `<subquery2>`.`b`)))))) or (`test`.`t1`.`a` > 0)) +drop tables t1,t2; +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (1),(5); +CREATE TABLE t2 ( b INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1); +CREATE TABLE t3 ( c INT ); +INSERT INTO t3 VALUES (4),(5); +SET optimizer_switch='exists_to_in=on,subquery_cache=off,materialization=on,in_to_exists=off,semijoin=off'; +explain extended +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00 +3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t2.b' of SELECT #3 was resolved in SELECT #2 +Note 1003 select (select 1 from dual where (not(((1 is not null) and <in_optimizer>(1,1 in ( <materialize> (select `test`.`t3`.`c` from `test`.`t3` where (`test`.`t3`.`c` is not null) ), <primary_index_lookup>(1 in <temporary table> on distinct_key where ((1 = `<subquery3>`.`c`))))))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +1 +1 +SET optimizer_switch='exists_to_in=on,subquery_cache=off'; +explain extended +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00 +3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t2.b' of SELECT #3 was resolved in SELECT #2 +Note 1003 select (select 1 from dual where (not(((1 is not null) and <in_optimizer>(1,1 in ( <materialize> (select `test`.`t3`.`c` from `test`.`t3` where (`test`.`t3`.`c` is not null) ), <primary_index_lookup>(1 in <temporary table> on distinct_key where ((1 = `<subquery3>`.`c`))))))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +1 +1 +SET optimizer_switch='exists_to_in=off,subquery_cache=off'; +explain extended +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00 +3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t2.b' of SELECT #3 was resolved in SELECT #2 +Note 1003 select (select 1 from dual where (not(exists(select `test`.`t3`.`c` from `test`.`t3` where (`test`.`t3`.`c` = 1))))) AS `( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) )` from `test`.`t1` +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +1 +1 +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +drop table t1,t2,t3; +# multi condition test +CREATE TABLE t1 ( a varchar(1), a1 varchar(1)) ; +INSERT INTO t1 VALUES ('c', 'c'), ('b', 'b'); +CREATE TABLE t3 ( a int NOT NULL , b varchar(1), b1 varchar(1)) ; +INSERT INTO t3 VALUES (29,'c','c'); +INSERT INTO t3 VALUES (2,'c','c'); +alter table t1 add index aa (a,a1); +alter table t3 add index bb (b,b1); +-- EXIST to IN then semijoin (has priority over IN to EXISTS) +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=on,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +a a1 +c c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 index bb bb 8 NULL 2 100.00 Using where; Using index; LooseScan +1 PRIMARY t1 ref aa aa 8 test.t3.b,test.t3.b1 2 100.00 Using index +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` semi join (`test`.`t3`) where ((`test`.`t1`.`a` = `test`.`t3`.`b`) and (`test`.`t1`.`a1` = `test`.`t3`.`b1`)) +-- EXIST to IN then IN to EXISTS +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=off,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +a a1 +c c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL aa 8 NULL 2 100.00 Using where; Using index +2 DEPENDENT SUBQUERY t3 index_subquery bb bb 8 func,func 2 100.00 Using index; Using where +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`a1`),<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in t3 on bb where ((<cache>(`test`.`t1`.`a`) = `test`.`t3`.`b`) and (<cache>(`test`.`t1`.`a1`) = `test`.`t3`.`b1`))))) +-- EXIST2IN then MATERIALIZATION +set optimizer_switch='exists_to_in=on,in_to_exists=off,semijoin=off,materialization=on,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +a a1 +c c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL aa 8 NULL 2 100.00 Using where; Using index +2 MATERIALIZED t3 index NULL bb 8 NULL 2 100.00 Using index +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where <in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`a1`),(`test`.`t1`.`a`,`test`.`t1`.`a1`) in ( <materialize> (select `test`.`t3`.`b`,`test`.`t3`.`b1` from `test`.`t3` where 1 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where ((`test`.`t1`.`a` = `<subquery2>`.`b`) and (`test`.`t1`.`a1` = `<subquery2>`.`b1`))))) +-- NO EXIST2IN +set optimizer_switch='exists_to_in=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +a a1 +c c +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL aa 8 NULL 2 100.00 Using where; Using index +2 DEPENDENT SUBQUERY t3 ref bb bb 8 test.t1.a,test.t1.a1 2 100.00 Using index +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a1` AS `a1` from `test`.`t1` where exists(select 1 from `test`.`t3` where ((`test`.`t3`.`b` = `test`.`t1`.`a`) and (`test`.`t3`.`b1` = `test`.`t1`.`a1`))) +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +drop table t1,t3; +# +# MDEV-159 Assertion about not marked for read failed in +# String* Field_varstring::val_str(String*, String*) +# +SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' ); +SET optimizer_switch='in_to_exists=on,exists_to_in=on'; +CREATE TABLE t1 ( a VARCHAR(1) ); +INSERT INTO t1 VALUES ('k'),('m'); +CREATE TABLE t2 ( b INT, +c VARCHAR(1), +d VARCHAR(1) NOT NULL ); +INSERT INTO t2 VALUES +(4,'j','j'),(6,'v','v'); +CREATE ALGORITHM=MERGE VIEW v AS SELECT * FROM t2 WHERE b < 1; +SELECT c FROM v +WHERE EXISTS ( +SELECT * FROM t1, t2 +WHERE a <= v.d AND b = v.b +); +c +explain extended +SELECT c FROM v +WHERE EXISTS ( +SELECT * FROM t1, t2 +WHERE a <= v.d AND b = v.b +); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1276 Field or reference 'v.d' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'v.b' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t2`.`c` AS `c` from `test`.`t2` where (<in_optimizer>(`test`.`t2`.`b`,<exists>(select `test`.`t2`.`b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <= `test`.`t2`.`d`) and (<cache>(`test`.`t2`.`b`) = `test`.`t2`.`b`)))) and (`test`.`t2`.`b` < 1)) +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +drop view v; +drop table t1,t2; +# +# MDEV-160 Exists2In: Crash in in hp_movelink with subquery_cache=ON +# +SET optimizer_switch = 'in_to_exists=on,subquery_cache=on,exists_to_in=on'; +CREATE TABLE t1 ( +a VARCHAR(3) NOT NULL, +b VARCHAR(50) +); +INSERT INTO t1 VALUES +('USA','Chinese'),('USA','English'), +('FRA','French'),('ITA','Italian'); +CREATE TABLE t2 ( c VARCHAR(3) ); +INSERT INTO t2 VALUES ('USA'),('FRA'); +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( +SELECT * FROM t1, t2 +WHERE a <= alias2.a AND c = alias1.b +) OR alias1 .a = 'foo'; +a b a b +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( +SELECT * FROM t1, t2 +WHERE a <= alias2.a AND c = alias1.a +) OR alias1 .a = 'foo'; +a b a b +USA Chinese USA Chinese +USA English USA Chinese +FRA French USA Chinese +USA Chinese USA English +USA English USA English +FRA French USA English +USA Chinese FRA French +USA English FRA French +FRA French FRA French +USA Chinese ITA Italian +USA English ITA Italian +FRA French ITA Italian +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-160 Exists2In: Crash in in hp_movelink with subquery_cache=ON +# +SET optimizer_switch = 'in_to_exists=on,subquery_cache=on,exists_to_in=on'; +CREATE TABLE t1 ( +a VARCHAR(3) NOT NULL, +b VARCHAR(50) +); +INSERT INTO t1 VALUES +('USA','Chinese'),('USA','English'), +('FRA','French'),('ITA','Italian'); +CREATE TABLE t2 ( c VARCHAR(3) ); +INSERT INTO t2 VALUES ('USA'),('FRA'); +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( +SELECT * FROM t1, t2 +WHERE a <= alias2.a AND c = alias1.b +) OR alias1 .a = 'foo'; +a b a b +explain extended +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( +SELECT * FROM t1, t2 +WHERE a <= alias2.a AND c = alias1.b +) OR alias1 .a = 'foo'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY alias1 ALL NULL NULL NULL NULL 4 100.00 +1 PRIMARY alias2 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1276 Field or reference 'test.alias2.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.alias1.b' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`alias1`.`a` AS `a`,`test`.`alias1`.`b` AS `b`,`test`.`alias2`.`a` AS `a`,`test`.`alias2`.`b` AS `b` from `test`.`t1` `alias1` join `test`.`t1` `alias2` where (<expr_cache><`test`.`alias1`.`b`,`test`.`alias2`.`a`>(<in_optimizer>(`test`.`alias1`.`b`,<exists>(select `test`.`t2`.`c` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <= `test`.`alias2`.`a`) and (<cache>(`test`.`alias1`.`b`) = `test`.`t2`.`c`))))) or (`test`.`alias1`.`a` = 'foo')) +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-245 Exists2In: Wrong result (extra rows) with +# exists_to_in=ON, materialization=OFF, NOT EXISTS subquery +# +SET optimizer_switch='materialization=off,exists_to_in=on'; +CREATE TABLE t1 ( a INT ) ; +INSERT INTO t1 VALUES (0),(8),(1); +CREATE TABLE t2 ( b INT ) ; +INSERT INTO t2 VALUES (1),(2),(3); +SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * FROM t2 WHERE b = a ); +a +0 +8 +explain extended +SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * FROM t2 WHERE b = a ); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (not(((`test`.`t1`.`a` is not null) and <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(select `test`.`t2`.`b` from `test`.`t2` where ((`test`.`t2`.`b` is not null) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`b`)))))))) +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-243 Wrong result (extra or missing rows) with +# exists_to_in + materialization, EXISTS subquery +# +SET optimizer_switch='index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=on'; +CREATE TABLE t1 ( a VARCHAR(1), b VARCHAR(1) ); +INSERT INTO t1 VALUES ('v','v'),('s','v'); +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +a b +s v +explain extended +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY alias ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(alias); Using join buffer (flat, BNL join) +Warnings: +Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`alias`.`b`) and (`test`.`alias`.`b` > `test`.`alias`.`a`)) +SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' ); +SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=off'; +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +a b +s v +explain extended +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY alias ALL NULL NULL NULL NULL 2 100.00 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` where <in_optimizer>(`test`.`alias`.`b`,<exists>(select `test`.`t1`.`a` from `test`.`t1` where ((`test`.`t1`.`a` > `test`.`alias`.`a`) and (<cache>(`test`.`alias`.`b`) = `test`.`t1`.`a`)))) +SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=on'; +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +a b +s v +explain extended +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY alias ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary +Warnings: +Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`alias`.`a` AS `a`,`test`.`alias`.`b` AS `b` from `test`.`t1` `alias` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`alias`.`b`) and (`test`.`alias`.`b` > `test`.`alias`.`a`)) +drop table t1; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-403 Wrong result (missing rows) with subquery in +# EXISTS and an OR condition outside +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (2),(3); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (1),(3); +SET optimizer_switch = 'exists_to_in=off,in_to_exists=on'; +SELECT * FROM t1 AS alias1, t2 AS alias2 +WHERE EXISTS ( +SELECT 1 FROM t2 WHERE b = alias1.a AND b > alias2.b +) OR a = 5; +a b +3 1 +SET optimizer_switch = 'exists_to_in=on,in_to_exists=on'; +SELECT * FROM t1 AS alias1, t2 AS alias2 +WHERE EXISTS ( +SELECT 1 FROM t2 WHERE b = alias1.a AND b > alias2.b +) OR a = 5; +a b +3 1 +explain extended +SELECT * FROM t1 AS alias1, t2 AS alias2 +WHERE EXISTS ( +SELECT 1 FROM t2 WHERE b = alias1.a AND b > alias2.b +) OR a = 5; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.alias1.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.alias2.b' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`alias1`.`a` AS `a`,`test`.`alias2`.`b` AS `b` from `test`.`t1` `alias1` join `test`.`t2` `alias2` where (<expr_cache><`test`.`alias1`.`a`,`test`.`alias2`.`b`>(<in_optimizer>(`test`.`alias1`.`a`,<exists>(select `test`.`t2`.`b` from `test`.`t2` where ((`test`.`t2`.`b` > `test`.`alias2`.`b`) and (<cache>(`test`.`alias1`.`a`) = `test`.`t2`.`b`))))) or (`test`.`alias1`.`a` = 5)) +drop table t1, t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-404: Wrong result (extra rows) with STRAIGHT_JOIN, +# EXISTS subquery, NOT NULL column +# (same as above) +# +SET optimizer_switch = 'exists_to_in=on,in_to_exists=on'; +CREATE TABLE t1 (a INT, b VARCHAR(1) NOT NULL); +INSERT INTO t1 VALUES (1,'s'),(2,'e'); +SELECT STRAIGHT_JOIN * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( SELECT 1 FROM t1 WHERE b < alias2.b AND a = alias1.a ); +a b a b +2 e 1 s +drop table t1; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-3800: ORDER BY doesn't work with exists_to_in=ON on +# a query with EXISTS subquery and OR condition +# +SET optimizer_switch = 'in_to_exists=on,exists_to_in=on'; +CREATE TABLE t1 (a INT, b VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4,'j'),(6,'v'),(3,'c'); +CREATE TABLE t2 (c VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('b'),('y'); +SELECT a FROM t1 +WHERE EXISTS ( +SELECT 1 FROM t2 WHERE c = b +) OR b NOT IN ('U') +ORDER BY a; +a +3 +4 +6 +select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`b` in (select `test`.`t2`.`c` from `test`.`t2` where 1 ) or (`test`.`t1`.`b` <> 'U') order by `test`.`t1`.`a`; +a +3 +4 +6 +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# correct calculation of reserved items (postreview-fix) +# +create table t1 (col1 int, col2 int, col3 int); +insert into t1 values (1,2,3),(2,3,4),(4,5,6); +create table t2 as select * from t1; +explain extended +select * from t1 where exists (select col2 from t2 where t2.col1=t1.col1 and t2.col2=t1.col2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.col1' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.t1.col2' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t1`.`col2` AS `col2`,`test`.`t1`.`col3` AS `col3` from `test`.`t1` semi join (`test`.`t2`) where 1 +select * from t1 where exists (select col2 from t2 where t2.col1=t1.col1 and t2.col2=t1.col2); +col1 col2 col3 +1 2 3 +2 3 4 +4 5 6 +drop table t1,t2; +# +# MDEV-3879: Exists2In: Wrong result (extra row) and unexpected +# warning with exists_to_in=on and a NOT EXISTS subquery +# +SET optimizer_switch = 'exists_to_in=on'; +CREATE TABLE t1 (a1 INT, b1 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3,'y'),(6,'w'); +CREATE TABLE t2 (a2 INT, b2 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3,'y'),(6,'d'); +SELECT * FROM t1 +WHERE NOT EXISTS ( SELECT * FROM t2 WHERE b2 = b1 AND a2 = a1 ); +a1 b1 +6 w +drop table t1, t2; +# +# MDEV-3880: Wrong result (missing rows) with exists_to_in=on, +# LEFT JOIN and NOT EXISTS subquery. +# (Duplicate of above MDEV-3879). +# +SET optimizer_switch = 'exists_to_in=on'; +CREATE TABLE t1 (a1 INT, b1 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4,'b'),(5,'y'); +CREATE TABLE t2 (b2 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('z'),('b'); +CREATE TABLE t3 (a3 INT, b3 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (4,'j'),(6,'v'); +SELECT * FROM t1 LEFT JOIN t2 ON ( b2 = b1 ) +WHERE NOT EXISTS ( SELECT * FROM t3 WHERE b3 = b2 AND a3 = a1 ) ; +a1 b1 b2 +4 b b +5 y NULL +drop table t1, t2, t3; +# +# MDEV-3881: Endless loop and crash in Item_ref::real_item with +# exists_to_in=on, NOT EXISTS subquery, merge view or from subquery, +# constant table +# +SET optimizer_switch = 'exists_to_in=on'; +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(7); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (8); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t2; +CREATE TABLE t3 (c INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (4),(6); +SELECT * FROM t1, v1 WHERE NOT EXISTS ( SELECT * FROM t3 WHERE c = b ) AND a = b; +a b +drop view v1; +drop table t1, t2, t3; +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(7); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (8); +CREATE TABLE t3 (c INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (4),(6); +SELECT * FROM t1, ( SELECT * FROM t2 ) alias WHERE NOT EXISTS ( SELECT * FROM t3 WHERE c = b ) AND a = b; +a b +drop table t1, t2, t3; +# +# MDEV-3906: Server crashes in Dependency_marker::visit_field +# on 2nd execution of PS with exists_to_in and NOT EXISTS subquery +# +SET optimizer_switch='exists_to_in=on'; +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(7); +PREPARE stmt FROM ' +SELECT * FROM t1 AS alias +WHERE NOT EXISTS ( SELECT * FROM t1 WHERE t1.a = alias.a ) +'; +EXECUTE stmt; +a +EXECUTE stmt; +a +drop table t1; +# +# MDEV-3904: Assertion `in_subs->has_strategy()' failed in +# JOIN::choose_subquery_plan on 2nd execution of PS with +# exists_to_in+semijoin, EXISTS subquery, MERGE view or FROM subquery +# +SET optimizer_switch='in_to_exists=on,semijoin=on,exists_to_in=on'; +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (4),(6); +CREATE ALGORITHM=MERGE VIEW v AS +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE b = a ); +PREPARE stmt FROM ' SELECT * FROM v '; +EXECUTE stmt; +a +EXECUTE stmt; +a +drop view v; +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-3903: Server crashes in Item_cond::fix_fields on 2nd execution +# of a prepared stmt with exists_to_in+materialization+semijoin, +# EXISTS subquery, STRAIGHT_JOIN +# +SET optimizer_switch='materialization=on,semijoin=on,exists_to_in=on'; +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3),(4); +PREPARE stmt FROM +'SELECT STRAIGHT_JOIN * FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE b = a )'; +EXECUTE stmt; +a +EXECUTE stmt; +a +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +# +# MDEV-4152: Wrong result (missing rows) with exists_to_in=on, +# inner joins +# +SET optimizer_switch='materialization=on,semijoin=on,exists_to_in=on'; +CREATE TABLE t1 (i INT, c1 CHAR(5), c2 CHAR(5), t1_field VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'test1','test2','f'), (2,'test3','test4','d'); +CREATE TABLE t2 (t2_field VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('m'), ('b'); +CREATE TABLE t3 (t3_field VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t3 VALUES ('b'),('c'); +SELECT * FROM t1, t2 outer_t2 +WHERE EXISTS ( SELECT 1 FROM t2, t3 WHERE t3_field = outer_t2.t2_field AND t2_field <= t1_field ); +i c1 c2 t1_field t2_field +1 test1 test2 f b +2 test3 test4 d b +drop table t1,t2,t3; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +set optimizer_switch=default; diff --git a/mysql-test/r/subselect_exists2in_costmat.result b/mysql-test/r/subselect_exists2in_costmat.result new file mode 100644 index 00000000000..a46996d9bad --- /dev/null +++ b/mysql-test/r/subselect_exists2in_costmat.result @@ -0,0 +1,103 @@ +set @subselect_mat_cost=@@optimizer_switch; +set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; +set long_query_time=0.1; +drop database if exists world; +set names utf8; +create database world; +use world; +CREATE TABLE Country ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +Population int(11) NOT NULL default '0', +Capital int(11) default NULL, +PRIMARY KEY (Code), +UNIQUE INDEX (Name) +); +CREATE TABLE City ( +ID int(11) NOT NULL auto_increment, +Name char(35) NOT NULL default '', +Country char(3) NOT NULL default '', +Population int(11) NOT NULL default '0', +PRIMARY KEY (ID), +INDEX (Population), +INDEX (Country) +); +CREATE TABLE CountryLanguage ( +Country char(3) NOT NULL default '', +Language char(30) NOT NULL default '', +Percentage float(3,1) NOT NULL default '0.0', +PRIMARY KEY (Country, Language), +INDEX (Percentage) +); +Make the schema and data more diverse by adding more indexes, nullable +columns, and NULL data. +create index SurfaceArea on Country(SurfaceArea); +create index Language on CountryLanguage(Language); +create index CityName on City(Name); +alter table City change population population int(11) null default 0; +select max(id) from City into @max_city_id; +insert into City values (@max_city_id + 1,'Kilifarevo','BGR',NULL); +SELECT COUNT(*) FROM Country; +COUNT(*) +239 +SELECT COUNT(*) FROM City; +COUNT(*) +4080 +SELECT COUNT(*) FROM CountryLanguage; +COUNT(*) +984 +set @@optimizer_switch = 'exists_to_in=on,in_to_exists=on,semijoin=on,materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on'; + +1. Subquery in a disjunctive WHERE clause of the outer query. + + +Q1.1m: +MATERIALIZATION: there are too many rows in the outer query +to be looked up in the inner table. +EXPLAIN +SELECT Name FROM Country +WHERE (EXISTS (select 1 from City where City.Population > 100000 and +Code = Country) OR +Name LIKE 'L%') AND +surfacearea > 1000000; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY Country ALL Name,SurfaceArea NULL NULL NULL 239 Using where +2 MATERIALIZED City ALL Population,Country NULL NULL NULL 4080 Using where +SELECT Name FROM Country +WHERE (EXISTS (select 1 from City where City.Population > 100000 and +Code = Country) OR +Name LIKE 'L%') AND +surfacearea > 1000000; +Name +Algeria +Angola +Argentina +Australia +Bolivia +Brazil +Egypt +South Africa +Ethiopia +Indonesia +India +Iran +Canada +Kazakstan +China +Colombia +Congo, The Democratic Republic of the +Libyan Arab Jamahiriya +Mali +Mauritania +Mexico +Mongolia +Niger +Peru +Saudi Arabia +Sudan +Chad +Russian Federation +United States +drop database world; +set optimizer_switch=@subselect_mat_cost; diff --git a/mysql-test/r/subselect_exists_to_in.result b/mysql-test/r/subselect_exists_to_in.result new file mode 100644 index 00000000000..579277f11f9 --- /dev/null +++ b/mysql-test/r/subselect_exists_to_in.result @@ -0,0 +1,7021 @@ +select @@optimizer_switch like '%exists_to_in=on%'; +@@optimizer_switch like '%exists_to_in=on%' +0 +set optimizer_switch='exists_to_in=on'; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; +drop view if exists v2; +set @subselect_tmp=@@optimizer_switch; +set @@optimizer_switch=ifnull(@optimizer_switch_for_subselect_test, +"semijoin=on,firstmatch=on,loosescan=on,semijoin_with_cache=on,partial_match_rowid_merge=off,partial_match_table_scan=off"); +set join_cache_level=1; +set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; +select (select 2); +(select 2) +2 +explain extended select (select 2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1003 select 2 AS `(select 2)` +SELECT (SELECT 1) UNION SELECT (SELECT 2); +(SELECT 1) +1 +2 +explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1249 Select 4 was reduced during optimization +Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)` +SELECT (SELECT (SELECT 0 UNION SELECT 0)); +(SELECT (SELECT 0 UNION SELECT 0)) +0 +explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +4 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1003 select (select 0 union select 0) AS `(SELECT (SELECT 0 UNION SELECT 0))` +SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; +ERROR 42S22: Reference 'a' not supported (forward reference in item list) +SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b; +ERROR 42S22: Reference 'b' not supported (forward reference in item list) +SELECT (SELECT 1),MAX(1) FROM (SELECT 1) as a; +(SELECT 1) MAX(1) +1 1 +SELECT (SELECT a) as a; +ERROR 42S22: Reference 'a' not supported (forward reference in item list) +EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00 +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 +Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select 1 AS `1` from dual having ((select 1) = 1) +SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; +1 +1 +SELECT (SELECT 1), a; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1; +a +1 +SELECT 1 FROM (SELECT (SELECT a) b) c; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id); +id +1 +SELECT * FROM (SELECT 1) a WHERE 1 IN (SELECT 1,1); +ERROR 21000: Operand should contain 1 column(s) +SELECT 1 IN (SELECT 1); +1 IN (SELECT 1) +1 +SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); +1 +1 +select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); +ERROR HY000: Incorrect usage of PROCEDURE and subquery +SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); +ERROR HY000: Incorrect parameters to procedure 'ANALYSE' +SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NOT NULL; +ERROR 42S22: Unknown column 'a' in 'field list' +SELECT (SELECT 1,2,3) = ROW(1,2,3); +(SELECT 1,2,3) = ROW(1,2,3) +1 +SELECT (SELECT 1,2,3) = ROW(1,2,1); +(SELECT 1,2,3) = ROW(1,2,1) +0 +SELECT (SELECT 1,2,3) < ROW(1,2,1); +(SELECT 1,2,3) < ROW(1,2,1) +0 +SELECT (SELECT 1,2,3) > ROW(1,2,1); +(SELECT 1,2,3) > ROW(1,2,1) +1 +SELECT (SELECT 1,2,3) = ROW(1,2,NULL); +(SELECT 1,2,3) = ROW(1,2,NULL) +NULL +SELECT ROW(1,2,3) = (SELECT 1,2,3); +ROW(1,2,3) = (SELECT 1,2,3) +1 +SELECT ROW(1,2,3) = (SELECT 1,2,1); +ROW(1,2,3) = (SELECT 1,2,1) +0 +SELECT ROW(1,2,3) < (SELECT 1,2,1); +ROW(1,2,3) < (SELECT 1,2,1) +0 +SELECT ROW(1,2,3) > (SELECT 1,2,1); +ROW(1,2,3) > (SELECT 1,2,1) +1 +SELECT ROW(1,2,3) = (SELECT 1,2,NULL); +ROW(1,2,3) = (SELECT 1,2,NULL) +NULL +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); +(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +1 +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); +(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +0 +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); +(SELECT 1.5,2,'a') = ROW('1.5b',2,'b') +0 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '1.5b' +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); +(SELECT 'b',2,'a') = ROW(1.5,2,'a') +0 +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); +(SELECT 1.5,2,'a') = ROW(1.5,'2','a') +1 +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); +(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +0 +SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a); +ERROR 21000: Operand should contain 1 column(s) +SELECT 1 as a,(SELECT a+a) b,(SELECT b); +a b (SELECT b) +1 2 2 +create table t1 (a int); +create table t2 (a int, b int); +create table t3 (a int); +create table t4 (a int not null, b int not null); +insert into t1 values (2); +insert into t2 values (1,7),(2,7); +insert into t4 values (4,8),(3,8),(5,9); +select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1; +ERROR 42S22: Reference 'a1' not supported (forward reference in item list) +select (select a from t1 where t1.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a) a +NULL 1 +2 2 +select (select a from t1 where t1.a=t2.b), a from t2; +(select a from t1 where t1.a=t2.b) a +NULL 1 +NULL 2 +select (select a from t1), a, (select 1 union select 2 limit 1) from t2; +(select a from t1) a (select 1 union select 2 limit 1) +2 1 1 +2 2 1 +select (select a from t3), a from t2; +(select a from t3) a +NULL 1 +NULL 2 +select * from t2 where t2.a=(select a from t1); +a b +2 7 +insert into t3 values (6),(7),(3); +select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1); +a b +1 7 +2 7 +(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 order by a limit 2) limit 3; +a b +1 7 +2 7 +3 8 +(select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a); +a b +1 7 +2 7 +4 8 +3 8 +explain extended (select * from t2 where t2.b=(select a from t3 order by 1 desc limit 1)) union (select * from t4 where t4.b=(select max(t2.a)*4 from t2) order by a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where +2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using filesort +3 UNION t4 ALL NULL NULL NULL NULL 3 100.00 Using where +4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 +NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)) order by `a`) +select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2; +(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a +3 1 +7 2 +select (select t3.a from t3 where a<8 order by 1 desc limit 1), a from +(select * from t2 where a>1) as tt; +(select t3.a from t3 where a<8 order by 1 desc limit 1) a +7 2 +set @tmp_optimizer_switch=@@optimizer_switch; +set optimizer_switch='derived_merge=off,derived_with_keys=off'; +explain extended select (select t3.a from t3 where a<8 order by 1 desc limit 1), a from +(select * from t2 where a>1) as tt; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <derived3> ALL NULL NULL NULL NULL 2 100.00 +3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where +2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort +Warnings: +Note 1003 select (select `test`.`t3`.`a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt` +set optimizer_switch=@tmp_optimizer_switch; +select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); +a +2 +select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a > t1.a) order by 1 desc limit 1); +a +2 +select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); +a +select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +8 7.5000 +8 4.5000 +9 7.5000 +explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 +3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select `test`.`t4`.`b` AS `b`,<expr_cache><`test`.`t4`.`a`>((select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +select * from t3 where exists (select * from t2 where t2.b=t3.a); +a +7 +select * from t3 where not exists (select * from t2 where t2.b=t3.a); +a +6 +3 +select * from t3 where a in (select b from t2); +a +7 +select * from t3 where a not in (select b from t2); +a +6 +3 +select * from t3 where a = some (select b from t2); +a +7 +select * from t3 where a <> any (select b from t2); +a +6 +3 +select * from t3 where a = all (select b from t2); +a +7 +select * from t3 where a <> all (select b from t2); +a +6 +3 +insert into t2 values (100, 5); +select * from t3 where a < any (select b from t2); +a +6 +3 +select * from t3 where a < all (select b from t2); +a +3 +select * from t3 where a >= any (select b from t2); +a +6 +7 +explain extended select * from t3 where a >= any (select b from t2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,((select min(`test`.`t2`.`b`) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`)))) +select * from t3 where a >= all (select b from t2); +a +7 +delete from t2 where a=100; +select * from t3 where a in (select a,b from t2); +ERROR 21000: Operand should contain 1 column(s) +select * from t3 where a in (select * from t2); +ERROR 21000: Operand should contain 1 column(s) +insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10); +select b,max(a) as ma from t4 group by b having b < (select max(t2.a) from t2 where t2.b=t4.b); +b ma +insert into t2 values (2,10); +select b,max(a) as ma from t4 group by b having ma < (select max(t2.a) from t2 where t2.b=t4.b); +b ma +10 1 +delete from t2 where a=2 and b=10; +select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 where t2.b=t4.b); +b ma +7 12 +create table t5 (a int); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +insert into t5 values (5); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +insert into t5 values (2); +select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +NULL 1 +2 2 +explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 +2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 +3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 100.00 Using where +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select <expr_cache><`test`.`t2`.`a`>((select 2 from dual where (2 = `test`.`t2`.`a`) union select `test`.`t5`.`a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`))) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; +ERROR 21000: Subquery returns more than 1 row +create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); +create table t7( uq int primary key, name char(25)); +insert into t7 values(1,"Oblastnaia bolnitsa"),(2,"Bolnitsa Krasnogo Kresta"); +insert into t6 values (1,1),(1,2),(2,2),(1,3); +select * from t6 where exists (select * from t7 where uq = clinic_uq); +patient_uq clinic_uq +1 1 +1 2 +2 2 +explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t7 index PRIMARY PRIMARY 4 NULL 2 100.00 Using index +1 PRIMARY t6 ALL i1 NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where (`test`.`t6`.`clinic_uq` = `test`.`t7`.`uq`) +select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); +ERROR 23000: Column 'a' in field list is ambiguous +drop table t1,t2,t3; +CREATE TABLE t3 (a varchar(20),b char(1) NOT NULL default '0'); +INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b'); +CREATE TABLE t2 (a varchar(20),b int NOT NULL default '0'); +INSERT INTO t2 VALUES ('W','1'),('A','3'),('J','2'); +CREATE TABLE t1 (a varchar(20),b date NOT NULL default '0000-00-00'); +INSERT INTO t1 VALUES ('W','1732-02-22'),('A','1735-10-30'),('J','1743-04-13'); +SELECT * FROM t1 WHERE b = (SELECT MIN(b) FROM t1); +a b +W 1732-02-22 +SELECT * FROM t2 WHERE b = (SELECT MIN(b) FROM t2); +a b +W 1 +SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3); +a b +W a +CREATE TABLE `t8` ( +`pseudo` varchar(35) character set latin1 NOT NULL default '', +`email` varchar(60) character set latin1 NOT NULL default '', +PRIMARY KEY (`pseudo`), +UNIQUE KEY `email` (`email`) +) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC; +INSERT INTO t8 (pseudo,email) VALUES ('joce','test'); +INSERT INTO t8 (pseudo,email) VALUES ('joce1','test1'); +INSERT INTO t8 (pseudo,email) VALUES ('2joce1','2test1'); +EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce')) FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index +4 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index +2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 +3 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1 100.00 Using index +Warnings: +Note 1003 select 'joce' AS `pseudo`,(select 'test' from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1 +SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM +t8 WHERE pseudo='joce'); +ERROR 21000: Operand should contain 1 column(s) +SELECT pseudo FROM t8 WHERE pseudo=(SELECT * FROM t8 WHERE +pseudo='joce'); +ERROR 21000: Operand should contain 1 column(s) +SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'); +pseudo +joce +SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo LIKE '%joce%'); +ERROR 21000: Subquery returns more than 1 row +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8; +CREATE TABLE `t1` ( +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`pseudo`,`date`,`topic`), +KEY `topic` (`topic`) +) ENGINE=MyISAM ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (topic,date,pseudo) VALUES +('43506','2002-10-02','joce'),('40143','2002-08-03','joce'); +EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03') +EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY t1 index NULL PRIMARY 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 select (select distinct `test`.`t1`.`date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')` +SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'; +date +2002-08-03 +SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03'); +(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03') +2002-08-03 +SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1; +1 +1 +1 +1 +SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1; +ERROR 21000: Subquery returns more than 1 row +EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL topic 3 NULL 2 100.00 Using index +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select 1 AS `1` from `test`.`t1` where 1 +drop table t1; +CREATE TABLE `t1` ( +`numeropost` mediumint(8) unsigned NOT NULL auto_increment, +`maxnumrep` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`), +UNIQUE KEY `maxnumrep` (`maxnumrep`) +) ENGINE=MyISAM ROW_FORMAT=FIXED; +INSERT INTO t1 (numeropost,maxnumrep) VALUES (40143,1),(43506,2); +CREATE TABLE `t2` ( +`mot` varchar(30) NOT NULL default '', +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) NOT NULL default '', +PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`) +) ENGINE=MyISAM ROW_FORMAT=DYNAMIC; +INSERT INTO t2 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce'); +select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); +a +40143 +SELECT numeropost,maxnumrep FROM t1 WHERE exists (SELECT 1 FROM t2 WHERE (mot='joce') AND date >= '2002-10-21' AND t1.numeropost = t2.topic) ORDER BY maxnumrep DESC LIMIT 0, 20; +numeropost maxnumrep +43506 2 +40143 1 +SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) b; +ERROR 42S22: Unknown column 'a' in 'having clause' +SELECT 1 IN (SELECT 1 FROM t2 HAVING a); +ERROR 42S22: Unknown column 'a' in 'having clause' +SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100); +mot topic date pseudo +SELECT * from t2 where topic IN (SELECT SUM(topic) FROM t1); +mot topic date pseudo +SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100); +mot topic date pseudo +SELECT * from t2 where topic = any (SELECT SUM(topic) FROM t1); +mot topic date pseudo +SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic); +mot topic date pseudo +SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; +mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +joce 40143 2002-10-22 joce 1 +joce 43506 2002-10-22 joce 1 +SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); +mot topic date pseudo +SELECT * from t2 where topic <> any (SELECT SUM(topic) FROM t2); +mot topic date pseudo +joce 40143 2002-10-22 joce +joce 43506 2002-10-22 joce +SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); +mot topic date pseudo +joce 40143 2002-10-22 joce +SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); +mot topic date pseudo +joce 40143 2002-10-22 joce +SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); +mot topic date pseudo +joce 40143 2002-10-22 joce +SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; +mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +joce 40143 2002-10-22 joce 1 +joce 43506 2002-10-22 joce 0 +drop table t1,t2; +CREATE TABLE `t1` ( +`numeropost` mediumint(8) unsigned NOT NULL auto_increment, +`maxnumrep` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`), +UNIQUE KEY `maxnumrep` (`maxnumrep`) +) ENGINE=MyISAM ROW_FORMAT=FIXED; +INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1); +select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1); +ERROR 21000: Subquery returns more than 1 row +select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1); +ERROR 21000: Subquery returns more than 1 row +show warnings; +Level Code Message +Error 1242 Subquery returns more than 1 row +Error 1028 Sort aborted: Subquery returns more than 1 row +drop table t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +(select * from t1) union (select * from t1) order by (select a from t1 limit 1); +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 (field char(1) NOT NULL DEFAULT 'b'); +INSERT INTO t1 VALUES (); +SELECT field FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) a HAVING field='b'); +ERROR 21000: Subquery returns more than 1 row +drop table t1; +CREATE TABLE `t1` ( +`numeropost` mediumint(8) unsigned NOT NULL default '0', +`numreponse` int(10) unsigned NOT NULL auto_increment, +`pseudo` varchar(35) NOT NULL default '', +PRIMARY KEY (`numeropost`,`numreponse`), +UNIQUE KEY `numreponse` (`numreponse`), +KEY `pseudo` (`pseudo`,`numeropost`) +) ENGINE=MyISAM; +SELECT (SELECT numeropost FROM t1 HAVING numreponse=a),numreponse FROM (SELECT * FROM t1) as a; +ERROR 42S22: Reference 'numreponse' not supported (forward reference in item list) +SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=a) FROM (SELECT * FROM t1) as a; +ERROR 42S22: Unknown column 'a' in 'having clause' +SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=1) FROM (SELECT * FROM t1) as a; +numreponse (SELECT numeropost FROM t1 HAVING numreponse=1) +INSERT INTO t1 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test'); +EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1'); +ERROR 21000: Subquery returns more than 1 row +SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1'); +ERROR 21000: Subquery returns more than 1 row +EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') +EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 select 3 AS `numreponse` from `test`.`t1` where ((1 = '1')) +drop table t1; +CREATE TABLE t1 (a int(1)); +INSERT INTO t1 VALUES (1); +SELECT 1 FROM (SELECT a FROM t1) b HAVING (SELECT b.a)=1; +1 +1 +drop table t1; +create table t1 (a int NOT NULL, b int, primary key (a)); +create table t2 (a int NOT NULL, b int, primary key (a)); +insert into t1 values (0, 10),(1, 11),(2, 12); +insert into t2 values (1, 21),(2, 22),(3, 23); +select * from t1; +a b +0 10 +1 11 +2 12 +update t1 set b= (select b from t1); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +update t1 set b= (select b from t2); +ERROR 21000: Subquery returns more than 1 row +update t1 set b= (select b from t2 where t1.a = t2.a); +select * from t1; +a b +0 NULL +1 21 +2 22 +drop table t1, t2; +create table t1 (a int NOT NULL, b int, primary key (a)); +create table t2 (a int NOT NULL, b int, primary key (a)); +insert into t1 values (0, 10),(1, 11),(2, 12); +insert into t2 values (1, 21),(2, 12),(3, 23); +select * from t1; +a b +0 10 +1 11 +2 12 +select * from t1 where b = (select b from t2 where t1.a = t2.a); +a b +2 12 +delete from t1 where b in (select b from t1); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +delete from t1 where b = (select b from t2); +ERROR 21000: Subquery returns more than 1 row +delete from t1 where b = (select b from t2 where t1.a = t2.a); +select * from t1; +a b +0 10 +1 11 +drop table t1, t2; +create table t11 (a int NOT NULL, b int, primary key (a)); +create table t12 (a int NOT NULL, b int, primary key (a)); +create table t2 (a int NOT NULL, b int, primary key (a)); +insert into t11 values (0, 10),(1, 11),(2, 12); +insert into t12 values (33, 10),(22, 11),(2, 12); +insert into t2 values (1, 21),(2, 12),(3, 23); +select * from t11; +a b +0 10 +1 11 +2 12 +select * from t12; +a b +33 10 +22 11 +2 12 +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a); +ERROR HY000: You can't specify target table 't12' for update in FROM clause +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2); +ERROR 21000: Subquery returns more than 1 row +delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a); +select * from t11; +a b +0 10 +1 11 +select * from t12; +a b +33 10 +22 11 +drop table t11, t12, t2; +CREATE TABLE t1 (x int) ENGINE=MyISAM; +create table t2 (a int) ENGINE=MyISAM; +create table t3 (b int); +insert into t2 values (1); +insert into t3 values (1),(2); +INSERT INTO t1 (x) VALUES ((SELECT x FROM t1)); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +INSERT INTO t1 (x) VALUES ((SELECT b FROM t3)); +ERROR 21000: Subquery returns more than 1 row +INSERT INTO t1 (x) VALUES ((SELECT a FROM t2)); +select * from t1; +x +1 +insert into t2 values (1); +INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2)); +select * from t1; +x +1 +2 +INSERT INTO t1 (x) select (SELECT SUM(a)+1 FROM t2) FROM t2; +select * from t1; +x +1 +2 +3 +3 +INSERT INTO t1 (x) select (SELECT SUM(x)+2 FROM t1) FROM t2; +select * from t1; +x +1 +2 +3 +3 +11 +11 +INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(x) FROM t2)); +ERROR 42S22: Unknown column 'x' in 'field list' +INSERT DELAYED INTO t1 (x) VALUES ((SELECT SUM(a) FROM t2)); +select * from t1; +x +1 +2 +3 +3 +11 +11 +2 +drop table t1, t2, t3; +CREATE TABLE t1 (x int not null, y int, primary key (x)) ENGINE=MyISAM; +create table t2 (a int); +create table t3 (a int); +insert into t2 values (1); +insert into t3 values (1),(2); +select * from t1; +x y +replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2)); +ERROR HY000: You can't specify target table 't1' for update in FROM clause +replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2)); +ERROR 21000: Subquery returns more than 1 row +replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2)); +select * from t1; +x y +1 2 +replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+2 FROM t2)); +select * from t1; +x y +1 3 +replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a FROM t2)); +select * from t1; +x y +1 3 +4 1 +replace DELAYED into t1 (x, y) VALUES ((SELECT a+3 FROM t2), (SELECT a+1 FROM t2)); +select * from t1; +x y +1 3 +4 2 +replace LOW_PRIORITY into t1 (x, y) VALUES ((SELECT a+1 FROM t2), (SELECT a FROM t2)); +select * from t1; +x y +1 3 +4 2 +2 1 +drop table t1, t2, t3; +SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *); +ERROR HY000: No tables used +CREATE TABLE t2 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES (1),(2); +SELECT * FROM t2 WHERE id IN (SELECT 1); +id +1 +EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ref id id 5 const 1 100.00 Using index +Warnings: +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1) +SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); +id +1 +SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1)); +id +2 +EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ref id id 5 const 1 100.00 Using where; Using index +Warnings: +Note 1249 Select 3 was reduced during optimization +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = <cache>((1 + 1))) +EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where <expr_cache><`test`.`t2`.`id`>(<in_optimizer>(`test`.`t2`.`id`,<exists>(select 1 having (<cache>(`test`.`t2`.`id`) = <ref_null_helper>(1)) union select 3 having (<cache>(`test`.`t2`.`id`) = <ref_null_helper>(3))))) +SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 3); +id +SELECT * FROM t2 WHERE id IN (SELECT 5 UNION SELECT 2); +id +2 +INSERT INTO t2 VALUES ((SELECT * FROM t2)); +ERROR HY000: You can't specify target table 't2' for update in FROM clause +INSERT INTO t2 VALUES ((SELECT id FROM t2)); +ERROR HY000: You can't specify target table 't2' for update in FROM clause +SELECT * FROM t2; +id +1 +2 +CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 values (1),(1); +UPDATE t2 SET id=(SELECT * FROM t1); +ERROR 21000: Subquery returns more than 1 row +drop table t2, t1; +create table t1 (a int); +insert into t1 values (1),(2),(3); +select 1 IN (SELECT * from t1); +1 IN (SELECT * from t1) +1 +select 10 IN (SELECT * from t1); +10 IN (SELECT * from t1) +0 +select NULL IN (SELECT * from t1); +NULL IN (SELECT * from t1) +NULL +update t1 set a=NULL where a=2; +select 1 IN (SELECT * from t1); +1 IN (SELECT * from t1) +1 +select 3 IN (SELECT * from t1); +3 IN (SELECT * from t1) +1 +select 10 IN (SELECT * from t1); +10 IN (SELECT * from t1) +NULL +select 1 > ALL (SELECT * from t1); +1 > ALL (SELECT * from t1) +0 +select 10 > ALL (SELECT * from t1); +10 > ALL (SELECT * from t1) +NULL +select 1 > ANY (SELECT * from t1); +1 > ANY (SELECT * from t1) +NULL +select 10 > ANY (SELECT * from t1); +10 > ANY (SELECT * from t1) +1 +drop table t1; +create table t1 (a varchar(20)); +insert into t1 values ('A'),('BC'),('DEF'); +select 'A' IN (SELECT * from t1); +'A' IN (SELECT * from t1) +1 +select 'XYZS' IN (SELECT * from t1); +'XYZS' IN (SELECT * from t1) +0 +select NULL IN (SELECT * from t1); +NULL IN (SELECT * from t1) +NULL +update t1 set a=NULL where a='BC'; +select 'A' IN (SELECT * from t1); +'A' IN (SELECT * from t1) +1 +select 'DEF' IN (SELECT * from t1); +'DEF' IN (SELECT * from t1) +1 +select 'XYZS' IN (SELECT * from t1); +'XYZS' IN (SELECT * from t1) +NULL +select 'A' > ALL (SELECT * from t1); +'A' > ALL (SELECT * from t1) +0 +select 'XYZS' > ALL (SELECT * from t1); +'XYZS' > ALL (SELECT * from t1) +NULL +select 'A' > ANY (SELECT * from t1); +'A' > ANY (SELECT * from t1) +NULL +select 'XYZS' > ANY (SELECT * from t1); +'XYZS' > ANY (SELECT * from t1) +1 +drop table t1; +create table t1 (a float); +insert into t1 values (1.5),(2.5),(3.5); +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +0 +select NULL IN (SELECT * from t1); +NULL IN (SELECT * from t1) +NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL +select 10.5 > ANY (SELECT * from t1); +10.5 > ANY (SELECT * from t1) +1 +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1` +select (select a+1) from t1; +(select a+1) +2.5 +NULL +4.5 +drop table t1; +CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a)); +CREATE TABLE t2 (a int(11) default '0', INDEX (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4); +INSERT INTO t2 VALUES (1),(2),(3); +SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; +a t1.a in (select t2.a from t2) +1 1 +2 1 +3 1 +4 0 +explain extended SELECT t1.a, t1.a in (select t2.a from t2) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index +2 SUBQUERY t2 index_subquery a a 5 func 2 100.00 Using index +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in t2 on a checking NULL having <is_not_null_test>(`test`.`t2`.`a`))))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +CREATE TABLE t3 (a int(11) default '0'); +INSERT INTO t3 VALUES (1),(2),(3); +SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; +a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) +1 1 +2 1 +3 1 +4 0 +explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index +2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having <is_not_null_test>(`test`.`t2`.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +drop table t1,t2,t3; +# check correct NULL Processing for normal IN/ALL/ANY +# and 2 ways of max/min optimization +create table t1 (a int); +insert into t1 values (1), (100), (NULL), (1000); +create table t2 (a int not null); +# subselect returns empty set (for NULL and non-NULL left part) +select a, a in (select * from t2) from t1; +a a in (select * from t2) +1 0 +100 0 +NULL 0 +1000 0 +select a, a > any (select * from t2) from t1; +a a > any (select * from t2) +1 0 +100 0 +NULL 0 +1000 0 +select a, a > all (select * from t2) from t1; +a a > all (select * from t2) +1 1 +100 1 +NULL 1 +1000 1 +select a from t1 where a in (select * from t2); +a +select a from t1 where a > any (select * from t2); +a +select a from t1 where a > all (select * from t2); +a +1 +100 +NULL +1000 +select a from t1 where a in (select * from t2 group by a); +a +select a from t1 where a > any (select * from t2 group by a); +a +select a from t1 where a > all (select * from t2 group by a); +a +1 +100 +NULL +1000 +insert into t2 values (1),(200); +# sebselect returns non-empty set without NULLs +select a, a in (select * from t2) from t1; +a a in (select * from t2) +1 1 +100 0 +NULL NULL +1000 0 +select a, a > any (select * from t2) from t1; +a a > any (select * from t2) +1 0 +100 1 +NULL NULL +1000 1 +select a, a > all (select * from t2) from t1; +a a > all (select * from t2) +1 0 +100 0 +NULL NULL +1000 1 +select a from t1 where a in (select * from t2); +a +1 +select a from t1 where a > any (select * from t2); +a +100 +1000 +select a from t1 where a > all (select * from t2); +a +1000 +select a from t1 where a in (select * from t2 group by a); +a +1 +select a from t1 where a > any (select * from t2 group by a); +a +100 +1000 +select a from t1 where a > all (select * from t2 group by a); +a +1000 +drop table t2; +create table t2 (a int); +insert into t2 values (1),(NULL),(200); +# sebselect returns non-empty set with NULLs +select a, a in (select * from t2) from t1; +a a in (select * from t2) +1 1 +100 NULL +NULL NULL +1000 NULL +select a, a > any (select * from t2) from t1; +a a > any (select * from t2) +1 NULL +100 1 +NULL NULL +1000 1 +select a, a > all (select * from t2) from t1; +a a > all (select * from t2) +1 0 +100 0 +NULL NULL +1000 NULL +select a from t1 where a in (select * from t2); +a +1 +select a from t1 where a > any (select * from t2); +a +100 +1000 +select a from t1 where a > all (select * from t2); +a +select a from t1 where a in (select * from t2 group by a); +a +1 +select a from t1 where a > any (select * from t2 group by a); +a +100 +1000 +select a from t1 where a > all (select * from t2 group by a); +a +drop table t1, t2; +create table t1 (a float); +select 10.5 IN (SELECT * from t1 LIMIT 1); +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +select 10.5 IN (SELECT * from t1 LIMIT 1 UNION SELECT 1.5); +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +drop table t1; +create table t1 (a int, b int, c varchar(10)); +create table t2 (a int); +insert into t1 values (1,2,'a'),(2,3,'b'),(3,4,'c'); +insert into t2 values (1),(2),(NULL); +select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t1 where a=t2.a) from t2; +a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a) +1 1 a +2 0 b +NULL NULL NULL +select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2; +a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a) +1 0 a +2 1 b +NULL NULL NULL +select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t1 where a=t2.a) from t2; +a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a) +1 0 a +2 0 b +NULL NULL NULL +drop table t1,t2; +create table t1 (a int, b real, c varchar(10)); +insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); +select ROW(1, 1, 'a') IN (select a,b,c from t1); +ROW(1, 1, 'a') IN (select a,b,c from t1) +1 +select ROW(1, 2, 'a') IN (select a,b,c from t1); +ROW(1, 2, 'a') IN (select a,b,c from t1) +0 +select ROW(1, 1, 'a') IN (select b,a,c from t1); +ROW(1, 1, 'a') IN (select b,a,c from t1) +1 +select ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null); +ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null) +1 +select ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null); +ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null) +0 +select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null); +ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null) +1 +select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a'); +ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a') +1 +select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a'); +ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a') +0 +select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a'); +ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a') +1 +select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2); +ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +drop table t1; +create table t1 (a int); +insert into t1 values (1); +do @a:=(SELECT a from t1); +select @a; +@a +1 +set @a:=2; +set @a:=(SELECT a from t1); +select @a; +@a +1 +drop table t1; +do (SELECT a from t1); +ERROR 42S02: Table 'test.t1' doesn't exist +set @a:=(SELECT a from t1); +ERROR 42S02: Table 'test.t1' doesn't exist +CREATE TABLE t1 (a int, KEY(a)); +HANDLER t1 OPEN; +HANDLER t1 READ a=((SELECT 1)); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1))' at line 1 +HANDLER t1 CLOSE; +drop table t1; +create table t1 (a int); +create table t2 (b int); +insert into t1 values (1),(2); +insert into t2 values (1); +select a from t1 where a in (select a from t1 where a in (select b from t2)); +a +1 +drop table t1, t2; +create table t1 (a int, b int); +create table t2 like t1; +insert into t1 values (1,2),(1,3),(1,4),(1,5); +insert into t2 values (1,2),(1,3); +select * from t1 where row(a,b) in (select a,b from t2); +a b +1 2 +1 3 +drop table t1, t2; +CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1); +UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +select * from t1; +i +2 +drop table t1; +CREATE TABLE t1 (a int(1)); +EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found +Warnings: +Note 1003 select (select rand() from `test`.`t1`) AS `(SELECT RAND() FROM t1)` from `test`.`t1` +EXPLAIN EXTENDED SELECT (SELECT ENCRYPT('test') FROM t1) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found +Warnings: +Note 1003 select (select encrypt('test') from `test`.`t1`) AS `(SELECT ENCRYPT('test') FROM t1)` from `test`.`t1` +EXPLAIN EXTENDED SELECT (SELECT BENCHMARK(1,1) FROM t1) FROM t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 0.00 const row not found +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 0 0.00 const row not found +Warnings: +Note 1003 select (select benchmark(1,1) from `test`.`t1`) AS `(SELECT BENCHMARK(1,1) FROM t1)` from `test`.`t1` +drop table t1; +CREATE TABLE `t1` ( +`mot` varchar(30) character set latin1 NOT NULL default '', +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`), +KEY `pseudo` (`pseudo`,`date`,`topic`), +KEY `topic` (`topic`) +) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC; +CREATE TABLE `t2` ( +`mot` varchar(30) character set latin1 NOT NULL default '', +`topic` mediumint(8) unsigned NOT NULL default '0', +`date` date NOT NULL default '0000-00-00', +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`), +KEY `pseudo` (`pseudo`,`date`,`topic`), +KEY `topic` (`topic`) +) ENGINE=MyISAM CHARSET=latin1 ROW_FORMAT=DYNAMIC; +CREATE TABLE `t3` ( +`numeropost` mediumint(8) unsigned NOT NULL auto_increment, +`maxnumrep` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`), +UNIQUE KEY `maxnumrep` (`maxnumrep`) +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES ('joce','1','','joce'),('test','2','','test'); +Warnings: +Warning 1265 Data truncated for column 'date' at row 1 +Warning 1265 Data truncated for column 'date' at row 2 +INSERT INTO t2 VALUES ('joce','1','','joce'),('test','2','','test'); +Warnings: +Warning 1265 Data truncated for column 'date' at row 1 +Warning 1265 Data truncated for column 'date' at row 2 +INSERT INTO t3 VALUES (1,1); +SELECT DISTINCT topic FROM t2 WHERE NOT EXISTS(SELECT * FROM t3 WHERE +numeropost=topic); +topic +2 +select * from t1; +mot topic date pseudo +joce 1 0000-00-00 joce +test 2 0000-00-00 test +DELETE FROM t1 WHERE topic IN (SELECT DISTINCT topic FROM t2 WHERE NOT +EXISTS(SELECT * FROM t3 WHERE numeropost=topic)); +select * from t1; +mot topic date pseudo +joce 1 0000-00-00 joce +drop table t1, t2, t3; +SELECT * FROM (SELECT 1 as a,(SELECT a)) a; +a (SELECT a) +1 1 +CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(1) NOT NULL DEFAULT '0', + `(SELECT 1)` int(1) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(1) NOT NULL DEFAULT '0', + `(SELECT a)` int(1) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(1) NOT NULL DEFAULT '0', + `(SELECT a+0)` int(3) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; +select * from t1; +a +2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a int); +insert into t1 values (1), (2), (3); +explain extended select a,(select (select rand() from t1 limit 1) from t1 limit 1) +from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 +2 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 +3 UNCACHEABLE SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,(select (select rand() from `test`.`t1` limit 1) from `test`.`t1` limit 1) AS `(select (select rand() from t1 limit 1) from t1 limit 1)` from `test`.`t1` +drop table t1; +select t1.Continent, t2.Name, t2.Population from t1 LEFT JOIN t2 ON t1.Code = t2.Country where t2.Population IN (select max(t2.Population) AS Population from t2, t1 where t2.Country = t1.Code group by Continent); +ERROR 42S02: Table 'test.t1' doesn't exist +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +name char(35) NOT NULL default '', +t2 char(3) NOT NULL default '', +District char(20) NOT NULL default '', +Population int(11) NOT NULL default '0', +PRIMARY KEY (ID) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (130,'Sydney','AUS','New South Wales',3276207); +INSERT INTO t1 VALUES (131,'Melbourne','AUS','Victoria',2865329); +INSERT INTO t1 VALUES (132,'Brisbane','AUS','Queensland',1291117); +CREATE TABLE t2 ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', +Region char(26) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +IndepYear smallint(6) default NULL, +Population int(11) NOT NULL default '0', +LifeExpectancy float(3,1) default NULL, +GNP float(10,2) default NULL, +GNPOld float(10,2) default NULL, +LocalName char(45) NOT NULL default '', +GovernmentForm char(45) NOT NULL default '', +HeadOfState char(60) default NULL, +Capital int(11) default NULL, +Code2 char(2) NOT NULL default '', +PRIMARY KEY (Code) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('AUS','Australia','Oceania','Australia and New Zealand',7741220.00,1901,18886000,79.8,351182.00,392911.00,'Australia','Constitutional Monarchy, Federation','Elisabeth II',135,'AU'); +INSERT INTO t2 VALUES ('AZE','Azerbaijan','Asia','Middle East',86600.00,1991,7734000,62.9,4127.00,4100.00,'Azärbaycan','Federal Republic','Heydär Äliyev',144,'AZ'); +select t2.Continent, t1.Name, t1.Population from t2 LEFT JOIN t1 ON t2.Code = t1.t2 where t1.Population IN (select max(t1.Population) AS Population from t1, t2 where t1.t2 = t2.Code group by Continent); +Continent Name Population +Oceania Sydney 3276207 +drop table t1, t2; +CREATE TABLE `t1` ( +`id` mediumint(8) unsigned NOT NULL auto_increment, +`pseudo` varchar(35) character set latin1 NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `pseudo` (`pseudo`) +) ENGINE=MyISAM PACK_KEYS=1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (pseudo) VALUES ('test'); +SELECT 0 IN (SELECT 1 FROM t1 a); +0 IN (SELECT 1 FROM t1 a) +0 +EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select <in_optimizer>(0,<exists>(select 1 from dual where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 0 IN (SELECT 1 FROM t1 a); +0 IN (SELECT 1 FROM t1 a) +0 +EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select <in_optimizer>(0,<exists>(select 1 from `test`.`t1` `a` where (0 = 1))) AS `0 IN (SELECT 1 FROM t1 a)` +drop table t1; +CREATE TABLE `t1` ( +`i` int(11) NOT NULL default '0', +PRIMARY KEY (`i`) +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1); +UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); +UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); +ERROR 42S22: Unknown column 't.i' in 'field list' +select * from t1; +i +3 +drop table t1; +CREATE TABLE t1 ( +id int(11) default NULL +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1),(1),(2),(2),(1),(3); +CREATE TABLE t2 ( +id int(11) default NULL, +name varchar(15) default NULL +) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES (4,'vita'), (1,'vita'), (2,'vita'), (1,'vita'); +update t1, t2 set t2.name='lenka' where t2.id in (select id from t1); +select * from t2; +id name +4 vita +1 lenka +2 lenka +1 lenka +drop table t1,t2; +create table t1 (a int, unique index indexa (a)); +insert into t1 values (-1), (-4), (-2), (NULL); +select -10 IN (select a from t1 FORCE INDEX (indexa)); +-10 IN (select a from t1 FORCE INDEX (indexa)) +NULL +drop table t1; +create table t1 (id int not null auto_increment primary key, salary int, key(salary)); +insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); +explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) +drop table t1; +CREATE TABLE t1 ( +ID int(10) unsigned NOT NULL auto_increment, +SUB_ID int(3) unsigned NOT NULL default '0', +REF_ID int(10) unsigned default NULL, +REF_SUB int(3) unsigned default '0', +PRIMARY KEY (ID,SUB_ID), +UNIQUE KEY t1_PK (ID,SUB_ID), +KEY t1_FK (REF_ID,REF_SUB), +KEY t1_REFID (REF_ID) +) ENGINE=MyISAM CHARSET=cp1251; +INSERT INTO t1 VALUES (1,0,NULL,NULL),(2,0,NULL,NULL); +SELECT DISTINCT REF_ID FROM t1 WHERE ID= (SELECT DISTINCT REF_ID FROM t1 WHERE ID=2); +REF_ID +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,0), (2,0), (3,0); +insert into t2 values (1,1), (2,1), (3,1), (2,2); +update ignore t1 set b=(select b from t2 where t1.a=t2.a); +Warnings: +Warning 1242 Subquery returns more than 1 row +select * from t1; +a b +1 1 +2 NULL +3 1 +drop table t1, t2; +CREATE TABLE `t1` ( +`id` mediumint(8) unsigned NOT NULL auto_increment, +`pseudo` varchar(35) NOT NULL default '', +`email` varchar(60) NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `email` (`email`), +UNIQUE KEY `pseudo` (`pseudo`) +) ENGINE=MyISAM CHARSET=latin1 PACK_KEYS=1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 (id,pseudo,email) VALUES (1,'test','test'),(2,'test1','test1'); +SELECT pseudo as a, pseudo as b FROM t1 GROUP BY (SELECT a) ORDER BY (SELECT id*1); +a b +test test +test1 test1 +drop table if exists t1; +(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0); +a +1 +create table t1 (a int not null, b int, primary key (a)); +create table t2 (a int not null, primary key (a)); +create table t3 (a int not null, b int, primary key (a)); +insert into t1 values (1,10), (2,20), (3,30), (4,40); +insert into t2 values (2), (3), (4), (5); +insert into t3 values (10,3), (20,4), (30,5); +select * from t2 where t2.a in (select a from t1); +a +2 +3 +4 +explain extended select * from t2 where t2.a in (select a from t1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index +1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 4 75.00 Using where; Using index; Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +a +2 +4 +explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +a +2 +3 +explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +drop table t1, t2, t3; +create table t1 (a int, b int, index a (a,b)); +create table t2 (a int, index a (a)); +create table t3 (a int, b int, index a (a)); +insert into t1 values (1,10), (2,20), (3,30), (4,40); +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +insert into t1 +select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D; +insert into t2 values (2), (3), (4), (5); +insert into t3 values (10,3), (20,4), (30,5); +select * from t2 where t2.a in (select a from t1); +a +2 +3 +4 +explain extended select * from t2 where t2.a in (select a from t1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index +1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where (`test`.`t1`.`a` = `test`.`t2`.`a`) +select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +a +2 +4 +explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index +1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +a +2 +3 +explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index +1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index +1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) +insert into t1 values (3,31); +select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +a +2 +3 +4 +select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31); +a +2 +4 +explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index +1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2) +Warnings: +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` <> 30)) +drop table t0, t1, t2, t3; +create table t1 (a int, b int); +create table t2 (a int, b int); +create table t3 (a int, b int); +insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); +insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); +insert into t3 values (3,3), (2,2), (1,1); +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; +a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t1,t2,t3; +create table t1 (s1 int); +create table t2 (s1 int); +insert into t1 values (1); +insert into t2 values (1); +select * from t1 where exists (select s1 from t2 having max(t2.s1)=t1.s1); +s1 +1 +drop table t1,t2; +create table t1 (s1 int); +create table t2 (s1 int); +insert into t1 values (1); +insert into t2 values (1); +update t1 set s1 = s1 + 1 where 1 = (select x.s1 as A from t2 WHERE t2.s1 > t1.s1 order by A); +ERROR 42S22: Unknown column 'x.s1' in 'field list' +DROP TABLE t1, t2; +CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci, +s2 CHAR(5) COLLATE latin1_swedish_ci); +INSERT INTO t1 VALUES ('z','?'); +select * from t1 where s1 > (select max(s2) from t1); +ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>' +select * from t1 where s1 > any (select max(s2) from t1); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (latin1_german1_ci,IMPLICIT) for operation '<' +drop table t1; +create table t1(toid int,rd int); +create table t2(userid int,pmnew int,pmtotal int); +insert into t2 values(1,0,0),(2,0,0); +insert into t1 values(1,0),(1,0),(1,0),(1,12),(1,15),(1,123),(1,12312),(1,12312),(1,123),(2,0),(2,0),(2,1),(2,2); +select userid,pmtotal,pmnew, (select count(rd) from t1 where toid=t2.userid) calc_total, (select count(rd) from t1 where rd=0 and toid=t2.userid) calc_new from t2 where userid in (select distinct toid from t1); +userid pmtotal pmnew calc_total calc_new +1 0 0 9 3 +2 0 0 4 2 +drop table t1, t2; +create table t1 (s1 char(5)); +select (select 'a','b' from t1 union select 'a','b' from t1) from t1; +ERROR 21000: Operand should contain 1 column(s) +insert into t1 values ('tttt'); +select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1); +s1 +tttt +explain extended (select * from t1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 +Warnings: +Note 1003 (select 'tttt' AS `s1` from dual) +(select * from t1); +s1 +tttt +drop table t1; +create table t1 (s1 char(5), index s1(s1)); +create table t2 (s1 char(5), index s1(s1)); +insert into t1 values ('a1'),('a2'),('a3'); +insert into t2 values ('a1'),('a2'); +select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +s1 s1 NOT IN (SELECT s1 FROM t2) +a1 0 +a2 0 +a3 1 +select s1, s1 = ANY (SELECT s1 FROM t2) from t1; +s1 s1 = ANY (SELECT s1 FROM t2) +a1 1 +a2 1 +a3 0 +select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; +s1 s1 <> ALL (SELECT s1 FROM t2) +a1 0 +a2 0 +a3 1 +select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +s1 s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') +a1 0 +a2 1 +a3 1 +explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index +2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +Warnings: +Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(<is_not_null_test>(`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index +2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +Warnings: +Note 1003 select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(<is_not_null_test>(`test`.`t2`.`s1`)))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index +2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +Warnings: +Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(<is_not_null_test>(`test`.`t2`.`s1`)))))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index +2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Using where; Full scan on NULL key +Warnings: +Note 1003 select `test`.`t1`.`s1` AS `s1`,(not(<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < 'a2') having trigcond(<is_not_null_test>(`test`.`t2`.`s1`)))))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +drop table t1,t2; +create table t2 (a int, b int not null); +create table t3 (a int); +insert into t3 values (6),(7),(3); +select * from t3 where a >= all (select b from t2); +a +6 +7 +3 +explain extended select * from t3 where a >= all (select b from t2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`)))) +select * from t3 where a >= some (select b from t2); +a +explain extended select * from t3 where a >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`)))) +select * from t3 where a >= all (select b from t2 group by 1); +a +6 +7 +3 +explain extended select * from t3 where a >= all (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,((select max(NULL) from `test`.`t2`) > <cache>(`test`.`t3`.`a`)))) +select * from t3 where a >= some (select b from t2 group by 1); +a +explain extended select * from t3 where a >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 0.00 const row not found +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>(<in_optimizer>(`test`.`t3`.`a`,((select min(NULL) from `test`.`t2`) <= <cache>(`test`.`t3`.`a`)))) +select * from t3 where NULL >= any (select b from t2); +a +explain extended select * from t3 where NULL >= any (select b from t2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 +select * from t3 where NULL >= any (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= any (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 +select * from t3 where NULL >= some (select b from t2); +a +explain extended select * from t3 where NULL >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 +select * from t3 where NULL >= some (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0 +insert into t2 values (2,2), (2,1), (3,3), (3,1); +select * from t3 where a > all (select max(b) from t2 group by a); +a +6 +7 +explain extended select * from t3 where a > all (select max(b) from t2 group by a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 100.00 Using temporary +Warnings: +Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>(<in_optimizer>(`test`.`t3`.`a`,(<max>(select max(`test`.`t2`.`b`) from `test`.`t2` group by `test`.`t2`.`a`) >= <cache>(`test`.`t3`.`a`)))) +drop table t2, t3; +CREATE TABLE `t1` ( `id` mediumint(9) NOT NULL auto_increment, `taskid` bigint(20) NOT NULL default '0', `dbid` int(11) NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=3 ; +INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now()); +CREATE TABLE `t2` (`db_id` int(11) NOT NULL auto_increment,`name` varchar(200) NOT NULL default '',`primary_uid` smallint(6) NOT NULL default '0',`secondary_uid` smallint(6) NOT NULL default '0',PRIMARY KEY (`db_id`),UNIQUE KEY `name_2` (`name`),FULLTEXT KEY `name` (`name`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2147483647; +INSERT INTO `t2` (`db_id`, `name`, `primary_uid`, `secondary_uid`) VALUES (18, 'Not Set 1', 0, 0),(19, 'Valid', 1, 2),(20, 'Valid 2', 1, 2),(21, 'Should Not Return', 1, 2),(26, 'Not Set 2', 0, 0),(-1, 'ALL DB\'S', 0, 0); +CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(11) NOT NULL default '0',`taskid` int(11) NOT NULL default '0',`mon` tinyint(4) NOT NULL default '1',`tues` tinyint(4) NOT NULL default '1',`wed` tinyint(4) NOT NULL default '1',`thur` tinyint(4) NOT NULL default '1',`fri` tinyint(4) NOT NULL default '1',`sat` tinyint(4) NOT NULL default '0',`sun` tinyint(4) NOT NULL default '0',`how_often` smallint(6) NOT NULL default '1',`userid` smallint(6) NOT NULL default '0',`active` tinyint(4) NOT NULL default '1',PRIMARY KEY (`taskgenid`)) ENGINE=MyISAM CHARSET=latin1 AUTO_INCREMENT=2 ; +INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); +CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; +INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; +dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') +-1 Valid 1 +-1 Valid 2 1 +-1 Should Not Return 0 +SELECT dbid, name FROM t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND ((date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')) AND t4.task_id = taskid; +dbid name +-1 Valid +-1 Valid 2 +drop table t1,t2,t3,t4; +CREATE TABLE t1 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES (1),(5); +CREATE TABLE t2 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES (2),(6); +select * from t1 where (1,2,6) in (select * from t2); +ERROR 21000: Operand should contain 3 column(s) +DROP TABLE t1,t2; +create table t1 (s1 int); +insert into t1 values (1); +insert into t1 values (2); +set sort_buffer_size = (select s1 from t1); +ERROR 21000: Subquery returns more than 1 row +do (select * from t1); +Warnings: +Error 1242 Subquery returns more than 1 row +drop table t1; +create table t1 (s1 char); +insert into t1 values ('e'); +select * from t1 where 'f' > any (select s1 from t1); +s1 +e +select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +s1 +e +explain extended select * from t1 where 'f' > any (select s1 from t1 union select s1 from t1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00 +2 SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 +3 UNION t1 system NULL NULL NULL NULL 1 100.00 +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 select 'e' AS `s1` from dual where 1 +drop table t1; +CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874'); +CREATE TABLE t2 (code char(5) NOT NULL default '',UNIQUE KEY code (code)) ENGINE=MyISAM CHARSET=latin1; +INSERT INTO t2 VALUES ('1'),('1226'),('1245'),('1862'),('18623'),('1874'),('1967'),('6'); +select c.number as phone,(select p.code from t2 p where c.number like concat(p.code, '%') order by length(p.code) desc limit 1) as code from t1 c; +phone code +69294728265 6 +18621828126 1862 +89356874041 NULL +95895001874 NULL +drop table t1, t2; +create table t1 (s1 int); +create table t2 (s1 int); +select * from t1 where (select count(*) from t2 where t1.s2) = 1; +ERROR 42S22: Unknown column 't1.s2' in 'where clause' +select * from t1 where (select count(*) from t2 group by t1.s2) = 1; +ERROR 42S22: Unknown column 't1.s2' in 'group statement' +select count(*) from t2 group by t1.s2; +ERROR 42S22: Unknown column 't1.s2' in 'group statement' +drop table t1, t2; +CREATE TABLE t1(COLA FLOAT NOT NULL,COLB FLOAT NOT NULL,COLC VARCHAR(20) DEFAULT NULL,PRIMARY KEY (COLA, COLB)); +CREATE TABLE t2(COLA FLOAT NOT NULL,COLB FLOAT NOT NULL,COLC CHAR(1) NOT NULL,PRIMARY KEY (COLA)); +INSERT INTO t1 VALUES (1,1,'1A3240'), (1,2,'4W2365'); +INSERT INTO t2 VALUES (100, 200, 'C'); +SELECT DISTINCT COLC FROM t1 WHERE COLA = (SELECT COLA FROM t2 WHERE COLB = 200 AND COLC ='C' LIMIT 1); +COLC +DROP TABLE t1, t2; +CREATE TABLE t1 (a int(1)); +INSERT INTO t1 VALUES (1),(1),(1),(1),(1),(2),(3),(4),(5); +SELECT DISTINCT (SELECT a) FROM t1 LIMIT 100; +(SELECT a) +1 +2 +3 +4 +5 +DROP TABLE t1; +create table t1 (a int, b decimal(13, 3)); +insert into t1 values (1, 0.123); +select a, (select max(b) from t1) into outfile "../../tmp/subselect.out.file.1" from t1; +delete from t1; +load data infile "../../tmp/subselect.out.file.1" into table t1; +select * from t1; +a b +1 0.123 +drop table t1; +CREATE TABLE `t1` ( +`id` int(11) NOT NULL auto_increment, +`id_cns` tinyint(3) unsigned NOT NULL default '0', +`tipo` enum('','UNO','DUE') NOT NULL default '', +`anno_dep` smallint(4) unsigned zerofill NOT NULL default '0000', +`particolare` mediumint(8) unsigned NOT NULL default '0', +`generale` mediumint(8) unsigned NOT NULL default '0', +`bis` tinyint(3) unsigned NOT NULL default '0', +PRIMARY KEY (`id`), +UNIQUE KEY `idx_cns_gen_anno` (`anno_dep`,`id_cns`,`generale`,`particolare`), +UNIQUE KEY `idx_cns_par_anno` (`id_cns`,`anno_dep`,`tipo`,`particolare`,`bis`) +); +INSERT INTO `t1` VALUES (1,16,'UNO',1987,2048,9681,0),(2,50,'UNO',1987,1536,13987,0),(3,16,'UNO',1987,2432,14594,0),(4,16,'UNO',1987,1792,13422,0),(5,16,'UNO',1987,1025,10240,0),(6,16,'UNO',1987,1026,7089,0); +CREATE TABLE `t2` ( +`id` tinyint(3) unsigned NOT NULL auto_increment, +`max_anno_dep` smallint(6) unsigned NOT NULL default '0', +PRIMARY KEY (`id`) +); +INSERT INTO `t2` VALUES (16,1987),(50,1990),(51,1990); +SELECT cns.id, cns.max_anno_dep, cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM t2 AS cns; +id max_anno_dep PIPPO +16 1987 1 +50 1990 0 +51 1990 NULL +DROP TABLE t1, t2; +create table t1 (a int); +insert into t1 values (1), (2), (3); +SET SQL_SELECT_LIMIT=1; +select sum(a) from (select * from t1) as a; +sum(a) +6 +select 2 in (select * from t1); +2 in (select * from t1) +1 +SET SQL_SELECT_LIMIT=default; +drop table t1; +CREATE TABLE t1 (a int, b int, INDEX (a)); +INSERT INTO t1 VALUES (1, 1), (1, 2), (1, 3); +SELECT * FROM t1 WHERE a = (SELECT MAX(a) FROM t1 WHERE a = 1) ORDER BY b; +a b +1 1 +1 2 +1 3 +DROP TABLE t1; +create table t1(val varchar(10)); +insert into t1 values ('aaa'), ('bbb'),('eee'),('mmm'),('ppp'); +select count(*) from t1 as w1 where w1.val in (select w2.val from t1 as w2 where w2.val like 'm%') and w1.val in (select w3.val from t1 as w3 where w3.val like 'e%'); +count(*) +0 +drop table t1; +create table t1 (id int not null, text varchar(20) not null default '', primary key (id)); +insert into t1 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text11'), (12, 'text12'); +select * from t1 where id not in (select id from t1 where id < 8); +id text +8 text8 +9 text9 +10 text10 +11 text11 +12 text12 +select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); +id text +8 text8 +9 text9 +10 text10 +11 text11 +12 text12 +explain extended select * from t1 where id not in (select id from t1 where id < 8); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where +2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where (not(<expr_cache><`test`.`t1`.`id`>(<in_optimizer>(`test`.`t1`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`id`) in t1 on PRIMARY where ((`test`.`t1`.`id` < 8) and (<cache>(`test`.`t1`.`id`) = `test`.`t1`.`id`)))))))) +explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where +2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 1 100.00 Using where; Using index +Warnings: +Note 1276 Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not(<in_optimizer>(1,<expr_cache><`test`.`tt`.`id`>(exists(select `test`.`t1`.`id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null)))))) +insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001'); +create table t2 (id int not null, text varchar(20) not null default '', primary key (id)); +insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10'); +select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); +id text id text id text +1 text1 1 text1 1 text1 +2 text2 2 text2 2 text2 +3 text3 3 text3 3 text3 +4 text4 4 text4 4 text4 +5 text5 5 text5 5 text5 +6 text6 6 text6 6 text6 +7 text7 7 text7 7 text7 +8 text8 8 text8 8 text8 +9 text9 9 text9 9 text9 +10 text10 10 text10 10 text10 +11 text11 11 text1 11 text11 +12 text12 12 text2 12 text12 +1000 text1000 NULL NULL 1000 text1000 +1001 text1001 NULL NULL 1000 text1000 +explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE a ALL NULL NULL NULL NULL 14 100.00 +1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2 100.00 +1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using index condition +Warnings: +Note 1003 select `test`.`a`.`id` AS `id`,`test`.`a`.`text` AS `text`,`test`.`b`.`id` AS `id`,`test`.`b`.`text` AS `text`,`test`.`c`.`id` AS `id`,`test`.`c`.`text` AS `text` from `test`.`t1` `a` left join `test`.`t2` `b` on(((`test`.`b`.`id` = `test`.`a`.`id`) or isnull(`test`.`b`.`id`))) join `test`.`t1` `c` where (if(isnull(`test`.`b`.`id`),1000,`test`.`b`.`id`) = `test`.`c`.`id`) +drop table t1,t2; +create table t1 (a int); +insert into t1 values (1); +explain select benchmark(1000, (select a from t1 where a=sha(rand()))); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used +2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1 +drop table t1; +create table t1(id int); +create table t2(id int); +create table t3(flag int); +select (select * from t3 where id not null) from t1, t2; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'null) from t1, t2' at line 1 +drop table t1,t2,t3; +CREATE TABLE t1 (id INT); +CREATE TABLE t2 (id INT); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1); +SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id); +id c +1 1 +2 0 +SELECT id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id); +id c +1 1 +2 0 +SELECT t1.id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY t1.id; +id c +1 1 +2 0 +SELECT id, ( SELECT COUNT(t.id) FROM t2 AS t WHERE t.id = t1.id ) AS c FROM t1 LEFT JOIN t2 USING (id) ORDER BY id; +id c +1 1 +2 0 +DROP TABLE t1,t2; +CREATE TABLE t1 ( a int, b int ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +ALTER TABLE t1 ADD INDEX (a); +SELECT a FROM t1 WHERE a > ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +3 +SELECT a FROM t1 WHERE a < ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +SELECT a FROM t1 WHERE a = ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 HAVING a = 2 UNION SELECT a FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE a > ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) > ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE a > ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) > ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) = ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) <> ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 2 column(s) +SELECT a FROM t1 WHERE a = ANY (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) = ANY (SELECT a,2 FROM t1 WHERE b = 2); +a +SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 2 column(s) +SELECT a FROM t1 WHERE a <> ALL (SELECT a,2 FROM t1 WHERE b = 2); +ERROR 21000: Operand should contain 1 column(s) +SELECT a FROM t1 WHERE (1,2) <> ALL (SELECT a,2 FROM t1 WHERE b = 2); +a +1 +2 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 WHERE b = 2 UNION SELECT a,1 FROM t1 WHERE b = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 WHERE b = 2 UNION SELECT a,1 FROM t1 WHERE b = 2); +a +1 +3 +SELECT a FROM t1 WHERE (a,1) = ANY (SELECT a,1 FROM t1 HAVING a = 2 UNION SELECT a,1 FROM t1 HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE (a,1) <> ALL (SELECT a,1 FROM t1 HAVING a = 2 UNION SELECT a,1 FROM t1 HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2 group by a); +a +1 +3 +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 group by a HAVING a = 2); +a +1 +3 +SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a), '-') from t1 a; +concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a > t1.a), '-') +0- +0- +1- +SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a), '-') from t1 a; +concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a < t1.a), '-') +1- +0- +0- +SELECT concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a), '-') from t1 a; +concat(EXISTS(SELECT a FROM t1 WHERE b = 2 and a.a = t1.a), '-') +0- +1- +0- +DROP TABLE t1; +CREATE TABLE t1 ( a double, b double ); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = 2e0); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = 2e0); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = 2e0); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = 2e0); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = 2e0); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = 2e0); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = 2e0); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = 2e0); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = 2e0); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = 2e0); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = 2e0); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = 2e0); +a +1 +3 +DROP TABLE t1; +CREATE TABLE t1 ( a char(1), b char(1)); +INSERT INTO t1 VALUES ('1','1'),('2','2'),('3','3'); +SELECT a FROM t1 WHERE a > ANY (SELECT a FROM t1 WHERE b = '2'); +a +3 +SELECT a FROM t1 WHERE a < ANY (SELECT a FROM t1 WHERE b = '2'); +a +1 +SELECT a FROM t1 WHERE a = ANY (SELECT a FROM t1 WHERE b = '2'); +a +2 +SELECT a FROM t1 WHERE a >= ANY (SELECT a FROM t1 WHERE b = '2'); +a +2 +3 +SELECT a FROM t1 WHERE a <= ANY (SELECT a FROM t1 WHERE b = '2'); +a +1 +2 +SELECT a FROM t1 WHERE a <> ANY (SELECT a FROM t1 WHERE b = '2'); +a +1 +3 +SELECT a FROM t1 WHERE a > ALL (SELECT a FROM t1 WHERE b = '2'); +a +3 +SELECT a FROM t1 WHERE a < ALL (SELECT a FROM t1 WHERE b = '2'); +a +1 +SELECT a FROM t1 WHERE a = ALL (SELECT a FROM t1 WHERE b = '2'); +a +2 +SELECT a FROM t1 WHERE a >= ALL (SELECT a FROM t1 WHERE b = '2'); +a +2 +3 +SELECT a FROM t1 WHERE a <= ALL (SELECT a FROM t1 WHERE b = '2'); +a +1 +2 +SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = '2'); +a +1 +3 +DROP TABLE t1; +create table t1 (a int, b int); +insert into t1 values (1,2),(3,4); +select * from t1 up where exists (select * from t1 where t1.a=up.a); +a b +1 2 +3 4 +explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where 1 +drop table t1; +CREATE TABLE t1 (t1_a int); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (t2_a int, t2_b int, PRIMARY KEY (t2_a, t2_b)); +INSERT INTO t2 VALUES (1, 1), (1, 2); +SELECT * FROM t1, t2 table2 WHERE t1_a = 1 AND table2.t2_a = 1 +HAVING table2.t2_b = (SELECT MAX(t2_b) FROM t2 WHERE t2_a = table2.t2_a); +t1_a t2_a t2_b +1 1 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (id int(11) default NULL,name varchar(10) default NULL); +INSERT INTO t1 VALUES (1,'Tim'),(2,'Rebecca'),(3,NULL); +CREATE TABLE t2 (id int(11) default NULL, pet varchar(10) default NULL); +INSERT INTO t2 VALUES (1,'Fido'),(2,'Spot'),(3,'Felix'); +SELECT a.*, b.* FROM (SELECT * FROM t1) AS a JOIN t2 as b on a.id=b.id; +id name id pet +1 Tim 1 Fido +2 Rebecca 2 Spot +3 NULL 3 Felix +drop table t1,t2; +CREATE TABLE t1 ( a int, b int ); +CREATE TABLE t2 ( c int, d int ); +INSERT INTO t1 VALUES (1,2), (2,3), (3,4); +SELECT a AS abc, b FROM t1 outr WHERE b = +(SELECT MIN(b) FROM t1 WHERE a=outr.a); +abc b +1 2 +2 3 +3 4 +INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b = +(SELECT MIN(b) FROM t1 WHERE a=outr.a); +select * from t2; +c d +1 2 +2 3 +3 4 +CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b = +(SELECT MIN(b) FROM t1 WHERE a=outr.a); +select * from t3; +abc b +1 2 +2 3 +3 4 +prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a);"; +execute stmt1; +deallocate prepare stmt1; +select * from t2; +c d +1 2 +2 3 +3 4 +1 2 +2 3 +3 4 +drop table t3; +prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 outr WHERE b = (SELECT MIN(b) FROM t1 WHERE a=outr.a);"; +execute stmt1; +select * from t3; +abc b +1 2 +2 3 +3 4 +deallocate prepare stmt1; +DROP TABLE t1, t2, t3; +CREATE TABLE `t1` ( `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t1 values (1); +CREATE TABLE `t2` ( `b` int(11) default NULL, `a` int(11) default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; +insert into t2 values (1,2); +select t000.a, count(*) `C` FROM t1 t000 GROUP BY t000.a HAVING count(*) > ALL (SELECT count(*) FROM t2 t001 WHERE t001.a=1); +a C +1 1 +drop table t1,t2; +create table t1 (a int not null auto_increment primary key, b varchar(40), fulltext(b)); +insert into t1 (b) values ('ball'),('ball games'), ('games'), ('foo'), ('foobar'), ('Serg'), ('Sergei'),('Georg'), ('Patrik'),('Hakan'); +create table t2 (a int); +insert into t2 values (1),(3),(2),(7); +select a,b from t1 where match(b) against ('Ball') > 0; +a b +1 ball +2 ball games +select a from t2 where a in (select a from t1 where match(b) against ('Ball') > 0); +a +1 +2 +drop table t1,t2; +CREATE TABLE t1(`IZAVORGANG_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`KUERZEL` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin,`IZAANALYSEART_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`IZAPMKZ_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin); +CREATE INDEX AK01IZAVORGANG ON t1(izaAnalyseart_id,Kuerzel); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000001','601','D0000000001','I0000000001'); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000002','602','D0000000001','I0000000001'); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000003','603','D0000000001','I0000000001'); +INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000004','101','D0000000001','I0000000001'); +SELECT `IZAVORGANG_ID` FROM t1 WHERE `KUERZEL` IN(SELECT MIN(`KUERZEL`)`Feld1` FROM t1 WHERE `KUERZEL` LIKE'601%'And`IZAANALYSEART_ID`='D0000000001'); +IZAVORGANG_ID +D0000000001 +drop table t1; +CREATE TABLE `t1` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`)); +CREATE TABLE `t2` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`)); +insert into t1 values (1,1),(1,2),(2,1),(2,2); +insert into t2 values (1,2),(2,2); +select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid); +aid bid +1 1 +2 1 +alter table t2 drop primary key; +alter table t2 add key KEY1 (aid, bid); +select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid); +aid bid +1 1 +2 1 +alter table t2 drop key KEY1; +alter table t2 add primary key (bid, aid); +select * from t1 where t1.aid not in (select aid from t2 where bid=t1.bid); +aid bid +1 1 +2 1 +drop table t1,t2; +CREATE TABLE t1 (howmanyvalues bigint, avalue int); +INSERT INTO t1 VALUES (1, 1),(2, 1),(2, 2),(3, 1),(3, 2),(3, 3),(4, 1),(4, 2),(4, 3),(4, 4); +SELECT howmanyvalues, count(*) from t1 group by howmanyvalues; +howmanyvalues count(*) +1 1 +2 2 +3 3 +4 4 +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues; +howmanyvalues mycount +1 1 +2 2 +3 3 +4 4 +CREATE INDEX t1_howmanyvalues_idx ON t1 (howmanyvalues); +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues+1 = a.howmanyvalues+1) as mycount from t1 a group by a.howmanyvalues; +howmanyvalues mycount +1 1 +2 2 +3 3 +4 4 +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues; +howmanyvalues mycount +1 1 +2 2 +3 3 +4 4 +SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.avalue) as mycount from t1 a group by a.howmanyvalues; +howmanyvalues mycount +1 1 +2 1 +3 1 +4 1 +drop table t1; +create table t1 (x int); +select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x; +(select b.x from t1 as b where b.x=a.x) +drop table t1; +CREATE TABLE `t1` ( `master` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `slave` int(10) unsigned NOT NULL default '0', `access` int(10) unsigned NOT NULL default '0', UNIQUE KEY `access_u` (`master`,`map`,`slave`)); +INSERT INTO `t1` VALUES (1,0,0,700),(1,1,1,400),(1,5,5,400),(1,12,12,400),(1,12,32,400),(4,12,32,400); +CREATE TABLE `t2` ( `id` int(10) unsigned NOT NULL default '0', `pid` int(10) unsigned NOT NULL default '0', `map` smallint(6) unsigned NOT NULL default '0', `level` tinyint(4) unsigned NOT NULL default '0', `title` varchar(255) default NULL, PRIMARY KEY (`id`,`pid`,`map`), KEY `level` (`level`), KEY `id` (`id`,`map`)) ; +INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,'a'),(12,5,12,7,'a'); +SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; +ERROR 42S22: Unknown column 'b.sc' in 'field list' +SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; +ac +700 +NULL +drop tables t1,t2; +create table t1 (a int not null, b int not null, c int, primary key (a,b)); +insert into t1 values (1,1,1), (2,2,2), (3,3,3); +set @b:= 0; +explain select sum(a) from t1 where b > @b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index +set @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +do @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +drop table t1; +set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ; +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5); +insert into t2 values (1,3),(2,1); +select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b; +a b (select max(b) from t2 where t1.b=t2.a) +1 1 3 +1 2 1 +1 3 NULL +2 4 NULL +2 5 NULL +drop table t1, t2; +create table t1 (id int); +create table t2 (id int, body text, fulltext (body)); +insert into t1 values(1),(2),(3); +insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test'); +select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode)); +count(distinct id) +1 +drop table t2,t1; +create table t1 (s1 int,s2 int); +insert into t1 values (20,15); +select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0)); +s1 s2 +drop table t1; +create table t1 (s1 int); +insert into t1 values (1),(null); +select * from t1 where s1 < all (select s1 from t1); +s1 +select s1, s1 < all (select s1 from t1) from t1; +s1 s1 < all (select s1 from t1) +1 0 +NULL NULL +drop table t1; +CREATE TABLE t1 ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', +Region char(26) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +IndepYear smallint(6) default NULL, +Population int(11) NOT NULL default '0', +LifeExpectancy float(3,1) default NULL, +GNP float(10,2) default NULL, +GNPOld float(10,2) default NULL, +LocalName char(45) NOT NULL default '', +GovernmentForm char(45) NOT NULL default '', +HeadOfState char(60) default NULL, +Capital int(11) default NULL, +Code2 char(2) NOT NULL default '' +) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); +INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); +/*!40000 ALTER TABLE t1 ENABLE KEYS */; +SELECT DISTINCT Continent AS c FROM t1 outr WHERE +Code <> SOME ( SELECT Code FROM t1 WHERE Continent = outr.Continent AND +Population < 200); +c +Oceania +drop table t1; +create table t1 (a1 int); +create table t2 (b1 int); +select * from t1 where a2 > any(select b1 from t2); +ERROR 42S22: Unknown column 'a2' in 'IN/ALL/ANY subquery' +select * from t1 where a1 > any(select b1 from t2); +a1 +drop table t1,t2; +create table t1 (a integer, b integer); +select (select * from t1) = (select 1,2); +(select * from t1) = (select 1,2) +NULL +select (select 1,2) = (select * from t1); +(select 1,2) = (select * from t1) +NULL +select row(1,2) = ANY (select * from t1); +row(1,2) = ANY (select * from t1) +0 +select row(1,2) != ALL (select * from t1); +row(1,2) != ALL (select * from t1) +1 +drop table t1; +create table t1 (a integer, b integer); +select row(1,(2,2)) in (select * from t1 ); +ERROR 21000: Operand should contain 2 column(s) +select row(1,(2,2)) = (select * from t1 ); +ERROR 21000: Operand should contain 2 column(s) +select (select * from t1) = row(1,(2,2)); +ERROR 21000: Operand should contain 1 column(s) +drop table t1; +create table t1 (a integer); +insert into t1 values (1); +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx ; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 as xx, 1 = ALL ( select 1 from t1 where 1 = xx ); +xx 1 = ALL ( select 1 from t1 where 1 = xx ) +1 1 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +drop table t1; +CREATE TABLE t1 ( +categoryId int(11) NOT NULL, +courseId int(11) NOT NULL, +startDate datetime NOT NULL, +endDate datetime NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL, +attributes text NOT NULL +); +INSERT INTO t1 VALUES (1,41,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(1,86,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(1,87,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,52,'2004-03-15','2004-10-01','2004-03-15','2004-09-17',''), +(2,53,'2004-03-16','2004-10-01','2004-03-16','2004-09-17',''), +(2,88,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,89,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(3,51,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(5,12,'2004-02-18','2010-01-01','2004-02-18','2004-02-18',''); +CREATE TABLE t2 ( +userId int(11) NOT NULL, +courseId int(11) NOT NULL, +date datetime NOT NULL +); +INSERT INTO t2 VALUES (5141,71,'2003-11-18'), +(5141,72,'2003-11-25'),(5141,41,'2004-08-06'), +(5141,52,'2004-08-06'),(5141,53,'2004-08-06'), +(5141,12,'2004-08-06'),(5141,86,'2004-10-21'), +(5141,87,'2004-10-21'),(5141,88,'2004-10-21'), +(5141,89,'2004-10-22'),(5141,51,'2004-10-26'); +CREATE TABLE t3 ( +groupId int(11) NOT NULL, +parentId int(11) NOT NULL, +startDate datetime NOT NULL, +endDate datetime NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL, +ordering int(11) +); +INSERT INTO t3 VALUES (12,9,'1000-01-01','3999-12-31','2004-01-29','2004-01-29',NULL); +CREATE TABLE t4 ( +id int(11) NOT NULL, +groupTypeId int(11) NOT NULL, +groupKey varchar(50) NOT NULL, +name text, +ordering int(11), +description text, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL +); +INSERT INTO t4 VALUES (9,5,'stationer','stationer',0,'Stationer','2004-01-29','2004-01-29'), +(12,5,'group2','group2',0,'group2','2004-01-29','2004-01-29'); +CREATE TABLE t5 ( +userId int(11) NOT NULL, +groupId int(11) NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL +); +INSERT INTO t5 VALUES (5141,12,'2004-08-06','2004-08-06'); +select +count(distinct t2.userid) pass, +groupstuff.*, +count(t2.courseid) crse, +t1.categoryid, +t2.courseid, +date_format(date, '%b%y') as colhead +from t2 +join t1 on t2.courseid=t1.courseid +join +( +select +t5.userid, +parentid, +parentgroup, +childid, +groupname, +grouptypeid +from t5 +join +( +select t4.id as parentid, +t4.name as parentgroup, +t4.id as childid, +t4.name as groupname, +t4.grouptypeid +from t4 +) as gin on t5.groupid=gin.childid +) as groupstuff on t2.userid = groupstuff.userid +group by +groupstuff.groupname, colhead , t2.courseid; +pass userid parentid parentgroup childid groupname grouptypeid crse categoryid courseid colhead +1 5141 12 group2 12 group2 5 1 5 12 Aug04 +1 5141 12 group2 12 group2 5 1 1 41 Aug04 +1 5141 12 group2 12 group2 5 1 2 52 Aug04 +1 5141 12 group2 12 group2 5 1 2 53 Aug04 +1 5141 12 group2 12 group2 5 1 3 51 Oct04 +1 5141 12 group2 12 group2 5 1 1 86 Oct04 +1 5141 12 group2 12 group2 5 1 1 87 Oct04 +1 5141 12 group2 12 group2 5 1 2 88 Oct04 +1 5141 12 group2 12 group2 5 1 2 89 Oct04 +drop table t1, t2, t3, t4, t5; +create table t1 (a int); +insert into t1 values (1), (2), (3); +SELECT 1 FROM t1 WHERE (SELECT 1) in (SELECT 1); +1 +1 +1 +1 +drop table t1; +create table t1 (a int); +create table t2 (a int); +insert into t1 values (1),(2); +insert into t2 values (0),(1),(2),(3); +select a from t2 where a in (select a from t1); +a +1 +2 +select a from t2 having a in (select a from t1); +a +1 +2 +prepare stmt1 from "select a from t2 where a in (select a from t1)"; +execute stmt1; +a +1 +2 +execute stmt1; +a +1 +2 +deallocate prepare stmt1; +prepare stmt1 from "select a from t2 having a in (select a from t1)"; +execute stmt1; +a +1 +2 +execute stmt1; +a +1 +2 +deallocate prepare stmt1; +drop table t1, t2; +create table t1 (a int, b int); +insert into t1 values (1,2); +select 1 = (select * from t1); +ERROR 21000: Operand should contain 1 column(s) +select (select * from t1) = 1; +ERROR 21000: Operand should contain 2 column(s) +select (1,2) = (select a from t1); +ERROR 21000: Operand should contain 2 column(s) +select (select a from t1) = (1,2); +ERROR 21000: Operand should contain 1 column(s) +select (1,2,3) = (select * from t1); +ERROR 21000: Operand should contain 3 column(s) +select (select * from t1) = (1,2,3); +ERROR 21000: Operand should contain 2 column(s) +drop table t1; +CREATE TABLE `t1` ( +`itemid` bigint(20) unsigned NOT NULL auto_increment, +`sessionid` bigint(20) unsigned default NULL, +`time` int(10) unsigned NOT NULL default '0', +`type` set('A','D','E','F','G','I','L','N','U') collate latin1_general_ci NOT +NULL default '', +`data` text collate latin1_general_ci NOT NULL, +PRIMARY KEY (`itemid`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +INSERT INTO `t1` VALUES (1, 1, 1, 'D', ''); +CREATE TABLE `t2` ( +`sessionid` bigint(20) unsigned NOT NULL auto_increment, +`pid` int(10) unsigned NOT NULL default '0', +`date` int(10) unsigned NOT NULL default '0', +`ip` varchar(15) collate latin1_general_ci NOT NULL default '', +PRIMARY KEY (`sessionid`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1'); +SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30; +ip count( e.itemid ) +10.10.10.1 1 +drop tables t1,t2; +create table t1 (fld enum('0','1')); +insert into t1 values ('1'); +select * from (select max(fld) from t1) as foo; +max(fld) +1 +drop table t1; +set @tmp11867_optimizer_switch=@@optimizer_switch; +set optimizer_switch='semijoin_with_cache=off'; +CREATE TABLE t1 (one int, two int, flag char(1)); +CREATE TABLE t2 (one int, two int, flag char(1)); +INSERT INTO t1 VALUES(1,2,'Y'),(2,3,'Y'),(3,4,'Y'),(5,6,'N'),(7,8,'N'); +INSERT INTO t2 VALUES(1,2,'Y'),(2,3,'Y'),(3,4,'Y'),(5,6,'N'),(7,8,'N'); +SELECT * FROM t1 +WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t2 WHERE flag = 'N'); +one two flag +5 6 N +7 8 N +SELECT * FROM t1 +WHERE ROW(one,two) IN (SELECT DISTINCT one,two FROM t1 WHERE flag = 'N'); +one two flag +5 6 N +7 8 N +insert into t2 values (null,null,'N'); +insert into t2 values (null,3,'0'); +insert into t2 values (null,5,'0'); +insert into t2 values (10,null,'0'); +insert into t1 values (10,3,'0'); +insert into t1 values (10,5,'0'); +insert into t1 values (10,10,'0'); +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N') as 'test' from t1; +one two test +1 2 NULL +2 3 NULL +3 4 NULL +5 6 1 +7 8 1 +10 3 NULL +10 5 NULL +10 10 NULL +SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); +one two +5 6 +7 8 +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N' group by one,two) as 'test' from t1; +one two test +1 2 NULL +2 3 NULL +3 4 NULL +5 6 1 +7 8 1 +10 3 NULL +10 5 NULL +10 10 NULL +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; +one two test +1 2 0 +2 3 NULL +3 4 0 +5 6 0 +7 8 0 +10 3 NULL +10 5 NULL +10 10 NULL +SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; +one two test +1 2 0 +2 3 NULL +3 4 0 +5 6 0 +7 8 0 +10 3 NULL +10 5 NULL +10 10 NULL +explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0') as 'test' from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<expr_cache><`test`.`t1`.`one`,`test`.`t1`.`two`>(<in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond(((<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond(((<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond(<is_not_null_test>(`test`.`t2`.`one`)) and trigcond(<is_not_null_test>(`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N'); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`flag` = 'N') +explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 9 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two`,<expr_cache><`test`.`t1`.`one`,`test`.`t1`.`two`>(<in_optimizer>((`test`.`t1`.`one`,`test`.`t1`.`two`),<exists>(select `test`.`t2`.`one`,`test`.`t2`.`two` from `test`.`t2` where ((`test`.`t2`.`flag` = '0') and trigcond(trigcond(((<cache>(`test`.`t1`.`one`) = `test`.`t2`.`one`) or isnull(`test`.`t2`.`one`)))) and trigcond(trigcond(((<cache>(`test`.`t1`.`two`) = `test`.`t2`.`two`) or isnull(`test`.`t2`.`two`))))) having (trigcond(<is_not_null_test>(`test`.`t2`.`one`)) and trigcond(<is_not_null_test>(`test`.`t2`.`two`)))))) AS `test` from `test`.`t1` +DROP TABLE t1,t2; +set optimizer_switch=@tmp11867_optimizer_switch; +CREATE TABLE t1 (a char(5), b char(5)); +INSERT INTO t1 VALUES (NULL,'aaa'), ('aaa','aaa'); +SELECT * FROM t1 WHERE (a,b) IN (('aaa','aaa'), ('aaa','bbb')); +a b +aaa aaa +DROP TABLE t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int, b int); +CREATE TABLE t3 (b int NOT NULL); +INSERT INTO t1 VALUES (1), (2), (3), (4); +INSERT INTO t2 VALUES (1,10), (3,30); +SELECT * FROM t2 LEFT JOIN t3 ON t2.b=t3.b +WHERE t3.b IS NOT NULL OR t2.a > 10; +a b b +SELECT * FROM t1 +WHERE t1.a NOT IN (SELECT a FROM t2 LEFT JOIN t3 ON t2.b=t3.b +WHERE t3.b IS NOT NULL OR t2.a > 10); +a +1 +2 +3 +4 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (f1 INT); +CREATE TABLE t2 (f2 INT); +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2); +f1 +1 +SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE 1=0); +f1 +1 +INSERT INTO t2 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE f1 > ALL (SELECT f2 FROM t2 WHERE f2=0); +f1 +1 +DROP TABLE t1, t2; +select 1 from dual where 1 < any (select 2); +1 +1 +select 1 from dual where 1 < all (select 2); +1 +1 +select 1 from dual where 2 > any (select 1); +1 +1 +select 1 from dual where 2 > all (select 1); +1 +1 +select 1 from dual where 1 < any (select 2 from dual); +1 +1 +select 1 from dual where 1 < all (select 2 from dual where 1!=1); +1 +1 +create table t1 (s1 char); +insert into t1 values (1),(2); +select * from t1 where (s1 < any (select s1 from t1)); +s1 +1 +select * from t1 where not (s1 < any (select s1 from t1)); +s1 +2 +select * from t1 where (s1 < ALL (select s1+1 from t1)); +s1 +1 +select * from t1 where not(s1 < ALL (select s1+1 from t1)); +s1 +2 +select * from t1 where (s1+1 = ANY (select s1 from t1)); +s1 +1 +select * from t1 where NOT(s1+1 = ANY (select s1 from t1)); +s1 +2 +select * from t1 where (s1 = ALL (select s1/s1 from t1)); +s1 +1 +select * from t1 where NOT(s1 = ALL (select s1/s1 from t1)); +s1 +2 +drop table t1; +create table t1 ( +retailerID varchar(8) NOT NULL, +statusID int(10) unsigned NOT NULL, +changed datetime NOT NULL, +UNIQUE KEY retailerID (retailerID, statusID, changed) +); +INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56"); +INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53"); +INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56"); +INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53"); +INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50"); +INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50"); +select * from t1 r1 +where (r1.retailerID,(r1.changed)) in +(SELECT r2.retailerId,(max(changed)) from t1 r2 +group by r2.retailerId); +retailerID statusID changed +0026 2 2006-01-06 12:25:53 +0037 2 2006-01-06 12:25:53 +0048 1 2006-01-06 12:37:50 +0059 1 2006-01-06 12:37:50 +drop table t1; +create table t1(a int, primary key (a)); +insert into t1 values (10); +create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); +explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 +1 PRIMARY r const PRIMARY PRIMARY 4 const 1 +2 SUBQUERY t2 range b b 40 NULL 2 Using where +SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; +a a b +10 3 35989 +explain SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 +1 PRIMARY r const PRIMARY PRIMARY 4 const 1 +2 SUBQUERY t2 range b b 40 NULL 2 Using index condition +SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r +ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' + ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; +a a b +10 1 359 +drop table t1,t2; +CREATE TABLE t1 ( +field1 int NOT NULL, +field2 int NOT NULL, +field3 int NOT NULL, +PRIMARY KEY (field1,field2,field3) +); +CREATE TABLE t2 ( +fieldA int NOT NULL, +fieldB int NOT NULL, +PRIMARY KEY (fieldA,fieldB) +); +INSERT INTO t1 VALUES +(1,1,1), (1,1,2), (1,2,1), (1,2,2), (1,2,3), (1,3,1); +INSERT INTO t2 VALUES (1,1), (1,2), (1,3); +SELECT field1, field2, COUNT(*) +FROM t1 GROUP BY field1, field2; +field1 field2 COUNT(*) +1 1 2 +1 2 3 +1 3 1 +SELECT field1, field2 +FROM t1 +GROUP BY field1, field2 +HAVING COUNT(*) >= ALL (SELECT fieldB +FROM t2 WHERE fieldA = field1); +field1 field2 +1 2 +SELECT field1, field2 +FROM t1 +GROUP BY field1, field2 +HAVING COUNT(*) < ANY (SELECT fieldB +FROM t2 WHERE fieldA = field1); +field1 field2 +1 1 +1 3 +DROP TABLE t1, t2; +CREATE TABLE t1(a int, INDEX (a)); +INSERT INTO t1 VALUES (1), (3), (5), (7); +INSERT INTO t1 VALUES (NULL); +CREATE TABLE t2(a int); +INSERT INTO t2 VALUES (1),(2),(3); +EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 +2 SUBQUERY t1 index_subquery a a 5 func 2 Using index; Full scan on NULL key +SELECT a, a IN (SELECT a FROM t1) FROM t2; +a a IN (SELECT a FROM t1) +1 1 +2 NULL +3 1 +DROP TABLE t1,t2; +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES ('1998-09-23'), ('2003-03-25'); +CREATE TABLE t2 AS SELECT +(SELECT a FROM t1 WHERE a < '2000-01-01') AS sub_a +FROM t1 WHERE a > '2000-01-01'; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `sub_a` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +CREATE TABLE t3 AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01'); +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (1), (2); +SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) > 0; +a +SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; +a +1 +2 +EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +DROP TABLE t1; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (2), (4), (1), (3); +CREATE TABLE t2 (b int, c int); +INSERT INTO t2 VALUES +(2,1), (1,3), (2,1), (4,4), (2,2), (1,4); +SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 2 ); +a +2 +4 +1 +3 +SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 1); +ERROR 21000: Subquery returns more than 1 row +SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 2), a; +a +1 +2 +3 +4 +SELECT a FROM t1 ORDER BY (SELECT c FROM t2 WHERE b > 1), a; +ERROR 21000: Subquery returns more than 1 row +SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 2); +b MAX(c) +1 4 +2 2 +4 4 +SELECT b, MAX(c) FROM t2 GROUP BY b, (SELECT c FROM t2 WHERE b > 1); +ERROR 21000: Subquery returns more than 1 row +SELECT a FROM t1 GROUP BY a +HAVING IFNULL((SELECT b FROM t2 WHERE b > 2), +(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3; +a +1 +2 +3 +4 +SELECT a FROM t1 GROUP BY a +HAVING IFNULL((SELECT b FROM t2 WHERE b > 1), +(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3; +ERROR 21000: Subquery returns more than 1 row +SELECT a FROM t1 GROUP BY a +HAVING IFNULL((SELECT b FROM t2 WHERE b > 4), +(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)) > 3; +a +4 +SELECT a FROM t1 GROUP BY a +HAVING IFNULL((SELECT b FROM t2 WHERE b > 4), +(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)) > 3; +ERROR 21000: Subquery returns more than 1 row +SELECT a FROM t1 +ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 2), +(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)); +a +1 +2 +3 +4 +SELECT a FROM t1 +ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 1), +(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)); +ERROR 21000: Subquery returns more than 1 row +SELECT a FROM t1 +ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4), +(SELECT c FROM t2 WHERE c=a AND b > 2 ORDER BY b)); +a +1 +2 +3 +4 +SELECT a FROM t1 +ORDER BY IFNULL((SELECT b FROM t2 WHERE b > 4), +(SELECT c FROM t2 WHERE c=a AND b > 1 ORDER BY b)); +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1,t2; +create table t1 (df decimal(5,1)); +insert into t1 values(1.1); +insert into t1 values(2.2); +select * from t1 where df <= all (select avg(df) from t1 group by df); +df +1.1 +select * from t1 where df >= all (select avg(df) from t1 group by df); +df +2.2 +drop table t1; +create table t1 (df decimal(5,1)); +insert into t1 values(1.1); +select 1.1 * exists(select * from t1); +1.1 * exists(select * from t1) +1.1 +drop table t1; +CREATE TABLE t1 ( +grp int(11) default NULL, +a decimal(10,2) default NULL); +insert into t1 values (1, 1), (2, 2), (2, 3), (3, 4), (3, 5), (3, 6), (NULL, NULL); +select * from t1; +grp a +1 1.00 +2 2.00 +2 3.00 +3 4.00 +3 5.00 +3 6.00 +NULL NULL +select min(a) from t1 group by grp; +min(a) +NULL +1.00 +2.00 +4.00 +drop table t1; +CREATE table t1 ( c1 integer ); +INSERT INTO t1 VALUES ( 1 ); +INSERT INTO t1 VALUES ( 2 ); +INSERT INTO t1 VALUES ( 3 ); +CREATE TABLE t2 ( c2 integer ); +INSERT INTO t2 VALUES ( 1 ); +INSERT INTO t2 VALUES ( 4 ); +INSERT INTO t2 VALUES ( 5 ); +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c2 WHERE c2 IN (1); +c1 c2 +1 1 +SELECT * FROM t1 LEFT JOIN t2 ON c1 = c2 +WHERE c2 IN ( SELECT c2 FROM t2 WHERE c2 IN ( 1 ) ); +c1 c2 +1 1 +DROP TABLE t1,t2; +CREATE TABLE t1 ( c1 integer ); +INSERT INTO t1 VALUES ( 1 ); +INSERT INTO t1 VALUES ( 2 ); +INSERT INTO t1 VALUES ( 3 ); +INSERT INTO t1 VALUES ( 6 ); +CREATE TABLE t2 ( c2 integer ); +INSERT INTO t2 VALUES ( 1 ); +INSERT INTO t2 VALUES ( 4 ); +INSERT INTO t2 VALUES ( 5 ); +INSERT INTO t2 VALUES ( 6 ); +CREATE TABLE t3 ( c3 integer ); +INSERT INTO t3 VALUES ( 7 ); +INSERT INTO t3 VALUES ( 8 ); +SELECT c1,c2 FROM t1 LEFT JOIN t2 ON c1 = c2 +WHERE EXISTS (SELECT c3 FROM t3 WHERE c2 IS NULL ); +c1 c2 +2 NULL +3 NULL +DROP TABLE t1,t2,t3; +CREATE TABLE `t1` ( +`itemid` bigint(20) unsigned NOT NULL auto_increment, +`sessionid` bigint(20) unsigned default NULL, +`time` int(10) unsigned NOT NULL default '0', +`type` set('A','D','E','F','G','I','L','N','U') collate latin1_general_ci NOT +NULL default '', +`data` text collate latin1_general_ci NOT NULL, +PRIMARY KEY (`itemid`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +INSERT INTO `t1` VALUES (1, 1, 1, 'D', ''); +CREATE TABLE `t2` ( +`sessionid` bigint(20) unsigned NOT NULL auto_increment, +`pid` int(10) unsigned NOT NULL default '0', +`date` int(10) unsigned NOT NULL default '0', +`ip` varchar(15) collate latin1_general_ci NOT NULL default '', +PRIMARY KEY (`sessionid`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +INSERT INTO `t2` VALUES (1, 1, 1, '10.10.10.1'); +SELECT s.ip, count( e.itemid ) FROM `t1` e JOIN t2 s ON s.sessionid = e.sessionid WHERE e.sessionid = ( SELECT sessionid FROM t2 ORDER BY sessionid DESC LIMIT 1 ) GROUP BY s.ip HAVING count( e.itemid ) >0 LIMIT 0 , 30; +ip count( e.itemid ) +10.10.10.1 1 +drop tables t1,t2; +CREATE TABLE t1 (EMPNUM CHAR(3)); +CREATE TABLE t2 (EMPNUM CHAR(3) ); +INSERT INTO t1 VALUES ('E1'),('E2'); +INSERT INTO t2 VALUES ('E1'); +DELETE FROM t1 +WHERE t1.EMPNUM NOT IN +(SELECT t2.EMPNUM +FROM t2 +WHERE t1.EMPNUM = t2.EMPNUM); +select * from t1; +EMPNUM +E1 +DROP TABLE t1,t2; +CREATE TABLE t1(select_id BIGINT, values_id BIGINT); +INSERT INTO t1 VALUES (1, 1); +CREATE TABLE t2 (select_id BIGINT, values_id BIGINT, +PRIMARY KEY(select_id,values_id)); +INSERT INTO t2 VALUES (0, 1), (0, 2), (0, 3), (1, 5); +SELECT values_id FROM t1 +WHERE values_id IN (SELECT values_id FROM t2 +WHERE select_id IN (1, 0)); +values_id +1 +SELECT values_id FROM t1 +WHERE values_id IN (SELECT values_id FROM t2 +WHERE select_id BETWEEN 0 AND 1); +values_id +1 +SELECT values_id FROM t1 +WHERE values_id IN (SELECT values_id FROM t2 +WHERE select_id = 0 OR select_id = 1); +values_id +1 +DROP TABLE t1, t2; +create table t1 (fld enum('0','1')); +insert into t1 values ('1'); +select * from (select max(fld) from t1) as foo; +max(fld) +1 +drop table t1; +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (c int, d int); +CREATE TABLE t3 (e int); +INSERT INTO t1 VALUES +(1,10), (2,10), (1,20), (2,20), (3,20), (2,30), (4,40); +INSERT INTO t2 VALUES +(2,10), (2,20), (4,10), (5,10), (3,20), (2,40); +INSERT INTO t3 VALUES (10), (30), (10), (20) ; +SELECT a, MAX(b), MIN(b) FROM t1 GROUP BY a; +a MAX(b) MIN(b) +1 20 10 +2 30 10 +3 20 20 +4 40 40 +SELECT * FROM t2; +c d +2 10 +2 20 +4 10 +5 10 +3 20 +2 40 +SELECT * FROM t3; +e +10 +30 +10 +20 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20); +a +2 +4 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)<d); +a +2 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>d); +a +2 +4 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 +WHERE d >= SOME(SELECT e FROM t3 WHERE MAX(b)=e)); +a +2 +3 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 +WHERE EXISTS(SELECT e FROM t3 WHERE MAX(b)=e AND e <= d)); +a +2 +3 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 +WHERE d > SOME(SELECT e FROM t3 WHERE MAX(b)=e)); +a +2 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 +WHERE EXISTS(SELECT e FROM t3 WHERE MAX(b)=e AND e < d)); +a +2 +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 +WHERE MIN(b) < d AND +EXISTS(SELECT e FROM t3 WHERE MAX(b)=e AND e <= d)); +a +2 +SELECT a, SUM(a) FROM t1 GROUP BY a; +a SUM(a) +1 2 +2 6 +3 3 +4 4 +SELECT a FROM t1 +WHERE EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) = c) GROUP BY a; +a +3 +4 +SELECT a FROM t1 GROUP BY a +HAVING EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) = c); +a +1 +3 +4 +SELECT a FROM t1 +WHERE a < 3 AND +EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) != c) GROUP BY a; +a +1 +2 +SELECT a FROM t1 +WHERE a < 3 AND +EXISTS(SELECT c FROM t2 GROUP BY c HAVING SUM(a) != c); +a +1 +2 +1 +2 +2 +SELECT t1.a FROM t1 GROUP BY t1.a +HAVING t1.a < ALL(SELECT t2.c FROM t2 GROUP BY t2.c +HAVING EXISTS(SELECT t3.e FROM t3 GROUP BY t3.e +HAVING SUM(t1.a+t2.c) < t3.e/4)); +a +1 +2 +SELECT t1.a FROM t1 GROUP BY t1.a +HAVING t1.a > ALL(SELECT t2.c FROM t2 +WHERE EXISTS(SELECT t3.e FROM t3 GROUP BY t3.e +HAVING SUM(t1.a+t2.c) < t3.e/4)); +a +4 +SELECT t1.a FROM t1 GROUP BY t1.a +HAVING t1.a > ALL(SELECT t2.c FROM t2 +WHERE EXISTS(SELECT t3.e FROM t3 +WHERE SUM(t1.a+t2.c) < t3.e/4)); +ERROR HY000: Invalid use of group function +SELECT t1.a from t1 GROUP BY t1.a HAVING AVG(SUM(t1.b)) > 20; +ERROR HY000: Invalid use of group function +SELECT t1.a FROM t1 GROUP BY t1.a +HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c +HAVING AVG(t2.c+SUM(t1.b)) > 20); +a +2 +3 +4 +SELECT t1.a FROM t1 GROUP BY t1.a +HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c +HAVING AVG(SUM(t1.b)) > 20); +a +2 +4 +SELECT t1.a, SUM(b) AS sum FROM t1 GROUP BY t1.a +HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c +HAVING t2.c+sum > 20); +a sum +2 60 +3 20 +4 40 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a varchar(5), b varchar(10)); +INSERT INTO t1 VALUES +('AAA', 5), ('BBB', 4), ('BBB', 1), ('CCC', 2), +('CCC', 7), ('AAA', 2), ('AAA', 4), ('BBB', 3), ('AAA', 8); +SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); +a b +BBB 4 +CCC 7 +AAA 8 +EXPLAIN +SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary +ALTER TABLE t1 ADD INDEX(a); +SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); +a b +BBB 4 +CCC 7 +AAA 8 +EXPLAIN +SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL a NULL NULL NULL 9 Using where +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 21 test.t1.a,test.t1.b 1 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 9 Using temporary +DROP TABLE t1; +create table t1( f1 int,f2 int); +insert into t1 values (1,1),(2,2); +select tt.t from (select 'crash1' as t, f2 from t1) as tt left join t1 on tt.t = 'crash2' and tt.f2 = t1.f2 where tt.t = 'crash1'; +t +crash1 +crash1 +drop table t1; +create table t1 (c int, key(c)); +insert into t1 values (1142477582), (1142455969); +create table t2 (a int, b int); +insert into t2 values (2, 1), (1, 0); +delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; +drop table t1, t2; +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); +ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); +ERROR 42S22: Unknown column 'no_such_column' in 'where clause' +SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); +ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' +DROP TABLE t1; +create table t1 (i int, j bigint); +insert into t1 values (1, 2), (2, 2), (3, 2); +select * from (select min(i) from t1 where j=(select * from (select min(j) from t1) t2)) t3; +min(i) +1 +drop table t1; +CREATE TABLE t1 (i BIGINT UNSIGNED); +INSERT INTO t1 VALUES (10000000000000000000); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (i BIGINT UNSIGNED); +INSERT INTO t2 VALUES (10000000000000000000); +INSERT INTO t2 VALUES (1); +/* simple test */ +SELECT t1.i FROM t1 JOIN t2 ON t1.i = t2.i; +i +10000000000000000000 +1 +/* subquery test */ +SELECT t1.i FROM t1 WHERE t1.i = (SELECT MAX(i) FROM t2); +i +10000000000000000000 +/* subquery test with cast*/ +SELECT t1.i FROM t1 WHERE t1.i = CAST((SELECT MAX(i) FROM t2) AS UNSIGNED); +i +10000000000000000000 +DROP TABLE t1; +DROP TABLE t2; +CREATE TABLE t1 ( +id bigint(20) unsigned NOT NULL auto_increment, +name varchar(255) NOT NULL, +PRIMARY KEY (id) +); +INSERT INTO t1 VALUES +(1, 'Balazs'), (2, 'Joe'), (3, 'Frank'); +CREATE TABLE t2 ( +id bigint(20) unsigned NOT NULL auto_increment, +mid bigint(20) unsigned NOT NULL, +date date NOT NULL, +PRIMARY KEY (id) +); +INSERT INTO t2 VALUES +(1, 1, '2006-03-30'), (2, 2, '2006-04-06'), (3, 3, '2006-04-13'), +(4, 2, '2006-04-20'), (5, 1, '2006-05-01'); +SELECT *, +(SELECT date FROM t2 WHERE mid = t1.id +ORDER BY date DESC LIMIT 0, 1) AS date_last, +(SELECT date FROM t2 WHERE mid = t1.id +ORDER BY date DESC LIMIT 3, 1) AS date_next_to_last +FROM t1; +id name date_last date_next_to_last +1 Balazs 2006-05-01 NULL +2 Joe 2006-04-20 NULL +3 Frank 2006-04-13 NULL +SELECT *, +(SELECT COUNT(*) FROM t2 WHERE mid = t1.id +ORDER BY date DESC LIMIT 1, 1) AS date_count +FROM t1; +id name date_count +1 Balazs NULL +2 Joe NULL +3 Frank NULL +SELECT *, +(SELECT date FROM t2 WHERE mid = t1.id +ORDER BY date DESC LIMIT 0, 1) AS date_last, +(SELECT date FROM t2 WHERE mid = t1.id +ORDER BY date DESC LIMIT 1, 1) AS date_next_to_last +FROM t1; +id name date_last date_next_to_last +1 Balazs 2006-05-01 2006-03-30 +2 Joe 2006-04-20 2006-04-06 +3 Frank 2006-04-13 NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +i1 int(11) NOT NULL default '0', +i2 int(11) NOT NULL default '0', +t datetime NOT NULL default '0000-00-00 00:00:00', +PRIMARY KEY (i1,i2,t) +); +INSERT INTO t1 VALUES +(24,1,'2005-03-03 16:31:31'),(24,1,'2005-05-27 12:40:07'), +(24,1,'2005-05-27 12:40:08'),(24,1,'2005-05-27 12:40:10'), +(24,1,'2005-05-27 12:40:25'),(24,1,'2005-05-27 12:40:30'), +(24,2,'2005-03-03 13:43:05'),(24,2,'2005-03-03 16:23:31'), +(24,2,'2005-03-03 16:31:30'),(24,2,'2005-05-27 12:37:02'), +(24,2,'2005-05-27 12:40:06'); +CREATE TABLE t2 ( +i1 int(11) NOT NULL default '0', +i2 int(11) NOT NULL default '0', +t datetime default NULL, +PRIMARY KEY (i1) +); +INSERT INTO t2 VALUES (24,1,'2006-06-20 12:29:40'); +EXPLAIN +SELECT * FROM t1,t2 +WHERE t1.t = (SELECT t1.t FROM t1 +WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 +ORDER BY t1.t DESC LIMIT 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 system NULL NULL NULL NULL 1 +1 PRIMARY t1 index NULL PRIMARY 16 NULL 11 Using where; Using index +2 SUBQUERY t1 range PRIMARY PRIMARY 16 NULL 5 Using where; Using index +SELECT * FROM t1,t2 +WHERE t1.t = (SELECT t1.t FROM t1 +WHERE t1.t < t2.t AND t1.i2=1 AND t2.i1=t1.i1 +ORDER BY t1.t DESC LIMIT 1); +i1 i2 t i1 i2 t +24 1 2005-05-27 12:40:30 24 1 2006-06-20 12:29:40 +DROP TABLE t1, t2; +CREATE TABLE t1 (i INT); +(SELECT i FROM t1) UNION (SELECT i FROM t1); +i +SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS +( +(SELECT i FROM t1) UNION +(SELECT i FROM t1) +); +i +SELECT * FROM t1 +WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1))); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION (SELECT i FROM t1)))' at line 2 +explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12)) +from t1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'union (select t12.i from t1 t12)) +from t1' at line 1 +explain select * from t1 where not exists +((select t11.i from t1 t11) union (select t12.i from t1 t12)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table +3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b)); +insert into t1 (a) values (FLOOR(rand() * 100)); +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +insert into t1 (a) select FLOOR(rand() * 100) from t1; +SELECT a, +(SELECT REPEAT(' ',250) FROM t1 i1 +WHERE i1.b=t1.a ORDER BY RAND() LIMIT 1) AS a +FROM t1 ORDER BY a LIMIT 5; +a a +0 NULL +0 NULL +0 NULL +0 NULL +0 NULL +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT); +INSERT INTO t2 values (1); +INSERT INTO t1 VALUES (1,1),(1,2),(2,3),(3,4); +SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; +(SELECT COUNT(DISTINCT t1.b) from t2) +2 +1 +1 +SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +FROM t1 GROUP BY t1.a; +(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +2 +1 +1 +SELECT COUNT(DISTINCT t1.b), (SELECT COUNT(DISTINCT t1.b)) FROM t1 GROUP BY t1.a; +COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) +2 2 +1 1 +1 1 +SELECT COUNT(DISTINCT t1.b), +(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +FROM t1 GROUP BY t1.a; +COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +2 2 +1 1 +1 1 +SELECT ( +SELECT ( +SELECT COUNT(DISTINCT t1.b) +) +) +FROM t1 GROUP BY t1.a; +( +SELECT ( +SELECT COUNT(DISTINCT t1.b) +) +) +2 +1 +1 +SELECT ( +SELECT ( +SELECT ( +SELECT COUNT(DISTINCT t1.b) +) +) +FROM t1 GROUP BY t1.a LIMIT 1) +FROM t1 t2 +GROUP BY t2.a; +( +SELECT ( +SELECT ( +SELECT COUNT(DISTINCT t1.b) +) +) +FROM t1 GROUP BY t1.a LIMIT 1) +2 +2 +2 +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b int, PRIMARY KEY (b)); +CREATE TABLE t2 (x int auto_increment, y int, z int, +PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b)); +create table t3 (a int); +insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +insert into t1 select RAND()*1000, A.a + 10*(B.a+10*(C.a+10*D.a)) +from t3 A, t3 B, t3 C, t3 D where D.a<3; +insert into t2(y,z) select t1.b, RAND()*1000 from t1, t3; +SET SESSION sort_buffer_size = 32 * 1024; +SELECT SQL_NO_CACHE COUNT(*) +FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c +FROM t1) t; +COUNT(*) +3000 +SET SESSION sort_buffer_size = 8 * 1024 * 1024; +SELECT SQL_NO_CACHE COUNT(*) +FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c +FROM t1) t; +COUNT(*) +3000 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (id char(4) PRIMARY KEY, c int); +CREATE TABLE t2 (c int); +INSERT INTO t1 VALUES ('aa', 1); +INSERT INTO t2 VALUES (1); +SELECT * FROM t1 +WHERE EXISTS (SELECT c FROM t2 WHERE c=1 +UNION +SELECT c from t2 WHERE c=t1.c); +id c +aa 1 +INSERT INTO t1 VALUES ('bb', 2), ('cc', 3), ('dd',1); +SELECT * FROM t1 +WHERE EXISTS (SELECT c FROM t2 WHERE c=1 +UNION +SELECT c from t2 WHERE c=t1.c); +id c +aa 1 +bb 2 +cc 3 +dd 1 +INSERT INTO t2 VALUES (2); +CREATE TABLE t3 (c int); +INSERT INTO t3 VALUES (1); +SELECT * FROM t1 +WHERE EXISTS (SELECT t2.c FROM t2 JOIN t3 ON t2.c=t3.c WHERE t2.c=1 +UNION +SELECT c from t2 WHERE c=t1.c); +id c +aa 1 +bb 2 +cc 3 +dd 1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1(f1 int); +CREATE TABLE t2(f2 int, f21 int, f3 timestamp); +INSERT INTO t1 VALUES (1),(1),(2),(2); +INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11"), (2,2,"2004-02-29 11:11:11"); +SELECT ((SELECT f2 FROM t2 WHERE f21=f1 LIMIT 1) * COUNT(f1)) AS sq FROM t1 GROUP BY f1; +sq +2 +4 +SELECT (SELECT SUM(1) FROM t2 ttt GROUP BY t2.f3 LIMIT 1) AS tt FROM t2; +tt +2 +2 +PREPARE stmt1 FROM 'SELECT ((SELECT f2 FROM t2 WHERE f21=f1 LIMIT 1) * COUNT(f1)) AS sq FROM t1 GROUP BY f1'; +EXECUTE stmt1; +sq +2 +4 +EXECUTE stmt1; +sq +2 +4 +DEALLOCATE PREPARE stmt1; +SELECT f2, AVG(f21), +(SELECT t.f3 FROM t2 AS t WHERE t2.f2=t.f2 AND t.f3=MAX(t2.f3)) AS test +FROM t2 GROUP BY f2; +f2 AVG(f21) test +1 1.0000 2004-02-29 11:11:11 +2 2.0000 2004-02-29 11:11:11 +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b INT, c CHAR(10) NOT NULL); +INSERT INTO t1 VALUES +(1,1,'a'), (1,2,'b'), (1,3,'c'), (1,4,'d'), (1,5,'e'), +(2,1,'f'), (2,2,'g'), (2,3,'h'), (3,4,'i'), (3,3,'j'), +(3,2,'k'), (3,1,'l'), (1,9,'m'); +SELECT a, MAX(b), +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b)) AS test +FROM t1 GROUP BY a; +a MAX(b) test +1 9 m +2 3 h +3 4 i +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t1xt2; +CREATE TABLE t1 ( +id_1 int(5) NOT NULL, +t varchar(4) DEFAULT NULL +); +CREATE TABLE t2 ( +id_2 int(5) NOT NULL, +t varchar(4) DEFAULT NULL +); +CREATE TABLE t1xt2 ( +id_1 int(5) NOT NULL, +id_2 int(5) NOT NULL +); +INSERT INTO t1 VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'); +INSERT INTO t2 VALUES (2, 'bb'), (3, 'cc'), (4, 'dd'), (12, 'aa'); +INSERT INTO t1xt2 VALUES (2, 2), (3, 3), (4, 4); +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)); +id_1 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))); +id_1 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)))); +id_1 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)); +id_1 +1 +2 +3 +4 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN ((SELECT t1xt2.id_2 FROM t1xt2 where t1.id_1 = t1xt2.id_1))); +id_1 +1 +2 +3 +4 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN (((SELECT t1xt2.id_2 FROM t1xt2 where t1.id_1 = t1xt2.id_1)))); +id_1 +1 +2 +3 +4 +insert INTO t1xt2 VALUES (1, 12); +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)); +id_1 +1 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))); +id_1 +1 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)))); +id_1 +1 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)); +id_1 +2 +3 +4 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))); +id_1 +2 +3 +4 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)))); +id_1 +2 +3 +4 +insert INTO t1xt2 VALUES (2, 12); +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)); +id_1 +1 +2 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))); +id_1 +1 +2 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)))); +id_1 +1 +2 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN (SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)); +id_1 +3 +4 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN ((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1))); +id_1 +3 +4 +SELECT DISTINCT t1.id_1 FROM t1 WHERE +(12 NOT IN (((SELECT t1xt2.id_2 FROM t1xt2 WHERE t1.id_1 = t1xt2.id_1)))); +id_1 +3 +4 +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t1xt2; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (3), (1), (2); +SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1; +col1 col2 +this is a test. 3 +this is a test. 1 +this is a test. 2 +SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t; +col1 t2 +this is a test. 3 +this is a test. 1 +this is a test. 2 +DROP table t1; +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); +SELECT COUNT(*), a, +(SELECT m FROM t2 WHERE m = count(*) LIMIT 1) +FROM t1 GROUP BY a; +COUNT(*) a (SELECT m FROM t2 WHERE m = count(*) LIMIT 1) +2 2 2 +3 3 3 +1 4 1 +SELECT COUNT(*), a, +(SELECT MIN(m) FROM t2 WHERE m = count(*)) +FROM t1 GROUP BY a; +COUNT(*) a (SELECT MIN(m) FROM t2 WHERE m = count(*)) +2 2 2 +3 3 3 +1 4 1 +SELECT COUNT(*), a +FROM t1 GROUP BY a +HAVING (SELECT MIN(m) FROM t2 WHERE m = count(*)) > 1; +COUNT(*) a +2 2 +3 3 +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); +SELECT COUNT(*) c, a, +(SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) +FROM t1 GROUP BY a; +c a (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) +2 2 2 +3 3 3 +1 4 1,1 +SELECT COUNT(*) c, a, +(SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a) +FROM t1 GROUP BY a; +c a (SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a) +2 2 3 +3 3 4 +1 4 2,2 +DROP table t1,t2; +CREATE TABLE t1 (a int, b INT, d INT, c CHAR(10) NOT NULL, PRIMARY KEY (a, b)); +INSERT INTO t1 VALUES (1,1,0,'a'), (1,2,0,'b'), (1,3,0,'c'), (1,4,0,'d'), +(1,5,0,'e'), (2,1,0,'f'), (2,2,0,'g'), (2,3,0,'h'), (3,4,0,'i'), (3,3,0,'j'), +(3,2,0,'k'), (3,1,0,'l'), (1,9,0,'m'), (1,0,10,'n'), (2,0,5,'o'), (3,0,7,'p'); +SELECT a, MAX(b), +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=MAX(t1.b + 0)) as test +FROM t1 GROUP BY a; +a MAX(b) test +1 9 m +2 3 h +3 4 i +SELECT a x, MAX(b), +(SELECT t.c FROM t1 AS t WHERE x=t.a AND t.b=MAX(t1.b + 0)) as test +FROM t1 GROUP BY a; +x MAX(b) test +1 9 m +2 3 h +3 4 i +SELECT a, AVG(b), +(SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.b=AVG(t1.b)) AS test +FROM t1 WHERE t1.d=0 GROUP BY a; +a AVG(b) test +1 4.0000 d +2 2.0000 g +3 2.5000 NULL +SELECT tt.a, +(SELECT (SELECT c FROM t1 as t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a) +LIMIT 1) FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test +FROM t1 as tt; +a test +1 n +1 n +1 n +1 n +1 n +1 n +1 n +2 o +2 o +2 o +2 o +3 p +3 p +3 p +3 p +3 p +SELECT tt.a, +(SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a) +LIMIT 1) +FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test +FROM t1 as tt GROUP BY tt.a; +a test +1 n +2 o +3 p +SELECT tt.a, MAX( +(SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a) +LIMIT 1) +FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1)) as test +FROM t1 as tt GROUP BY tt.a; +a test +1 n +2 o +3 p +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (2,22),(1,11),(2,22); +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +a +1 +2 +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; +a +SELECT a FROM t1 t0 +WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; +a +1 +2 +SET @@sql_mode='ansi'; +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +ERROR HY000: Invalid use of group function +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; +ERROR HY000: Invalid use of group function +SELECT a FROM t1 t0 +WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; +ERROR HY000: Invalid use of group function +SET @@sql_mode=default; +DROP TABLE t1; +CREATE TABLE t1 (a INT); +INSERT INTO t1 values (1),(1),(1),(1); +CREATE TABLE t2 (x INT); +INSERT INTO t1 values (1000),(1001),(1002); +SELECT SUM( (SELECT COUNT(a) FROM t2) ) FROM t1; +ERROR HY000: Invalid use of group function +SELECT SUM( (SELECT SUM(COUNT(a)) FROM t2) ) FROM t1; +ERROR HY000: Invalid use of group function +SELECT COUNT(1) FROM DUAL; +COUNT(1) +1 +SELECT SUM( (SELECT AVG( (SELECT t1.a FROM t2) ) FROM DUAL) ) FROM t1; +ERROR HY000: Invalid use of group function +SELECT +SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING t1.a < 12) ) FROM t2) ) +FROM t1; +ERROR HY000: Invalid use of group function +SELECT t1.a as XXA, +SUM( (SELECT AVG( (SELECT COUNT(*) FROM t1 t HAVING XXA < 12) ) FROM t2) ) +FROM t1; +ERROR HY000: Invalid use of group function +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b int, KEY (a)); +INSERT INTO t1 VALUES (1,1),(2,1); +EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ref a a 5 const 1 Using where; Using index +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort +DROP TABLE t1; +CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id)); +INSERT INTO t1 VALUES +(3,'FL'), (2,'GA'), (4,'FL'), (1,'GA'), (5,'NY'), (7,'FL'), (6,'NY'); +CREATE TABLE t2 (id int NOT NULL, INDEX idx(id)); +INSERT INTO t2 VALUES (7), (5), (1), (3); +SELECT id, st FROM t1 +WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id); +id st +3 FL +1 GA +7 FL +SELECT id, st FROM t1 +WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id) +GROUP BY id; +id st +1 GA +3 FL +7 FL +SELECT id, st FROM t1 +WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id); +id st +2 GA +4 FL +SELECT id, st FROM t1 +WHERE st IN ('GA','FL') AND NOT EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id) +GROUP BY id; +id st +2 GA +4 FL +DROP TABLE t1,t2; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (1), (2); +EXPLAIN EXTENDED +SELECT * FROM (SELECT count(*) FROM t1 GROUP BY a) as res; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00 +2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort +Warnings: +Note 1003 select `res`.`count(*)` AS `count(*)` from (select count(0) AS `count(*)` from `test`.`t1` group by `test`.`t1`.`a`) `res` +DROP TABLE t1; +CREATE TABLE t1 ( +a varchar(255) default NULL, +b timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, +INDEX idx(a,b) +); +CREATE TABLE t2 ( +a varchar(255) default NULL +); +INSERT INTO t1 VALUES ('abcdefghijk','2007-05-07 06:00:24'); +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO `t1` VALUES ('asdf','2007-02-08 01:11:26'); +INSERT INTO `t2` VALUES ('abcdefghijk'); +INSERT INTO `t2` VALUES ('asdf'); +SET session sort_buffer_size=8192; +SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.a ORDER BY t1.b LIMIT 1) AS d1 FROM t2; +d1 +1 +1 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INTEGER, b INTEGER); +CREATE TABLE t2 (x INTEGER); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +INSERT INTO t2 VALUES (1), (2); +SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a; +ERROR 21000: Subquery returns more than 1 row +SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a; +ERROR 21000: Subquery returns more than 1 row +SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1; +(SELECT SUM(t1.a)/AVG(t2.x) FROM t2) +3.3333 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2); +SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1 +AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a) +GROUP BY a1.a; +a COUNT(*) +1 3 +DROP TABLE t1; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (1),(2); +SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=0) FROM t1; +(SELECT SUM(t1.a) FROM t2 WHERE a=0) +NULL +SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1; +ERROR 21000: Subquery returns more than 1 row +SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1; +(SELECT SUM(t1.a) FROM t2 WHERE a=1) +3 +DROP TABLE t1,t2; +CREATE TABLE t1 (a1 INT, a2 INT); +CREATE TABLE t2 (b1 INT, b2 INT); +INSERT INTO t1 VALUES (100, 200); +INSERT INTO t1 VALUES (101, 201); +INSERT INTO t2 VALUES (101, 201); +INSERT INTO t2 VALUES (103, 203); +SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1; +((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL +0 +0 +DROP TABLE t1, t2; +CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5)); +INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43); +SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1); +s1 s2 +SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1); +s1 s2 +CREATE INDEX I1 ON t1 (s1); +CREATE INDEX I2 ON t1 (s2); +SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1); +s1 s2 +SELECT s1, s2 FROM t1 WHERE (s2, 10) IN (SELECT s1, 10 FROM t1); +s1 s2 +TRUNCATE t1; +INSERT INTO t1 VALUES (0x41,0x41); +SELECT * FROM t1 WHERE s1 = (SELECT s2 FROM t1); +s1 s2 +DROP TABLE t1; +CREATE TABLE t1 (a1 VARBINARY(2) NOT NULL DEFAULT '0', PRIMARY KEY (a1)); +CREATE TABLE t2 (a2 BINARY(2) default '0', INDEX (a2)); +CREATE TABLE t3 (a3 BINARY(2) default '0'); +INSERT INTO t1 VALUES (1),(2),(3),(4); +INSERT INTO t2 VALUES (1),(2),(3); +INSERT INTO t3 VALUES (1),(2),(3); +SELECT LEFT(t2.a2, 1) FROM t2,t3 WHERE t3.a3=t2.a2; +LEFT(t2.a2, 1) +1 +2 +3 +SELECT t1.a1, t1.a1 in (SELECT t2.a2 FROM t2,t3 WHERE t3.a3=t2.a2) FROM t1; +a1 t1.a1 in (SELECT t2.a2 FROM t2,t3 WHERE t3.a3=t2.a2) +1 0 +2 0 +3 0 +4 0 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a1 BINARY(3) PRIMARY KEY, b1 VARBINARY(3)); +CREATE TABLE t2 (a2 VARBINARY(3) PRIMARY KEY); +CREATE TABLE t3 (a3 VARBINARY(3) PRIMARY KEY); +INSERT INTO t1 VALUES (1,10), (2,20), (3,30), (4,40); +INSERT INTO t2 VALUES (2), (3), (4), (5); +INSERT INTO t3 VALUES (10), (20), (30); +SELECT LEFT(t1.a1,1) FROM t1,t3 WHERE t1.b1=t3.a3; +LEFT(t1.a1,1) +1 +2 +3 +SELECT a2 FROM t2 WHERE t2.a2 IN (SELECT t1.a1 FROM t1,t3 WHERE t1.b1=t3.a3); +a2 +DROP TABLE t1, t2, t3; +SET @save_optimizer_switch=@@optimizer_switch; +SET optimizer_switch='semijoin_with_cache=off'; +SET optimizer_switch='materialization=off'; +CREATE TABLE t1 (a CHAR(1), b VARCHAR(10)); +INSERT INTO t1 VALUES ('a', 'aa'); +INSERT INTO t1 VALUES ('a', 'aaa'); +SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); +a b +CREATE INDEX I1 ON t1 (a); +CREATE INDEX I2 ON t1 (b); +EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where +1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1) +SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1); +a b +CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10)); +INSERT INTO t2 SELECT * FROM t1; +CREATE INDEX I1 ON t2 (a); +CREATE INDEX I2 ON t2 (b); +EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL I2 NULL NULL NULL 2 Using where +1 PRIMARY t2 ref I1 I1 4 test.t2.b 2 Using where; Using index; FirstMatch(t2) +SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2); +a b +EXPLAIN +SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where +1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1) +SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500); +a b +DROP TABLE t1,t2; +SET optimizer_switch= @save_optimizer_switch; +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (1,1), (1,2), (2,3), (2,4); +EXPLAIN +SELECT a AS out_a, MIN(b) FROM t1 +WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a) +GROUP BY a; +ERROR 42S22: Unknown column 'out_a' in 'where clause' +SELECT a AS out_a, MIN(b) FROM t1 +WHERE b > (SELECT MIN(b) FROM t1 WHERE a = out_a) +GROUP BY a; +ERROR 42S22: Unknown column 'out_a' in 'where clause' +EXPLAIN +SELECT a AS out_a, MIN(b) FROM t1 t1_outer +WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) +GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1_outer ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where +SELECT a AS out_a, MIN(b) FROM t1 t1_outer +WHERE b > (SELECT MIN(b) FROM t1 WHERE a = t1_outer.a) +GROUP BY a; +out_a MIN(b) +1 2 +2 4 +DROP TABLE t1; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (1),(2); +INSERT INTO t2 VALUES (1),(2); +SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); +2 +2 +2 +EXPLAIN EXTENDED +SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where 1 +EXPLAIN EXTENDED +SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION +(SELECT 1 FROM t2 WHERE t1.a = t2.a)); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where +3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists((select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))) +DROP TABLE t1,t2; +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(f11 int, f12 int); +create table t2(f21 int unsigned not null, f22 int, f23 varchar(10)); +insert into t1 values(1,1),(2,2), (3, 3); +insert into t2 +select -1 , (@a:=(A.a + 10 * (B.a + 10 * (C.a+10*D.a))))/5000 + 1, @a +from t0 A, t0 B, t0 C, t0 D; +set session sort_buffer_size= 33*1024; +select count(*) from t1 where f12 = +(select f22 from t2 where f22 = f12 order by f21 desc, f22, f23 limit 1); +count(*) +3 +drop table t0,t1,t2; +CREATE TABLE t4 ( +f7 varchar(32) collate utf8_bin NOT NULL default '', +f10 varchar(32) collate utf8_bin default NULL, +PRIMARY KEY (f7) +); +INSERT INTO t4 VALUES(1,1), (2,null); +CREATE TABLE t2 ( +f4 varchar(32) collate utf8_bin NOT NULL default '', +f2 varchar(50) collate utf8_bin default NULL, +f3 varchar(10) collate utf8_bin default NULL, +PRIMARY KEY (f4), +UNIQUE KEY uk1 (f2) +); +INSERT INTO t2 VALUES(1,1,null), (2,2,null); +CREATE TABLE t1 ( +f8 varchar(32) collate utf8_bin NOT NULL default '', +f1 varchar(10) collate utf8_bin default NULL, +f9 varchar(32) collate utf8_bin default NULL, +PRIMARY KEY (f8) +); +INSERT INTO t1 VALUES (1,'P',1), (2,'P',1), (3,'R',2); +CREATE TABLE t3 ( +f6 varchar(32) collate utf8_bin NOT NULL default '', +f5 varchar(50) collate utf8_bin default NULL, +PRIMARY KEY (f6) +); +INSERT INTO t3 VALUES (1,null), (2,null); +SELECT +IF(t1.f1 = 'R', a1.f2, t2.f2) AS a4, +IF(t1.f1 = 'R', a1.f3, t2.f3) AS f3, +SUM( +IF( +(SELECT VPC.f2 +FROM t2 VPC, t4 a2, t2 a3 +WHERE +VPC.f4 = a2.f10 AND a3.f2 = a4 +LIMIT 1) IS NULL, +0, +t3.f5 +) +) AS a6 +FROM +t2, t3, t1 JOIN t2 a1 ON t1.f9 = a1.f4 +GROUP BY a4; +a4 f3 a6 +1 NULL NULL +2 NULL NULL +DROP TABLE t1, t2, t3, t4; +create table t1 (a float(5,4) zerofill); +create table t2 (a float(5,4),b float(2,0)); +select t1.a from t1 where +t1.a= (select b from t2 limit 1) and not +t1.a= (select a from t2 limit 1) ; +a +drop table t1, t2; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +SET @save_join_cache_level=@@join_cache_level; +SET join_cache_level=0; +EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary +Warnings: +Note 1003 select 1 AS `1` from <materialize> (select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where (`<subquery2>`.`min(a)` = 1) +EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary +Warnings: +Note 1003 select 1 AS `1` from <materialize> (select min(`test`.`t1`.`a`) from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a`) join `test`.`t1` where (`<subquery2>`.`min(a)` = 1) +SET join_cache_level=@save_join_cache_level; +DROP TABLE t1; +# +# Bug#45061: Incorrectly market field caused wrong result. +# +CREATE TABLE `C` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +KEY `int_key` (`int_key`) +); +INSERT INTO `C` VALUES (9,9), (0,0), (8,6), (3,6), (7,6), (0,4), +(1,7), (9,4), (0,8), (9,4), (0,7), (5,5), (0,0), (8,5), (8,7), +(5,2), (1,8), (7,0), (0,9), (9,5); +SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); +int_nokey int_key +9 9 +0 0 +5 5 +0 0 +EXPLAIN EXTENDED SELECT * FROM C WHERE `int_key` IN (SELECT `int_nokey`); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY C ALL NULL NULL NULL NULL 20 100.00 Using where +DROP TABLE C; +# End of test for bug#45061. +# +# Bug #46749: Segfault in add_key_fields() with outer subquery level +# field references +# +CREATE TABLE t1 ( +a int, +b int, +UNIQUE (a), KEY (b) +); +INSERT INTO t1 VALUES (1,1), (2,1); +CREATE TABLE st1 like t1; +INSERT INTO st1 VALUES (1,1), (2,1); +CREATE TABLE st2 like t1; +INSERT INTO st2 VALUES (1,1), (2,1); +EXPLAIN +SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) +FROM t1 +WHERE a = 230; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT MAX(b), (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) +FROM t1 +WHERE a = 230; +MAX(b) (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b) +NULL NULL +DROP TABLE t1, st1, st2; +# +# Bug #48709: Assertion failed in sql_select.cc:11782: +# int join_read_key(JOIN_TAB*) +# +CREATE TABLE t1 (pk int PRIMARY KEY, int_key int); +INSERT INTO t1 VALUES (10,1), (14,1); +CREATE TABLE t2 (pk int PRIMARY KEY, int_key int); +INSERT INTO t2 VALUES (3,3), (5,NULL), (7,3); +# should have eq_ref for t1 +EXPLAIN +SELECT * FROM t2 outr +WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) +ORDER BY outr.pk; +id select_type table type possible_keys key key_len ref rows Extra +x x outr ALL x x x x x x +x x t1 eq_ref x x x x x x +x x t2 index x x x x x x +# should not crash on debug binaries +SELECT * FROM t2 outr +WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2) +ORDER BY outr.pk; +pk int_key +3 3 +7 3 +DROP TABLE t1,t2; +# +# Bug#12329653 +# EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY +# +CREATE TABLE t1(a1 int); +INSERT INTO t1 VALUES (1),(2); +SELECT @@session.sql_mode INTO @old_sql_mode; +SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; +EXPLAIN EXTENDED +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1003 select 1 AS `1` from `test`.`t1` where 1 +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); +1 +1 +1 +PREPARE stmt FROM +'SELECT 1 UNION ALL +SELECT 1 FROM t1 +ORDER BY +(SELECT 1 FROM t1 AS t1_0 + WHERE 1 < SOME (SELECT a1 FROM t1) +)' ; +EXECUTE stmt ; +ERROR 21000: Subquery returns more than 1 row +EXECUTE stmt ; +ERROR 21000: Subquery returns more than 1 row +SET SESSION sql_mode=@old_sql_mode; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; +# +# Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER +# +CREATE TABLE t1(a1 int); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2(a1 int); +INSERT INTO t2 VALUES (3); +SELECT @@session.sql_mode INTO @old_sql_mode; +SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2 FROM t2); +1 +1 +1 +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2); +1 +1 +1 +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2); +1 +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2); +1 +1 +1 +SET SESSION sql_mode=@old_sql_mode; +DROP TABLE t1, t2; +# +# Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER +# +create table t2(i int); +insert into t2 values(0); +SELECT @@session.sql_mode INTO @old_sql_mode; +SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; +CREATE VIEW v1 AS +SELECT 'f' FROM t2 UNION SELECT 'x' FROM t2 +; +CREATE TABLE t1 ( +pk int NOT NULL, +col_varchar_key varchar(1) DEFAULT NULL, +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +); +SELECT t1.pk +FROM t1 +WHERE t1.col_varchar_key < ALL ( SELECT * FROM v1 ) +; +pk +SET SESSION sql_mode=@old_sql_mode; +drop table t2, t1; +drop view v1; +End of 5.0 tests. +create table t_out (subcase char(3), +a1 char(2), b1 char(2), c1 char(2)); +create table t_in (a2 char(2), b2 char(2), c2 char(2)); +insert into t_out values ('A.1','2a', NULL, '2a'); +insert into t_out values ('A.3', '2a', NULL, '2a'); +insert into t_out values ('A.4', '2a', NULL, 'xx'); +insert into t_out values ('B.1', '2a', '2a', '2a'); +insert into t_out values ('B.2', '2a', '2a', '2a'); +insert into t_out values ('B.3', '3a', 'xx', '3a'); +insert into t_out values ('B.4', 'xx', '3a', '3a'); +insert into t_in values ('1a', '1a', '1a'); +insert into t_in values ('2a', '2a', '2a'); +insert into t_in values (NULL, '2a', '2a'); +insert into t_in values ('3a', NULL, '3a'); + +Test general IN semantics (not top-level) + +case A.1 +select subcase, +(a1, b1, c1) IN (select * from t_in where a2 = 'no_match') pred_in, +(a1, b1, c1) NOT IN (select * from t_in where a2 = 'no_match') pred_not_in +from t_out where subcase = 'A.1'; +subcase pred_in pred_not_in +A.1 0 1 +case A.2 - impossible +case A.3 +select subcase, +(a1, b1, c1) IN (select * from t_in) pred_in, +(a1, b1, c1) NOT IN (select * from t_in) pred_not_in +from t_out where subcase = 'A.3'; +subcase pred_in pred_not_in +A.3 NULL NULL +case A.4 +select subcase, +(a1, b1, c1) IN (select * from t_in) pred_in, +(a1, b1, c1) NOT IN (select * from t_in) pred_not_in +from t_out where subcase = 'A.4'; +subcase pred_in pred_not_in +A.4 0 1 +case B.1 +select subcase, +(a1, b1, c1) IN (select * from t_in where a2 = 'no_match') pred_in, +(a1, b1, c1) NOT IN (select * from t_in where a2 = 'no_match') pred_not_in +from t_out where subcase = 'B.1'; +subcase pred_in pred_not_in +B.1 0 1 +case B.2 +select subcase, +(a1, b1, c1) IN (select * from t_in) pred_in, +(a1, b1, c1) NOT IN (select * from t_in) pred_not_in +from t_out where subcase = 'B.2'; +subcase pred_in pred_not_in +B.2 1 0 +case B.3 +select subcase, +(a1, b1, c1) IN (select * from t_in) pred_in, +(a1, b1, c1) NOT IN (select * from t_in) pred_not_in +from t_out where subcase = 'B.3'; +subcase pred_in pred_not_in +B.3 NULL NULL +case B.4 +select subcase, +(a1, b1, c1) IN (select * from t_in) pred_in, +(a1, b1, c1) NOT IN (select * from t_in) pred_not_in +from t_out where subcase = 'B.4'; +subcase pred_in pred_not_in +B.4 0 1 + +Test IN as top-level predicate, and +as non-top level for cases A.3, B.3 (the only cases with NULL result). + +case A.1 +select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out +where subcase = 'A.1' and +(a1, b1, c1) IN (select * from t_in where a1 = 'no_match'); +pred_in +F +select case when count(*) > 0 then 'T' else 'F' end as pred_not_in from t_out +where subcase = 'A.1' and +(a1, b1, c1) NOT IN (select * from t_in where a1 = 'no_match'); +pred_not_in +T +select case when count(*) > 0 then 'T' else 'F' end as not_pred_in from t_out +where subcase = 'A.1' and +NOT((a1, b1, c1) IN (select * from t_in where a1 = 'no_match')); +not_pred_in +T +case A.3 +select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out +where subcase = 'A.3' and +(a1, b1, c1) IN (select * from t_in); +pred_in +F +select case when count(*) > 0 then 'T' else 'F' end as pred_not_in from t_out +where subcase = 'A.3' and +(a1, b1, c1) NOT IN (select * from t_in); +pred_not_in +F +select case when count(*) > 0 then 'T' else 'F' end as not_pred_in from t_out +where subcase = 'A.3' and +NOT((a1, b1, c1) IN (select * from t_in)); +not_pred_in +F +select case when count(*) > 0 then 'N' else 'wrong result' end as pred_in from t_out +where subcase = 'A.3' and +((a1, b1, c1) IN (select * from t_in)) is NULL and +((a1, b1, c1) NOT IN (select * from t_in)) is NULL; +pred_in +N +case A.4 +select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out +where subcase = 'A.4' and +(a1, b1, c1) IN (select * from t_in); +pred_in +F +select case when count(*) > 0 then 'T' else 'F' end as pred_not_in from t_out +where subcase = 'A.4' and +(a1, b1, c1) NOT IN (select * from t_in); +pred_not_in +T +select case when count(*) > 0 then 'T' else 'F' end as not_pred_in from t_out +where subcase = 'A.4' and +NOT((a1, b1, c1) IN (select * from t_in)); +not_pred_in +T +case B.1 +select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out +where subcase = 'B.1' and +(a1, b1, c1) IN (select * from t_in where a1 = 'no_match'); +pred_in +F +select case when count(*) > 0 then 'T' else 'F' end as pred_not_in from t_out +where subcase = 'B.1' and +(a1, b1, c1) NOT IN (select * from t_in where a1 = 'no_match'); +pred_not_in +T +select case when count(*) > 0 then 'T' else 'F' end as not_pred_in from t_out +where subcase = 'B.1' and +NOT((a1, b1, c1) IN (select * from t_in where a1 = 'no_match')); +not_pred_in +T +case B.2 +select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out +where subcase = 'B.2' and +(a1, b1, c1) IN (select * from t_in); +pred_in +T +select case when count(*) > 0 then 'T' else 'F' end as pred_not_in from t_out +where subcase = 'B.2' and +(a1, b1, c1) NOT IN (select * from t_in); +pred_not_in +F +select case when count(*) > 0 then 'T' else 'F' end as not_pred_in from t_out +where subcase = 'B.2' and +NOT((a1, b1, c1) IN (select * from t_in)); +not_pred_in +F +case B.3 +select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out +where subcase = 'B.3' and +(a1, b1, c1) IN (select * from t_in); +pred_in +F +select case when count(*) > 0 then 'T' else 'F' end as pred_not_in from t_out +where subcase = 'B.3' and +(a1, b1, c1) NOT IN (select * from t_in); +pred_not_in +F +select case when count(*) > 0 then 'T' else 'F' end as not_pred_in from t_out +where subcase = 'B.3' and +NOT((a1, b1, c1) IN (select * from t_in)); +not_pred_in +F +select case when count(*) > 0 then 'N' else 'wrong result' end as pred_in from t_out +where subcase = 'B.3' and +((a1, b1, c1) IN (select * from t_in)) is NULL and +((a1, b1, c1) NOT IN (select * from t_in)) is NULL; +pred_in +N +case B.4 +select case when count(*) > 0 then 'T' else 'F' end as pred_in from t_out +where subcase = 'B.4' and +(a1, b1, c1) IN (select * from t_in); +pred_in +F +select case when count(*) > 0 then 'T' else 'F' end as pred_not_in from t_out +where subcase = 'B.4' and +(a1, b1, c1) NOT IN (select * from t_in); +pred_not_in +T +select case when count(*) > 0 then 'T' else 'F' end as not_pred_in from t_out +where subcase = 'B.4' and +NOT((a1, b1, c1) IN (select * from t_in)); +not_pred_in +T +drop table t_out; +drop table t_in; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (2,22),(1,11),(2,22); +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +a +1 +2 +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; +a +SELECT a FROM t1 t0 +WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; +a +1 +2 +SET @@sql_mode='ansi'; +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; +ERROR HY000: Invalid use of group function +SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a; +ERROR HY000: Invalid use of group function +SELECT a FROM t1 t0 +WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a; +ERROR HY000: Invalid use of group function +SET @@sql_mode=default; +DROP TABLE t1; +CREATE TABLE t1 (s1 CHAR(1)); +INSERT INTO t1 VALUES ('a'); +SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); +s1 +a +DROP TABLE t1; +CREATE TABLE t1(c INT, KEY(c)); +CREATE TABLE t2(a INT, b INT); +INSERT INTO t2 VALUES (1, 10), (2, NULL); +INSERT INTO t1 VALUES (1), (3); +SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); +a b +DROP TABLE t1,t2; +CREATE TABLE t1(pk INT PRIMARY KEY, a INT, INDEX idx(a)); +INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20); +CREATE TABLE t2(pk INT PRIMARY KEY, a INT, b INT, INDEX idxa(a)); +INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100); +SELECT * FROM t1 +WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b); +pk a +1 10 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), KEY b (b)); +INSERT INTO t1 VALUES (1,NULL), (9,NULL); +CREATE TABLE t2 ( +a INT, +b INT, +c INT, +d INT, +PRIMARY KEY (a), +UNIQUE KEY b (b,c,d), +KEY b_2 (b), +KEY c (c), +KEY d (d) +); +INSERT INTO t2 VALUES +(43, 2, 11 ,30), +(44, 2, 12 ,30), +(45, 1, 1 ,10000), +(46, 1, 2 ,10000), +(556,1, 32 ,10000); +CREATE TABLE t3 ( +a INT, +b INT, +c INT, +PRIMARY KEY (a), +UNIQUE KEY b (b,c), +KEY c (c), +KEY b_2 (b) +); +INSERT INTO t3 VALUES (1,1,1), (2,32,1); +explain +SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 2 Using index +1 PRIMARY t3 ref b,b_2 b 5 test.t1.a 1 Using index +2 DEPENDENT SUBQUERY t2 ref b,b_2,c b 10 test.t3.c,test.t1.a 1 Using where; Using index; Using filesort +SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; +a incorrect +1 1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (id int); +CREATE TABLE t2 (id int, c int); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +CREATE VIEW v1 AS +SELECT t2.c AS c FROM t1, t2 +WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +UPDATE v1 SET c=1; +CREATE VIEW v2 (a,b) AS +SELECT t2.id, t2.c AS c FROM t1, t2 +WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +INSERT INTO v2(a,b) VALUES (2,2); +ERROR HY000: CHECK OPTION failed 'test.v2' +SELECT * FROM v1; +c +1 +1 +1 +1 +CREATE VIEW v3 AS +SELECT t2.c AS c FROM t2 +WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +DELETE FROM v3; +DROP VIEW v1,v2,v3; +DROP TABLE t1,t2; +# +# BUG#37822 Correlated subquery with IN and IS UNKNOWN provides wrong result +# +create table t1(id integer primary key, g integer, v integer, s char(1)); +create table t2(id integer primary key, g integer, v integer, s char(1)); +insert into t1 values +(10, 10, 10, 'l'), +(20, 20, 20, 'l'), +(40, 40, 40, 'l'), +(41, 40, null, 'l'), +(50, 50, 50, 'l'), +(51, 50, null, 'l'), +(60, 60, 60, 'l'), +(61, 60, null, 'l'), +(70, 70, 70, 'l'), +(90, 90, null, 'l'); +insert into t2 values +(10, 10, 10, 'r'), +(30, 30, 30, 'r'), +(50, 50, 50, 'r'), +(60, 60, 60, 'r'), +(61, 60, null, 'r'), +(70, 70, 70, 'r'), +(71, 70, null, 'r'), +(80, 80, 80, 'r'), +(81, 80, null, 'r'), +(100,100,null, 'r'); +select * +from t1 +where v in(select v +from t2 +where t1.g=t2.g) is unknown; +id g v s +51 50 NULL l +61 60 NULL l +drop table t1, t2; +# +# Bug#37822 Correlated subquery with IN and IS UNKNOWN provides wrong result +# +create table t1(id integer primary key, g integer, v integer, s char(1)); +create table t2(id integer primary key, g integer, v integer, s char(1)); +insert into t1 values +(10, 10, 10, 'l'), +(20, 20, 20, 'l'), +(40, 40, 40, 'l'), +(41, 40, null, 'l'), +(50, 50, 50, 'l'), +(51, 50, null, 'l'), +(60, 60, 60, 'l'), +(61, 60, null, 'l'), +(70, 70, 70, 'l'), +(90, 90, null, 'l'); +insert into t2 values +(10, 10, 10, 'r'), +(30, 30, 30, 'r'), +(50, 50, 50, 'r'), +(60, 60, 60, 'r'), +(61, 60, null, 'r'), +(70, 70, 70, 'r'), +(71, 70, null, 'r'), +(80, 80, 80, 'r'), +(81, 80, null, 'r'), +(100,100,null, 'r'); +select * +from t1 +where v in(select v +from t2 +where t1.g=t2.g) is unknown; +id g v s +51 50 NULL l +61 60 NULL l +drop table t1, t2; +# +# Bug#33204: INTO is allowed in subselect, causing inconsistent results +# +CREATE TABLE t1( a INT ); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2( a INT, b INT ); +SELECT * +FROM (SELECT a INTO @var FROM t1 WHERE a = 2) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2) t1a' at line 2 +SELECT * +FROM (SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2 +SELECT * +FROM (SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2 +SELECT * FROM ( +SELECT 1 a +UNION +SELECT a INTO @var FROM t1 WHERE a = 2 +) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2 +) t1a' at line 4 +SELECT * FROM ( +SELECT 1 a +UNION +SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2 +) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2 +) t1a' at line 4 +SELECT * FROM ( +SELECT 1 a +UNION +SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2 +) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2 +) t1a' at line 4 +SELECT * FROM (SELECT a FROM t1 WHERE a = 2) t1a; +a +2 +SELECT * FROM ( +SELECT a FROM t1 WHERE a = 2 +UNION +SELECT a FROM t1 WHERE a = 2 +) t1a; +a +2 +SELECT * FROM ( +SELECT 1 a +UNION +SELECT a FROM t1 WHERE a = 2 +UNION +SELECT a FROM t1 WHERE a = 2 +) t1a; +a +1 +2 +SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1 +SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias; +a +1 +SELECT * FROM (SELECT 1 UNION SELECT 1) t1a; +1 +1 +SELECT * FROM ((SELECT 1 a INTO @a)) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @a)) t1a' at line 1 +SELECT * FROM ((SELECT 1 a INTO OUTFILE 'file' )) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1 +SELECT * FROM ((SELECT 1 a INTO DUMPFILE 'file' )) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1 +SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO @a)) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @a)) t1a' at line 1 +SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO DUMPFILE 'file' )) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1 +SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO OUTFILE 'file' )) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1 +SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO @a))) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @a))) t1a' at line 1 +SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO DUMPFILE 'file' ))) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' ))) t1a' at line 1 +SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO OUTFILE 'file' ))) t1a; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' ))) t1a' at line 1 +SELECT * FROM (SELECT 1 a ORDER BY a) t1a; +a +1 +SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a) t1a; +a +1 +SELECT * FROM (SELECT 1 a UNION SELECT 1 a LIMIT 1) t1a; +a +1 +SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a; +a +1 +SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1; +a 1 +1 1 +2 1 +SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) ON 1' at line 1 +SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON 1' at line 1 +SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ON 1' at line 1 +SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't1a ON 1' at line 1 +SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't1a ON 1' at line 1 +SELECT * FROM t1 JOIN (t1 t1a) ON 1; +a a +1 1 +2 1 +1 2 +2 2 +SELECT * FROM t1 JOIN ((t1 t1a)) ON 1; +a a +1 1 +2 1 +1 2 +2 2 +SELECT * FROM (t1 t1a); +a +1 +2 +SELECT * FROM ((t1 t1a)); +a +1 +2 +SELECT * FROM t1 JOIN (SELECT 1 t1a) alias ON 1; +a t1a +1 1 +2 1 +SELECT * FROM t1 JOIN ((SELECT 1 t1a)) alias ON 1; +a t1a +1 1 +2 1 +SELECT * FROM t1 JOIN (SELECT 1 a) a ON 1; +a a +1 1 +2 1 +SELECT * FROM t1 JOIN ((SELECT 1 a)) a ON 1; +a a +1 1 +2 1 +SELECT * FROM (t1 JOIN (SELECT 1) t1a1 ON 1) t1a2; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't1a2' at line 1 +SELECT * FROM t1 WHERE a = ALL ( SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a = ANY ( SELECT 3 UNION SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO @a); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @a)' at line 1 +SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1 +SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1 +SELECT * FROM t1 WHERE a = ( SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a = ( SELECT 1 INTO @a); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @a)' at line 1 +SELECT * FROM t1 WHERE a = ( SELECT 1 INTO OUTFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1 +SELECT * FROM t1 WHERE a = ( SELECT 1 INTO DUMPFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1 +SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO @a); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @a)' at line 1 +SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1 +SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1 +SELECT ( SELECT 1 INTO @v ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @v )' at line 1 +SELECT ( SELECT 1 INTO OUTFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1 +SELECT ( SELECT 1 INTO DUMPFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1 +SELECT ( SELECT 1 UNION SELECT 1 INTO @v ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @v )' at line 1 +SELECT ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1 +SELECT ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1 +SELECT ( SELECT a FROM t1 WHERE a = 1 ), a FROM t1; +( SELECT a FROM t1 WHERE a = 1 ) a +1 1 +1 2 +SELECT ( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ), a FROM t1; +( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ) a +1 1 +1 2 +SELECT * FROM t2 WHERE (a, b) IN (SELECT a, b FROM t2); +a b +SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 )' at line 1 +( SELECT 1 UNION SELECT 1 ) UNION SELECT 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1' at line 1 +SELECT ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1 +SELECT ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1' at line 1 +SELECT ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ); +( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) +1 +SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1)); +((SELECT 1 UNION SELECT 1 UNION SELECT 1)) +1 +SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1 +SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') UNION SELECT 1 )' at line 1 +SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a; +1 +1 +SELECT * FROM t1 WHERE a = ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1 +SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1 +SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1 +SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1 +SELECT * FROM t1 WHERE a = ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 )' at line 1 +SELECT * FROM t1 WHERE a = ALL ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1 +SELECT * FROM t1 WHERE a = ANY ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1 +SELECT * FROM t1 WHERE a IN ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 1 )' at line 1 +SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ); +a +1 +SELECT * FROM t1 WHERE EXISTS ( SELECT 1 UNION SELECT 1 INTO @v ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @v )' at line 1 +SELECT EXISTS(SELECT 1+1); +EXISTS(SELECT 1+1) +1 +SELECT EXISTS(SELECT 1+1 INTO @test); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @test)' at line 1 +SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 INTO @v ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @v )' at line 1 +SELECT * FROM t1 WHERE EXISTS ( SELECT 1 INTO @v ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @v )' at line 1 +SELECT * FROM t1 WHERE a IN ( SELECT 1 INTO @v ); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @v )' at line 1 +DROP TABLE t1, t2; +CREATE TABLE t1 (a ENUM('rainbow')); +INSERT INTO t1 VALUES (),(),(),(),(); +SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID())); +1 +1 +DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB); +INSERT INTO t1 SET a = 'aaaa'; +INSERT INTO t1 SET a = 'aaaa'; +SELECT 1 FROM t1 GROUP BY +(SELECT LAST_INSERT_ID() FROM t1 ORDER BY MIN(a) ASC LIMIT 1); +1 +1 +DROP TABLE t1; +# +# Bug #49512 : subquery with aggregate function crash +# subselect_single_select_engine::exec() +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(); +# should not crash +SELECT 1 FROM t1 WHERE a <> SOME +( +SELECT MAX((SELECT a FROM t1 LIMIT 1)) AS d +FROM t1,t1 a +); +1 +DROP TABLE t1; +# +# Bug #45989 take 2 : memory leak after explain encounters an +# error in the query +# +CREATE TABLE t1(a LONGTEXT); +INSERT INTO t1 VALUES (repeat('a',@@global.max_allowed_packet)); +INSERT INTO t1 VALUES (repeat('b',@@global.max_allowed_packet)); +EXPLAIN EXTENDED SELECT DISTINCT 1 FROM t1, +(SELECT DISTINCTROW a AS away FROM t1 GROUP BY a WITH ROLLUP) AS d1 +WHERE t1.a = d1.a; +ERROR 42S22: Unknown column 'd1.a' in 'where clause' +DROP TABLE t1; +Set up test tables. +CREATE TABLE t1 ( +t1_id INT UNSIGNED, +PRIMARY KEY(t1_id) +) Engine=MyISAM; +INSERT INTO t1 (t1_id) VALUES (1), (2), (3), (4), (5); +CREATE TABLE t2 SELECT * FROM t1; +CREATE TABLE t3 ( +t3_id INT UNSIGNED AUTO_INCREMENT, +t1_id INT UNSIGNED, +amount DECIMAL(16,2), +PRIMARY KEY(t3_id), +KEY(t1_id) +) Engine=MyISAM; +INSERT INTO t3 (t1_id, t3_id, amount) +VALUES (1, 1, 100.00), (2, 2, 200.00), (4, 4, 400.00); +This is the 'inner query' running by itself. +Produces correct results. +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id +; +t1_id total_amount +1 100.00 +2 200.00 +3 0.00 +4 400.00 +5 0.00 +SELECT * FROM (the same inner query) +Produces correct results. +SELECT * FROM ( +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id +) AS t; +t1_id total_amount +1 100.00 +2 200.00 +3 0.00 +4 400.00 +5 0.00 +Now make t2.t1_id part of a key. +ALTER TABLE t2 ADD PRIMARY KEY(t1_id); +Same inner query by itself. +Still correct results. +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id; +t1_id total_amount +1 100.00 +2 200.00 +3 0.00 +4 400.00 +5 0.00 +SELECT * FROM (the same inner query), now with indexes on the LEFT JOIN +SELECT * FROM ( +SELECT +t1.t1_id, +IFNULL((SELECT SUM(amount) FROM t3 WHERE t3.t1_id=t1.t1_id), 0) AS total_amount +FROM +t1 +LEFT JOIN t2 ON t2.t1_id=t1.t1_id +GROUP BY +t1.t1_id +) AS t; +t1_id total_amount +1 100.00 +2 200.00 +3 0.00 +4 400.00 +5 0.00 +DROP TABLE t3; +DROP TABLE t2; +DROP TABLE t1; +# +# Bug #52711: Segfault when doing EXPLAIN SELECT with +# union...order by (select... where...) +# +CREATE TABLE t1 (a VARCHAR(10), FULLTEXT KEY a (a)); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (1),(2); +# Should not crash +EXPLAIN +SELECT * FROM t2 UNION SELECT * FROM t2 +ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); +# Should not crash +SELECT * FROM t2 UNION SELECT * FROM t2 +ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); +DROP TABLE t1,t2; +# +# Bug #58818: Incorrect result for IN/ANY subquery +# with HAVING condition +# +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (1), (2), (3); +CREATE TABLE t1s(i INT); +INSERT INTO t1s VALUES (10), (20), (30); +CREATE TABLE t2s(i INT); +INSERT INTO t2s VALUES (100), (200), (300); +SELECT * FROM t1 +WHERE t1.i NOT IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.I IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +SELECT * FROM t1 +WHERE NOT t1.I = ANY +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.i = ANY ( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +DROP TABLE t1,t1s,t2s; +# LP BUG#675248 - select->prep_where references on freed memory +CREATE TABLE t1 (a int, b int); +insert into t1 values (1,1),(0,0); +CREATE TABLE t2 (c int); +insert into t2 values (1),(2); +prepare stmt1 from "select sum(a),(select sum(c) from t2 where table1.b) as sub +from t1 as table1 group by sub"; +execute stmt1; +sum(a) sub +0 NULL +1 3 +deallocate prepare stmt1; +prepare stmt1 from "select sum(a),(select sum(c) from t2 having table1.b) as sub +from t1 as table1"; +execute stmt1; +sum(a) sub +1 3 +deallocate prepare stmt1; +drop table t1,t2; +# +# Bug LP#693935/#58727: Assertion failure with +# a single row subquery returning more than one row +# +create table t1 (a char(1) charset utf8); +insert into t1 values ('a'), ('b'); +create table t2 (a binary(1)); +insert into t2 values ('x'), ('y'); +select * from t2 where a=(select a from t1) and a='x'; +ERROR 21000: Subquery returns more than 1 row +drop table t1,t2; +End of 5.1 tests +# +# Bug #11765713 58705: +# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES +# CREATED BY OPT_SUM_QUERY +# +CREATE TABLE t1(a INT NOT NULL, KEY (a)); +INSERT INTO t1 VALUES (0), (1); +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1) +); +ERROR 21000: Subquery returns more than 1 row +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1 where a is null) +); +foo +DROP TABLE t1; +# +# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): +# Assertion `file' failed. +# +CREATE TABLE t1 (a INT); +SELECT 1 FROM +(SELECT ROW( +(SELECT 1 FROM t1 RIGHT JOIN +(SELECT 1 FROM t1, t1 t2) AS d ON 1), +1) FROM t1) AS e; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; +# +# Bug#13721076 CRASH WITH TIME TYPE/TIMESTAMP() AND WARNINGS IN SUBQUERY +# +CREATE TABLE t1(a TIME NOT NULL); +INSERT INTO t1 VALUES ('00:00:32'); +SELECT 1 FROM t1 WHERE a > +(SELECT timestamp(a) AS a FROM t1); +1 +DROP TABLE t1; +# +# No BUG#, a case brought from 5.2's innodb_mysql_lock.test +# +create table t1 (i int not null primary key); +insert into t1 values (1),(2),(3),(4),(5); +create table t2 (j int not null primary key); +insert into t2 values (1),(2),(3),(4),(5); +create table t3 (k int not null primary key); +insert into t3 values (1),(2),(3); +create view v2 as select t2.j as j from t2 where t2.j in (select t1.i from t1); +select * from t3 where k in (select j from v2); +k +1 +2 +3 +drop table t1,t2,t3; +drop view v2; +# +# Bug#52068: Optimizer generates invalid semijoin materialization plan +# +drop table if exists ot1, ot2, it1, it2; +CREATE TABLE ot1(a INTEGER); +INSERT INTO ot1 VALUES(5), (8); +CREATE TABLE it2(a INTEGER); +INSERT INTO it2 VALUES(9), (5), (1), (8); +CREATE TABLE it3(a INTEGER); +INSERT INTO it3 VALUES(7), (1), (0), (5), (1), (4); +CREATE TABLE ot4(a INTEGER); +INSERT INTO ot4 VALUES(1), (3), (5), (7), (9), (7), (3), (1); +SELECT * FROM ot1,ot4 +WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a +FROM it2,it3); +a a +5 1 +8 1 +5 5 +8 5 +5 7 +8 7 +5 7 +8 7 +5 1 +8 1 +explain SELECT * FROM ot1,ot4 +WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a +FROM it2,it3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 +1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using join buffer (flat, BNL join) +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 +2 MATERIALIZED it2 ALL NULL NULL NULL NULL 4 +2 MATERIALIZED it3 ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) +DROP TABLE IF EXISTS ot1, ot4, it2, it3; +# +# Bug#729039: NULL keys used to evaluate subquery +# +CREATE TABLE t1 (a int) ; +INSERT INTO t1 VALUES (NULL), (1), (NULL), (2); +CREATE TABLE t2 (a int, INDEX idx(a)) ; +INSERT INTO t2 VALUES (NULL), (1), (NULL); +SELECT * FROM t1 +WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a); +a +1 +EXPLAIN +SELECT * FROM t1 +WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join) +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 +SELECT * FROM t1 +WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); +a +1 +EXPLAIN +SELECT * FROM t1 +WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join) +2 MATERIALIZED t2 index idx idx 5 NULL 3 Using index +DROP TABLE t1,t2; +# +# BUG#752992: Wrong results for a subquery with 'semijoin=on' +# +CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); +INSERT INTO t1 VALUES (11,0); +INSERT INTO t1 VALUES (12,5); +INSERT INTO t1 VALUES (15,0); +CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); +INSERT INTO t2 VALUES (11,1); +INSERT INTO t2 VALUES (12,2); +INSERT INTO t2 VALUES (15,4); +SET @save_join_cache_level=@@join_cache_level; +SET join_cache_level=0; +EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 3 +1 PRIMARY it eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 Using index +1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(it) +SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); +pk i +11 0 +12 5 +15 0 +SET join_cache_level=@save_join_cache_level; +DROP table t1,t2; +# +# Bug#751350: crash with pushed condition for outer references when +# there should be none of such conditions +# +CREATE TABLE t1 (a int, b int) ; +INSERT INTO t1 VALUES (0,0),(0,0); +set @optimizer_switch_save=@@optimizer_switch; +set @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=on'; +EXPLAIN +SELECT b FROM t1 +WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) +GROUP BY b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where +SELECT b FROM t1 +WHERE ('0') IN ( SELECT a FROM t1 GROUP BY a ) +GROUP BY b; +b +0 +set @@optimizer_switch=@optimizer_switch_save; +DROP TABLE t1; +# +# Bug #11765713 58705: +# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES +# CREATED BY OPT_SUM_QUERY +# +CREATE TABLE t1(a INT NOT NULL, KEY (a)); +INSERT INTO t1 VALUES (0), (1); +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1) +); +ERROR 21000: Subquery returns more than 1 row +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1 where a is null) +); +foo +DROP TABLE t1; +CREATE TABLE t1 (a int(11), b varchar(1)); +INSERT INTO t1 VALUES (2,NULL),(5,'d'),(7,'g'); +SELECT a FROM t1 WHERE b < ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +SELECT a FROM t1 WHERE b < ANY ( SELECT b FROM t1 ); +a +5 +SELECT a FROM t1 WHERE b > ANY ( SELECT b FROM t1 GROUP BY b ); +a +7 +SELECT a FROM t1 WHERE b > ANY ( SELECT b FROM t1 ); +a +7 +SELECT a FROM t1 WHERE b <= ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b <= ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b >= ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b >= ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b = ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b = ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b <> ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b <> ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b < ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b < ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b > ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b > ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b <= ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b <= ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b >= ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b >= ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b = ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b = ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b <> ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b <> ALL ( SELECT b FROM t1 GROUP BY b ); +a +delete from t1; +INSERT INTO t1 VALUES (2,NULL),(5,'d'),(7,'g'); +SELECT a FROM t1 WHERE b < ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +SELECT a FROM t1 WHERE b < ANY ( SELECT b FROM t1 ); +a +5 +SELECT a FROM t1 WHERE b > ANY ( SELECT b FROM t1 GROUP BY b ); +a +7 +SELECT a FROM t1 WHERE b > ANY ( SELECT b FROM t1 ); +a +7 +SELECT a FROM t1 WHERE b <= ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b <= ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b >= ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b >= ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b = ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b = ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b <> ANY ( SELECT b FROM t1 ); +a +5 +7 +SELECT a FROM t1 WHERE b <> ANY ( SELECT b FROM t1 GROUP BY b ); +a +5 +7 +SELECT a FROM t1 WHERE b < ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b < ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b > ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b > ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b <= ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b <= ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b >= ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b >= ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b = ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b = ALL ( SELECT b FROM t1 GROUP BY b ); +a +SELECT a FROM t1 WHERE b <> ALL ( SELECT b FROM t1 ); +a +SELECT a FROM t1 WHERE b <> ALL ( SELECT b FROM t1 GROUP BY b ); +a +drop table t1; +# +# Fix of lp:780386 (NULL left part with empty ALL subquery). +# +CREATE TABLE t1 ( f11 int) ; +INSERT IGNORE INTO t1 VALUES (0),(0); +CREATE TABLE t2 ( f3 int, f10 int, KEY (f10,f3)) ; +INSERT IGNORE INTO t2 VALUES (NULL,NULL),(5,0); +DROP TABLE IF EXISTS t3; +Warnings: +Note 1051 Unknown table 't3' +CREATE TABLE t3 ( f3 int) ; +INSERT INTO t3 VALUES (0),(0); +SELECT a1.f3 AS r FROM t2 AS a1 , t1 WHERE a1.f3 < ALL ( SELECT f3 FROM t3 WHERE f3 = 1 ) ; +r +NULL +5 +NULL +5 +DROP TABLE t1, t2, t3; +# +# Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER +# +CREATE TABLE t1(a1 int); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2(a1 int); +INSERT INTO t2 VALUES (3); +SELECT @@session.sql_mode INTO @old_sql_mode; +SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2 FROM t2); +1 +1 +1 +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2); +1 +1 +1 +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2); +1 +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2); +1 +1 +1 +SET SESSION sql_mode=@old_sql_mode; +DROP TABLE t1, t2; +create table t2(i int); +insert into t2 values(0); +SELECT @@session.sql_mode INTO @old_sql_mode; +SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; +CREATE VIEW v1 AS +SELECT 'f' FROM t2 UNION SELECT 'x' FROM t2 +; +CREATE TABLE t1 ( +pk int NOT NULL, +col_varchar_key varchar(1) DEFAULT NULL, +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +); +SELECT t1.pk +FROM t1 +WHERE t1.col_varchar_key < ALL ( SELECT * FROM v1 ) +; +pk +SET SESSION sql_mode=@old_sql_mode; +drop table t2, t1; +drop view v1; +# +# BUG#50257: Missing info in REF column of the EXPLAIN +# lines for subselects +# +CREATE TABLE t1 (a INT, b INT, INDEX (a)); +INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); +EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 5 const 1 +EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 +2 SUBQUERY t1 ref a a 5 const 1 Using index +DROP TABLE t1; +# +# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) +# (duplicate of LP bug #888456) +# +CREATE TABLE t1 (f1 varchar(1)); +INSERT INTO t1 VALUES ('v'),('s'); +CREATE TABLE t2 (f1_key varchar(1), KEY (f1_key)); +INSERT INTO t2 VALUES ('j'),('v'),('c'),('m'),('d'), +('d'),('y'),('t'),('d'),('s'); +EXPLAIN +SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 +WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 +WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY table1 ALL NULL NULL NULL NULL 2 +1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index +SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2 +WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 +WHERE f1_key != table2.f1_key AND f1_key >= table1.f1); +f1 f1_key +v j +s j +v v +s v +v c +s c +v m +s m +v d +s d +v d +s d +v y +s y +v t +s t +v d +s d +v s +s s +DROP TABLE t1,t2; +# +# LP bug 919427: EXPLAIN for a query over a single-row table +# with IN subquery in WHERE condition +# +CREATE TABLE ot ( +col_int_nokey int(11), +col_varchar_nokey varchar(1) +) ; +INSERT INTO ot VALUES (1,'x'); +CREATE TABLE it1( +col_int_key int(11), +col_varchar_key varchar(1), +KEY idx_cvk_cik (col_varchar_key,col_int_key) +); +INSERT INTO it1 VALUES (NULL,'x'), (NULL,'f'); +CREATE TABLE it2 ( +col_int_key int(11), +col_varchar_key varchar(1), +col_varchar_key2 varchar(1), +KEY idx_cvk_cvk2_cik (col_varchar_key, col_varchar_key2, col_int_key), +KEY idx_cvk_cik (col_varchar_key, col_int_key) +); +INSERT INTO it2 VALUES (NULL,'x','x'), (NULL,'f','f'); +EXPLAIN +SELECT col_int_nokey FROM ot +WHERE col_varchar_nokey IN +(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ot system NULL NULL NULL NULL 1 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 +2 MATERIALIZED it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index +SELECT col_int_nokey FROM ot +WHERE col_varchar_nokey IN +(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); +col_int_nokey +1 +EXPLAIN +SELECT col_int_nokey FROM ot +WHERE (col_varchar_nokey, 'x') IN +(SELECT col_varchar_key, col_varchar_key2 FROM it2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ot system NULL NULL NULL NULL 1 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 +2 MATERIALIZED it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index +SELECT col_int_nokey FROM ot +WHERE (col_varchar_nokey, 'x') IN +(SELECT col_varchar_key, col_varchar_key2 FROM it2); +col_int_nokey +1 +DROP TABLE ot,it1,it2; +# +# MDEV-746 +# Bug#13651009 WRONG RESULT FROM DERIVED TABLE IF THE SUBQUERY +# HAS AN EMPTY RESULT +# +CREATE TABLE t1 ( +pk int NOT NULL, +col_int_nokey int NOT NULL, +col_int_key int NOT NULL, +col_time_key time NOT NULL, +col_varchar_key varchar(1) NOT NULL, +col_varchar_nokey varchar(1) NOT NULL, +PRIMARY KEY (pk), +KEY col_int_key (col_int_key), +KEY col_time_key (col_time_key), +KEY col_varchar_key (col_varchar_key,col_int_key) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +pk int NOT NULL AUTO_INCREMENT, +col_int_nokey int NOT NULL, +col_int_key int NOT NULL, +col_time_key time NOT NULL, +col_varchar_key varchar(1) NOT NULL, +col_varchar_nokey varchar(1) NOT NULL, +PRIMARY KEY (pk), +KEY col_int_key (col_int_key), +KEY col_time_key (col_time_key), +KEY col_varchar_key (col_varchar_key,col_int_key) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,4,4,'00:00:00','b','b'); +SET @var2:=4, @var3:=8; + +Testcase without inner subquery +EXPLAIN SELECT @var3:=12, sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR +sq4_alias1.col_varchar_key = @var3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT @var3:=12, sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR +sq4_alias1.col_varchar_key = @var3; +@var3:=12 pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey +SELECT @var3; +@var3 +8 +EXPLAIN SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR +sq4_alias1.col_varchar_key = @var3 ) AS alias3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE <derived2> system NULL NULL NULL NULL 0 const row not found +2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table +SELECT * FROM ( SELECT @var3:=12, sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key + NULL) IS NULL OR +sq4_alias1.col_varchar_key = @var3 ) AS alias3; +@var3:=12 pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey +SELECT @var3; +@var3 +8 + +Testcase with inner subquery; crashed WL#6095 +SET @var3=8; +EXPLAIN SELECT sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) +NOT IN +(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1, +c_sq1_alias1.col_varchar_nokey AS c_sq1_field2 +FROM t2 AS c_sq1_alias1 +WHERE (c_sq1_alias1.col_int_nokey != @var2 +OR c_sq1_alias1.pk != @var3)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 +SELECT sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) +NOT IN +(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1, +c_sq1_alias1.col_varchar_nokey AS c_sq1_field2 +FROM t2 AS c_sq1_alias1 +WHERE (c_sq1_alias1.col_int_nokey != @var2 +OR c_sq1_alias1.pk != @var3)); +pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey +EXPLAIN SELECT * FROM ( SELECT sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) +NOT IN +(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1, +c_sq1_alias1.col_varchar_nokey AS c_sq1_field2 +FROM t2 AS c_sq1_alias1 +WHERE (c_sq1_alias1.col_int_nokey != @var2 +OR c_sq1_alias1.pk != @var3)) ) AS alias3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +3 DEPENDENT SUBQUERY c_sq1_alias1 system PRIMARY NULL NULL NULL 1 +SELECT * FROM ( SELECT sq4_alias1.* +FROM t1 AS sq4_alias1 +WHERE (sq4_alias1.col_varchar_key , sq4_alias1.col_varchar_nokey) +NOT IN +(SELECT c_sq1_alias1.col_varchar_key AS c_sq1_field1, +c_sq1_alias1.col_varchar_nokey AS c_sq1_field2 +FROM t2 AS c_sq1_alias1 +WHERE (c_sq1_alias1.col_int_nokey != @var2 +OR c_sq1_alias1.pk != @var3)) ) AS alias3; +pk col_int_nokey col_int_key col_time_key col_varchar_key col_varchar_nokey +DROP TABLE t1,t2; +End of 5.2 tests +# +# BUG#779885: Crash in eliminate_item_equal with materialization=on in +# +CREATE TABLE t1 ( f1 int ); +INSERT INTO t1 VALUES (19), (20); +CREATE TABLE t2 ( f10 varchar(32) ); +INSERT INTO t2 VALUES ('c'),('d'); +CREATE TABLE t3 ( f10 varchar(32) ); +INSERT INTO t3 VALUES ('a'),('b'); +SELECT * +FROM t1 +WHERE +( 't' ) IN ( +SELECT t3.f10 +FROM t3 +JOIN t2 +ON t2.f10 = t3.f10 +); +f1 +DROP TABLE t1,t2,t3; +# +# BUG lp:813473: Wrong result with outer join + NOT IN subquery +# This bug is a duplicate of Bug#11764086 whose test case is added below +# +CREATE TABLE t1 (c int) ; +INSERT INTO t1 VALUES (5),(6); +CREATE TABLE t2 (a int, b int) ; +INSERT INTO t2 VALUES (20,9),(20,9); +create table t3 (d int, e int); +insert into t3 values (2, 9), (3,10); +SET @save_optimizer_switch=@@optimizer_switch; +SET optimizer_switch='outer_join_with_cache=off'; +EXPLAIN +SELECT t2.b , t1.c +FROM t2 LEFT JOIN t1 ON t1.c < 3 +WHERE (t2.b , t1.c) NOT IN (SELECT * from t3); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where +SELECT t2.b , t1.c +FROM t2 LEFT JOIN t1 ON t1.c < 3 +WHERE (t2.b, t1.c) NOT IN (SELECT * from t3); +b c +9 NULL +9 NULL +SET optimizer_switch=@save_optimizer_switch; +drop table t1, t2, t3; +# +# BUG#50257: Missing info in REF column of the EXPLAIN +# lines for subselects +# +CREATE TABLE t1 (a INT, b INT, INDEX (a)); +INSERT INTO t1 VALUES (3, 10), (2, 20), (7, 10), (5, 20); + +set @tmp_optimizer_switch=@@optimizer_switch; +set optimizer_switch='derived_merge=off,derived_with_keys=off'; +EXPLAIN SELECT * FROM (SELECT * FROM t1 WHERE a=7) t; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 +2 DERIVED t1 ref a a 5 const 1 +set optimizer_switch=@tmp_optimizer_switch; + +EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 +2 SUBQUERY t1 ref a a 5 const 1 Using index + +DROP TABLE t1; +# +# Bug#11764086: Null left operand to NOT IN in WHERE clause +# behaves differently than real NULL +# +CREATE TABLE parent (id int); +INSERT INTO parent VALUES (1), (2); +CREATE TABLE child (parent_id int, other int); +INSERT INTO child VALUES (1,NULL); +# Offending query (c.parent_id is NULL for null-complemented rows only) +SELECT p.id, c.parent_id +FROM parent p +LEFT JOIN child c +ON p.id = c.parent_id +WHERE c.parent_id NOT IN ( +SELECT parent_id +FROM child +WHERE parent_id = 3 +); +id parent_id +1 1 +2 NULL +# Some syntactic variations with IS FALSE and IS NOT TRUE +SELECT p.id, c.parent_id +FROM parent p +LEFT JOIN child c +ON p.id = c.parent_id +WHERE c.parent_id IN ( +SELECT parent_id +FROM child +WHERE parent_id = 3 +) IS NOT TRUE; +id parent_id +1 1 +2 NULL +SELECT p.id, c.parent_id +FROM parent p +LEFT JOIN child c +ON p.id = c.parent_id +WHERE c.parent_id IN ( +SELECT parent_id +FROM child +WHERE parent_id = 3 +) IS FALSE; +id parent_id +1 1 +2 NULL +DROP TABLE parent, child; +# End of test for bug#11764086. +# +# Bug 11765699 - 58690: !TABLE || (!TABLE->READ_SET || +# BITMAP_IS_SET(TABLE->READ_SET, FIELD_INDEX +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0), (1); +CREATE TABLE t2( +b TEXT, +c INT, +PRIMARY KEY (b(1)) +); +INSERT INTO t2 VALUES ('a', 2), ('b', 3); +SELECT 1 FROM t1 WHERE a = +(SELECT 1 FROM t2 WHERE b = +(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2) +ORDER BY b +); +1 +SELECT 1 FROM t1 WHERE a = +(SELECT 1 FROM t2 WHERE b = +(SELECT 1 FROM t1 t11 WHERE c = 1 OR t1.a = 1 AND 1 = 2) +GROUP BY b +); +1 +DROP TABLE t1, t2; +# +# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS) +# +CREATE TABLE t1 (f1 varchar(1)); +INSERT INTO t1 VALUES ('v'),('s'); +CREATE TABLE t2 (f1_key varchar(1), KEY (f1_key)); +INSERT INTO t2 VALUES ('j'),('v'),('c'),('m'),('d'), +('d'),('y'),('t'),('d'),('s'); +SELECT table1.f1, table2.f1_key +FROM t1 AS table1, t2 AS table2 +WHERE EXISTS +( +SELECT DISTINCT f1_key +FROM t2 +WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); +f1 f1_key +v j +s j +v v +s v +v c +s c +v m +s m +v d +s d +v d +s d +v y +s y +v t +s t +v d +s d +v s +s s +explain SELECT table1.f1, table2.f1_key +FROM t1 AS table1, t2 AS table2 +WHERE EXISTS +( +SELECT DISTINCT f1_key +FROM t2 +WHERE f1_key != table2.f1_key AND f1_key >= table1.f1 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY table1 ALL NULL NULL NULL NULL 2 +1 PRIMARY table2 index NULL f1_key 4 NULL 10 Using where; Using index; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t2 index f1_key f1_key 4 NULL 10 Using where; Using index +DROP TABLE t1,t2; +# +# lp:826279: assertion failure with GROUP BY a result of subquery +# +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (0), (0); +CREATE TABLE t2 (a int, b int, c int); +INSERT INTO t2 VALUES (10,7,0), (0,7,0); +CREATE TABLE t3 (a int, b int); +INSERT INTO t3 VALUES (10,7), (0,7); +SELECT SUM(DISTINCT b), +(SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 +WHERE t.a != 0 AND t2.a != 0) +FROM (SELECT * FROM t3) AS t +GROUP BY 2; +SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 +WHERE t.a != 0 AND t2.a != 0) +7 NULL +SELECT SUM(DISTINCT b), +(SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) +FROM (SELECT * FROM t3) AS t +GROUP BY 2; +SUM(DISTINCT b) (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) +7 NULL +7 10 +DROP TABLE t1,t2,t3; +# +# Bug#12329653 +# EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY +# +CREATE TABLE t1(a1 int); +INSERT INTO t1 VALUES (1),(2); +SELECT @@session.sql_mode INTO @old_sql_mode; +SET SESSION sql_mode='ONLY_FULL_GROUP_BY'; +SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t1); +1 +1 +1 +PREPARE stmt FROM +'SELECT 1 UNION ALL +SELECT 1 FROM t1 +ORDER BY +(SELECT 1 FROM t1 AS t1_0 + WHERE 1 < SOME (SELECT a1 FROM t1) +)' ; +EXECUTE stmt ; +ERROR 21000: Subquery returns more than 1 row +EXECUTE stmt ; +ERROR 21000: Subquery returns more than 1 row +SET SESSION sql_mode=@old_sql_mode; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; +# +# LP BUG#833777 Performance regression with deeply nested subqueries +# +create table t1 (a int not null, b char(10) not null); +insert into t1 values (1, 'a'); +set @@optimizer_switch='in_to_exists=on,semijoin=off,materialization=off,subquery_cache=off'; +select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1))))))))))))))))))))))))))))); +a +1 +set @@optimizer_switch=@subselect_tmp; +drop table t1; +# +# LP BUG#894397 Wrong result with in_to_exists, constant table , semijoin=OFF,materialization=OFF +# +CREATE TABLE t1 (a varchar(3)); +INSERT INTO t1 VALUES ('AAA'),('BBB'); +CREATE TABLE t2 (a varchar(3)); +INSERT INTO t2 VALUES ('CCC'); +set @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; +SELECT * FROM t1 WHERE t1.a IN (SELECT t2.a FROM t2 WHERE t2.a < 'ZZZ'); +a +set @@optimizer_switch=@subselect_tmp; +drop table t1, t2; +# +# LP bug #859375: Assertion `0' failed in st_select_lex_unit::optimize +# with view , UNION and prepared statement (rewriting fake_select +# condition). +# +CREATE TABLE t1 ( f1 int NOT NULL, f4 varchar(1) NOT NULL) ; +INSERT INTO t1 VALUES (6,'d'),(7,'y'); +CREATE TABLE t2 ( f1 int NOT NULL, f2 int NOT NULL) ; +INSERT INTO t2 VALUES (10,7); +CREATE VIEW v2 AS SELECT * FROM t2; +PREPARE st1 FROM " + SELECT * + FROM t1 + LEFT JOIN v2 ON ( v2.f2 = t1.f1 ) + WHERE v2.f1 NOT IN ( + SELECT 1 UNION + SELECT 247 + ) +"; +EXECUTE st1; +f1 f4 f1 f2 +7 y 10 7 +deallocate prepare st1; +DROP VIEW v2; +DROP TABLE t1,t2; +# +# LP bug #887458 Crash in subselect_union_engine::no_rows with +# double UNION and join_cache_level=3,8 +# (IN/ALL/ANY optimizations should not be applied to fake_select) +CREATE TABLE t2 ( a int, b varchar(1)) ; +INSERT IGNORE INTO t2 VALUES (8,'y'),(8,'y'); +CREATE TABLE t1 ( b varchar(1)) ; +INSERT IGNORE INTO t1 VALUES (NULL),(NULL); +set @save_join_cache_level=@@join_cache_level; +SET SESSION join_cache_level=3; +SELECT * +FROM t1, t2 +WHERE t2.b IN ( +SELECT 'm' UNION +SELECT 'm' +) OR t1.b <> SOME ( +SELECT 'v' UNION +SELECT 't' +); +b a b +set @@join_cache_level= @save_join_cache_level; +drop table t1,t2; +# +# LP bug #885162 Got error 124 from storage engine with UNION inside +# subquery and join_cache_level=3..8 +# (IN/ALL/ANY optimizations should not be applied to fake_select) +# +CREATE TABLE t1 ( +f1 varchar(1) DEFAULT NULL +); +INSERT INTO t1 VALUES ('c'); +set @save_join_cache_level=@@join_cache_level; +SET SESSION join_cache_level=8; +SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' ); +f1 +set @@join_cache_level= @save_join_cache_level; +drop table t1; +# +# LP BUG#747278 incorrect values of the NULL (no rows) single +# row subquery requested via element_index() interface +# +CREATE TABLE t1 (f1a int, f1b int) ; +INSERT IGNORE INTO t1 VALUES (1,1),(2,2); +CREATE TABLE t2 ( f2 int); +INSERT IGNORE INTO t2 VALUES (3),(4); +CREATE TABLE t3 (f3a int default 1, f3b int default 2); +INSERT INTO t3 VALUES (1,1),(2,2); +set @old_optimizer_switch = @@session.optimizer_switch; +set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; +SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +NULL +SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +NULL +set @@session.optimizer_switch=@old_optimizer_switch; +SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +NULL +SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +NULL +NULL +SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +NULL +select (null, null) = (null, null); +(null, null) = (null, null) +NULL +SELECT (SELECT f3a, f3a FROM t3 where f3a > 3) = (0, 0); +(SELECT f3a, f3a FROM t3 where f3a > 3) = (0, 0) +NULL +drop tables t1,t2,t3; +# +# LP BUG#825051 Wrong result with date/datetime and subquery with GROUP BY and in_to_exists +# +CREATE TABLE t1 (a date, KEY (a)) ; +INSERT INTO t1 VALUES ('2009-01-01'),('2009-02-02'); +set @old_optimizer_switch = @@optimizer_switch; +SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index +2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 2 Using index +SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +a +2009-01-01 +2009-02-02 +SET @@optimizer_switch='semijoin=off,materialization=on,in_to_exists=off,subquery_cache=off'; +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index +2 MATERIALIZED t1 index NULL a 4 NULL 2 Using index +SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1); +a +2009-01-01 +2009-02-02 +set @@optimizer_switch=@old_optimizer_switch; +drop table t1; +# +# LP BUG#908269 incorrect condition in case of subqueries depending +# on constant tables +# +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (1),(5); +CREATE TABLE t2 ( b INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1); +CREATE TABLE t3 ( c INT ); +INSERT INTO t3 VALUES (4),(5); +SET optimizer_switch='subquery_cache=off'; +SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +1 +NULL +SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; +( SELECT b FROM t2 WHERE b = a OR b * 0) +1 +NULL +SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1; +( SELECT b FROM t2 WHERE b = a OR rand() * 0) +1 +NULL +drop table t1,t2,t3; +set optimizer_switch=@subselect_tmp; +# +# LP BUG#905353 Wrong non-empty result with a constant table, +# aggregate function in subquery, MyISAM or Aria +# +CREATE TABLE t1 ( a INT ) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1); +SELECT a FROM t1 WHERE ( SELECT MIN(a) = 100 ); +a +drop table t1; +# +# LP BUG#985667 Wrong result with subquery in SELECT clause, and constant table in +# main query and implicit grouping +# +CREATE TABLE t1 (f1 int) engine=MyISAM; +INSERT INTO t1 VALUES (7),(8); +CREATE TABLE t2 (f2 int, f3 varchar(1)) engine=MyISAM; +INSERT INTO t2 VALUES (3,'f'); +EXPLAIN +SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 +SELECT COUNT(f1), (SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; +COUNT(f1) f4 +0 NULL +EXPLAIN +SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 +SELECT COUNT(f1), exists(SELECT f1 FROM t1 WHERE f2 > 0 limit 1) AS f4 FROM t2, t1 WHERE 'v'= f3; +COUNT(f1) f4 +0 0 +EXPLAIN +SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where +SELECT COUNT(f1), f2 > ALL (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; +COUNT(f1) f4 +0 1 +EXPLAIN +SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where +SELECT COUNT(f1), f2 IN (SELECT f1 FROM t1 WHERE f2 > 0) AS f4 FROM t2, t1 WHERE 'v'= f3; +COUNT(f1) f4 +0 0 +drop table t1,t2; +# +# LP BUG#1002079 Server crashes in Item_singlerow_subselect::val_int with constant table, +# HAVING, UNION in subquery +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (7),(0); +CREATE TABLE t2 (b INT); +EXPLAIN +SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 system NULL NULL NULL NULL 0 const row not found +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +SELECT SUM(a) AS f1, a AS f2 FROM (t1, t2) HAVING f2 >= ALL (SELECT 4 UNION SELECT 5) AND f1 = 7; +f1 f2 +drop table t1,t2; +# +# LP BUG#1008686 Server crashes in subselect_union_engine::no_rows on SELECT with impossible +# WHERE and UNION in HAVING +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(7); +EXPLAIN +SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used +3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +SELECT MIN(a) AS min_a, a FROM t1 WHERE 0 HAVING a NOT IN ( SELECT 2 UNION SELECT 5 ) OR min_a != 1; +min_a a +EXPLAIN +SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 2 Using where +NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL +SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 UNION select a+1 from t1 ) OR min_a != 1; +min_a a +drop table t1; +# +# MDEV-367: Different results with and without subquery_cache on +# a query with a constant NOT IN condition +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2),(3); +set @mdev367_optimizer_switch = @@optimizer_switch; +set optimizer_switch = 'subquery_cache=on'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +set optimizer_switch = 'subquery_cache=off'; +SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100; +a +SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1; +a ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) +1 NULL +2 NULL +3 NULL +set optimizer_switch=@mdev367_optimizer_switch; +DROP TABLE t1; +# +# MDEV-521 single value subselect transformation problem +# +CREATE TABLE t1 (f1 char(2), PRIMARY KEY (f1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('u1'),('u2'); +SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) ); +f1 +u1 +u2 +FLUSH TABLES; +SELECT a.* FROM t1 a WHERE ( SELECT EXISTS ( SELECT 1 FROM t1 b WHERE b.f1 = a.f1 ) ); +f1 +u1 +u2 +DROP TABLE t1; +# return optimizer switch changed in the beginning of this test +set optimizer_switch=@subselect_tmp; +# +# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not +# precomputed and thus not part of optimization +# +CREATE TABLE t1 ( a VARCHAR(16), KEY (a) ); +INSERT INTO t1 VALUES ('Abilene'),('Akron'),('Albany'),('Albuquerque'),('Alexandria'),('Allentown'), +('Amarillo'),('Anaheim'),('Anchorage'),('Ann Arbor'),('Arden-Arcade'); +EXPLAIN +SELECT MAX( alias2.a ) AS field +FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 +WHERE alias1.a = alias2.a OR alias1.a = 'y' +HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where +SELECT MAX( alias2.a ) AS field +FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 +WHERE alias1.a = alias2.a OR alias1.a = 'y' +HAVING field>'B' AND ( 'Moscow' ) IN ( SELECT a FROM t1 ); +field +EXPLAIN +SELECT MAX( alias2.a ) +FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 +WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index +1 PRIMARY alias2 ref a a 19 test.alias1.a 2 Using index +1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join) +2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where +SELECT MAX( alias2.a ) +FROM t1 AS alias1, t1 AS alias2, t1 AS alias3 +WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 ); +MAX( alias2.a ) +Arden-Arcade +drop table t1; +# +# MDEV-277 CHEAP SQ: Server crashes in st_join_table::get_examined_rows +# with semijoin+materialization, IN and = subqueries +# +CREATE TABLE t1 (a1 INT); +INSERT INTO t1 VALUES (4),(6); +CREATE TABLE t2 (b1 INT); +INSERT INTO t2 VALUES (1),(7); +EXPLAIN +SELECT * FROM t1 +WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 +2 SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 +3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 +3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) +SELECT * FROM t1 +WHERE a1 = (SELECT COUNT(*) FROM t1 WHERE a1 IN (SELECT a1 FROM t1, t2)); +a1 +drop table t1, t2; +# +# MDEV-287 CHEAP SQ: A query with subquery in SELECT list, EXISTS, +# inner joins takes hundreds times longer +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(7); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (4),(5); +CREATE TABLE t3 (c INT); +INSERT INTO t3 VALUES (8),(3); +set @@expensive_subquery_limit= 0; +EXPLAIN +SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +FROM t2 alias1, t1 alias2, t1 alias3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 +1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) +1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 +flush status; +SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +FROM t2 alias1, t1 alias2, t1 alias3; +(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +NULL +NULL +NULL +NULL +NULL +NULL +NULL +NULL +show status like "subquery_cache%"; +Variable_name Value +Subquery_cache_hit 6 +Subquery_cache_miss 2 +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 8 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 22 +set @@expensive_subquery_limit= default; +EXPLAIN +SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +FROM t2 alias1, t1 alias2, t1 alias3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 +1 PRIMARY alias2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) +1 PRIMARY alias3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 +flush status; +SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +FROM t2 alias1, t1 alias2, t1 alias3; +(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +NULL +NULL +NULL +NULL +NULL +NULL +NULL +NULL +show status like "subquery_cache%"; +Variable_name Value +Subquery_cache_hit 0 +Subquery_cache_miss 0 +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 16 +drop table t1, t2, t3; +# +# MDEV-288 CHEAP SQ: Valgrind warnings "Memory lost" with IN and EXISTS nested subquery, materialization+semijoin +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (0),(8); +CREATE TABLE t2 (b INT PRIMARY KEY); +INSERT INTO t2 VALUES (1),(2); +EXPLAIN +SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 +SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); +a +drop table t1,t2; +# +# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used +# +CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('USA'); +CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia'); +CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (12),(22),(9),(45); +create table t4 like t3; +insert into t4 select * from t3; +# This should not show range access for table t2 +explain +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where +1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index +3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +set @tmp_mdev410=@@global.userstat; +set global userstat=on; +flush table_statistics; +flush index_statistics; +SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1 +WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 ); +MIN(b) +NULL +# The following shows that t2 was indeed scanned with a full scan. +show table_statistics; +Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes +test t1 2 0 0 +test t2 3 0 0 +show index_statistics; +Table_schema Table_name Index_name Rows_read +test t2 b 1 +set global userstat=@tmp_mdev410; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-430: Server crashes in select_describe on EXPLAIN with +# materialization+semijoin, 2 nested subqueries, aggregate functions +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +# +# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (8),(0); +CREATE TABLE t2 (b INT, c VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (4,'j'),(6,'v'); +CREATE TABLE t3 (d VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t3 VALUES ('b'),('c'); +EXPLAIN +SELECT * FROM t1 +WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index a a 5 NULL 2 Using where; Using index +2 SUBQUERY <subquery3> ALL distinct_key NULL NULL NULL 1 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +3 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 +SELECT * FROM t1 +WHERE a = (SELECT MAX(b) FROM t2 WHERE c IN (SELECT MAX(d) FROM t3)) OR a = 10; +a +drop table t1, t2, t3; +# +# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery +# +CREATE TABLE t1 (a INT, KEY(a)); +INSERT INTO t1 VALUES (1),(8); +CREATE TABLE t2 (b INT, KEY(b)); +INSERT INTO t2 VALUES (45),(17),(20); +EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index +2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index +DROP TABLE t1,t2; +set optimizer_switch=default; +select @@optimizer_switch like '%exists_to_in=on%'; +@@optimizer_switch like '%exists_to_in=on%' +0 diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 8932acf8ffd..0b339738432 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -372,7 +372,7 @@ SELECT SUM( c ) FROM t2 WHERE (SELECT DISTINCT b FROM t3) > 0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using where; Using index +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 3 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using temporary SELECT * diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index 9bb26e8a6e0..53334dbc32b 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -1896,7 +1896,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (`test`.`t1`.`b` = 7) and (<cache>(isnull(`<subquery2>`.`MAX(c)`)) or (`<subquery2>`.`MAX(c)` = 7))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (<cache>(isnull(`<subquery2>`.`MAX(c)`)) or (`<subquery2>`.`MAX(c)` = 7))) SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); a b diff --git a/mysql-test/r/subselect_mat_cost_bugs.result b/mysql-test/r/subselect_mat_cost_bugs.result index 8c95c8637aa..24640154c59 100644 --- a/mysql-test/r/subselect_mat_cost_bugs.result +++ b/mysql-test/r/subselect_mat_cost_bugs.result @@ -100,7 +100,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 index c3 c3 9 NULL 2 100.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where <expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(select `test`.`t1a`.`c1` from `test`.`t1b` join `test`.`t2` left join `test`.`t1a` on((2 and (`test`.`t1a`.`c2` = `test`.`t1b`.`pk`))) where ((`test`.`t1`.`pk` <> 0) and (<cache>(`test`.`t1`.`c1`) = `test`.`t1a`.`c1`) and (`test`.`t2`.`c3` = `test`.`t1b`.`c4`))))) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where <expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(select `test`.`t1a`.`c1` from `test`.`t1b` join `test`.`t2` left join `test`.`t1a` on(((`test`.`t1a`.`c2` = `test`.`t1b`.`pk`) and 2)) where ((`test`.`t1`.`pk` <> 0) and (<cache>(`test`.`t1`.`c1`) = `test`.`t1a`.`c1`) and (`test`.`t2`.`c3` = `test`.`t1b`.`c4`))))) SELECT pk FROM t1 WHERE c1 IN diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index ba3b8e791d2..ce9a4ad444f 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -436,7 +436,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` where (1 = (select 1 union select 1)) +Note 1003 select 1 AS `1` from `test`.`t1` where 1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -565,10 +565,10 @@ Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using where; Using index +1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = '1') and (`test`.`t1`.`numreponse` = (select max(`test`.`t1`.`numreponse`) from `test`.`t1` where (`test`.`t1`.`numeropost` = '1')))) +Note 1003 select 3 AS `numreponse` from `test`.`t1` where ((1 = '1')) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -1378,7 +1378,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(sal insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 0 0.00 Using where +1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) @@ -1464,7 +1464,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1507,7 +1507,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` = `test`.`t3`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -2979,7 +2979,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 1 PRIMARY t2 ALL NULL NULL NULL NULL 9 100.00 Using where; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`two` = `test`.`t1`.`two`) and (`test`.`t2`.`one` = `test`.`t1`.`one`) and (`test`.`t2`.`flag` = 'N')) +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`flag` = 'N') and (`test`.`t2`.`one` = `test`.`t1`.`one`) and (`test`.`t2`.`two` = `test`.`t1`.`two`)) explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 @@ -6913,7 +6913,7 @@ INSERT INTO t2 VALUES (1),(2); EXPLAIN SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1)); diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 13467916039..e017e67cfe6 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -432,7 +432,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` where (1 = (select 1 union select 1)) +Note 1003 select 1 AS `1` from `test`.`t1` where 1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -561,10 +561,10 @@ Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using where; Using index +1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = '1') and (`test`.`t1`.`numreponse` = (select max(`test`.`t1`.`numreponse`) from `test`.`t1` where (`test`.`t1`.`numeropost` = '1')))) +Note 1003 select 3 AS `numreponse` from `test`.`t1` where ((1 = '1')) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -1374,7 +1374,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(sal insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 0 0.00 Using where +1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index a75c6dc5966..492321c5d81 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -435,7 +435,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` where (1 = (select 1 union select 1)) +Note 1003 select 1 AS `1` from `test`.`t1` where 1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -564,10 +564,10 @@ Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using where; Using index +1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = '1') and (`test`.`t1`.`numreponse` = (select max(`test`.`t1`.`numreponse`) from `test`.`t1` where (`test`.`t1`.`numeropost` = '1')))) +Note 1003 select 3 AS `numreponse` from `test`.`t1` where ((1 = '1')) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -1377,7 +1377,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(sal insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 0 0.00 Using where +1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) @@ -1463,7 +1463,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 75.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t3`.`a` = `test`.`t1`.`b`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1506,7 +1506,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`a` = `test`.`t2`.`a`) and (`test`.`t1`.`b` = `test`.`t3`.`a`)) +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and (`test`.`t1`.`a` = `test`.`t2`.`a`)) insert into t1 values (3,31); select * from t2 where t2.a in (select a from t1 where t1.b <> 30); a @@ -2979,7 +2979,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 9 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`flag` = 'N')) +Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where (`test`.`t2`.`flag` = 'N') explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00 diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 34cdb17e23e..eb92936e85d 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -432,7 +432,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select 1 AS `1` from `test`.`t1` where (1 = (select 1 union select 1)) +Note 1003 select 1 AS `1` from `test`.`t1` where 1 drop table t1; CREATE TABLE `t1` ( `numeropost` mediumint(8) unsigned NOT NULL auto_increment, @@ -561,10 +561,10 @@ Warnings: Note 1003 select max(`test`.`t1`.`numreponse`) AS `MAX(numreponse)` from `test`.`t1` where (`test`.`t1`.`numeropost` = '1') EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using where; Using index +1 PRIMARY t1 const PRIMARY,numreponse PRIMARY 7 const,const 1 100.00 Using index 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: -Note 1003 select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = '1') and (`test`.`t1`.`numreponse` = (select max(`test`.`t1`.`numreponse`) from `test`.`t1` where (`test`.`t1`.`numeropost` = '1')))) +Note 1003 select 3 AS `numreponse` from `test`.`t1` where ((1 = '1')) drop table t1; CREATE TABLE t1 (a int(1)); INSERT INTO t1 VALUES (1); @@ -1374,7 +1374,7 @@ create table t1 (id int not null auto_increment primary key, salary int, key(sal insert into t1 (salary) values (100),(1000),(10000),(10),(500),(5000),(50000); explain extended SELECT id FROM t1 where salary = (SELECT MAX(salary) FROM t1); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ref salary salary 5 const 0 0.00 Using where +1 PRIMARY t1 ref salary salary 5 const 1 100.00 Using where 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away Warnings: Note 1003 select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`salary` = (select max(`test`.`t1`.`salary`) from `test`.`t1`)) diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index d9fa9853da5..92c626eca61 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -74,7 +74,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using where 1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where ((`test`.`t10`.`pk` = `test`.`t1`.`a`) and (`test`.`t12`.`pk` = `test`.`t10`.`a`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where ((`test`.`t12`.`pk` = `test`.`t10`.`a`) and (`test`.`t10`.`pk` = `test`.`t1`.`a`)) subqueries within outer joins go into ON expr. explAin extended select * from t1 left join (t2 A, t2 B) on ( A.A= t1.A And B.A in (select pk from t10)); @@ -84,7 +84,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY B ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on((<in_optimizer>(`test`.`B`.`A`,`test`.`B`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`B`.`A` in <temporAry tABle> on distinct_key where ((`test`.`B`.`A` = `<suBquery2>`.`pk`))))) And (`test`.`A`.`A` = `test`.`t1`.`A`))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(((`test`.`A`.`A` = `test`.`t1`.`A`) And <in_optimizer>(`test`.`B`.`A`,`test`.`B`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`B`.`A` in <temporAry tABle> on distinct_key where ((`test`.`B`.`A` = `<suBquery2>`.`pk`))))))) where 1 t2 should be wrapped into OJ-nest, so we have "t1 LJ (t2 J t10)" explAin extended select * from t1 left join t2 on (t2.A= t1.A And t2.A in (select pk from t10)); @@ -93,7 +93,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on((<in_optimizer>(`test`.`t2`.`A`,`test`.`t2`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`t2`.`A` in <temporAry tABle> on distinct_key where ((`test`.`t2`.`A` = `<suBquery2>`.`pk`))))) And (`test`.`t2`.`A` = `test`.`t1`.`A`))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(((`test`.`t2`.`A` = `test`.`t1`.`A`) And <in_optimizer>(`test`.`t1`.`A`,`test`.`t1`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`t1`.`A` in <temporAry tABle> on distinct_key where ((`test`.`t1`.`A` = `<suBquery2>`.`pk`))))))) where 1 we shouldn't flatten if we're going to get a join of > MAX_TABLES. explain select * from t1 s00, t1 s01, t1 s02, t1 s03, t1 s04,t1 s05,t1 s06,t1 s07,t1 s08,t1 s09, @@ -501,7 +501,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t0.pk 1 100.00 Using where 1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 2 100.00 Using index; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where ((`test`.`t2`.`vkey` = `test`.`t1`.`vnokey`) and (`test`.`t1`.`pk` = `test`.`t0`.`pk`)) +Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where ((`test`.`t1`.`pk` = `test`.`t0`.`pk`) and (`test`.`t2`.`vkey` = `test`.`t1`.`vnokey`)) SELECT vkey FROM t0 WHERE pk IN (SELECT t1.pk FROM t0 t1 JOIN t0 t2 ON t2.vkey = t1.vnokey); vkey @@ -814,7 +814,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`c` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`c` = `test`.`t1`.`c`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0); pk 1 @@ -824,7 +824,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`d` = `test`.`t1`.`d`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`d` = `test`.`t1`.`d`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0); pk 2 @@ -833,7 +833,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`e` = `test`.`t1`.`e`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`e` = `test`.`t1`.`e`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0); pk 1 @@ -843,7 +843,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`f` = `test`.`t1`.`f`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`f` = `test`.`t1`.`f`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0); pk 1 @@ -853,7 +853,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`g` = `test`.`t1`.`g`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`g` = `test`.`t1`.`g`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0); pk 1 @@ -863,7 +863,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`h` = `test`.`t1`.`h`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`h` = `test`.`t1`.`h`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0); pk 1 @@ -873,7 +873,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0); pk 1 @@ -883,7 +883,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`j` = `test`.`t1`.`j`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`j` = `test`.`t1`.`j`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0); pk 1 @@ -893,7 +893,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`k` = `test`.`t1`.`k`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = `test`.`t1`.`k`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0); pk 1 @@ -1994,7 +1994,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where ((`test`.`t1`.`f2` = `test`.`t2`.`f2`) and (`test`.`t3`.`f1` = `test`.`t1`.`f1`) and (`test`.`t4`.`f2` = `test`.`t2`.`f3`)) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where ((`test`.`t4`.`f2` = `test`.`t2`.`f3`) and (`test`.`t3`.`f1` = `test`.`t1`.`f1`) and (`test`.`t1`.`f2` = `test`.`t2`.`f2`)) SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); f1 f2 f3 f3 2 0 0 0 @@ -2783,6 +2783,16 @@ a b deallocate prepare stmt; drop table t1,t2; # +# MDEV-4335: Unexpected results when selecting on information_schema +# +CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL); +INSERT INTO t1 VALUES ('mysql'),('information_schema'); +SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA); +db +mysql +information_schema +DROP TABLE t1; +# # MySQL Bug#13340270: assertion table->sort.record_pointers == __null # CREATE TABLE t1 ( diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index 97e36cd705c..c4b9933ae07 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -456,7 +456,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Using where; FirstMatch(t2) Warnings: Note 1276 Field or reference 'test.t0.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`)) +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`b` = `test`.`t2`.`b`)) update t1 set a=3, b=11 where a=4; update t2 set b=11 where a=3; select * from t0 where t0.a in diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index e4030b8138b..d9b9815133c 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -468,7 +468,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Using where; FirstMatch(t2); Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan Warnings: Note 1276 Field or reference 'test.t0.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`)) +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`b` = `test`.`t2`.`b`)) update t1 set a=3, b=11 where a=4; update t2 set b=11 where a=3; # Not anymore: diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index f69befc8608..c91ee67a717 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -458,7 +458,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ref a a 5 test.t0.a 1 100.00 Using where; FirstMatch(t2) Warnings: Note 1276 Field or reference 'test.t0.a' of SELECT #2 was resolved in SELECT #1 -Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) and (`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`)) +Note 1003 select `test`.`t0`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) join `test`.`t0` where ((`test`.`t2`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`a` = `test`.`t0`.`a`) and (`test`.`t1`.`b` = `test`.`t2`.`b`)) update t1 set a=3, b=11 where a=4; update t2 set b=11 where a=3; select * from t0 where t0.a in @@ -1124,3 +1124,267 @@ AND ( 6 ) IN ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay DROP TABLE t1, t2; set max_join_size= @tmp_906385; +# +# mdev-3995: Wrong result for semijoin with materialization +# +set @save_optimizer_switch=@@optimizer_switch; +CREATE TABLE t1 ( +cat_id int(10) unsigned NOT NULL, +PRIMARY KEY (cat_id) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES +(709411),(709412),(709413),(709414),(709416),(709417),(709418),(709419),(709421),(709422), +(709424),(709425),(709427),(709428),(709429),(709431),(709432),(709433),(709434),(709435), +(709438),(709439),(709441),(709442),(709443),(709444),(709445),(709446),(709447),(709450), +(709451),(709454),(709455),(709456),(709457),(709459),(709460),(709461),(709462),(709463), +(709464),(709465),(709467),(709469),(709470),(709471),(709472),(709473),(709474),(709475), +(709476),(709477),(709478),(709479),(709480),(709481),(709483),(709484),(709485),(709487), +(709490),(709491),(709492),(709493),(709494),(709495),(709496),(709497),(709498),(709499), +(709500),(709501),(709502),(709503),(709504),(709505),(709506),(709507),(709509),(709510), +(709511),(709512),(709513),(709514),(709515),(709516),(709517),(709518),(709519),(709520), +(709521),(709522),(709523),(709524),(709525),(709526),(709527),(709528),(709529),(709530), +(709531),(709532),(709533),(709534),(709535),(709536),(709537),(709538),(709539),(709540), +(709541),(709542),(709543),(709544),(709545),(709546),(709548),(709549),(709551),(709552), +(709553),(709555),(709556),(709557),(709558),(709559),(709560),(709561),(709562),(709563), +(709564),(709565),(709566),(709567),(709568),(709569),(709570),(709571),(709572),(709573), +(709574),(709575),(709576),(709577),(709578),(709579),(709580),(709581),(709582),(709583), +(709584),(709585),(709586),(709587),(709588),(709590),(709591),(709592),(709593),(709594), +(709595),(709596),(709597),(709598),(709600),(709601),(709602),(709603),(709604),(709605), +(709606),(709608),(709609),(709610),(709611),(709612),(709613),(709614),(709615),(709616), +(709617),(709618),(709619),(709620),(709621),(709622),(709623),(709624),(709625),(709626), +(709627),(709628),(709629),(709630),(709631),(709632),(709633),(709634),(709635),(709637), +(709638),(709639),(709640),(709641),(709642),(709643),(709644),(709645),(709646),(709649), +(709650),(709651),(709652),(709653),(709654),(709655),(709656),(709657),(709658),(709659); +CREATE TABLE t2 ( +cat_id int(10) NOT NULL, +KEY cat_id (cat_id) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES +(708742),(708755),(708759),(708761),(708766),(708769),(708796),(708798),(708824),(708825), +(708838),(708844),(708861),(708882),(708887),(708889),(708890),(709586),(709626); +CREATE TABLE t3 ( +sack_id int(10) unsigned NOT NULL, +kit_id tinyint(3) unsigned NOT NULL DEFAULT '0', +cat_id int(10) unsigned NOT NULL, +PRIMARY KEY (sack_id,kit_id,cat_id) +) ENGINE=MyISAM; +INSERT INTO t3 VALUES +(33479,6,708523),(33479,6,708632),(33479,6,709085),(33479,6,709586),(33479,6,709626); +CREATE TABLE t4 ( +cat_id int(10) unsigned NOT NULL, +KEY cat_id (cat_id) +) ENGINE=MyISAM; +INSERT INTO t4 (cat_id) SELECT cat_id from t2; +set optimizer_switch='materialization=off'; +EXPLAIN +SELECT count(*) FROM t1, t3 +WHERE t1.cat_id = t3.cat_id AND +t3.cat_id IN (SELECT cat_id FROM t2) AND +t3.sack_id = 33479 AND t3.kit_id = 6; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 4 Using index +1 PRIMARY t2 ref cat_id cat_id 4 test.t3.cat_id 2 Using where; Using index; FirstMatch(t3) +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.cat_id 1 Using where; Using index +SELECT count(*) FROM t1, t3 +WHERE t1.cat_id = t3.cat_id AND +t3.cat_id IN (SELECT cat_id FROM t2) AND +t3.sack_id = 33479 AND t3.kit_id = 6; +count(*) +2 +set optimizer_switch='materialization=on'; +EXPLAIN +SELECT count(*) FROM t1, t3 +WHERE t1.cat_id = t3.cat_id AND +t3.cat_id IN (SELECT cat_id FROM t4) AND +t3.sack_id = 33479 AND t3.kit_id = 6; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 4 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.cat_id 1 Using index +2 MATERIALIZED t4 index cat_id cat_id 4 NULL 19 Using index +SELECT count(*) FROM t1, t3 +WHERE t1.cat_id = t3.cat_id AND +t3.cat_id IN (SELECT cat_id FROM t4) AND +t3.sack_id = 33479 AND t3.kit_id = 6; +count(*) +2 +EXPLAIN +SELECT count(*) FROM t1, t3 +WHERE t1.cat_id = t3.cat_id AND +t3.cat_id IN (SELECT cat_id FROM t2) AND +t3.sack_id = 33479 AND t3.kit_id = 6; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 4 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.cat_id 1 Using index +2 MATERIALIZED t2 index cat_id cat_id 4 NULL 19 Using index +SELECT count(*) FROM t1, t3 +WHERE t1.cat_id = t3.cat_id AND +t3.cat_id IN (SELECT cat_id FROM t2) AND +t3.sack_id = 33479 AND t3.kit_id = 6; +count(*) +2 +DROP TABLE t1,t2,t3,t4; +set optimizer_switch=@save_optimizer_switch; +# +# mdev-3913: LEFT JOIN with materialized multi-table IN subquery in WHERE +# +set @save_optimizer_switch=@@optimizer_switch; +CREATE TABLE t1 (a1 char(1), b1 char(1), index idx(b1,a1)); +INSERT INTO t1 VALUES ('f','c'),('d','m'),('g','y'); +INSERT INTO t1 VALUES ('f','c'),('d','m'),('g','y'); +CREATE TABLE t2 (a2 char(1), b2 char(1)); +INSERT INTO t2 VALUES ('y','y'),('y','y'),('w','w'); +CREATE TABLE t3 (a3 int); +INSERT INTO t3 VALUES (8),(6); +CREATE TABLE t4 (a4 char(1), b4 char(1)); +INSERT INTO t4 VALUES ('y','y'),('y','y'),('w','w'); +set optimizer_switch='materialization=off'; +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) +WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Start temporary +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ref idx idx 2 test.t4.a4 1 100.00 Using index; End temporary +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on((`test`.`t2`.`a2` = `test`.`t4`.`a4`)) where ((`test`.`t4`.`b4` = `test`.`t4`.`a4`) and (`test`.`t1`.`b1` = `test`.`t4`.`a4`)) +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) +WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); +a1 b1 a2 b2 +g y y y +g y y y +g y y y +g y y y +set optimizer_switch='materialization=on'; +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) +WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 100.00 +1 PRIMARY t1 ref idx idx 2 test.t4.a4 1 100.00 Using index +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 100.00 +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(((`test`.`t1`.`b1` = `test`.`t4`.`a4`) and (`test`.`t2`.`a2` = `test`.`t4`.`a4`))) where ((`test`.`t4`.`b4` = `test`.`t4`.`a4`) and (`test`.`t1`.`b1` = `test`.`t4`.`a4`)) +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) +WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); +a1 b1 a2 b2 +g y y y +g y y y +g y y y +g y y y +DROP TABLE t1,t2,t3,t4; +set optimizer_switch=@save_optimizer_switch; +# +# mdev-4172: LEFT JOIN with materialized multi-table IN subquery in WHERE +# and OR in ON condition +# +set @save_optimizer_switch=@@optimizer_switch; +CREATE TABLE t1 (a1 int, c1 varchar(1)); +INSERT t1 VALUES (7,'v'), (3,'y'); +CREATE TABLE t2 (c2 varchar(1)); +INSERT INTO t2 VALUES ('y'), ('y'); +CREATE TABLE t3 (c3 varchar(1)); +INSERT INTO t3 VALUES +('j'), ('v'), ('c'), ('m'), ('d'), +('d'), ('y'), ('t'), ('d'), ('s'); +CREATE TABLE t4 (a4 int, c4 varchar(1)); +INSERT INTO t4 SELECT * FROM t1; +set optimizer_switch='materialization=off'; +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') +WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 10 100.00 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) or (`test`.`t1`.`c1` > 'z'))) where ((`test`.`t4`.`c4` = `test`.`t1`.`c1`) and (`test`.`t3`.`c3` = `test`.`t1`.`c1`)) +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') +WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); +a1 c1 c2 +3 y y +3 y y +7 v NULL +set optimizer_switch='materialization=on'; +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') +WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(((`test`.`t2`.`c2` = `test`.`t1`.`c1`) or (`test`.`t1`.`c1` > 'z'))) where (`test`.`t3`.`c3` = `test`.`t4`.`c4`) +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') +WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); +a1 c1 c2 +3 y y +3 y y +7 v NULL +DROP TABLE t1,t2,t3,t4; +set optimizer_switch=@save_optimizer_switch; +# +# mdev-4177: materialization of a subquery whose WHERE condition is OR +# formula with two disjucts such that the second one is always false +# +set @save_optimizer_switch=@@optimizer_switch; +set @save_join_cache_level=@@join_cache_level; +CREATE TABLE t1 (i1 int) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1), (7), (4), (8), (4); +CREATE TABLE t2 (i2 int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (7), (5); +CREATE TABLE t3 (i3 int) ENGINE=MyISAM; +INSERT INTO t3 VALUES (7), (2), (9); +set join_cache_level=3; +set optimizer_switch='materialization=off,semijoin=off'; +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 +2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 100.00 Using where; Using join buffer (flat, BNLH join) +Warnings: +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` where <expr_cache><`test`.`t1`.`i1`>(<in_optimizer>(`test`.`t1`.`i1`,<exists>(select `test`.`t3`.`i3` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (<cache>(`test`.`t1`.`i1`) = `test`.`t3`.`i3`))))) +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); +i1 +7 +set optimizer_switch='materialization=on,semijoin=on'; +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 100.00 +1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 100.00 Using where; Using join buffer (flat, BNLH join) +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join) +Warnings: +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`)) +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); +i1 +7 +EXPLAIN EXTENDED +SELECT * FROM t1 +WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 100.00 +1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 100.00 Using where; Using join buffer (flat, BNLH join) +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join) +Warnings: +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where ((`test`.`t3`.`i3` = `test`.`t2`.`i2`) and (`test`.`t1`.`i1` = `test`.`t2`.`i2`) and (`test`.`t3`.`i3` > 0)) +SELECT * FROM t1 +WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2); +i1 +7 +SELECT * FROM t1 +WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 7 AND i3 = i2 OR 1=2); +i1 +DROP TABLE t1,t2,t3; +set join_cache_level= @save_join_cache_level; +set optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index 1ca8b44a0b8..04a54c9a371 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -87,7 +87,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY t12 eq_ref PRIMARY PRIMARY 4 test.t10.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where ((`test`.`t10`.`pk` = `test`.`t1`.`a`) and (`test`.`t12`.`pk` = `test`.`t10`.`a`)) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where ((`test`.`t12`.`pk` = `test`.`t10`.`a`) and (`test`.`t10`.`pk` = `test`.`t1`.`a`)) subqueries within outer joins go into ON expr. explAin extended select * from t1 left join (t2 A, t2 B) on ( A.A= t1.A And B.A in (select pk from t10)); @@ -97,7 +97,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY B ALL NULL NULL NULL NULL 3 100.00 Using where; Using join Buffer (incrementAl, BNL join) 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on((<in_optimizer>(`test`.`B`.`A`,`test`.`B`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`B`.`A` in <temporAry tABle> on distinct_key where ((`test`.`B`.`A` = `<suBquery2>`.`pk`))))) And (`test`.`A`.`A` = `test`.`t1`.`A`))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(((`test`.`A`.`A` = `test`.`t1`.`A`) And <in_optimizer>(`test`.`B`.`A`,`test`.`B`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`B`.`A` in <temporAry tABle> on distinct_key where ((`test`.`B`.`A` = `<suBquery2>`.`pk`))))))) where 1 t2 should be wrapped into OJ-nest, so we have "t1 LJ (t2 J t10)" explAin extended select * from t1 left join t2 on (t2.A= t1.A And t2.A in (select pk from t10)); @@ -106,7 +106,7 @@ id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join Buffer (flAt, BNL join) 2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on((<in_optimizer>(`test`.`t2`.`A`,`test`.`t2`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`t2`.`A` in <temporAry tABle> on distinct_key where ((`test`.`t2`.`A` = `<suBquery2>`.`pk`))))) And (`test`.`t2`.`A` = `test`.`t1`.`A`))) where 1 +Note 1003 select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(((`test`.`t2`.`A` = `test`.`t1`.`A`) And <in_optimizer>(`test`.`t1`.`A`,`test`.`t1`.`A` in ( <mAteriAlize> (select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`t1`.`A` in <temporAry tABle> on distinct_key where ((`test`.`t1`.`A` = `<suBquery2>`.`pk`))))))) where 1 we shouldn't flatten if we're going to get a join of > MAX_TABLES. explain select * from t1 s00, t1 s01, t1 s02, t1 s03, t1 s04,t1 s05,t1 s06,t1 s07,t1 s08,t1 s09, @@ -514,7 +514,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t0.pk 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 2 100.00 Using index; FirstMatch(t1) Warnings: -Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where ((`test`.`t2`.`vkey` = `test`.`t1`.`vnokey`) and (`test`.`t1`.`pk` = `test`.`t0`.`pk`)) +Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where ((`test`.`t1`.`pk` = `test`.`t0`.`pk`) and (`test`.`t2`.`vkey` = `test`.`t1`.`vnokey`)) SELECT vkey FROM t0 WHERE pk IN (SELECT t1.pk FROM t0 t1 JOIN t0 t2 ON t2.vkey = t1.vnokey); vkey @@ -827,7 +827,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`c` = `test`.`t1`.`c`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`c` = `test`.`t1`.`c`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0); pk 1 @@ -837,7 +837,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`d` = `test`.`t1`.`d`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`d` = `test`.`t1`.`d`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0); pk 2 @@ -846,7 +846,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`e` = `test`.`t1`.`e`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`e` = `test`.`t1`.`e`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0); pk 1 @@ -856,7 +856,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`f` = `test`.`t1`.`f`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`f` = `test`.`t1`.`f`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0); pk 1 @@ -866,7 +866,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`g` = `test`.`t1`.`g`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`g` = `test`.`t1`.`g`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0); pk 1 @@ -876,7 +876,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`h` = `test`.`t1`.`h`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`h` = `test`.`t1`.`h`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0); pk 1 @@ -886,7 +886,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`i` = `test`.`t1`.`i`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0); pk 1 @@ -896,7 +896,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`j` = `test`.`t1`.`j`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`j` = `test`.`t1`.`j`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0); pk 1 @@ -906,7 +906,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`k` = `test`.`t1`.`k`) and (`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`pk` > 0)) +Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where ((`test`.`t2`.`b` = `test`.`t1`.`b`) and (`test`.`t2`.`k` = `test`.`t1`.`k`) and (`test`.`t2`.`pk` > 0)) SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0); pk 1 @@ -2008,7 +2008,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (incremental, BNL join) 2 MATERIALIZED t4 index f2 f2 5 NULL 2 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where ((`test`.`t1`.`f2` = `test`.`t2`.`f2`) and (`test`.`t3`.`f1` = `test`.`t1`.`f1`)) +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`f1` = `test`.`t1`.`f1`) and (`test`.`t1`.`f2` = `test`.`t2`.`f2`)) SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); f1 f2 f3 f3 2 0 0 0 @@ -2797,6 +2797,16 @@ a b deallocate prepare stmt; drop table t1,t2; # +# MDEV-4335: Unexpected results when selecting on information_schema +# +CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL); +INSERT INTO t1 VALUES ('mysql'),('information_schema'); +SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA); +db +information_schema +mysql +DROP TABLE t1; +# # MySQL Bug#13340270: assertion table->sort.record_pointers == __null # CREATE TABLE t1 ( diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result index 20fee7fb7f8..717d6832415 100644 --- a/mysql-test/r/subselect_sj_mat.result +++ b/mysql-test/r/subselect_sj_mat.result @@ -86,7 +86,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Using temporary Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2`.`b1`,min(`test`.`t2`.`b2`) from `test`.`t2` where (`test`.`t2`.`b1` > '0') group by `test`.`t2`.`b1`) join `test`.`t1` where ((`<subquery2>`.`min(b2)` = `test`.`t1`.`a2`) and (`<subquery2>`.`b1` = `test`.`t1`.`a1`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2`.`b1`,min(`test`.`t2`.`b2`) from `test`.`t2` where (`test`.`t2`.`b1` > '0') group by `test`.`t2`.`b1`) join `test`.`t1` where ((`<subquery2>`.`b1` = `test`.`t1`.`a1`) and (`<subquery2>`.`min(b2)` = `test`.`t1`.`a2`)) select * from t1 where (a1, a2) in (select b1, min(b2) from t2 where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -120,7 +120,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 # NULL 5 50.00 Using where; Using index; LooseScan 1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 100.00 Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where ((`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` > '0')) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b1` > '0')) select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); a1 a2 1 - 01 2 - 01 @@ -132,7 +132,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key # # # 1 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # # # 3 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where ((`<subquery2>`.`max(b2)` = `test`.`t1i`.`a2`) and (`<subquery2>`.`b1` = `test`.`t1i`.`a1`)) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where ((`<subquery2>`.`b1` = `test`.`t1i`.`a1`) and (`<subquery2>`.`max(b2)` = `test`.`t1i`.`a2`)) select * from t1i where (a1, a2) in (select b1, max(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -144,7 +144,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key # # # 1 100.00 # 2 MATERIALIZED t2i range it2i1,it2i3 # # # 3 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where ((`<subquery2>`.`min(b2)` = `test`.`t1i`.`a2`) and (`<subquery2>`.`b1` = `test`.`t1i`.`a1`)) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1i` where ((`<subquery2>`.`b1` = `test`.`t1i`.`a1`) and (`<subquery2>`.`min(b2)` = `test`.`t1i`.`a2`)) select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -156,7 +156,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2i range NULL it2i3 9 NULL 3 100.00 Using index for group-by Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` group by `test`.`t2i`.`b1`) join `test`.`t1` where ((`<subquery2>`.`max(b2)` = `test`.`t1`.`a2`) and (`<subquery2>`.`b1` = `test`.`t1`.`a1`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` group by `test`.`t2i`.`b1`) join `test`.`t1` where ((`<subquery2>`.`b1` = `test`.`t1`.`a1`) and (`<subquery2>`.`max(b2)` = `test`.`t1`.`a2`)) select * from t1 where (a1, a2) in (select b1, max(b2) from t2i group by b1); a1 a2 1 - 01 2 - 01 @@ -188,7 +188,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2i range it2i1,it2i3 it2i3 18 NULL 3 100.00 Using where; Using index for group-by Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1` where ((`<subquery2>`.`min(b2)` = `test`.`t1`.`a2`) and (`<subquery2>`.`b1` = `test`.`t1`.`a1`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where (`test`.`t2i`.`b1` > '0') group by `test`.`t2i`.`b1`) join `test`.`t1` where ((`<subquery2>`.`b1` = `test`.`t1`.`a1`) and (`<subquery2>`.`min(b2)` = `test`.`t1`.`a2`)) select * from t1 where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1); a1 a2 1 - 01 2 - 01 @@ -236,7 +236,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 test.t1.a1,test.t1.a2 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2`) join `test`.`t1` where ((`<subquery2>`.`b2` = `test`.`t1`.`a2`) and (`<subquery2>`.`b1` = `test`.`t1`.`a1`)) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from <materialize> (select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` order by `test`.`t2`.`b1`,`test`.`t2`.`b2`) join `test`.`t1` where ((`<subquery2>`.`b1` = `test`.`t1`.`a1`) and (`<subquery2>`.`b2` = `test`.`t1`.`a2`)) select * from t1 where (a1, a2) in (select b1, b2 from t2 order by b1, b2); a1 a2 1 - 01 2 - 01 @@ -248,7 +248,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 test.t1i.a1,test.t1i.a2 1 100.00 2 MATERIALIZED t2i index NULL it2i3 18 NULL 5 100.00 Using index Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2`) join `test`.`t1i` where ((`<subquery2>`.`b2` = `test`.`t1i`.`a2`) and (`<subquery2>`.`b1` = `test`.`t1i`.`a1`)) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` order by `test`.`t2i`.`b1`,`test`.`t2i`.`b2`) join `test`.`t1i` where ((`<subquery2>`.`b1` = `test`.`t1i`.`a1`) and (`<subquery2>`.`b2` = `test`.`t1i`.`a2`)) select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2); a1 a2 1 - 01 2 - 01 @@ -305,7 +305,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 80.00 Using where; Using index; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2`.`b1` > '0') and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (`test`.`t2`.`b1` > '0') and (`test`.`t3`.`c2` > '0')) select * from t1 where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and (a1, a2) in (select c1, c2 from t3 @@ -324,7 +324,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 # 1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 2 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where ((`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t3i`.`c2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b2` = `test`.`t2i`.`b2`) and (`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t3i`.`c1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` > '0') and (`test`.`t2i`.`b2` > '0')) +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t3i`.`c1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` = `test`.`t2i`.`b1`) and (`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t3i`.`c2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b1` > '0') and (`test`.`t2i`.`b2` > '0')) select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and (a1, a2) in (select c1, c2 from t3i @@ -349,7 +349,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 4 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where 3 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery3>`.`c2`)))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`))))))) and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery3>`.`c2`)))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`))))))) and (`test`.`t3`.`c2` > '0')) select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 where c2 LIKE '%02') or @@ -375,7 +375,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where ((`test`.`t2i`.`b2` = `test`.`t3c`.`c2`) and (`test`.`t2`.`b2` = `test`.`t1`.`a2`) and (`test`.`t2i`.`b1` = `test`.`t3c`.`c1`) and (`test`.`t2`.`b1` = `test`.`t1`.`a1`) and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and (<cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`))))))) and (`test`.`t3c`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where ((`test`.`t2i`.`b1` = `test`.`t3c`.`c1`) and (`test`.`t2`.`b1` = `test`.`t1`.`a1`) and (`test`.`t2i`.`b2` = `test`.`t3c`.`c2`) and (`test`.`t2`.`b2` = `test`.`t1`.`a2`) and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and (<cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`))))))) and (`test`.`t3c`.`c2` > '0')) select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 t3a where c1 = a1) or @@ -413,7 +413,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 7 UNION t2i ref it2i1,it2i2,it2i3 # # # 2 100.00 # NULL UNION RESULT <union1,7> ALL NULL # # # NULL NULL # Warnings: -Note 1003 (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery3>`.`c2`)))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`))))))) and (`test`.`t3`.`c2` > '0'))) union (select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where ((`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t3i`.`c2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b2` = `test`.`t2i`.`b2`) and (`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t3i`.`c1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` > '0') and (`test`.`t2i`.`b2` > '0'))) +Note 1003 (select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%02') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery3>`.`c2`)))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3`.`c2` from `test`.`t3` where (`test`.`t3`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`))))))) and (`test`.`t3`.`c2` > '0'))) union (select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where ((`test`.`t1i`.`a1` = `test`.`t2i`.`b1`) and (`test`.`t3i`.`c1` = `test`.`t2i`.`b1`) and (`test`.`t2i`.`b1` = `test`.`t2i`.`b1`) and (`test`.`t1i`.`a2` = `test`.`t2i`.`b2`) and (`test`.`t3i`.`c2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b2` = `test`.`t2i`.`b2`) and (`test`.`t2i`.`b1` > '0') and (`test`.`t2i`.`b2` > '0'))) (select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 where c2 LIKE '%02') or @@ -443,7 +443,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and (<cache>(`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and (<cache>(`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) where ((`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and (<cache>(`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and (<cache>(`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and (`test`.`t3`.`c2` > '0')) select * from t1 where (a1, a2) in (select * from t1 where a1 > '0' UNION select * from t2 where b1 < '9') and (a1, a2) in (select c1, c2 from t3 @@ -467,7 +467,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 5 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) join `test`.`t3` where ((`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and (`test`.`t3`.`c1` = `test`.`t1`.`a1`) and (`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and (<cache>(`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and (<cache>(`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and (`test`.`t3`.`c2` > '0')) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t3`.`c1` AS `c1`,`test`.`t3`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t2i` join `test`.`t3`) join `test`.`t3` where ((`test`.`t3`.`c1` = `test`.`t1`.`a1`) and (`test`.`t2i`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2i`.`b2` = `test`.`t3`.`c2`) and <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),<exists>(select `test`.`t1`.`a1`,`test`.`t1`.`a2` from `test`.`t1` where ((`test`.`t1`.`a1` > '0') and (<cache>(`test`.`t1`.`a1`) = `test`.`t1`.`a1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t1`.`a2`)) union select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where ((`test`.`t2`.`b1` < '9') and (<cache>(`test`.`t1`.`a1`) = `test`.`t2`.`b1`) and (<cache>(`test`.`t1`.`a2`) = `test`.`t2`.`b2`))))) and (`test`.`t3`.`c2` > '0')) select * from t1, t3 where (a1, a2) in (select * from t1 where a1 > '0' UNION select * from t2 where b1 < '9') and (c1, c2) in (select c1, c2 from t3 @@ -513,7 +513,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a2' of SELECT #6 was resolved in SELECT #1 -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where ((`test`.`t2i`.`b2` = `test`.`t1`.`a2`) and (`test`.`t3c`.`c2` = `test`.`t1`.`a2`) and (`test`.`t2`.`b2` = `test`.`t1`.`a2`) and (`test`.`t2i`.`b1` = `test`.`t1`.`a1`) and (`test`.`t3c`.`c1` = `test`.`t1`.`a1`) and (`test`.`t2`.`b1` = `test`.`t1`.`a1`) and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and (<cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`)))))))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where ((`test`.`t2i`.`b1` = `test`.`t1`.`a1`) and (`test`.`t3c`.`c1` = `test`.`t1`.`a1`) and (`test`.`t2`.`b1` = `test`.`t1`.`a1`) and (`test`.`t2i`.`b2` = `test`.`t1`.`a2`) and (`test`.`t3c`.`c2` = `test`.`t1`.`a2`) and (`test`.`t2`.`b2` = `test`.`t1`.`a2`) and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where ((`test`.`t3a`.`c1` = `test`.`t1`.`a1`) and (<cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where (`test`.`t3b`.`c2` like '%03') ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where ((`test`.`t2`.`b2` = `<subquery4>`.`c2`)))))))) explain extended select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -633,7 +633,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where ((`test`.`t2_16`.`b2` = `test`.`t1_16`.`a2`) and (`test`.`t2_16`.`b1` = `test`.`t1_16`.`a1`) and (`test`.`t1_16`.`a1` > '0')) +Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where ((`test`.`t2_16`.`b1` = `test`.`t1_16`.`a1`) and (`test`.`t2_16`.`b2` = `test`.`t1_16`.`a2`) and (`test`.`t1_16`.`a1` > '0')) select left(a1,7), left(a2,7) from t1_16 where (a1,a2) in (select b1, b2 from t2_16 where b1 > '0'); @@ -700,7 +700,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2_16` join `test`.`t2` join `test`.`t1_16`) where ((`test`.`t2_16`.`b2` = `test`.`t1_16`.`a2`) and (`test`.`t2_16`.`b1` = `test`.`t1_16`.`a1`) and (`test`.`t2`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2`.`b2` = substr(`test`.`t1_16`.`a2`,1,6)) and (`test`.`t3`.`c2` > '0') and (concat(`test`.`t1`.`a1`,'x') = left(`test`.`t1_16`.`a1`,8))) +Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2_16` join `test`.`t2` join `test`.`t1_16`) where ((`test`.`t2`.`b1` = `test`.`t3`.`c1`) and (`test`.`t2_16`.`b1` = `test`.`t1_16`.`a1`) and (`test`.`t2_16`.`b2` = `test`.`t1_16`.`a2`) and (`test`.`t2`.`b2` = substr(`test`.`t1_16`.`a2`,1,6)) and (`test`.`t3`.`c2` > '0') and (concat(`test`.`t1`.`a1`,'x') = left(`test`.`t1_16`.`a1`,8))) drop table t1_16, t2_16, t3_16; set @blob_len = 512; set @suffix_len = @blob_len - @prefix_len; @@ -748,7 +748,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where ((`test`.`t2_512`.`b2` = `test`.`t1_512`.`a2`) and (`test`.`t2_512`.`b1` = `test`.`t1_512`.`a1`) and (`test`.`t1_512`.`a1` > '0')) +Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where ((`test`.`t2_512`.`b1` = `test`.`t1_512`.`a1`) and (`test`.`t2_512`.`b2` = `test`.`t1_512`.`a2`) and (`test`.`t1_512`.`a1` > '0')) select left(a1,7), left(a2,7) from t1_512 where (a1,a2) in (select b1, b2 from t2_512 where b1 > '0'); @@ -844,7 +844,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where ((`test`.`t2_1024`.`b2` = `test`.`t1_1024`.`a2`) and (`test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1`) and (`test`.`t1_1024`.`a1` > '0')) +Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where ((`test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1`) and (`test`.`t2_1024`.`b2` = `test`.`t1_1024`.`a2`) and (`test`.`t1_1024`.`a1` > '0')) select left(a1,7), left(a2,7) from t1_1024 where (a1,a2) in (select b1, b2 from t2_1024 where b1 > '0'); @@ -939,7 +939,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where ((`test`.`t2_1025`.`b2` = `test`.`t1_1025`.`a2`) and (`test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1`) and (`test`.`t1_1025`.`a1` > '0')) +Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where ((`test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1`) and (`test`.`t2_1025`.`b2` = `test`.`t1_1025`.`a2`) and (`test`.`t1_1025`.`a1` > '0')) select left(a1,7), left(a2,7) from t1_1025 where (a1,a2) in (select b1, b2 from t2_1025 where b1 > '0'); @@ -1027,7 +1027,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1bb ALL NULL NULL NULL NULL 3 100.00 1 PRIMARY t2bb ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) Warnings: -Note 1003 select conv(`test`.`t1bb`.`a1`,10,2) AS `bin(a1)`,`test`.`t1bb`.`a2` AS `a2` from `test`.`t1bb` semi join (`test`.`t2bb`) where ((`test`.`t2bb`.`b2` = `test`.`t1bb`.`a2`) and (`test`.`t2bb`.`b1` = `test`.`t1bb`.`a1`)) +Note 1003 select conv(`test`.`t1bb`.`a1`,10,2) AS `bin(a1)`,`test`.`t1bb`.`a2` AS `a2` from `test`.`t1bb` semi join (`test`.`t2bb`) where ((`test`.`t2bb`.`b1` = `test`.`t1bb`.`a1`) and (`test`.`t2bb`.`b2` = `test`.`t1bb`.`a2`)) select bin(a1), a2 from t1bb where (a1, a2) in (select b1, b2 from t2bb); @@ -1934,7 +1934,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (`test`.`t1`.`b` = 7) and (<cache>(isnull(`<subquery2>`.`MAX(c)`)) or (`<subquery2>`.`MAX(c)` = 7))) +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t2`.`c`) from `test`.`t2`) join `test`.`t1` where ((`test`.`t1`.`b` = 7) and (`test`.`t1`.`a` = `<subquery2>`.`MAX(c)`) and (<cache>(isnull(`<subquery2>`.`MAX(c)`)) or (`<subquery2>`.`MAX(c)` = 7))) SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); a b diff --git a/mysql-test/r/sum_distinct-big.result b/mysql-test/r/sum_distinct-big.result index d4933b31f80..2d350826ac8 100644 --- a/mysql-test/r/sum_distinct-big.result +++ b/mysql-test/r/sum_distinct-big.result @@ -1,4 +1,8 @@ DROP TABLE IF EXISTS t1, t2; +set @save_tmp_table_size=@@tmp_table_size; +set @save_max_heap_table_size=@@max_heap_table_size; +set @save_storage_engine=@@storage_engine; +set storage_engine=MYISAM; CREATE TABLE t1 (id INTEGER); CREATE TABLE t2 (id INTEGER); INSERT INTO t1 (id) VALUES (1), (1), (1),(1); @@ -120,3 +124,57 @@ sm 536887296 DROP TABLE t1; DROP TABLE t2; +SET @@tmp_table_size=@save_tmp_table_size; +SET @@max_heap_table_size=@save_max_heap_table_size; +# +# Bug mdev-4311: COUNT(DISTINCT...) requiring a file for Unique +# (bug #68749) +# +set @save_storage_engine=@@storage_engine; +set storage_engine=INNODB; +CREATE TABLE t1 (id INTEGER) ENGINE=InnoDB; +CREATE TABLE t2 (id INTEGER) ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (1), (1), (1),(1); +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 SELECT id+1 FROM t1; +INSERT INTO t1 SELECT id+2 FROM t1; +INSERT INTO t1 SELECT id+4 FROM t1; +INSERT INTO t1 SELECT id+8 FROM t1; +INSERT INTO t1 SELECT id+16 FROM t1; +INSERT INTO t1 SELECT id+32 FROM t1; +INSERT INTO t1 SELECT id+64 FROM t1; +INSERT INTO t1 SELECT id+128 FROM t1; +INSERT INTO t1 SELECT id+256 FROM t1; +INSERT INTO t1 SELECT id+512 FROM t1; +INSERT INTO t1 SELECT id+1024 FROM t1; +INSERT INTO t1 SELECT id+2048 FROM t1; +INSERT INTO t1 SELECT id+4096 FROM t1; +INSERT INTO t1 SELECT id+8192 FROM t1; +INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand(); +INSERT INTO t2 VALUE(NULL); +# With default tmp_table_size / max_heap_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; +sm +16384 +set @@tmp_table_size=1024*256; +# With reduced tmp_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; +sm +16384 +set @@tmp_table_size=@save_tmp_table_size; +SET @@max_heap_table_size=1024*256; +# With reduced max_heap_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; +sm +16384 +SET @@max_heap_table_size=@save_max_heap_table_size; +# Back to default tmp_table_size / max_heap_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; +sm +16384 +DROP TABLE t1,t2; +set storage_engine=@save_storage_engine; diff --git a/mysql-test/r/temporal_scale_4283.result b/mysql-test/r/temporal_scale_4283.result new file mode 100644 index 00000000000..685a6192a97 --- /dev/null +++ b/mysql-test/r/temporal_scale_4283.result @@ -0,0 +1,12 @@ +create table t1 (a int); +insert into t1 values (4),(8); +select distinct 100 mod timestampadd( week, a, '2002-05-20' ) from t1; +100 mod timestampadd( week, a, '2002-05-20' ) +100 +drop table t1; +create table t1 (i int); +insert into t1 values (2),(4); +select distinct convert_tz( '2001-03-21', 'utc', 'met' ) mod i from t1; +convert_tz( '2001-03-21', 'utc', 'met' ) mod i +0 +drop table t1; diff --git a/mysql-test/r/truncate_badse.result b/mysql-test/r/truncate_badse.result new file mode 100644 index 00000000000..16f44f180ed --- /dev/null +++ b/mysql-test/r/truncate_badse.result @@ -0,0 +1,13 @@ +install plugin example soname 'ha_example'; +create table t1 (a int) engine=example; +select 1; +1 +1 +uninstall plugin example; +flush tables; +select count(*) from information_schema.plugins where plugin_name='example'; +count(*) +0 +truncate table t1; +ERROR 42000: Unknown storage engine 'EXAMPLE' +drop table t1; diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 8a85cd53b2a..2d4a290751f 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -136,7 +136,7 @@ select @d:=1311; 1311 select year(@d), month(@d), day(@d), cast(@d as date); year(@d) month(@d) day(@d) cast(@d as date) -NULL NULL NULL NULL +0 0 0 0000-00-00 Warnings: Warning 1292 Incorrect datetime value: '1311' Warning 1292 Incorrect datetime value: '1311' diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 811fbacaf59..05cdcf7e256 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -573,7 +573,7 @@ CAST('NULL' AS DATE) < CAST('2008-01-01' AS DATE) n7, CAST('2008-01-01' AS DATE) < CAST('NULL' AS DATE) n8, CAST('NULL' AS DATE) < CAST('NULL' AS DATE) n9; n1 n2 n3 n4 n5 n6 n7 n8 n9 -0 0 1 NULL NULL NULL NULL NULL NULL +0 0 1 1 1 0 1 0 0 Warnings: Warning 1292 Incorrect datetime value: 'NULL' Warning 1292 Incorrect datetime value: 'NULL' @@ -585,6 +585,8 @@ Warning 1292 Incorrect datetime value: 'NULL' Warning 1292 Incorrect datetime value: 'NULL' Warning 1292 Incorrect datetime value: 'NULL' Warning 1292 Incorrect datetime value: 'NULL' +Warning 1292 Incorrect datetime value: 'NULL' +Warning 1292 Incorrect datetime value: 'NULL' End of 5.0 tests set @org_mode=@@sql_mode; create table t1 (da date default '1962-03-03 23:33:34', dt datetime default '1962-03-03'); @@ -651,6 +653,19 @@ SELECT * FROM t1; dt1 DROP TABLE t1; End of 5.1 tests +create table t1 (d date, t time) engine=myisam; +insert into t1 values ('2000-12-03','22:55:23'),('2008-05-03','10:19:31'); +select case when d = '2012-12-12' then d else t end as cond, group_concat( d ) from t1 group by cond; +cond group_concat( d ) +0000-00-00 00:00:00 2000-12-03 +0000-00-00 00:00:00 2008-05-03 +Warnings: +Warning 1292 Incorrect datetime value: '22:55:23' +Warning 1292 Incorrect datetime value: '10:19:31' +Warning 1292 Incorrect datetime value: '22:55:23' +Warning 1292 Incorrect datetime value: '10:19:31' +drop table t1; +End of 5.3 tests # # Start of 5.5 tests # diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 813f912c5af..d373d14c089 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1854,3 +1854,18 @@ a DROP TABLE t1; End of 5.1 tests +# +# MDEV-4241: Assertion failure: scale >= 0 && precision > 0 && +# scale <= precision in decimal_bin_size +# +CREATE TABLE t1 ( +f1 enum('1','2','3','4','5') +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +SELECT AVG(f1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def AVG(f1) 246 7 6 Y 32896 4 63 +AVG(f1) +1.5000 +drop table t1; +End of 5.3 tests diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result index ec63cc0d98c..d565bb2dbd6 100644 --- a/mysql-test/r/upgrade.result +++ b/mysql-test/r/upgrade.result @@ -33,26 +33,28 @@ show create database `#mysql50#mysqltest-1`; ERROR 42000: Unknown database '#mysql50#mysqltest-1' show tables in `mysqltest1`; Tables_in_mysqltest1 -t1 t-1 +t1 show tables in `mysqltest-1`; Tables_in_mysqltest-1 -t1 t-1 +t1 drop database `mysqltest1`; drop database `mysqltest-1`; -drop table if exists `txu@0023p@0023p1`; -drop table if exists `txu#p#p1`; create table `txu#p#p1` (s1 int); insert into `txu#p#p1` values (1); select * from `txu@0023p@0023p1`; ERROR 42S02: Table 'test.txu@0023p@0023p1' doesn't exist create table `txu@0023p@0023p1` (s1 int); -ERROR 42S01: Table '#mysql50#txu@0023p@0023p1' already exists +show tables; +Tables_in_test +txu#p#p1 +txu@0023p@0023p1 select * from `txu#p#p1`; s1 1 drop table `txu#p#p1`; +drop table `txu@0023p@0023p1`; # # Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1 # diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 27a0d7f0a1b..f428d460d39 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/r/user_var.result b/mysql-test/r/user_var.result index 6cbbe934bde..78ed5bb65d5 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -461,8 +461,42 @@ GROUP BY @b:=(SELECT COUNT(*) > t2.a); @a:=MIN(t1.a) 1 DROP TABLE t1; +SET @bug12408412=1; +SELECT GROUP_CONCAT(@bug12408412 ORDER BY 1) INTO @bug12408412; End of 5.1 tests -DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0); +SELECT DISTINCT POW(COUNT(*), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a)) +AS b FROM t1 GROUP BY a; +b +1 +SELECT @a; +@a +1 +DROP TABLE t1; +CREATE TABLE t1(f1 INT, f2 INT); +INSERT INTO t1 VALUES (1,2),(2,3),(3,1); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (1); +SET @var=NULL; +SELECT @var:=(SELECT f2 FROM t2 WHERE @var) FROM t1 GROUP BY f1 ORDER BY f2 DESC +LIMIT 1; +@var:=(SELECT f2 FROM t2 WHERE @var) +NULL +SELECT @var; +@var +NULL +DROP TABLE t1, t2; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0),(1),(3); +SELECT DISTINCT POW(COUNT(distinct a), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a limit 1)) AS b FROM t1 GROUP BY a; +b +1 +SELECT @a; +@a +1 +DROP TABLE t1; +End of 5.2 tests CREATE TABLE t1(f1 INT AUTO_INCREMENT, PRIMARY KEY(f1)); INSERT INTO t1 SET f1 = NULL ; SET @aux = NULL ; @@ -530,9 +564,9 @@ SELECT @a; @a 1 DROP TABLE t1; +End of 5.5 tests # # Check that used memory extends if we set a variable # set @var= repeat('a',20000); 1 -End of 5.5 tests diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 29986344f88..bba63e73c56 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1483,16 +1483,6 @@ SELECT @@GLOBAL.server_id; @@GLOBAL.server_id 0 SET GLOBAL server_id = @old_server_id; -SELECT @@GLOBAL.INIT_CONNECT, @@GLOBAL.INIT_CONNECT IS NULL; -@@GLOBAL.INIT_CONNECT @@GLOBAL.INIT_CONNECT IS NULL - 1 -CREATE TABLE t1 (a INT); -INSERT INTO t1 VALUES (); -SET @bug42778= @@sql_safe_updates; -SET @@sql_safe_updates= 0; -DELETE FROM t1 ORDER BY (@@GLOBAL.INIT_CONNECT) ASC LIMIT 10; -SET @@sql_safe_updates= @bug42778; -DROP TABLE t1; # # BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB always rollsback # diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 1e5e91b272c..ef4bcc33c48 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1423,7 +1423,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join `test`.`t2` on(((`test`.`t1`.`a` = `test`.`t3`.`a`) and (`test`.`t2`.`a` = `test`.`t3`.`a`)))) on((`test`.`t1`.`a` = `test`.`t3`.`a`)) where 1 +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join `test`.`t2` on((`test`.`t2`.`a` = `test`.`t3`.`a`))) on((`test`.`t1`.`a` = `test`.`t3`.`a`)) where 1 create view v1 (a) as select a from t1; create view v2 (a) as select a from t2; create view v4 (a,b) as select v1.a as a, v2.a as b from v1 left join v2 on (v1.a=v2.a); @@ -1438,7 +1438,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join (`test`.`t2`) on(((`test`.`t1`.`a` = `test`.`t3`.`a`) and (`test`.`t2`.`a` = `test`.`t3`.`a`)))) on((`test`.`t1`.`a` = `test`.`t3`.`a`)) where 1 +Note 1003 select `test`.`t3`.`a` AS `a`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `b` from `test`.`t3` left join (`test`.`t1` left join (`test`.`t2`) on((`test`.`t2`.`a` = `test`.`t3`.`a`))) on((`test`.`t1`.`a` = `test`.`t3`.`a`)) where 1 prepare stmt1 from "select * from t3 left join v4 on (t3.a = v4.a);"; execute stmt1; a a b diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result index dc624a07f4f..d0cdd858d4a 100644 --- a/mysql-test/r/windows.result +++ b/mysql-test/r/windows.result @@ -16,7 +16,7 @@ CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES (1,1); EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used DROP TABLE t1; CREATE DATABASE `TESTDB`; diff --git a/mysql-test/suite/archive/archive.result b/mysql-test/suite/archive/archive.result index 98608a95f37..a491b5bb9ee 100644 --- a/mysql-test/suite/archive/archive.result +++ b/mysql-test/suite/archive/archive.result @@ -6257,7 +6257,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6 3 011402 37 Romans scholastics jarring 4 011403 37 intercepted audiology tinily DELETE FROM t2; -ERROR HY000: Table storage engine for 't2' doesn't have this option +ERROR HY000: Storage engine ARCHIVE of the table `test`.`t2` doesn't have this option SELECT * FROM t2; auto fld1 companynr fld3 fld4 fld5 fld6 1 000001 00 Omaha teethe neat @@ -8689,7 +8689,7 @@ auto fld1 companynr fld3 fld4 fld5 fld6 3 011402 37 Romans scholastics jarring 4 011403 37 intercepted audiology tinily TRUNCATE TABLE t2; -ERROR HY000: Table storage engine for 't2' doesn't have this option +ERROR HY000: Storage engine ARCHIVE of the table `test`.`t2` doesn't have this option SELECT * FROM t2; auto fld1 companynr fld3 fld4 fld5 fld6 1 000001 00 Omaha teethe neat @@ -12701,12 +12701,12 @@ CREATE TABLE t1(a INT, b BLOB) ENGINE=archive; SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; DATA_LENGTH AVG_ROW_LENGTH -8666 15 +550 15 INSERT INTO t1 VALUES(1, 'sampleblob1'),(2, 'sampleblob2'); SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; DATA_LENGTH AVG_ROW_LENGTH -8700 4350 +584 292 DROP TABLE t1; SET @save_join_buffer_size= @@join_buffer_size; SET @@join_buffer_size= 8192; @@ -12749,21 +12749,12 @@ SELECT * FROM t1; col1 col2 DROP TABLE t1; # -# BUG#48757 - missing .ARZ file causes server crash -# -CREATE TABLE t1(a INT) ENGINE=ARCHIVE; -FLUSH TABLE t1; -SELECT * FROM t1; -ERROR HY000: Can't find file: 't1' (errno: 2 "No such file or directory") -DROP TABLE t1; -ERROR 42S02: Unknown table 't1' -# # Ensure that TRUNCATE fails for non-empty archive tables. # CREATE TABLE t1 (a INT) ENGINE=ARCHIVE; INSERT INTO t1 VALUES (1); TRUNCATE TABLE t1; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine ARCHIVE of the table `test`.`t1` doesn't have this option DROP TABLE t1; # # BUG#46565 - repair of partition fail for archive engine @@ -12785,38 +12776,6 @@ a 2 DROP TABLE t1; # -# Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE -# -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (a int) ENGINE=ARCHIVE; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -INSERT INTO t1 VALUES (1); -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize status OK -FLUSH TABLES; -INSERT INTO t1 VALUES (2); -SELECT * FROM t1 ORDER BY a; -a -1 -2 -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 -DROP TABLE t1; -# -# BUG#58205 - Valgrind failure in fn_format when called from -# archive_discover -# -CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE; -DROP TABLE `a/../`; -# # BUG#57162 - valgrind errors, random data when returning # ordered data from archive tables # @@ -12856,9 +12815,37 @@ DROP TABLE t1; # create table t1 (a int, b char(50)) engine=archive; select * from t1; +a b +flush tables; +select * from t1; ERROR HY000: Table 't1' is marked as crashed and should be repaired show warnings; Level Code Message Warning 127 Got error 127 when reading table `test`.`t1` Error 1194 Table 't1' is marked as crashed and should be repaired drop table t1; +create temporary table t1 (a int) engine=archive; +insert t1 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +show create table t1; +Table Create Table +t1 CREATE TEMPORARY TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +alter table t1 add column b varchar(10); +select * from t1; +a b +1 NULL +2 NULL +3 NULL +show create table t1; +Table Create Table +t1 CREATE TEMPORARY TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 DELAY_KEY_WRITE=1 +drop table t1; diff --git a/mysql-test/suite/archive/archive.test b/mysql-test/suite/archive/archive.test index 5dd85bf1aba..1114eb4e89a 100644 --- a/mysql-test/suite/archive/archive.test +++ b/mysql-test/suite/archive/archive.test @@ -3,7 +3,6 @@ # Taken FROM the select test # -- source include/have_archive.inc --- source include/have_binlog_format_mixed_or_statement.inc CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired"); @@ -1670,17 +1669,6 @@ DROP TABLE t1; remove_file $MYSQLD_DATADIR/test/t1.ARM; --echo # ---echo # BUG#48757 - missing .ARZ file causes server crash ---echo # -CREATE TABLE t1(a INT) ENGINE=ARCHIVE; -FLUSH TABLE t1; ---remove_file $MYSQLD_DATADIR/test/t1.ARZ ---error ER_FILE_NOT_FOUND -SELECT * FROM t1; ---error ER_BAD_TABLE_ERROR -DROP TABLE t1; - ---echo # --echo # Ensure that TRUNCATE fails for non-empty archive tables. --echo # CREATE TABLE t1 (a INT) ENGINE=ARCHIVE; @@ -1713,34 +1701,6 @@ SELECT * FROM t1; DROP TABLE t1; --echo # ---echo # Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE ---echo # - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1 (a int) ENGINE=ARCHIVE; -SHOW CREATE TABLE t1; -INSERT INTO t1 VALUES (1); -OPTIMIZE TABLE t1; -let $MYSQLD_DATADIR= `select @@datadir`; -remove_file $MYSQLD_DATADIR/test/t1.frm; -FLUSH TABLES; -INSERT INTO t1 VALUES (2); -SELECT * FROM t1 ORDER BY a; -SHOW CREATE TABLE t1; -DROP TABLE t1; - ---echo # ---echo # BUG#58205 - Valgrind failure in fn_format when called from ---echo # archive_discover ---echo # -CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE; -remove_file $MYSQLD_DATADIR/test/a@002f@002e@002e@002f.frm; -DROP TABLE `a/../`; - ---echo # --echo # BUG#57162 - valgrind errors, random data when returning --echo # ordered data from archive tables --echo # @@ -1774,9 +1734,24 @@ DROP TABLE t1; --echo # BUG#917689 Using wrong archive table causes crash --echo # create table t1 (a int, b char(50)) engine=archive; +select * from t1; # open the table to create the frm +flush tables; # and close the table again --remove_file $MYSQLD_DATADIR/test/t1.ARZ copy_file std_data/t917689.ARZ $MYSQLD_DATADIR/test/t1.ARZ; ---error 1194 +--error ER_CRASHED_ON_USAGE select * from t1; show warnings; drop table t1; + +# +# temporary archive +# +create temporary table t1 (a int) engine=archive; +insert t1 values (1),(2),(3); +select * from t1; +show create table t1; +alter table t1 add column b varchar(10); +select * from t1; +show create table t1; +drop table t1; + diff --git a/mysql-test/suite/archive/discover.result b/mysql-test/suite/archive/discover.result new file mode 100644 index 00000000000..59e79664eb6 --- /dev/null +++ b/mysql-test/suite/archive/discover.result @@ -0,0 +1,125 @@ +create table t1 (a int) engine=archive; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +insert t1 values (1); +show tables; +Tables_in_test +t1 +# +# simple discover on use +# +flush tables; +insert t1 values (2); +select * from t1; +a +1 +2 +t1.ARZ +t1.frm +# +# show tables +# +create table t2 (a int) engine=archive; +select * from t2; +a +flush tables; +show tables; +Tables_in_test +t1 +t2 +t1.ARZ +t2.ARZ +t2.frm +# +# show full tables +# +flush tables; +show full tables; +Tables_in_test Table_type +t1 BASE TABLE +t2 BASE TABLE +t1.ARZ +t2.ARZ +t2.frm +# +# discover on truncate +# +flush tables; +truncate table t1; +ERROR HY000: Storage engine ARCHIVE of the table `test`.`t1` doesn't have this option +t1.ARZ +t1.frm +t2.ARZ +t2.frm +# +# discover on rename +# +flush tables; +rename table t2 to t0; +t0.ARZ +t1.ARZ +t1.frm +# +# discover on HA_ERR_TABLE_DEF_CHANGED +# +alter table t1 modify a int default 5; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +# +# discover on drop +# +flush tables; +drop table t1; +t0.ARZ +# +# discover of table non-existance on drop +# +select * from t0; +a +flush tables; +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist +drop table t0; +show status like 'Handler_discover'; +Variable_name Value +Handler_discover 7 +# +# Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE +# +create table t1 (a int) engine=archive; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +insert into t1 values (1); +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +flush tables; +insert into t1 values (2); +select * from t1 order by a; +a +1 +2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +drop table t1; +# +# BUG#58205 - Valgrind failure in fn_format when called from +# archive_discover +# +create table `a/../`(a int) engine=archive; +select * from `a/../`; +a +flush tables; +drop table `a/../`; diff --git a/mysql-test/suite/archive/discover.test b/mysql-test/suite/archive/discover.test new file mode 100644 index 00000000000..0b7e521185d --- /dev/null +++ b/mysql-test/suite/archive/discover.test @@ -0,0 +1,104 @@ +-- source include/have_archive.inc +let $mysqld_datadir= `select @@datadir`; + +create table t1 (a int) engine=archive; +show create table t1; +insert t1 values (1); +show tables; + +--echo # +--echo # simple discover on use +--echo # +remove_file $mysqld_datadir/test/t1.frm; +flush tables; +insert t1 values (2); +select * from t1; +--list_files $mysqld_datadir/test + +--echo # +--echo # show tables +--echo # +create table t2 (a int) engine=archive; +select * from t2; +remove_file $mysqld_datadir/test/t1.frm; +flush tables; +show tables; +--list_files $mysqld_datadir/test + +--echo # +--echo # show full tables +--echo # +flush tables; +show full tables; +--list_files $mysqld_datadir/test + +--echo # +--echo # discover on truncate +--echo # +flush tables; +--error ER_ILLEGAL_HA +truncate table t1; +--list_files $mysqld_datadir/test + +--echo # +--echo # discover on rename +--echo # +remove_file $mysqld_datadir/test/t2.frm; +flush tables; +rename table t2 to t0; +--list_files $mysqld_datadir/test + +--echo # +--echo # discover on HA_ERR_TABLE_DEF_CHANGED +--echo # +copy_file $mysqld_datadir/test/t1.ARZ $MYSQL_TMP_DIR/t1.ARZ; +alter table t1 modify a int default 5; +remove_file $mysqld_datadir/test/t1.ARZ; +copy_file $MYSQL_TMP_DIR/t1.ARZ $mysqld_datadir/test/t1.ARZ; +remove_file $MYSQL_TMP_DIR/t1.ARZ; +show create table t1; + +--echo # +--echo # discover on drop +--echo # +remove_file $mysqld_datadir/test/t1.frm; +flush tables; +drop table t1; +--list_files $mysqld_datadir/test + +--echo # +--echo # discover of table non-existance on drop +--echo # +select * from t0; +remove_file $mysqld_datadir/test/t0.ARZ; +flush tables; +--error ER_NO_SUCH_TABLE +select * from t1; +drop table t0; +--list_files $mysqld_datadir/test +show status like 'Handler_discover'; + +--echo # +--echo # Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE +--echo # + +create table t1 (a int) engine=archive; +show create table t1; +insert into t1 values (1); +optimize table t1; +remove_file $mysqld_datadir/test/t1.frm; +flush tables; +insert into t1 values (2); +select * from t1 order by a; +show create table t1; +drop table t1; + +--echo # +--echo # BUG#58205 - Valgrind failure in fn_format when called from +--echo # archive_discover +--echo # +create table `a/../`(a int) engine=archive; +select * from `a/../`; flush tables; +remove_file $mysqld_datadir/test/a@002f@002e@002e@002f.frm; +drop table `a/../`; + diff --git a/mysql-test/suite/archive/partition_archive.result b/mysql-test/suite/archive/partition_archive.result index 186a7930251..7b3c01694da 100644 --- a/mysql-test/suite/archive/partition_archive.result +++ b/mysql-test/suite/archive/partition_archive.result @@ -15,10 +15,10 @@ ENGINE = ARCHIVE; INSERT INTO t1 VALUES(CURRENT_DATE); SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; DATA_LENGTH INDEX_LENGTH -8658 0 +535 0 SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; DATA_LENGTH INDEX_LENGTH -8658 0 +535 0 DROP TABLE t1; drop database if exists db99; drop table if exists t1; @@ -30,6 +30,7 @@ partition by list (a) (partition p0 values in (1), partition p1 values in (2)); insert into t1 values (1), (2); create index inx on t1 (a); +ERROR HY000: Can't create table `db99`.`#sql-temporary` (errno: 1 "Operation not permitted") alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; diff --git a/mysql-test/suite/archive/partition_archive.test b/mysql-test/suite/archive/partition_archive.test index 6f6a26c018a..be2abeada73 100644 --- a/mysql-test/suite/archive/partition_archive.test +++ b/mysql-test/suite/archive/partition_archive.test @@ -47,7 +47,8 @@ engine=archive partition by list (a) (partition p0 values in (1), partition p1 values in (2)); insert into t1 values (1), (2); ---error 0, ER_CANT_CREATE_TABLE +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ /Not owner/Operation not permitted/ +--error ER_CANT_CREATE_TABLE create index inx on t1 (a); alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; 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_checkpoint.result b/mysql-test/suite/binlog/r/binlog_checkpoint.result index 02fa8c12310..44fa80d620f 100644 --- a/mysql-test/suite/binlog/r/binlog_checkpoint.result +++ b/mysql-test/suite/binlog/r/binlog_checkpoint.result @@ -89,6 +89,22 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION master-bin.000003 # Binlog_checkpoint # # master-bin.000001 master-bin.000003 # Binlog_checkpoint # # master-bin.000003 +*** MDEV-4322: Broken XID counting during binlog rotation *** +SET @old_dbug= @@global.DEBUG_DBUG; +SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done"; +FLUSH LOGS; +INSERT INTO t1 VALUES (30, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR injected_binlog_background_thread"; +SET GLOBAL debug_dbug= @old_dbug; +INSERT INTO t1 VALUES (31, REPEAT("x", 4100)); +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +master-bin.000005 # +master-bin.000006 # DROP TABLE t1, t2; SET GLOBAL max_binlog_size= @old_max_binlog_size; SET GLOBAL innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result index bf65bab602d..9824707a8c0 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 /*!*/; @@ -701,8 +722,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 /*!*/; @@ -771,8 +794,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 /*!*/; @@ -813,8 +838,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 /*!*/; @@ -885,8 +912,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 /*!*/; @@ -954,8 +983,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 /*!*/; @@ -1002,8 +1033,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 /*!*/; @@ -1044,8 +1077,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 /*!*/; @@ -1069,8 +1104,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 /*!*/; @@ -1118,8 +1155,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 /*!*/; @@ -1160,8 +1199,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 /*!*/; @@ -1253,8 +1294,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 /*!*/; @@ -1343,8 +1386,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 /*!*/; @@ -1412,8 +1457,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 /*!*/; @@ -1486,8 +1533,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 /*!*/; @@ -1556,8 +1605,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 /*!*/; @@ -1598,8 +1649,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 /*!*/; @@ -1680,6 +1733,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 8f481b25251..4fcb0fca9c0 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 /*!*/; @@ -4137,3 +4138,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 3227ad3d661..dd09a398922 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 /*!*/; @@ -3788,6 +3789,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. # @@ -3870,6 +3872,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 /*!*/; @@ -4081,6 +4084,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. # @@ -4239,6 +4243,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 /*!*/; @@ -4752,6 +4757,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. # @@ -4802,6 +4808,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 /*!*/; @@ -4861,6 +4868,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 8338e48459a..66f4cce5f05 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 /*!*/; @@ -3810,6 +3811,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. # @@ -3892,6 +3894,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 /*!*/; @@ -4109,6 +4112,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. # @@ -4267,6 +4271,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 /*!*/; @@ -4790,6 +4795,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. # @@ -4840,6 +4846,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 /*!*/; @@ -4901,6 +4908,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 f2f1ed00431..fc356a9ace3 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 /*!*/; @@ -465,6 +466,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_old_versions.result b/mysql-test/suite/binlog/r/binlog_old_versions.result index a4850b835c8..169a23b2019 100644 --- a/mysql-test/suite/binlog/r/binlog_old_versions.result +++ b/mysql-test/suite/binlog/r/binlog_old_versions.result @@ -38,21 +38,6 @@ SELECT COUNT(*) FROM t3; COUNT(*) 17920 DROP TABLE t1, t3; -==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== -SELECT * FROM t1 ORDER BY a; -a b -0 last_insert_id -1 one -3 last stm in trx: next event should be xid -4 four -781729 random -SELECT * FROM t2 ORDER BY a; -a b -3 first stm in trx -SELECT COUNT(*) FROM t3; -COUNT(*) -17920 -DROP TABLE t1, t2, t3; ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ==== SELECT * FROM t1 ORDER BY a; a b diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result index 8b9ccee7a93..5df4a0af16f 100644 --- a/mysql-test/suite/binlog/r/binlog_row_annotate.result +++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result @@ -61,6 +61,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 /*!*/; @@ -283,12 +284,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 /*!*/; @@ -430,11 +433,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 /*!*/; @@ -643,6 +648,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 @@ -653,6 +659,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 /*!*/; @@ -875,12 +882,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 /*!*/; @@ -1022,11 +1031,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 /*!*/; @@ -1230,3 +1241,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 733e5e1c0ab..4e107c087ef 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 f2dedaa633a..6973985e6c3 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 /*!*/; @@ -217,6 +218,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 @@ -224,6 +226,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 /*!*/; @@ -413,6 +416,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 cfeca4811cb..506c1e4ed53 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/binlog/std_data/ver_5_1-wl2325_r.001 b/mysql-test/suite/binlog/std_data/ver_5_1-wl2325_r.001 Binary files differdeleted file mode 100644 index 47071c011f9..00000000000 --- a/mysql-test/suite/binlog/std_data/ver_5_1-wl2325_r.001 +++ /dev/null diff --git a/mysql-test/suite/binlog/std_data/ver_5_1-wl2325_s.001 b/mysql-test/suite/binlog/std_data/ver_5_1-wl2325_s.001 Binary files differdeleted file mode 100644 index 4302bfed879..00000000000 --- a/mysql-test/suite/binlog/std_data/ver_5_1-wl2325_s.001 +++ /dev/null diff --git a/mysql-test/suite/binlog/t/binlog_checkpoint.test b/mysql-test/suite/binlog/t/binlog_checkpoint.test index 8c84e51c4df..4fa40b23547 100644 --- a/mysql-test/suite/binlog/t/binlog_checkpoint.test +++ b/mysql-test/suite/binlog/t/binlog_checkpoint.test @@ -113,8 +113,33 @@ connection default; --source include/show_binlog_events.inc -# Cleanup +--echo *** MDEV-4322: Broken XID counting during binlog rotation *** + +# Test that binlog shutdown waits for any pending binlog checkpoints to have time to complete. + connection default; +# We will use debug_sync to setup a wait inside the background processing +# of binlog checkpoints. The wait is newer resumed, and will eventually +# time out. If server shutdown does not wait for checkpoint processing to +# complete, we will get an assert. +# +# It is a bit tricky to inject the wait properly as it has to happen in a +# background thread during shutdown. So we first inject a DBUG to set the +# debug_sync wait in the correct thread, then wait to be signalled that +# the inject happened so that we can remove it again from DBUG (else +# check_testcase will complain). + +SET @old_dbug= @@global.DEBUG_DBUG; +SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done"; + +FLUSH LOGS; +INSERT INTO t1 VALUES (30, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR injected_binlog_background_thread"; +SET GLOBAL debug_dbug= @old_dbug; +INSERT INTO t1 VALUES (31, REPEAT("x", 4100)); +--source include/show_binary_logs.inc + + DROP TABLE t1, t2; SET GLOBAL max_binlog_size= @old_max_binlog_size; SET GLOBAL innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/binlog/t/binlog_old_versions.test b/mysql-test/suite/binlog/t/binlog_old_versions.test index b294adbc69d..77b3db31983 100644 --- a/mysql-test/suite/binlog/t/binlog_old_versions.test +++ b/mysql-test/suite/binlog/t/binlog_old_versions.test @@ -64,25 +64,6 @@ SELECT COUNT(*) FROM t3; DROP TABLE t1, t3; ---echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== - -# In this version, it was not possible to switch between row-based and -# statement-based binlogging without restarting the server. So, we -# have two binlogs; one for row based and one for statement based -# replication. - -# Read rbr binlog. ---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-wl2325_r.001 | $MYSQL --local-infile=1 -# Read stm binlog. ---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-wl2325_s.001 | $MYSQL --local-infile=1 -# Show result. -SELECT * FROM t1 ORDER BY a; -SELECT * FROM t2 ORDER BY a; -SELECT COUNT(*) FROM t3; -# Reset. -DROP TABLE t1, t2, t3; - - --echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ==== # Read binlog. diff --git a/mysql-test/suite/csv/csv.result b/mysql-test/suite/csv/csv.result index d81cf6e28bc..be8ffa8f9e5 100644 --- a/mysql-test/suite/csv/csv.result +++ b/mysql-test/suite/csv/csv.result @@ -5379,7 +5379,7 @@ ERROR 42000: The storage engine for the table doesn't support nullable columns SHOW WARNINGS; Level Code Message Error 1178 The storage engine for the table doesn't support nullable columns -Error 1005 Can't create table 'test.t1' (errno: 138 "Unsupported extension used for table") +Error 1005 Can't create table `test`.`t1` (errno: 138 "Unsupported extension used for table") create table t1 (c1 tinyblob not null) engine=csv; insert into t1 values("This"); update t1 set c1="That" where c1="This"; 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/federated/assisted_discovery.result b/mysql-test/suite/federated/assisted_discovery.result new file mode 100644 index 00000000000..7a351b9df6f --- /dev/null +++ b/mysql-test/suite/federated/assisted_discovery.result @@ -0,0 +1,37 @@ +CREATE DATABASE federated; +CREATE DATABASE federated; +CREATE TABLE t1 ( +`id` int(20) primary key, +`group` int NOT NULL default 1, +`a\\b` int NOT NULL default 2, +`a\\` int unsigned, +`name` varchar(32) default 'name') +DEFAULT CHARSET=latin1; +CREATE TABLE t1 ENGINE=FEDERATED +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(20) NOT NULL, + `group` int(11) NOT NULL DEFAULT '1', + `a\\b` int(11) NOT NULL DEFAULT '2', + `a\\` int(10) unsigned DEFAULT NULL, + `name` varchar(32) DEFAULT 'name', + PRIMARY KEY (`id`) +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1' +INSERT INTO t1 (id, name) VALUES (1, 'foo'); +INSERT INTO t1 (id, name) VALUES (2, 'fee'); +SELECT * FROM t1; +id group a\\b a\\ name +1 1 2 NULL foo +2 1 2 NULL fee +DROP TABLE t1; +SELECT * FROM t1; +id group a\\b a\\ name +1 1 2 NULL foo +2 1 2 NULL fee +DROP TABLE t1; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/suite/federated/assisted_discovery.test b/mysql-test/suite/federated/assisted_discovery.test new file mode 100644 index 00000000000..9f3abe74ecc --- /dev/null +++ b/mysql-test/suite/federated/assisted_discovery.test @@ -0,0 +1,34 @@ +source include/federated.inc; +source have_federatedx.inc; + +connection slave; + +CREATE TABLE t1 ( + `id` int(20) primary key, + `group` int NOT NULL default 1, + `a\\b` int NOT NULL default 2, + `a\\` int unsigned, + `name` varchar(32) default 'name') + DEFAULT CHARSET=latin1; + +connection master; + +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 ENGINE=FEDERATED + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; + +--replace_result $SLAVE_MYPORT SLAVE_PORT +SHOW CREATE TABLE t1; +INSERT INTO t1 (id, name) VALUES (1, 'foo'); +INSERT INTO t1 (id, name) VALUES (2, 'fee'); +--sorted_result +SELECT * FROM t1; +DROP TABLE t1; + +connection slave; +--sorted_result +SELECT * FROM t1; +DROP TABLE t1; + +source include/federated_cleanup.inc; + diff --git a/mysql-test/suite/federated/federated_archive.result b/mysql-test/suite/federated/federated_archive.result index d67568ec11c..c2f43458126 100644 --- a/mysql-test/suite/federated/federated_archive.result +++ b/mysql-test/suite/federated/federated_archive.result @@ -20,13 +20,13 @@ id name 1 foo 2 bar DELETE FROM federated.t1 WHERE id = 1; -ERROR HY000: Got error 10000 'Error on remote system: 1031: Table storage engine for 'archive_table' doesn't have this option' from FEDERATED +ERROR HY000: Got error 10000 'Error on remote system: 1031: Storage engine ARCHIVE of the table `federated`.`archive_table` doesn'' from FEDERATED SELECT * FROM federated.t1; id name 1 foo 2 bar UPDATE federated.t1 SET name='baz' WHERE id = 1; -ERROR HY000: Got error 10000 'Error on remote system: 1031: Table storage engine for 'archive_table' doesn't have this option' from FEDERATED +ERROR HY000: Got error 10000 'Error on remote system: 1031: Storage engine ARCHIVE of the table `federated`.`archive_table` doesn'' from FEDERATED SELECT * FROM federated.t1; id name 1 foo diff --git a/mysql-test/suite/federated/federated_bug_35333.result b/mysql-test/suite/federated/federated_bug_35333.result index 74f6f6e8f02..05e4bab8ec5 100644 --- a/mysql-test/suite/federated/federated_bug_35333.result +++ b/mysql-test/suite/federated/federated_bug_35333.result @@ -24,14 +24,12 @@ CREATE TABLE t1 (c1 int) ENGINE=MYISAM; SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT -test t1 BASE TABLE NULL NULL NULL NULL Can't find file: 't1' (errno: 2 "No such file or directory") +test t1 BASE TABLE NULL NULL NULL NULL Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") Warnings: -Warning 1017 Can't find file: 't1' (errno: 2 "No such file or directory") -SHOW WARNINGS; -Level Code Message -Warning 1017 Can't find file: 't1' (errno: 2 "No such file or directory") +Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") DROP TABLE t1; -ERROR 42S02: Unknown table 't1' +Warnings: +Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") # # Cleanup # diff --git a/mysql-test/suite/federated/federated_bug_35333.test b/mysql-test/suite/federated/federated_bug_35333.test index 6487e10e018..47feefd75a1 100644 --- a/mysql-test/suite/federated/federated_bug_35333.test +++ b/mysql-test/suite/federated/federated_bug_35333.test @@ -64,11 +64,7 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`; SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -SHOW WARNINGS; ---disable_warnings ---error 1051 DROP TABLE t1; ---enable_warnings --echo # --echo # Cleanup diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result index 2ece1a32b4f..5ae2abb46e5 100644 --- a/mysql-test/suite/federated/federatedx.result +++ b/mysql-test/suite/federated/federatedx.result @@ -1508,7 +1508,7 @@ id name 1 Monty 2 David ALTER TABLE federated.alter_me MODIFY COLUMN id int(16) NOT NULL; -ERROR HY000: Table storage engine for 'alter_me' doesn't have this option +ERROR HY000: Storage engine FEDERATED of the table `federated`.`alter_me` doesn't have this option SELECT * FROM federated.alter_me; id name 1 Monty diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index e161e8ed058..8bf290ba168 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -3,6 +3,19 @@ WHERE table_schema = 'information_schema' AND table_name <> 'profiling' AND table_name not like 'innodb_%' ORDER BY table_schema, table_name, column_name; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +def information_schema ALL_PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select +def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select +def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select +def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select +def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select +def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select +def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select +def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12) select +def information_schema ALL_PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select +def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select +def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select +def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select +def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select def information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select @@ -215,7 +228,7 @@ def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 N def information_schema PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select def information_schema PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12) select def information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) select +def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) select def information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) select def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) select @@ -473,6 +486,19 @@ WHERE table_schema = 'information_schema' AND table_name <> 'profiling' AND table_name not like 'innodb_%' ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +3.0000 information_schema ALL_PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ALL_PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) +3.0000 information_schema ALL_PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16) +3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) +3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) +3.0000 information_schema ALL_PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64) +1.0000 information_schema ALL_PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema ALL_PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema ALL_PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ALL_PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12) +3.0000 information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80) 3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60) @@ -678,7 +704,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21 3.0000 information_schema PARTITIONS TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) -3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 10 30 utf8 utf8_general_ci varchar(10) +3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16) 3.0000 information_schema PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80) 3.0000 information_schema PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) 3.0000 information_schema PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64) diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result index 003f506fee8..ba5166691c1 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result @@ -4,6 +4,19 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'pbxt_%' ORDER BY table_schema, table_name, column_name; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +def information_schema ALL_PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) +def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) +def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) +def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext +def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) +def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) +def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) +def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12) +def information_schema ALL_PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) +def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) +def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) +def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) +def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) def information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) @@ -216,7 +229,7 @@ def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 N def information_schema PLUGINS PLUGIN_LICENSE 10 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) def information_schema PLUGINS PLUGIN_MATURITY 12 NO varchar 12 36 NULL NULL NULL utf8 utf8_general_ci varchar(12) def information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) -def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL NULL utf8 utf8_general_ci varchar(10) +def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 16 48 NULL NULL NULL utf8 utf8_general_ci varchar(16) def information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL NULL utf8 utf8_general_ci varchar(80) def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL NULL utf8 utf8_general_ci varchar(20) @@ -478,6 +491,19 @@ AND table_name <> 'profiling' AND table_name not like 'innodb_%' AND table_name not like 'pbxt_%' ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE +3.0000 information_schema ALL_PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ALL_PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) +3.0000 information_schema ALL_PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16) +3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) +3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) +3.0000 information_schema ALL_PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64) +1.0000 information_schema ALL_PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext +3.0000 information_schema ALL_PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80) +3.0000 information_schema ALL_PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64) +3.0000 information_schema ALL_PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12) +3.0000 information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80) 3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60) @@ -683,7 +709,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21 3.0000 information_schema PARTITIONS TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 information_schema PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) -3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 10 30 utf8 utf8_general_ci varchar(10) +3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 16 48 utf8 utf8_general_ci varchar(16) 3.0000 information_schema PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80) 3.0000 information_schema PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20) 3.0000 information_schema PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64) diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result index 6aa2e3bb93d..6e92285dbaf 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is.result @@ -16,6 +16,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%' ORDER BY table_schema,table_name; TABLE_CATALOG def TABLE_SCHEMA information_schema +TABLE_NAME ALL_PLUGINS +TABLE_TYPE SYSTEM VIEW +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG def +TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY @@ -816,6 +839,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%' ORDER BY table_schema,table_name; TABLE_CATALOG def TABLE_SCHEMA information_schema +TABLE_NAME ALL_PLUGINS +TABLE_TYPE SYSTEM VIEW +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG def +TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result index 6aa2e3bb93d..6e92285dbaf 100644 --- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result @@ -16,6 +16,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%' ORDER BY table_schema,table_name; TABLE_CATALOG def TABLE_SCHEMA information_schema +TABLE_NAME ALL_PLUGINS +TABLE_TYPE SYSTEM VIEW +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG def +TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY @@ -816,6 +839,29 @@ AND table_name not like 'pbxt_%' AND table_name not like 'xtradb_%' ORDER BY table_schema,table_name; TABLE_CATALOG def TABLE_SCHEMA information_schema +TABLE_NAME ALL_PLUGINS +TABLE_TYPE SYSTEM VIEW +ENGINE MYISAM_OR_MARIA +VERSION 10 +ROW_FORMAT DYNAMIC_OR_PAGE +TABLE_ROWS #TBLR# +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME #CRT# +UPDATE_TIME #UT# +CHECK_TIME #CT# +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS #CO# +TABLE_COMMENT #TC# +user_comment +Separator ----------------------------------------------------- +TABLE_CATALOG def +TABLE_SCHEMA information_schema TABLE_NAME CHARACTER_SETS TABLE_TYPE SYSTEM VIEW ENGINE MEMORY diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index 179d0cd814e..f9cdbb13d61 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -2490,8 +2490,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp SELECT * from t1 where f2=f1' at line 1 CREATE PROCEDURE option() SELECT * from t1 where f2=f1; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option() -SELECT * from t1 where f2=f1' at line 1 +DROP PROCEDURE option; CREATE PROCEDURE optionally() SELECT * from t1 where f2=f1; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'optionally() @@ -8548,8 +8547,6 @@ CREATE PROCEDURE sp1() BEGIN declare option char; END// -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option char; -END' at line 3 DROP PROCEDURE IF EXISTS sp1; CREATE PROCEDURE sp1() BEGIN @@ -10773,11 +10770,7 @@ BEGIN declare option condition for sqlstate '02000'; declare exit handler for option set @var2 = 1; END// -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option condition for sqlstate '02000'; -declare exit handler for option set @var2' at line 3 DROP PROCEDURE IF EXISTS sp1; -Warnings: -Note 1305 PROCEDURE db_storedproc.sp1 does not exist CREATE PROCEDURE sp1( ) BEGIN declare optionally condition for sqlstate '02000'; @@ -12957,7 +12950,7 @@ CREATE PROCEDURE sp1( ) BEGIN declare option handler for sqlstate '02000' set @var2 = 1; END// -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'option handler for sqlstate '02000' set @var2 = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'handler for sqlstate '02000' set @var2 = 1; END' at line 3 DROP PROCEDURE IF EXISTS sp1; Warnings: diff --git a/mysql-test/suite/funcs_1/t/storedproc.test b/mysql-test/suite/funcs_1/t/storedproc.test index 3bd3199da4e..69406a57a00 100644 --- a/mysql-test/suite/funcs_1/t/storedproc.test +++ b/mysql-test/suite/funcs_1/t/storedproc.test @@ -1507,9 +1507,9 @@ CREATE PROCEDURE on() CREATE PROCEDURE optimize() SELECT * from t1 where f2=f1; ---error ER_PARSE_ERROR CREATE PROCEDURE option() SELECT * from t1 where f2=f1; +DROP PROCEDURE option; --error ER_PARSE_ERROR CREATE PROCEDURE optionally() @@ -10171,7 +10171,6 @@ DROP PROCEDURE IF EXISTS sp1; --enable_warnings delimiter //; ---error ER_PARSE_ERROR CREATE PROCEDURE sp1() BEGIN declare option char; @@ -12755,7 +12754,6 @@ delimiter ;// DROP PROCEDURE IF EXISTS sp1; delimiter //; ---error ER_PARSE_ERROR CREATE PROCEDURE sp1( ) BEGIN declare option condition for sqlstate '02000'; diff --git a/mysql-test/suite/handler/aria.result b/mysql-test/suite/handler/aria.result index 95be170b5f8..630b16433a4 100644 --- a/mysql-test/suite/handler/aria.result +++ b/mysql-test/suite/handler/aria.result @@ -586,7 +586,7 @@ Note 1051 Unknown table 't1' create table t1 (a int not null) ENGINE=csv; --> client 2 handler t1 open; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option --> client 1 drop table t1; create table t1 (a int); diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result index 8b526335024..55f9fd41c7a 100644 --- a/mysql-test/suite/handler/heap.result +++ b/mysql-test/suite/handler/heap.result @@ -586,7 +586,7 @@ Note 1051 Unknown table 't1' create table t1 (a int not null) ENGINE=csv; --> client 2 handler t1 open; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option --> client 1 drop table t1; create table t1 (a int); @@ -1728,9 +1728,9 @@ a b 4 40 5 50 HANDLER t1 READ a FIRST; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option HANDLER t1 READ a LAST; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option HANDLER t1 READ b FIRST LIMIT 2; a b 1 10 @@ -1781,11 +1781,11 @@ create table t1 (f1 integer not null, key (f1)) engine=Memory; insert into t1 values (1); HANDLER t1 OPEN; HANDLER t1 READ f1 NEXT; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option HANDLER t1 READ f1 NEXT; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option HANDLER t1 READ f1 NEXT; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option HANDLER t1 CLOSE; DROP TABLE t1; End of 5.3 tests diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result index db36640ea39..d4103ddd6ff 100644 --- a/mysql-test/suite/handler/innodb.result +++ b/mysql-test/suite/handler/innodb.result @@ -587,7 +587,7 @@ Note 1051 Unknown table 't1' create table t1 (a int not null) ENGINE=csv; --> client 2 handler t1 open; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option --> client 1 drop table t1; create table t1 (a int); diff --git a/mysql-test/suite/handler/interface.result b/mysql-test/suite/handler/interface.result index 96d21e7373a..cebbc2784df 100644 --- a/mysql-test/suite/handler/interface.result +++ b/mysql-test/suite/handler/interface.result @@ -269,7 +269,7 @@ handler t1 open; lock table t1 write; alter table t1 engine=csv; handler t1 read a next; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option handler t1 close; unlock tables; drop table t1; diff --git a/mysql-test/suite/handler/myisam.result b/mysql-test/suite/handler/myisam.result index e8abe8047cd..980b87768da 100644 --- a/mysql-test/suite/handler/myisam.result +++ b/mysql-test/suite/handler/myisam.result @@ -586,7 +586,7 @@ Note 1051 Unknown table 't1' create table t1 (a int not null) ENGINE=csv; --> client 2 handler t1 open; -ERROR HY000: Table storage engine for 't1' doesn't have this option +ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option --> client 1 drop table t1; create table t1 (a int); diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result index ae562a0dda1..0142cfa66b0 100644 --- a/mysql-test/suite/heap/heap.result +++ b/mysql-test/suite/heap/heap.result @@ -738,6 +738,26 @@ SELECT c2 FROM t1; c2 0 DROP TABLE t1; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +color enum('GREEN', 'WHITE') DEFAULT NULL, +ts int, +PRIMARY KEY (id), +KEY color (color) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES("1","GREEN",1); +INSERT INTO t1 VALUES("2","GREEN",1); +INSERT INTO t1 VALUES("3","GREEN",1); +INSERT INTO t1 VALUES("4","GREEN",1); +INSERT INTO t1 VALUES("5","GREEN",1); +INSERT INTO t1 VALUES("6","GREEN",1); +DELETE FROM t1 WHERE id = 1; +INSERT INTO t1 VALUES("7","GREEN", 2); +DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN'; +SELECT * from t1; +id color ts +7 GREEN 2 +DROP TABLE t1; CREATE TABLE t1 (a int, index(a)) engine=heap min_rows=10 max_rows=100; insert into t1 values(1); select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; @@ -790,3 +810,22 @@ select data_length,index_length from information_schema.tables where table_schem data_length index_length 81024 121024 drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +color enum('GREEN', 'WHITE') DEFAULT NULL, +ts int, +PRIMARY KEY (id), +KEY color (color) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES("1","GREEN",1); +INSERT INTO t1 VALUES("2","GREEN",1); +INSERT INTO t1 VALUES("3","GREEN",1); +INSERT INTO t1 VALUES("4","GREEN",1); +INSERT INTO t1 VALUES("5","GREEN",1); +INSERT INTO t1 VALUES("6","GREEN",1); +DELETE FROM t1 WHERE id = 1; +INSERT INTO t1 VALUES("7","GREEN", 2); +DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN'; +SELECT * from t1 WHERE ts = 1 AND color = 'GREEN'; +id color ts +DROP TABLE t1; diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test index 6f5046af139..ef2527beeb0 100644 --- a/mysql-test/suite/heap/heap.test +++ b/mysql-test/suite/heap/heap.test @@ -487,6 +487,32 @@ SELECT c2 FROM t1; DROP TABLE t1; # +# BUG#51763 Can't delete rows from MEMORY table with HASH key +# + +CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + color enum('GREEN', 'WHITE') DEFAULT NULL, + ts int, + PRIMARY KEY (id), + KEY color (color) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES("1","GREEN",1); +INSERT INTO t1 VALUES("2","GREEN",1); +INSERT INTO t1 VALUES("3","GREEN",1); +INSERT INTO t1 VALUES("4","GREEN",1); +INSERT INTO t1 VALUES("5","GREEN",1); +INSERT INTO t1 VALUES("6","GREEN",1); +DELETE FROM t1 WHERE id = 1; +INSERT INTO t1 VALUES("7","GREEN", 2); +DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN'; +SELECT * from t1; +DROP TABLE t1; + +# End of 5.1 tests + +# # Show that MIN_ROWS and MAX_ROWS have an effect on how data_length # and index_length are allocated. # Result is different for 32 / 64 bit machines as pointer lengths are different @@ -537,3 +563,27 @@ insert into t1 select rand(100000000) from t1; --replace_result 40512 81024 60512 121024 select data_length,index_length from information_schema.tables where table_schema="test" and table_name="t1"; drop table t1; + +# +# BUG#51763 Can't delete rows from MEMORY table with HASH key +# + +CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + color enum('GREEN', 'WHITE') DEFAULT NULL, + ts int, + PRIMARY KEY (id), + KEY color (color) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES("1","GREEN",1); +INSERT INTO t1 VALUES("2","GREEN",1); +INSERT INTO t1 VALUES("3","GREEN",1); +INSERT INTO t1 VALUES("4","GREEN",1); +INSERT INTO t1 VALUES("5","GREEN",1); +INSERT INTO t1 VALUES("6","GREEN",1); +DELETE FROM t1 WHERE id = 1; +INSERT INTO t1 VALUES("7","GREEN", 2); +DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN'; +SELECT * from t1 WHERE ts = 1 AND color = 'GREEN'; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def index 0e7cd067056..ad1323d4857 100644 --- a/mysql-test/suite/innodb/disabled.def +++ b/mysql-test/suite/innodb/disabled.def @@ -9,5 +9,4 @@ # Do not use any TAB characters for whitespace. # ############################################################################## - -innodb_bug12400341: variable innodb_trx_rseg_n_slots_debug is removed in MariaDB +innodb_bug14676111: MDEV-4396 diff --git a/mysql-test/suite/innodb/r/help_url.result b/mysql-test/suite/innodb/r/help_url.result index 214bf9f4e22..6d2b03f294c 100644 --- a/mysql-test/suite/innodb/r/help_url.result +++ b/mysql-test/suite/innodb/r/help_url.result @@ -3,7 +3,7 @@ set global innodb_file_per_table=1, innodb_file_format=Barracuda; create table t1 (i int) engine=InnoDB; alter table t1 discard tablespace; select * from t1; -ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine +ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine InnoDB InnoDB: http://dev.mysql.com/doc/refman/10.0/en/innodb-troubleshooting.html drop table t1; set global innodb_file_per_table=default, innodb_file_format=default; diff --git a/mysql-test/suite/innodb/r/innodb-create-options.result b/mysql-test/suite/innodb/r/innodb-create-options.result index c73baa60d42..c32af26c22d 100644 --- a/mysql-test/suite/innodb/r/innodb-create-options.result +++ b/mysql-test/suite/innodb/r/innodb-create-options.result @@ -10,11 +10,11 @@ Note 1051 Unknown table 't1' # 'FIXED' is sent to InnoDB since it is used by MyISAM. # But it is an invalid mode in InnoDB CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: invalid ROW_FORMAT specifier. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0; SHOW WARNINGS; Level Code Message @@ -46,11 +46,11 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME ROW_FORMAT CREATE_OPTIONS t1 Compact ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: invalid ROW_FORMAT specifier. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS t1 Compact @@ -58,23 +58,23 @@ t1 Compact # KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; SHOW WARNINGS; Level Code Message @@ -104,29 +104,29 @@ t1 Compressed key_block_size=16 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: invalid ROW_FORMAT specifier. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16; SHOW WARNINGS; Level Code Message @@ -146,11 +146,11 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME ROW_FORMAT CREATE_OPTIONS t1 Compact row_format=COMPACT ALTER TABLE t1 KEY_BLOCK_SIZE=2; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=REDUNDANT; SHOW WARNINGS; Level Code Message @@ -158,11 +158,11 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME ROW_FORMAT CREATE_OPTIONS t1 Redundant row_format=REDUNDANT ALTER TABLE t1 KEY_BLOCK_SIZE=4; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DYNAMIC; SHOW WARNINGS; Level Code Message @@ -170,11 +170,11 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME ROW_FORMAT CREATE_OPTIONS t1 Dynamic row_format=DYNAMIC ALTER TABLE t1 KEY_BLOCK_SIZE=8; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=COMPRESSED; SHOW WARNINGS; Level Code Message @@ -212,23 +212,23 @@ t1 CREATE TABLE `t1` ( `f1` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2 ALTER TABLE t1 ROW_FORMAT=COMPACT; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=REDUNDANT; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DYNAMIC; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=COMPRESSED; SHOW WARNINGS; Level Code Message @@ -250,11 +250,11 @@ t1 Compact row_format=COMPACT # Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE. DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") # Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and # and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope # and that they can be set to default values during strict mode. @@ -263,23 +263,23 @@ DROP TABLE IF EXISTS t1; Warnings: Note 1051 Unknown table 't1' CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT; SHOW WARNINGS; Level Code Message @@ -298,34 +298,34 @@ CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; SHOW WARNINGS; Level Code Message ALTER TABLE t1 KEY_BLOCK_SIZE=8; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=COMPRESSED; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DYNAMIC; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SET GLOBAL innodb_file_format=Barracuda; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; SET GLOBAL innodb_file_format=Antelope; ALTER TABLE t1 ADD COLUMN f1 INT; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; SHOW WARNINGS; Level Code Message @@ -340,23 +340,23 @@ SET GLOBAL innodb_file_format=Barracuda; SET GLOBAL innodb_file_per_table=OFF; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT; SHOW WARNINGS; Level Code Message @@ -375,23 +375,23 @@ CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; SHOW WARNINGS; Level Code Message ALTER TABLE t1 KEY_BLOCK_SIZE=1; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=COMPRESSED; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DYNAMIC; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=COMPACT; SHOW WARNINGS; Level Code Message @@ -415,12 +415,12 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; SET GLOBAL innodb_file_per_table=OFF; ALTER TABLE t1 ADD COLUMN f1 INT; -ERROR HY000: Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. -Error 1005 Can't create table '#sql-temporary' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; SHOW WARNINGS; Level Code Message diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index 0f004772153..9130b3a4ef2 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -545,7 +545,7 @@ t4 CREATE TABLE `t4` ( CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 alter table t3 add constraint dc foreign key (a) references t1(a); -ERROR HY000: Can't create table '#sql-temporary' (errno: 121 "Duplicate key on write or update") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 121 "Duplicate key on write or update") show create table t3; Table Create Table t3 CREATE TABLE `t3` ( @@ -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'; @@ -1146,17 +1146,17 @@ PRIMARY KEY (c1) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1); -ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed") ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2); -ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed") ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1); -ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed") ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL; ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2); -ERROR HY000: Can't create table '#sql-temporary' (errno: 150 "Foreign key constraint is incorrectly formed") +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed") ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1); SHOW CREATE TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result index 8f920b9212e..3f0c8b43f0c 100644 --- a/mysql-test/suite/innodb/r/innodb-zip.result +++ b/mysql-test/suite/innodb/r/innodb-zip.result @@ -203,11 +203,11 @@ drop table t1; set innodb_strict_mode = on; create table t1 (id int primary key) engine = innodb key_block_size = 0; create table t2 (id int primary key) engine = innodb key_block_size = 9; -ERROR HY000: Can't create table 'test.t2' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] -Error 1005 Can't create table 'test.t2' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options") create table t3 (id int primary key) engine = innodb key_block_size = 1; create table t4 (id int primary key) engine = innodb key_block_size = 2; create table t5 (id int primary key) engine = innodb key_block_size = 4; @@ -237,25 +237,25 @@ create table t1 (id int primary key) engine = innodb key_block_size = 8 row_format = compressed; create table t2 (id int primary key) engine = innodb key_block_size = 8 row_format = redundant; -ERROR HY000: Can't create table 'test.t2' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t2' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options") create table t3 (id int primary key) engine = innodb key_block_size = 8 row_format = compact; -ERROR HY000: Can't create table 'test.t3' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t3' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t3` (errno: 140 "Wrong create options") create table t4 (id int primary key) engine = innodb key_block_size = 8 row_format = dynamic; -ERROR HY000: Can't create table 'test.t4' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t4' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options") create table t5 (id int primary key) engine = innodb key_block_size = 8 row_format = default; SELECT table_schema, table_name, row_format, data_length, index_length @@ -268,28 +268,28 @@ test t5 Compressed 8192 0 drop table t1, t5; create table t1 (id int primary key) engine = innodb key_block_size = 9 row_format = redundant; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] Warning 140 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") create table t2 (id int primary key) engine = innodb key_block_size = 9 row_format = compact; -ERROR HY000: Can't create table 'test.t2' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] Warning 140 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t2' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options") create table t2 (id int primary key) engine = innodb key_block_size = 9 row_format = dynamic; -ERROR HY000: Can't create table 'test.t2' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] Warning 140 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. -Error 1005 Can't create table 'test.t2' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options") SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb'; table_schema table_name row_format data_length index_length @@ -297,47 +297,47 @@ mysql innodb_index_stats Compact 16384 0 mysql innodb_table_stats Compact 16384 0 set global innodb_file_per_table = off; create table t1 (id int primary key) engine = innodb key_block_size = 1; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") create table t2 (id int primary key) engine = innodb key_block_size = 2; -ERROR HY000: Can't create table 'test.t2' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. -Error 1005 Can't create table 'test.t2' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options") create table t3 (id int primary key) engine = innodb key_block_size = 4; -ERROR HY000: Can't create table 'test.t3' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. -Error 1005 Can't create table 'test.t3' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t3` (errno: 140 "Wrong create options") create table t4 (id int primary key) engine = innodb key_block_size = 8; -ERROR HY000: Can't create table 'test.t4' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. -Error 1005 Can't create table 'test.t4' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options") create table t5 (id int primary key) engine = innodb key_block_size = 16; -ERROR HY000: Can't create table 'test.t5' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. -Error 1005 Can't create table 'test.t5' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options") create table t6 (id int primary key) engine = innodb row_format = compressed; -ERROR HY000: Can't create table 'test.t6' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t6` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. -Error 1005 Can't create table 'test.t6' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t6` (errno: 140 "Wrong create options") create table t7 (id int primary key) engine = innodb row_format = dynamic; -ERROR HY000: Can't create table 'test.t7' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t7` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table. -Error 1005 Can't create table 'test.t7' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t7` (errno: 140 "Wrong create options") create table t8 (id int primary key) engine = innodb row_format = compact; create table t9 (id int primary key) engine = innodb row_format = redundant; SELECT table_schema, table_name, row_format, data_length, index_length @@ -351,47 +351,47 @@ drop table t8, t9; set global innodb_file_per_table = on; set global innodb_file_format = `0`; create table t1 (id int primary key) engine = innodb key_block_size = 1; -ERROR HY000: Can't create table 'test.t1' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t1' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") create table t2 (id int primary key) engine = innodb key_block_size = 2; -ERROR HY000: Can't create table 'test.t2' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t2` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t2' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t2` (errno: 140 "Wrong create options") create table t3 (id int primary key) engine = innodb key_block_size = 4; -ERROR HY000: Can't create table 'test.t3' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t3' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t3` (errno: 140 "Wrong create options") create table t4 (id int primary key) engine = innodb key_block_size = 8; -ERROR HY000: Can't create table 'test.t4' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t4' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options") create table t5 (id int primary key) engine = innodb key_block_size = 16; -ERROR HY000: Can't create table 'test.t5' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t5' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options") create table t6 (id int primary key) engine = innodb row_format = compressed; -ERROR HY000: Can't create table 'test.t6' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t6` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t6' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t6` (errno: 140 "Wrong create options") create table t7 (id int primary key) engine = innodb row_format = dynamic; -ERROR HY000: Can't create table 'test.t7' (errno: 140 "Wrong create options") +ERROR HY000: Can't create table `test`.`t7` (errno: 140 "Wrong create options") show warnings; Level Code Message Warning 140 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. -Error 1005 Can't create table 'test.t7' (errno: 140 "Wrong create options") +Error 1005 Can't create table `test`.`t7` (errno: 140 "Wrong create options") create table t8 (id int primary key) engine = innodb row_format = compact; create table t9 (id int primary key) engine = innodb row_format = redundant; SELECT table_schema, table_name, row_format, data_length, index_length diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 934311adcaf..da5f77fcdca 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -2525,13 +2525,13 @@ drop table t1; set foreign_key_checks=0; create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb; create table t1(a char(10) primary key, b varchar(20)) engine = innodb; -ERROR HY000: Can't create table 'test.t1' (errno: 150 "Foreign key constraint is incorrectly formed") +ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed") set foreign_key_checks=1; drop table t2; set foreign_key_checks=0; create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8; -ERROR HY000: Can't create table 'test.t2' (errno: 150 "Foreign key constraint is incorrectly formed") +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") set foreign_key_checks=1; drop table t1; set foreign_key_checks=0; diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result index 551e94f5e77..86eaa83980d 100644 --- a/mysql-test/suite/innodb/r/innodb_bug12400341.result +++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result @@ -1,4 +1,6 @@ call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); +set @old_innodb_undo_logs = @@innodb_undo_logs; +set global innodb_undo_logs=1; show variables like "max_connections"; Variable_name Value max_connections 64 @@ -15,7 +17,7 @@ select count(*) from information_schema.processlist; count(*) 33 CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; -ERROR HY000: Can't create table 'mysqltest.testtable' (errno: 177) +ERROR HY000: Can't create table `mysqltest`.`testtable` (errno: 177 "Too many active concurrent transactions") select count(*) from information_schema.processlist; count(*) 33 @@ -23,3 +25,4 @@ select count(*) from information_schema.processlist; count(*) 33 drop database mysqltest; +set global innodb_undo_logs = @old_innodb_undo_logs; 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_bug46000.result b/mysql-test/suite/innodb/r/innodb_bug46000.result index 9ee0c935d71..f3dff71539b 100644 --- a/mysql-test/suite/innodb/r/innodb_bug46000.result +++ b/mysql-test/suite/innodb/r/innodb_bug46000.result @@ -6,7 +6,7 @@ show warnings; Level Code Message Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index. Error 1280 Incorrect index name 'GEN_CLUST_INDEX' -Error 1005 Can't create table 'test.bug46000' (errno: -1 "Internal error < 0 (Not system error)") +Error 1005 Can't create table `test`.`bug46000` (errno: -1 "Internal error < 0 (Not system error)") create table bug46000(id int) engine=innodb; create index GEN_CLUST_INDEX on bug46000(id); ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX' 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_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result index 36b37e4ccd8..21c1234d7d3 100644 --- a/mysql-test/suite/innodb/r/innodb_gis.result +++ b/mysql-test/suite/innodb/r/innodb_gis.result @@ -598,4 +598,4 @@ create table t1 (a int not null, b linestring not null, unique key b (b(12))); create unique index a on t1(a); drop table t1; create table t1 (g geometry not null, spatial gk(g)) engine=innodb; -ERROR HY000: The used table type doesn't support SPATIAL indexes +ERROR HY000: The storage engine InnoDB doesn't support SPATIAL indexes diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index be2b4b28f6a..7247b26e86b 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)); @@ -630,12 +630,13 @@ a DROP TABLE t1,t2,t3; create table t1 (a int) engine=innodb; select * from bug29807; -ERROR 42S02: Table 'test.bug29807' doesn't exist +ERROR 42S02: Table 'test.bug29807' doesn't exist in engine drop table t1; drop table bug29807; -ERROR 42S02: Unknown table 'bug29807' -create table bug29807 (a int); -drop table bug29807; +Warnings: +Warning 155 Table 'test.bug29807' doesn't exist in engine +call mtr.add_suppression("InnoDB: Error: table .test...bug29807. does not exist in the InnoDB internal"); +call mtr.add_suppression("Cannot find or open table test\/bug29807 from"); CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; switch to connection c1 diff --git a/mysql-test/suite/innodb/t/help_url.test b/mysql-test/suite/innodb/t/help_url.test index 2c70cd296cc..075d1180649 100644 --- a/mysql-test/suite/innodb/t/help_url.test +++ b/mysql-test/suite/innodb/t/help_url.test @@ -2,6 +2,7 @@ # MDEV-4273 MYSQL_VERSION_MAJOR.MYSQL_VERSION_MINOR not replaced # --source include/have_innodb.inc +--source include/not_embedded.inc call mtr.add_suppression('InnoDB: Error'); diff --git a/mysql-test/suite/innodb/t/innodb-create-options.test b/mysql-test/suite/innodb/t/innodb-create-options.test index 12c24820031..0f8e6f8dda2 100644 --- a/mysql-test/suite/innodb/t/innodb-create-options.test +++ b/mysql-test/suite/innodb/t/innodb-create-options.test @@ -96,10 +96,10 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; SHOW WARNINGS; SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; @@ -141,25 +141,25 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE --echo # Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16; SHOW WARNINGS; @@ -173,26 +173,26 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 KEY_BLOCK_SIZE=2; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=REDUNDANT; SHOW WARNINGS; SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 KEY_BLOCK_SIZE=4; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=DYNAMIC; SHOW WARNINGS; SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 KEY_BLOCK_SIZE=8; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=COMPRESSED; SHOW WARNINGS; @@ -213,20 +213,20 @@ CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2; SHOW CREATE TABLE t1; ALTER TABLE t1 ADD COLUMN f1 INT; SHOW CREATE TABLE t1; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=COMPACT; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=REDUNDANT; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=DYNAMIC; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=COMPRESSED; SHOW WARNINGS; @@ -276,29 +276,29 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 KEY_BLOCK_SIZE=8; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=COMPRESSED; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=DYNAMIC; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; SET GLOBAL innodb_file_format=Barracuda; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; SET GLOBAL innodb_file_format=Antelope; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ADD COLUMN f1 INT; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; SHOW WARNINGS; @@ -337,20 +337,20 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 KEY_BLOCK_SIZE=1; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=COMPRESSED; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ROW_FORMAT=DYNAMIC; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=COMPACT; SHOW WARNINGS; @@ -365,10 +365,10 @@ SET GLOBAL innodb_file_per_table=ON; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; SET GLOBAL innodb_file_per_table=OFF; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t1 ADD COLUMN f1 INT; ---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ / - .*[0-9]*)/)/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ SHOW WARNINGS; ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; SHOW WARNINGS; diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index cea9055b873..a8ef524c3e9 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -250,7 +250,7 @@ insert into t2 values (1,1,1,1,1); commit; alter table t4 add constraint dc foreign key (a) references t1(a); show create table t4; ---replace_regex /'test\.#sql-[0-9a-f_]*'/'#sql-temporary'/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ # a foreign key 'test/dc' already exists --error ER_CANT_CREATE_TABLE alter table t3 add constraint dc foreign key (a) references t1(a); @@ -620,20 +620,20 @@ CREATE TABLE t2( PRIMARY KEY (c1) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1); ---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2); ---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1); ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL; ---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/ +--replace_regex /#sql-[0-9a-f_]+/#sql-temporary/ --error ER_CANT_CREATE_TABLE ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2); diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test index 7e2e2d1d3c9..67bcda7697e 100644 --- a/mysql-test/suite/innodb/t/innodb-zip.test +++ b/mysql-test/suite/innodb/t/innodb-zip.test @@ -1,9 +1,5 @@ -- 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 $per_table=`select @@innodb_file_per_table`; let $format=`select @@innodb_file_format`; diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index 4e5d6d7ce90..532870fd29c 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -4,11 +4,6 @@ # .\sync\sync0sync.c line 324 # is fixed -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 -} - ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test index 2ab1be81f6d..b9f8c503dc5 100644 --- a/mysql-test/suite/innodb/t/innodb_bug12400341.test +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -14,6 +14,9 @@ set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug; set global innodb_trx_rseg_n_slots_debug = 32; --enable_query_log +set @old_innodb_undo_logs = @@innodb_undo_logs; +set global innodb_undo_logs=1; + show variables like "max_connections"; show variables like "innodb_thread_concurrency"; show variables like "innodb_file_per_table"; @@ -98,6 +101,8 @@ while ($c) # drop database mysqltest; +set global innodb_undo_logs = @old_innodb_undo_logs; + --disable_query_log set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug; --enable_query_log 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_bug53591.test b/mysql-test/suite/innodb/t/innodb_bug53591.test index f0ed4b93c32..9a1c2afbccb 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53591.test +++ b/mysql-test/suite/innodb/t/innodb_bug53591.test @@ -1,9 +1,5 @@ --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 $file_format=`select @@innodb_file_format`; let $file_per_table=`select @@innodb_file_per_table`; diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test index 776f5dae517..d7540dff36d 100644 --- a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test +++ b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test @@ -14,10 +14,6 @@ # # ###################################################################### -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 -} # Save innodb variables let $innodb_file_format_orig=`select @@innodb_file_format`; diff --git a/mysql-test/suite/jp/r/jp_create_db_sjis.result b/mysql-test/suite/jp/r/jp_create_db_sjis.result index b7c09fbfbe9..93524e1c443 100644 --- a/mysql-test/suite/jp/r/jp_create_db_sjis.result +++ b/mysql-test/suite/jp/r/jp_create_db_sjis.result @@ -9,12 +9,12 @@ CREATE DATABASE `ƒ\\•\`; SELECT schema_name from information_schema.schemata where schema_name <> 'mtr'; schema_name information_schema -ƒ\\•\ -“ú–{Œê -ÆÎÝºÞ mysql performance_schema test +ƒ\\•\ +“ú–{Œê +ÆÎÝºÞ USE `ÆÎݺÞ`; USE `“ú–{Œê`; USE `ƒ\\•\`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ucs2.result b/mysql-test/suite/jp/r/jp_create_db_ucs2.result index 3832ff5a0c7..c6a2ff78b4f 100644 --- a/mysql-test/suite/jp/r/jp_create_db_ucs2.result +++ b/mysql-test/suite/jp/r/jp_create_db_ucs2.result @@ -10,12 +10,12 @@ CREATE DATABASE `íÜíÝíÞ`; SELECT schema_name from information_schema.schemata where schema_name <> 'mtr'; schema_name information_schema -ÆüËܸì -íÜíÝíÞ -ŽÆŽÎŽÝŽºŽÞ mysql performance_schema test +ÆüËܸì +íÜíÝíÞ +ŽÆŽÎŽÝŽºŽÞ USE `ŽÆŽÎŽÝŽºŽÞ`; USE `ÆüËܸì`; USE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ujis.result b/mysql-test/suite/jp/r/jp_create_db_ujis.result index d6bf31336fd..e5e0c2f1ad8 100644 --- a/mysql-test/suite/jp/r/jp_create_db_ujis.result +++ b/mysql-test/suite/jp/r/jp_create_db_ujis.result @@ -9,12 +9,12 @@ CREATE DATABASE `íÜíÝíÞ`; SELECT schema_name from information_schema.schemata where schema_name <> 'mtr'; schema_name information_schema -ÆüËܸì -íÜíÝíÞ -ŽÆŽÎŽÝŽºŽÞ mysql performance_schema test +ÆüËܸì +íÜíÝíÞ +ŽÆŽÎŽÝŽºŽÞ USE `ŽÆŽÎŽÝŽºŽÞ`; USE `ÆüËܸì`; USE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/r/jp_create_db_utf8.result b/mysql-test/suite/jp/r/jp_create_db_utf8.result index 62202d43df0..f07a36fd7c7 100644 --- a/mysql-test/suite/jp/r/jp_create_db_utf8.result +++ b/mysql-test/suite/jp/r/jp_create_db_utf8.result @@ -9,12 +9,12 @@ CREATE DATABASE `龔龖龗`; SELECT schema_name from information_schema.schemata where schema_name <> 'mtr'; schema_name information_schema -日本語 -龔龖龗 -ニホï¾ï½ºï¾ž mysql performance_schema test +日本語 +龔龖龗 +ニホï¾ï½ºï¾ž USE `ニホï¾ï½ºï¾ž`; USE `日本語`; USE `龔龖龗`; 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 6efd87df786..ddd0adade57 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -653,7 +653,7 @@ t1 1 a 1 a A 1000 NULL NULL YES BTREE alter table t1 engine=heap; alter table t1 disable keys; Warnings: -Note 1031 Table storage engine for 't1' doesn't have this option +Note 1031 Storage engine MEMORY of the table `test`.`t1` doesn't have this option show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t1 1 a 1 a NULL 500 NULL NULL YES HASH @@ -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/maria/maria3.result b/mysql-test/suite/maria/maria3.result index 27d72b75930..b502d71e772 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -359,7 +359,7 @@ NULL NULL 0 NULL 0 0 alter table t1 add column d char(0) not null, add key (d); -ERROR 42000: The used storage engine can't index column 'd' +ERROR 42000: The storage engine Aria can't index column `d` drop table t1; CREATE TABLE t1 (a bit(3)); insert into t1 values (NULL),(0),(1),(2),(3),(4),(5),(6),(7); 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/percona/percona_innodb_fake_changes.result b/mysql-test/suite/percona/percona_innodb_fake_changes.result index 5540c76f2e5..434b7283146 100644 --- a/mysql-test/suite/percona/percona_innodb_fake_changes.result +++ b/mysql-test/suite/percona/percona_innodb_fake_changes.result @@ -43,7 +43,7 @@ SET autocommit=0; SET innodb_fake_changes=1; BEGIN; CREATE TABLE t2 (a INT) ENGINE=InnoDB; -ERROR HY000: Can't create table 'test.t2' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database") DROP TABLE t1; ERROR 42S02: Unknown table 't1' TRUNCATE TABLE t1; diff --git a/mysql-test/suite/perfschema/r/dml_handler.result b/mysql-test/suite/perfschema/r/dml_handler.result index 707a1d7071a..41ffa18799f 100644 --- a/mysql-test/suite/perfschema/r/dml_handler.result +++ b/mysql-test/suite/perfschema/r/dml_handler.result @@ -11,149 +11,149 @@ SELECT COUNT(*) FROM table_list INTO @table_count; SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=49; HANDLER performance_schema.users OPEN; -ERROR HY000: Table storage engine for 'users' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`users` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=48; HANDLER performance_schema.threads OPEN; -ERROR HY000: Table storage engine for 'threads' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`threads` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=47; HANDLER performance_schema.table_lock_waits_summary_by_table OPEN; -ERROR HY000: Table storage engine for 'table_lock_waits_summary_by_table' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`table_lock_waits_summary_by_table` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=46; HANDLER performance_schema.table_io_waits_summary_by_table OPEN; -ERROR HY000: Table storage engine for 'table_io_waits_summary_by_table' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`table_io_waits_summary_by_table` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=45; HANDLER performance_schema.table_io_waits_summary_by_index_usage OPEN; -ERROR HY000: Table storage engine for 'table_io_waits_summary_by_index_usage' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`table_io_waits_summary_by_index_usage` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=44; HANDLER performance_schema.socket_summary_by_instance OPEN; -ERROR HY000: Table storage engine for 'socket_summary_by_instance' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`socket_summary_by_instance` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=43; HANDLER performance_schema.socket_summary_by_event_name OPEN; -ERROR HY000: Table storage engine for 'socket_summary_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`socket_summary_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=42; HANDLER performance_schema.socket_instances OPEN; -ERROR HY000: Table storage engine for 'socket_instances' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`socket_instances` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=41; HANDLER performance_schema.setup_timers OPEN; -ERROR HY000: Table storage engine for 'setup_timers' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`setup_timers` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=40; HANDLER performance_schema.setup_objects OPEN; -ERROR HY000: Table storage engine for 'setup_objects' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`setup_objects` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=39; HANDLER performance_schema.setup_instruments OPEN; -ERROR HY000: Table storage engine for 'setup_instruments' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`setup_instruments` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=38; HANDLER performance_schema.setup_consumers OPEN; -ERROR HY000: Table storage engine for 'setup_consumers' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`setup_consumers` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=37; HANDLER performance_schema.setup_actors OPEN; -ERROR HY000: Table storage engine for 'setup_actors' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`setup_actors` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=36; HANDLER performance_schema.rwlock_instances OPEN; -ERROR HY000: Table storage engine for 'rwlock_instances' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`rwlock_instances` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=35; HANDLER performance_schema.performance_timers OPEN; -ERROR HY000: Table storage engine for 'performance_timers' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`performance_timers` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=34; HANDLER performance_schema.objects_summary_global_by_type OPEN; -ERROR HY000: Table storage engine for 'objects_summary_global_by_type' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`objects_summary_global_by_type` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=33; HANDLER performance_schema.mutex_instances OPEN; -ERROR HY000: Table storage engine for 'mutex_instances' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`mutex_instances` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=32; HANDLER performance_schema.hosts OPEN; -ERROR HY000: Table storage engine for 'hosts' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`hosts` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=31; HANDLER performance_schema.file_summary_by_instance OPEN; -ERROR HY000: Table storage engine for 'file_summary_by_instance' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`file_summary_by_instance` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=30; HANDLER performance_schema.file_summary_by_event_name OPEN; -ERROR HY000: Table storage engine for 'file_summary_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`file_summary_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=29; HANDLER performance_schema.file_instances OPEN; -ERROR HY000: Table storage engine for 'file_instances' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`file_instances` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=28; HANDLER performance_schema.events_waits_summary_global_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_waits_summary_global_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_summary_global_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=27; HANDLER performance_schema.events_waits_summary_by_user_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_waits_summary_by_user_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_summary_by_user_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=26; HANDLER performance_schema.events_waits_summary_by_thread_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_waits_summary_by_thread_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_summary_by_thread_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=25; HANDLER performance_schema.events_waits_summary_by_instance OPEN; -ERROR HY000: Table storage engine for 'events_waits_summary_by_instance' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_summary_by_instance` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=24; HANDLER performance_schema.events_waits_summary_by_host_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_waits_summary_by_host_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_summary_by_host_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=23; HANDLER performance_schema.events_waits_summary_by_account_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_waits_summary_by_account_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_summary_by_account_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=22; HANDLER performance_schema.events_waits_history_long OPEN; -ERROR HY000: Table storage engine for 'events_waits_history_long' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_history_long` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=21; HANDLER performance_schema.events_waits_history OPEN; -ERROR HY000: Table storage engine for 'events_waits_history' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_history` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=20; HANDLER performance_schema.events_waits_current OPEN; -ERROR HY000: Table storage engine for 'events_waits_current' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_waits_current` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=19; HANDLER performance_schema.events_statements_summary_global_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_statements_summary_global_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_summary_global_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=18; HANDLER performance_schema.events_statements_summary_by_user_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_statements_summary_by_user_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_summary_by_user_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=17; HANDLER performance_schema.events_statements_summary_by_thread_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_statements_summary_by_thread_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_summary_by_thread_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=16; HANDLER performance_schema.events_statements_summary_by_host_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_statements_summary_by_host_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_summary_by_host_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=15; HANDLER performance_schema.events_statements_summary_by_digest OPEN; -ERROR HY000: Table storage engine for 'events_statements_summary_by_digest' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_summary_by_digest` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=14; HANDLER performance_schema.events_statements_summary_by_account_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_statements_summary_by_account_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_summary_by_account_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=13; HANDLER performance_schema.events_statements_history_long OPEN; -ERROR HY000: Table storage engine for 'events_statements_history_long' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_history_long` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=12; HANDLER performance_schema.events_statements_history OPEN; -ERROR HY000: Table storage engine for 'events_statements_history' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_history` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=11; HANDLER performance_schema.events_statements_current OPEN; -ERROR HY000: Table storage engine for 'events_statements_current' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_statements_current` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=10; HANDLER performance_schema.events_stages_summary_global_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_stages_summary_global_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_summary_global_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=9; HANDLER performance_schema.events_stages_summary_by_user_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_stages_summary_by_user_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_summary_by_user_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=8; HANDLER performance_schema.events_stages_summary_by_thread_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_stages_summary_by_thread_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_summary_by_thread_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=7; HANDLER performance_schema.events_stages_summary_by_host_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_stages_summary_by_host_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_summary_by_host_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=6; HANDLER performance_schema.events_stages_summary_by_account_by_event_name OPEN; -ERROR HY000: Table storage engine for 'events_stages_summary_by_account_by_event_name' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_summary_by_account_by_event_name` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=5; HANDLER performance_schema.events_stages_history_long OPEN; -ERROR HY000: Table storage engine for 'events_stages_history_long' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_history_long` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=4; HANDLER performance_schema.events_stages_history OPEN; -ERROR HY000: Table storage engine for 'events_stages_history' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_history` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=3; HANDLER performance_schema.events_stages_current OPEN; -ERROR HY000: Table storage engine for 'events_stages_current' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`events_stages_current` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=2; HANDLER performance_schema.cond_instances OPEN; -ERROR HY000: Table storage engine for 'cond_instances' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`cond_instances` doesn't have this option SELECT TABLE_NAME INTO @table_name FROM table_list WHERE id=1; HANDLER performance_schema.accounts OPEN; -ERROR HY000: Table storage engine for 'accounts' doesn't have this option +ERROR HY000: Storage engine PERFORMANCE_SCHEMA of the table `performance_schema`.`accounts` doesn't have this option DROP TEMPORARY TABLE table_list; diff --git a/mysql-test/suite/perfschema/r/event_aggregate.result b/mysql-test/suite/perfschema/r/event_aggregate.result index 6863ac6e2ce..a5cfe97f98e 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate.result +++ b/mysql-test/suite/perfschema/r/event_aggregate.result @@ -188,8 +188,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -200,31 +200,30 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -300,8 +299,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -315,8 +314,8 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 1 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -325,8 +324,8 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 user2 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -335,19 +334,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 5 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -448,13 +446,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -463,39 +461,38 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 8 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -589,13 +586,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -607,12 +604,12 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 1 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -621,12 +618,12 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 user3 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -635,19 +632,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 9 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -766,65 +762,64 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 12 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -936,18 +931,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -957,16 +952,16 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 1 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -975,16 +970,16 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 user4 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -993,19 +988,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 13 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1142,76 +1136,75 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 16 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1343,72 +1336,71 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 17 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1543,67 +1535,66 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 18 localhost wait/synch/mutex/sql/LOCK_connection_count 2 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1740,62 +1731,61 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 19 localhost wait/synch/mutex/sql/LOCK_connection_count 3 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1935,56 +1925,55 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2125,56 +2114,55 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2333,38 +2321,37 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2541,20 +2528,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2737,14 +2723,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2933,8 +2918,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -3123,8 +3107,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -3313,8 +3296,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3503,8 +3485,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3693,8 +3674,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3883,8 +3863,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4073,8 +4052,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4263,8 +4241,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4453,8 +4430,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4643,8 +4619,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4833,8 +4808,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -5007,8 +4981,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -5129,8 +5102,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -5215,8 +5187,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result index ad2440bd2d1..42945079ef4 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result +++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result @@ -173,8 +173,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -187,25 +187,24 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -271,8 +270,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -288,8 +287,8 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 user2 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -298,19 +297,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 5 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -392,13 +390,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -409,29 +407,28 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 8 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -506,13 +503,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -526,12 +523,12 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 user3 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -540,19 +537,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 9 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -643,18 +639,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; @@ -663,33 +659,32 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 12 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -773,18 +768,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -796,16 +791,16 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 user4 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -814,19 +809,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 13 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -926,60 +920,59 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 16 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1074,56 +1067,55 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 17 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1221,51 +1213,50 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 18 localhost wait/synch/mutex/sql/LOCK_connection_count 2 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1365,46 +1356,45 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 19 localhost wait/synch/mutex/sql/LOCK_connection_count 3 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1509,38 +1499,37 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1646,38 +1635,37 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1783,38 +1771,37 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1938,20 +1925,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2081,14 +2067,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2224,8 +2209,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2361,8 +2345,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2498,8 +2481,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2635,8 +2617,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2772,8 +2753,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2909,8 +2889,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3046,8 +3025,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3183,8 +3161,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3320,8 +3297,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3457,8 +3433,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3594,8 +3569,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3731,8 +3705,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3852,8 +3825,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3937,8 +3909,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result index 6faff1992c7..12893a8cc2b 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result +++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result @@ -147,8 +147,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -161,21 +161,20 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -232,8 +231,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -249,8 +248,8 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 user2 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -261,13 +260,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -340,13 +338,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -357,25 +355,24 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -441,13 +438,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -461,12 +458,12 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 user3 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -477,13 +474,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -565,18 +561,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; @@ -585,29 +581,28 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -682,18 +677,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -705,16 +700,16 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 user4 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -725,13 +720,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -822,56 +816,55 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -957,52 +950,51 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1091,47 +1083,46 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1222,42 +1213,41 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1353,34 +1343,33 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1477,34 +1466,33 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1601,34 +1589,33 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1745,14 +1732,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1869,14 +1855,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1999,8 +1984,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2123,8 +2107,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2247,8 +2230,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2371,8 +2353,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2495,8 +2476,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2619,8 +2599,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2743,8 +2722,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2867,8 +2845,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2991,8 +2968,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3115,8 +3091,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3239,8 +3214,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3363,8 +3337,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3471,8 +3444,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3543,8 +3515,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result index 87b81a54b6b..bd9a52361a1 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result +++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result @@ -158,8 +158,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -174,19 +174,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -242,8 +241,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -261,19 +260,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 5 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -336,13 +334,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -355,19 +353,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 8 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -423,13 +420,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -445,19 +442,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 9 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -520,18 +516,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; @@ -542,19 +538,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 12 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -610,18 +605,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -635,19 +630,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 13 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -710,23 +704,23 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -735,19 +729,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 16 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -805,18 +798,18 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -825,20 +818,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 17 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -899,13 +891,13 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -914,20 +906,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 18 localhost wait/synch/mutex/sql/LOCK_connection_count 2 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -990,8 +981,8 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -1000,20 +991,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 19 localhost wait/synch/mutex/sql/LOCK_connection_count 3 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1083,20 +1073,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1167,20 +1156,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1251,20 +1239,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1335,20 +1322,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1425,14 +1411,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1515,8 +1500,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1599,8 +1583,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1683,8 +1666,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1767,8 +1749,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1851,8 +1832,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1935,8 +1915,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2019,8 +1998,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2103,8 +2081,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2187,8 +2164,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2271,8 +2247,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2355,8 +2330,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2439,8 +2413,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2523,8 +2496,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2607,8 +2579,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result index 09144e3641b..bb14b14e291 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result +++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result @@ -132,8 +132,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -150,13 +150,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -203,8 +202,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -224,13 +223,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -284,13 +282,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -305,13 +303,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -358,13 +355,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -382,13 +379,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -442,18 +438,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; @@ -466,13 +462,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -519,18 +514,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -546,13 +541,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -606,23 +600,23 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -633,13 +627,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -688,18 +681,18 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -710,14 +703,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -769,13 +761,13 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -786,14 +778,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -847,8 +838,8 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star execute dump_waits_user; @@ -859,14 +850,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -929,14 +919,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1000,14 +989,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1071,14 +1059,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1142,14 +1129,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1213,14 +1199,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1290,8 +1275,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1361,8 +1345,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1432,8 +1415,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1503,8 +1485,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1574,8 +1555,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1645,8 +1625,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1716,8 +1695,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1787,8 +1765,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1858,8 +1835,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -1929,8 +1905,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2000,8 +1975,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2071,8 +2045,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2142,8 +2115,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -2213,8 +2185,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result index e50d2b1f837..0595c50e531 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result +++ b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result @@ -162,8 +162,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -174,27 +174,26 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -261,8 +260,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -276,8 +275,8 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 1 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -286,8 +285,8 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 user2 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -298,13 +297,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -396,13 +394,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -411,35 +409,34 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -524,13 +521,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -542,12 +539,12 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 1 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -556,12 +553,12 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 user3 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -572,13 +569,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -688,61 +684,60 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -845,18 +840,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -866,16 +861,16 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 1 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -884,16 +879,16 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 user4 wait/synch/mutex/sql/LOCK_user_locks 0 @@ -904,13 +899,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1038,72 +1032,71 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1226,68 +1219,67 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1413,63 +1405,62 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1597,58 +1588,57 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1779,52 +1769,51 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1956,52 +1945,51 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2151,34 +2139,33 @@ execute dump_waits_user; user event_name count_star user1 wait/io/file/sql/query_log 5 user1 wait/synch/mutex/sql/LOCK_connection_count 1 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 user2 wait/io/file/sql/query_log 5 user2 wait/synch/mutex/sql/LOCK_connection_count 1 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 user3 wait/io/file/sql/query_log 5 user3 wait/synch/mutex/sql/LOCK_connection_count 1 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 user4 wait/io/file/sql/query_log 5 user4 wait/synch/mutex/sql/LOCK_connection_count 1 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_host; host event_name count_star execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2348,14 +2335,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2525,14 +2511,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2708,8 +2693,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2885,8 +2869,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -3062,8 +3045,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3239,8 +3221,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3416,8 +3397,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3593,8 +3573,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3770,8 +3749,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3947,8 +3925,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4124,8 +4101,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4301,8 +4277,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4478,8 +4453,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -4639,8 +4613,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -4748,8 +4721,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -4821,8 +4793,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result index 4f1dddb3f16..532fd209e18 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result +++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result @@ -173,8 +173,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -185,27 +185,26 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -271,8 +270,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -286,8 +285,8 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 1 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -298,19 +297,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 5 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 2 -localhost wait/synch/rwlock/sql/LOCK_grant 2 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -392,13 +390,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -407,31 +405,30 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 8 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -506,13 +503,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -524,12 +521,12 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 1 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -540,19 +537,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 9 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 4 -localhost wait/synch/rwlock/sql/LOCK_grant 4 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -643,53 +639,52 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 12 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -773,18 +768,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -794,16 +789,16 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 1 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -814,19 +809,18 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 13 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 6 -localhost wait/synch/rwlock/sql/LOCK_grant 6 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -926,60 +920,59 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 16 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1074,56 +1067,55 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 17 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1221,51 +1213,50 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 18 localhost wait/synch/mutex/sql/LOCK_connection_count 2 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1365,46 +1356,45 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 19 localhost wait/synch/mutex/sql/LOCK_connection_count 3 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1507,40 +1497,39 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1644,40 +1633,39 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1801,20 +1789,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1938,20 +1925,19 @@ execute dump_waits_host; host event_name count_star localhost wait/io/file/sql/query_log 20 localhost wait/synch/mutex/sql/LOCK_connection_count 4 -localhost wait/synch/mutex/sql/LOCK_user_locks 8 -localhost wait/synch/rwlock/sql/LOCK_grant 8 +localhost wait/synch/mutex/sql/LOCK_user_locks 0 +localhost wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2081,14 +2067,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2224,8 +2209,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2361,8 +2345,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2498,8 +2481,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2635,8 +2617,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2772,8 +2753,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2909,8 +2889,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3046,8 +3025,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3183,8 +3161,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3320,8 +3297,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3457,8 +3433,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3594,8 +3569,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3715,8 +3689,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3800,8 +3773,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3885,8 +3857,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result index 6de38e218ab..76c7311f99c 100644 --- a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result +++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result @@ -147,8 +147,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username status user2 not found username status @@ -159,8 +159,8 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -169,13 +169,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 4 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 4 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -232,8 +231,8 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 1 user2 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -247,8 +246,8 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 1 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -261,13 +260,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 5 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 5 -wait/synch/mutex/sql/LOCK_user_locks 2 -wait/synch/rwlock/sql/LOCK_grant 2 +wait/synch/rwlock/sql/LOCK_grant 1 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -340,13 +338,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username status user3 not found username status @@ -355,12 +353,12 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -369,13 +367,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 8 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 8 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -441,13 +438,13 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 1 user3 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -459,12 +456,12 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 1 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -477,13 +474,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 9 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 9 -wait/synch/mutex/sql/LOCK_user_locks 4 -wait/synch/rwlock/sql/LOCK_grant 4 +wait/synch/rwlock/sql/LOCK_grant 2 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -565,34 +561,34 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username status user4 not found execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -601,13 +597,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 12 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 12 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -682,18 +677,18 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 1 user4 wait/synch/mutex/sql/LOCK_connection_count 0 @@ -703,16 +698,16 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 1 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 @@ -725,13 +720,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 13 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 13 -wait/synch/mutex/sql/LOCK_user_locks 6 -wait/synch/rwlock/sql/LOCK_grant 6 +wait/synch/rwlock/sql/LOCK_grant 3 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -822,41 +816,41 @@ call dump_thread(); username event_name count_star user1 wait/io/file/sql/query_log 4 user1 wait/synch/mutex/sql/LOCK_connection_count 0 -user1 wait/synch/mutex/sql/LOCK_user_locks 2 -user1 wait/synch/rwlock/sql/LOCK_grant 2 +user1 wait/synch/mutex/sql/LOCK_user_locks 0 +user1 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 4 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -865,13 +859,12 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 16 wait/synch/mutex/sql/LOCK_connection_count 0 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 16 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -957,36 +950,36 @@ user1 not found username event_name count_star user2 wait/io/file/sql/query_log 4 user2 wait/synch/mutex/sql/LOCK_connection_count 0 -user2 wait/synch/mutex/sql/LOCK_user_locks 2 -user2 wait/synch/rwlock/sql/LOCK_grant 2 +user2 wait/synch/mutex/sql/LOCK_user_locks 0 +user2 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 4 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -995,14 +988,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 17 wait/synch/mutex/sql/LOCK_connection_count 1 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1091,31 +1083,31 @@ user2 not found username event_name count_star user3 wait/io/file/sql/query_log 4 user3 wait/synch/mutex/sql/LOCK_connection_count 0 -user3 wait/synch/mutex/sql/LOCK_user_locks 2 -user3 wait/synch/rwlock/sql/LOCK_grant 2 +user3 wait/synch/mutex/sql/LOCK_user_locks 0 +user3 wait/synch/rwlock/sql/LOCK_grant 1 username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 4 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -1124,14 +1116,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 18 wait/synch/mutex/sql/LOCK_connection_count 2 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1222,26 +1213,26 @@ user3 not found username event_name count_star user4 wait/io/file/sql/query_log 4 user4 wait/synch/mutex/sql/LOCK_connection_count 0 -user4 wait/synch/mutex/sql/LOCK_user_locks 2 -user4 wait/synch/rwlock/sql/LOCK_grant 2 +user4 wait/synch/mutex/sql/LOCK_user_locks 0 +user4 wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 4 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 0 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -1250,14 +1241,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 19 wait/synch/mutex/sql/LOCK_connection_count 3 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1351,20 +1341,20 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -1373,14 +1363,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1475,20 +1464,20 @@ execute dump_waits_account; user host event_name count_star user1 localhost wait/io/file/sql/query_log 5 user1 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user1 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user1 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user1 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user1 localhost wait/synch/rwlock/sql/LOCK_grant 1 user2 localhost wait/io/file/sql/query_log 5 user2 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user2 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user2 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user2 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user2 localhost wait/synch/rwlock/sql/LOCK_grant 1 user3 localhost wait/io/file/sql/query_log 5 user3 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user3 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user3 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user3 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user3 localhost wait/synch/rwlock/sql/LOCK_grant 1 user4 localhost wait/io/file/sql/query_log 5 user4 localhost wait/synch/mutex/sql/LOCK_connection_count 1 -user4 localhost wait/synch/mutex/sql/LOCK_user_locks 2 -user4 localhost wait/synch/rwlock/sql/LOCK_grant 2 +user4 localhost wait/synch/mutex/sql/LOCK_user_locks 0 +user4 localhost wait/synch/rwlock/sql/LOCK_grant 1 execute dump_waits_user; user event_name count_star execute dump_waits_host; @@ -1497,14 +1486,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1621,14 +1609,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1745,14 +1732,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1869,14 +1855,13 @@ execute dump_waits_global; event_name count_star wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/mutex/sql/LOCK_user_locks 0 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -1999,8 +1984,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2123,8 +2107,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 3 @@ -2247,8 +2230,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2371,8 +2353,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2495,8 +2476,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2619,8 +2599,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2743,8 +2722,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2867,8 +2845,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -2991,8 +2968,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3115,8 +3091,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3239,8 +3214,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star user1 localhost stage/sql/checking permissions 0 @@ -3347,8 +3321,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3419,8 +3392,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; @@ -3491,8 +3463,7 @@ execute dump_waits_history; event_name count(event_name) wait/io/file/sql/query_log 20 wait/synch/mutex/sql/LOCK_connection_count 4 -wait/synch/mutex/sql/LOCK_user_locks 8 -wait/synch/rwlock/sql/LOCK_grant 8 +wait/synch/rwlock/sql/LOCK_grant 4 execute dump_stages_account; user host event_name count_star execute dump_stages_user; diff --git a/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-test/suite/perfschema/r/func_mutex.result index 1c9d0b8a254..657f45d70e9 100644 --- a/mysql-test/suite/perfschema/r/func_mutex.result +++ b/mysql-test/suite/perfschema/r/func_mutex.result @@ -70,52 +70,34 @@ Success TRUNCATE TABLE performance_schema.events_waits_history_long; TRUNCATE TABLE performance_schema.events_waits_history; TRUNCATE TABLE performance_schema.events_waits_current; -SELECT * FROM t1 WHERE id = 1; -id b -1 initial value +show variables like "%not_found%"; +Variable_name Value SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long -WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); -SELECT * FROM t1; -id b -1 initial value -2 initial value -3 initial value -4 initial value -5 initial value -6 initial value -7 initial value -8 initial value +WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); +show variables like "%not_found%"; +Variable_name Value SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long -WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); +WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed; test_fm1_rw_timed Success UPDATE performance_schema.setup_instruments SET enabled = 'NO' -WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant'; +WHERE NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash'; TRUNCATE TABLE performance_schema.events_waits_history_long; TRUNCATE TABLE performance_schema.events_waits_history; TRUNCATE TABLE performance_schema.events_waits_current; -SELECT * FROM t1 WHERE id = 1; -id b -1 initial value +show variables like "%not_found%"; +Variable_name Value SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long -WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); -SELECT * FROM t1; -id b -1 initial value -2 initial value -3 initial value -4 initial value -5 initial value -6 initial value -7 initial value -8 initial value +WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); +show variables like "%not_found%"; +Variable_name Value SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long -WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); +WHERE (EVENT_NAME = 'LOCK_system_variables_hash')); SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; test_fm2_rw_timed Success diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result index 913f98d9663..a50c4ffa297 100644 --- a/mysql-test/suite/perfschema/r/misc.result +++ b/mysql-test/suite/perfschema/r/misc.result @@ -42,12 +42,12 @@ AND EVENT_NAME IN WHERE NAME LIKE "wait/synch/%") LIMIT 1; create table test.t1(a int) engine=performance_schema; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type WHERE object_schema='test'; object_schema object_name create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") SELECT object_schema, object_name FROM performance_schema.objects_summary_global_by_type WHERE object_schema='test'; object_schema object_name diff --git a/mysql-test/suite/perfschema/r/nesting.result b/mysql-test/suite/perfschema/r/nesting.result index a7b26b34776..cac92025a97 100644 --- a/mysql-test/suite/perfschema/r/nesting.result +++ b/mysql-test/suite/perfschema/r/nesting.result @@ -106,140 +106,135 @@ and (end_event_id <= @marker_end) ) all_events order by relative_event_id asc; relative_event_id relative_end_event_id event_name comment nesting_event_type relative_nesting_event_id -0 19 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL -1 5 stage/sql/init (stage) STATEMENT 0 +0 18 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL +1 4 stage/sql/init (stage) STATEMENT 0 2 2 wait/io/socket/sql/client_connection recv STAGE 1 3 3 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1 -4 4 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1 -5 5 wait/io/file/sql/query_log write STAGE 1 -6 6 stage/sql/checking permissions (stage) STATEMENT 0 -7 7 stage/sql/Opening tables (stage) STATEMENT 0 -8 8 stage/sql/init (stage) STATEMENT 0 -9 9 stage/sql/optimizing (stage) STATEMENT 0 -10 12 stage/sql/executing (stage) STATEMENT 0 -11 11 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 10 -12 12 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 10 -13 13 stage/sql/end (stage) STATEMENT 0 -14 14 stage/sql/query end (stage) STATEMENT 0 -15 15 stage/sql/closing tables (stage) STATEMENT 0 -16 16 stage/sql/freeing items (stage) STATEMENT 0 -17 17 wait/io/socket/sql/client_connection send STATEMENT 0 -18 19 stage/sql/cleaning up (stage) STATEMENT 0 -19 19 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 18 -20 20 idle idle NULL NULL -21 40 statement/sql/select select "This is simple statement one" as payload NULL NULL -22 26 stage/sql/init (stage) STATEMENT 21 -23 23 wait/io/socket/sql/client_connection recv STAGE 22 -24 24 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 22 -25 25 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 22 -26 26 wait/io/file/sql/query_log write STAGE 22 -27 27 stage/sql/checking permissions (stage) STATEMENT 21 -28 28 stage/sql/Opening tables (stage) STATEMENT 21 -29 29 stage/sql/init (stage) STATEMENT 21 -30 30 stage/sql/optimizing (stage) STATEMENT 21 -31 33 stage/sql/executing (stage) STATEMENT 21 -32 32 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 31 -33 33 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 31 -34 34 stage/sql/end (stage) STATEMENT 21 -35 35 stage/sql/query end (stage) STATEMENT 21 -36 36 stage/sql/closing tables (stage) STATEMENT 21 -37 37 stage/sql/freeing items (stage) STATEMENT 21 -38 38 wait/io/socket/sql/client_connection send STATEMENT 21 -39 40 stage/sql/cleaning up (stage) STATEMENT 21 -40 40 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 39 -41 41 idle idle NULL NULL -42 61 statement/sql/select select "This is simple statement two" as payload NULL NULL -43 47 stage/sql/init (stage) STATEMENT 42 -44 44 wait/io/socket/sql/client_connection recv STAGE 43 -45 45 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 43 -46 46 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 43 -47 47 wait/io/file/sql/query_log write STAGE 43 -48 48 stage/sql/checking permissions (stage) STATEMENT 42 -49 49 stage/sql/Opening tables (stage) STATEMENT 42 -50 50 stage/sql/init (stage) STATEMENT 42 -51 51 stage/sql/optimizing (stage) STATEMENT 42 -52 54 stage/sql/executing (stage) STATEMENT 42 -53 53 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 52 -54 54 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 52 -55 55 stage/sql/end (stage) STATEMENT 42 -56 56 stage/sql/query end (stage) STATEMENT 42 -57 57 stage/sql/closing tables (stage) STATEMENT 42 -58 58 stage/sql/freeing items (stage) STATEMENT 42 -59 59 wait/io/socket/sql/client_connection send STATEMENT 42 -60 61 stage/sql/cleaning up (stage) STATEMENT 42 -61 61 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 60 -62 62 idle idle NULL NULL -63 80 statement/sql/select select "This is the first part of a multi query" as payload; +4 4 wait/io/file/sql/query_log write STAGE 1 +5 5 stage/sql/checking permissions (stage) STATEMENT 0 +6 6 stage/sql/Opening tables (stage) STATEMENT 0 +7 7 stage/sql/init (stage) STATEMENT 0 +8 8 stage/sql/optimizing (stage) STATEMENT 0 +9 11 stage/sql/executing (stage) STATEMENT 0 +10 10 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 9 +11 11 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 9 +12 12 stage/sql/end (stage) STATEMENT 0 +13 13 stage/sql/query end (stage) STATEMENT 0 +14 14 stage/sql/closing tables (stage) STATEMENT 0 +15 15 stage/sql/freeing items (stage) STATEMENT 0 +16 16 wait/io/socket/sql/client_connection send STATEMENT 0 +17 18 stage/sql/cleaning up (stage) STATEMENT 0 +18 18 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 17 +19 19 idle idle NULL NULL +20 38 statement/sql/select select "This is simple statement one" as payload NULL NULL +21 24 stage/sql/init (stage) STATEMENT 20 +22 22 wait/io/socket/sql/client_connection recv STAGE 21 +23 23 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 21 +24 24 wait/io/file/sql/query_log write STAGE 21 +25 25 stage/sql/checking permissions (stage) STATEMENT 20 +26 26 stage/sql/Opening tables (stage) STATEMENT 20 +27 27 stage/sql/init (stage) STATEMENT 20 +28 28 stage/sql/optimizing (stage) STATEMENT 20 +29 31 stage/sql/executing (stage) STATEMENT 20 +30 30 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 29 +31 31 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 29 +32 32 stage/sql/end (stage) STATEMENT 20 +33 33 stage/sql/query end (stage) STATEMENT 20 +34 34 stage/sql/closing tables (stage) STATEMENT 20 +35 35 stage/sql/freeing items (stage) STATEMENT 20 +36 36 wait/io/socket/sql/client_connection send STATEMENT 20 +37 38 stage/sql/cleaning up (stage) STATEMENT 20 +38 38 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 37 +39 39 idle idle NULL NULL +40 58 statement/sql/select select "This is simple statement two" as payload NULL NULL +41 44 stage/sql/init (stage) STATEMENT 40 +42 42 wait/io/socket/sql/client_connection recv STAGE 41 +43 43 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 41 +44 44 wait/io/file/sql/query_log write STAGE 41 +45 45 stage/sql/checking permissions (stage) STATEMENT 40 +46 46 stage/sql/Opening tables (stage) STATEMENT 40 +47 47 stage/sql/init (stage) STATEMENT 40 +48 48 stage/sql/optimizing (stage) STATEMENT 40 +49 51 stage/sql/executing (stage) STATEMENT 40 +50 50 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 49 +51 51 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 49 +52 52 stage/sql/end (stage) STATEMENT 40 +53 53 stage/sql/query end (stage) STATEMENT 40 +54 54 stage/sql/closing tables (stage) STATEMENT 40 +55 55 stage/sql/freeing items (stage) STATEMENT 40 +56 56 wait/io/socket/sql/client_connection send STATEMENT 40 +57 58 stage/sql/cleaning up (stage) STATEMENT 40 +58 58 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 57 +59 59 idle idle NULL NULL +60 76 statement/sql/select select "This is the first part of a multi query" as payload; select "And this is the second part of a multi query" as payload; select "With a third part to make things complete" as payload NULL NULL -64 68 stage/sql/init (stage) STATEMENT 63 -65 65 wait/io/socket/sql/client_connection recv STAGE 64 -66 66 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 64 -67 67 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 64 -68 68 wait/io/file/sql/query_log write STAGE 64 -69 69 stage/sql/checking permissions (stage) STATEMENT 63 -70 70 stage/sql/Opening tables (stage) STATEMENT 63 -71 71 stage/sql/init (stage) STATEMENT 63 -72 72 stage/sql/optimizing (stage) STATEMENT 63 -73 75 stage/sql/executing (stage) STATEMENT 63 -74 74 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73 -75 75 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73 -76 76 stage/sql/end (stage) STATEMENT 63 -77 77 stage/sql/query end (stage) STATEMENT 63 -78 78 stage/sql/closing tables (stage) STATEMENT 63 -79 80 stage/sql/freeing items (stage) STATEMENT 63 -80 80 wait/io/socket/sql/client_connection send STAGE 79 -81 95 statement/sql/select select "And this is the second part of a multi query" as payload; +61 64 stage/sql/init (stage) STATEMENT 60 +62 62 wait/io/socket/sql/client_connection recv STAGE 61 +63 63 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 61 +64 64 wait/io/file/sql/query_log write STAGE 61 +65 65 stage/sql/checking permissions (stage) STATEMENT 60 +66 66 stage/sql/Opening tables (stage) STATEMENT 60 +67 67 stage/sql/init (stage) STATEMENT 60 +68 68 stage/sql/optimizing (stage) STATEMENT 60 +69 71 stage/sql/executing (stage) STATEMENT 60 +70 70 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 69 +71 71 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 69 +72 72 stage/sql/end (stage) STATEMENT 60 +73 73 stage/sql/query end (stage) STATEMENT 60 +74 74 stage/sql/closing tables (stage) STATEMENT 60 +75 76 stage/sql/freeing items (stage) STATEMENT 60 +76 76 wait/io/socket/sql/client_connection send STAGE 75 +77 91 statement/sql/select select "And this is the second part of a multi query" as payload; select "With a third part to make things complete" as payload NULL NULL -82 83 stage/sql/init (stage) STATEMENT 81 -83 83 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 82 -84 84 stage/sql/checking permissions (stage) STATEMENT 81 -85 85 stage/sql/Opening tables (stage) STATEMENT 81 -86 86 stage/sql/init (stage) STATEMENT 81 -87 87 stage/sql/optimizing (stage) STATEMENT 81 -88 90 stage/sql/executing (stage) STATEMENT 81 -89 89 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 88 -90 90 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 88 -91 91 stage/sql/end (stage) STATEMENT 81 -92 92 stage/sql/query end (stage) STATEMENT 81 -93 93 stage/sql/closing tables (stage) STATEMENT 81 -94 95 stage/sql/freeing items (stage) STATEMENT 81 -95 95 wait/io/socket/sql/client_connection send STAGE 94 -96 112 statement/sql/select select "With a third part to make things complete" as payload NULL NULL -97 98 stage/sql/init (stage) STATEMENT 96 -98 98 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 97 -99 99 stage/sql/checking permissions (stage) STATEMENT 96 -100 100 stage/sql/Opening tables (stage) STATEMENT 96 -101 101 stage/sql/init (stage) STATEMENT 96 -102 102 stage/sql/optimizing (stage) STATEMENT 96 -103 105 stage/sql/executing (stage) STATEMENT 96 -104 104 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 103 -105 105 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 103 -106 106 stage/sql/end (stage) STATEMENT 96 -107 107 stage/sql/query end (stage) STATEMENT 96 -108 108 stage/sql/closing tables (stage) STATEMENT 96 -109 109 stage/sql/freeing items (stage) STATEMENT 96 -110 110 wait/io/socket/sql/client_connection send STATEMENT 96 -111 112 stage/sql/cleaning up (stage) STATEMENT 96 -112 112 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 111 -113 113 idle idle NULL NULL -114 133 statement/sql/select select "MARKER_END" as marker NULL NULL -115 119 stage/sql/init (stage) STATEMENT 114 -116 116 wait/io/socket/sql/client_connection recv STAGE 115 -117 117 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 115 -118 118 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 115 -119 119 wait/io/file/sql/query_log write STAGE 115 -120 120 stage/sql/checking permissions (stage) STATEMENT 114 -121 121 stage/sql/Opening tables (stage) STATEMENT 114 -122 122 stage/sql/init (stage) STATEMENT 114 -123 123 stage/sql/optimizing (stage) STATEMENT 114 -124 126 stage/sql/executing (stage) STATEMENT 114 -125 125 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 124 -126 126 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 124 -127 127 stage/sql/end (stage) STATEMENT 114 -128 128 stage/sql/query end (stage) STATEMENT 114 -129 129 stage/sql/closing tables (stage) STATEMENT 114 -130 130 stage/sql/freeing items (stage) STATEMENT 114 -131 131 wait/io/socket/sql/client_connection send STATEMENT 114 -132 133 stage/sql/cleaning up (stage) STATEMENT 114 -133 133 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 132 +78 79 stage/sql/init (stage) STATEMENT 77 +79 79 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 78 +80 80 stage/sql/checking permissions (stage) STATEMENT 77 +81 81 stage/sql/Opening tables (stage) STATEMENT 77 +82 82 stage/sql/init (stage) STATEMENT 77 +83 83 stage/sql/optimizing (stage) STATEMENT 77 +84 86 stage/sql/executing (stage) STATEMENT 77 +85 85 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 84 +86 86 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 84 +87 87 stage/sql/end (stage) STATEMENT 77 +88 88 stage/sql/query end (stage) STATEMENT 77 +89 89 stage/sql/closing tables (stage) STATEMENT 77 +90 91 stage/sql/freeing items (stage) STATEMENT 77 +91 91 wait/io/socket/sql/client_connection send STAGE 90 +92 108 statement/sql/select select "With a third part to make things complete" as payload NULL NULL +93 94 stage/sql/init (stage) STATEMENT 92 +94 94 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 93 +95 95 stage/sql/checking permissions (stage) STATEMENT 92 +96 96 stage/sql/Opening tables (stage) STATEMENT 92 +97 97 stage/sql/init (stage) STATEMENT 92 +98 98 stage/sql/optimizing (stage) STATEMENT 92 +99 101 stage/sql/executing (stage) STATEMENT 92 +100 100 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 99 +101 101 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 99 +102 102 stage/sql/end (stage) STATEMENT 92 +103 103 stage/sql/query end (stage) STATEMENT 92 +104 104 stage/sql/closing tables (stage) STATEMENT 92 +105 105 stage/sql/freeing items (stage) STATEMENT 92 +106 106 wait/io/socket/sql/client_connection send STATEMENT 92 +107 108 stage/sql/cleaning up (stage) STATEMENT 92 +108 108 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 107 +109 109 idle idle NULL NULL +110 128 statement/sql/select select "MARKER_END" as marker NULL NULL +111 114 stage/sql/init (stage) STATEMENT 110 +112 112 wait/io/socket/sql/client_connection recv STAGE 111 +113 113 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 111 +114 114 wait/io/file/sql/query_log write STAGE 111 +115 115 stage/sql/checking permissions (stage) STATEMENT 110 +116 116 stage/sql/Opening tables (stage) STATEMENT 110 +117 117 stage/sql/init (stage) STATEMENT 110 +118 118 stage/sql/optimizing (stage) STATEMENT 110 +119 121 stage/sql/executing (stage) STATEMENT 110 +120 120 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 119 +121 121 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 119 +122 122 stage/sql/end (stage) STATEMENT 110 +123 123 stage/sql/query end (stage) STATEMENT 110 +124 124 stage/sql/closing tables (stage) STATEMENT 110 +125 125 stage/sql/freeing items (stage) STATEMENT 110 +126 126 wait/io/socket/sql/client_connection send STATEMENT 110 +127 128 stage/sql/cleaning up (stage) STATEMENT 110 +128 128 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 127 diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result index 55c42c9a149..85e46759f22 100644 --- a/mysql-test/suite/perfschema/r/privilege.result +++ b/mysql-test/suite/perfschema/r/privilege.result @@ -152,13 +152,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.file_instances; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_instruments' @@ -250,13 +250,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.file_instances; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'setup_instruments' @@ -348,13 +348,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.file_instances; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'setup_instruments' @@ -446,13 +446,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") create table test.t1 like performance_schema.file_instances; -ERROR HY000: Can't create table 'test.t1' (errno: 131 "Command not supported by database") +ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by database") insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'setup_instruments' diff --git a/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-test/suite/perfschema/t/func_mutex.test index a6940710626..13e63286e8e 100644 --- a/mysql-test/suite/perfschema/t/func_mutex.test +++ b/mysql-test/suite/perfschema/t/func_mutex.test @@ -87,38 +87,38 @@ TRUNCATE TABLE performance_schema.events_waits_history_long; TRUNCATE TABLE performance_schema.events_waits_history; TRUNCATE TABLE performance_schema.events_waits_current; -SELECT * FROM t1 WHERE id = 1; +show variables like "%not_found%"; SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long - WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); -SELECT * FROM t1; +show variables like "%not_found%"; SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long - WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed; UPDATE performance_schema.setup_instruments SET enabled = 'NO' -WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant'; +WHERE NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash'; TRUNCATE TABLE performance_schema.events_waits_history_long; TRUNCATE TABLE performance_schema.events_waits_history; TRUNCATE TABLE performance_schema.events_waits_current; -SELECT * FROM t1 WHERE id = 1; +show variables like "%not_found%"; SET @before_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long - WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); -SELECT * FROM t1; +show variables like "%not_found%"; SET @after_count = (SELECT SUM(TIMER_WAIT) FROM performance_schema.events_waits_history_long - WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + WHERE (EVENT_NAME = 'LOCK_system_variables_hash')); SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test index 1c98d43a1f5..af19e8db51d 100644 --- a/mysql-test/suite/perfschema/t/misc.test +++ b/mysql-test/suite/perfschema/t/misc.test @@ -5,10 +5,6 @@ --source include/have_perfschema.inc --source include/have_innodb.inc -if (`select version() like '10.0.0-%'`) { - skip upstream bug#67098; -} - # # Bug#12790483 OBJECTS_SUMMARY_GLOBAL_BY_TYPE AND RENAME TABLE # diff --git a/mysql-test/suite/plugins/r/audit_null.result b/mysql-test/suite/plugins/r/audit_null.result index 4cf648510e6..2b1b64a9d85 100644 --- a/mysql-test/suite/plugins/r/audit_null.result +++ b/mysql-test/suite/plugins/r/audit_null.result @@ -9,8 +9,8 @@ ERROR 42S22: Unknown column 'foobar' in 'field list' show status like 'audit_null%'; Variable_name Value Audit_null_called 9 -Audit_null_general_error 1 Audit_null_general_log 3 +Audit_null_general_error 1 Audit_null_general_result 2 create procedure au1(x char(16)) select concat("test1", x); call au1("-12"); @@ -19,8 +19,8 @@ test1-12 show status like 'audit_null%'; Variable_name Value Audit_null_called 19 -Audit_null_general_error 1 Audit_null_general_log 7 +Audit_null_general_error 1 Audit_null_general_result 5 uninstall plugin audit_null; Warnings: diff --git a/mysql-test/suite/plugins/r/audit_null_debug.result b/mysql-test/suite/plugins/r/audit_null_debug.result index 2b5fa291f24..86a22135852 100644 --- a/mysql-test/suite/plugins/r/audit_null_debug.result +++ b/mysql-test/suite/plugins/r/audit_null_debug.result @@ -1,4 +1,4 @@ -call mtr.add_suppression("mysql/plugin.MYI"); +call mtr.add_suppression("Incorrect key file for table.*mysql.plugin.MYI"); SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage'; install plugin audit_null soname 'adt_null'; ERROR HY000: Incorrect key file for table './mysql/plugin.MYI'; try to repair it diff --git a/mysql-test/suite/plugins/r/auth_v0100.result b/mysql-test/suite/plugins/r/auth_v0100.result new file mode 100644 index 00000000000..53affc94947 --- /dev/null +++ b/mysql-test/suite/plugins/r/auth_v0100.result @@ -0,0 +1,18 @@ +install soname 'auth_0x0100'; +select plugin_name, plugin_type_version from information_schema.plugins where plugin_type='authentication' order by plugin_name; +plugin_name plugin_type_version +auth_0x0100 1.0 +mysql_native_password 2.0 +mysql_old_password 2.0 +create user tt identified via auth_0x0100; +grant select on test.* to zzzzzzzzzzzzzzzz; +connect(localhost,tt,,test,MASTER_MYPORT,MASTER_MYSOCK); +ERROR 28000: Access denied for user 'tt'@'localhost' (using password: YES) +grant proxy on zzzzzzzzzzzzzzzz to tt; +select user(), current_user(), @@external_user; +user() tt@localhost +current_user() zzzzzzzzzzzzzzzz@% +@@external_user oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo. +drop user tt; +drop user zzzzzzzzzzzzzzzz; +uninstall plugin auth_0x0100; diff --git a/mysql-test/suite/plugins/r/qc_info.result b/mysql-test/suite/plugins/r/qc_info.result new file mode 100644 index 00000000000..3e967d55f43 --- /dev/null +++ b/mysql-test/suite/plugins/r/qc_info.result @@ -0,0 +1,15 @@ +set global query_cache_size=1355776; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; +statement_schema statement_text result_blocks_count result_blocks_size +test select * from t1 1 512 +drop table t1; +select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; +statement_schema statement_text result_blocks_count result_blocks_size +set global query_cache_size= default; diff --git a/mysql-test/suite/plugins/r/qc_info_priv.result b/mysql-test/suite/plugins/r/qc_info_priv.result new file mode 100644 index 00000000000..c723eca1ec0 --- /dev/null +++ b/mysql-test/suite/plugins/r/qc_info_priv.result @@ -0,0 +1,23 @@ +set global query_cache_size=1355776; +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; +statement_schema statement_text result_blocks_count result_blocks_size +test select * from t1 1 512 +create user mysqltest; +select a from t1; +a +1 +2 +3 +select count(*) from information_schema.query_cache_info; +count(*) +0 +drop user mysqltest; +drop table t1; +set global query_cache_size= default; diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result new file mode 100644 index 00000000000..8b9a41e0e1f --- /dev/null +++ b/mysql-test/suite/plugins/r/show_all_plugins.result @@ -0,0 +1,35 @@ +flush status; +show status like '%libraries%'; +Variable_name Value +Opened_plugin_libraries 0 +select * from information_schema.all_plugins where plugin_library='ha_example.so'; +PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION +EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE 100001.0 ha_example.so 1.4 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1 +UNUSABLE 3.14 NOT INSTALLED DAEMON 100001.0 ha_example.so 1.4 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926 +show status like '%libraries%'; +Variable_name Value +Opened_plugin_libraries 1 +show plugins soname 'ha_example.so'; +Name Status Type Library License +EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL +UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL +show status like '%libraries%'; +Variable_name Value +Opened_plugin_libraries 2 +show plugins soname like '%example%'; +Name Status Type Library License +EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL +UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL +daemon_example NOT INSTALLED DAEMON libdaemon_example.so GPL +three_attempts NOT INSTALLED AUTHENTICATION dialog_examples.so GPL +two_questions NOT INSTALLED AUTHENTICATION dialog_examples.so GPL +show status like '%libraries%'; +Variable_name Value +Opened_plugin_libraries 6 +show plugins soname where library = 'ha_example.so'; +Name Status Type Library License +EXAMPLE NOT INSTALLED STORAGE ENGINE ha_example.so GPL +UNUSABLE NOT INSTALLED DAEMON ha_example.so GPL +select variable_value > 10 from information_schema.global_status where variable_name like '%libraries%'; +variable_value > 10 +1 diff --git a/mysql-test/suite/plugins/t/audit_null_debug.test b/mysql-test/suite/plugins/t/audit_null_debug.test index d9e6cad5524..bd0495843db 100644 --- a/mysql-test/suite/plugins/t/audit_null_debug.test +++ b/mysql-test/suite/plugins/t/audit_null_debug.test @@ -5,19 +5,21 @@ if (!$ADT_NULL_SO) { skip No NULL_AUDIT plugin; } -call mtr.add_suppression("mysql/plugin.MYI"); +call mtr.add_suppression("Incorrect key file for table.*mysql.plugin.MYI"); # # MySQL BUG#14485479 - INSTALL AUDIT PLUGIN HANGS IF WE TRY TO DISABLE AND ENABLED DURING DDL OPERATION # (a.k.a. audit event caused by the table access during audit plugin initialization) # SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage'; +--replace_result \\ / --error 126 install plugin audit_null soname 'adt_null'; SET debug_dbug='-d,myisam_pretend_crashed_table_on_usage'; install plugin audit_null soname 'adt_null'; SET debug_dbug='+d,myisam_pretend_crashed_table_on_usage'; +--replace_result \\ / --error 126 uninstall plugin audit_null; SET debug_dbug='-d,myisam_pretend_crashed_table_on_usage'; diff --git a/mysql-test/suite/plugins/t/auth_v0100.test b/mysql-test/suite/plugins/t/auth_v0100.test new file mode 100644 index 00000000000..3cf93ba67f2 --- /dev/null +++ b/mysql-test/suite/plugins/t/auth_v0100.test @@ -0,0 +1,26 @@ +--source include/not_embedded.inc + +if (!$AUTH_0X0100_SO) { + skip No auth_0x0100 plugin; +} + +install soname 'auth_0x0100'; + +select plugin_name, plugin_type_version from information_schema.plugins where plugin_type='authentication' order by plugin_name; + +create user tt identified via auth_0x0100; +grant select on test.* to zzzzzzzzzzzzzzzz; + +--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MASTER_MYPORT MASTER_MYPORT +--error ER_ACCESS_DENIED_ERROR +connect (c0,localhost,tt); + +grant proxy on zzzzzzzzzzzzzzzz to tt; +connect (c1,localhost,tt); +connection c1; + +--query_vertical select user(), current_user(), @@external_user +connection default; +drop user tt; +drop user zzzzzzzzzzzzzzzz; +uninstall plugin auth_0x0100; diff --git a/mysql-test/suite/plugins/t/qc_info.test b/mysql-test/suite/plugins/t/qc_info.test new file mode 100644 index 00000000000..fc6c9d5af3a --- /dev/null +++ b/mysql-test/suite/plugins/t/qc_info.test @@ -0,0 +1,8 @@ +--source qc_info_init.inc + +drop table t1; +# the query was invalidated +select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; + +set global query_cache_size= default; + diff --git a/mysql-test/suite/plugins/t/qc_info_init.inc b/mysql-test/suite/plugins/t/qc_info_init.inc new file mode 100644 index 00000000000..9422bd7f141 --- /dev/null +++ b/mysql-test/suite/plugins/t/qc_info_init.inc @@ -0,0 +1,12 @@ +if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'query_cache_info' and plugin_status='active'`) +{ + --skip QUERY_CACHE_INFO plugin is not active +} + +set global query_cache_size=1355776; + +create table t1 (a int not null); +insert into t1 values (1),(2),(3); +select * from t1; +select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info; + diff --git a/mysql-test/suite/plugins/t/qc_info_init.opt b/mysql-test/suite/plugins/t/qc_info_init.opt new file mode 100644 index 00000000000..663de4da7d7 --- /dev/null +++ b/mysql-test/suite/plugins/t/qc_info_init.opt @@ -0,0 +1,2 @@ +--loose-query_cache_info +--plugin-load=$QUERY_CACHE_INFO_SO diff --git a/mysql-test/suite/plugins/t/qc_info_priv.test b/mysql-test/suite/plugins/t/qc_info_priv.test new file mode 100644 index 00000000000..31c394107c1 --- /dev/null +++ b/mysql-test/suite/plugins/t/qc_info_priv.test @@ -0,0 +1,15 @@ +--source include/not_embedded.inc +--source qc_info_init.inc + +# try an unprivileged user +create user mysqltest; +connect (conn1,localhost,mysqltest,,); +connection conn1; +select a from t1; +select count(*) from information_schema.query_cache_info; +connection default; +drop user mysqltest; +drop table t1; + +set global query_cache_size= default; + diff --git a/mysql-test/suite/plugins/t/show_all_plugins.test b/mysql-test/suite/plugins/t/show_all_plugins.test new file mode 100644 index 00000000000..1beca12b52c --- /dev/null +++ b/mysql-test/suite/plugins/t/show_all_plugins.test @@ -0,0 +1,26 @@ +if (!$DIALOG_EXAMPLES_SO) { skip requires dialog_examples.so; } +if (!$HA_EXAMPLE_SO) { skip requires ha_examples.so; } +if (!$LIBDAEMON_EXAMPLE_SO) { skip requires libdaemon_examples.so; } +if (!$UDF_EXAMPLE_SO) { skip requires udf_example.so; } + +flush status; +show status like '%libraries%'; +#--sorted_result +#select * from information_schema.all_plugins; +#show status like '%libraries%'; +--replace_result .dll .so +eval select * from information_schema.all_plugins where plugin_library='$HA_EXAMPLE_SO'; +show status like '%libraries%'; +--sorted_result +--replace_result .dll .so +eval show plugins soname '$HA_EXAMPLE_SO'; +show status like '%libraries%'; +--sorted_result +--replace_result .dll .so +show plugins soname like '%example%'; +show status like '%libraries%'; +--sorted_result +--replace_result .dll .so +eval show plugins soname where library = '$HA_EXAMPLE_SO'; +select variable_value > 10 from information_schema.global_status where variable_name like '%libraries%'; + 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/replace.result b/mysql-test/suite/rpl/r/replace.result new file mode 100644 index 00000000000..855c54ef8fa --- /dev/null +++ b/mysql-test/suite/rpl/r/replace.result @@ -0,0 +1,22 @@ +include/master-slave.inc +[connection master] +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (pr_id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, pr_page int(11) NOT NULL, pr_type varbinary(60) NOT NULL, test int, UNIQUE KEY pr_pagetype (pr_page,pr_type)) ENGINE=myisam AUTO_INCREMENT=136; +insert into t1 (pr_page, pr_type, test) values(1,"one",0),(2,"two",0); +select * from t1; +pr_id pr_page pr_type test +136 1 one 0 +137 2 two 0 +replace into t1 (pr_page, pr_type,test) values(1,"one",2); +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +137 2 two 0 +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +137 2 two 0 +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result index 5b3f1872c4e..f61ca063b77 100644 --- a/mysql-test/suite/rpl/r/rpl_EE_err.result +++ b/mysql-test/suite/rpl/r/rpl_EE_err.result @@ -4,5 +4,5 @@ create table t1 (a int) engine=myisam; flush tables; drop table if exists t1; Warnings: -Warning 2 Can't find file: 't1' (errno: 2 "No such file or directory") +Warning 2 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directory") include/rpl_end.inc 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_mdev359.result b/mysql-test/suite/rpl/r/rpl_mdev359.result index f4382f672e4..c0c7bac1175 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev359.result +++ b/mysql-test/suite/rpl/r/rpl_mdev359.result @@ -1,7 +1,6 @@ include/master-slave.inc [connection master] CREATE TABLE t1 (a INT) ENGINE=MyISAM; -INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master'; SET GLOBAL rpl_semi_sync_master_enabled = ON; SET DEBUG_SYNC = "rpl_semisync_master_commit_trx_before_lock SIGNAL m1_ready WAIT_FOR m1_cont"; INSERT INTO t1 SELECT * FROM t1; @@ -9,5 +8,4 @@ SET DEBUG_SYNC= "now WAIT_FOR m1_ready"; SET GLOBAL rpl_semi_sync_master_enabled = OFF; SET DEBUG_SYNC= "now SIGNAL m1_cont"; DROP TABLE t1; -UNINSTALL PLUGIN rpl_semi_sync_master; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result index e43ff4303f6..f9504641ffb 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev382.result +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -155,6 +155,7 @@ master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=14 master-bin.000001 # Execute_load_query 1 # 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 1 # 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 /*!*/; @@ -198,6 +199,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! @@ -247,6 +249,7 @@ master-bin.000001 # User var 1 # @```c`=-123450123456789012345678901234567890123 master-bin.000001 # User var 1 # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci master-bin.000001 # Query 1 # 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 1 # 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 /*!*/; @@ -292,6 +295,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 @@ -338,6 +342,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # BEGIN master-bin.000002 # Query 1 # use `test`; INSERT INTO t1 VALUES(1) master-bin.000002 # Query 1 # 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 /*!*/; @@ -364,5 +369,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_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result index 51859b5b49b..06eb56a40c5 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result @@ -1,13 +1,26 @@ include/master-slave.inc [connection master] +call mtr.add_suppression("Timeout waiting for reply of binlog"); +call mtr.add_suppression("Read semi-sync reply"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); +call mtr.add_suppression("Master server does not support semi-sync"); +call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); # # Uninstall semi-sync plugins on master and slave # include/stop_slave.inc +reset slave; +set global rpl_semi_sync_master_enabled= 0; +set global rpl_semi_sync_slave_enabled= 0; +reset master; +set global rpl_semi_sync_master_enabled= 0; +set global rpl_semi_sync_slave_enabled= 0; # # Main test of semi-sync replication start here # [ on master ] +set global rpl_semi_sync_master_timeout= 60000; [ default state of semi-sync on master should be OFF ] show variables like 'rpl_semi_sync_master_enabled'; Variable_name Value @@ -41,9 +54,7 @@ Rpl_semi_sync_master_status OFF show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 0 -# -# INSTALL PLUGIN semi-sync on slave -# +reset master; [ on slave ] [ default state of semi-sync on slave should be OFF ] show variables like 'rpl_semi_sync_slave_enabled'; @@ -84,6 +95,16 @@ select CONNECTIONS_NORMAL_SLAVE - CONNECTIONS_NORMAL_SLAVE as 'Should be 0'; Should be 0 0 [ insert records to table ] +insert t1 values (10); +insert t1 values (9); +insert t1 values (8); +insert t1 values (7); +insert t1 values (6); +insert t1 values (5); +insert t1 values (4); +insert t1 values (3); +insert t1 values (2); +insert t1 values (1); [ master status after inserts ] show status like 'Rpl_semi_sync_master_status'; Variable_name Value @@ -159,6 +180,16 @@ Rpl_semi_sync_master_no_tx 1 show status like 'Rpl_semi_sync_master_yes_tx'; Variable_name Value Rpl_semi_sync_master_yes_tx 14 +delete from t1 where a=10; +delete from t1 where a=9; +delete from t1 where a=8; +delete from t1 where a=7; +delete from t1 where a=6; +delete from t1 where a=5; +delete from t1 where a=4; +delete from t1 where a=3; +delete from t1 where a=2; +delete from t1 where a=1; insert into t1 values (100); [ master status should be OFF ] show status like 'Rpl_semi_sync_master_status'; @@ -278,6 +309,7 @@ Rpl_semi_sync_master_yes_tx 0 [ on slave ] include/stop_slave.inc reset slave; +kill query _tid; include/start_slave.inc [ on master ] create table t1 (a int) engine = ENGINE_TYPE; @@ -307,6 +339,7 @@ include/stop_slave.inc reset slave; [ on master ] reset master; +kill query _tid; set sql_log_bin=0; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; flush privileges; @@ -357,6 +390,7 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF [ on master ] +kill query _tid; [ Semi-sync status on master should be ON ] show status like 'Rpl_semi_sync_master_clients'; Variable_name Value @@ -385,11 +419,7 @@ Variable_name Value Rpl_semi_sync_slave_status ON include/stop_slave.inc [ on master ] -set sql_log_bin=0; -UNINSTALL PLUGIN rpl_semi_sync_master; -set sql_log_bin=1; -SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'; -Variable_name Value +set global rpl_semi_sync_master_enabled= 0; [ on slave ] SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; Variable_name Value @@ -397,18 +427,10 @@ rpl_semi_sync_slave_enabled ON include/start_slave.inc [ on master ] insert into t1 values (10); -[ on slave ] -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; -Variable_name Value -Rpl_semi_sync_slave_status OFF # # Test non-semi-sync slave connect to semi-sync master # -set sql_log_bin=0; -INSTALL PLUGIN rpl_semi_sync_master SONAME 'SEMISYNC_MASTER_SO'; set global rpl_semi_sync_master_timeout= 5000; -/* 5s */ -set sql_log_bin=1; set global rpl_semi_sync_master_enabled= 1; [ on slave ] include/stop_slave.inc @@ -416,16 +438,8 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; Variable_name Value Rpl_semi_sync_slave_status OFF [ uninstall semi-sync slave plugin ] -UNINSTALL PLUGIN rpl_semi_sync_slave; -SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; -Variable_name Value -include/start_slave.inc -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; -Variable_name Value -include/stop_slave.inc -[ reinstall semi-sync slave plugin and disable semi-sync ] -INSTALL PLUGIN rpl_semi_sync_slave SONAME 'SEMISYNC_SLAVE_SO'; set global rpl_semi_sync_slave_enabled= 0; +[ reinstall semi-sync slave plugin and disable semi-sync ] SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; Variable_name Value rpl_semi_sync_slave_enabled OFF @@ -440,11 +454,12 @@ Rpl_semi_sync_slave_status OFF # Clean up # include/stop_slave.inc -UNINSTALL PLUGIN rpl_semi_sync_slave; -UNINSTALL PLUGIN rpl_semi_sync_master; +set global rpl_semi_sync_slave_enabled= 0; +set global rpl_semi_sync_master_enabled= 0; change master to master_user='root',master_password=''; include/start_slave.inc drop table t1; drop user rpl@127.0.0.1; flush privileges; +set global rpl_semi_sync_master_timeout= default; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result index 1c6d73fe681..456c0c4475a 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result @@ -1,6 +1,15 @@ include/master-slave.inc [connection master] +call mtr.add_suppression("Timeout waiting for reply of binlog"); +call mtr.add_suppression("Semi-sync master .* waiting for slave reply"); +call mtr.add_suppression("Read semi-sync reply"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); +call mtr.add_suppression("Master server does not support semi-sync"); +call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +set global rpl_semi_sync_master_enabled = 1; include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = 1; include/start_slave.inc SET GLOBAL event_scheduler = ON; CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=ENGINE_TYPE; @@ -34,8 +43,8 @@ UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 2; UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 1; SET GLOBAL event_scheduler = OFF; include/stop_slave.inc -UNINSTALL PLUGIN rpl_semi_sync_slave; -UNINSTALL PLUGIN rpl_semi_sync_master; +set global rpl_semi_sync_slave_enabled = 0; +set global rpl_semi_sync_master_enabled = 0; include/start_slave.inc DROP EVENT ev1; DROP EVENT ev2; diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index c2d3f5ce212..f7b9daf83b8 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/r/rpl_table_options.result b/mysql-test/suite/rpl/r/rpl_table_options.result index 423a2b65583..d69570a1709 100644 --- a/mysql-test/suite/rpl/r/rpl_table_options.result +++ b/mysql-test/suite/rpl/r/rpl_table_options.result @@ -7,7 +7,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL -) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 +) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340 `VAROPT`='5' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/rpl/r/semisync_memleak_4066.result b/mysql-test/suite/rpl/r/semisync_memleak_4066.result new file mode 100644 index 00000000000..c599f1426d3 --- /dev/null +++ b/mysql-test/suite/rpl/r/semisync_memleak_4066.result @@ -0,0 +1,4 @@ +include/master-slave.inc +[connection master] +CREATE TEMPORARY TABLE tmp (i INT); +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/replace.test b/mysql-test/suite/rpl/t/replace.test new file mode 100644 index 00000000000..36afda0d927 --- /dev/null +++ b/mysql-test/suite/rpl/t/replace.test @@ -0,0 +1,24 @@ +# +# Test of REPLACE with replication +# + +source include/master-slave.inc; + +# +# Test of doing replace on unique key on table with auto_increment +# + +drop table if exists t1; +CREATE TABLE t1 (pr_id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, pr_page int(11) NOT NULL, pr_type varbinary(60) NOT NULL, test int, UNIQUE KEY pr_pagetype (pr_page,pr_type)) ENGINE=myisam AUTO_INCREMENT=136; +insert into t1 (pr_page, pr_type, test) values(1,"one",0),(2,"two",0); +select * from t1; +replace into t1 (pr_page, pr_type,test) values(1,"one",2); +select * from t1; +sync_slave_with_master; +connection slave; +select * from t1; +connection master; +drop table t1; + +# End of 5.5 tests +--source include/rpl_end.inc 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_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test index 9ebed299956..49c5056c485 100644 --- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test +++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test @@ -43,7 +43,7 @@ insert into t3 values(connection_id()); send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); connection master1; -let $wait_condition= SELECT a > 1 FROM t2; +let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'update%' AND state='User lock'; source include/wait_condition.inc; select (@id := id) - id from t3; kill @id; diff --git a/mysql-test/suite/rpl/t/rpl_mdev359.test b/mysql-test/suite/rpl/t/rpl_mdev359.test index ef4e41f5291..96c7ac859d9 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev359.test +++ b/mysql-test/suite/rpl/t/rpl_mdev359.test @@ -1,4 +1,4 @@ ---source include/have_semisync_plugin.inc +--source include/have_semisync.inc --source include/not_embedded.inc --source include/have_debug_sync.inc --source include/have_binlog_format_mixed_or_statement.inc @@ -13,7 +13,6 @@ # the code, disable the semisync, and then continue the paused thread. CREATE TABLE t1 (a INT) ENGINE=MyISAM; -INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master'; SET GLOBAL rpl_semi_sync_master_enabled = ON; --connection master1 SET DEBUG_SYNC = "rpl_semisync_master_commit_trx_before_lock SIGNAL m1_ready WAIT_FOR m1_cont"; @@ -29,8 +28,4 @@ SET DEBUG_SYNC= "now SIGNAL m1_cont"; connection master; DROP TABLE t1; -disable_warnings; -UNINSTALL PLUGIN rpl_semi_sync_master; -enable_warnings; - --source include/rpl_end.inc 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/rpl/t/rpl_rotate_purge_deadlock.test b/mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test index a63844b451c..6db4e2bea04 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_purge_deadlock.test @@ -1,10 +1,10 @@ # # Bug#11763573 - 56299: MUTEX DEADLOCK WITH COM_BINLOG_DUMP, BINLOG PURGE, AND PROCESSLIST/KILL # -source include/master-slave.inc; source include/have_debug_sync.inc; source include/have_binlog_format_row.inc; source include/have_innodb.inc; +source include/master-slave.inc; # # Testing that execution of two concurrent INSERTing connections both diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index b861bb8c8ec..55fefb3aafa 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -13,8 +13,8 @@ let $master_pos_drop_t1= query_get_value(SHOW MASTER STATUS, Position, 1); 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); +let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 8); +let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 8); # Save master log position for query CREATE TABLE t2 let $master_pos_create_t2= query_get_value(SHOW MASTER STATUS, Position, 1); diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index ac5511e28a3..aa36d70d4b7 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -1,4 +1,4 @@ -source include/have_semisync_plugin.inc; +source include/have_semisync.inc; source include/not_embedded.inc; source include/have_innodb.inc; source include/master-slave.inc; @@ -7,7 +7,6 @@ let $engine_type= InnoDB; #let $engine_type= MyISAM; # Suppress warnings that might be generated during the test -disable_query_log; connection master; call mtr.add_suppression("Timeout waiting for reply of binlog"); call mtr.add_suppression("Read semi-sync reply"); @@ -16,7 +15,6 @@ connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); -enable_query_log; connection master; # wait for dying connections (if any) to disappear @@ -32,27 +30,15 @@ let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connec --echo # Uninstall semi-sync plugins on master and slave --echo # connection slave; -disable_query_log; source include/stop_slave.inc; reset slave; -disable_warnings; -error 0,1305; -UNINSTALL PLUGIN rpl_semi_sync_slave; -error 0,1305; -UNINSTALL PLUGIN rpl_semi_sync_master; -enable_warnings; +set global rpl_semi_sync_master_enabled= 0; +set global rpl_semi_sync_slave_enabled= 0; connection master; reset master; -set sql_log_bin=0; -disable_warnings; -error 0,1305; -UNINSTALL PLUGIN rpl_semi_sync_slave; -error 0,1305; -UNINSTALL PLUGIN rpl_semi_sync_master; -enable_warnings; -set sql_log_bin=1; -enable_query_log; +set global rpl_semi_sync_master_enabled= 0; +set global rpl_semi_sync_slave_enabled= 0; --echo # --echo # Main test of semi-sync replication start here @@ -61,16 +47,7 @@ enable_query_log; connection master; echo [ on master ]; -disable_query_log; -let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1); -if ($value == No such row) -{ - set sql_log_bin=0; - eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; - set global rpl_semi_sync_master_timeout= 60000; /* 60s */ - set sql_log_bin=1; -} -enable_query_log; +set global rpl_semi_sync_master_timeout= 60000; # 60s echo [ default state of semi-sync on master should be OFF ]; show variables like 'rpl_semi_sync_master_enabled'; @@ -116,28 +93,12 @@ show status like 'Rpl_semi_sync_master_status'; --replace_result 305 304 show status like 'Rpl_semi_sync_master_yes_tx'; -disable_query_log; # reset master to make sure the following test will start with a clean environment reset master; -enable_query_log; - ---echo # ---echo # INSTALL PLUGIN semi-sync on slave ---echo # connection slave; echo [ on slave ]; -disable_query_log; -let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1); -if ($value == No such row) -{ - set sql_log_bin=0; - eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO'; - set sql_log_bin=1; -} -enable_query_log; - echo [ default state of semi-sync on slave should be OFF ]; show variables like 'rpl_semi_sync_slave_enabled'; @@ -177,15 +138,17 @@ let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_conn replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE; eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0'; -let $i=10; echo [ insert records to table ]; -disable_query_log; -while ($i) -{ - eval insert into t1 values ($i); - dec $i; -} -enable_query_log; +insert t1 values (10); +insert t1 values (9); +insert t1 values (8); +insert t1 values (7); +insert t1 values (6); +insert t1 values (5); +insert t1 values (4); +insert t1 values (3); +insert t1 values (2); +insert t1 values (1); echo [ master status after inserts ]; show status like 'Rpl_semi_sync_master_status'; @@ -271,14 +234,16 @@ show status like 'Rpl_semi_sync_master_yes_tx'; # Semi-sync status on master is now OFF, so all these transactions # will be replicated asynchronously. -let $i=10; -disable_query_log; -while ($i) -{ - eval delete from t1 where a=$i; - dec $i; -} -enable_query_log; +delete from t1 where a=10; +delete from t1 where a=9; +delete from t1 where a=8; +delete from t1 where a=7; +delete from t1 where a=6; +delete from t1 where a=5; +delete from t1 where a=4; +delete from t1 where a=3; +delete from t1 where a=2; +delete from t1 where a=1; insert into t1 values (100); @@ -408,9 +373,8 @@ connection master; let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; if ($_tid) { - disable_query_log; + --replace_result $_tid _tid eval kill query $_tid; - enable_query_log; # After dump thread exit, Rpl_semi_sync_master_clients will be 0 let $status_var= Rpl_semi_sync_master_clients; @@ -463,9 +427,8 @@ reset master; let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; if ($_tid) { - disable_query_log; + --replace_result $_tid _tid eval kill query $_tid; - enable_query_log; # After dump thread exit, Rpl_semi_sync_master_clients will be 0 let $status_var= Rpl_semi_sync_master_clients; @@ -525,9 +488,8 @@ echo [ on master ]; let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`; if ($_tid) { - disable_query_log; + --replace_result $_tid _tid eval kill query $_tid; - enable_query_log; # After dump thread exit, Rpl_semi_sync_master_clients will be 0 let $status_var= Rpl_semi_sync_master_clients; @@ -562,11 +524,7 @@ connection slave; source include/stop_slave.inc; connection master; echo [ on master ]; -set sql_log_bin=0; -UNINSTALL PLUGIN rpl_semi_sync_master; -set sql_log_bin=1; -enable_query_log; -SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'; +set global rpl_semi_sync_master_enabled= 0; connection slave; echo [ on slave ]; @@ -577,19 +535,13 @@ connection master; echo [ on master ]; insert into t1 values (10); sync_slave_with_master; -echo [ on slave ]; -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; --echo # --echo # Test non-semi-sync slave connect to semi-sync master --echo # connection master; -set sql_log_bin=0; -replace_result $SEMISYNC_MASTER_SO SEMISYNC_MASTER_SO; -eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; -set global rpl_semi_sync_master_timeout= 5000; /* 5s */ -set sql_log_bin=1; +set global rpl_semi_sync_master_timeout= 5000; # 5s set global rpl_semi_sync_master_enabled= 1; connection slave; @@ -598,16 +550,9 @@ source include/stop_slave.inc; SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; echo [ uninstall semi-sync slave plugin ]; -UNINSTALL PLUGIN rpl_semi_sync_slave; -SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; -source include/start_slave.inc; -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; -source include/stop_slave.inc; +set global rpl_semi_sync_slave_enabled= 0; echo [ reinstall semi-sync slave plugin and disable semi-sync ]; -replace_result $SEMISYNC_SLAVE_SO SEMISYNC_SLAVE_SO; -eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO'; -set global rpl_semi_sync_slave_enabled= 0; SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; source include/start_slave.inc; @@ -619,14 +564,10 @@ SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; connection slave; source include/stop_slave.inc; -UNINSTALL PLUGIN rpl_semi_sync_slave; +set global rpl_semi_sync_slave_enabled= 0; connection master; -# The dump thread may still be running on the master, and so the following -# UNINSTALL could generate a warning about the plugin is busy. -disable_warnings; -UNINSTALL PLUGIN rpl_semi_sync_master; -enable_warnings; +set global rpl_semi_sync_master_enabled= 0; connection slave; change master to master_user='root',master_password=''; @@ -639,4 +580,5 @@ sync_slave_with_master; connection master; drop user rpl@127.0.0.1; flush privileges; +set global rpl_semi_sync_master_timeout= default; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test index b4a9a9e6e59..b8f3c8130be 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test @@ -1,12 +1,11 @@ -source include/have_semisync_plugin.inc; +source include/have_semisync.inc; source include/not_embedded.inc; -source include/master-slave.inc; source include/have_innodb.inc; +source include/master-slave.inc; let $engine_type= InnoDB; # Suppress warnings that might be generated during the test -disable_query_log; connection master; call mtr.add_suppression("Timeout waiting for reply of binlog"); call mtr.add_suppression("Semi-sync master .* waiting for slave reply"); @@ -16,33 +15,13 @@ connection slave; call mtr.add_suppression("Master server does not support semi-sync"); call mtr.add_suppression("Semi-sync slave .* reply"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); -enable_query_log; connection master; -disable_query_log; -let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1); -if ($value == No such row) -{ - set sql_log_bin=0; - eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; - SET GLOBAL rpl_semi_sync_master_enabled = 1; - set sql_log_bin=1; -} -enable_query_log; +set global rpl_semi_sync_master_enabled = 1; connection slave; source include/stop_slave.inc; - -disable_query_log; -let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1); -if ($value == No such row) -{ - set sql_log_bin=0; - eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO'; - SET GLOBAL rpl_semi_sync_slave_enabled = 1; - set sql_log_bin=1; -} -enable_query_log; +set global rpl_semi_sync_slave_enabled = 1; source include/start_slave.inc; @@ -93,18 +72,16 @@ while ($run) # connection slave; source include/stop_slave.inc; - -disable_warnings; -UNINSTALL PLUGIN rpl_semi_sync_slave; +set global rpl_semi_sync_slave_enabled = 0; connection master; -UNINSTALL PLUGIN rpl_semi_sync_master; -enable_warnings; +set global rpl_semi_sync_master_enabled = 0; connection slave; source include/start_slave.inc; connection master; + DROP EVENT ev1; DROP EVENT ev2; DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test index 16f89123d75..0805308aa73 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_000001.test +++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test @@ -88,7 +88,8 @@ insert into t3 select get_lock('crash_lock%20C', 1) from t2; connection master; send update t1 set n = n + get_lock('crash_lock%20C', 2); connection master1; -sleep 3; +let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'update%' AND state='User lock'; +source include/wait_condition.inc; select (@id := id) - id from t2; kill @id; # We don't drop t3 as this is a temporary table diff --git a/mysql-test/suite/rpl/t/semisync_memleak_4066.test b/mysql-test/suite/rpl/t/semisync_memleak_4066.test new file mode 100644 index 00000000000..f888f764b43 --- /dev/null +++ b/mysql-test/suite/rpl/t/semisync_memleak_4066.test @@ -0,0 +1,15 @@ +# +# MDEV-4066 semisync_master + temporary tables causes memory leaks +# +source include/have_semisync.inc; +source include/have_binlog_format_row.inc; +source include/master-slave.inc; + +connection master; + +--connect (con1,localhost,root,,) +CREATE TEMPORARY TABLE tmp (i INT); +--disconnect con1 + +source include/rpl_end.inc; + diff --git a/mysql-test/suite/sphinx/sphinx.result b/mysql-test/suite/sphinx/sphinx.result index 82c76335e0b..5fe11f4671b 100644 --- a/mysql-test/suite/sphinx/sphinx.result +++ b/mysql-test/suite/sphinx/sphinx.result @@ -46,9 +46,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE ts ref q q 257 const 3 Using where with pushed condition SET optimizer_switch=@save_optimizer_switch; drop table ts; -show status like "sphinx_error%"; -Variable_name Value -Sphinx_error OFF show status like "sphinx_total%"; Variable_name Value Sphinx_total 2 diff --git a/mysql-test/suite/sphinx/sphinx.test b/mysql-test/suite/sphinx/sphinx.test index 648eec07f63..126131209c5 100644 --- a/mysql-test/suite/sphinx/sphinx.test +++ b/mysql-test/suite/sphinx/sphinx.test @@ -26,6 +26,9 @@ explain select * from ts where q=';groupby=attr:gid'; SET optimizer_switch=@save_optimizer_switch; drop table ts; -show status like "sphinx_error%"; +# +# Don't show sphinx error as this is different between sphinx versions +# show status like "sphinx_error%"; + show status like "sphinx_total%"; show status like "sphinx_word%"; diff --git a/mysql-test/suite/storage_engine/1st.result b/mysql-test/suite/storage_engine/1st.result index 6b686c2b2b4..192a8f8f39b 100644 --- a/mysql-test/suite/storage_engine/1st.result +++ b/mysql-test/suite/storage_engine/1st.result @@ -4,7 +4,7 @@ SHOW CREATE TABLE t1; SHOW COLUMNS IN t1; INSERT INTO t1 VALUES (1,'a'); INSERT INTO t1 (a,b) VALUES (2,'b'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b diff --git a/mysql-test/suite/storage_engine/1st.test b/mysql-test/suite/storage_engine/1st.test index af7a4503948..c9ebd8b75e4 100644 --- a/mysql-test/suite/storage_engine/1st.test +++ b/mysql-test/suite/storage_engine/1st.test @@ -14,7 +14,7 @@ # - CREATE TABLE .. (column1 <column options>, column2 <column options>) ENGINE=<storage_engine>; # - INSERT INTO TABLE .. VALUES (val1,val2); # - DROP TABLE .. -# - SELECT * FROM .. +# - SELECT a,b FROM .. # - SHOW CREATE TABLE .. # - SHOW COLUMNS IN ... # @@ -62,10 +62,10 @@ if (!$mysql_errname) --source unexpected_result.inc } - SELECT * FROM t1; + SELECT a,b FROM t1; if ($mysql_errname) { - --let $functionality = SELECT * FROM .. + --let $functionality = SELECT a,b FROM .. --source unexpected_result.inc } diff --git a/mysql-test/suite/storage_engine/alter_table.result b/mysql-test/suite/storage_engine/alter_table.result index 6d868a27a36..09696e0e6b6 100644 --- a/mysql-test/suite/storage_engine/alter_table.result +++ b/mysql-test/suite/storage_engine/alter_table.result @@ -105,7 +105,7 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL, `b` int(11) DEFAULT NULL ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 2 2 4 3 diff --git a/mysql-test/suite/storage_engine/alter_table.test b/mysql-test/suite/storage_engine/alter_table.test index 023d8927e16..f99792f5766 100644 --- a/mysql-test/suite/storage_engine/alter_table.test +++ b/mysql-test/suite/storage_engine/alter_table.test @@ -111,7 +111,7 @@ SHOW CREATE TABLE t1; --source alter_table.inc --source mask_engine.inc SHOW CREATE TABLE t1; -SELECT * FROM t1; +SELECT a,b FROM t1; DROP TABLE t1; # Character set, collate diff --git a/mysql-test/suite/storage_engine/alter_tablespace.result b/mysql-test/suite/storage_engine/alter_tablespace.result index 5d8709b2357..71ef910b222 100644 --- a/mysql-test/suite/storage_engine/alter_tablespace.result +++ b/mysql-test/suite/storage_engine/alter_tablespace.result @@ -4,15 +4,15 @@ ALTER TABLE t1 DISCARD TABLESPACE; DROP TABLE t1; CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t1 (a) VALUES (1),(2); -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 ALTER TABLE t1 DISCARD TABLESPACE; -SELECT * FROM t1; +SELECT a FROM t1; ERROR HY000: Got error -1 from storage engine ALTER TABLE t1 IMPORT TABLESPACE; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 diff --git a/mysql-test/suite/storage_engine/alter_tablespace.test b/mysql-test/suite/storage_engine/alter_tablespace.test index 6c429bb98ea..508639c7dc5 100644 --- a/mysql-test/suite/storage_engine/alter_tablespace.test +++ b/mysql-test/suite/storage_engine/alter_tablespace.test @@ -30,7 +30,7 @@ if (!$mysql_errname) --source create_table.inc INSERT INTO t1 (a) VALUES (1),(2); --sorted_result - SELECT * FROM t1; + SELECT a FROM t1; # http://dev.mysql.com/doc/mysql-enterprise-backup/3.5/en/partial.restoring.single.html # To get a "clean" backup we need to either use innobackup, or to monitor show engine innodb status, @@ -64,7 +64,7 @@ EOF --source alter_table.inc --let $error_codes = ER_GET_ERRNO - SELECT * FROM t1; + SELECT a FROM t1; --source check_errors.inc if ($mysql_errname != ER_GET_ERRNO) { @@ -76,7 +76,7 @@ EOF --let $alter_definition = IMPORT TABLESPACE --source alter_table.inc --sorted_result - SELECT * FROM t1; + SELECT a FROM t1; # Adding a warning suppression based on what InnoDB currently does # when it attempts to access a table without an *.ibd file diff --git a/mysql-test/suite/storage_engine/autoinc_secondary.result b/mysql-test/suite/storage_engine/autoinc_secondary.result index ad2b43bc6fe..28b0a406fff 100644 --- a/mysql-test/suite/storage_engine/autoinc_secondary.result +++ b/mysql-test/suite/storage_engine/autoinc_secondary.result @@ -4,7 +4,7 @@ INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a'); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b @@ -17,7 +17,7 @@ INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b a 1 a 2 @@ -30,7 +30,7 @@ INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b a 1 a 5 diff --git a/mysql-test/suite/storage_engine/autoinc_secondary.test b/mysql-test/suite/storage_engine/autoinc_secondary.test index 8b95f1d859e..25fc0f7cfa1 100644 --- a/mysql-test/suite/storage_engine/autoinc_secondary.test +++ b/mysql-test/suite/storage_engine/autoinc_secondary.test @@ -25,7 +25,7 @@ if (!$mysql_errname) INSERT INTO t1 (b) VALUES ('a'),('b'),('b'),('c'),('a'); SELECT LAST_INSERT_ID(); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -45,7 +45,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); SELECT LAST_INSERT_ID(); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -65,7 +65,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES ('a'),('b'),('b'),('c'),('a'); SELECT LAST_INSERT_ID(); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/autoinc_vars.result b/mysql-test/suite/storage_engine/autoinc_vars.result index a9fd8c8d06c..aca21dfd1c4 100644 --- a/mysql-test/suite/storage_engine/autoinc_vars.result +++ b/mysql-test/suite/storage_engine/autoinc_vars.result @@ -5,7 +5,7 @@ INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b @@ -15,7 +15,7 @@ INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 200 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b @@ -28,7 +28,7 @@ INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 850 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b @@ -48,6 +48,6 @@ ERROR 22003: Out of range value for column 'a' at row 1 SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 850 -SELECT * FROM t1; +SELECT a FROM t1; a DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/autoinc_vars.test b/mysql-test/suite/storage_engine/autoinc_vars.test index ceafcd7138f..b154fd794d0 100644 --- a/mysql-test/suite/storage_engine/autoinc_vars.test +++ b/mysql-test/suite/storage_engine/autoinc_vars.test @@ -25,7 +25,7 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c'); SELECT LAST_INSERT_ID(); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; # auto_increment_increment @@ -34,13 +34,13 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f'); SELECT LAST_INSERT_ID(); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; SET auto_increment_increment = 50; INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i'); SELECT LAST_INSERT_ID(); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -60,7 +60,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES (NULL); SELECT LAST_INSERT_ID(); --sorted_result - SELECT * FROM t1; + SELECT a FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/autoincrement.result b/mysql-test/suite/storage_engine/autoincrement.result index bc51a2a82af..44cb8650441 100644 --- a/mysql-test/suite/storage_engine/autoincrement.result +++ b/mysql-test/suite/storage_engine/autoincrement.result @@ -8,7 +8,7 @@ t1 CREATE TABLE `t1` ( KEY `a` (`a`) ) ENGINE=<STORAGE_ENGINE> DEFAULT CHARSET=latin1 INSERT INTO t1 (b) VALUES ('a'),('b'); -SELECT * FROM t1 ORDER BY a; +SELECT a,b FROM t1 ORDER BY a; a b 1 a 2 b @@ -16,7 +16,7 @@ SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 1 INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d'); -SELECT * FROM t1 ORDER BY a; +SELECT a,b FROM t1 ORDER BY a; a b 1 a 2 b @@ -27,7 +27,7 @@ LAST_INSERT_ID() 3 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT INTO t1 (a,b) VALUES (NULL,'e'); -SELECT * FROM t1 ORDER BY a; +SELECT a,b FROM t1 ORDER BY a; a b 1 a 2 b @@ -38,7 +38,7 @@ SELECT LAST_INSERT_ID(); LAST_INSERT_ID() 5 INSERT INTO t1 (a,b) VALUES (0,'f'); -SELECT * FROM t1 ORDER BY a; +SELECT a,b FROM t1 ORDER BY a; a b 0 f 1 a @@ -61,7 +61,7 @@ SHOW TABLE STATUS FROM test LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 # # # # # # # # # 8 # # # # # # # INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j'); -SELECT * FROM t1 ORDER BY a; +SELECT a,b FROM t1 ORDER BY a; a b 0 f 1 a @@ -84,7 +84,7 @@ SHOW TABLE STATUS FROM test LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 # # # # # # # # # 21 # # # # # # # INSERT INTO t1 (a,b) VALUES (NULL,'l'); -SELECT * FROM t1 ORDER BY a; +SELECT a,b FROM t1 ORDER BY a; a b 0 f 1 a @@ -105,7 +105,7 @@ SHOW TABLE STATUS FROM test LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 # # # # # # # # # 22 # # # # # # # INSERT INTO t1 (a,b) VALUES (-5,'m'); -SELECT * FROM t1 ORDER BY a; +SELECT a,b FROM t1 ORDER BY a; a b -5 m 0 f @@ -123,7 +123,7 @@ a b DROP TABLE t1; CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> AUTO_INCREMENT = 100; INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 100 a 101 b diff --git a/mysql-test/suite/storage_engine/autoincrement.test b/mysql-test/suite/storage_engine/autoincrement.test index fb07ea55c57..ddb0ab1b464 100644 --- a/mysql-test/suite/storage_engine/autoincrement.test +++ b/mysql-test/suite/storage_engine/autoincrement.test @@ -26,22 +26,22 @@ if (!$mysql_errname) # Automatic values INSERT INTO t1 (b) VALUES ('a'),('b'); - SELECT * FROM t1 ORDER BY a; + SELECT a,b FROM t1 ORDER BY a; SELECT LAST_INSERT_ID(); INSERT INTO t1 (a,b) VALUES (NULL,'c'),(0,'d'); - SELECT * FROM t1 ORDER BY a; + SELECT a,b FROM t1 ORDER BY a; SELECT LAST_INSERT_ID(); let $sql_mode = `SELECT @@sql_mode`; SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT INTO t1 (a,b) VALUES (NULL,'e'); - SELECT * FROM t1 ORDER BY a; + SELECT a,b FROM t1 ORDER BY a; SELECT LAST_INSERT_ID(); INSERT INTO t1 (a,b) VALUES (0,'f'); - SELECT * FROM t1 ORDER BY a; + SELECT a,b FROM t1 ORDER BY a; SELECT LAST_INSERT_ID(); --replace_result $sql_mode <INITIAL_SQL_MODE> @@ -63,7 +63,7 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (NULL,'i'),(9,'j'); - SELECT * FROM t1 ORDER BY a; + SELECT a,b FROM t1 ORDER BY a; SELECT LAST_INSERT_ID(); --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # @@ -77,7 +77,7 @@ if (!$mysql_errname) SHOW TABLE STATUS FROM test LIKE 't1'; INSERT INTO t1 (a,b) VALUES (NULL,'l'); - SELECT * FROM t1 ORDER BY a; + SELECT a,b FROM t1 ORDER BY a; SELECT LAST_INSERT_ID(); --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # @@ -87,7 +87,7 @@ if (!$mysql_errname) # but won't check what happens to the sequence after that, since the behavior is undefined INSERT INTO t1 (a,b) VALUES (-5,'m'); - SELECT * FROM t1 ORDER BY a; + SELECT a,b FROM t1 ORDER BY a; DROP TABLE t1; } @@ -106,7 +106,7 @@ if (!$mysql_errname) { INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; SELECT LAST_INSERT_ID(); DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/col_opt_default.result b/mysql-test/suite/storage_engine/col_opt_default.result index 2d0a8508b99..d1f3e9d98c6 100644 --- a/mysql-test/suite/storage_engine/col_opt_default.result +++ b/mysql-test/suite/storage_engine/col_opt_default.result @@ -4,7 +4,7 @@ SHOW COLUMNS IN t1; Field Type Null Key Default Extra a int(11) # 0 INSERT INTO t1 (a) VALUES (1); -SELECT * FROM t1; +SELECT a FROM t1; a 1 ALTER TABLE t1 ADD COLUMN b <CHAR_COLUMN> DEFAULT ''; @@ -13,7 +13,7 @@ Field Type Null Key Default Extra a int(11) # 0 b char(8) # INSERT INTO t1 (b) VALUES ('a'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 a 1 diff --git a/mysql-test/suite/storage_engine/col_opt_default.test b/mysql-test/suite/storage_engine/col_opt_default.test index f59daef37fc..3b28def76db 100644 --- a/mysql-test/suite/storage_engine/col_opt_default.test +++ b/mysql-test/suite/storage_engine/col_opt_default.test @@ -25,7 +25,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES (1); --sorted_result - SELECT * FROM t1; + SELECT a FROM t1; --let $alter_definition = ADD COLUMN b $char_col DEFAULT '' --source alter_table.inc @@ -41,7 +41,7 @@ if (!$mysql_errname) INSERT INTO t1 (b) VALUES ('a'); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; } DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/col_opt_not_null.result b/mysql-test/suite/storage_engine/col_opt_not_null.result index 49b834efc26..18508e98e8c 100644 --- a/mysql-test/suite/storage_engine/col_opt_not_null.result +++ b/mysql-test/suite/storage_engine/col_opt_not_null.result @@ -15,20 +15,20 @@ b0 binary(0) # # # # b1 binary(1) # # # # b20 binary(20) # # # # b255 binary(255) # # # # -INSERT INTO t1 VALUES ('','','','',''); -INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('','','','',''); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) 00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 -INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'b0' at row 1 Warning 1265 Data truncated for column 'b1' at row 1 Warning 1265 Data truncated for column 'b20' at row 1 Warning 1265 Data truncated for column 'b255' at row 1 -INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +INSERT INTO t1 (b,b0,b1,b20,b255) SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'b0' at row 1 @@ -237,29 +237,29 @@ a bit(1) # # # b bit(20) # # # c bit(64) # # # d bit(1) # # # -INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; BIN(a) HEX(b) c+0 0 FFFFF 18446744073709551615 -INSERT INTO t1 VALUES (1,0,-1,0); +INSERT INTO t1 (a,b,c,d) VALUES (1,0,-1,0); SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; a+0 b+0 c+0 0 1048575 18446744073709551615 1 0 18446744073709551615 -INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0); SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); a+0 b+0 c+0 1 0 18446744073709551615 1 102 255 -INSERT INTO t1 VALUES (0x10,0,0,1); +INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -SELECT * FROM t1; +SELECT a,b,c,d FROM t1; a b c d -INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0); Warnings: Warning 1264 Out of range value for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c,d FROM t1; a b c d DROP TABLE t1; CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS> NOT NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; @@ -319,7 +319,7 @@ b17m longblob # # # t tinyblob # # # m mediumblob # # # l longblob # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -330,7 +330,7 @@ LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 5 6 65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 -INSERT INTO t1 VALUES +INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); Warnings: Warning 1265 Data truncated for column 'b' at row 1 @@ -392,23 +392,23 @@ SHOW COLUMNS IN t1; Field Type Null Key Default Extra b1 tinyint(1) # # # b2 tinyint(1) # # # -INSERT INTO t1 VALUES (1,TRUE); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (1,TRUE); +SELECT b1,b2 FROM t1; b1 b2 1 1 -INSERT INTO t1 VALUES (FALSE,0); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (FALSE,0); +SELECT b1,b2 FROM t1; b1 b2 0 0 1 1 -INSERT INTO t1 VALUES (2,3); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (2,3); +SELECT b1,b2 FROM t1; b1 b2 0 0 1 1 2 3 -INSERT INTO t1 VALUES (-1,-2); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (-1,-2); +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 @@ -420,28 +420,28 @@ false false true true true true true true -SELECT * FROM t1 WHERE b1 = TRUE; +SELECT b1,b2 FROM t1 WHERE b1 = TRUE; b1 b2 1 1 -SELECT * FROM t1 WHERE b2 = FALSE; +SELECT b1,b2 FROM t1 WHERE b2 = FALSE; b1 b2 0 0 -INSERT INTO t1 VALUES ('a','b'); +INSERT INTO t1 (b1,b2) VALUES ('a','b'); Warnings: Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 -SELECT * FROM t1; +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 0 0 1 1 2 3 -INSERT INTO t1 VALUES (128,-129); +INSERT INTO t1 (b1,b2) VALUES (128,-129); Warnings: Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b2' at row 1 -SELECT * FROM t1; +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 @@ -499,20 +499,20 @@ c0 char(0) # # # c1 char(1) # # # c20 char(20) # # # c255 char(255) # # # -INSERT INTO t1 VALUES ('','','','',''); -INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); -SELECT * FROM t1; +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','',''); +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. -INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); Warnings: Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'c0' at row 1 Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c20' at row 1 Warning 1265 Data truncated for column 'c255' at row 1 -INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; Warnings: Warning 1265 Data truncated for column 'c' at row 2 Warning 1265 Data truncated for column 'c0' at row 2 @@ -523,7 +523,7 @@ Warning 1265 Data truncated for column 'c0' at row 3 Warning 1265 Data truncated for column 'c1' at row 3 Warning 1265 Data truncated for column 'c20' at row 3 Warning 1265 Data truncated for column 'c255' at row 3 -SELECT * FROM t1; +SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 @@ -625,7 +625,7 @@ INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); -SELECT * FROM t1; +SELECT v0,v1,v64,v65000 FROM t1; v0 v1 v64 v65000 @@ -751,18 +751,18 @@ y year(4) # # # y4 year(4) # # # y2 year(2) # # # SET @tm = '2012-04-09 05:27:00'; -INSERT INTO t1 VALUES +INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), ('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), ('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); -SELECT * FROM t1; +SELECT d,dt,ts,t,y,y4,y2 FROM t1; d dt ts t y y4 y2 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 -INSERT INTO t1 VALUES +INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); Warnings: Warning 1265 Data truncated for column 'd' at row 1 @@ -772,7 +772,7 @@ Warning 1264 Out of range value for column 't' at row 1 Warning 1264 Out of range value for column 'y' at row 1 Warning 1264 Out of range value for column 'y4' at row 1 Warning 1264 Out of range value for column 'y2' at row 1 -SELECT * FROM t1; +SELECT d,dt,ts,t,y,y4,y2 FROM t1; d dt ts t y y4 y2 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 @@ -853,7 +853,7 @@ SHOW COLUMNS IN t1; Field Type Null Key Default Extra c timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP INSERT INTO t1 (c) VALUES (NULL); -SELECT * FROM t1; +SELECT c FROM t1; c <TIMESTAMP> DROP TABLE t1; @@ -959,17 +959,17 @@ Field Type Null Key Default Extra a enum('') # # # b enum('test1','test2','test3','test4','test5') # # # c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # -INSERT INTO t1 VALUES ('','test2','4'),('',5,2); -SELECT * FROM t1; +INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2); +SELECT a,b,c FROM t1; a b c test2 4 test5 2 -INSERT INTO t1 VALUES (0,'test6',-1); +INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); Warnings: Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c test2 4 @@ -984,14 +984,14 @@ a enum('') # # # b enum('test1','test2','test3','test4','test5') # # # c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # e enum('a','A') # # # -INSERT INTO t1 VALUES ('','test3','75','A'); -SELECT * FROM t1; +INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A'); +SELECT a,b,c,e FROM t1; a b c e a test2 4 a test3 75 a test5 2 a -SELECT * FROM t1 WHERE b='test2' OR a != ''; +SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != ''; a b c e test2 4 a DROP TABLE t1; @@ -1050,30 +1050,30 @@ n0_0 decimal(10,0) # # # n1 decimal(1,0) # # # n20_4 decimal(20,4) # # # n65_4 decimal(65,4) # # # -INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); -INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -1084,7 +1084,7 @@ Warning 1264 Out of range value for column 'n' at row 1 Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -1092,7 +1092,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -1104,7 +1104,7 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -1113,7 +1113,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); Warnings: Note 1265 Data truncated for column 'd' at row 1 Note 1265 Data truncated for column 'd0' at row 1 @@ -1125,7 +1125,7 @@ Note 1265 Data truncated for column 'n0_0' at row 1 Note 1265 Data truncated for column 'n1' at row 1 Note 1265 Data truncated for column 'n20_4' at row 1 Note 1265 Data truncated for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -1229,8 +1229,8 @@ d1_0 double(1,0) # # # d10_10 double(10,10) # # # d53 double(53,0) # # # d53_10 double(53,10) # # # -INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 11111111.111 d10_10 0.0123456789 @@ -1241,8 +1241,8 @@ f0 12345.1 f20_3 56789.988 f23_0 123457000 r1_1 0.9 -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 99999999999999999999999999999999999999, 99999999999999999999999999999999999999.9999999999999999, 0.9, @@ -1257,7 +1257,7 @@ INSERT INTO t1 VALUES ( Warnings: Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 0 d 11111111.111 @@ -1288,8 +1288,8 @@ f23_0 1e38 r1_1 0.0 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -1341,7 +1341,7 @@ MAX(f0) 9.999999680285692e37 MAX(f20_3) 99999998430674940.000 MAX(f23_0) 9.999999680285692e37 MAX(r1_1) 0.9 -INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f0' at row 1 @@ -1349,7 +1349,7 @@ Warning 1264 Out of range value for column 'r1_1' at row 1 Warning 1264 Out of range value for column 'f23_0' at row 1 Warning 1264 Out of range value for column 'f20_3' at row 1 Warning 1264 Out of range value for column 'd1_0' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -1400,7 +1400,7 @@ r1_1 0.0 r1_1 0.9 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 999999999999999999999999999999999999999, 999999999999999999999999999999999999999.9999999999999999, 1.9, @@ -1423,7 +1423,7 @@ Warning 1264 Out of range value for column 'd1_0' at row 1 Warning 1264 Out of range value for column 'd10_10' at row 1 Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -1594,16 +1594,16 @@ b bigint(20) # # # b0 bigint(20) # # # b1 bigint(1) # # # b20 bigint(20) # # # -INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); -SELECT * FROM t1; +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 -INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); -INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1625,14 +1625,14 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 -INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1654,7 +1654,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1676,7 +1676,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1742,7 +1742,7 @@ Warning 1264 Out of range value for column 'm' at row 4 Warning 1264 Out of range value for column 'm0' at row 4 Warning 1264 Out of range value for column 'm1' at row 4 Warning 1264 Out of range value for column 'm20' at row 4 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 @@ -1912,22 +1912,22 @@ Field Type Null Key Default Extra a set('') # # # b set('test1','test2','test3','test4','test5') # # # c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (a,b,c) VALUES ('','test2,test3','01,34,44,,23'), ('',5,2), (',','test4,test2',''); Warnings: Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c test1,test3 02 test2,test3 01,23,34,44 test2,test4 -INSERT INTO t1 VALUES (0,'test6',-1); +INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 test1,test3 02 @@ -1945,7 +1945,7 @@ c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15' e set('a','A') # # # ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS> NOT NULL; ERROR HY000: Too many strings for column f and SET -SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; a b c e test2,test3 01,23,34,44 test2,test4 @@ -2005,7 +2005,7 @@ t17m longtext # # # tt tinytext # # # m mediumtext # # # l longtext # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -2016,7 +2016,7 @@ LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 5 6 65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 -INSERT INTO t1 VALUES +INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); Warnings: Warning 1265 Data truncated for column 't' at row 1 diff --git a/mysql-test/suite/storage_engine/col_opt_not_null.test b/mysql-test/suite/storage_engine/col_opt_not_null.test index 2cd0e909536..1ec00621518 100644 --- a/mysql-test/suite/storage_engine/col_opt_not_null.test +++ b/mysql-test/suite/storage_engine/col_opt_not_null.test @@ -144,7 +144,7 @@ if (!$mysql_errname) } --replace_regex /[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}/<TIMESTAMP>/ - SELECT * FROM t1; + SELECT c FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/col_opt_null.result b/mysql-test/suite/storage_engine/col_opt_null.result index ebcb91d0c5f..45982faed61 100644 --- a/mysql-test/suite/storage_engine/col_opt_null.result +++ b/mysql-test/suite/storage_engine/col_opt_null.result @@ -15,20 +15,20 @@ b0 binary(0) # # # # b1 binary(1) # # # # b20 binary(20) # # # # b255 binary(255) # # # # -INSERT INTO t1 VALUES ('','','','',''); -INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('','','','',''); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) 00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 -INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'b0' at row 1 Warning 1265 Data truncated for column 'b1' at row 1 Warning 1265 Data truncated for column 'b20' at row 1 Warning 1265 Data truncated for column 'b255' at row 1 -INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +INSERT INTO t1 (b,b0,b1,b20,b255) SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'b0' at row 1 @@ -229,29 +229,29 @@ a bit(1) # # # b bit(20) # # # c bit(64) # # # d bit(1) # # # -INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; BIN(a) HEX(b) c+0 0 FFFFF 18446744073709551615 -INSERT INTO t1 VALUES (1,0,-1,0); +INSERT INTO t1 (a,b,c,d) VALUES (1,0,-1,0); SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; a+0 b+0 c+0 0 1048575 18446744073709551615 1 0 18446744073709551615 -INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0); SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); a+0 b+0 c+0 1 0 18446744073709551615 1 102 255 -INSERT INTO t1 VALUES (0x10,0,0,1); +INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -SELECT * FROM t1; +SELECT a,b,c,d FROM t1; a b c d -INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0); Warnings: Warning 1264 Out of range value for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c,d FROM t1; a b c d DROP TABLE t1; CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS> NULL) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; @@ -307,7 +307,7 @@ b17m longblob # # # t tinyblob # # # m mediumblob # # # l longblob # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -318,7 +318,7 @@ LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 5 6 65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 -INSERT INTO t1 VALUES +INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); Warnings: Warning 1265 Data truncated for column 'b' at row 1 @@ -388,23 +388,23 @@ SHOW COLUMNS IN t1; Field Type Null Key Default Extra b1 tinyint(1) # # # b2 tinyint(1) # # # -INSERT INTO t1 VALUES (1,TRUE); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (1,TRUE); +SELECT b1,b2 FROM t1; b1 b2 1 1 -INSERT INTO t1 VALUES (FALSE,0); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (FALSE,0); +SELECT b1,b2 FROM t1; b1 b2 0 0 1 1 -INSERT INTO t1 VALUES (2,3); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (2,3); +SELECT b1,b2 FROM t1; b1 b2 0 0 1 1 2 3 -INSERT INTO t1 VALUES (-1,-2); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (-1,-2); +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 @@ -416,28 +416,28 @@ false false true true true true true true -SELECT * FROM t1 WHERE b1 = TRUE; +SELECT b1,b2 FROM t1 WHERE b1 = TRUE; b1 b2 1 1 -SELECT * FROM t1 WHERE b2 = FALSE; +SELECT b1,b2 FROM t1 WHERE b2 = FALSE; b1 b2 0 0 -INSERT INTO t1 VALUES ('a','b'); +INSERT INTO t1 (b1,b2) VALUES ('a','b'); Warnings: Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 -SELECT * FROM t1; +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 0 0 1 1 2 3 -INSERT INTO t1 VALUES (128,-129); +INSERT INTO t1 (b1,b2) VALUES (128,-129); Warnings: Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b2' at row 1 -SELECT * FROM t1; +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 @@ -491,20 +491,20 @@ c0 char(0) # # # c1 char(1) # # # c20 char(20) # # # c255 char(255) # # # -INSERT INTO t1 VALUES ('','','','',''); -INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); -SELECT * FROM t1; +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','',''); +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. -INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); Warnings: Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'c0' at row 1 Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c20' at row 1 Warning 1265 Data truncated for column 'c255' at row 1 -INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; Warnings: Warning 1265 Data truncated for column 'c' at row 2 Warning 1265 Data truncated for column 'c0' at row 2 @@ -515,7 +515,7 @@ Warning 1265 Data truncated for column 'c0' at row 3 Warning 1265 Data truncated for column 'c1' at row 3 Warning 1265 Data truncated for column 'c20' at row 3 Warning 1265 Data truncated for column 'c255' at row 3 -SELECT * FROM t1; +SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 @@ -613,7 +613,7 @@ INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); -SELECT * FROM t1; +SELECT v0,v1,v64,v65000 FROM t1; v0 v1 v64 v65000 @@ -735,18 +735,18 @@ y year(4) # # # y4 year(4) # # # y2 year(2) # # # SET @tm = '2012-04-09 05:27:00'; -INSERT INTO t1 VALUES +INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), ('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), ('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); -SELECT * FROM t1; +SELECT d,dt,ts,t,y,y4,y2 FROM t1; d dt ts t y y4 y2 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 -INSERT INTO t1 VALUES +INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); Warnings: Warning 1265 Data truncated for column 'd' at row 1 @@ -756,7 +756,7 @@ Warning 1264 Out of range value for column 't' at row 1 Warning 1264 Out of range value for column 'y' at row 1 Warning 1264 Out of range value for column 'y4' at row 1 Warning 1264 Out of range value for column 'y2' at row 1 -SELECT * FROM t1; +SELECT d,dt,ts,t,y,y4,y2 FROM t1; d dt ts t y y4 y2 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 @@ -927,17 +927,17 @@ Field Type Null Key Default Extra a enum('') # # # b enum('test1','test2','test3','test4','test5') # # # c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # -INSERT INTO t1 VALUES ('','test2','4'),('',5,2); -SELECT * FROM t1; +INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2); +SELECT a,b,c FROM t1; a b c test2 4 test5 2 -INSERT INTO t1 VALUES (0,'test6',-1); +INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); Warnings: Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c test2 4 @@ -952,14 +952,14 @@ a enum('') # # # b enum('test1','test2','test3','test4','test5') # # # c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # e enum('a','A') # # # -INSERT INTO t1 VALUES ('','test3','75','A'); -SELECT * FROM t1; +INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A'); +SELECT a,b,c,e FROM t1; a b c e NULL test2 4 NULL test3 75 a test5 2 NULL -SELECT * FROM t1 WHERE b='test2' OR a != ''; +SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != ''; a b c e test2 4 NULL DROP TABLE t1; @@ -1014,30 +1014,30 @@ n0_0 decimal(10,0) # # # n1 decimal(1,0) # # # n20_4 decimal(20,4) # # # n65_4 decimal(65,4) # # # -INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); -INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -1048,7 +1048,7 @@ Warning 1264 Out of range value for column 'n' at row 1 Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -1056,7 +1056,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -1068,7 +1068,7 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -1077,7 +1077,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); Warnings: Note 1265 Data truncated for column 'd' at row 1 Note 1265 Data truncated for column 'd0' at row 1 @@ -1089,7 +1089,7 @@ Note 1265 Data truncated for column 'n0_0' at row 1 Note 1265 Data truncated for column 'n1' at row 1 Note 1265 Data truncated for column 'n20_4' at row 1 Note 1265 Data truncated for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -1183,8 +1183,8 @@ d1_0 double(1,0) # # # d10_10 double(10,10) # # # d53 double(53,0) # # # d53_10 double(53,10) # # # -INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 11111111.111 d10_10 0.0123456789 @@ -1195,8 +1195,8 @@ f0 12345.1 f20_3 56789.988 f23_0 123457000 r1_1 0.9 -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 99999999999999999999999999999999999999, 99999999999999999999999999999999999999.9999999999999999, 0.9, @@ -1211,7 +1211,7 @@ INSERT INTO t1 VALUES ( Warnings: Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 0 d 11111111.111 @@ -1242,8 +1242,8 @@ f23_0 1e38 r1_1 0.0 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -1295,7 +1295,7 @@ MAX(f0) 9.999999680285692e37 MAX(f20_3) 99999998430674940.000 MAX(f23_0) 9.999999680285692e37 MAX(r1_1) 0.9 -INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f0' at row 1 @@ -1303,7 +1303,7 @@ Warning 1264 Out of range value for column 'r1_1' at row 1 Warning 1264 Out of range value for column 'f23_0' at row 1 Warning 1264 Out of range value for column 'f20_3' at row 1 Warning 1264 Out of range value for column 'd1_0' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -1354,7 +1354,7 @@ r1_1 0.0 r1_1 0.9 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 999999999999999999999999999999999999999, 999999999999999999999999999999999999999.9999999999999999, 1.9, @@ -1377,7 +1377,7 @@ Warning 1264 Out of range value for column 'd1_0' at row 1 Warning 1264 Out of range value for column 'd10_10' at row 1 Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -1540,16 +1540,16 @@ b bigint(20) # # # b0 bigint(20) # # # b1 bigint(1) # # # b20 bigint(20) # # # -INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); -SELECT * FROM t1; +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 -INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); -INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1571,14 +1571,14 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 -INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1600,7 +1600,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1622,7 +1622,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -1688,7 +1688,7 @@ Warning 1264 Out of range value for column 'm' at row 4 Warning 1264 Out of range value for column 'm0' at row 4 Warning 1264 Out of range value for column 'm1' at row 4 Warning 1264 Out of range value for column 'm20' at row 4 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 @@ -1838,22 +1838,22 @@ Field Type Null Key Default Extra a set('') # # # b set('test1','test2','test3','test4','test5') # # # c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (a,b,c) VALUES ('','test2,test3','01,34,44,,23'), ('',5,2), (',','test4,test2',''); Warnings: Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c test1,test3 02 test2,test3 01,23,34,44 test2,test4 -INSERT INTO t1 VALUES (0,'test6',-1); +INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 test1,test3 02 @@ -1871,7 +1871,7 @@ c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15' e set('a','A') # # # ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS> NULL; ERROR HY000: Too many strings for column f and SET -SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; a b c e test2,test3 01,23,34,44 NULL test2,test4 NULL @@ -1927,7 +1927,7 @@ t17m longtext # # # tt tinytext # # # m mediumtext # # # l longtext # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -1938,7 +1938,7 @@ LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 5 6 65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 -INSERT INTO t1 VALUES +INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); Warnings: Warning 1265 Data truncated for column 't' at row 1 diff --git a/mysql-test/suite/storage_engine/col_opt_unsigned.result b/mysql-test/suite/storage_engine/col_opt_unsigned.result index a68aa48ee79..7b5274525ce 100644 --- a/mysql-test/suite/storage_engine/col_opt_unsigned.result +++ b/mysql-test/suite/storage_engine/col_opt_unsigned.result @@ -25,15 +25,15 @@ n0_0 decimal(10,0) unsigned # # # n1 decimal(1,0) unsigned # # # n20_4 decimal(20,4) unsigned # # # n65_4 decimal(65,4) unsigned # # # -INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -45,7 +45,7 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -57,20 +57,20 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -81,7 +81,7 @@ Warning 1264 Out of range value for column 'n' at row 1 Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 @@ -89,7 +89,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -101,7 +101,7 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 @@ -110,7 +110,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); Warnings: Note 1265 Data truncated for column 'd' at row 1 Note 1265 Data truncated for column 'd0' at row 1 @@ -122,7 +122,7 @@ Note 1265 Data truncated for column 'n0_0' at row 1 Note 1265 Data truncated for column 'n1' at row 1 Note 1265 Data truncated for column 'n20_4' at row 1 Note 1265 Data truncated for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 @@ -152,7 +152,7 @@ Warning 1264 Out of range value for column 'b' at row 1 INSERT INTO t1 (a,b) VALUES (-100,100); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 100 1 0 @@ -184,8 +184,8 @@ d1_0 double(1,0) unsigned # # # d10_10 double(10,10) unsigned # # # d53 double(53,0) unsigned # # # d53_10 double(53,10) unsigned # # # -INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 11111111.111 d10_10 0.0123456789 @@ -196,8 +196,8 @@ f0 12345.1 f20_3 56789.988 f23_0 123457000 r1_1 0.9 -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 99999999999999999999999999999999999999, 99999999999999999999999999999999999999.9999999999999999, 0.9, @@ -212,7 +212,7 @@ INSERT INTO t1 VALUES ( Warnings: Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 0 d 11111111.111 @@ -243,7 +243,7 @@ f23_0 1e38 r1_1 0.0 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f0' at row 1 @@ -255,7 +255,7 @@ Warning 1264 Out of range value for column 'd1_0' at row 1 Warning 1264 Out of range value for column 'd10_10' at row 1 Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 0 d 0 @@ -307,7 +307,7 @@ MAX(f0) 9.999999680285692e37 MAX(f20_3) 99999998430674940.000 MAX(f23_0) 9.999999680285692e37 MAX(r1_1) 0.9 -INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f0' at row 1 @@ -315,7 +315,7 @@ Warning 1264 Out of range value for column 'r1_1' at row 1 Warning 1264 Out of range value for column 'f23_0' at row 1 Warning 1264 Out of range value for column 'f20_3' at row 1 Warning 1264 Out of range value for column 'd1_0' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 0 d 0 @@ -366,7 +366,7 @@ r1_1 0.0 r1_1 0.9 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 999999999999999999999999999999999999999, 999999999999999999999999999999999999999.9999999999999999, 1.9, @@ -389,7 +389,7 @@ Warning 1264 Out of range value for column 'd1_0' at row 1 Warning 1264 Out of range value for column 'd10_10' at row 1 Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 0 d 0 @@ -470,7 +470,7 @@ Warning 1264 Out of range value for column 'b' at row 1 INSERT INTO t1 (a,b) VALUES (-100,100); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 100 1 0 @@ -522,15 +522,15 @@ b bigint(20) unsigned # # # b0 bigint(20) unsigned # # # b1 bigint(1) unsigned # # # b20 bigint(20) unsigned # # # -INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); -SELECT * FROM t1; +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 -INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -552,15 +552,15 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); -SELECT * FROM t1; +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 4294967295 4294967295 4294967295 4294967295 255 255 255 255 65535 65535 65535 65535 16777215 16777215 16777215 16777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 -INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -582,7 +582,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -604,7 +604,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -654,7 +654,7 @@ Warning 1264 Out of range value for column 'm' at row 3 Warning 1264 Out of range value for column 'm0' at row 3 Warning 1264 Out of range value for column 'm1' at row 3 Warning 1264 Out of range value for column 'm20' at row 3 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 @@ -690,7 +690,7 @@ Warning 1264 Out of range value for column 's' at row 1 Warning 1264 Out of range value for column 'm' at row 1 Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'b' at row 1 -SELECT * FROM t1; +SELECT t,s,m,i,b FROM t1; t s m i b 0 0 0 0 0 255 65535 16777215 4294967295 18446744073709551615 diff --git a/mysql-test/suite/storage_engine/col_opt_unsigned.test b/mysql-test/suite/storage_engine/col_opt_unsigned.test index e9d4566de7f..62b7b29a507 100644 --- a/mysql-test/suite/storage_engine/col_opt_unsigned.test +++ b/mysql-test/suite/storage_engine/col_opt_unsigned.test @@ -29,7 +29,7 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (1.0,-1.0); INSERT INTO t1 (a,b) VALUES (-100,100); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -56,7 +56,7 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (1.0,-1.0); INSERT INTO t1 (a,b) VALUES (-100,100); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -86,7 +86,7 @@ if (!$mysql_errname) INSERT INTO t1 (t,s,m,i,b) VALUES (255,65535,16777215,4294967295,18446744073709551615); INSERT INTO t1 (t,s,m,i,b) VALUES (-1,-1,-1,-1,-1); --sorted_result - SELECT * FROM t1; + SELECT t,s,m,i,b FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/col_opt_zerofill.result b/mysql-test/suite/storage_engine/col_opt_zerofill.result index c2445c5bbc7..a35ce4bfe66 100644 --- a/mysql-test/suite/storage_engine/col_opt_zerofill.result +++ b/mysql-test/suite/storage_engine/col_opt_zerofill.result @@ -25,15 +25,15 @@ n0_0 decimal(10,0) unsigned zerofill # # # n1 decimal(1,0) unsigned zerofill # # # n20_4 decimal(20,4) unsigned zerofill # # # n65_4 decimal(65,4) unsigned zerofill # # # -INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -45,7 +45,7 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -57,20 +57,20 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -81,7 +81,7 @@ Warning 1264 Out of range value for column 'n' at row 1 Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 @@ -89,7 +89,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0000000100 0000123456 0.3 00040000.25 00000000000000000000000000000000123456789123456789.1000100000 0000001024 0000007000 8 0000000000999999.9000 0000000000000000000000000000000000000000009223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -101,7 +101,7 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 @@ -110,7 +110,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); Warnings: Note 1265 Data truncated for column 'd' at row 1 Note 1265 Data truncated for column 'd0' at row 1 @@ -122,7 +122,7 @@ Note 1265 Data truncated for column 'n0_0' at row 1 Note 1265 Data truncated for column 'n1' at row 1 Note 1265 Data truncated for column 'n20_4' at row 1 Note 1265 Data truncated for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 0000000000 0000000000 0.0 00000000.00 00000000000000000000000000000000000000000000000000.0000000000 0000000000 0000000000 0 0000000000000000.0000 0000000000000000000000000000000000000000000000000000000000000.0000 @@ -149,7 +149,7 @@ b decimal(10,0) unsigned zerofill # # # # INSERT INTO t1 (a,b) VALUES (1.1,1234); Warnings: Note 1265 Data truncated for column 'a' at row 1 -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0000000001 0000001234 DROP TABLE t1; @@ -180,8 +180,8 @@ d1_0 double(1,0) unsigned zerofill # # # d10_10 double(10,10) unsigned zerofill # # # d53 double(53,0) unsigned zerofill # # # d53_10 double(53,10) unsigned zerofill # # # -INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 0000012345.1 d 000000000011111111.111 d10_10 0.0123456789 @@ -192,8 +192,8 @@ f0 0000012345.1 f20_3 0000000000056789.988 f23_0 000123457000 r1_1 0.9 -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 99999999999999999999999999999999999999, 99999999999999999999999999999999999999.9999999999999999, 0.9, @@ -208,7 +208,7 @@ INSERT INTO t1 VALUES ( Warnings: Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 0000012345.1 d 0000000000000000000000 d 0000000000000000001e81 @@ -239,7 +239,7 @@ f23_0 000123457000 r1_1 0.0 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f0' at row 1 @@ -251,7 +251,7 @@ Warning 1264 Out of range value for column 'd1_0' at row 1 Warning 1264 Out of range value for column 'd10_10' at row 1 Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 0000012345.1 d 0000000000000000000000 d 0000000000000000000000 @@ -303,7 +303,7 @@ MAX(f0) 9.999999680285692e37 MAX(f20_3) 99999998430674940.000 MAX(f23_0) 9.999999680285692e37 MAX(r1_1) 0.9 -INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f0' at row 1 @@ -311,7 +311,7 @@ Warning 1264 Out of range value for column 'r1_1' at row 1 Warning 1264 Out of range value for column 'f23_0' at row 1 Warning 1264 Out of range value for column 'f20_3' at row 1 Warning 1264 Out of range value for column 'd1_0' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 0000012345.1 d 0000000000000000000000 d 0000000000000000000000 @@ -362,7 +362,7 @@ r1_1 0.0 r1_1 0.9 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 999999999999999999999999999999999999999, 999999999999999999999999999999999999999.9999999999999999, 1.9, @@ -385,7 +385,7 @@ Warning 1264 Out of range value for column 'd1_0' at row 1 Warning 1264 Out of range value for column 'd10_10' at row 1 Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 0000012345.1 d 0000000000000000000000 d 0000000000000000000000 @@ -461,7 +461,7 @@ Field Type Null Key Default Extra a double unsigned zerofill # # # # b float unsigned zerofill # # # # INSERT INTO t1 (a,b) VALUES (1,1234.5); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0000000000000000000001 0000001234.5 DROP TABLE t1; @@ -512,15 +512,15 @@ b bigint(20) unsigned zerofill # # # b0 bigint(20) unsigned zerofill # # # b1 bigint(1) unsigned zerofill # # # b20 bigint(20) unsigned zerofill # # # -INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); -SELECT * FROM t1; +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 -INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -542,15 +542,15 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); -SELECT * FROM t1; +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 0000000001 0000000002 3 00000000000000000004 005 006 7 00000000000000000008 00009 00010 11 00000000000000000012 00000013 00000014 15 00000000000000000016 00000000000000000017 00000000000000000018 19 00000000000000000020 2147483647 2147483647 2147483647 00000000002147483647 127 127 127 00000000000000000127 32767 32767 32767 00000000000000032767 08388607 08388607 8388607 00000000000008388607 09223372036854775807 09223372036854775807 9223372036854775807 09223372036854775807 4294967295 4294967295 4294967295 00000000004294967295 255 255 255 00000000000000000255 65535 65535 65535 00000000000000065535 16777215 16777215 16777215 00000000000016777215 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 -INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -572,7 +572,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -594,7 +594,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -644,7 +644,7 @@ Warning 1264 Out of range value for column 'm' at row 3 Warning 1264 Out of range value for column 'm0' at row 3 Warning 1264 Out of range value for column 'm1' at row 3 Warning 1264 Out of range value for column 'm20' at row 3 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 0000000000 0000000000 0 00000000000000000000 000 000 0 00000000000000000000 00000 00000 0 00000000000000000000 00000000 00000000 0 00000000000000000000 00000000000000000000 00000000000000000000 0 00000000000000000000 @@ -673,7 +673,7 @@ m mediumint(8) unsigned zerofill # # # # i int(10) unsigned zerofill # # # # b bigint(20) unsigned zerofill # # # # INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0); -SELECT * FROM t1; +SELECT t,s,m,i,b FROM t1; t s m i b 001 00010 00000100 0000001000 00000000000000000000 DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/col_opt_zerofill.test b/mysql-test/suite/storage_engine/col_opt_zerofill.test index 83b7dcf28c1..0dc1c243673 100644 --- a/mysql-test/suite/storage_engine/col_opt_zerofill.test +++ b/mysql-test/suite/storage_engine/col_opt_zerofill.test @@ -27,7 +27,7 @@ if (!$mysql_errname) SHOW COLUMNS IN t1; INSERT INTO t1 (a,b) VALUES (1.1,1234); - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -52,7 +52,7 @@ if (!$mysql_errname) SHOW COLUMNS IN t1; INSERT INTO t1 (a,b) VALUES (1,1234.5); - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -80,7 +80,7 @@ if (!$mysql_errname) SHOW COLUMNS IN t1; INSERT INTO t1 (t,s,m,i,b) VALUES (1,10,100,1000,0); - SELECT * FROM t1; + SELECT t,s,m,i,b FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/delete.result b/mysql-test/suite/storage_engine/delete.result index 1d84516c86a..d7125a344b7 100644 --- a/mysql-test/suite/storage_engine/delete.result +++ b/mysql-test/suite/storage_engine/delete.result @@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); INSERT INTO t1 (a,b) SELECT a, b FROM t1; DELETE FROM t1 WHERE b IN ('c'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 1 a @@ -16,7 +16,7 @@ a b 5 e 5 e DELETE FROM t1 WHERE a < 0 OR b = 'a'; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 10000 foobar 10000 foobar @@ -27,7 +27,7 @@ a b 5 e 5 e DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 10000 foobar 10000 foobar @@ -38,7 +38,7 @@ a b 5 e CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t2 (c,d) SELECT b, a FROM t1; -SELECT * FROM t2; +SELECT c,d FROM t2; c d b 2 b 2 @@ -48,7 +48,7 @@ e 5 foobar 10000 foobar 10000 DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 10000 foobar 10000 foobar @@ -57,21 +57,21 @@ a b 4 d 5 e 5 e -SELECT * FROM t2; +SELECT c,d FROM t2; c d foobar 10000 foobar 10000 DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 2 b 2 b 4 d 5 e 5 e -SELECT * FROM t2; +SELECT c,d FROM t2; c d DELETE FROM t1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/delete.test b/mysql-test/suite/storage_engine/delete.test index 802093e2977..e210ec3d17c 100644 --- a/mysql-test/suite/storage_engine/delete.test +++ b/mysql-test/suite/storage_engine/delete.test @@ -25,16 +25,16 @@ if ($mysql_errname) --source unexpected_result.inc } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DELETE FROM t1 WHERE a < 0 OR b = 'a'; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; # ORDER BY and LIMIT DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; # Multi-table DELETE @@ -43,23 +43,23 @@ SELECT * FROM t1; --source create_table.inc INSERT INTO t2 (c,d) SELECT b, a FROM t1; --sorted_result -SELECT * FROM t2; +SELECT c,d FROM t2; DELETE t2.* FROM t1, t2 WHERE c < b AND a + d != 1; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --sorted_result -SELECT * FROM t2; +SELECT c,d FROM t2; DELETE FROM t2, t1.* USING t2, t1 WHERE c = 'foobar' and b = c; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --sorted_result -SELECT * FROM t2; +SELECT c,d FROM t2; DELETE FROM t1; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; # Cleanup DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/delete_ignore.result b/mysql-test/suite/storage_engine/delete_ignore.result index a15c338ea04..aedac761d99 100644 --- a/mysql-test/suite/storage_engine/delete_ignore.result +++ b/mysql-test/suite/storage_engine/delete_ignore.result @@ -4,7 +4,7 @@ INSERT INTO t1 (a,b) VALUES (10000,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5, INSERT INTO t1 (a,b) SELECT a, b FROM t1; CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t2 (c,d) SELECT b, a FROM t1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 1 a @@ -18,7 +18,7 @@ a b 4 d 5 e 5 e -SELECT * FROM t2; +SELECT c,d FROM t2; c d a 1 a 1 @@ -33,7 +33,7 @@ e 5 foobar 10000 foobar 10000 DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 10000 foobar @@ -49,10 +49,10 @@ a b DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); Warnings: Warning 1242 Subquery returns more than 1 row -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a -SELECT * FROM t2; +SELECT c,d FROM t2; c d foobar 10000 foobar 10000 diff --git a/mysql-test/suite/storage_engine/delete_ignore.test b/mysql-test/suite/storage_engine/delete_ignore.test index fa98ec92029..c1b1926db45 100644 --- a/mysql-test/suite/storage_engine/delete_ignore.test +++ b/mysql-test/suite/storage_engine/delete_ignore.test @@ -18,9 +18,9 @@ INSERT INTO t1 (a,b) SELECT a, b FROM t1; --source create_table.inc INSERT INTO t2 (c,d) SELECT b, a FROM t1; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --sorted_result -SELECT * FROM t2; +SELECT c,d FROM t2; DELETE IGNORE FROM t1 WHERE b IS NOT NULL ORDER BY a LIMIT 1; if ($mysql_errname) @@ -29,13 +29,13 @@ if ($mysql_errname) --source unexpected_result.inc } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DELETE IGNORE t1.*, t2.* FROM t1, t2 WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --sorted_result -SELECT * FROM t2; +SELECT c,d FROM t2; # Cleanup DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/delete_low_prio.result b/mysql-test/suite/storage_engine/delete_low_prio.result index be334612a2b..89d08db5450 100644 --- a/mysql-test/suite/storage_engine/delete_low_prio.result +++ b/mysql-test/suite/storage_engine/delete_low_prio.result @@ -17,7 +17,7 @@ SLEEP(1) 0 0 connection default; -SELECT * FROM t1; +SELECT a,b FROM t1; a b INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); connection con1; @@ -34,7 +34,7 @@ SLEEP(1) 0 0 connection default; -SELECT * FROM t1; +SELECT a,b FROM t1; a b INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); SET LOW_PRIORITY_UPDATES = 1; @@ -52,7 +52,7 @@ SLEEP(1) 0 0 connection default; -SELECT * FROM t1; +SELECT a,b FROM t1; a b disconnect con1; disconnect con2; diff --git a/mysql-test/suite/storage_engine/delete_low_prio.test b/mysql-test/suite/storage_engine/delete_low_prio.test index 34677df5373..f79a055dabe 100644 --- a/mysql-test/suite/storage_engine/delete_low_prio.test +++ b/mysql-test/suite/storage_engine/delete_low_prio.test @@ -73,7 +73,7 @@ if ($found) --connection default --reap --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); @@ -113,7 +113,7 @@ if ($found) --connection default --reap --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); SET LOW_PRIORITY_UPDATES = 1; @@ -148,7 +148,7 @@ if ($found) --connection default --reap --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --disconnect con1 --disconnect con2 diff --git a/mysql-test/suite/storage_engine/delete_quick.result b/mysql-test/suite/storage_engine/delete_quick.result index 30d4841b51f..7166bcde96c 100644 --- a/mysql-test/suite/storage_engine/delete_quick.result +++ b/mysql-test/suite/storage_engine/delete_quick.result @@ -2,24 +2,24 @@ DROP TABLE IF EXISTS t1,t2; CREATE TABLE t1 (a <INT_COLUMN>, <CUSTOM_INDEX> (a), b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); DELETE QUICK FROM t1 WHERE a = 1 OR b > 'foo'; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 2 b 3 c 4 d 5 e CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; -INSERT INTO t2 SELECT b, a FROM t1; -SELECT * FROM t2; +INSERT INTO t2 (c,d) SELECT b, a FROM t1; +SELECT c,d FROM t2; c d b 2 c 3 d 4 e 5 DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d; -SELECT * FROM t1; +SELECT a,b FROM t1; a b -SELECT * FROM t2; +SELECT c,d FROM t2; c d DROP TABLE t2; DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_quick.test b/mysql-test/suite/storage_engine/delete_quick.test index 3b37096de4f..f96fedfd9c5 100644 --- a/mysql-test/suite/storage_engine/delete_quick.test +++ b/mysql-test/suite/storage_engine/delete_quick.test @@ -30,20 +30,20 @@ if (!$mysql_errname) if (!$mysql_errname) { --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --let $create_definition = c $char_col, d $int_col --let $table_name = t2 --source create_table.inc - INSERT INTO t2 SELECT b, a FROM t1; + INSERT INTO t2 (c,d) SELECT b, a FROM t1; --sorted_result - SELECT * FROM t2; + SELECT c,d FROM t2; DELETE QUICK FROM t2, t1.* USING t2, t1 WHERE c IS NULL OR a = d; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --sorted_result - SELECT * FROM t2; + SELECT c,d FROM t2; DROP TABLE t2; } DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/delete_with_keys.result b/mysql-test/suite/storage_engine/delete_with_keys.result index 6622cc1fb64..e968451b2e2 100644 --- a/mysql-test/suite/storage_engine/delete_with_keys.result +++ b/mysql-test/suite/storage_engine/delete_with_keys.result @@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>, <CUSTOM_INDEX> (b)) ENGINE=<ST INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); DELETE FROM t1 WHERE b > 'y'; DELETE FROM t1 WHERE a=2; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 3 c @@ -17,7 +17,7 @@ CREATE TABLE t1 (a <INT_COLUMN> PRIMARY KEY, b <CHAR_COLUMN>) ENGINE=<STORAGE_EN INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'x'),(7,'y'),(8,'z'); DELETE FROM t1 WHERE b > 'y'; DELETE FROM t1 WHERE a=2; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 3 c @@ -30,7 +30,7 @@ DROP TABLE t1; CREATE TABLE t1 (a <INT_COLUMN>, b <INT_COLUMN>, c <INT_COLUMN>, <CUSTOM_INDEX>(a), <CUSTOM_INDEX>(b)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9); DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c 1 2 3 4 5 6 diff --git a/mysql-test/suite/storage_engine/delete_with_keys.test b/mysql-test/suite/storage_engine/delete_with_keys.test index 274801b6d0e..cda0da0653f 100644 --- a/mysql-test/suite/storage_engine/delete_with_keys.test +++ b/mysql-test/suite/storage_engine/delete_with_keys.test @@ -29,7 +29,7 @@ if (!$mysql_errname) DELETE FROM t1 WHERE a=2; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DELETE FROM t1; } DROP TABLE t1; @@ -49,7 +49,7 @@ if (!$mysql_errname) DELETE FROM t1 WHERE a=2; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DELETE FROM t1; DROP TABLE t1; } @@ -66,7 +66,7 @@ if (!$mysql_errname) INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6),(7,8,9); DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; --sorted_result - SELECT * FROM t1; + SELECT a,b,c FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/foreign_keys.result b/mysql-test/suite/storage_engine/foreign_keys.result index 5374e78d9b1..6c4a3406811 100644 --- a/mysql-test/suite/storage_engine/foreign_keys.result +++ b/mysql-test/suite/storage_engine/foreign_keys.result @@ -26,11 +26,11 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail DELETE FROM t1 WHERE a=2; ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)) DELETE FROM t2 WHERE a=2; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 c 2 d -SELECT * FROM t2; +SELECT a,b FROM t2; a b 1 a DROP TABLE t1; @@ -54,7 +54,7 @@ ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (` INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'a'); INSERT INTO t2 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(4,'e'),(3,'a'); UPDATE t1 SET a=a+1; -SELECT * FROM t2; +SELECT a,b FROM t2; a b 5 a 5 a @@ -63,7 +63,7 @@ a b 5 d 5 e DELETE FROM t1 WHERE b='a' LIMIT 2; -SELECT * FROM t2; +SELECT a,b FROM t2; a b TRUNCATE TABLE t1; ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`)) diff --git a/mysql-test/suite/storage_engine/foreign_keys.test b/mysql-test/suite/storage_engine/foreign_keys.test index 643ca8bf6b1..cbadc4c950d 100644 --- a/mysql-test/suite/storage_engine/foreign_keys.test +++ b/mysql-test/suite/storage_engine/foreign_keys.test @@ -73,8 +73,9 @@ if (!$mysql_errname) DELETE FROM t2 WHERE a=2; --sorted_result - SELECT * FROM t1; - SELECT * FROM t2; + SELECT a,b FROM t1; + --sorted_result + SELECT a,b FROM t2; --let $error_codes = ER_ROW_IS_REFERENCED DROP TABLE t1; @@ -119,7 +120,7 @@ if (!$mysql_errname) --source unexpected_result.inc } --sorted_result - SELECT * FROM t2; + SELECT a,b FROM t2; DELETE FROM t1 WHERE b='a' LIMIT 2; if ($mysql_errname) @@ -128,7 +129,7 @@ if (!$mysql_errname) --source unexpected_result.inc } --sorted_result - SELECT * FROM t2; + SELECT a,b FROM t2; --let $error_codes = ER_TRUNCATE_ILLEGAL_FK TRUNCATE TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert.result b/mysql-test/suite/storage_engine/insert.result index a07a6e8d9a4..2dfe20cb822 100644 --- a/mysql-test/suite/storage_engine/insert.result +++ b/mysql-test/suite/storage_engine/insert.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t1 VALUES (100,'foobar'),(1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 100 foobar @@ -10,7 +10,7 @@ a b 4 d 5 e INSERT t1 VALUE (10,'foo'),(11,'abc'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 10 foo @@ -21,7 +21,7 @@ a b 4 d 5 e INSERT INTO t1 (b,a) VALUES ('test',0); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 test 1 a @@ -33,7 +33,7 @@ a b 4 d 5 e INSERT INTO t1 VALUES (DEFAULT,DEFAULT); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 test 1 a @@ -46,7 +46,7 @@ a b 5 e NULL NULL INSERT t1 (a) VALUE (10),(20); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 test 1 a @@ -61,7 +61,7 @@ a b 5 e NULL NULL INSERT INTO t1 SET a = 11, b = 'f'; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 test 1 a @@ -77,7 +77,7 @@ a b 5 e NULL NULL INSERT t1 SET b = DEFAULT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 test 1 a @@ -94,9 +94,9 @@ a b NULL NULL NULL NULL CREATE TABLE t2 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; -INSERT INTO t2 SELECT * FROM t1; +INSERT INTO t2 SELECT a,b FROM t1; INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo'; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 test 1 a @@ -113,8 +113,8 @@ a b 5 e NULL NULL NULL NULL -INSERT t1 SELECT * FROM t1; -SELECT * FROM t1; +INSERT t1 (a,b) SELECT a,b FROM t1; +SELECT a,b FROM t1; a b 0 test 0 test diff --git a/mysql-test/suite/storage_engine/insert.test b/mysql-test/suite/storage_engine/insert.test index d9076219eb0..1f780eba71f 100644 --- a/mysql-test/suite/storage_engine/insert.test +++ b/mysql-test/suite/storage_engine/insert.test @@ -22,40 +22,40 @@ if ($mysql_errname) --source unexpected_result.inc } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; INSERT t1 VALUE (10,'foo'),(11,'abc'); --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; INSERT INTO t1 (b,a) VALUES ('test',0); --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; INSERT INTO t1 VALUES (DEFAULT,DEFAULT); --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; INSERT t1 (a) VALUE (10),(20); --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; # INSERT [INTO] .. SET INSERT INTO t1 SET a = 11, b = 'f'; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; INSERT t1 SET b = DEFAULT; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; # INSERT .. SELECT --let $table_name = t2 --source create_table.inc -INSERT INTO t2 SELECT * FROM t1; +INSERT INTO t2 SELECT a,b FROM t1; if ($mysql_errname) { --let $functionality = INSERT .. SELECT @@ -65,11 +65,11 @@ if ($mysql_errname) INSERT INTO t1 (a) SELECT a FROM t2 WHERE b = 'foo'; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; -INSERT t1 SELECT * FROM t1; +INSERT t1 (a,b) SELECT a,b FROM t1; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; # Cleanup DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/insert_delayed.result b/mysql-test/suite/storage_engine/insert_delayed.result index 98e149bdf96..528003d8923 100644 --- a/mysql-test/suite/storage_engine/insert_delayed.result +++ b/mysql-test/suite/storage_engine/insert_delayed.result @@ -6,17 +6,17 @@ connect con0,localhost,root,,; SET lock_wait_timeout = 1; INSERT DELAYED INTO t1 (a,b) VALUES (3,'c'); INSERT DELAYED INTO t1 SET a=4, b='d'; -INSERT DELAYED INTO t1 SELECT 5, 'e'; +INSERT DELAYED INTO t1 (a,b) SELECT 5, 'e'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction disconnect con0; connection default; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 f 2 b UNLOCK TABLES; FLUSH TABLES; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 f 2 b diff --git a/mysql-test/suite/storage_engine/insert_delayed.test b/mysql-test/suite/storage_engine/insert_delayed.test index 7c3c4eec768..ca8bf7eddbb 100644 --- a/mysql-test/suite/storage_engine/insert_delayed.test +++ b/mysql-test/suite/storage_engine/insert_delayed.test @@ -41,16 +41,16 @@ if (!$mysql_errname) INSERT DELAYED INTO t1 SET a=4, b='d'; # DELAYED is ignored with INSERT .. SELECT --let $error_codes = ER_LOCK_WAIT_TIMEOUT - INSERT DELAYED INTO t1 SELECT 5, 'e'; + INSERT DELAYED INTO t1 (a,b) SELECT 5, 'e'; --source check_errors.inc --disconnect con0 --connection default - SELECT * FROM t1; + SELECT a,b FROM t1; } UNLOCK TABLES; FLUSH TABLES; -SELECT * FROM t1; +SELECT a,b FROM t1; # Cleanup DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/insert_high_prio.result b/mysql-test/suite/storage_engine/insert_high_prio.result index 66378564ff7..4f5a3a443cd 100644 --- a/mysql-test/suite/storage_engine/insert_high_prio.result +++ b/mysql-test/suite/storage_engine/insert_high_prio.result @@ -26,7 +26,7 @@ SLEEP(1) 0 0 connection con0; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 f 2 b @@ -50,7 +50,7 @@ SLEEP(1) 0 0 connection con0; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 f 2 b diff --git a/mysql-test/suite/storage_engine/insert_high_prio.test b/mysql-test/suite/storage_engine/insert_high_prio.test index 819e996d468..558e95a6cdf 100644 --- a/mysql-test/suite/storage_engine/insert_high_prio.test +++ b/mysql-test/suite/storage_engine/insert_high_prio.test @@ -80,7 +80,7 @@ if ($found) --connection con0 --reap --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DROP TABLE t1; @@ -122,7 +122,7 @@ if ($found) --connection con0 --reap --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --disconnect con1 --disconnect con2 diff --git a/mysql-test/suite/storage_engine/insert_low_prio.result b/mysql-test/suite/storage_engine/insert_low_prio.result index 561b6296380..1a74a82ea23 100644 --- a/mysql-test/suite/storage_engine/insert_low_prio.result +++ b/mysql-test/suite/storage_engine/insert_low_prio.result @@ -25,7 +25,7 @@ SLEEP(1) 0 0 connection con0; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 f 2 b diff --git a/mysql-test/suite/storage_engine/insert_low_prio.test b/mysql-test/suite/storage_engine/insert_low_prio.test index 30f47833162..ed30d106016 100644 --- a/mysql-test/suite/storage_engine/insert_low_prio.test +++ b/mysql-test/suite/storage_engine/insert_low_prio.test @@ -76,7 +76,7 @@ if ($found) --connection con0 --reap --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --disconnect con0 --disconnect con1 diff --git a/mysql-test/suite/storage_engine/insert_with_keys.result b/mysql-test/suite/storage_engine/insert_with_keys.result index db7439c4dbf..39e42b306d2 100644 --- a/mysql-test/suite/storage_engine/insert_with_keys.result +++ b/mysql-test/suite/storage_engine/insert_with_keys.result @@ -5,7 +5,7 @@ INSERT INTO t1 (a,b) VALUES (100,'a'), (6,'f'); INSERT INTO t1 (a,b) VALUES (30,'m'),(29,'n'); INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 1 a @@ -34,7 +34,7 @@ ERROR 23000: Duplicate entry '3' for key 'a' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file INSERT INTO t1 (a,b) VALUES (0,''); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 1 a @@ -50,7 +50,7 @@ INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); Warnings: Warning 1062 Duplicate entry '1' for key 'a' INSERT INTO t1 (a,b) VALUES (3,'a'),(4,'d') ON DUPLICATE KEY UPDATE a = a+10; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 1 a @@ -73,7 +73,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); ERROR 23000: Duplicate entry '1-a' for key 'a' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 100 a @@ -90,7 +90,7 @@ INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); Warnings: Warning 1062 Duplicate entry '1-a' for key 'a' INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 100 a 100 b @@ -122,7 +122,7 @@ ERROR 23000: Duplicate entry '3' for key 'PRIMARY' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file INSERT INTO t1 (a,b) VALUES (0,''); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 1 a @@ -138,7 +138,7 @@ INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); Warnings: Warning 1062 Duplicate entry '1' for key 'PRIMARY' INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE b = CONCAT(b,b); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 1 aa diff --git a/mysql-test/suite/storage_engine/insert_with_keys.test b/mysql-test/suite/storage_engine/insert_with_keys.test index 1959b55c707..c44b6c712e0 100644 --- a/mysql-test/suite/storage_engine/insert_with_keys.test +++ b/mysql-test/suite/storage_engine/insert_with_keys.test @@ -24,7 +24,7 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); INSERT INTO t1 (a,b) VALUES (3,'a'),(0,''); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -49,7 +49,7 @@ if (!$mysql_errname) --source check_errors.inc INSERT INTO t1 (a,b) VALUES (0,''); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); if ($mysql_errname) @@ -63,7 +63,7 @@ if (!$mysql_errname) } --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -86,12 +86,12 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); --source check_errors.inc --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); INSERT INTO t1 (a,b) VALUES (1,'a'),(12345,'z') ON DUPLICATE KEY UPDATE a = a+VALUES(a); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY INSERT INTO t1 (a,b) VALUES (101,'x'),(101,'x'); @@ -120,7 +120,7 @@ if (!$mysql_errname) --source check_errors.inc INSERT INTO t1 (a,b) VALUES (0,''); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; INSERT IGNORE INTO t1 (a,b) VALUES (1,'a'),(12345,'z'); if ($mysql_errname) @@ -134,7 +134,7 @@ if (!$mysql_errname) --source unexpected_result.inc } --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/loaddata.result b/mysql-test/suite/storage_engine/loaddata.result index 85608cdc32a..2b25435fa7a 100644 --- a/mysql-test/suite/storage_engine/loaddata.result +++ b/mysql-test/suite/storage_engine/loaddata.result @@ -1,8 +1,8 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 -FIELDS TERMINATED BY ','; -SELECT * FROM t1; +FIELDS TERMINATED BY ',' (a,b); +SELECT a,b FROM t1; a b 1 foo 2 bar @@ -10,8 +10,8 @@ a b 4 abc LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 CHARACTER SET utf8 COLUMNS TERMINATED BY ',' - ESCAPED BY '/'; -SELECT * FROM t1; + ESCAPED BY '/' (a,b); +SELECT a,b FROM t1; a b 1 foo 1 foo @@ -21,46 +21,66 @@ a b 3 4 abc 4 abc +LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 +FIELDS TERMINATED BY ';' + (a) SET b='loaded'; +Warnings: +Warning 1262 Row 1 was truncated; it contained more data than there were input columns +Warning 1262 Row 2 was truncated; it contained more data than there were input columns +Warning 1262 Row 3 was truncated; it contained more data than there were input columns +SELECT a,b FROM t1; +a b +0 loaded +1 foo +1 foo +102 loaded +2 bar +2 bar +3 +3 +4 abc +4 abc +5 loaded LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '''' LINES STARTING BY 'prefix:' -IGNORE 2 LINES -(a,b); +IGNORE 2 LINES (a,b); Warnings: Warning 1262 Row 2 was truncated; it contained more data than there were input columns -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 +0 loaded 1 foo 1 foo 100 foo +102 loaded 2 bar 2 bar 3 3 4 abc 4 abc +5 loaded 7 test -LOAD DATA LOCAL INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1 -FIELDS TERMINATED BY ';' - (a) SET b='loaded'; -Warnings: -Warning 1262 Row 1 was truncated; it contained more data than there were input columns -Warning 1262 Row 2 was truncated; it contained more data than there were input columns -Warning 1262 Row 3 was truncated; it contained more data than there were input columns -SELECT * FROM t1; +LOAD DATA INFILE '<DATADIR>/se_loaddata.dat' INTO TABLE t1; +SELECT a,b FROM t1; a b 0 0 loaded 1 foo 1 foo +1 foo 100 foo 102 loaded 2 bar 2 bar +2 bar 3 3 +3 +4 abc 4 abc 4 abc 5 loaded diff --git a/mysql-test/suite/storage_engine/loaddata.test b/mysql-test/suite/storage_engine/loaddata.test index c413184af00..5a708626c74 100644 --- a/mysql-test/suite/storage_engine/loaddata.test +++ b/mysql-test/suite/storage_engine/loaddata.test @@ -22,23 +22,40 @@ EOF --replace_result $datadir <DATADIR> eval LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 - FIELDS TERMINATED BY ','; + FIELDS TERMINATED BY ',' (a,b); if ($mysql_errname) { --source unexpected_result.inc + --remove_file $datadir/se_loaddata.dat } if (!$mysql_errname) { --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --replace_result $datadir <DATADIR> eval LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 CHARACTER SET utf8 COLUMNS TERMINATED BY ',' - ESCAPED BY '/'; + ESCAPED BY '/' (a,b); + --sorted_result + SELECT a,b FROM t1; + + --remove_file $datadir/se_loaddata.dat + --write_file $datadir/se_loaddata.dat +5;YYY; +102;'zzz'; +0;'test'; +EOF + + --replace_result $datadir <DATADIR> + eval + LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 + FIELDS TERMINATED BY ';' + (a) SET b='loaded'; + --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --remove_file $datadir/se_loaddata.dat --write_file $datadir/se_loaddata.dat @@ -57,31 +74,30 @@ EOF FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '''' LINES STARTING BY 'prefix:' - IGNORE 2 LINES - (a,b); + IGNORE 2 LINES (a,b); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --remove_file $datadir/se_loaddata.dat --write_file $datadir/se_loaddata.dat -5;YYY; -102;'zzz'; -0;'test'; +1 foo +2 bar +3 +4 abc EOF --replace_result $datadir <DATADIR> eval - LOAD DATA LOCAL INFILE '$datadir/se_loaddata.dat' INTO TABLE t1 - FIELDS TERMINATED BY ';' - (a) SET b='loaded'; - + LOAD DATA INFILE '$datadir/se_loaddata.dat' INTO TABLE t1; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; + + --remove_file $datadir/se_loaddata.dat + } # Cleanup ---remove_file $datadir/se_loaddata.dat DROP TABLE t1; --source cleanup_engine.inc diff --git a/mysql-test/suite/storage_engine/lock.result b/mysql-test/suite/storage_engine/lock.result index 73573381110..f20548da12b 100644 --- a/mysql-test/suite/storage_engine/lock.result +++ b/mysql-test/suite/storage_engine/lock.result @@ -12,7 +12,7 @@ id2 COUNT(DISTINCT id) 3 1 UPDATE t1 SET id=-1 WHERE id=1; connection con1; -SELECT * FROM t1; +SELECT id,id2 FROM t1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction LOCK TABLE t1 READ; ERROR HY000: Lock wait timeout exceeded; try restarting transaction @@ -38,7 +38,7 @@ DROP TABLE IF EXISTS t2; UNLOCK TABLES; CREATE TABLE t2 (id <INT_COLUMN>, id2 <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; LOCK TABLE t1 WRITE, t2 WRITE; -INSERT INTO t2 SELECT * FROM t1; +INSERT INTO t2 (id,id2) SELECT id,id2 FROM t1; UPDATE t1 SET id=1 WHERE id=-1; DROP TABLE t1,t2; CREATE TABLE t1 (i1 <INT_COLUMN>, nr <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; @@ -105,7 +105,7 @@ LOCK TABLE t1 WRITE, t2 WRITE; CREATE TEMPORARY TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; FLUSH TABLE t1; DROP TEMPORARY TABLE t1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b UNLOCK TABLES; DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/lock.test b/mysql-test/suite/storage_engine/lock.test index 16872bdaa7d..7335f8d1d39 100644 --- a/mysql-test/suite/storage_engine/lock.test +++ b/mysql-test/suite/storage_engine/lock.test @@ -43,7 +43,7 @@ connection con1; # With WRITE lock held by connection 'default', # nobody else can access the table --let $error_codes = ER_LOCK_WAIT_TIMEOUT -SELECT * FROM t1; +SELECT id,id2 FROM t1; --source check_errors.inc --let $error_codes = ER_LOCK_WAIT_TIMEOUT LOCK TABLE t1 READ; @@ -94,7 +94,7 @@ UNLOCK TABLES; --let $create_definition = id $int_col, id2 $int_col --source create_table.inc LOCK TABLE t1 WRITE, t2 WRITE; -INSERT INTO t2 SELECT * FROM t1; +INSERT INTO t2 (id,id2) SELECT id,id2 FROM t1; UPDATE t1 SET id=1 WHERE id=-1; if ($mysql_errname) { @@ -232,7 +232,7 @@ LOCK TABLE t1 WRITE, t2 WRITE; --source create_table.inc FLUSH TABLE t1; DROP TEMPORARY TABLE t1; -SELECT * FROM t1; +SELECT a,b FROM t1; UNLOCK TABLES; DROP TABLE t1, t2; diff --git a/mysql-test/suite/storage_engine/parts/repair_table.result b/mysql-test/suite/storage_engine/parts/repair_table.result index b156df6d7dc..8b08ee15fd0 100644 --- a/mysql-test/suite/storage_engine/parts/repair_table.result +++ b/mysql-test/suite/storage_engine/parts/repair_table.result @@ -10,7 +10,7 @@ INSERT INTO t2 (a,b) SELECT a, b FROM t1; ALTER TABLE t1 REPAIR PARTITION p0; Table Op Msg_type Msg_text test.t1 repair status OK -INSERT INTO t1 VALUES (3,'c'); +INSERT INTO t1 (a,b) VALUES (3,'c'); ALTER TABLE t1 REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; Table Op Msg_type Msg_text test.t1 repair status OK @@ -22,7 +22,7 @@ INSERT INTO t1 (a,b) VALUES (7,'g'),(8,'h'); ALTER TABLE t1 REPAIR PARTITION LOCAL ALL EXTENDED; Table Op Msg_type Msg_text test.t1 repair status OK -INSERT INTO t1 VALUES (10,'j'); +INSERT INTO t1 (a,b) VALUES (10,'j'); ALTER TABLE t1 REPAIR PARTITION p1 QUICK USE_FRM; Table Op Msg_type Msg_text test.t1 repair status OK @@ -76,7 +76,7 @@ Table Op Msg_type Msg_text test.t1 check Error Failed to read from the .par file test.t1 check Error Incorrect information in file: './test/t1.frm' test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; ERROR HY000: Failed to read from the .par file # Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). # If you got a difference in error message, just add it to rdiff file @@ -118,7 +118,7 @@ Table Op Msg_type Msg_text test.t1 check error Size of datafile is: 26 Should be: 39 test.t1 check error Partition p0 returned error test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; a b 8 h 10 j @@ -142,7 +142,7 @@ test.t1 check error Record-count is not ok; is 3 Should be: 2 test.t1 check warning Found 3 key parts. Should be: 2 test.t1 check error Partition p0 returned error test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; a b 8 h 10 j @@ -166,7 +166,7 @@ Table Op Msg_type Msg_text test.t1 check error Size of datafile is: 39 Should be: 52 test.t1 check error Partition p1 returned error test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; a b 8 h 10 j @@ -193,7 +193,7 @@ test.t1 check error Record-count is not ok; is 4 Should be: 3 test.t1 check warning Found 4 key parts. Should be: 3 test.t1 check error Partition p1 returned error test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; a b 8 h 10 j @@ -218,7 +218,7 @@ Restoring <DATADIR>/test/t1.par CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK -SELECT * FROM t1; +SELECT a,b FROM t1; a b 8 h 10 j diff --git a/mysql-test/suite/storage_engine/parts/repair_table.test b/mysql-test/suite/storage_engine/parts/repair_table.test index f77b2ef8de4..06be8de1f56 100644 --- a/mysql-test/suite/storage_engine/parts/repair_table.test +++ b/mysql-test/suite/storage_engine/parts/repair_table.test @@ -35,7 +35,7 @@ if (!$mysql_errname) let $alter_definition = REPAIR PARTITION p0; --source ../alter_table.inc - INSERT INTO t1 VALUES (3,'c'); + INSERT INTO t1 (a,b) VALUES (3,'c'); let $alter_definition = REPAIR PARTITION NO_WRITE_TO_BINLOG p0, p1; --source ../alter_table.inc @@ -57,7 +57,7 @@ if (!$mysql_errname) let $alter_definition = REPAIR PARTITION LOCAL ALL EXTENDED; --source ../alter_table.inc - INSERT INTO t1 VALUES (10,'j'); + INSERT INTO t1 (a,b) VALUES (10,'j'); let $alter_definition = REPAIR PARTITION p1 QUICK USE_FRM; --source ../alter_table.inc diff --git a/mysql-test/suite/storage_engine/parts/truncate_table.result b/mysql-test/suite/storage_engine/parts/truncate_table.result index e46f4c97de5..e3b18d57989 100644 --- a/mysql-test/suite/storage_engine/parts/truncate_table.result +++ b/mysql-test/suite/storage_engine/parts/truncate_table.result @@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO TRUNCATE TABLE t1; INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); TRUNCATE TABLE t1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b DROP TABLE t1; CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; @@ -46,23 +46,23 @@ t1 CREATE TABLE `t1` ( ) ENGINE=<STORAGE_ENGINE> AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) PARTITIONS 2 */ -SELECT * FROM t1; +SELECT a,c FROM t1; a c 1 d DROP TABLE t1; CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> PARTITION BY HASH(a) PARTITIONS 2; INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); ALTER TABLE t1 TRUNCATE PARTITION p0; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 101 g 3 c -EXPLAIN PARTITIONS SELECT * FROM t1; +EXPLAIN PARTITIONS SELECT a,b FROM t1; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0,p1 # # # # # # INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); ALTER TABLE t1 TRUNCATE PARTITION ALL; -SELECT * FROM t1; +SELECT a,b FROM t1; a b DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/parts/truncate_table.test b/mysql-test/suite/storage_engine/parts/truncate_table.test index 20f316d5297..9d921f013f4 100644 --- a/mysql-test/suite/storage_engine/parts/truncate_table.test +++ b/mysql-test/suite/storage_engine/parts/truncate_table.test @@ -33,7 +33,7 @@ if (!$mysql_errname) INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); TRUNCATE TABLE t1; - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -64,7 +64,7 @@ if (!$mysql_errname) INSERT INTO t1 (c) VALUES ('d'); --source ../mask_engine.inc SHOW CREATE TABLE t1; - SELECT * FROM t1; + SELECT a,c FROM t1; DROP TABLE t1; } @@ -93,16 +93,16 @@ if (!$mysql_errname) } --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --replace_column 5 # 6 # 7 # 8 # 9 # 10 # - EXPLAIN PARTITIONS SELECT * FROM t1; + EXPLAIN PARTITIONS SELECT a,b FROM t1; INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); let $alter_definition = TRUNCATE PARTITION ALL; --source ../alter_table.inc - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/repair_table.inc b/mysql-test/suite/storage_engine/repair_table.inc index 83d2f02e20a..be3e5ba35c2 100644 --- a/mysql-test/suite/storage_engine/repair_table.inc +++ b/mysql-test/suite/storage_engine/repair_table.inc @@ -64,7 +64,7 @@ INSERT INTO t1 (a,b) VALUES (14,'n'); --source check_errors.inc CHECK TABLE t1; --let $error_codes = 0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY -SELECT * FROM t1; +SELECT a,b FROM t1; --source check_errors.inc --enable_warnings REPAIR TABLE t1; @@ -143,7 +143,7 @@ if ($have_default_index) EOF CHECK TABLE t1; --let $error_codes = 0,ER_NOT_KEYFILE,144 - SELECT * FROM t1; + SELECT a,b FROM t1; --source check_errors.inc } } diff --git a/mysql-test/suite/storage_engine/repair_table.result b/mysql-test/suite/storage_engine/repair_table.result index f1af943fd7b..a20b9be3ba1 100644 --- a/mysql-test/suite/storage_engine/repair_table.result +++ b/mysql-test/suite/storage_engine/repair_table.result @@ -46,7 +46,7 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check Error Incorrect file format 't1' test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; ERROR HY000: Incorrect file format 't1' # Statement ended with one of expected results (0,130,ER_FAILED_READ_FROM_PAR_FILE,ER_OPEN_AS_READONLY). # If you got a difference in error message, just add it to rdiff file @@ -84,7 +84,7 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check error Size of datafile is: 39 Should be: 65 test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; ERROR HY000: Incorrect key file for table 't1'; try to repair it # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). # If you got a difference in error message, just add it to rdiff file @@ -99,7 +99,7 @@ Table Op Msg_type Msg_text test.t1 check warning Table is marked as crashed and last repair failed test.t1 check error Size of datafile is: 39 Should be: 65 test.t1 check error Corrupt -SELECT * FROM t1; +SELECT a,b FROM t1; ERROR HY000: Table './test/t1' is marked as crashed and last (automatic?) repair failed # Statement ended with one of expected results (0,ER_NOT_KEYFILE,144). # If you got a difference in error message, just add it to rdiff file diff --git a/mysql-test/suite/storage_engine/replace.result b/mysql-test/suite/storage_engine/replace.result index c8fbca8f534..85988c740b2 100644 --- a/mysql-test/suite/storage_engine/replace.result +++ b/mysql-test/suite/storage_engine/replace.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b @@ -9,7 +9,7 @@ a b 4 d 5 e REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 10 foo @@ -26,7 +26,7 @@ ERROR 23000: Duplicate entry '2' for key 'a' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file REPLACE INTO t1 (a,b) VALUES (2,'d'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 d @@ -39,7 +39,7 @@ ERROR 23000: Duplicate entry 'b' for key 'PRIMARY' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file REPLACE INTO t1 (a,b) VALUES (4,'b'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 3 c diff --git a/mysql-test/suite/storage_engine/replace.test b/mysql-test/suite/storage_engine/replace.test index 368ed62a300..0a00734abec 100644 --- a/mysql-test/suite/storage_engine/replace.test +++ b/mysql-test/suite/storage_engine/replace.test @@ -13,11 +13,11 @@ DROP TABLE IF EXISTS t1; REPLACE INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'); --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; REPLACE t1 (a,b) VALUE (10,'foo'),(10,'foo'); --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DROP TABLE t1; @@ -37,7 +37,7 @@ if (!$mysql_errname) --source check_errors.inc REPLACE INTO t1 (a,b) VALUES (2,'d'); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } @@ -58,7 +58,7 @@ if (!$mysql_errname) --source check_errors.inc REPLACE INTO t1 (a,b) VALUES (4,'b'); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/select.result b/mysql-test/suite/storage_engine/select.result index d2331f4d869..015ed80b771 100644 --- a/mysql-test/suite/storage_engine/select.result +++ b/mysql-test/suite/storage_engine/select.result @@ -144,7 +144,7 @@ a b a b 200 bar 200 bar 200 bar 200 bar 200 bar 200 bar -SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); +SELECT alias1.* FROM ( SELECT a,b FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); a b 1 z 1 z @@ -233,7 +233,7 @@ SUM(t2.a) SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a); MIN(t2.a) 1 -SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > ''; +SELECT alias.b FROM t1 NATURAL JOIN ( SELECT a,b FROM t1 ) alias WHERE b > ''; b bar bar @@ -247,7 +247,7 @@ z z z z -SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; +SELECT t2.b FROM ( SELECT a,b FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; b bar bar @@ -306,15 +306,15 @@ z z z z -SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2; +SELECT ( SELECT MIN(a) FROM ( SELECT a,b FROM t1 ) alias1 ) AS min_a FROM t2; min_a 1 1 1 -SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); +SELECT a,b FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); a b 1 z -SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); +SELECT a,b FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); a b 200 bar SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FROM t2 WHERE a = t1_outer.a ); @@ -325,19 +325,19 @@ a b 100 foobar 200 bar 200 bar -SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); +SELECT a,b FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); a b 100 foobar 200 bar -SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); +SELECT a,b FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); a b 1 z 100 foobar -SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); +SELECT a,b FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); a b 1 z 1 z -SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b ); +SELECT a,b FROM t1 WHERE EXISTS ( SELECT a,b FROM t2 WHERE t2.b > t1.b ); a b 100 foobar 100 foobar @@ -371,12 +371,12 @@ a b 100 foobar 200 bar 200 bar -SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1; +SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION DISTINCT SELECT a,b FROM t1; a b 1 z 100 foobar 200 bar -SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1; +SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION ALL SELECT a,b FROM t1; a b 1 z 1 z diff --git a/mysql-test/suite/storage_engine/select.test b/mysql-test/suite/storage_engine/select.test index 528fa64cfb2..34cfd99d344 100644 --- a/mysql-test/suite/storage_engine/select.test +++ b/mysql-test/suite/storage_engine/select.test @@ -108,7 +108,7 @@ SELECT t1_1.*, t2.* FROM t2, t1 AS t1_1, t1 AS t1_2 WHERE t1_1.a = t1_2.a AND t2.a = t1_1.a; --sorted_result -SELECT alias1.* FROM ( SELECT * FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); +SELECT alias1.* FROM ( SELECT a,b FROM t1 ) alias1, t2 WHERE t2.a IN (100,200); --sorted_result SELECT t1.a FROM { OJ t1 LEFT OUTER JOIN t2 ON t1.a = t2.a+10 }; @@ -134,10 +134,10 @@ SELECT SUM(t2.a) FROM t1 RIGHT JOIN t2 ON t2.b = t1.b; SELECT MIN(t2.a) FROM t1 RIGHT OUTER JOIN t2 USING (b,a); --sorted_result -SELECT alias.b FROM t1 NATURAL JOIN ( SELECT * FROM t1 ) alias WHERE b > ''; +SELECT alias.b FROM t1 NATURAL JOIN ( SELECT a,b FROM t1 ) alias WHERE b > ''; --sorted_result -SELECT t2.b FROM ( SELECT * FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; +SELECT t2.b FROM ( SELECT a,b FROM t1 ) alias NATURAL LEFT JOIN t2 WHERE b IS NOT NULL; --sorted_result SELECT t1.*, t2.* FROM t1 NATURAL LEFT OUTER JOIN t2; @@ -151,15 +151,15 @@ SELECT t1_2.b FROM t1 t1_1 NATURAL RIGHT OUTER JOIN t1 t1_2 INNER JOIN t2; # Subquery as scalar operand, subquery in the FROM clause --sorted_result -SELECT ( SELECT MIN(a) FROM ( SELECT * FROM t1 ) alias1 ) AS min_a FROM t2; +SELECT ( SELECT MIN(a) FROM ( SELECT a,b FROM t1 ) alias1 ) AS min_a FROM t2; # Comparison using subqueries --sorted_result -SELECT * FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); +SELECT a,b FROM t2 WHERE a = ( SELECT MIN(a) FROM t1 ); --sorted_result -SELECT * FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); +SELECT a,b FROM t2 WHERE b LIKE ( SELECT b FROM t1 ORDER BY b LIMIT 1 ); # Subquery with IN, correlated subquery @@ -169,20 +169,20 @@ SELECT t2.* FROM t1 t1_outer, t2 WHERE ( t1_outer.a, t2.b ) IN ( SELECT a, b FRO # Subquery with ANY, ALL --sorted_result -SELECT * FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); +SELECT a,b FROM t2 WHERE b = ANY ( SELECT b FROM t1 WHERE a > 1 ); --sorted_result -SELECT * FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); +SELECT a,b FROM t2 WHERE b > ALL ( SELECT b FROM t1 WHERE b < 'foo' ); # Row subqueries --sorted_result -SELECT * FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); +SELECT a,b FROM t1 WHERE ROW(a, b) = ( SELECT a, b FROM t2 ORDER BY a, b LIMIT 1 ); # Subquery with EXISTS --sorted_result -SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE t2.b > t1.b ); +SELECT a,b FROM t1 WHERE EXISTS ( SELECT a,b FROM t2 WHERE t2.b > t1.b ); # Subquery in ORDER BY @@ -197,10 +197,10 @@ SELECT a, b FROM t1 HAVING a IN ( SELECT a FROM t2 WHERE b = t1.b ); # Union --sorted_result -SELECT * FROM t1 UNION SELECT * FROM t2 UNION DISTINCT SELECT * FROM t1; +SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION DISTINCT SELECT a,b FROM t1; --sorted_result -SELECT * FROM t1 UNION SELECT * FROM t2 UNION ALL SELECT * FROM t1; +SELECT a,b FROM t1 UNION SELECT a,b FROM t2 UNION ALL SELECT a,b FROM t1; # Cleanup diff --git a/mysql-test/suite/storage_engine/select_high_prio.result b/mysql-test/suite/storage_engine/select_high_prio.result index b3b70df3731..10226ae0f39 100644 --- a/mysql-test/suite/storage_engine/select_high_prio.result +++ b/mysql-test/suite/storage_engine/select_high_prio.result @@ -12,7 +12,7 @@ LOCK TABLE t1 READ; connection con0; UPDATE t1 SET b = CONCAT(b,b); connection con2; -SELECT * FROM t1; +SELECT a,b FROM t1; connection con1; UNLOCK TABLES; connection con0; diff --git a/mysql-test/suite/storage_engine/select_high_prio.test b/mysql-test/suite/storage_engine/select_high_prio.test index 385752e8d4e..49cd91ebbfd 100644 --- a/mysql-test/suite/storage_engine/select_high_prio.test +++ b/mysql-test/suite/storage_engine/select_high_prio.test @@ -49,12 +49,12 @@ let $condition = LIKE 'Waiting for table%'; let $wait_timeout = 2; --source include/wait_show_condition.inc --send -SELECT * FROM t1; +SELECT a,b FROM t1; --connection con1 let $show_statement = SHOW PROCESSLIST; let $field = Info; -let $condition = = 'SELECT * FROM t1'; +let $condition = = 'SELECT a,b FROM t1'; let $wait_timeout = 2; --source include/wait_show_condition.inc if (!$found) diff --git a/mysql-test/suite/storage_engine/truncate_table.result b/mysql-test/suite/storage_engine/truncate_table.result index 0a774c4b8dd..d8dc5046442 100644 --- a/mysql-test/suite/storage_engine/truncate_table.result +++ b/mysql-test/suite/storage_engine/truncate_table.result @@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO TRUNCATE TABLE t1; INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); TRUNCATE TABLE t1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b DROP TABLE t1; CREATE TABLE t1 (a <INT_COLUMN> KEY AUTO_INCREMENT, c <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; @@ -22,7 +22,7 @@ INSERT INTO t1 (c) VALUES ('d'); SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 # # # # # # # # # 2 # # # # # # # -SELECT * FROM t1; +SELECT a,c FROM t1; a c 1 d DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/truncate_table.test b/mysql-test/suite/storage_engine/truncate_table.test index c84fba143b7..a9277b39619 100644 --- a/mysql-test/suite/storage_engine/truncate_table.test +++ b/mysql-test/suite/storage_engine/truncate_table.test @@ -19,7 +19,7 @@ if (!$mysql_errname) { INSERT INTO t1 (a,b) VALUES (1,'a'), (2,'b'), (3,'c'); TRUNCATE TABLE t1; - SELECT * FROM t1; + SELECT a,b FROM t1; } DROP TABLE t1; @@ -51,7 +51,7 @@ if (!$mysql_errname) --replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # SHOW TABLE STATUS LIKE 't1'; - SELECT * FROM t1; + SELECT a,c FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result index a52f18fc623..3b0bdb3b560 100644 --- a/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_repeatable_read.result @@ -9,7 +9,7 @@ connection con2; INSERT INTO t1 (a) VALUES (1); connection con1; # If consistent read works on this isolation level (REPEATABLE READ), the following SELECT should not return the value we inserted (1) -SELECT * FROM t1; +SELECT a FROM t1; a COMMIT; connection default; diff --git a/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result index 8d75ea075a2..691039e8d96 100644 --- a/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result +++ b/mysql-test/suite/storage_engine/trx/cons_snapshot_serializable.result @@ -9,7 +9,7 @@ connection con2; INSERT INTO t1 (a) VALUES (1); connection con1; # If consistent read works on this isolation level (SERIALIZABLE), the following SELECT should not return the value we inserted (1) -SELECT * FROM t1; +SELECT a FROM t1; a COMMIT; connection default; diff --git a/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc index 8dc9d6c4bb1..7f0dfe04214 100644 --- a/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc +++ b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc @@ -38,7 +38,7 @@ if ($mysql_errname) connection con1; --echo # If consistent read works on this isolation level ($trx_isolation), the following SELECT should not return the value we inserted (1) -SELECT * FROM t1; +SELECT a FROM t1; COMMIT; connection default; diff --git a/mysql-test/suite/storage_engine/trx/delete.result b/mysql-test/suite/storage_engine/trx/delete.result index 827877a7e30..14e5389dcfb 100644 --- a/mysql-test/suite/storage_engine/trx/delete.result +++ b/mysql-test/suite/storage_engine/trx/delete.result @@ -4,7 +4,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(6,'f'),(7,' INSERT INTO t1 (a,b) SELECT a, b FROM t1; BEGIN; DELETE FROM t1 WHERE b IN ('c'); -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 1 a @@ -24,7 +24,7 @@ a b 8 h DELETE FROM t1 WHERE a < 0 OR b = 'a'; COMMIT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 10000 foobar 10000 foobar @@ -46,7 +46,7 @@ SAVEPOINT spt1; DELETE FROM t1; RELEASE SAVEPOINT spt1; ROLLBACK; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 10000 foobar 10000 foobar diff --git a/mysql-test/suite/storage_engine/trx/delete.test b/mysql-test/suite/storage_engine/trx/delete.test index 0898eebb49a..50da1f20153 100644 --- a/mysql-test/suite/storage_engine/trx/delete.test +++ b/mysql-test/suite/storage_engine/trx/delete.test @@ -22,11 +22,11 @@ if ($mysql_errname) --source ../unexpected_result.inc } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DELETE FROM t1 WHERE a < 0 OR b = 'a'; COMMIT; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; BEGIN; DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; @@ -35,7 +35,7 @@ DELETE FROM t1; RELEASE SAVEPOINT spt1; ROLLBACK; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; BEGIN; DELETE FROM t1 WHERE a <= 4 ORDER BY b DESC LIMIT 1; diff --git a/mysql-test/suite/storage_engine/trx/insert.result b/mysql-test/suite/storage_engine/trx/insert.result index 986d63b2a07..1d8aca98687 100644 --- a/mysql-test/suite/storage_engine/trx/insert.result +++ b/mysql-test/suite/storage_engine/trx/insert.result @@ -4,7 +4,7 @@ BEGIN; INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo'); INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc'); COMMIT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 10 foo @@ -21,7 +21,7 @@ INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); RELEASE SAVEPOINT spt1; INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); ROLLBACK; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 10 foo @@ -39,7 +39,7 @@ INSERT t1 SET b = DEFAULT; ROLLBACK TO SAVEPOINT spt1; INSERT INTO t1 (b,a) VALUES ('test1',10); COMMIT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 10 NULL diff --git a/mysql-test/suite/storage_engine/trx/insert.test b/mysql-test/suite/storage_engine/trx/insert.test index c458f90b1bb..1a736584b03 100644 --- a/mysql-test/suite/storage_engine/trx/insert.test +++ b/mysql-test/suite/storage_engine/trx/insert.test @@ -15,7 +15,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(100,'foo'); INSERT t1 (a,b) VALUE (10,'foo'),(11,'abc'); COMMIT; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; BEGIN; INSERT INTO t1 (b,a) VALUES ('test',0); @@ -25,7 +25,7 @@ RELEASE SAVEPOINT spt1; INSERT INTO t1 (a,b) VALUES (DEFAULT,DEFAULT); ROLLBACK; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; BEGIN; INSERT t1 (a) VALUE (10),(20); @@ -36,7 +36,7 @@ ROLLBACK TO SAVEPOINT spt1; INSERT INTO t1 (b,a) VALUES ('test1',10); COMMIT; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/level_read_committed.result b/mysql-test/suite/storage_engine/trx/level_read_committed.result index 12c0c2f42a8..ce1b126dc1a 100644 --- a/mysql-test/suite/storage_engine/trx/level_read_committed.result +++ b/mysql-test/suite/storage_engine/trx/level_read_committed.result @@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; connection con1; CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; START TRANSACTION; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; BEGIN; @@ -14,53 +14,53 @@ INSERT INTO t1 (a) VALUES(1); # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; INSERT INTO t1 (a) VALUES (2); # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a INSERT INTO t1 (a) SELECT a+100 FROM t1; # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 INSERT INTO t1 (a) SELECT a+200 FROM t1; # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 201 202 COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 201 202 connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 @@ -81,7 +81,7 @@ connection con2; INSERT INTO t1 (a) VALUES (1); connection con1; # If consistent read works on this isolation level (READ COMMITTED), the following SELECT should not return the value we inserted (1) -SELECT * FROM t1; +SELECT a FROM t1; a 1 COMMIT; diff --git a/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result index 2bf93768b00..68fbe5632cb 100644 --- a/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result +++ b/mysql-test/suite/storage_engine/trx/level_read_uncommitted.result @@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; connection con1; CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; START TRANSACTION; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; BEGIN; @@ -14,7 +14,7 @@ INSERT INTO t1 (a) VALUES(1); # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 connection con2; @@ -22,35 +22,35 @@ INSERT INTO t1 (a) VALUES (2); # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 INSERT INTO t1 (a) SELECT a+100 FROM t1; # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a 1 101 102 2 connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a 1 101 102 2 COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a 1 101 102 2 connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 101 @@ -59,7 +59,7 @@ a INSERT INTO t1 (a) SELECT a+200 FROM t1; # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a 1 101 @@ -70,7 +70,7 @@ a 301 302 COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a 1 101 @@ -81,7 +81,7 @@ a 301 302 connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a 1 101 @@ -106,7 +106,7 @@ connection con2; INSERT INTO t1 (a) VALUES (1); connection con1; # If consistent read works on this isolation level (READ UNCOMMITTED), the following SELECT should not return the value we inserted (1) -SELECT * FROM t1; +SELECT a FROM t1; a 1 COMMIT; diff --git a/mysql-test/suite/storage_engine/trx/level_repeatable_read.result b/mysql-test/suite/storage_engine/trx/level_repeatable_read.result index 82324c16801..c828b18dba0 100644 --- a/mysql-test/suite/storage_engine/trx/level_repeatable_read.result +++ b/mysql-test/suite/storage_engine/trx/level_repeatable_read.result @@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; connection con1; CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; START TRANSACTION; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; BEGIN; @@ -14,50 +14,50 @@ INSERT INTO t1 (a) VALUES(1); # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; INSERT INTO t1 (a) VALUES (2); # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a INSERT INTO t1 (a) SELECT a+100 FROM t1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a INSERT INTO t1 (a) SELECT a+200 FROM t1; # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a 201 202 COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 201 202 connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 diff --git a/mysql-test/suite/storage_engine/trx/level_serializable.result b/mysql-test/suite/storage_engine/trx/level_serializable.result index 0f990dfbf77..3f57395fa37 100644 --- a/mysql-test/suite/storage_engine/trx/level_serializable.result +++ b/mysql-test/suite/storage_engine/trx/level_serializable.result @@ -6,7 +6,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; connection con1; CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; START TRANSACTION; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; BEGIN; @@ -15,7 +15,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; INSERT INTO t1 (a) VALUES (2); @@ -23,32 +23,32 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction # WARNING: Statement ended with errno 1205, errname 'ER_LOCK_WAIT_TIMEOUT'. # If it differs from the result file, it might indicate a problem. connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a INSERT INTO t1 (a) SELECT a+100 FROM t1; # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a INSERT INTO t1 (a) SELECT a+200 FROM t1; # WARNING: Statement ended with errno 0, errname ''. # If it differs from the result file, it might indicate a problem. -SELECT * FROM t1; +SELECT a FROM t1; a COMMIT; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; -SELECT * FROM t1; +SELECT a FROM t1; a connection default; disconnect con1; diff --git a/mysql-test/suite/storage_engine/trx/select_for_update.result b/mysql-test/suite/storage_engine/trx/select_for_update.result index 8b0de87de05..f5954489d91 100644 --- a/mysql-test/suite/storage_engine/trx/select_for_update.result +++ b/mysql-test/suite/storage_engine/trx/select_for_update.result @@ -3,23 +3,23 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); connect con1,localhost,root,,; BEGIN; -SELECT * FROM t1 WHERE b='a' FOR UPDATE; +SELECT a,b FROM t1 WHERE b='a' FOR UPDATE; a b 1 a 3 a connection default; SET lock_wait_timeout = 1; -SELECT * FROM t1 WHERE b='a'; +SELECT a,b FROM t1 WHERE b='a'; a b 1 a 3 a -SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE; ERROR HY000: Lock wait timeout exceeded; try restarting transaction UPDATE t1 SET b='c' WHERE b='a'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction connection con1; COMMIT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b @@ -27,7 +27,7 @@ a b disconnect con1; connection default; UPDATE t1 SET b='c' WHERE b='a'; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 c 2 b diff --git a/mysql-test/suite/storage_engine/trx/select_for_update.test b/mysql-test/suite/storage_engine/trx/select_for_update.test index 93ccc1915df..2a7dee2d3f4 100644 --- a/mysql-test/suite/storage_engine/trx/select_for_update.test +++ b/mysql-test/suite/storage_engine/trx/select_for_update.test @@ -22,7 +22,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); --connect (con1,localhost,root,,) BEGIN; --sorted_result -SELECT * FROM t1 WHERE b='a' FOR UPDATE; +SELECT a,b FROM t1 WHERE b='a' FOR UPDATE; if ($mysql_errname) { --let $functionality = SELECT .. FOR UPDATE @@ -35,7 +35,7 @@ SET lock_wait_timeout = 1; # Should still be able to select --sorted_result -SELECT * FROM t1 WHERE b='a'; +SELECT a,b FROM t1 WHERE b='a'; if ($mysql_errname) { --let $functionality = SELECT .. FOR UPDATE or locking @@ -46,7 +46,7 @@ if ($mysql_errname) --sorted_result --let $error_codes = ER_LOCK_WAIT_TIMEOUT -SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE; --source ../check_errors.inc if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) { @@ -66,7 +66,7 @@ if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) --connection con1 COMMIT; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --disconnect con1 --connection default @@ -78,7 +78,7 @@ if ($mysql_errname) --source ../unexpected_result.inc } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result index 00610a03bd8..3d668d721ae 100644 --- a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result +++ b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.result @@ -3,17 +3,17 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); connect con1,localhost,root,,; BEGIN; -SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE; a b 1 a 3 a connection default; SET lock_wait_timeout = 1; -SELECT * FROM t1 WHERE b='a'; +SELECT a,b FROM t1 WHERE b='a'; a b 1 a 3 a -SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE; a b 1 a 3 a @@ -21,7 +21,7 @@ UPDATE t1 SET b='c' WHERE b='a'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction connection con1; COMMIT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 2 b @@ -29,7 +29,7 @@ a b disconnect con1; connection default; UPDATE t1 SET b='c' WHERE b='a'; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 c 2 b diff --git a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test index a50c86403e9..4c03b44640b 100644 --- a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test +++ b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test @@ -22,7 +22,7 @@ INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'a'); --connect (con1,localhost,root,,) BEGIN; --sorted_result -SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE; if ($mysql_errname) { --let $functionality = LOCK IN SHARE MODE @@ -35,14 +35,14 @@ SET lock_wait_timeout = 1; # Should still be able to select --sorted_result -SELECT * FROM t1 WHERE b='a'; +SELECT a,b FROM t1 WHERE b='a'; if ($mysql_errname) { --let $functionality = LOCK IN SHARE MODE --source ../unexpected_result.inc } --sorted_result -SELECT * FROM t1 WHERE b='a' LOCK IN SHARE MODE; +SELECT a,b FROM t1 WHERE b='a' LOCK IN SHARE MODE; if ($mysql_errname) { --let $functionality = LOCK IN SHARE MODE @@ -61,7 +61,7 @@ if ($mysql_errname != ER_LOCK_WAIT_TIMEOUT) --connection con1 COMMIT; --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --disconnect con1 --connection default @@ -73,7 +73,7 @@ if ($mysql_errname) --source ../unexpected_result.inc } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/transaction_isolation.inc b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc index c81071d99b6..9e07ff1b857 100644 --- a/mysql-test/suite/storage_engine/trx/transaction_isolation.inc +++ b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc @@ -31,7 +31,7 @@ let $create_definition = a $int_col; START TRANSACTION; --sorted_result -SELECT * FROM t1; # First snapshot +SELECT a FROM t1; # First snapshot connection con2; @@ -42,7 +42,7 @@ INSERT INTO t1 (a) VALUES(1); connection con1; --sorted_result -SELECT * FROM t1; # Second snapshot +SELECT a FROM t1; # Second snapshot connection con2; --let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT @@ -51,25 +51,25 @@ INSERT INTO t1 (a) VALUES (2); connection con1; --sorted_result -SELECT * FROM t1; # Third snapshot +SELECT a FROM t1; # Third snapshot --let $error_codes = 0,ER_LOCK_WAIT_TIMEOUT INSERT INTO t1 (a) SELECT a+100 FROM t1; --source ../strict_check_errors.inc --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; connection con2; --sorted_result -SELECT * FROM t1; # Inside the transaction +SELECT a FROM t1; # Inside the transaction COMMIT; --sorted_result -SELECT * FROM t1; # Outside the transaction +SELECT a FROM t1; # Outside the transaction connection con1; --sorted_result -SELECT * FROM t1; # Inside the transaction +SELECT a FROM t1; # Inside the transaction # Note: INSERT .. SELECT might be tricky, for example for InnoDB # even with REPEATABLE-READ it works as if it is executed with READ COMMITTED. @@ -81,14 +81,14 @@ INSERT INTO t1 (a) SELECT a+200 FROM t1; --source ../strict_check_errors.inc --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; COMMIT; --sorted_result -SELECT * FROM t1; # Outside the transaction +SELECT a FROM t1; # Outside the transaction connection con2; --sorted_result -SELECT * FROM t1; # After both transactions have committed +SELECT a FROM t1; # After both transactions have committed connection default; disconnect con1; diff --git a/mysql-test/suite/storage_engine/trx/update.result b/mysql-test/suite/storage_engine/trx/update.result index e609bfcbc23..968674619bd 100644 --- a/mysql-test/suite/storage_engine/trx/update.result +++ b/mysql-test/suite/storage_engine/trx/update.result @@ -6,7 +6,7 @@ BEGIN; UPDATE t1 SET a=a+100; UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100; COMMIT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 10050 NULL 10050 NULL @@ -31,7 +31,7 @@ UPDATE t1 SET b = ''; ROLLBACK TO SAVEPOINT spt1; UPDATE t1 SET b = 'upd' WHERE a = 10050; COMMIT; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 10050 upd 10050 upd diff --git a/mysql-test/suite/storage_engine/trx/update.test b/mysql-test/suite/storage_engine/trx/update.test index df65e244528..245b7554477 100644 --- a/mysql-test/suite/storage_engine/trx/update.test +++ b/mysql-test/suite/storage_engine/trx/update.test @@ -26,7 +26,7 @@ if (!$mysql_errname) UPDATE t1 SET a=a-50, b=DEFAULT WHERE a>100; COMMIT; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; BEGIN; UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY a DESC, b ASC LIMIT 3; @@ -41,7 +41,7 @@ if (!$mysql_errname) UPDATE t1 SET b = 'upd' WHERE a = 10050; COMMIT; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; } DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/xa.result b/mysql-test/suite/storage_engine/trx/xa.result index 3e2cb43a11c..72017018e2a 100644 --- a/mysql-test/suite/storage_engine/trx/xa.result +++ b/mysql-test/suite/storage_engine/trx/xa.result @@ -7,18 +7,18 @@ connection con2; XA START 'xa1'; INSERT INTO t1 (a) VALUES (1); connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; INSERT INTO t1 (a) VALUES (2); XA END 'xa1'; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; XA PREPARE 'xa1'; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a connection con2; XA RECOVER; @@ -26,7 +26,7 @@ formatID gtrid_length bqual_length data 1 3 0 xa1 XA COMMIT 'xa1'; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 @@ -34,7 +34,7 @@ connection con2; XA START 'xa2'; INSERT INTO t1 (a) VALUES (3); connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 @@ -42,14 +42,14 @@ connection con2; INSERT INTO t1 (a) VALUES (4); XA END 'xa2'; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 connection con2; XA COMMIT 'xa2' ONE PHASE; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 @@ -59,7 +59,7 @@ connection con2; XA START 'xa3'; INSERT INTO t1 (a) VALUES (5); connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 @@ -69,7 +69,7 @@ connection con2; INSERT INTO t1 (a) VALUES (6); XA END 'xa3'; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 @@ -78,7 +78,7 @@ a connection con2; XA PREPARE 'xa3'; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 @@ -87,7 +87,7 @@ a connection con2; XA ROLLBACK 'xa3'; connection con1; -SELECT * FROM t1; +SELECT a FROM t1; a 1 2 diff --git a/mysql-test/suite/storage_engine/trx/xa.test b/mysql-test/suite/storage_engine/trx/xa.test index c64ba7cd27b..17cae7eae76 100644 --- a/mysql-test/suite/storage_engine/trx/xa.test +++ b/mysql-test/suite/storage_engine/trx/xa.test @@ -30,7 +30,7 @@ INSERT INTO t1 (a) VALUES (1); --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 INSERT INTO t1 (a) VALUES (2); @@ -38,14 +38,14 @@ XA END 'xa1'; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 XA PREPARE 'xa1'; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 XA RECOVER; @@ -53,7 +53,7 @@ XA COMMIT 'xa1'; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; # One-phase COMMIT @@ -63,7 +63,7 @@ INSERT INTO t1 (a) VALUES (3); --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 INSERT INTO t1 (a) VALUES (4); @@ -71,14 +71,14 @@ XA END 'xa2'; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 XA COMMIT 'xa2' ONE PHASE; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; # Rollback @@ -88,7 +88,7 @@ INSERT INTO t1 (a) VALUES (5); --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 INSERT INTO t1 (a) VALUES (6); @@ -96,21 +96,21 @@ XA END 'xa3'; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 XA PREPARE 'xa3'; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; --connection con2 XA ROLLBACK 'xa3'; --connection con1 --sorted_result -SELECT * FROM t1; +SELECT a FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/trx/xa_recovery.result b/mysql-test/suite/storage_engine/trx/xa_recovery.result index e14e9a0bf1a..a9208a6e9d3 100644 --- a/mysql-test/suite/storage_engine/trx/xa_recovery.result +++ b/mysql-test/suite/storage_engine/trx/xa_recovery.result @@ -22,7 +22,7 @@ formatID gtrid_length bqual_length data 1 3 0 xa2 XA ROLLBACK 'xa1'; XA COMMIT 'xa2'; -SELECT * FROM t1; +SELECT a FROM t1; a 3 4 diff --git a/mysql-test/suite/storage_engine/trx/xa_recovery.test b/mysql-test/suite/storage_engine/trx/xa_recovery.test index d7ac2e782d1..4dab66b77dd 100644 --- a/mysql-test/suite/storage_engine/trx/xa_recovery.test +++ b/mysql-test/suite/storage_engine/trx/xa_recovery.test @@ -64,7 +64,7 @@ EOF XA RECOVER; XA ROLLBACK 'xa1'; XA COMMIT 'xa2'; -SELECT * FROM t1; +SELECT a FROM t1; DROP TABLE t1; --source ../cleanup_engine.inc diff --git a/mysql-test/suite/storage_engine/type_binary.inc b/mysql-test/suite/storage_engine/type_binary.inc index 812a1cc9527..dbee1d57274 100644 --- a/mysql-test/suite/storage_engine/type_binary.inc +++ b/mysql-test/suite/storage_engine/type_binary.inc @@ -27,16 +27,16 @@ if (!$mysql_errname) # Valid values - INSERT INTO t1 VALUES ('','','','',''); - INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); + INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('','','','',''); + INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); --sorted_result SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; # Invalid values - INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); - INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; + INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); + INSERT INTO t1 (b,b0,b1,b20,b255) SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; --sorted_result SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; diff --git a/mysql-test/suite/storage_engine/type_binary.result b/mysql-test/suite/storage_engine/type_binary.result index 455dbb57a7e..8da8b04095b 100644 --- a/mysql-test/suite/storage_engine/type_binary.result +++ b/mysql-test/suite/storage_engine/type_binary.result @@ -12,20 +12,20 @@ b0 binary(0) # # # # b1 binary(1) # # # # b20 binary(20) # # # # b255 binary(255) # # # # -INSERT INTO t1 VALUES ('','','','',''); -INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('','','','',''); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); SELECT HEX(b), HEX(b0), HEX(b1), HEX(b20), HEX(b255) FROM t1; HEX(b) HEX(b0) HEX(b1) HEX(b20) HEX(b255) 00 00 0000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 61 62 616263646566676869206B6C6D6E6F7071727374 4372656174696E6720616E2061727469636C6520666F7220746865204B6E6F776C65646765626173652069732073696D696C617220746F2061736B696E67207175657374696F6E732E2046697273742C206E6176696761746520746F207468652063617465676F727920776865726520796F75206665656C207468652061727469636C652073686F756C642062652E204F6E63652074686572652C20646F75626C6520636865636B207468617420616E2061727469636C6520646F65736E277420616C726561647920657869737420776869636820776F756C6420776F726B2E00000000000000000000000000000000000000000000000000000000000000 -INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +INSERT INTO t1 (b,b0,b1,b20,b255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'b0' at row 1 Warning 1265 Data truncated for column 'b1' at row 1 Warning 1265 Data truncated for column 'b20' at row 1 Warning 1265 Data truncated for column 'b255' at row 1 -INSERT INTO t1 SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; +INSERT INTO t1 (b,b0,b1,b20,b255) SELECT b255, b255, b255, b255, CONCAT(b255,b255) FROM t1; Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'b0' at row 1 diff --git a/mysql-test/suite/storage_engine/type_binary_indexes.result b/mysql-test/suite/storage_engine/type_binary_indexes.result index 6f828aed100..96e0d6d601a 100644 --- a/mysql-test/suite/storage_engine/type_binary_indexes.result +++ b/mysql-test/suite/storage_engine/type_binary_indexes.result @@ -88,7 +88,7 @@ SHOW INDEX IN t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment t1 1 v16 1 v16 # # 10 NULL # # INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b'); -INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 (b,b20,v16,v128) SELECT b,b20,v16,v128 FROM t1; EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%'; id select_type table type possible_keys key key_len ref rows Extra # # # # # NULL # # # # diff --git a/mysql-test/suite/storage_engine/type_binary_indexes.test b/mysql-test/suite/storage_engine/type_binary_indexes.test index 24b16aa5175..943593027f8 100644 --- a/mysql-test/suite/storage_engine/type_binary_indexes.test +++ b/mysql-test/suite/storage_engine/type_binary_indexes.test @@ -130,7 +130,7 @@ if (!$mysql_errname) SHOW INDEX IN t1; INSERT INTO t1 (b,b20,v16,v128) VALUES ('a','char1','varchar1a','varchar1b'),('a','char2','varchar2a','varchar2b'),('b','char3','varchar1a','varchar1b'),('c','char4','varchar3a','varchar3b'),('d','char5','varchar4a','varchar3b'),('e','char6','varchar2a','varchar3b'); - INSERT INTO t1 SELECT * FROM t1; + INSERT INTO t1 (b,b20,v16,v128) SELECT b,b20,v16,v128 FROM t1; --replace_column 1 # 2 # 3 # 4 # 5 # 7 # 8 # 9 # 10 # EXPLAIN SELECT HEX(SUBSTRING(v16,0,3)) FROM t1 WHERE v16 LIKE 'varchar%'; diff --git a/mysql-test/suite/storage_engine/type_bit.inc b/mysql-test/suite/storage_engine/type_bit.inc index 1a232305e1c..eb7920f8d83 100644 --- a/mysql-test/suite/storage_engine/type_bit.inc +++ b/mysql-test/suite/storage_engine/type_bit.inc @@ -43,28 +43,28 @@ if (!$mysql_errname) SHOW COLUMNS IN t1; } - INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); + INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); --sorted_result SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; - INSERT INTO t1 VALUES (1,0,-1,0); + INSERT INTO t1 (a,b,c,d) VALUES (1,0,-1,0); --sorted_result SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; - INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); + INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0); --sorted_result SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); # Out of range values # (should produce warnings) - INSERT INTO t1 VALUES (0x10,0,0,1); + INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1); --sorted_result - SELECT * FROM t1; + SELECT a,b,c,d FROM t1; - INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); + INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0); --sorted_result - SELECT * FROM t1; + SELECT a,b,c,d FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_bit.result b/mysql-test/suite/storage_engine/type_bit.result index 69b9ac53d76..3c88b297d8a 100644 --- a/mysql-test/suite/storage_engine/type_bit.result +++ b/mysql-test/suite/storage_engine/type_bit.result @@ -18,29 +18,29 @@ a bit(1) # # # b bit(20) # # # c bit(64) # # # d bit(1) # # # -INSERT INTO t1 VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); +INSERT INTO t1 (a,b,c,d) VALUES (0,POW(2,20)-1,b'1111111111111111111111111111111111111111111111111111111111111111',1); SELECT BIN(a), HEX(b), c+0 FROM t1 WHERE d>0; BIN(a) HEX(b) c+0 0 FFFFF 18446744073709551615 -INSERT INTO t1 VALUES (1,0,-1,0); +INSERT INTO t1 (a,b,c,d) VALUES (1,0,-1,0); SELECT a+0, b+0, c+0 FROM t1 WHERE d<100; a+0 b+0 c+0 0 1048575 18446744073709551615 1 0 18446744073709551615 -INSERT INTO t1 VALUES (b'1', 'f', 0xFF, 0x0); +INSERT INTO t1 (a,b,c,d) VALUES (b'1', 'f', 0xFF, 0x0); SELECT a+0, b+0, c+0 FROM t1 WHERE d IN (0, 2); a+0 b+0 c+0 1 0 18446744073709551615 1 102 255 -INSERT INTO t1 VALUES (0x10,0,0,1); +INSERT INTO t1 (a,b,c,d) VALUES (0x10,0,0,1); Warnings: Warning 1264 Out of range value for column 'a' at row 1 -SELECT * FROM t1; +SELECT a,b,c,d FROM t1; a b c d -INSERT INTO t1 VALUES (0x01,0,0x10000000000000000,0); +INSERT INTO t1 (a,b,c,d) VALUES (0x01,0,0x10000000000000000,0); Warnings: Warning 1264 Out of range value for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c,d FROM t1; a b c d DROP TABLE t1; CREATE TABLE t1 (a BIT(65) <CUSTOM_COL_OPTIONS>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; diff --git a/mysql-test/suite/storage_engine/type_blob.inc b/mysql-test/suite/storage_engine/type_blob.inc index 93a52fc9971..626c556102e 100644 --- a/mysql-test/suite/storage_engine/type_blob.inc +++ b/mysql-test/suite/storage_engine/type_blob.inc @@ -33,7 +33,7 @@ if (!$mysql_errname) # Valid values # (cannot get MAX for all columns due to max_allowed_packet limitations) - INSERT INTO t1 VALUES + INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -44,7 +44,7 @@ if (!$mysql_errname) # Invalid values (produce warnings, except for mediumblob and longblob columns for which the values are within limits) - INSERT INTO t1 VALUES + INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); --sorted_result diff --git a/mysql-test/suite/storage_engine/type_blob.result b/mysql-test/suite/storage_engine/type_blob.result index a93391f749a..9a9e14709e5 100644 --- a/mysql-test/suite/storage_engine/type_blob.result +++ b/mysql-test/suite/storage_engine/type_blob.result @@ -22,7 +22,7 @@ b17m longblob # # # t tinyblob # # # m mediumblob # # # l longblob # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -33,7 +33,7 @@ LENGTH(b) LENGTH(b0) LENGTH(b1) LENGTH(b300) LENGTH(bm) LENGTH(b70k) LENGTH(b17m 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 5 6 65535 65535 255 65535 65535 1048576 2097152 255 1048576 2097152 -INSERT INTO t1 VALUES +INSERT INTO t1 (b,b0,b1,b300,bm,b70k,b17m,t,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); Warnings: Warning 1265 Data truncated for column 'b' at row 1 diff --git a/mysql-test/suite/storage_engine/type_bool.inc b/mysql-test/suite/storage_engine/type_bool.inc index ae7d0043c49..b14f658c973 100644 --- a/mysql-test/suite/storage_engine/type_bool.inc +++ b/mysql-test/suite/storage_engine/type_bool.inc @@ -25,40 +25,40 @@ if (!$mysql_errname) # Valid values - INSERT INTO t1 VALUES (1,TRUE); + INSERT INTO t1 (b1,b2) VALUES (1,TRUE); --sorted_result - SELECT * FROM t1; + SELECT b1,b2 FROM t1; - INSERT INTO t1 VALUES (FALSE,0); + INSERT INTO t1 (b1,b2) VALUES (FALSE,0); --sorted_result - SELECT * FROM t1; + SELECT b1,b2 FROM t1; - INSERT INTO t1 VALUES (2,3); + INSERT INTO t1 (b1,b2) VALUES (2,3); --sorted_result - SELECT * FROM t1; + SELECT b1,b2 FROM t1; - INSERT INTO t1 VALUES (-1,-2); + INSERT INTO t1 (b1,b2) VALUES (-1,-2); --sorted_result - SELECT * FROM t1; + SELECT b1,b2 FROM t1; --sorted_result SELECT IF(b1,'true','false') AS a, IF(b2,'true','false') AS b FROM t1; --sorted_result - SELECT * FROM t1 WHERE b1 = TRUE; + SELECT b1,b2 FROM t1 WHERE b1 = TRUE; --sorted_result - SELECT * FROM t1 WHERE b2 = FALSE; + SELECT b1,b2 FROM t1 WHERE b2 = FALSE; # Invalid values - INSERT INTO t1 VALUES ('a','b'); + INSERT INTO t1 (b1,b2) VALUES ('a','b'); --sorted_result - SELECT * FROM t1; + SELECT b1,b2 FROM t1; - INSERT INTO t1 VALUES (128,-129); + INSERT INTO t1 (b1,b2) VALUES (128,-129); --sorted_result - SELECT * FROM t1; + SELECT b1,b2 FROM t1; # This is why we don't have zerofill and unsigned tests # for boolean columns: diff --git a/mysql-test/suite/storage_engine/type_bool.result b/mysql-test/suite/storage_engine/type_bool.result index 89beaa11a16..87308ed63fc 100644 --- a/mysql-test/suite/storage_engine/type_bool.result +++ b/mysql-test/suite/storage_engine/type_bool.result @@ -6,23 +6,23 @@ SHOW COLUMNS IN t1; Field Type Null Key Default Extra b1 tinyint(1) # # # b2 tinyint(1) # # # -INSERT INTO t1 VALUES (1,TRUE); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (1,TRUE); +SELECT b1,b2 FROM t1; b1 b2 1 1 -INSERT INTO t1 VALUES (FALSE,0); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (FALSE,0); +SELECT b1,b2 FROM t1; b1 b2 0 0 1 1 -INSERT INTO t1 VALUES (2,3); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (2,3); +SELECT b1,b2 FROM t1; b1 b2 0 0 1 1 2 3 -INSERT INTO t1 VALUES (-1,-2); -SELECT * FROM t1; +INSERT INTO t1 (b1,b2) VALUES (-1,-2); +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 @@ -34,28 +34,28 @@ false false true true true true true true -SELECT * FROM t1 WHERE b1 = TRUE; +SELECT b1,b2 FROM t1 WHERE b1 = TRUE; b1 b2 1 1 -SELECT * FROM t1 WHERE b2 = FALSE; +SELECT b1,b2 FROM t1 WHERE b2 = FALSE; b1 b2 0 0 -INSERT INTO t1 VALUES ('a','b'); +INSERT INTO t1 (b1,b2) VALUES ('a','b'); Warnings: Warning 1366 Incorrect integer value: 'a' for column 'b1' at row 1 Warning 1366 Incorrect integer value: 'b' for column 'b2' at row 1 -SELECT * FROM t1; +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 0 0 1 1 2 3 -INSERT INTO t1 VALUES (128,-129); +INSERT INTO t1 (b1,b2) VALUES (128,-129); Warnings: Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b2' at row 1 -SELECT * FROM t1; +SELECT b1,b2 FROM t1; b1 b2 -1 -2 0 0 diff --git a/mysql-test/suite/storage_engine/type_char.inc b/mysql-test/suite/storage_engine/type_char.inc index 8484fc23b10..8e666299736 100644 --- a/mysql-test/suite/storage_engine/type_char.inc +++ b/mysql-test/suite/storage_engine/type_char.inc @@ -27,19 +27,19 @@ if (!$mysql_errname) # Valid values - INSERT INTO t1 VALUES ('','','','',''); - INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); + INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','',''); + INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); --sorted_result - SELECT * FROM t1; + SELECT c,c0,c1,c20,c255 FROM t1; # Invalid values - INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); - INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; + INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); + INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; --sorted_result - SELECT * FROM t1; + SELECT c,c0,c1,c20,c255 FROM t1; --sorted_result SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20; diff --git a/mysql-test/suite/storage_engine/type_char.result b/mysql-test/suite/storage_engine/type_char.result index 61d3cf2419d..ce6d6f11b19 100644 --- a/mysql-test/suite/storage_engine/type_char.result +++ b/mysql-test/suite/storage_engine/type_char.result @@ -12,20 +12,20 @@ c0 char(0) # # # c1 char(1) # # # c20 char(20) # # # c255 char(255) # # # -INSERT INTO t1 VALUES ('','','','',''); -INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); -SELECT * FROM t1; +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('','','','',''); +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.'); +SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 a b abcdefghi klmnopqrst Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn't already exist which would work. -INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); +INSERT INTO t1 (c,c0,c1,c20,c255) VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256)); Warnings: Warning 1265 Data truncated for column 'c' at row 1 Warning 1265 Data truncated for column 'c0' at row 1 Warning 1265 Data truncated for column 'c1' at row 1 Warning 1265 Data truncated for column 'c20' at row 1 Warning 1265 Data truncated for column 'c255' at row 1 -INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; +INSERT INTO t1 (c,c0,c1,c20,c255) SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1; Warnings: Warning 1265 Data truncated for column 'c' at row 2 Warning 1265 Data truncated for column 'c0' at row 2 @@ -36,7 +36,7 @@ Warning 1265 Data truncated for column 'c0' at row 3 Warning 1265 Data truncated for column 'c1' at row 3 Warning 1265 Data truncated for column 'c20' at row 3 Warning 1265 Data truncated for column 'c255' at row 3 -SELECT * FROM t1; +SELECT c,c0,c1,c20,c255 FROM t1; c c0 c1 c20 c255 diff --git a/mysql-test/suite/storage_engine/type_char_indexes.result b/mysql-test/suite/storage_engine/type_char_indexes.result index f02fcef3ef0..33594e2581f 100644 --- a/mysql-test/suite/storage_engine/type_char_indexes.result +++ b/mysql-test/suite/storage_engine/type_char_indexes.result @@ -96,10 +96,10 @@ varchar1b 2 varchar2b 1 varchar3b 1 SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; -EXPLAIN SELECT * FROM t1 WHERE c > 'a'; +EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a'; id select_type table type possible_keys key key_len ref rows Extra # # # range c_v c_v # # # Using index condition -SELECT * FROM t1 WHERE c > 'a'; +SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a'; c c20 v16 v128 b char3 varchar1a varchar1b c char4 varchar3a varchar3b @@ -133,10 +133,10 @@ r1a r1a r2a r3a -EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; +EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; id select_type table type possible_keys key key_len ref rows Extra # # # range # v16 # # # # -SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; +SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; c c20 v16 v128 a char1 varchar1a varchar1b b char3 varchar1a varchar1b diff --git a/mysql-test/suite/storage_engine/type_char_indexes.test b/mysql-test/suite/storage_engine/type_char_indexes.test index 582800eabba..6fff8a6f73e 100644 --- a/mysql-test/suite/storage_engine/type_char_indexes.test +++ b/mysql-test/suite/storage_engine/type_char_indexes.test @@ -135,9 +135,9 @@ if (!$mysql_errname) SET SESSION optimizer_switch = 'engine_condition_pushdown=on'; --replace_column 1 # 2 # 3 # 7 # 8 # 9 # - EXPLAIN SELECT * FROM t1 WHERE c > 'a'; + EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a'; --sorted_result - SELECT * FROM t1 WHERE c > 'a'; + SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a'; SET SESSION optimizer_switch = @@global.optimizer_switch; DROP TABLE t1; @@ -175,9 +175,9 @@ if (!$mysql_errname) SELECT SUBSTRING(v16,7,3) FROM t1 IGNORE INDEX (v16) WHERE v16 LIKE 'varchar%'; --replace_column 1 # 2 # 3 # 5 # 7 # 8 # 9 # 10 # - EXPLAIN SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; --sorted_result - SELECT * FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; + SELECT c,c20,v16,v128 FROM t1 WHERE v16 = 'varchar1a' OR v16 = 'varchar3a' ORDER BY v16; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/type_date_time.inc b/mysql-test/suite/storage_engine/type_date_time.inc index d0b953984be..29bfcf630f0 100644 --- a/mysql-test/suite/storage_engine/type_date_time.inc +++ b/mysql-test/suite/storage_engine/type_date_time.inc @@ -32,22 +32,22 @@ if (!$mysql_errname) # Valid values # '1970-01-01 00:00:01' - INSERT INTO t1 VALUES + INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), ('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), ('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); --sorted_result - SELECT * FROM t1; + SELECT d,dt,ts,t,y,y4,y2 FROM t1; # Invalid values - INSERT INTO t1 VALUES + INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); --sorted_result - SELECT * FROM t1; + SELECT d,dt,ts,t,y,y4,y2 FROM t1; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/type_date_time.result b/mysql-test/suite/storage_engine/type_date_time.result index 06b92d3149f..73c9a2ec7ed 100644 --- a/mysql-test/suite/storage_engine/type_date_time.result +++ b/mysql-test/suite/storage_engine/type_date_time.result @@ -19,18 +19,18 @@ y year(4) # # # y4 year(4) # # # y2 year(2) # # # SET @tm = '2012-04-09 05:27:00'; -INSERT INTO t1 VALUES +INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00'), ('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99'), ('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0'), (DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm)); -SELECT * FROM t1; +SELECT d,dt,ts,t,y,y4,y2 FROM t1; d dt ts t y y4 y2 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 00 2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 12 9999-12-31 9999-12-31 23:59:59 2038-01-19 07:14:07 838:59:59 2155 2155 99 -INSERT INTO t1 VALUES +INSERT INTO t1 (d,dt,ts,t,y,y4,y2) VALUES ('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1' ); Warnings: Warning 1265 Data truncated for column 'd' at row 1 @@ -40,7 +40,7 @@ Warning 1264 Out of range value for column 't' at row 1 Warning 1264 Out of range value for column 'y' at row 1 Warning 1264 Out of range value for column 'y4' at row 1 Warning 1264 Out of range value for column 'y2' at row 1 -SELECT * FROM t1; +SELECT d,dt,ts,t,y,y4,y2 FROM t1; d dt ts t y y4 y2 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 00 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 00 diff --git a/mysql-test/suite/storage_engine/type_enum.inc b/mysql-test/suite/storage_engine/type_enum.inc index 6b9b83fc52e..2e747e50ef4 100644 --- a/mysql-test/suite/storage_engine/type_enum.inc +++ b/mysql-test/suite/storage_engine/type_enum.inc @@ -28,16 +28,16 @@ if (!$mysql_errname) --replace_column 3 # 4 # 5 # SHOW COLUMNS IN t1; - INSERT INTO t1 VALUES ('','test2','4'),('',5,2); + INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2); --sorted_result - SELECT * FROM t1; + SELECT a,b,c FROM t1; # Out of range values # (should produce warnings) - INSERT INTO t1 VALUES (0,'test6',-1); + INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); --sorted_result - SELECT * FROM t1; + SELECT a,b,c FROM t1; # Non-unique values in enum # (should produce a warning) @@ -53,14 +53,14 @@ if (!$mysql_errname) --replace_column 3 # 4 # 5 # SHOW COLUMNS IN t1; - INSERT INTO t1 VALUES ('','test3','75','A'); + INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A'); --sorted_result - SELECT * FROM t1; + SELECT a,b,c,e FROM t1; # Simple comparison --sorted_result - SELECT * FROM t1 WHERE b='test2' OR a != ''; + SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != ''; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/type_enum.result b/mysql-test/suite/storage_engine/type_enum.result index 920aa5c7807..c2efd87ffb7 100644 --- a/mysql-test/suite/storage_engine/type_enum.result +++ b/mysql-test/suite/storage_engine/type_enum.result @@ -8,17 +8,17 @@ Field Type Null Key Default Extra a enum('') # # # b enum('test1','test2','test3','test4','test5') # # # c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # -INSERT INTO t1 VALUES ('','test2','4'),('',5,2); -SELECT * FROM t1; +INSERT INTO t1 (a,b,c) VALUES ('','test2','4'),('',5,2); +SELECT a,b,c FROM t1; a b c test2 4 test5 2 -INSERT INTO t1 VALUES (0,'test6',-1); +INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); Warnings: Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c test2 4 @@ -33,14 +33,14 @@ a enum('') # # # b enum('test1','test2','test3','test4','test5') # # # c enum('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i','3j','3k','3l','3m','3n','3o','3p','3q','3r','3s','3t','3u','3v','3w','3x','3y','3z','40','41','42','43','44','45','46','47','48','49','4a','4b','4c','4d','4e','4f','4g','4h','4i','4j','4k','4l','4m','4n','4o','4p','4q','4r','4s','4t','4u','4v','4w','4x','4y','4z','50','51','52','53','54','55','56','57','58','59','5a','5b','5c','5d','5e','5f','5g','5h','5i','5j','5k','5l','5m','5n','5o','5p','5q','5r','5s','5t','5u','5v','5w','5x','5y','5z','60','61','62','63','64','65','66','67','68','69','6a','6b','6c','6d','6e','6f','6g','6h','6i','6j','6k','6l','6m','6n','6o','6p','6q','6r','6s','6t','6u','6v','6w','6x','6y','6z','70','71','72','73','74','75') # # # e enum('a','A') # # # -INSERT INTO t1 VALUES ('','test3','75','A'); -SELECT * FROM t1; +INSERT INTO t1 (a,b,c,e) VALUES ('','test3','75','A'); +SELECT a,b,c,e FROM t1; a b c e NULL test2 4 NULL test3 75 a test5 2 NULL -SELECT * FROM t1 WHERE b='test2' OR a != ''; +SELECT a,b,c,e FROM t1 WHERE b='test2' OR a != ''; a b c e test2 4 NULL DROP TABLE t1; diff --git a/mysql-test/suite/storage_engine/type_fixed.inc b/mysql-test/suite/storage_engine/type_fixed.inc index 6765fb575bc..3b4ade9ff6d 100644 --- a/mysql-test/suite/storage_engine/type_fixed.inc +++ b/mysql-test/suite/storage_engine/type_fixed.inc @@ -32,40 +32,40 @@ if (!$mysql_errname) # Always valid values - INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); - INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); - INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); --sorted_result - SELECT * FROM t1; + SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; # Values which can be valid or not, # depending on whether columns are SIGNED or UNSIGNED # (if not valid should produce warnings) - INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); - INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); --sorted_result - SELECT * FROM t1; + SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; --sorted_result - SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; + SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; # Invalid values - INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); --sorted_result - SELECT * FROM t1; + SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; - INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); --sorted_result - SELECT * FROM t1; + SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; - INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); + INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); --sorted_result - SELECT * FROM t1; + SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; --let $error_codes = ER_TOO_BIG_PRECISION --let $alter_definition = ADD COLUMN n66 NUMERIC(66) diff --git a/mysql-test/suite/storage_engine/type_fixed.result b/mysql-test/suite/storage_engine/type_fixed.result index 2c1566538db..5eea911a323 100644 --- a/mysql-test/suite/storage_engine/type_fixed.result +++ b/mysql-test/suite/storage_engine/type_fixed.result @@ -22,30 +22,30 @@ n0_0 decimal(10,0) # # # n1 decimal(1,0) # # # n20_4 decimal(20,4) # # # n65_4 decimal(65,4) # # # -INSERT INTO t1 VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (100,123456,0.3,40000.25,123456789123456789.10001,1024,7000.0,8.0,999999.9,9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.0,9999999999.0,0.9,99999999.99,99999999999999999999999999999999999999999999999999.9999999999,9999999999.0,9999999999.0,9.0,9999999999999999.9999,9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); -INSERT INTO t1 VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); -SELECT * FROM t1; +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-100,-123456,-0.3,-40000.25,-123456789123456789.10001,-1024,-7000.0,-8.0,-999999.9,-9223372036854775807); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (-9999999999.0,-9999999999.0,-0.9,-99999999.99,-99999999999999999999999999999999999999999999999999.9999999999,-9999999999.0,-9999999999.0,-9.0,-9999999999999999.9999,-9999999999999999999999999999999999999999999999999999999999999.9999); +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -SELECT * FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1 WHERE n20_4 = 9999999999999999.9999 OR d < 100; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 0 0 0.0 0.00 0.0000000000 0 0 0 0.0000 0.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) SELECT n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4, n65_4 FROM t1 WHERE n65_4 = ( SELECT MAX(n65_4) FROM t1 ); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -56,7 +56,7 @@ Warning 1264 Out of range value for column 'n' at row 1 Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -64,7 +64,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 100 123456 0.3 40000.25 123456789123456789.1000100000 1024 7000 8 999999.9000 9223372036854775807.0000 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (10000000000.0,10000000000.0,1.1,100000000.99,100000000000000000000000000000000000000000000000000.0,10000000000.0,10000000000.0,10.0,10000000000000000.9999,10000000000000000000000000000000000000000000000000000000000000.9999); Warnings: Warning 1264 Out of range value for column 'd' at row 1 Warning 1264 Out of range value for column 'd0' at row 1 @@ -76,7 +76,7 @@ Warning 1264 Out of range value for column 'n0_0' at row 1 Warning 1264 Out of range value for column 'n1' at row 1 Warning 1264 Out of range value for column 'n20_4' at row 1 Warning 1264 Out of range value for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 @@ -85,7 +85,7 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999 -INSERT INTO t1 VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); +INSERT INTO t1 (d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4) VALUES (9999999999.1,9999999999.1,1.9,99999999.001,99999999999999999999999999999999999999999999999999.99999999991,9999999999.1,9999999999.1,9.1,9999999999999999.00001,9999999999999999999999999999999999999999999999999999999999999.11111); Warnings: Note 1265 Data truncated for column 'd' at row 1 Note 1265 Data truncated for column 'd0' at row 1 @@ -97,7 +97,7 @@ Note 1265 Data truncated for column 'n0_0' at row 1 Note 1265 Data truncated for column 'n1' at row 1 Note 1265 Data truncated for column 'n20_4' at row 1 Note 1265 Data truncated for column 'n65_4' at row 1 -SELECT * FROM t1; +SELECT d,d0,d1_1,d10_2,d60_10,n,n0_0,n1,n20_4,n65_4 FROM t1; d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4 -100 -123456 -0.3 -40000.25 -123456789123456789.1000100000 -1024 -7000 -8 -999999.9000 -9223372036854775807.0000 -9999999999 -9999999999 -0.9 -99999999.99 -99999999999999999999999999999999999999999999999999.9999999999 -9999999999 -9999999999 -9 -9999999999999999.9999 -9999999999999999999999999999999999999999999999999999999999999.9999 diff --git a/mysql-test/suite/storage_engine/type_float.inc b/mysql-test/suite/storage_engine/type_float.inc index 7e355f01e0d..1b8f0102755 100644 --- a/mysql-test/suite/storage_engine/type_float.inc +++ b/mysql-test/suite/storage_engine/type_float.inc @@ -32,13 +32,13 @@ if (!$mysql_errname) # Always valid values - INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); + INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); --sorted_result - --query_vertical SELECT * FROM t1 + --query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1 - INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); - INSERT INTO t1 VALUES ( + INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 99999999999999999999999999999999999999, 99999999999999999999999999999999999999.9999999999999999, 0.9, @@ -52,28 +52,28 @@ if (!$mysql_errname) ); --sorted_result - --query_vertical SELECT * FROM t1 + --query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1 # Values which can be valid or not, # depending on whether columns are SIGNED or UNSIGNED # (if not valid should produce warnings) - INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); + INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); --sorted_result - --query_vertical SELECT * FROM t1 + --query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1 --sorted_result --query_vertical SELECT MAX(f), MAX(f0), MAX(r1_1), MAX(f23_0), MAX(f20_3), MAX(d), MAX(d1_0), MAX(d10_10), MAX(d53), MAX(d53_10) FROM t1 # Invalid values - INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; + INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; --sorted_result - --query_vertical SELECT * FROM t1 + --query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1 - INSERT INTO t1 VALUES ( + INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 999999999999999999999999999999999999999, 999999999999999999999999999999999999999.9999999999999999, 1.9, @@ -87,7 +87,7 @@ if (!$mysql_errname) ); --sorted_result - --query_vertical SELECT * FROM t1 + --query_vertical SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1 --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH --let $alter_definition = ADD COLUMN d0_0 DOUBLE(0,0) diff --git a/mysql-test/suite/storage_engine/type_float.result b/mysql-test/suite/storage_engine/type_float.result index 1f863505430..5cd76673a3c 100644 --- a/mysql-test/suite/storage_engine/type_float.result +++ b/mysql-test/suite/storage_engine/type_float.result @@ -22,8 +22,8 @@ d1_0 double(1,0) # # # d10_10 double(10,10) # # # d53 double(53,0) # # # d53_10 double(53,10) # # # -INSERT INTO t1 VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (12345.12345,12345.12345,0.9,123456789.123,56789.987,11111111.111,8.0,0.0123456789,1234566789123456789,99999999999999999.99999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 11111111.111 d10_10 0.0123456789 @@ -34,8 +34,8 @@ f0 12345.1 f20_3 56789.988 f23_0 123457000 r1_1 0.9 -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 99999999999999999999999999999999999999, 99999999999999999999999999999999999999.9999999999999999, 0.9, @@ -50,7 +50,7 @@ INSERT INTO t1 VALUES ( Warnings: Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d 0 d 11111111.111 @@ -81,8 +81,8 @@ f23_0 1e38 r1_1 0.0 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); -SELECT * FROM t1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES (-999999999999999999999999,-99999999999.999999999999,-0.9,-999.99999999999999999999,-99999999999999999.999,-999999999999999999999999999999999999999999999999999999999999-0.999,-9,-.9999999999,-999999999999999999999999999999.99999999999999999999999,-9999999999999999999999999999999999999999999.9999999999); +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -134,7 +134,7 @@ MAX(f0) 9.999999680285692e37 MAX(f20_3) 99999998430674940.000 MAX(f23_0) 9.999999680285692e37 MAX(r1_1) 0.9 -INSERT INTO t1 SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) SELECT d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10, d53_10 FROM t1 ORDER BY d53_10 DESC LIMIT 1; Warnings: Warning 1264 Out of range value for column 'f' at row 1 Warning 1264 Out of range value for column 'f0' at row 1 @@ -142,7 +142,7 @@ Warning 1264 Out of range value for column 'r1_1' at row 1 Warning 1264 Out of range value for column 'f23_0' at row 1 Warning 1264 Out of range value for column 'f20_3' at row 1 Warning 1264 Out of range value for column 'd1_0' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 @@ -193,7 +193,7 @@ r1_1 0.0 r1_1 0.9 r1_1 0.9 r1_1 0.9 -INSERT INTO t1 VALUES ( +INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10) VALUES ( 999999999999999999999999999999999999999, 999999999999999999999999999999999999999.9999999999999999, 1.9, @@ -216,7 +216,7 @@ Warning 1264 Out of range value for column 'd1_0' at row 1 Warning 1264 Out of range value for column 'd10_10' at row 1 Warning 1264 Out of range value for column 'd53' at row 1 Warning 1264 Out of range value for column 'd53_10' at row 1 -SELECT * FROM t1; +SELECT f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10 FROM t1; f 12345.1 d -1e60 d 0 diff --git a/mysql-test/suite/storage_engine/type_int.inc b/mysql-test/suite/storage_engine/type_int.inc index 5aaea78fcd5..058b18a24d5 100644 --- a/mysql-test/suite/storage_engine/type_int.inc +++ b/mysql-test/suite/storage_engine/type_int.inc @@ -42,32 +42,32 @@ if (!$mysql_errname) # Always valid values - INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); - INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); - INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); --sorted_result - SELECT * FROM t1; + SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; # Values which can be valid or not, # depending on whether columns are SIGNED or UNSIGNED # (if not valid should produce warnings) - INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); - INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); --sorted_result - SELECT * FROM t1; + SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; # Invalid values - INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); - INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); - INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); + INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); --sorted_result - SELECT * FROM t1; + SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; --let $error_codes = ER_TOO_BIG_DISPLAYWIDTH --let $alter_definition = ADD COLUMN i257 INT(257) diff --git a/mysql-test/suite/storage_engine/type_int.result b/mysql-test/suite/storage_engine/type_int.result index 47f4ebad93a..8f462648a6a 100644 --- a/mysql-test/suite/storage_engine/type_int.result +++ b/mysql-test/suite/storage_engine/type_int.result @@ -42,16 +42,16 @@ b bigint(20) # # # b0 bigint(20) # # # b1 bigint(1) # # # b20 bigint(20) # # # -INSERT INTO t1 VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); -INSERT INTO t1 VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO t1 VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); -SELECT * FROM t1; +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (2147483647,2147483647,2147483647,2147483647,127,127,127,127,32767,32767,32767,32767,8388607,8388607,8388607,8388607,9223372036854775807,9223372036854775807,9223372036854775807,9223372036854775807); +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 -INSERT INTO t1 VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); -INSERT INTO t1 VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483648,-2147483648,-2147483648,-2147483648,-128,-128,-128,-128,-32768,-32768,-32768,-32768,-8388608,-8388608,-8388608,-8388608,-9223372036854775808,-9223372036854775808,-9223372036854775808,-9223372036854775808); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967295,4294967295,4294967295,4294967295,255,255,255,255,65535,65535,65535,65535,16777215,16777215,16777215,16777215,18446744073709551615,18446744073709551615,18446744073709551615,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -73,14 +73,14 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 2147483647 2147483647 2147483647 2147483647 127 127 127 127 32767 32767 32767 32767 8388607 8388607 8388607 8388607 9223372036854775807 9223372036854775807 9223372036854775807 9223372036854775807 -INSERT INTO t1 VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (-2147483649,-2147483649,-2147483649,-2147483649,-129,-129,-129,-129,-32769,-32769,-32769,-32769,-8388609,-8388609,-8388609,-8388609,-9223372036854775809,-9223372036854775809,-9223372036854775809,-9223372036854775809); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -102,7 +102,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) VALUES (4294967296,4294967296,4294967296,4294967296,256,256,256,256,65536,65536,65536,65536,16777216,16777216,16777216,16777216,18446744073709551616,18446744073709551616,18446744073709551616,18446744073709551616); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -124,7 +124,7 @@ Warning 1264 Out of range value for column 'b' at row 1 Warning 1264 Out of range value for column 'b0' at row 1 Warning 1264 Out of range value for column 'b1' at row 1 Warning 1264 Out of range value for column 'b20' at row 1 -INSERT INTO t1 SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); +INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615); Warnings: Warning 1264 Out of range value for column 'i' at row 1 Warning 1264 Out of range value for column 'i0' at row 1 @@ -190,7 +190,7 @@ Warning 1264 Out of range value for column 'm' at row 4 Warning 1264 Out of range value for column 'm0' at row 4 Warning 1264 Out of range value for column 'm1' at row 4 Warning 1264 Out of range value for column 'm20' at row 4 -SELECT * FROM t1; +SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1; i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 -2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808 diff --git a/mysql-test/suite/storage_engine/type_set.inc b/mysql-test/suite/storage_engine/type_set.inc index b4844b00ec7..bc927cf8014 100644 --- a/mysql-test/suite/storage_engine/type_set.inc +++ b/mysql-test/suite/storage_engine/type_set.inc @@ -25,19 +25,19 @@ if (!$mysql_errname) --replace_column 3 # 4 # 5 # SHOW COLUMNS IN t1; - INSERT INTO t1 VALUES + INSERT INTO t1 (a,b,c) VALUES ('','test2,test3','01,34,44,,23'), ('',5,2), (',','test4,test2',''); --sorted_result - SELECT * FROM t1; + SELECT a,b,c FROM t1; # Out of range values # (should produce warnings) - INSERT INTO t1 VALUES (0,'test6',-1); + INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); --sorted_result - SELECT * FROM t1; + SELECT a,b,c FROM t1; # Non-unique values in set # (should produce a warning) @@ -62,7 +62,7 @@ if (!$mysql_errname) # Simple comparison --sorted_result - SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; + SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; DROP TABLE t1; } diff --git a/mysql-test/suite/storage_engine/type_set.result b/mysql-test/suite/storage_engine/type_set.result index 210b07748bc..2248ce9f7e0 100644 --- a/mysql-test/suite/storage_engine/type_set.result +++ b/mysql-test/suite/storage_engine/type_set.result @@ -8,22 +8,22 @@ Field Type Null Key Default Extra a set('') # # # b set('test1','test2','test3','test4','test5') # # # c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50''51','52','53','54','55','56','57','58','59','60','61','62','63','64') # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (a,b,c) VALUES ('','test2,test3','01,34,44,,23'), ('',5,2), (',','test4,test2',''); Warnings: Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c test1,test3 02 test2,test3 01,23,34,44 test2,test4 -INSERT INTO t1 VALUES (0,'test6',-1); +INSERT INTO t1 (a,b,c) VALUES (0,'test6',-1); Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'c' at row 1 -SELECT * FROM t1; +SELECT a,b,c FROM t1; a b c 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50'51,52,53,54,55,56,57,58,59,60,61,62,63,64 test1,test3 02 @@ -41,7 +41,7 @@ c set('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15' e set('a','A') # # # ALTER TABLE t1 ADD COLUMN f SET('1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',' ','11','12','13','14','15','16','17','18','19','1a','1b','1c','1d','1e','1f','1g','1h','1i','1j','1k','1l','1m','1n','1o','1p','1q','1r','1s','1t','1u','1v','1w','1x','1y','1z','20','21','22','23','24','25','26','27','28','29','2a','2b','2c','2d','2e','2f','2g','2h','2i','2j','2k','2l','2m','2n','2o','2p','2q','2r','2s','2t','2u','2v','2w','2x','2y','2z','30','31','32','33','34','35','36','37','38','39','3a','3b','3c','3d','3e','3f','3g','3h','3i') <CUSTOM_COL_OPTIONS>; ERROR HY000: Too many strings for column f and SET -SELECT * FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; +SELECT a,b,c,e FROM t1 WHERE FIND_IN_SET('test2',b)>0 OR a != ''; a b c e test2,test3 01,23,34,44 NULL test2,test4 NULL diff --git a/mysql-test/suite/storage_engine/type_spatial.inc b/mysql-test/suite/storage_engine/type_spatial.inc index 5195f779bcc..212786d60bf 100644 --- a/mysql-test/suite/storage_engine/type_spatial.inc +++ b/mysql-test/suite/storage_engine/type_spatial.inc @@ -372,50 +372,50 @@ if (!$mysql_errname) SHOW FIELDS FROM gis_geometrycollection; SHOW FIELDS FROM gis_geometry; - INSERT INTO gis_point VALUES + INSERT INTO gis_point (fid,g) VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); - INSERT INTO gis_line VALUES + INSERT INTO gis_line (fid,g) VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); - INSERT INTO gis_polygon VALUES + INSERT INTO gis_polygon (fid,g) VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); - INSERT INTO gis_multi_point VALUES + INSERT INTO gis_multi_point (fid,g) VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); - INSERT INTO gis_multi_line VALUES + INSERT INTO gis_multi_line (fid,g) VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); - INSERT INTO gis_multi_polygon VALUES + INSERT INTO gis_multi_polygon (fid,g) VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); - INSERT INTO gis_geometrycollection VALUES + INSERT INTO gis_geometrycollection (fid,g) VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), (122, GeomFromText('GeometryCollection()')), (123, GeomFromText('GeometryCollection EMPTY')); - INSERT into gis_geometry SELECT * FROM gis_point; - INSERT into gis_geometry SELECT * FROM gis_line; - INSERT into gis_geometry SELECT * FROM gis_polygon; - INSERT into gis_geometry SELECT * FROM gis_multi_point; - INSERT into gis_geometry SELECT * FROM gis_multi_line; - INSERT into gis_geometry SELECT * FROM gis_multi_polygon; - INSERT into gis_geometry SELECT * FROM gis_geometrycollection; + INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_point; + INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_line; + INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_polygon; + INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_point; + INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_line; + INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_polygon; + INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_geometrycollection; SELECT fid, AsText(g) FROM gis_point; SELECT fid, AsText(g) FROM gis_line; @@ -475,7 +475,7 @@ if (!$mysql_errname) USE gis_ogs; --echo # Lakes - INSERT INTO lakes VALUES ( + INSERT INTO lakes (fid,name,shore) VALUES ( 101, 'BLUE LAKE', PolyFromText( 'POLYGON( @@ -486,37 +486,37 @@ if (!$mysql_errname) --echo # Road Segments - INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, + INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(102, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); - INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, + INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(103, 'Route 5', 'Main Street', 4, LineFromText( 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); - INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, + INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(104, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 70 38, 72 48 )' ,101)); - INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, + INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(105, 'Main Street', NULL, 4, LineFromText( 'LINESTRING( 70 38, 84 42 )' ,101)); - INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, + INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(106, 'Dirt Road by Green Forest', NULL, 1, LineFromText( 'LINESTRING( 28 26, 28 0 )',101)); --echo # DividedRoutes - INSERT INTO divided_routes VALUES(119, 'Route 75', 4, + INSERT INTO divided_routes (fid,name,num_lanes,centerlines) VALUES(119, 'Route 75', 4, MLineFromText( 'MULTILINESTRING((10 48,10 21,10 0), (16 0,16 23,16 48))', 101)); --echo # Forests - INSERT INTO forests VALUES(109, 'Green Forest', + INSERT INTO forests (fid,name,boundary) VALUES(109, 'Green Forest', MPolyFromText( 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', @@ -524,28 +524,28 @@ if (!$mysql_errname) --echo # Bridges - INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( + INSERT INTO bridges (fid,name,position) VALUES(110, 'Cam Bridge', PointFromText( 'POINT( 44 31 )', 101)); --echo # Streams - INSERT INTO streams VALUES(111, 'Cam Stream', + INSERT INTO streams (fid,name,centerline) VALUES(111, 'Cam Stream', LineFromText( 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); - INSERT INTO streams VALUES(112, NULL, + INSERT INTO streams (fid,name,centerline) VALUES(112, NULL, LineFromText( 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); --echo # Buildings - INSERT INTO buildings VALUES(113, '123 Main Street', + INSERT INTO buildings (fid,name,position,footprint) VALUES(113, '123 Main Street', PointFromText( 'POINT( 52 30 )', 101), PolyFromText( 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); - INSERT INTO buildings VALUES(114, '215 Main Street', + INSERT INTO buildings (fid,name,position,footprint) VALUES(114, '215 Main Street', PointFromText( 'POINT( 64 33 )', 101), PolyFromText( @@ -554,24 +554,24 @@ if (!$mysql_errname) --echo # Ponds - INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', + INSERT INTO ponds (fid,name,type,shores) VALUES(120, NULL, 'Stock Pond', MPolyFromText( 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); --echo # Named Places - INSERT INTO named_places VALUES(117, 'Ashton', + INSERT INTO named_places (fid,name,boundary) VALUES(117, 'Ashton', PolyFromText( 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); - INSERT INTO named_places VALUES(118, 'Goose Island', + INSERT INTO named_places (fid,name,boundary) VALUES(118, 'Goose Island', PolyFromText( 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); --echo # Map Neatlines - INSERT INTO map_neatlines VALUES(115, + INSERT INTO map_neatlines (fid,neatline) VALUES(115, PolyFromText( 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); diff --git a/mysql-test/suite/storage_engine/type_spatial.result b/mysql-test/suite/storage_engine/type_spatial.result index c6b856ab8b0..94e3b22fd3c 100644 --- a/mysql-test/suite/storage_engine/type_spatial.result +++ b/mysql-test/suite/storage_engine/type_spatial.result @@ -77,43 +77,43 @@ SHOW FIELDS FROM gis_geometry; Field Type Null Key Default Extra fid int(11) YES NULL g geometry YES NULL -INSERT INTO gis_point VALUES +INSERT INTO gis_point (fid,g) VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); -INSERT INTO gis_line VALUES +INSERT INTO gis_line (fid,g) VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); -INSERT INTO gis_polygon VALUES +INSERT INTO gis_polygon (fid,g) VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); -INSERT INTO gis_multi_point VALUES +INSERT INTO gis_multi_point (fid,g) VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); -INSERT INTO gis_multi_line VALUES +INSERT INTO gis_multi_line (fid,g) VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); -INSERT INTO gis_multi_polygon VALUES +INSERT INTO gis_multi_polygon (fid,g) VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); -INSERT INTO gis_geometrycollection VALUES +INSERT INTO gis_geometrycollection (fid,g) VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), (122, GeomFromText('GeometryCollection()')), (123, GeomFromText('GeometryCollection EMPTY')); -INSERT into gis_geometry SELECT * FROM gis_point; -INSERT into gis_geometry SELECT * FROM gis_line; -INSERT into gis_geometry SELECT * FROM gis_polygon; -INSERT into gis_geometry SELECT * FROM gis_multi_point; -INSERT into gis_geometry SELECT * FROM gis_multi_line; -INSERT into gis_geometry SELECT * FROM gis_multi_polygon; -INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_point; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_line; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_polygon; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_point; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_line; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_polygon; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_geometrycollection; SELECT fid, AsText(g) FROM gis_point; fid AsText(g) 101 POINT(10 10) @@ -431,7 +431,7 @@ first second w c o e d t i r DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; USE gis_ogs; # Lakes -INSERT INTO lakes VALUES ( +INSERT INTO lakes (fid,name,shore) VALUES ( 101, 'BLUE LAKE', PolyFromText( 'POLYGON( @@ -440,68 +440,68 @@ PolyFromText( )', 101)); # Road Segments -INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(102, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); -INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(103, 'Route 5', 'Main Street', 4, LineFromText( 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); -INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(104, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 70 38, 72 48 )' ,101)); -INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(105, 'Main Street', NULL, 4, LineFromText( 'LINESTRING( 70 38, 84 42 )' ,101)); -INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(106, 'Dirt Road by Green Forest', NULL, 1, LineFromText( 'LINESTRING( 28 26, 28 0 )',101)); # DividedRoutes -INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +INSERT INTO divided_routes (fid,name,num_lanes,centerlines) VALUES(119, 'Route 75', 4, MLineFromText( 'MULTILINESTRING((10 48,10 21,10 0), (16 0,16 23,16 48))', 101)); # Forests -INSERT INTO forests VALUES(109, 'Green Forest', +INSERT INTO forests (fid,name,boundary) VALUES(109, 'Green Forest', MPolyFromText( 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', 101)); # Bridges -INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +INSERT INTO bridges (fid,name,position) VALUES(110, 'Cam Bridge', PointFromText( 'POINT( 44 31 )', 101)); # Streams -INSERT INTO streams VALUES(111, 'Cam Stream', +INSERT INTO streams (fid,name,centerline) VALUES(111, 'Cam Stream', LineFromText( 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); -INSERT INTO streams VALUES(112, NULL, +INSERT INTO streams (fid,name,centerline) VALUES(112, NULL, LineFromText( 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); # Buildings -INSERT INTO buildings VALUES(113, '123 Main Street', +INSERT INTO buildings (fid,name,position,footprint) VALUES(113, '123 Main Street', PointFromText( 'POINT( 52 30 )', 101), PolyFromText( 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); -INSERT INTO buildings VALUES(114, '215 Main Street', +INSERT INTO buildings (fid,name,position,footprint) VALUES(114, '215 Main Street', PointFromText( 'POINT( 64 33 )', 101), PolyFromText( 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); # Ponds -INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +INSERT INTO ponds (fid,name,type,shores) VALUES(120, NULL, 'Stock Pond', MPolyFromText( 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); # Named Places -INSERT INTO named_places VALUES(117, 'Ashton', +INSERT INTO named_places (fid,name,boundary) VALUES(117, 'Ashton', PolyFromText( 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); -INSERT INTO named_places VALUES(118, 'Goose Island', +INSERT INTO named_places (fid,name,boundary) VALUES(118, 'Goose Island', PolyFromText( 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); # Map Neatlines -INSERT INTO map_neatlines VALUES(115, +INSERT INTO map_neatlines (fid,neatline) VALUES(115, PolyFromText( 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); SELECT Dimension(shore) diff --git a/mysql-test/suite/storage_engine/type_spatial_indexes.result b/mysql-test/suite/storage_engine/type_spatial_indexes.result index a3c2a4d4e75..cebcb80d14f 100644 --- a/mysql-test/suite/storage_engine/type_spatial_indexes.result +++ b/mysql-test/suite/storage_engine/type_spatial_indexes.result @@ -77,43 +77,43 @@ SHOW FIELDS FROM gis_geometry; Field Type Null Key Default Extra fid int(11) YES NULL g geometry YES NULL -INSERT INTO gis_point VALUES +INSERT INTO gis_point (fid,g) VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); -INSERT INTO gis_line VALUES +INSERT INTO gis_line (fid,g) VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); -INSERT INTO gis_polygon VALUES +INSERT INTO gis_polygon (fid,g) VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); -INSERT INTO gis_multi_point VALUES +INSERT INTO gis_multi_point (fid,g) VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); -INSERT INTO gis_multi_line VALUES +INSERT INTO gis_multi_line (fid,g) VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); -INSERT INTO gis_multi_polygon VALUES +INSERT INTO gis_multi_polygon (fid,g) VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); -INSERT INTO gis_geometrycollection VALUES +INSERT INTO gis_geometrycollection (fid,g) VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), (122, GeomFromText('GeometryCollection()')), (123, GeomFromText('GeometryCollection EMPTY')); -INSERT into gis_geometry SELECT * FROM gis_point; -INSERT into gis_geometry SELECT * FROM gis_line; -INSERT into gis_geometry SELECT * FROM gis_polygon; -INSERT into gis_geometry SELECT * FROM gis_multi_point; -INSERT into gis_geometry SELECT * FROM gis_multi_line; -INSERT into gis_geometry SELECT * FROM gis_multi_polygon; -INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_point; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_line; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_polygon; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_point; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_line; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_polygon; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_geometrycollection; SELECT fid, AsText(g) FROM gis_point; fid AsText(g) 101 POINT(10 10) @@ -431,7 +431,7 @@ first second w c o e d t i r DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; USE gis_ogs; # Lakes -INSERT INTO lakes VALUES ( +INSERT INTO lakes (fid,name,shore) VALUES ( 101, 'BLUE LAKE', PolyFromText( 'POLYGON( @@ -440,68 +440,68 @@ PolyFromText( )', 101)); # Road Segments -INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(102, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); -INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(103, 'Route 5', 'Main Street', 4, LineFromText( 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); -INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(104, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 70 38, 72 48 )' ,101)); -INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(105, 'Main Street', NULL, 4, LineFromText( 'LINESTRING( 70 38, 84 42 )' ,101)); -INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(106, 'Dirt Road by Green Forest', NULL, 1, LineFromText( 'LINESTRING( 28 26, 28 0 )',101)); # DividedRoutes -INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +INSERT INTO divided_routes (fid,name,num_lanes,centerlines) VALUES(119, 'Route 75', 4, MLineFromText( 'MULTILINESTRING((10 48,10 21,10 0), (16 0,16 23,16 48))', 101)); # Forests -INSERT INTO forests VALUES(109, 'Green Forest', +INSERT INTO forests (fid,name,boundary) VALUES(109, 'Green Forest', MPolyFromText( 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', 101)); # Bridges -INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +INSERT INTO bridges (fid,name,position) VALUES(110, 'Cam Bridge', PointFromText( 'POINT( 44 31 )', 101)); # Streams -INSERT INTO streams VALUES(111, 'Cam Stream', +INSERT INTO streams (fid,name,centerline) VALUES(111, 'Cam Stream', LineFromText( 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); -INSERT INTO streams VALUES(112, NULL, +INSERT INTO streams (fid,name,centerline) VALUES(112, NULL, LineFromText( 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); # Buildings -INSERT INTO buildings VALUES(113, '123 Main Street', +INSERT INTO buildings (fid,name,position,footprint) VALUES(113, '123 Main Street', PointFromText( 'POINT( 52 30 )', 101), PolyFromText( 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); -INSERT INTO buildings VALUES(114, '215 Main Street', +INSERT INTO buildings (fid,name,position,footprint) VALUES(114, '215 Main Street', PointFromText( 'POINT( 64 33 )', 101), PolyFromText( 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); # Ponds -INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +INSERT INTO ponds (fid,name,type,shores) VALUES(120, NULL, 'Stock Pond', MPolyFromText( 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); # Named Places -INSERT INTO named_places VALUES(117, 'Ashton', +INSERT INTO named_places (fid,name,boundary) VALUES(117, 'Ashton', PolyFromText( 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); -INSERT INTO named_places VALUES(118, 'Goose Island', +INSERT INTO named_places (fid,name,boundary) VALUES(118, 'Goose Island', PolyFromText( 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); # Map Neatlines -INSERT INTO map_neatlines VALUES(115, +INSERT INTO map_neatlines (fid,neatline) VALUES(115, PolyFromText( 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); SELECT Dimension(shore) @@ -777,43 +777,43 @@ SHOW FIELDS FROM gis_geometry; Field Type Null Key Default Extra fid int(11) YES NULL g geometry NO NULL -INSERT INTO gis_point VALUES +INSERT INTO gis_point (fid,g) VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); -INSERT INTO gis_line VALUES +INSERT INTO gis_line (fid,g) VALUES (105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10))))); -INSERT INTO gis_polygon VALUES +INSERT INTO gis_polygon (fid,g) VALUES (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))))); -INSERT INTO gis_multi_point VALUES +INSERT INTO gis_multi_point (fid,g) VALUES (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10))))); -INSERT INTO gis_multi_line VALUES +INSERT INTO gis_multi_line (fid,g) VALUES (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))))); -INSERT INTO gis_multi_polygon VALUES +INSERT INTO gis_multi_polygon (fid,g) VALUES (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); -INSERT INTO gis_geometrycollection VALUES +INSERT INTO gis_geometrycollection (fid,g) VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), (122, GeomFromText('GeometryCollection()')), (123, GeomFromText('GeometryCollection EMPTY')); -INSERT into gis_geometry SELECT * FROM gis_point; -INSERT into gis_geometry SELECT * FROM gis_line; -INSERT into gis_geometry SELECT * FROM gis_polygon; -INSERT into gis_geometry SELECT * FROM gis_multi_point; -INSERT into gis_geometry SELECT * FROM gis_multi_line; -INSERT into gis_geometry SELECT * FROM gis_multi_polygon; -INSERT into gis_geometry SELECT * FROM gis_geometrycollection; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_point; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_line; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_polygon; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_point; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_line; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_multi_polygon; +INSERT into gis_geometry (fid,g) SELECT fid,g FROM gis_geometrycollection; SELECT fid, AsText(g) FROM gis_point; fid AsText(g) 101 POINT(10 10) @@ -1131,7 +1131,7 @@ first second w c o e d t i r DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; USE gis_ogs; # Lakes -INSERT INTO lakes VALUES ( +INSERT INTO lakes (fid,name,shore) VALUES ( 101, 'BLUE LAKE', PolyFromText( 'POLYGON( @@ -1140,68 +1140,68 @@ PolyFromText( )', 101)); # Road Segments -INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(102, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); -INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(103, 'Route 5', 'Main Street', 4, LineFromText( 'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); -INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(104, 'Route 5', NULL, 2, LineFromText( 'LINESTRING( 70 38, 72 48 )' ,101)); -INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(105, 'Main Street', NULL, 4, LineFromText( 'LINESTRING( 70 38, 84 42 )' ,101)); -INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +INSERT INTO road_segments (fid,name,aliases,num_lanes,centerline) VALUES(106, 'Dirt Road by Green Forest', NULL, 1, LineFromText( 'LINESTRING( 28 26, 28 0 )',101)); # DividedRoutes -INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +INSERT INTO divided_routes (fid,name,num_lanes,centerlines) VALUES(119, 'Route 75', 4, MLineFromText( 'MULTILINESTRING((10 48,10 21,10 0), (16 0,16 23,16 48))', 101)); # Forests -INSERT INTO forests VALUES(109, 'Green Forest', +INSERT INTO forests (fid,name,boundary) VALUES(109, 'Green Forest', MPolyFromText( 'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26), (52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))', 101)); # Bridges -INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +INSERT INTO bridges (fid,name,position) VALUES(110, 'Cam Bridge', PointFromText( 'POINT( 44 31 )', 101)); # Streams -INSERT INTO streams VALUES(111, 'Cam Stream', +INSERT INTO streams (fid,name,centerline) VALUES(111, 'Cam Stream', LineFromText( 'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); -INSERT INTO streams VALUES(112, NULL, +INSERT INTO streams (fid,name,centerline) VALUES(112, NULL, LineFromText( 'LINESTRING( 76 0, 78 4, 73 9 )', 101)); # Buildings -INSERT INTO buildings VALUES(113, '123 Main Street', +INSERT INTO buildings (fid,name,position,footprint) VALUES(113, '123 Main Street', PointFromText( 'POINT( 52 30 )', 101), PolyFromText( 'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); -INSERT INTO buildings VALUES(114, '215 Main Street', +INSERT INTO buildings (fid,name,position,footprint) VALUES(114, '215 Main Street', PointFromText( 'POINT( 64 33 )', 101), PolyFromText( 'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); # Ponds -INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +INSERT INTO ponds (fid,name,type,shores) VALUES(120, NULL, 'Stock Pond', MPolyFromText( 'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), ( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); # Named Places -INSERT INTO named_places VALUES(117, 'Ashton', +INSERT INTO named_places (fid,name,boundary) VALUES(117, 'Ashton', PolyFromText( 'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); -INSERT INTO named_places VALUES(118, 'Goose Island', +INSERT INTO named_places (fid,name,boundary) VALUES(118, 'Goose Island', PolyFromText( 'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); # Map Neatlines -INSERT INTO map_neatlines VALUES(115, +INSERT INTO map_neatlines (fid,neatline) VALUES(115, PolyFromText( 'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); SELECT Dimension(shore) diff --git a/mysql-test/suite/storage_engine/type_text.inc b/mysql-test/suite/storage_engine/type_text.inc index 0f31e91c776..86521e5fb1e 100644 --- a/mysql-test/suite/storage_engine/type_text.inc +++ b/mysql-test/suite/storage_engine/type_text.inc @@ -33,7 +33,7 @@ if (!$mysql_errname) # Valid values # (cannot get MAX for all columns due to max_allowed_packet limitations) - INSERT INTO t1 VALUES + INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -44,7 +44,7 @@ if (!$mysql_errname) # Invalid values (produce warnings, except for mediumtext and longtext columns for which the values are within limits) - INSERT INTO t1 VALUES + INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); --sorted_result diff --git a/mysql-test/suite/storage_engine/type_text.result b/mysql-test/suite/storage_engine/type_text.result index b3ca7a8d9da..88204e2235e 100644 --- a/mysql-test/suite/storage_engine/type_text.result +++ b/mysql-test/suite/storage_engine/type_text.result @@ -22,7 +22,7 @@ t17m longtext # # # tt tinytext # # # m mediumtext # # # l longtext # # # -INSERT INTO t1 VALUES +INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ('','','','','','','','','',''), ('a','b','c','d','e','f','g','h','i','j'), ('test1','test2','test3','test4','test5','test6','test7','test8','test9','test10'), @@ -33,7 +33,7 @@ LENGTH(t) LENGTH(t0) LENGTH(t1) LENGTH(t300) LENGTH(tm) LENGTH(t70k) LENGTH(t17m 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 5 5 5 5 6 65535 65535 255 65535 65535 1048576 1048576 255 1048576 1048576 -INSERT INTO t1 VALUES +INSERT INTO t1 (t,t0,t1,t300,tm,t70k,t17m,tt,m,l) VALUES ( REPEAT('a',65536), REPEAT('b',65536), REPEAT('c',256), REPEAT('d',65536), REPEAT('e',65536), REPEAT('f',1048576), REPEAT('g',1048576), REPEAT('h',256), REPEAT('i',1048576), REPEAT('j',1048576) ); Warnings: Warning 1265 Data truncated for column 't' at row 1 diff --git a/mysql-test/suite/storage_engine/type_varchar.inc b/mysql-test/suite/storage_engine/type_varchar.inc index 472f74e0dd1..e2da3deba39 100644 --- a/mysql-test/suite/storage_engine/type_varchar.inc +++ b/mysql-test/suite/storage_engine/type_varchar.inc @@ -72,7 +72,7 @@ if (!$mysql_errname) o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); --sorted_result - SELECT * FROM t1; + SELECT v0,v1,v64,v65000 FROM t1; # Invalid values diff --git a/mysql-test/suite/storage_engine/type_varchar.result b/mysql-test/suite/storage_engine/type_varchar.result index 055c8dcd7ca..f5e9bb416fe 100644 --- a/mysql-test/suite/storage_engine/type_varchar.result +++ b/mysql-test/suite/storage_engine/type_varchar.result @@ -51,7 +51,7 @@ INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. '); -SELECT * FROM t1; +SELECT v0,v1,v64,v65000 FROM t1; v0 v1 v64 v65000 diff --git a/mysql-test/suite/storage_engine/update.result b/mysql-test/suite/storage_engine/update.result index 3b96558c7c5..a07a1b57a5c 100644 --- a/mysql-test/suite/storage_engine/update.result +++ b/mysql-test/suite/storage_engine/update.result @@ -3,7 +3,7 @@ CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTO INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar'); INSERT INTO t1 (a,b) SELECT a, b FROM t1; UPDATE t1 SET a=a+100; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 101 a 101 a @@ -18,7 +18,7 @@ a b 105 e 105 e UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 NULL 1 NULL @@ -33,7 +33,7 @@ a b 5 NULL 5 NULL UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 NULL 1 update diff --git a/mysql-test/suite/storage_engine/update.test b/mysql-test/suite/storage_engine/update.test index 4f892fa547d..ad36382f8be 100644 --- a/mysql-test/suite/storage_engine/update.test +++ b/mysql-test/suite/storage_engine/update.test @@ -24,16 +24,16 @@ if ($mysql_errname) if (!$mysql_errname) { --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; # ORDER BY and LIMIT UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; } # Cleanup diff --git a/mysql-test/suite/storage_engine/update_ignore.result b/mysql-test/suite/storage_engine/update_ignore.result index 26b7168196a..27e62c4f966 100644 --- a/mysql-test/suite/storage_engine/update_ignore.result +++ b/mysql-test/suite/storage_engine/update_ignore.result @@ -5,7 +5,7 @@ INSERT INTO t1 (a,b) SELECT a, b FROM t1; CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t2 (c,d) SELECT b, a FROM t1; UPDATE IGNORE t1 SET b = 'upd1' WHERE b IS NOT NULL ORDER BY a LIMIT 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 1 upd1 @@ -23,7 +23,7 @@ UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); Warnings: Warning 1242 Subquery returns more than 1 row -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 1 upd2a @@ -37,7 +37,7 @@ a b 4 upd2a 5 upd2a 5 upd2a -SELECT * FROM t2; +SELECT c,d FROM t2; c d upd2b 1 upd2b 1 diff --git a/mysql-test/suite/storage_engine/update_ignore.test b/mysql-test/suite/storage_engine/update_ignore.test index ddd4f7405a3..98f817b0e77 100644 --- a/mysql-test/suite/storage_engine/update_ignore.test +++ b/mysql-test/suite/storage_engine/update_ignore.test @@ -26,14 +26,14 @@ if ($mysql_errname) if (!$mysql_errname) { --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; UPDATE IGNORE t1, t2 SET b = 'upd2a', c = 'upd2b' WHERE c < b OR a != ( SELECT 1 UNION SELECT 2 ); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --sorted_result - SELECT * FROM t2; + SELECT c,d FROM t2; } # Cleanup diff --git a/mysql-test/suite/storage_engine/update_low_prio.result b/mysql-test/suite/storage_engine/update_low_prio.result index 31a31b6be62..1e038103870 100644 --- a/mysql-test/suite/storage_engine/update_low_prio.result +++ b/mysql-test/suite/storage_engine/update_low_prio.result @@ -19,7 +19,7 @@ a+SLEEP(1) 11 12 connection default; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 21 foobar 22 b @@ -37,7 +37,7 @@ a+SLEEP(1) 21 22 connection default; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 41 foobar 42 b @@ -56,7 +56,7 @@ a+SLEEP(1) 41 42 connection default; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 71 foobar 72 b diff --git a/mysql-test/suite/storage_engine/update_low_prio.test b/mysql-test/suite/storage_engine/update_low_prio.test index 6c089c7172f..8cc1ad07d5c 100644 --- a/mysql-test/suite/storage_engine/update_low_prio.test +++ b/mysql-test/suite/storage_engine/update_low_prio.test @@ -76,7 +76,7 @@ if ($mysql_errname) } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; # UPDATE LOW_PRIORITY @@ -107,7 +107,7 @@ SELECT a+SLEEP(1) FROM t1; --connection default --reap --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; SET LOW_PRIORITY_UPDATES = 1; @@ -152,7 +152,7 @@ if ($mysql_errname) --source unexpected_result.inc } --sorted_result -SELECT * FROM t1; +SELECT a,b FROM t1; --disconnect con1 --disconnect con2 diff --git a/mysql-test/suite/storage_engine/update_multi.result b/mysql-test/suite/storage_engine/update_multi.result index 42b2f239dd2..909cce8213d 100644 --- a/mysql-test/suite/storage_engine/update_multi.result +++ b/mysql-test/suite/storage_engine/update_multi.result @@ -5,7 +5,7 @@ INSERT INTO t1 (a,b) SELECT a, b FROM t1; CREATE TABLE t2 (c <CHAR_COLUMN>, d <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; INSERT INTO t2 (c,d) SELECT b, a FROM t1; UPDATE t1, t2 SET t1.a = t2.d+100, t2.c = 'multi' WHERE c < b AND a + d != 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 1 a @@ -19,7 +19,7 @@ a b 101 e 101 foobar 101 foobar -SELECT * FROM t2; +SELECT c,d FROM t2; c d foobar 10000 foobar 10000 @@ -34,7 +34,7 @@ multi 4 multi 5 multi 5 UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 a 1 a @@ -48,7 +48,7 @@ a b 101 e 101 foobar 101 foobar -SELECT * FROM t2; +SELECT c,d FROM t2; c d foobar NULL foobar NULL diff --git a/mysql-test/suite/storage_engine/update_multi.test b/mysql-test/suite/storage_engine/update_multi.test index 589a8319382..4820eb5df46 100644 --- a/mysql-test/suite/storage_engine/update_multi.test +++ b/mysql-test/suite/storage_engine/update_multi.test @@ -26,15 +26,15 @@ if ($mysql_errname) if (!$mysql_errname) { --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --sorted_result - SELECT * FROM t2; + SELECT c,d FROM t2; UPDATE t2, t1 SET t2.d = DEFAULT WHERE c = 'foobar' and b = c; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --sorted_result - SELECT * FROM t2; + SELECT c,d FROM t2; } # Cleanup diff --git a/mysql-test/suite/storage_engine/update_with_keys.result b/mysql-test/suite/storage_engine/update_with_keys.result index 8250f31a19e..ed62c96a5e6 100644 --- a/mysql-test/suite/storage_engine/update_with_keys.result +++ b/mysql-test/suite/storage_engine/update_with_keys.result @@ -5,7 +5,7 @@ UPDATE t1 SET a=100, b='f' WHERE b IN ('b','c'); UPDATE t1 SET b='m' WHERE b = 'f'; UPDATE t1 SET b='z' WHERE a < 2; UPDATE t1 SET b=''; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 100 @@ -25,7 +25,7 @@ ERROR 23000: Duplicate entry '205' for key 'a' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file UPDATE t1 SET a=12345 ORDER BY a, b LIMIT 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 12345 a 200 f @@ -51,7 +51,7 @@ ERROR 23000: Duplicate entry '4-d' for key 'a' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file UPDATE t1 SET a=a+1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 101 a 2 a @@ -74,7 +74,7 @@ ERROR 23000: Duplicate entry '205' for key 'PRIMARY' # Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). # If you got a difference in error message, just add it to rdiff file UPDATE t1 SET a=12345 ORDER BY a DESC, b LIMIT 1; -SELECT * FROM t1; +SELECT a,b FROM t1; a b 0 a 12345 e diff --git a/mysql-test/suite/storage_engine/update_with_keys.test b/mysql-test/suite/storage_engine/update_with_keys.test index 578ee3b3294..77843365cef 100644 --- a/mysql-test/suite/storage_engine/update_with_keys.test +++ b/mysql-test/suite/storage_engine/update_with_keys.test @@ -32,7 +32,7 @@ if (!$mysql_errname) UPDATE t1 SET b='z' WHERE a < 2; UPDATE t1 SET b=''; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; } DROP TABLE t1; } @@ -62,7 +62,7 @@ if (!$mysql_errname) --source check_errors.inc UPDATE t1 SET a=12345 ORDER BY a, b LIMIT 1; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; # We'll check that the next update causes an error, # but won't check the result because it might be different depending @@ -101,7 +101,7 @@ if (!$mysql_errname) --source check_errors.inc UPDATE t1 SET a=a+1; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; --let $error_codes = ER_DUP_ENTRY,ER_DUP_KEY UPDATE t1 SET b='z'; --source check_errors.inc @@ -135,7 +135,7 @@ if (!$mysql_errname) UPDATE t1 SET a=12345 ORDER BY a DESC, b LIMIT 1; --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; # We'll check that the next update causes an error, # but won't check the result because it might be different depending diff --git a/mysql-test/suite/storage_engine/vcol.result b/mysql-test/suite/storage_engine/vcol.result index bae7636f6cb..d51ab038576 100644 --- a/mysql-test/suite/storage_engine/vcol.result +++ b/mysql-test/suite/storage_engine/vcol.result @@ -9,7 +9,7 @@ INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: Warning 1906 The value specified for computed column 'b' in table 't1' ignored Warning 1906 The value specified for computed column 'b' in table 't1' ignored -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 2 2 3 @@ -26,7 +26,7 @@ INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: Warning 1906 The value specified for computed column 'b' in table 't1' ignored Warning 1906 The value specified for computed column 'b' in table 't1' ignored -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 2 2 3 @@ -43,7 +43,7 @@ INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: Warning 1906 The value specified for computed column 'b' in table 't1' ignored Warning 1906 The value specified for computed column 'b' in table 't1' ignored -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 2 2 3 @@ -60,7 +60,7 @@ INSERT INTO t1 (a,b) VALUES (3,3),(4,4); Warnings: Warning 1906 The value specified for computed column 'b' in table 't1' ignored Warning 1906 The value specified for computed column 'b' in table 't1' ignored -SELECT * FROM t1; +SELECT a,b FROM t1; a b 1 2 2 3 diff --git a/mysql-test/suite/storage_engine/vcol.test b/mysql-test/suite/storage_engine/vcol.test index 90819ffbd47..e6257ab324b 100644 --- a/mysql-test/suite/storage_engine/vcol.test +++ b/mysql-test/suite/storage_engine/vcol.test @@ -24,7 +24,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; @@ -37,7 +37,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; @@ -50,7 +50,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; @@ -63,7 +63,7 @@ if (!$mysql_errname) INSERT INTO t1 (a) VALUES (1),(2); INSERT INTO t1 (a,b) VALUES (3,3),(4,4); --sorted_result - SELECT * FROM t1; + SELECT a,b FROM t1; DROP TABLE t1; } 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/engine_condition_pushdown_basic.result b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result index 55e6f747a19..937a3b164fa 100644 --- a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result +++ b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result @@ -9,7 +9,7 @@ SELECT @global_start_value; select @old_session_opt_switch:=@@session.optimizer_switch, @old_global_opt_switch:=@@global.optimizer_switch; @old_session_opt_switch:=@@session.optimizer_switch @old_global_opt_switch:=@@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off '#--------------------FN_DYNVARS_028_01------------------------#' SET @@session.engine_condition_pushdown = 0; Warnings: @@ -212,7 +212,7 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@session.engine_condition_pushdown = TRUE; Warnings: Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead @@ -220,7 +220,7 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@session.engine_condition_pushdown = FALSE; Warnings: Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead @@ -228,7 +228,7 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@global.engine_condition_pushdown = TRUE; Warnings: Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead @@ -236,7 +236,7 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@global.engine_condition_pushdown = FALSE; Warnings: Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead @@ -244,31 +244,31 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@session.optimizer_switch = "engine_condition_pushdown=on"; select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@session.optimizer_switch = "engine_condition_pushdown=off"; select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@global.optimizer_switch = "engine_condition_pushdown=on"; select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set @@global.optimizer_switch = "engine_condition_pushdown=off"; select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off SET @@session.engine_condition_pushdown = @session_start_value; Warnings: Warning 1287 '@@engine_condition_pushdown' is deprecated and will be removed in a future release. Please use '@@optimizer_switch' instead @@ -287,4 +287,4 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off diff --git a/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result b/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result index 55d61800a39..5802c71d280 100644 --- a/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result +++ b/mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result @@ -6,8 +6,8 @@ e,lost+found,.mysqlgui,ignored_db # with '.' SHOW DATABASES; Database -information_schema #mysql50#.otherdir +information_schema mtr mysql performance_schema @@ -33,8 +33,8 @@ id 2 SHOW DATABASES; Database -information_schema #mysql50#.otherdir +information_schema lost+found mtr mysql 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_changed_pages_limit_basic.result b/mysql-test/suite/sys_vars/r/innodb_max_changed_pages_basic.result index d9d067c2cf9..d9d067c2cf9 100644 --- a/mysql-test/suite/sys_vars/r/innodb_changed_pages_limit_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_max_changed_pages_basic.result 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/innodb_use_atomic_writes_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_atomic_writes_basic.result new file mode 100644 index 00000000000..fa6379fbe1c --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_use_atomic_writes_basic.result @@ -0,0 +1,21 @@ +select @@global.innodb_use_atomic_writes; +@@global.innodb_use_atomic_writes +0 +select @@session.innodb_use_atomic_writes; +ERROR HY000: Variable 'innodb_use_atomic_writes' is a GLOBAL variable +show global variables like 'innodb_use_atomic_writes'; +Variable_name Value +innodb_use_atomic_writes OFF +show session variables like 'innodb_use_atomic_writes'; +Variable_name Value +innodb_use_atomic_writes OFF +select * from information_schema.global_variables where variable_name='innodb_use_atomic_writes'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_USE_ATOMIC_WRITES OFF +select * from information_schema.session_variables where variable_name='innodb_use_atomic_writes'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_USE_ATOMIC_WRITES OFF +set global innodb_use_atomic_writes=1; +ERROR HY000: Variable 'innodb_use_atomic_writes' is a read only variable +set session innodb_use_atomic_writes=1; +ERROR HY000: Variable 'innodb_use_atomic_writes' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/innodb_use_fallocate_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_fallocate_basic.result new file mode 100644 index 00000000000..7ea55fba0a4 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_use_fallocate_basic.result @@ -0,0 +1,21 @@ +select @@global.innodb_use_fallocate; +@@global.innodb_use_fallocate +1 +select @@session.innodb_use_fallocate; +ERROR HY000: Variable 'innodb_use_fallocate' is a GLOBAL variable +show global variables like 'innodb_use_fallocate'; +Variable_name Value +innodb_use_fallocate ON +show session variables like 'innodb_use_fallocate'; +Variable_name Value +innodb_use_fallocate ON +select * from information_schema.global_variables where variable_name='innodb_use_fallocate'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_USE_FALLOCATE ON +select * from information_schema.session_variables where variable_name='innodb_use_fallocate'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_USE_FALLOCATE ON +set global innodb_use_fallocate=1; +ERROR HY000: Variable 'innodb_use_fallocate' is a read only variable +set session innodb_use_fallocate=1; +ERROR HY000: Variable 'innodb_use_fallocate' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result index 9f630e8bb00..bb7492ee7ef 100644 --- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_basic.result @@ -1,7 +1,7 @@ SET @start_value = @@global.max_binlog_cache_size; SELECT @start_value; @start_value -4294963200 +18446744073709547520 '#--------------------FN_DYNVARS_072_01------------------------#' SET @@global.max_binlog_cache_size = 5000; Warnings: @@ -9,7 +9,7 @@ Warning 1292 Truncated incorrect max_binlog_cache_size value: '5000' SET @@global.max_binlog_cache_size = DEFAULT; SELECT @@global.max_binlog_cache_size; @@global.max_binlog_cache_size -4294963200 +18446744073709547520 '#---------------------FN_DYNVARS_072_02-------------------------#' SET @@global.max_binlog_cache_size = @start_value; SELECT @@global.max_binlog_cache_size = 4294967295; @@ -149,4 +149,4 @@ ERROR 42S22: Unknown column 'max_binlog_cache_size' in 'field list' SET @@global.max_binlog_cache_size = @start_value; SELECT @@global.max_binlog_cache_size; @@global.max_binlog_cache_size -4294963200 +18446744073709547520 diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result index 14407672aa3..0b2db8eef69 100644 --- a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result @@ -1,7 +1,7 @@ SET @start_value = @@global.max_binlog_stmt_cache_size; SELECT @start_value; @start_value -4294963200 +18446744073709547520 '#--------------------FN_DYNVARS_072_01------------------------#' SET @@global.max_binlog_stmt_cache_size = 5000; Warnings: @@ -9,7 +9,7 @@ Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000' SET @@global.max_binlog_stmt_cache_size = DEFAULT; SELECT @@global.max_binlog_stmt_cache_size; @@global.max_binlog_stmt_cache_size -4294963200 +18446744073709547520 '#---------------------FN_DYNVARS_072_02-------------------------#' SET @@global.max_binlog_stmt_cache_size = @start_value; SELECT @@global.max_binlog_stmt_cache_size = 4294967295; @@ -149,4 +149,4 @@ ERROR 42S22: Unknown column 'max_binlog_stmt_cache_size' in 'field list' SET @@global.max_binlog_stmt_cache_size = @start_value; SELECT @@global.max_binlog_stmt_cache_size; @@global.max_binlog_stmt_cache_size -4294963200 +18446744073709547520 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/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index 509c0706ca3..8a9c49def85 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -1,61 +1,61 @@ SET @start_global_value = @@global.optimizer_switch; SELECT @start_global_value; @start_global_value -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off set global optimizer_switch=10; set session optimizer_switch=5; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off set global optimizer_switch="index_merge_sort_union=on"; set session optimizer_switch="index_merge=off"; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +optimizer_switch index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off set session optimizer_switch="default"; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off set optimizer_switch = replace(@@optimizer_switch, '=off', '=on'); select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on set global optimizer_switch=1.1; ERROR 42000: Incorrect argument type to variable 'optimizer_switch' set global optimizer_switch=1e1; @@ -67,4 +67,4 @@ ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar' SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result b/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result index 7fb9e0aaaae..be4da117c2b 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown1.result @@ -2,4 +2,4 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result b/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result index 9eb3a8f942d..d1c5516d9ed 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_eng_cond_pushdown2.result @@ -2,4 +2,4 @@ select @@session.engine_condition_pushdown, @@global.engine_condition_pushdown, @@session.optimizer_switch, @@global.optimizer_switch; @@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch -0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=off 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/r/rpl_semi_sync_master_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result index 3e444519441..7454f0b0089 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result @@ -1,4 +1,3 @@ -INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; select @@global.rpl_semi_sync_master_enabled; @@global.rpl_semi_sync_master_enabled 0 @@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_master_enabled = @start_global_value; select @@global.rpl_semi_sync_master_enabled; @@global.rpl_semi_sync_master_enabled 0 -UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result index e77bcc1c12a..78fee2a91dc 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_basic.result @@ -1,4 +1,3 @@ -INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; select @@global.rpl_semi_sync_master_timeout; @@global.rpl_semi_sync_master_timeout 10000 @@ -51,4 +50,3 @@ SET @@global.rpl_semi_sync_master_timeout = @start_global_value; select @@global.rpl_semi_sync_master_timeout; @@global.rpl_semi_sync_master_timeout 10000 -UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result index 55df5f57d9e..1096fa995e7 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_basic.result @@ -1,4 +1,3 @@ -INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; select @@global.rpl_semi_sync_master_trace_level; @@global.rpl_semi_sync_master_trace_level 32 @@ -69,4 +68,3 @@ SET @@global.rpl_semi_sync_master_trace_level = @start_global_value; select @@global.rpl_semi_sync_master_trace_level; @@global.rpl_semi_sync_master_trace_level 32 -UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result index 3d951b499ed..535f777eff7 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_basic.result @@ -1,4 +1,3 @@ -INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so'; select @@global.rpl_semi_sync_master_wait_no_slave; @@global.rpl_semi_sync_master_wait_no_slave 1 @@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value; select @@global.rpl_semi_sync_master_wait_no_slave; @@global.rpl_semi_sync_master_wait_no_slave 1 -UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result index a23b160e6f2..f52e8e80127 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result @@ -1,4 +1,3 @@ -INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; select @@global.rpl_semi_sync_slave_enabled; @@global.rpl_semi_sync_slave_enabled 0 @@ -70,4 +69,3 @@ SET @@global.rpl_semi_sync_slave_enabled = @start_global_value; select @@global.rpl_semi_sync_slave_enabled; @@global.rpl_semi_sync_slave_enabled 0 -UNINSTALL PLUGIN rpl_semi_sync_slave; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result index f7796309aea..9917ec6fce5 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_basic.result @@ -1,4 +1,3 @@ -INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so'; select @@global.rpl_semi_sync_slave_trace_level; @@global.rpl_semi_sync_slave_trace_level 32 @@ -69,4 +68,3 @@ SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value; select @@global.rpl_semi_sync_slave_trace_level; @@global.rpl_semi_sync_slave_trace_level 32 -UNINSTALL PLUGIN rpl_semi_sync_slave; 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..7998297c69e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_limit_optimistic_insert_debug_basic.test @@ -0,0 +1,50 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +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_changed_pages_limit_basic.test b/mysql-test/suite/sys_vars/t/innodb_max_changed_pages_basic.test index 00aa476e8d2..00aa476e8d2 100644 --- a/mysql-test/suite/sys_vars/t/innodb_changed_pages_limit_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_max_changed_pages_basic.test 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..d7207515fe1 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_trx_purge_view_update_only_debug_basic.test @@ -0,0 +1,54 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +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/innodb_use_atomic_writes_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_atomic_writes_basic.test new file mode 100644 index 00000000000..e14f618ee6b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_use_atomic_writes_basic.test @@ -0,0 +1,22 @@ +--source include/have_innodb.inc +# bool readonly + +# +# show values; +# +select @@global.innodb_use_atomic_writes; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_use_atomic_writes; +show global variables like 'innodb_use_atomic_writes'; +show session variables like 'innodb_use_atomic_writes'; +select * from information_schema.global_variables where variable_name='innodb_use_atomic_writes'; +select * from information_schema.session_variables where variable_name='innodb_use_atomic_writes'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global innodb_use_atomic_writes=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session innodb_use_atomic_writes=1; + diff --git a/mysql-test/suite/sys_vars/t/innodb_use_fallocate_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_fallocate_basic.test new file mode 100644 index 00000000000..655893be98e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_use_fallocate_basic.test @@ -0,0 +1,22 @@ +--source include/have_innodb.inc +# bool readonly + +# +# show values; +# +select @@global.innodb_use_fallocate; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_use_fallocate; +show global variables like 'innodb_use_fallocate'; +show session variables like 'innodb_use_fallocate'; +select * from information_schema.global_variables where variable_name='innodb_use_fallocate'; +select * from information_schema.session_variables where variable_name='innodb_use_fallocate'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global innodb_use_fallocate=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session innodb_use_fallocate=1; + 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/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test index ded489f36ff..2ff03a53c42 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_basic.test @@ -6,10 +6,7 @@ # # source include/not_embedded.inc; -source include/have_semisync_plugin.inc; -# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' ---replace_regex /\.dll/.so/ -eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; +source include/have_semisync.inc; select @@global.rpl_semi_sync_master_enabled; SET @start_global_value = @@global.rpl_semi_sync_master_enabled; @@ -61,5 +58,3 @@ set global rpl_semi_sync_master_enabled="some text"; # SET @@global.rpl_semi_sync_master_enabled = @start_global_value; select @@global.rpl_semi_sync_master_enabled; -UNINSTALL PLUGIN rpl_semi_sync_master; - diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test index 5258894150d..74d3c41150b 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_basic.test @@ -5,10 +5,7 @@ # 2010-01-21 OBN - Added # source include/not_embedded.inc; -source include/have_semisync_plugin.inc; -# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' ---replace_regex /\.dll/.so/ -eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; +source include/have_semisync.inc; select @@global.rpl_semi_sync_master_timeout; SET @start_global_value = @@global.rpl_semi_sync_master_timeout; @@ -51,5 +48,3 @@ set global rpl_semi_sync_master_timeout="some text"; # SET @@global.rpl_semi_sync_master_timeout = @start_global_value; select @@global.rpl_semi_sync_master_timeout; -UNINSTALL PLUGIN rpl_semi_sync_master; - diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test index d9b1d860b35..c41b53fe5e6 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_basic.test @@ -5,10 +5,7 @@ # 2010-01-21 OBN - Added # source include/not_embedded.inc; -source include/have_semisync_plugin.inc; -# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' ---replace_regex /\.dll/.so/ -eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; +source include/have_semisync.inc; select @@global.rpl_semi_sync_master_trace_level; SET @start_global_value = @@global.rpl_semi_sync_master_trace_level; @@ -59,5 +56,3 @@ set global rpl_semi_sync_master_trace_level="some text"; # SET @@global.rpl_semi_sync_master_trace_level = @start_global_value; select @@global.rpl_semi_sync_master_trace_level; -UNINSTALL PLUGIN rpl_semi_sync_master; - diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test index 896bd50d156..d4a46a08140 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_basic.test @@ -6,10 +6,7 @@ # # source include/not_embedded.inc; -source include/have_semisync_plugin.inc; -# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' ---replace_regex /\.dll/.so/ -eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; +source include/have_semisync.inc; select @@global.rpl_semi_sync_master_wait_no_slave; SET @start_global_value = @@global.rpl_semi_sync_master_wait_no_slave; @@ -61,5 +58,4 @@ set global rpl_semi_sync_master_wait_no_slave="some text"; # SET @@global.rpl_semi_sync_master_wait_no_slave = @start_global_value; select @@global.rpl_semi_sync_master_wait_no_slave; -UNINSTALL PLUGIN rpl_semi_sync_master; diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test index 030b0827a11..c7ce371970d 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_basic.test @@ -6,10 +6,7 @@ # # source include/not_embedded.inc; -source include/have_semisync_plugin.inc; -# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' ---replace_regex /\.dll/.so/ -eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO'; +source include/have_semisync.inc; select @@global.rpl_semi_sync_slave_enabled; SET @start_global_value = @@global.rpl_semi_sync_slave_enabled; @@ -62,5 +59,3 @@ set global rpl_semi_sync_slave_enabled="some text"; # SET @@global.rpl_semi_sync_slave_enabled = @start_global_value; select @@global.rpl_semi_sync_slave_enabled; -UNINSTALL PLUGIN rpl_semi_sync_slave; - diff --git a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test index 64c935ee957..d7e001b7322 100644 --- a/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test +++ b/mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_basic.test @@ -5,10 +5,7 @@ # 2010-01-21 OBN - Added # source include/not_embedded.inc; -source include/have_semisync_plugin.inc; -# The following is to prevent a mis-match on windows that has the name of of the lib ending with 'dll' ---replace_regex /\.dll/.so/ -eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO'; +source include/have_semisync.inc; select @@global.rpl_semi_sync_slave_trace_level; SET @start_global_value = @@global.rpl_semi_sync_slave_trace_level; @@ -59,5 +56,3 @@ set global rpl_semi_sync_slave_trace_level="some text"; # SET @@global.rpl_semi_sync_slave_trace_level = @start_global_value; select @@global.rpl_semi_sync_slave_trace_level; -UNINSTALL PLUGIN rpl_semi_sync_slave; - diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index eade7ba721e..d48b1687fa0 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1231,3 +1231,30 @@ execute stmt1; deallocate prepare stmt1; drop table t2; +# +# Test of ALTER TABLE IF [NOT] EXISTS +# + +CREATE TABLE t1 ( + id INT(11) NOT NULL, + x_param INT(11) DEFAULT NULL, + PRIMARY KEY (id) +); + +ALTER TABLE t1 ADD COLUMN IF NOT EXISTS id INT, + ADD COLUMN IF NOT EXISTS lol INT AFTER id; +ALTER TABLE t1 ADD COLUMN IF NOT EXISTS lol INT AFTER id; +ALTER TABLE t1 DROP COLUMN IF EXISTS lol; +ALTER TABLE t1 DROP COLUMN IF EXISTS lol; + +ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); +ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param); +ALTER TABLE t1 MODIFY IF EXISTS lol INT; + +DROP INDEX IF EXISTS x_param ON t1; +DROP INDEX IF EXISTS x_param ON t1; +CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); +CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param); +SHOW CREATE TABLE t1; +DROP TABLE t1; + 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/cache_temporal_4265.test b/mysql-test/t/cache_temporal_4265.test new file mode 100644 index 00000000000..6135438f023 --- /dev/null +++ b/mysql-test/t/cache_temporal_4265.test @@ -0,0 +1,11 @@ +# +# MDEV-4265 5.5 is slower than 5.3 because of many str_to_datetime calls +# +--source include/have_debug.inc + +create table t1 (a date); +insert t1 values ('2000-01-02'), ('2001-02-03'), ('2002-03-04'); +set debug_dbug='d,str_to_datetime_warn'; +select * from t1 where a > date_add('2000-01-01', interval 5 day); +drop table t1; + diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a61f89539cb..f82d859243a 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1559,29 +1559,26 @@ drop table t1,t2,t3; --echo # -- End of Bug#45829 # ---echo # new table creation/renaming blocked if old encoded table present +# new table creation/renaming is NOT blocked if old encoded table present # let $MYSQLD_DATADIR= `select @@datadir`; -create table `t-1` (a int) engine=myisam; -insert into `t-1` values (1); +create table `#mysql50#t-1` (a int) engine=myisam; +insert into `#mysql50#t-1` values (1); show tables; -flush tables; ---echo convert table files in mysql 5.0 file name encoding ---copy_file $MYSQLD_DATADIR/test/t@002d1.MYD $MYSQLD_DATADIR/test/t-1.MYD ---copy_file $MYSQLD_DATADIR/test/t@002d1.MYI $MYSQLD_DATADIR/test/t-1.MYI ---copy_file $MYSQLD_DATADIR/test/t@002d1.frm $MYSQLD_DATADIR/test/t-1.frm ---remove_file $MYSQLD_DATADIR/test/t@002d1.MYD ---remove_file $MYSQLD_DATADIR/test/t@002d1.MYI ---remove_file $MYSQLD_DATADIR/test/t@002d1.frm -show tables; ---error ER_TABLE_EXISTS_ERROR create table `t-1` (a int); +show tables; +# selects can distinguish between the two tables +select * from `t-1`; +select * from `#mysql50#t-1`; +drop table `t-1`; create table t1 (a int); ---error ER_TABLE_EXISTS_ERROR alter table t1 rename `t-1`; ---error ER_TABLE_EXISTS_ERROR +show tables; +drop table `t-1`; +create table t1 (a int); rename table t1 to `t-1`; -drop table `#mysql50#t-1`, t1; +show tables; +drop table `#mysql50#t-1`, `t-1`; --echo --echo End of 5.1 tests 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/derived_view.test b/mysql-test/t/derived_view.test index c7705294ef2..4b7e76e11ca 100644 --- a/mysql-test/t/derived_view.test +++ b/mysql-test/t/derived_view.test @@ -1512,6 +1512,40 @@ set optimizer_switch=@save3912_optimizer_switch; drop table t1, t2, t3; --echo # +--echo # MDEV-4209: equi-join on BLOB column from materialized view +--echo # or derived table +--echo # + +set @save_optimizer_switch=@@optimizer_switch; +set optimizer_switch='derived_with_keys=on'; + +CREATE TABLE t1 (c1 text, c2 int); +INSERT INTO t1 VALUES ('a',1), ('c',3), ('g',7), ('d',4), ('c',3); +CREATE TABLE t2 (c1 text, c2 int); +INSERT INTO t2 VALUES ('b',2), ('c',3); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; + +EXPLAIN EXTENDED +SELECT v1.c1, v1.c2 FROM v1, t2 WHERE v1.c1=t2.c1 AND v1.c2=t2.c2; +SELECT v1.c1, v1.c2 FROM v1, t2 WHERE v1.c1=t2.c1 AND v1.c2=t2.c2; + +EXPLAIN EXTENDED +SELECT t2.c1, t2.c2 FROM (SELECT c1 g, MAX(c2) m FROM t1 GROUP BY c1) t, t2 + WHERE t.g=t2.c1 AND t.m=t2.c2; +SELECT t2.c1, t2.c2 FROM (SELECT c1 g, MAX(c2) m FROM t1 GROUP BY c1) t, t2 + WHERE t.g=t2.c1 AND t.m=t2.c2; + +EXPLAIN EXTENDED +SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1; +SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1; + +DROP VIEW v1; +DROP TABLE t1,t2; + +set optimizer_switch=@save_optimizer_switch; + + +--echo # --echo # end of 5.3 tests --echo # diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index de30cac610a..c817e7209f6 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -552,6 +552,62 @@ select hex(COLUMN_CREATE(0, COLUMN_GET(COLUMN_CREATE(0, 0.0 as decimal), 0 as de select hex(COLUMN_CREATE(0, 0.0 as decimal)); --echo # +--echo # MDEV-4292: parse error when selecting on views using dynamic column +--echo # +create table t1 (i int, d blob); + +create view v1 as select i, column_get(d, 1 as binary) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as int) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as unsigned int) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as date) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as time) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as datetime) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as decimal) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as double) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +create view v1 as select i, column_get(d, 1 as char) as a from t1; +select * from v1; +show create view v1; +drop view v1; + +drop table t1; + +--echo # +--echo # end of 5.3 tests +--echo # + +--echo # --echo # test of symbolic names --echo # --echo # creation test (names) diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index b4b09413896..6e44b4c1578 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -646,3 +646,14 @@ DEALLOCATE PREPARE stmt; DROP TABLE t1; --echo End of 5.1 tests + +CREATE TABLE t1 ( + id int(11) auto_increment, + title varchar(100) default '', + PRIMARY KEY (id), + KEY ind5 (title) +) ENGINE=MyISAM; + +CREATE FULLTEXT INDEX IF NOT EXISTS ft1 ON t1(title); +CREATE FULLTEXT INDEX IF NOT EXISTS ft1 ON t1(title); +DROP TABLE t1; diff --git a/mysql-test/t/fulltext_derived_4316.test b/mysql-test/t/fulltext_derived_4316.test new file mode 100644 index 00000000000..ecf4a0e7722 --- /dev/null +++ b/mysql-test/t/fulltext_derived_4316.test @@ -0,0 +1,14 @@ +# +# MATCH on the derived tables +# + +# +# MDEV-4316 MariaDB server crash with signal 11 +# + +create table t1 (ft text) engine=myisam; +insert into t1 values ('test1'),('test2'); +select distinct match(ft) against("test1" in boolean mode) from + (select distinct ft from t1) as t; +drop table t1; + diff --git a/mysql-test/t/func_date_add.test b/mysql-test/t/func_date_add.test index fc5a5cb2823..5f27978347c 100644 --- a/mysql-test/t/func_date_add.test +++ b/mysql-test/t/func_date_add.test @@ -88,3 +88,15 @@ select b + interval a day from t1; drop table t1; --echo End of 5.0 tests + +# +# MDEV-4284 Assertion `cmp_items[(uint)cmp_type]' fails in sql/item_cmpfunc.cc +# + +create table t1 (a varchar(10)); +insert t1 values ('2000-12-03'),('2008-05-03'); +select * from t1 where case a when adddate( '2012-12-12', 7 ) then true end; +drop table t1; + +--echo End of 5.5 tests + diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 89c6c0fe534..97766fefa91 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1372,7 +1372,16 @@ set @@optimizer_switch=@save_optimizer_switch; --echo # DROP TABLE IF EXISTS t1,t2,t3,empty1; -### +# +# MDEV-4286 Server crashes in Protocol_text::store, stack smashing detected +# +create table t1 (i int, d date); +insert into t1 values (1, '2008-10-02'), (2, '2010-12-12'); +select avg(export_set( 3, 'y', sha(i))), group_concat(d) from t1 group by d order by i; +drop table t1; + +#### End of 5.3 tests + --echo # --echo # Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(), --echo # file .\item_sum.cc, line 587 diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test index 6706792d162..06405808d79 100644 --- a/mysql-test/t/func_group_innodb.test +++ b/mysql-test/t/func_group_innodb.test @@ -159,7 +159,20 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date = DROP TABLE t1; ---echo # End of test BUG#12713907 +--echo # +--echo # MDEV-4269: crash when grouping by values() +--echo # + +SELECT @@storage_engine INTO @old_engine; +set storage_engine=innodb; + +create table y select 1 b; +select 1 from y group by b; +select 1 from y group by values(b); +drop table y; +SET storage_engine=@old_engine; + +### End of 5.1 tests --echo # --echo # Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 292db69a6e3..22ebb6248e2 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -369,6 +369,183 @@ drop table t1,tv; --echo # +--echo # GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test +--echo # + +--echo # IS_USED_LOCK, IS_FREE_LOCK: the lock is not acquired +--echo # Note: IS_USED_LOCK returns NULL if the lock is unused +select is_used_lock('test'); +select is_free_lock('test'); + +--echo # GET_LOCK returns 1 if it manages to acquire a lock +select get_lock('test', 0); + +--echo # IS_USED_LOCK, IS_FREE_LOCK: the lock is acquired +select is_free_lock('test'); +select is_used_lock('test') = connection_id(); + +connect (con1,localhost,root,,); +--echo # -> Switching to connection 'con1' +connection con1; +--echo # IS_USED_LOCK, IS_FREE_LOCK: the lock is acquired in another +--echo # connection +select is_used_lock('test') = connection_id(); +select is_free_lock('test'); + +--echo # GET_LOCK returns 0 if it can't acquire a lock (wait timeout) +select get_lock('test', 0); + +--echo # RELEASE_LOCK returns 0 if the lock belongs to another connection +select release_lock('test'); + +--echo # -> Switching to connection 'default' +connection default; + +--echo # RELEASE_LOCK returns 1 if it successfully releases a lock +select release_lock('test'); +--echo # RELEASE_LOCK returns NULL if it doesn't release a lock and there is no such lock +select release_lock('test'); + +--echo # Test that get_lock() returns NULL if error. +select get_lock('test', 0); +--echo # -> Switching to connection 'con1' +connection con1; +create table t1 select connection_id() as id; +send select get_lock('test', 7200); + +--echo # -> Switching to connection 'default' +connection default; +let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state='User lock'; +source include/wait_condition.inc; +select (@id := id) - id from t1; +kill query @id; + +--echo # -> Switching to connection 'con1' +connection con1; +reap; + +--echo # -> Switching to connection 'default' +connection default; + +--echo # GET_LOCK() works recursively +select get_lock('test', 0); +select get_lock('test', 0); +select get_lock('test', 0); + +--echo # RELEASE_LOCK() needs to be called recursively then, too +select release_lock('test'); +select release_lock('test'); +select release_lock('test'); + +--echo # Once the last instance of the lock is released, +--echo # the next call returns NULL +select release_lock('test'); + + +--echo # Multiple locks in the same session are OK +select get_lock('test1', 0); +select get_lock('test2', 0); +select get_lock('test3', 0); + +select release_lock('test1'); +select release_lock('test2'); +select release_lock('test3'); + +--echo # Deadlocks are detected e.g. in case of a mutual wait +select get_lock('test1', 0); + +--echo # -> Switching to connection 'con1' +connection con1; +select get_lock('test2', 0); +send select get_lock('test1', 7200); + +--echo # -> Switching to connection 'default' +connection default; +let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state='User lock'; +source include/wait_condition.inc; +--error ER_LOCK_DEADLOCK +select get_lock('test2', 7200); + +select release_lock('test1'); + +--echo # -> Switching to connection 'con1' +connection con1; +reap; +select release_lock('test2'); +select release_lock('test1'); + +--echo # -> Switching to connection 'default' +connection default; + +--echo # LOCK/UNLOCK TABLES works fine with a user lock. +lock table t1 write; +select get_lock('test', 0); +unlock tables; +commit; +select release_lock('test'); + +--echo # GLOBAL READ LOCK works with fine with user locks +select get_lock('test1', 0); +flush tables with read lock; +select get_lock('test2', 0); +unlock tables; +commit; +select release_lock('test1'); +select release_lock('test2'); + +--echo # BEGIN/COMMIT/ROLLBACK don't unlock user locks. +begin; +select get_lock('test1', 0); +select get_lock('test2', 0); +select count(*) from t1; +rollback; +select release_lock('test1'); +select release_lock('test2'); + +--echo # Deadlocks between user locks and LOCK TABLES locks +--echo # are detected OK. +select get_lock('test', 0); + +--echo # -> Switching to connection 'con1' +connection con1; +lock table t1 write; +send select get_lock('test', 7200); + +--echo # -> Switching to connection 'default' +connection default; +let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state = 'User lock'; +source include/wait_condition.inc; +--error ER_LOCK_DEADLOCK +lock table t1 read; + +select release_lock('test'); + +--echo # -> Switching to connection 'con1' +connection con1; +reap; +select release_lock('test'); +unlock tables; + +--echo # cleanup +disconnect con1; +connection default; +drop table t1; + +--echo # check too long identifier names +select get_lock(repeat('a', 192), 0); +select is_used_lock(repeat('a', 192)) = connection_id(); +select is_free_lock(repeat('a', 192)); +select release_lock(repeat('a', 192)); +--error ER_TOO_LONG_IDENT +select get_lock(repeat('a', 193), 0); +--error ER_TOO_LONG_IDENT +select is_used_lock(repeat('a', 193)); +--error ER_TOO_LONG_IDENT +select is_free_lock(repeat('a', 193)); +--error ER_TOO_LONG_IDENT +select release_lock(repeat('a', 193)); + +--echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index d8d8f4538e1..f245b4f9f78 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1385,6 +1385,24 @@ LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1; SELECT * FROM t1; DROP TABLE t1; +# +# MDEV-759 lp:998340 - Valgrind complains on simple selects containing expression DAY(FROM_UNIXTIME(-1)) +# +SELECT SUBSTRING('1', DAY(FROM_UNIXTIME(-1))); +SELECT LEFT('1', DAY(FROM_UNIXTIME(-1))); +SELECT RIGHT('1', DAY(FROM_UNIXTIME(-1))); +SELECT REPEAT('1', DAY(FROM_UNIXTIME(-1))); +SELECT RPAD('hi', DAY(FROM_UNIXTIME(-1)),'?'); +SELECT LPAD('hi', DAY(FROM_UNIXTIME(-1)),'?'); + +# +# MDEV-4289 Assertion `0' fails in make_sortkey with GROUP_CONCAT, MAKE_SET, GROUP BY +# +create table t1 (i int); +insert into t1 values (null),(8); +select group_concat( i ), make_set( i, 'a', 'b' ) field from t1 group by field; +drop table t1; + --echo End of 5.1 tests --echo Start of 5.4 tests @@ -1502,11 +1520,6 @@ round( --connection default SET @@global.max_allowed_packet:= @tmp_max; --disconnect newconn - ---echo # ---echo # End of 5.5 tests ---echo # - # # Bug#11765562 58545: # EXPORT_SET() CAN BE USED TO MAKE ENTIRE SERVER COMPLETELY UNRESPONSIVE @@ -1517,3 +1530,16 @@ SELECT @@global.max_allowed_packet; SELECT CHAR_LENGTH(EXPORT_SET(1,1,1,REPEAT(1,100000000))); SET @@global.max_allowed_packet:= @tmp_max; +--echo # +--echo # MDEV-4272: DIV operator crashes in Item_func_int_div::val_int +--echo # (incorrect NULL value handling by convert) +--echo # +create table t1(a int) select null; +select 1 div convert(a using utf8) from t1; +drop table t1; + + +--echo # +--echo # End of 5.5 tests +--echo # + diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 57ef68595bf..7a72c21d0ff 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -883,7 +883,9 @@ SELECT STR_TO_DATE(SPACE(2),'1'); --echo # SET GLOBAL SQL_MODE=''; +--disable_warnings DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE)); +--enable_warnings SET GLOBAL SQL_MODE=DEFAULT; --echo # @@ -1174,3 +1176,13 @@ select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010') --error ER_TOO_BIG_PRECISION select now(258); + +# +# MDEV-4293 Valgrind warnings (Conditional jump or move depends on uninitialised value) in remove_eq_conds on time functions with NULL argument in WHERE +# +SELECT 1 FROM DUAL WHERE YEAR(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE MONTH(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE DAYOFMONTH(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE HOUR(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12')); diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index e7e6fa59df0..731efe5648e 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -120,7 +120,7 @@ INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText(' drop table t1; CREATE TABLE t1 ( - line LINESTRING NOT NULL, + line GEOMETRY NOT NULL, kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', name VARCHAR(32), @@ -935,7 +935,7 @@ DROP TABLE t1; --echo # and invalid spatial data --echo # -CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL, +CREATE TABLE t1(a POINT NOT NULL, b GEOMETRY NOT NULL, SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM; INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)")); --error ER_CANT_CREATE_GEOMETRY_OBJECT diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index b0ad8329cfb..cff93fc13ee 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -741,7 +741,7 @@ SET @a=POLYFROMWKB(@a); # Bug #57321 crashes and valgrind errors from spatial types # -create table t1(a polygon NOT NULL)engine=myisam; +create table t1(a geometry NOT NULL)engine=myisam; insert into t1 values (geomfromtext("point(0 1)")); insert into t1 values (geomfromtext("point(1 0)")); select * from (select polygon(t1.a) as p from t1 order by t1.a) d; @@ -759,6 +759,87 @@ create spatial index i on t1 (a); drop table t1; +# +# Bug#11767480 - SPATIAL INDEXES ON NON-SPATIAL COLUMNS CAUSE CRASHES. +# +CREATE TABLE t0 (a BINARY(32) NOT NULL); +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX i on t0 (a); +INSERT INTO t0 VALUES (1); + +--error ER_WRONG_ARGUMENTS +CREATE TABLE t1( + col0 BINARY NOT NULL, + col2 TIMESTAMP, + SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; + +# Test other ways to add indices +CREATE TABLE t1 ( + col0 BINARY NOT NULL, + col2 TIMESTAMP +) ENGINE=MyISAM; + +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX idx0 ON t1(col0); + +--error ER_WRONG_ARGUMENTS +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); + +CREATE TABLE t2 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 POINT +); + +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); + +--error ER_WRONG_ARGUMENTS +CREATE TABLE t3 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 LINESTRING, + SPATIAL INDEX i1 (col1, col2) +); + +# cleanup +DROP TABLE t0, t1, t2; + + +--echo # +--echo # BUG#12414917 - ISCLOSED() CRASHES ON 64-BIT BUILDS +--echo # +SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20))); + +--echo # +--echo # BUG#12537203 - CRASH WHEN SUBSELECTING GLOBAL VARIABLES IN +--echo # GEOMETRY FUNCTION ARGUMENTS +--echo # +--replace_regex /non geometric .* value/non geometric '' value/ +--error ER_ILLEGAL_VALUE_FOR_TYPE +SELECT GEOMETRYCOLLECTION((SELECT @@OLD)); + +--echo # +--echo # MDEV-4252 geometry query crashes server +--echo # +select astext(0x0100000000030000000100000000000010); +select astext(st_centroid(0x0100000000030000000100000000000010)); +select astext(st_exteriorring(0x0100000000030000000100000000000010)); +select envelope(0x0100000000030000000100000000000010); +select geometryn(0x0100000000070000000100000001030000000200000000000000ffff0000, 1); +select geometryn(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1); + +--echo # +--echo # MDEV-4296 Assertion `n_linear_rings > 0' fails in Gis_polygon::centroid_xy +--echo # + +SELECT Centroid( AsBinary( LineString(Point(0,0), Point(0,0), Point(0,0) ))); + +--echo # +--echo # MDEV-4295 Server crashes in get_point on a query with Area, AsBinary, MultiPoint +--echo # +SELECT Area(AsBinary(MultiPoint(Point(0,9), Point(0,1), Point(2,2)))); --echo End of 5.1 tests #bug 850775 ST_AREA does not work on GEOMETRYCOLLECTIONs in maria-5.3-gis @@ -1293,6 +1374,7 @@ WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; #WHERE lakes.name = 'Blue Lake'; DROP DATABASE gis_ogs; +USE test; --echo # --echo # BUG #1043845 st_distance() results are incorrect depending on variable order @@ -1308,25 +1390,18 @@ select st_distance(geomfromtext('point(-95.96269500000000000000 36.1418183333333 -95.9673057475387 36.1344478941074, -95.9673063519371 36.134484524621, -95.9673049102515 36.1343976584193) ')) ; -USE test; - --echo # ---echo # BUG#12414917 - ISCLOSED() CRASHES ON 64-BIT BUILDS +--echo # MDEV-4310 geometry function equals hangs forever. --echo # -SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20))); - ---echo # ---echo # BUG#12537203 - CRASH WHEN SUBSELECTING GLOBAL VARIABLES IN ---echo # GEOMETRY FUNCTION ARGUMENTS ---echo # ---replace_regex /non geometric .* value/non geometric '' value/ ---error ER_ILLEGAL_VALUE_FOR_TYPE -SELECT GEOMETRYCOLLECTION((SELECT @@OLD)); - - ---echo End of 5.1 tests +create table t1(a geometry not null)engine=myisam; +insert into t1 values(geomfromtext("POINT(0 0)")); +insert into t1 values(geomfromtext("POINT(0 9.2233720368548e18)")); +insert into t1 values(geomfromtext("POINT(0 9.2233720368548e18)")); +select equals(`a`,convert(`a` using utf8)) from `t1`; +drop table t1; +--echo End of 5.3 tests --echo # --echo # Bug#11908153: CRASH AND/OR VALGRIND ERRORS IN FIELD_BLOB::GET_KEY_IMAGE @@ -1358,4 +1433,13 @@ SELECT 1 FROM g1 WHERE a >= ANY DROP TABLE g1; +--echo # +--echo # MDEV-3819 missing constraints for spatial column types +--echo # + +create table t1 (pt point); +--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD +insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))')); +drop table t1; + --echo End of 5.5 tests diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test index f3e551cd623..c30e0c28f31 100644 --- a/mysql-test/t/grant4.test +++ b/mysql-test/t/grant4.test @@ -104,9 +104,7 @@ connection con1; use mysqltest_db1; --echo ** Connect as restricted user mysqltest_u1. --echo ** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do (authentication is enough). -# -# this result is wrong. reported as bug#34104 -# +--echo ** but will return no rows SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='t5'; # # Bug27145 EXTRA_ACL trouble diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index b2dd84f63c7..b606d413608 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1322,6 +1322,80 @@ SELECT 1 FROM t1 GROUP BY SUBSTRING(SYSDATE() FROM 'K' FOR 'jxW<'); DROP TABLE t1; SET BIG_TABLES=0; +--echo # +--echo # MDEV-641 LP:1002108 - Wrong result (or crash) from a query with duplicated field in the group list and a limit clause +--echo # Bug#11761078: 53534: INCORRECT 'SELECT SQL_BIG_RESULT...' +--echo # WITH GROUP BY ON DUPLICATED FIELDS +--echo # + +CREATE TABLE t1( + col1 int, + UNIQUE INDEX idx (col1)); + +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10), + (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); + +let $query0=SELECT col1 AS field1, col1 AS field2 + FROM t1 GROUP BY field1, field2; + +# Needs to be range to exercise bug +--eval EXPLAIN $query0; +FLUSH STATUS; +--eval $query0; +SHOW SESSION STATUS LIKE 'Sort_scan%'; + +let $query=SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2 + FROM t1 GROUP BY field1, field2; + +# Needs to be range to exercise bug +--eval EXPLAIN $query; +FLUSH STATUS; +--eval $query; +SHOW SESSION STATUS LIKE 'Sort_scan%'; + +CREATE VIEW v1 AS SELECT * FROM t1; + +SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2 +FROM v1 +GROUP BY field1, field2; + +SELECT SQL_BIG_RESULT tbl1.col1 AS field1, tbl2.col1 AS field2 +FROM t1 as tbl1, t1 as tbl2 +GROUP BY field1, field2 +LIMIT 3; + +explain +select col1 f1, col1 f2 from t1 order by f2, f1; +select col1 f1, col1 f2 from t1 order by f2, f1; + +explain +select col1 f1, col1 f2 from t1 group by f2 order by f2, f1; +select col1 f1, col1 f2 from t1 group by f2 order by f2, f1; + +explain +select col1 f1, col1 f2 from t1 group by f1, f2 order by f2, f1; +select col1 f1, col1 f2 from t1 group by f1, f2 order by f2, f1; + +CREATE TABLE t2( + col1 int, + col2 int, + UNIQUE INDEX idx (col1, col2)); + +INSERT INTO t2(col1, col2) VALUES + (1,20),(2,19),(3,18),(4,17),(5,16),(6,15),(7,14),(8,13),(9,12),(10,11), + (11,10),(12,9),(13,8),(14,7),(15,6),(16,5),(17,4),(18,3),(19,2),(20,1); + +explain +select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2, f3; +select col1 f1, col2 f2, col1 f3 from t2 group by f1, f2, f3; + +explain +select col1 f1, col2 f2, col1 f3 from t2 order by f1, f2, f3; +select col1 f1, col2 f2, col1 f3 from t2 order by f1, f2, f3; + +DROP VIEW v1; +DROP TABLE t1, t2; + --echo # End of 5.1 tests --echo # diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test index 19f7cbe40a1..82097c53fe0 100644 --- a/mysql-test/t/group_min_max.test +++ b/mysql-test/t/group_min_max.test @@ -1204,6 +1204,64 @@ drop table t1; --echo End of 5.1 tests +--echo # +--echo # MDEV-765 lp:825075 - Wrong result with GROUP BY + multipart key + MIN/MAX loose scan +--echo # + +CREATE TABLE t1 (a varchar(1), b varchar(1), KEY (b,a)); +INSERT INTO t1 VALUES +('0',NULL),('9',NULL),('8','c'),('4','d'),('7','d'),(NULL,'f'), +('7','f'),('8','g'),(NULL,'j'); + +explain +SELECT max(a) , b FROM t1 WHERE a IS NULL OR b = 'z' GROUP BY b; +SELECT max(a) , b FROM t1 WHERE a IS NULL OR b = 'z' GROUP BY b; + +explain +SELECT b, min(a) FROM t1 WHERE a = '7' OR b = 'z' GROUP BY b; +SELECT b, min(a) FROM t1 WHERE a = '7' OR b = 'z' GROUP BY b; + +explain +SELECT b, min(a) FROM t1 WHERE (a = b OR b = 'd' OR b is NULL) GROUP BY b; +SELECT b, min(a) FROM t1 WHERE (a = b OR b = 'd' OR b is NULL) GROUP BY b; + +explain +SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; +SELECT b, min(a) FROM t1 WHERE a > ('0' = b) AND b = 'z' GROUP BY b; + +explain +SELECT b, min(a) FROM t1 WHERE a > '0' AND (b < (a = '7')) GROUP BY b; +SELECT b, min(a) FROM t1 WHERE a > '0' AND (b < (a = '7')) GROUP BY b; + +explain +SELECT b, min(a) FROM t1 WHERE (a > '0' AND (a > '1' OR b = 'd')) GROUP BY b; +SELECT b, min(a) FROM t1 WHERE (a > '0' AND (a > '1' OR b = 'd')) GROUP BY b; + +drop table t1; + +--echo # +--echo # MDEV-4140 Wrong result with GROUP BY + multipart key + MIN/MAX loose scan and a subquery +--echo # + +CREATE TABLE t1 (a int, b int, KEY (b, a)) ; +INSERT INTO t1 VALUES (0,99),(9,99),(4,0),(7,0),(99,0),(7,0),(8,0),(99,0),(1,0); +CREATE TABLE t2 (c int) ; +INSERT INTO t2 VALUES (0),(1); + +EXPLAIN +SELECT MIN(a), b FROM t1 WHERE a > 0 GROUP BY b; +SELECT MIN(a), b FROM t1 WHERE a > 0 GROUP BY b; +EXPLAIN +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT c FROM t2 WHERE c = 0 ) GROUP BY b; +# this test is for 5.5 to ensure that the subquery is expensive +EXPLAIN +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT min(c) FROM t2, t1 t1a, t1 t1b WHERE c = 0 ) GROUP BY b; +SELECT MIN(a), b FROM t1 WHERE a > ( SELECT min(c) FROM t2, t1 t1a, t1 t1b WHERE c = 0 ) GROUP BY b; + +drop table t1, t2; + +--echo End of 5.3 tests --echo # --echo # WL#3220 (Loose index scan for COUNT DISTINCT) @@ -1342,4 +1400,3 @@ explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1; drop table t1; --echo # End of test#50539. - diff --git a/mysql-test/t/information_schema_all_engines-master.opt b/mysql-test/t/information_schema_all_engines-master.opt index 085c81d34bb..0a9fa574e49 100644 --- a/mysql-test/t/information_schema_all_engines-master.opt +++ b/mysql-test/t/information_schema_all_engines-master.opt @@ -2,9 +2,10 @@ --loose-innodb-buffer-pool-pages --loose-innodb-buffer-pool-pages-blob --loose-innodb-buffer-pool-pages-index +--loose-innodb-changed-pages --loose-innodb-cmp ---loose-innodb-cmpmem-reset --loose-innodb-cmp-reset +--loose-innodb-cmpmem-reset --loose-innodb-index-stats --loose-innodb-lock-waits --loose-innodb-rseg diff --git a/mysql-test/t/information_schema_all_engines.test b/mysql-test/t/information_schema_all_engines.test index 553367d2b9a..73ed00376ab 100644 --- a/mysql-test/t/information_schema_all_engines.test +++ b/mysql-test/t/information_schema_all_engines.test @@ -49,7 +49,7 @@ SELECT t.table_name, c1.column_name # # Bug#24630 Subselect query crashes mysqld # -select 1 as f1 from information_schema.tables where "CHARACTER_SETS"= +select 1 as f1 from information_schema.tables where "ALL_PLUGINS"= (select cast(table_name as char) from information_schema.tables order by table_name limit 1) limit 1; diff --git a/mysql-test/t/innodb_ext_key.test b/mysql-test/t/innodb_ext_key.test index 3e82403ddb5..31c6fca2b95 100644 --- a/mysql-test/t/innodb_ext_key.test +++ b/mysql-test/t/innodb_ext_key.test @@ -414,6 +414,7 @@ INSERT INTO t1 (a) VALUES (4), (6); INSERT INTO t2 (b) VALUES (0), (8); set @save_optimizer_switch=@@optimizer_switch; +set @save_join_cache_level=@@join_cache_level; SET join_cache_level=3; SET optimizer_switch='join_cache_hashed=on'; @@ -424,6 +425,7 @@ EXPLAIN SELECT * FROM t1, t2 WHERE b=a; SELECT * FROM t1, t2 WHERE b=a; +set join_cache_level=@save_join_cache_level; set optimizer_switch=@save_optimizer_switch; DROP TABLE t1,t2; @@ -466,6 +468,78 @@ set optimizer_switch=@save_optimizer_switch; DROP TABLE t1; +--echo # +--echo # Bug mdev-4220: using ref instead of eq_ref +--echo # with extended_keys=on +--echo # (performance regression introduced in the patch for mdev-3851) +--echo # + +set @save_optimizer_switch=@@optimizer_switch; + +create table t1 (a int not null) engine=innodb; + +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t2 ( + pk int primary key, a int not null, b int, unique(a) +)engine=innodb; + +insert into t2 +select + A.a + 10 * B.a, A.a + 10 * B.a, A.a + 10 * B.a +from t1 A, t1 B; + +set optimizer_switch='extended_keys=off'; +explain +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +flush status; +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +show status like 'handler_read%'; + +set optimizer_switch='extended_keys=on'; +explain +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +flush status; +select * from t1, t2 where t2.a=t1.a and t2.b < 2; +show status like 'handler_read%'; + +drop table t1,t2; + +# this test case did not demonstrate any regression +# it is added for better testing + +create table t1(a int) engine=myisam; +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t2(a int) engine=myisam; +insert into t2 select A.a + 10*B.a + 100*C.a from t1 A, t1 B, t1 C; + +create table t3 ( + pk1 int not null, pk2 int not null, col1 int not null, col2 int not null) +engine=innodb; +insert into t3 select a,a,a,a from t2; +alter table t3 add primary key (pk1, pk2); +alter table t3 add key (col1, col2); + +set optimizer_switch='extended_keys=off'; +--replace_column 9 # +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; +--replace_column 9 # +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; + +set optimizer_switch='extended_keys=on'; +--replace_column 9 # +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; +--replace_column 9 # +explain +select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; + +drop table t1,t2,t3; + +set optimizer_switch=@save_optimizer_switch; + set optimizer_switch=@save_ext_key_optimizer_switch; SET SESSION STORAGE_ENGINE=DEFAULT; - diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 907d39e95fe..33289f77c13 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -1136,3 +1136,29 @@ SET optimizer_switch=@tmp_optimizer_switch; DROP TABLE t1,t2,t3,t4,t5; SET optimizer_switch=@save_optimizer_switch; + +--echo # +--echo # Bug #35268: Parser can't handle STRAIGHT_JOIN with USING +--echo # + +CREATE TABLE t1 (a int); + +INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); + +CREATE TABLE t2 (a int); + +INSERT INTO t2 (a) VALUES (1),(2),(3),(4); + +EXPLAIN +SELECT t1.a FROM t1 NATURAL INNER JOIN t2 ORDER BY t1.a; +SELECT t1.a FROM t1 NATURAL INNER JOIN t2 ORDER BY t1.a; + +EXPLAIN +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 USING(a) ORDER BY t1.a; +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 USING(a) ORDER BY t1.a; + +EXPLAIN +SELECT t1.a FROM t1 NATURAL STRAIGHT_JOIN t2 ORDER BY t1.a; +SELECT t1.a FROM t1 NATURAL STRAIGHT_JOIN t2 ORDER BY t1.a; + +DROP TABLE t1,t2; 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/join_outer_innodb.test b/mysql-test/t/join_outer_innodb.test index cca1dde481d..adb555d5f85 100644 --- a/mysql-test/t/join_outer_innodb.test +++ b/mysql-test/t/join_outer_innodb.test @@ -143,3 +143,210 @@ eval SELECT $rest_of_query; eval EXPLAIN SELECT $rest_of_query; drop table t1,t2,t3,t4,t5,t6; + +--echo # +--echo Bug mdev-4318: view over a complex query with outer joins +--echo # + +CREATE TABLE t1 ( + a1 int NOT NULL, a2 int NOT NULL, a3 int DEFAULT NULL, a4 tinyint NOT NULL, + a5 int NOT NULL, a6 tinyint NOT NULL, a7 tinyint(4) DEFAULT NULL, + a8 smallint(6) DEFAULT NULL, a9 smallint(6) DEFAULT NULL, a10 tinyint NOT NULL, + PRIMARY KEY (a1), KEY a2 (a2), KEY a3 (a3), KEY a4 (a4), KEY a6 (a6), + KEY a5 (a5), KEY a7 (a7), KEY a8 (a8), KEY a9 (a9) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES + (3360,5684,2219,1,316832,1,0,NULL,NULL,NULL), + (3362,2754,597,2,316844,1,0,NULL,NULL,NULL), + (3363,369,NULL,1,317295,1,0,NULL,NULL,NULL); + +CREATE TABLE t2 ( + b1 int NOT NULL, b2 int NOT NULL, PRIMARY KEY (b1,b2), KEY b2 (b2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE t3 ( + c1 int NOT NULL, PRIMARY KEY (c1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t3 VALUES + (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12), + (1000),(1001),(1002),(1003),(9999); + +CREATE TABLE t4 ( + d1 int NOT NULL, PRIMARY KEY (d1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t4 VALUES (5674),(5676),(5680),(5684),(5685); + +CREATE TABLE t5 ( + e1 int NOT NULL, e2 varchar(64) NOT NULL, PRIMARY KEY (e1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t5 VALUES + (5684,'51a5de7a9f56314e082094d78f58be082c3cf0c1'), + (5685,'754dc8292cb9f5eb9ade126fe7e961c62412a349'), + (5686,'75eeb33f1c819bac21f6d023b4c5b24185eeda5c'); + +CREATE TABLE t6 ( + f1 int NOT NULL, PRIMARY KEY (f1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t6 VALUES (5542),(5620),(5686); + +CREATE TABLE t7 ( + g1 tinyint NOT NULL DEFAULT '0', g2 varchar(20) NOT NULL, PRIMARY KEY (g1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t7 VALUES + (1,'60feec2b20ed19f55ad0'),(3,'9ddb18bff7fcbd1e3133'), + (5,'a05599df9222bb160d11'),(7,'e31bae372f7d01df0589'), + (9,'8f8372dd7fc8eb46c8a3'),(11,'f8d0e28529e990a09309'); + +CREATE TABLE t8 ( + h1 tinyint NOT NULL, h2 varchar(128) DEFAULT NULL, PRIMARY KEY (h1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t8 VALUES (1,'b'),(2,'c'),(3,'d'),(4,'e'); + +CREATE TABLE t9 ( + i1 tinyint NOT NULL, i2 varchar(7) NOT NULL, i3 varchar(128) NOT NULL, + PRIMARY KEY (i1,i2), KEY i2 (i2), KEY i3 (i3) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t9 VALUES + (2,'a','07630d223c7e5f7b1feb19b3caafb0833fd028eb'), + (3,'b','1ca53dcc50b68af86f4b1b4676dbed917b543c30'), + (1,'b','2c01ac36c1ce9a7de66be89f85d8aa5f0052e2e8'), + (4,'a','496c486b3a9edc439477fef7d34cbefdebba86df'), + (3,'a','98bf72d8d467201058a5f69bd7709bfc74a8637e'), + (2,'b','9a45425f6160fb59d7f8a02c721498d4ce945302'), + (4,'b','9c9a7300f3e708f8e430f9f3376d966f5951f583'), + (1,'a','c0af3f076b905f31cbb51af304b9c7ad539e0861'); + +CREATE TABLE t10 ( + j1 tinyint NOT NULL, j2 varchar(20) NOT NULL, PRIMARY KEY (j1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t10 VALUES (1,'b'),(2,'c'),(3,'d'); + +CREATE TABLE t11 ( + k1 int NOT NULL, k2 datetime DEFAULT NULL, k3 int DEFAULT NULL, + k4 int DEFAULT NULL, PRIMARY KEY (k1), KEY k3 (k3), KEY k4 (k4) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t11 VALUES + (317422,'2013-03-18 11:43:03',1,NULL),(317423,'2013-03-18 11:43:11',1,NULL), + (317424,'2013-03-18 11:52:01',1,1),(317425,'2013-03-18 11:52:01',1,1), + (317426,'2013-03-18 11:56:38',1,1),(317427,'2013-03-18 12:18:25',1,NULL), + (317428,'2013-03-18 12:46:28',1,NULL),(317429,'2013-03-18 12:46:28',1,NULL), + (317430,'2013-03-18 12:46:28',1,NULL),(317431,'2013-03-18 12:46:28',1,NULL), + (317432,'2013-03-18 12:46:28',1,NULL),(317433,'2013-03-18 12:46:28',1,NULL), + (317434,'2013-03-18 12:46:28',1,NULL),(317435,'2013-03-18 12:46:28',1,NULL), + (317436,'2013-03-18 12:46:28',1,NULL),(317437,'2013-03-18 12:46:28',1,NULL), + (317438,'2013-03-18 12:46:28',1,NULL),(317439,'2013-03-18 12:46:28',1,NULL), + (317440,'2013-03-18 12:55:20',1,NULL),(317441,'2013-03-18 12:58:29',1,NULL), + (317442,'2013-03-18 13:06:02',1,NULL),(317443,'2013-03-18 15:23:18',21,NULL); + +CREATE TABLE t12 ( + l1 int NOT NULL, l2 varchar(64) NOT NULL, PRIMARY KEY (l1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t12 VALUES + (552,'59a498252ef59f96fbdc13a414abe244d8e8bc30'), + (554,'c6025c7cb2d9dfb1be7ce4a61f35b45bb9e61ba3'), + (555,'b245bcc672082bb6d10794b2b4ac972dd14b1cf5'); + +CREATE TABLE t13 ( + m1 int NOT NULL, m2 int NOT NULL, m3 int NOT NULL, + PRIMARY KEY (m1,m2,m3), KEY m3 (m3), KEY m2 (m2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t13 VALUES (3324,43,4),(3332,263,1),(3348,27,3); + +CREATE TABLE t14 ( + n1 smallint NOT NULL, n2 varchar(64) NOT NULL, PRIMARY KEY (n1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t14 VALUES + (21,'685bf7ca576af964c7cff564d5e4473b81499b8b'), + (23,'b8e42dab1ab952406b3accfb47089c61478138a8'), + (25,'3fea441e411db8c70bf039b50c8f18f59515be53'), + (27,'998aecc30fd0e0b8a1cac6590e5eccc2d7822223'); + +CREATE TABLE t15 ( + o1 smallint NOT NULL, PRIMARY KEY (o1) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t15 VALUES (1),(3); + +CREATE TABLE t16 ( + p1 smallint NOT NULL, p2 varchar(7) NOT NULL, p3 varchar(64) NOT NULL, + PRIMARY KEY (p1,p2) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO t16 VALUES + (1,'a','66bdbb389456f3ae97206da115a7b397c31400e8'), + (1,'b','66bdbb389456f3ae97206da115a7b397c31400e8'), + (3,'a','386c10e454278c6e27feb16258089166422f79b4'), + (3,'b','386c10e454278c6e27feb16258089166422f79b4'); + +let $Q= +select t3.c1,t5.e2,t1.a1,t14.n2,t16.p3,t10.j2,t7.g2,t11.k2,l3.l2, + t9.i3,t12.l2 AS l_l2,l2.l2 AS l2_l2,l4.l1 AS l4_l1,t6.f1 +from +( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + t1 + left join t2 on t1.a1 = t2.b1 + ) + left join t3 on t2.b2 = t3.c1 + ) + left join t4 on t1.a2 = t4.d1 + ) + left join t5 on t4.d1 = t5.e1 + ) + left join t6 on t1.a3 = t6.f1 + ) + left join t5 e2 on t6.f1 = e2.e1 + ) + join t7 on t1.a7 = t7.g1 + ) + join t8 on t1.a4 = t8.h1 + ) + join t9 on t8.h1 = t9.i1 + ) + join t10 on t1.a6 = t10.j1 + ) + join t11 on t1.a5 = t11.k1 + ) + left join t12 on t11.k3 = t12.l1 + ) + left join t12 l2 on t11.k4 = l2.l1 + ) + left join t13 on t1.a1 = t13.m1 and t13.m3 = 4 + ) + left join t12 l4 on l4.l1 = t13.m2 + ) + left join t13 m2 on t1.a1 = m2.m1 and m2.m3 = 3 + ) + left join t12 l3 on l3.l1 = m2.m2 + ) + left join t14 on t1.a8 = t14.n1 + ) + left join t15 on t1.a9 = t15.o1 +) +left join t16 on t15.o1 = t16.p1 +where t1.a10 = 1; + +eval create view v1 as $Q; + +eval explain $Q; + +explain select * from v1; + +drop view v1; + +drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16; diff --git a/mysql-test/t/keywords.test b/mysql-test/t/keywords.test index 08016313ca7..54052e65014 100644 --- a/mysql-test/t/keywords.test +++ b/mysql-test/t/keywords.test @@ -162,3 +162,14 @@ call p2(); DROP PROCEDURE p1; DROP PROCEDURE p2; DROP TABLE t1; + +# +# OPTION is not anymore a keyword +# + +create table option (option int not null); +drop table option; +--error 1193 +set option=1; +--error 1193 +set option option=1; diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test index 197cad536e4..fef8a9848ca 100644 --- a/mysql-test/t/mdl_sync.test +++ b/mysql-test/t/mdl_sync.test @@ -4382,7 +4382,7 @@ connection default; --echo # Connection con2 connection con2; --echo # Reaping: RENAME TABLE db1.t1 TO test.t1 ---error ER_FILE_NOT_FOUND, ER_FILE_NOT_FOUND +--error ER_NO_SUCH_TABLE --reap --echo # Connection default diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 4066fcb264b..7e198275730 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -226,19 +226,19 @@ drop table t3,t1,t2; # # temporary merge tables # -CREATE TABLE t1 (c1 INT NOT NULL); -CREATE TABLE t2 (c1 INT NOT NULL); -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (2); -CREATE TEMPORARY TABLE t3 (c1 INT NOT NULL) ENGINE=MRG_MYISAM UNION=(t1,t2); -SELECT * FROM t3; -CREATE TEMPORARY TABLE t4 (c1 INT NOT NULL); -CREATE TEMPORARY TABLE t5 (c1 INT NOT NULL); -INSERT INTO t4 VALUES (4); -INSERT INTO t5 VALUES (5); -CREATE TEMPORARY TABLE t6 (c1 INT NOT NULL) ENGINE=MRG_MYISAM UNION=(t4,t5); -SELECT * FROM t6; -DROP TABLE t6, t3, t1, t2, t4, t5; +create table t1 (a int not null); +create table t2 (a int not null); +insert into t1 values (1); +insert into t2 values (2); +create temporary table t3 (a int not null) ENGINE=MERGE UNION=(t1,t2); +select * from t3; +create temporary table t4 (a int not null); +create temporary table t5 (a int not null); +insert into t4 values (1); +insert into t5 values (2); +create temporary table t6 (a int not null) ENGINE=MERGE UNION=(t4,t5); +select * from t6; +drop table t6, t3, t1, t2, t4, t5; # # Bug#19627 - temporary merge table locking # MERGE table and its children must match in temporary type. @@ -622,14 +622,6 @@ SHOW CREATE TABLE m1; DROP TABLE t1, m1; # -# BUG#35274 - merge table doesn't need any base tables, gives error 124 when -# key accessed -# -CREATE TABLE t1(a INT, KEY(a)) ENGINE=merge; -SELECT MAX(a) FROM t1; -DROP TABLE t1; - -# # BUG#32047 - 'Spurious' errors while opening MERGE tables # CREATE TABLE t1(a INT); @@ -1306,9 +1298,9 @@ DROP TABLE t1, t2, t3; # Truncate failed with error message when table was in use by MERGE. # # Show that truncate of child table after use of parent table works. -CREATE TABLE t1 (c1 INT) ENGINE=MyISAM; -CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; -CREATE TABLE t3 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2); +CREATE TABLE t1 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t2 (c1 INT) ENGINE= MyISAM; +CREATE TABLE t3 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1, t2); INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (2); SELECT * FROM t3; @@ -1840,6 +1832,51 @@ DROP TABLE m1, t1; --echo End of 5.1 tests +--echo # +--echo # MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg +--echo # +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t2 ( i int ) engine=myisam; +insert into t2 values (1),(2); + +create table t3 (a int, b int, filler char(100), key(a), key(b)) engine=myisam; +create table t4 like t3; +insert into t3 + select A.a+10*B.a+100*C.a, + A.a+10*B.a+100*C.a, + 'filler-data-FILLER-DATA-qqq' + from t1 A, t1 B, t1 C where C.a < 5; +insert into t4 + select A.a+10*B.a+100*C.a, + A.a+10*B.a+100*C.a, + 'filler-data-FILLER-DATA-qqq' + from t1 A, t1 B, t1 C where C.a >= 5; + +create table t5 like t3; +alter table t5 engine=merge; +alter table t5 union(t3, t4); + +update t5 set b=999, a=999 where b>950; + +explain +select * from t2, t5 where t5.a=999 and t5.b=999; +select * from t2, t5 where t5.a=999 and t5.b=999; + +drop table t5; +drop table t1,t2,t3,t4; + +--echo End of 5.3 tests + +# +# BUG#35274 - merge table doesn't need any base tables, gives error 124 when +# key accessed +# +CREATE TABLE t1(a INT, KEY(a)) ENGINE=merge; +SELECT MAX(a) FROM t1; +DROP TABLE t1; + --echo # --echo # An additional test case for Bug#27430 Crash in subquery code --echo # when in PS and table DDL changed after PREPARE @@ -2845,3 +2882,4 @@ eval set global storage_engine=$default; # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc + diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 48735304aad..e0a35ca2bb9 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -696,6 +696,55 @@ DROP FUNCTION f1; DROP TABLE t1; --echo # +--echo # MDEV-4123: Incorrect results after multi-table update or +--echo # assertion `!table || (!table->read_set || +--echo # bitmap_is_set(table->read_set, field_index))' failure +--echo # + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( + id int(10) unsigned NOT NULL, + level tinyint(3) unsigned NOT NULL, + PRIMARY KEY (id) +); +INSERT INTO t1 VALUES (2519583,1); + +DROP TABLE IF EXISTS t2; +CREATE TABLE t2 ( + club_id int(11) NOT NULL DEFAULT '0', + profile_id int(11) NOT NULL DEFAULT '0', + member_level_id int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (profile_id,club_id) +); +INSERT INTO t2 VALUES (2,2519583,12); + +DROP TABLE IF EXISTS t3; +CREATE TABLE t3 ( + member_level_id int(11) unsigned NOT NULL DEFAULT '0', + map_level int(11) unsigned NOT NULL DEFAULT '0', + map_status int(11) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (member_level_id) +); +INSERT INTO t3 VALUES (12,12,1); + +CREATE + VIEW v1 AS + select club_id,profile_id, + map_level AS member_level_id,map_status AS member_status + from (t2 tc join t3 map + on(((tc.member_level_id = map.member_level_id) and + (club_id = 2)))); + +select level, count(*) as cnt from t1 group by level; +UPDATE t1 c LEFT JOIN v1 t ON (c.id = t.profile_id AND t.club_id = 2) + SET c.level = IF (t.member_status IS NULL, 1, IF (t.member_status = 1, 2,3)); +select level, count(*) as cnt from t1 group by level; +drop view v1; +drop table t1,t2,t3; + +--echo end of tests + +--echo # --echo # BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a --echo # table is updated twice --echo # @@ -759,6 +808,5 @@ SELECT * FROM t2; DROP TABLE t1,t2; - - +--echo end of 5.5 tests diff --git a/mysql-test/t/myisam-metadata.test b/mysql-test/t/myisam-metadata.test new file mode 100644 index 00000000000..c5327aa3a71 --- /dev/null +++ b/mysql-test/t/myisam-metadata.test @@ -0,0 +1,49 @@ +# +# Test bugs in MyISAM that may cause problems for metadata +# + +--source include/big_test.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# LP:989055 - Querying myisam table metadata may corrupt the table +# + +CREATE TABLE t1 ( + id INT PRIMARY KEY, + a VARCHAR(100), + INDEX(a) +) ENGINE=MyISAM; +ALTER TABLE t1 DISABLE KEYS; + +let $1=100000; +--disable_query_log +while ($1) +{ + eval insert into t1 values($1, "line number $1"); + dec $1; +} +--enable_query_log + +--connect(con1,localhost,root,,) +--send + ALTER TABLE t1 ENABLE KEYS; + +--connection default +--let $wait_timeout=10 +--let $show_statement= SHOW PROCESSLIST +--let $field= State +--let $condition= = 'Repair by sorting' +--source include/wait_show_condition.inc + +--replace_column 7 # 8 # 9 # 12 # 13 # 14 # +SHOW TABLE STATUS LIKE 't1'; + +--connection con1 +--reap +--connection default +--disconnect con1 +DROP TABLE t1; diff --git a/mysql-test/t/myisam-system.test b/mysql-test/t/myisam-system.test index d908e639a4e..cece33bb00b 100644 --- a/mysql-test/t/myisam-system.test +++ b/mysql-test/t/myisam-system.test @@ -9,14 +9,21 @@ drop table if exists t1,t2; create table t1 (a int) engine=myisam; let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/t1.MYI +--replace_result $MYSQLD_DATADIR ./ drop table if exists t1; create table t1 (a int) engine=myisam; --remove_file $MYSQLD_DATADIR/test/t1.MYI ---error ER_BAD_TABLE_ERROR,6 +--replace_result $MYSQLD_DATADIR ./ +--error ER_FILE_NOT_FOUND +select * from t1; +--replace_result $MYSQLD_DATADIR ./ drop table t1; create table t1 (a int) engine=myisam; --remove_file $MYSQLD_DATADIR/test/t1.MYD ---error ER_BAD_TABLE_ERROR,6,29 +--replace_result $MYSQLD_DATADIR ./ +--error 29 +select * from t1; +--replace_result $MYSQLD_DATADIR ./ drop table t1; --error ER_BAD_TABLE_ERROR drop table t1; 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 71a985654ef..662cd4c7c0c 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/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 90da022fb38..bf5331ca4f9 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -6,6 +6,8 @@ SET @old_general_log= @@global.general_log; SET @old_slow_query_log= @@global.slow_query_log; +call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'"); + # We run with different binaries for normal and --embedded-server # # If this test fails with "command "$MYSQL_CLIENT_TEST" failed", diff --git a/mysql-test/t/mysql_client_test_nonblock.test b/mysql-test/t/mysql_client_test_nonblock.test index fc2e0b1d01b..51263854e58 100644 --- a/mysql-test/t/mysql_client_test_nonblock.test +++ b/mysql-test/t/mysql_client_test_nonblock.test @@ -5,6 +5,7 @@ SET @old_general_log= @@global.general_log; SET @old_slow_query_log= @@global.slow_query_log; +call mtr.add_suppression(" Error reading file './client_test_db/test_frm_bug.frm'"); # We run with different binaries for normal and --embedded-server # diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index c0025f9e742..06d702495c2 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -93,6 +93,7 @@ drop view v1; # Bug#37527: mysqlcheck fails to report entire database # when frm file corruption # +call mtr.add_suppression("Error reading file './test/t1.frm'"); CREATE TABLE t1(a INT) engine=myisam; CREATE TABLE t2(a INT) engine=myisam; # backup then null t1.frm diff --git a/mysql-test/t/mysqld--help.test b/mysql-test/t/mysqld--help.test index 806e6f7f8d1..0f3df10ea70 100644 --- a/mysql-test/t/mysqld--help.test +++ b/mysql-test/t/mysqld--help.test @@ -20,11 +20,14 @@ perl; # their paths may vary: @skipvars=qw/basedir open-files-limit general-log-file log plugin-dir log-slow-queries pid-file slow-query-log-file log-basename - datadir slave-load-tmpdir tmpdir socket/; + datadir slave-load-tmpdir tmpdir socket thread-pool-size/; # Plugins which may or may not be there: - @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster feedback debug temp-pool ssl des-key-file - xtradb thread-concurrency super-large-pages mutex-deadlock-detector null-audit maria aria pbxt oqgraph sphinx thread-handling thread-pool/; + @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster + feedback debug temp-pool ssl des-key-file xtradb sequence + thread-concurrency super-large-pages mutex-deadlock-detector + null-audit aria pbxt oqgraph sphinx thread-handling + test-sql-discovery rpl-semi-sync query-cache-info/; # And substitute the content some environment variables with their # names: diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 038907702d5..bad59ff09c3 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2494,3 +2494,31 @@ INSERT INTO t1 VALUES (1),(2),(2),(3),(4); ALTER TABLE t1 ADD PARTITION PARTITIONS 2; SELECT * from t1 order by i; DROP TABLE t1; + +# +# Test ALTER TABLE ADD/DROP PARTITION IF EXISTS +# + +CREATE TABLE t1 ( d DATE NOT NULL) +PARTITION BY RANGE( YEAR(d) ) ( + PARTITION p0 VALUES LESS THAN (1960), + PARTITION p1 VALUES LESS THAN (1970), + PARTITION p2 VALUES LESS THAN (1980), + PARTITION p3 VALUES LESS THAN (1990) +); + +ALTER TABLE t1 ADD PARTITION IF NOT EXISTS( +PARTITION `p5` VALUES LESS THAN (2010) +COMMENT 'APSTART \' APEND' +); + +ALTER TABLE t1 ADD PARTITION IF NOT EXISTS( +PARTITION `p5` VALUES LESS THAN (2010) +COMMENT 'APSTART \' APEND' +); + +alter table t1 drop partition if exists p5; +alter table t1 drop partition if exists p5; + +DROP TABLE t1; + diff --git a/mysql-test/t/partition_debug_sync.test b/mysql-test/t/partition_debug_sync.test index 027a4bd19a7..f8c00abafab 100644 --- a/mysql-test/t/partition_debug_sync.test +++ b/mysql-test/t/partition_debug_sync.test @@ -60,22 +60,19 @@ CREATE TABLE t2 b INTEGER NOT NULL, KEY (b)) ENGINE = MYISAM -/*!50100 PARTITION BY RANGE (a) -(PARTITION p0 VALUES LESS THAN (2), - PARTITION p1 VALUES LESS THAN (20), - PARTITION p2 VALUES LESS THAN (100), - PARTITION p3 VALUES LESS THAN MAXVALUE ) */; +PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2), + PARTITION p1 VALUES LESS THAN (20), + PARTITION p2 VALUES LESS THAN (100), + PARTITION p3 VALUES LESS THAN MAXVALUE); SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_FOR waiting_for_alter'; SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done'; --send ALTER TABLE t2 REMOVE PARTITIONING connection default; --echo # Con default -SET SESSION debug_dbug= "+d,sleep_before_no_locks_delete_table"; SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions'; SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter'; SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done'; DROP TABLE IF EXISTS t2; -SET SESSION debug_dbug= "-d,sleep_before_no_locks_delete_table"; --echo # Con 1 connection con1; --error ER_NO_SUCH_TABLE diff --git a/mysql-test/t/partition_disabled.test b/mysql-test/t/partition_disabled.test index 320d6238502..798fb0aa59e 100644 --- a/mysql-test/t/partition_disabled.test +++ b/mysql-test/t/partition_disabled.test @@ -29,7 +29,9 @@ ALTER TABLE t1 ANALYZE PARTITION ALL; ALTER TABLE t1 REBUILD PARTITION ALL; ALTER TABLE t1 ENGINE Memory; ALTER TABLE t1 ADD (new INT); +--disable_warnings DROP TABLE t1; +--enable_warnings --error ER_OPTION_PREVENTS_STATEMENT CREATE TABLE t1 ( diff --git a/mysql-test/t/partition_not_windows.test b/mysql-test/t/partition_not_windows.test index 333e12e2b16..429329c79bb 100644 --- a/mysql-test/t/partition_not_windows.test +++ b/mysql-test/t/partition_not_windows.test @@ -199,7 +199,7 @@ DROP TABLE example; --rmdir $MYSQLTEST_VARDIR/p2Index --rmdir $MYSQLTEST_VARDIR/p3Index ---error ER_CANT_CREATE_TABLE,1 +--error 1 CREATE TABLE `example` ( `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, `DESCRIPTION` varchar(30) NOT NULL, diff --git a/mysql-test/t/partition_rename_longfilename.test b/mysql-test/t/partition_rename_longfilename.test index 5e454f01da7..51d9c583f56 100644 --- a/mysql-test/t/partition_rename_longfilename.test +++ b/mysql-test/t/partition_rename_longfilename.test @@ -1,4 +1,5 @@ -- source include/not_windows.inc +-- source include/support_long_file_names.inc -- source include/have_partition.inc -- source include/not_embedded.inc --disable_warnings diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 4412383f837..602b2e3c5c9 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -16,12 +16,13 @@ INSTALL SONAME 'ha_example'; --replace_regex /\.dll/.so/ --query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%' -CREATE TABLE t1(a int) ENGINE=EXAMPLE; +CREATE TABLE t1 (a int) ENGINE=EXAMPLE; +CREATE TABLE t2 (a int) ENGINE=EXAMPLE; +FLUSH TABLES; # Let's do some advanced ops with the example engine :) SELECT * FROM t1; - # a couple of tests for variables set global example_ulong_var=500; set global example_enum_var= e1; @@ -29,12 +30,26 @@ show status like 'example%'; show variables like 'example%'; UNINSTALL SONAME 'ha_example'; + +# the engine is NOT uninstalled yet, +# because the table `t1` is open, sitting in the table defintion cache + --replace_column 5 # --replace_regex /\.dll/.so/ --query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%' - DROP TABLE t1; +# now the engine IS unloaded +# and the table `t2` belongs to an unknown engine + +--replace_column 5 # +--replace_regex /\.dll/.so/ +--query_vertical select * from information_schema.plugins where plugin_library like 'ha_example%' +--error ER_UNKNOWN_STORAGE_ENGINE +SELECT * FROM t2; +DROP TABLE t2; + + --error 1305 UNINSTALL PLUGIN EXAMPLE; @@ -129,6 +144,7 @@ CREATE TABLE t1 (a int) ENGINE=example ULL=1e2; CREATE TABLE t1 (a int) ENGINE=example ULL=0x1234; SHOW CREATE TABLE t1; +SET example_varopt_default=33; # does not affect varopt of t1 select create_options from information_schema.tables where table_schema='test' and table_name='t1'; @@ -137,6 +153,16 @@ SHOW CREATE TABLE t1; DROP TABLE t1; +create table t1 (a int) engine=example; # varopt is 10 +show create table t1; +drop table t1; + +create table t1 (a int) engine=example varopt=15; +show create table t1; +alter table t1 varopt=default; +show create table t1; +drop table t1; + SET @@SQL_MODE=@OLD_SQL_MODE; # diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 812b1b5ff94..22cad56a8e4 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -582,10 +582,7 @@ drop table t2; # cases derived from client_test.c: test_rename() prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; -# rename must fail, t7 does not exist -# Clean up the filename here because embedded server reports whole path ---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ '' t7.frm t7 ---error ER_FILE_NOT_FOUND +--error ER_NO_SUCH_TABLE execute stmt1 ; create table t7 (a int) ; # rename, t5 -> t6 and t7 -> t8 diff --git a/mysql-test/t/quick_select_4161.test b/mysql-test/t/quick_select_4161.test new file mode 100644 index 00000000000..1e746754b41 --- /dev/null +++ b/mysql-test/t/quick_select_4161.test @@ -0,0 +1,53 @@ +# +# MDEV-4161 Assertion `status_var.memory_used == 0' fails in virtual THD::~THD() +# +--source include/have_debug_sync.inc + +CREATE TABLE t1 ( + event_date date DEFAULT '0000-00-00' NOT NULL, + type int(11) DEFAULT '0' NOT NULL, + event_id int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (event_date,type,event_id) +); + +INSERT INTO t1 VALUES ('1999-07-10',100100,24), ('1999-07-11',100100,25), +('1999-07-13',100600,0), ('1999-07-13',100600,4), ('1999-07-13',100600,26), +('1999-07-14',100600,10), ('1999-07-15',100600,16), ('1999-07-15',100800,45), +('1999-07-15',101000,47), ('1999-07-16',100800,46), ('1999-07-20',100600,5), +('1999-07-20',100600,27), ('1999-07-21',100600,11), ('1999-07-22',100600,17), +('1999-07-23',100100,39), ('1999-07-24',100100,39), ('1999-07-24',100500,40), +('1999-07-25',100100,39), ('1999-07-27',100600,1), ('1999-07-27',100600,6), +('1999-07-27',100600,28), ('1999-07-28',100600,12), ('1999-07-29',100500,41), +('1999-07-29',100600,18), ('1999-07-30',100500,41), ('1999-07-31',100500,41), +('1999-08-01',100700,34), ('1999-08-03',100600,7), ('1999-08-03',100600,29), +('1999-08-04',100600,13), ('1999-08-05',100500,42), ('1999-08-05',100600,19), +('1999-08-06',100500,42), ('1999-08-07',100500,42), ('1999-08-08',100500,42), +('1999-08-10',100600,2), ('1999-08-10',100600,9), ('1999-08-10',100600,30), +('1999-08-11',100600,14), ('1999-08-12',100600,20), ('1999-08-17',100500,8), +('1999-08-17',100600,31), ('1999-08-18',100600,15), ('1999-08-19',100600,22), +('1999-08-24',100600,3), ('1999-08-24',100600,32), ('1999-08-27',100500,43), +('1999-08-31',100600,33), ('1999-09-17',100100,37), ('1999-09-18',100100,37), +('1999-09-19',100100,37), ('2000-12-18',100700,38); + +connect (killee, localhost, root); + +let $id=`select connection_id()`; + +set debug_sync='inside_make_join_statistics signal killme wait_for done'; +send select event_date,type,event_id from t1 WHERE event_date >= "1999-07-01" AND event_date < "1999-07-15" AND (type=100600 OR type=100100) ORDER BY event_date; + +connection default; +set debug_sync='now wait_for killme'; +--replace_result $id %connection% +eval kill $id; +set debug_sync='now signal done'; + +connection killee; +--error 1053,1927,2006,2013 +reap; + +connection default; +disconnect killee; + +drop table t1; + diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test index bb90cbafd74..a55bc845acc 100644 --- a/mysql-test/t/rename.test +++ b/mysql-test/t/rename.test @@ -21,16 +21,16 @@ rename table t3 to t4, t2 to t3, t1 to t2, t4 to t1; select * from t1; # The following should give errors ---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR +--error ER_TABLE_EXISTS_ERROR rename table t1 to t2; ---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR +--error ER_TABLE_EXISTS_ERROR rename table t1 to t1; ---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR +--error ER_TABLE_EXISTS_ERROR rename table t3 to t4, t2 to t3, t1 to t2, t4 to t2; show tables like "t_"; ---error ER_TABLE_EXISTS_ERROR,ER_TABLE_EXISTS_ERROR +--error ER_TABLE_EXISTS_ERROR rename table t3 to t1, t2 to t3, t1 to t2, t4 to t1; ---error ER_FILE_NOT_FOUND,ER_FILE_NOT_FOUND +--error ER_NO_SUCH_TABLE rename table t3 to t4, t5 to t3, t1 to t2, t4 to t1; select * from t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 44eaf7130a7..af507b1f7ef 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -4460,5 +4460,24 @@ INSERT INTO t2 VALUES (3),(4); SELECT * FROM t1, t2 WHERE a=3 AND a=b; drop table t1,t2; +--echo # +--echo # Bug mdev-4250: wrong transformation of WHERE condition with OR +--echo # + +CREATE TABLE t1 (pk int PRIMARY KEY, a int); +INSERT INTO t1 VALUES (3,0), (2,0), (4,1), (5,0), (1,0); + +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (1=2 OR t1.pk=2) AND t1.a <> 0; + +DROP TABLE t1; + +SELECT * FROM mysql.time_zone +WHERE ( NOT (Use_leap_seconds <= Use_leap_seconds AND Time_zone_id != 1) + AND Time_zone_id = Time_zone_id + OR Time_zone_id <> Time_zone_id ) + AND Use_leap_seconds <> 'N'; + --echo End of 5.3 tests diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index c2edef87d41..32bf5417a0a 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -429,7 +429,9 @@ system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ; SHOW TABLE STATUS like 't1'; --error ER_NOT_FORM_FILE show create table t1; +--disable_warnings drop table if exists t1; +--enable_warnings --error 1,0 --remove_file $MYSQLD_DATADIR/test/t1.frm diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test index 051d4b8b5fc..41091d7f5b9 100644 --- a/mysql-test/t/show_explain.test +++ b/mysql-test/t/show_explain.test @@ -466,7 +466,7 @@ explain SELECT * FROM t2 WHERE a = WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3) ); -set @show_explain_probe_select_id=2; +set @show_explain_probe_select_id=1; set debug_dbug='+d,show_explain_probe_do_select'; send SELECT * FROM t2 WHERE a = (SELECT MAX(a) FROM t2 diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 12b0f903c26..e109f88e3f9 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -7,9 +7,6 @@ # In the case of trouble you might want to skip this. # -# embedded server returns different paths in error messages -# in lines like 'call bug14233();' -# mysqltest should be fixed to allow REPLACE_RESULT in error message -- source include/not_embedded.inc # Supress warnings written to the log file diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 37f660d6682..e427253f65f 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -1865,5 +1865,18 @@ ORDER BY alias1.b; drop table t1, t2, t3; +--echo # +--echo # MDEV-4144 simple subquery causes full scan instead of range scan +--echo # + +CREATE TABLE t1 (id int not null auto_increment, x int not null, primary key(id)); +INSERT INTO t1 (x) VALUES (0),(0),(0); + +EXPLAIN +SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; +SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; + +drop table t1; + SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; diff --git a/mysql-test/t/subselect_exists2in.test b/mysql-test/t/subselect_exists2in.test new file mode 100644 index 00000000000..94e7109e9d2 --- /dev/null +++ b/mysql-test/t/subselect_exists2in.test @@ -0,0 +1,739 @@ + +--disable_warnings +drop table if exists t1,t2,t3; +--enable_warnings + +set optimizer_switch='exists_to_in=on'; +--echo # +--echo # LP BUG#884644 exists2in broke name resolution +--echo # + +CREATE TABLE t1 (f1 integer); + +--error ER_BAD_FIELD_ERROR +SELECT * FROM t1 WHERE EXISTS (SELECT NO_SUCH_TABLE.NO_SUCH_FIELD FROM t1); + +drop table t1; + +--echo # +--echo # LP BUG#884657 Wrong result with exists2in , correlated subquery +--echo # + +CREATE TABLE t1 ( a varchar(1)) ; +INSERT INTO t1 VALUES ('c'),('b'); + +CREATE TABLE t2 ( b varchar(1)) ; +INSERT INTO t2 VALUES ('v'),('v'),('c'),(NULL),('x'),('i'),('e'),('p'),('s'),('j'),('z'),('c'),('a'),('q'),('y'),(NULL),('r'),('v'),(NULL),('r'); + +CREATE TABLE t3 ( a int NOT NULL , b varchar(1)) ; +INSERT INTO t3 VALUES (29,'c'); + +SELECT * +FROM t1, t2 +WHERE EXISTS ( + SELECT a + FROM t3 + WHERE t3.b = t1.a + AND t3.b <> t2.b +); + + +INSERT INTO t3 VALUES (2,'c'); +alter table t1 add index aa (a); +alter table t3 add index bb (b); +--echo -- EXIST to IN then semijoin (has priority over IN to EXISTS) +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=on,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +--echo -- EXIST to IN then IN to EXISTS +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=off,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +--echo -- EXIST2IN then MATERIALIZATION +set optimizer_switch='exists_to_in=on,in_to_exists=off,semijoin=off,materialization=on,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +--echo -- NO EXIST2IN +set optimizer_switch='exists_to_in=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a); +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +drop table t1,t2,t3; + +--echo # +--echo # From group_min_max.test +--echo # +create table t1 ( + a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' ' +); + +insert into t1 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'), +('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'), +('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'), +('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'), +('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'), +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'), +('d','a','a','a411','xy1'),('d','a','a','b411','xy2'),('d','a','a','c411','xy3'),('d','a','a','d411','xy4'), +('d','a','b','e412','xy1'),('d','a','b','f412','xy2'),('d','a','b','g412','xy3'),('d','a','b','h412','xy4'), +('d','b','a','i421','xy1'),('d','b','a','j421','xy2'),('d','b','a','k421','xy3'),('d','b','a','l421','xy4'), +('d','b','b','m422','xy1'),('d','b','b','n422','xy2'),('d','b','b','o422','xy3'),('d','b','b','p422','xy4'); + +create index idx_t1_0 on t1 (a1); +create index idx_t1_1 on t1 (a1,a2,b,c); +create index idx_t1_2 on t1 (a1,a2,b); +analyze table t1; + +# t2 is the same as t1, but with some NULLs in the MIN/MAX column, and +# one more nullable attribute + +create table t2 ( + a1 char(64), a2 char(64) not null, b char(16), c char(16), d char(16), dummy char(64) default ' ' +); +insert into t2 select * from t1; +# add few rows with NULL's in the MIN/MAX column +insert into t2 (a1, a2, b, c, d) values +('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'), +('a','a','a',NULL,'xyz'), +('a','a','b',NULL,'xyz'), +('a','b','a',NULL,'xyz'), +('c','a',NULL,'c777','xyz'),('c','a',NULL,'c888','xyz'),('c','a',NULL,'c999','xyz'), +('d','b','b',NULL,'xyz'), +('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'), +('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'), +('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'), +('a','a','a',NULL,'xyz'), +('a','a','b',NULL,'xyz'), +('a','b','a',NULL,'xyz'), +('c','a',NULL,'c777','xyz'),('c','a',NULL,'c888','xyz'),('c','a',NULL,'c999','xyz'), +('d','b','b',NULL,'xyz'), +('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'),('e','a','a',NULL,'xyz'), +('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'),('e','a','b',NULL,'xyz'); + +create index idx_t2_0 on t2 (a1); +create index idx_t2_1 on t2 (a1,a2,b,c); +create index idx_t2_2 on t2 (a1,a2,b); +analyze table t2; + +# Table t3 is the same as t1, but with smaller column lenghts. +# This allows to test different branches of the cost computation procedure +# when the number of keys per block are less than the number of keys in the +# sub-groups formed by predicates over non-group attributes. + +create table t3 ( + a1 char(1), a2 char(1), b char(1), c char(4) not null, d char(3), dummy char(1) default ' ' +); + +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); +insert into t3 (a1, a2, b, c, d) values +('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'), +('a','a','b','e112','xy1'),('a','a','b','f112','xy2'),('a','a','b','g112','xy3'),('a','a','b','h112','xy4'), +('a','b','a','i121','xy1'),('a','b','a','j121','xy2'),('a','b','a','k121','xy3'),('a','b','a','l121','xy4'), +('a','b','b','m122','xy1'),('a','b','b','n122','xy2'),('a','b','b','o122','xy3'),('a','b','b','p122','xy4'), +('b','a','a','a211','xy1'),('b','a','a','b211','xy2'),('b','a','a','c211','xy3'),('b','a','a','d211','xy4'), +('b','a','b','e212','xy1'),('b','a','b','f212','xy2'),('b','a','b','g212','xy3'),('b','a','b','h212','xy4'), +('b','b','a','i221','xy1'),('b','b','a','j221','xy2'),('b','b','a','k221','xy3'),('b','b','a','l221','xy4'), +('b','b','b','m222','xy1'),('b','b','b','n222','xy2'),('b','b','b','o222','xy3'),('b','b','b','p222','xy4'), +('c','a','a','a311','xy1'),('c','a','a','b311','xy2'),('c','a','a','c311','xy3'),('c','a','a','d311','xy4'), +('c','a','b','e312','xy1'),('c','a','b','f312','xy2'),('c','a','b','g312','xy3'),('c','a','b','h312','xy4'), +('c','b','a','i321','xy1'),('c','b','a','j321','xy2'),('c','b','a','k321','xy3'),('c','b','a','l321','xy4'), +('c','b','b','m322','xy1'),('c','b','b','n322','xy2'),('c','b','b','o322','xy3'),('c','b','b','p322','xy4'); + +create index idx_t3_0 on t3 (a1); +create index idx_t3_1 on t3 (a1,a2,b,c); +create index idx_t3_2 on t3 (a1,a2,b); +analyze table t3; + + +explain select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 + where t2.c in (select c from t3 where t3.c > t1.b) and + t2.c > 'b1' ) +group by a1,a2,b; + +select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 + where t2.c in (select c from t3 where t3.c > t1.b) and + t2.c > 'b1' ) +group by a1,a2,b; + +explain select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 + where t2.c in (select c from t3 where t3.c > t1.c) and + t2.c > 'b1' ) +group by a1,a2,b; + +select a1,a2,b,c,min(c), max(c) from t1 +where exists ( select * from t2 + where t2.c in (select c from t3 where t3.c > t1.c) and + t2.c > 'b1' ) +group by a1,a2,b; + +drop table t1, t2, t3; + +# +# LP BUG#901835 - incorrect semi-join conversion after exists2in +# +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (7),(0); +CREATE TABLE t2 ( b INT ); +INSERT INTO t2 VALUES (0),(8); + +SELECT * FROM t1 WHERE + EXISTS ( SELECT * FROM t2 WHERE b = a ) + OR a > 0; + +explain extended +SELECT * FROM t1 WHERE + EXISTS ( SELECT * FROM t2 WHERE b = a ) + OR a > 0; + +drop tables t1,t2; + +# +# NOT EXISTS test +# +CREATE TABLE t1 ( a INT ); +INSERT INTO t1 VALUES (1),(5); +CREATE TABLE t2 ( b INT ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1); + +CREATE TABLE t3 ( c INT ); +INSERT INTO t3 VALUES (4),(5); + +SET optimizer_switch='exists_to_in=on,subquery_cache=off,materialization=on,in_to_exists=off,semijoin=off'; + +explain extended +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; + +SET optimizer_switch='exists_to_in=on,subquery_cache=off'; + + +explain extended +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; + +SET optimizer_switch='exists_to_in=off,subquery_cache=off'; + +explain extended +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; +SELECT ( SELECT b FROM t2 WHERE NOT EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; + +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +drop table t1,t2,t3; + +--echo # multi condition test +CREATE TABLE t1 ( a varchar(1), a1 varchar(1)) ; +INSERT INTO t1 VALUES ('c', 'c'), ('b', 'b'); + +CREATE TABLE t3 ( a int NOT NULL , b varchar(1), b1 varchar(1)) ; +INSERT INTO t3 VALUES (29,'c','c'); +INSERT INTO t3 VALUES (2,'c','c'); +alter table t1 add index aa (a,a1); +alter table t3 add index bb (b,b1); +--echo -- EXIST to IN then semijoin (has priority over IN to EXISTS) +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=on,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +--echo -- EXIST to IN then IN to EXISTS +set optimizer_switch='exists_to_in=on,in_to_exists=on,semijoin=off,materialization=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +--echo -- EXIST2IN then MATERIALIZATION +set optimizer_switch='exists_to_in=on,in_to_exists=off,semijoin=off,materialization=on,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +--echo -- NO EXIST2IN +set optimizer_switch='exists_to_in=off,subquery_cache=off'; +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +explain extended +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1); +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +drop table t1,t3; + +--echo # +--echo # MDEV-159 Assertion about not marked for read failed in +--echo # String* Field_varstring::val_str(String*, String*) +--echo # + +SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' ); +SET optimizer_switch='in_to_exists=on,exists_to_in=on'; + +CREATE TABLE t1 ( a VARCHAR(1) ); +INSERT INTO t1 VALUES ('k'),('m'); + +CREATE TABLE t2 ( b INT, + c VARCHAR(1), + d VARCHAR(1) NOT NULL ); + +INSERT INTO t2 VALUES + (4,'j','j'),(6,'v','v'); + +CREATE ALGORITHM=MERGE VIEW v AS SELECT * FROM t2 WHERE b < 1; + +SELECT c FROM v +WHERE EXISTS ( + SELECT * FROM t1, t2 + WHERE a <= v.d AND b = v.b +); + +explain extended +SELECT c FROM v +WHERE EXISTS ( + SELECT * FROM t1, t2 + WHERE a <= v.d AND b = v.b +); + +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; +drop view v; +drop table t1,t2; + + +--echo # +--echo # MDEV-160 Exists2In: Crash in in hp_movelink with subquery_cache=ON +--echo # + +SET optimizer_switch = 'in_to_exists=on,subquery_cache=on,exists_to_in=on'; + +CREATE TABLE t1 ( + a VARCHAR(3) NOT NULL, + b VARCHAR(50) +); +INSERT INTO t1 VALUES + ('USA','Chinese'),('USA','English'), + ('FRA','French'),('ITA','Italian'); + +CREATE TABLE t2 ( c VARCHAR(3) ); +INSERT INTO t2 VALUES ('USA'),('FRA'); + +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( + SELECT * FROM t1, t2 + WHERE a <= alias2.a AND c = alias1.b +) OR alias1 .a = 'foo'; + +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( + SELECT * FROM t1, t2 + WHERE a <= alias2.a AND c = alias1.a +) OR alias1 .a = 'foo'; + +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +--echo # +--echo # MDEV-160 Exists2In: Crash in in hp_movelink with subquery_cache=ON +--echo # +SET optimizer_switch = 'in_to_exists=on,subquery_cache=on,exists_to_in=on'; + +CREATE TABLE t1 ( + a VARCHAR(3) NOT NULL, + b VARCHAR(50) +); +INSERT INTO t1 VALUES + ('USA','Chinese'),('USA','English'), + ('FRA','French'),('ITA','Italian'); + +CREATE TABLE t2 ( c VARCHAR(3) ); +INSERT INTO t2 VALUES ('USA'),('FRA'); + +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( + SELECT * FROM t1, t2 + WHERE a <= alias2.a AND c = alias1.b +) OR alias1 .a = 'foo'; + +explain extended +SELECT * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( + SELECT * FROM t1, t2 + WHERE a <= alias2.a AND c = alias1.b +) OR alias1 .a = 'foo'; + +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +--echo # +--echo # MDEV-245 Exists2In: Wrong result (extra rows) with +--echo # exists_to_in=ON, materialization=OFF, NOT EXISTS subquery +--echo # +SET optimizer_switch='materialization=off,exists_to_in=on'; + +CREATE TABLE t1 ( a INT ) ; +INSERT INTO t1 VALUES (0),(8),(1); + +CREATE TABLE t2 ( b INT ) ; +INSERT INTO t2 VALUES (1),(2),(3); + +SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * FROM t2 WHERE b = a ); +explain extended +SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * FROM t2 WHERE b = a ); + +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +--echo # +--echo # MDEV-243 Wrong result (extra or missing rows) with +--echo # exists_to_in + materialization, EXISTS subquery +--echo # + +SET optimizer_switch='index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=on'; + +CREATE TABLE t1 ( a VARCHAR(1), b VARCHAR(1) ); +INSERT INTO t1 VALUES ('v','v'),('s','v'); + +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +explain extended +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); + +SET optimizer_switch = REPLACE( @@optimizer_switch, '=on', '=off' ); +SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=off'; +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +explain extended +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +SET optimizer_switch = 'exists_to_in=on,materialization=on,semijoin=on'; +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); +explain extended +SELECT * FROM t1 AS alias +WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b ); + +drop table t1; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +--echo # +--echo # MDEV-403 Wrong result (missing rows) with subquery in +--echo # EXISTS and an OR condition outside +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (2),(3); + +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (1),(3); +SET optimizer_switch = 'exists_to_in=off,in_to_exists=on'; +SELECT * FROM t1 AS alias1, t2 AS alias2 +WHERE EXISTS ( + SELECT 1 FROM t2 WHERE b = alias1.a AND b > alias2.b +) OR a = 5; + +SET optimizer_switch = 'exists_to_in=on,in_to_exists=on'; + +SELECT * FROM t1 AS alias1, t2 AS alias2 +WHERE EXISTS ( + SELECT 1 FROM t2 WHERE b = alias1.a AND b > alias2.b +) OR a = 5; + +explain extended +SELECT * FROM t1 AS alias1, t2 AS alias2 +WHERE EXISTS ( + SELECT 1 FROM t2 WHERE b = alias1.a AND b > alias2.b +) OR a = 5; + +drop table t1, t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +--echo # +--echo # MDEV-404: Wrong result (extra rows) with STRAIGHT_JOIN, +--echo # EXISTS subquery, NOT NULL column +--echo # (same as above) +--echo # +SET optimizer_switch = 'exists_to_in=on,in_to_exists=on'; + +CREATE TABLE t1 (a INT, b VARCHAR(1) NOT NULL); +INSERT INTO t1 VALUES (1,'s'),(2,'e'); + +SELECT STRAIGHT_JOIN * FROM t1 AS alias1, t1 AS alias2 +WHERE EXISTS ( SELECT 1 FROM t1 WHERE b < alias2.b AND a = alias1.a ); + +drop table t1; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + + +--echo # +--echo # MDEV-3800: ORDER BY doesn't work with exists_to_in=ON on +--echo # a query with EXISTS subquery and OR condition +--echo # +SET optimizer_switch = 'in_to_exists=on,exists_to_in=on'; +CREATE TABLE t1 (a INT, b VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4,'j'),(6,'v'),(3,'c'); + +CREATE TABLE t2 (c VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('b'),('y'); + +SELECT a FROM t1 +WHERE EXISTS ( + SELECT 1 FROM t2 WHERE c = b +) OR b NOT IN ('U') +ORDER BY a; + +select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`b` in (select `test`.`t2`.`c` from `test`.`t2` where 1 ) or (`test`.`t1`.`b` <> 'U') order by `test`.`t1`.`a`; + +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + + +--echo # +--echo # correct calculation of reserved items (postreview-fix) +--echo # +create table t1 (col1 int, col2 int, col3 int); +insert into t1 values (1,2,3),(2,3,4),(4,5,6); +create table t2 as select * from t1; +explain extended +select * from t1 where exists (select col2 from t2 where t2.col1=t1.col1 and t2.col2=t1.col2); +select * from t1 where exists (select col2 from t2 where t2.col1=t1.col1 and t2.col2=t1.col2); +drop table t1,t2; + +--echo # +--echo # MDEV-3879: Exists2In: Wrong result (extra row) and unexpected +--echo # warning with exists_to_in=on and a NOT EXISTS subquery +--echo # +SET optimizer_switch = 'exists_to_in=on'; + +CREATE TABLE t1 (a1 INT, b1 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (3,'y'),(6,'w'); + +CREATE TABLE t2 (a2 INT, b2 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3,'y'),(6,'d'); + +SELECT * FROM t1 +WHERE NOT EXISTS ( SELECT * FROM t2 WHERE b2 = b1 AND a2 = a1 ); + +drop table t1, t2; + +--echo # +--echo # MDEV-3880: Wrong result (missing rows) with exists_to_in=on, +--echo # LEFT JOIN and NOT EXISTS subquery. +--echo # (Duplicate of above MDEV-3879). +--echo # + +SET optimizer_switch = 'exists_to_in=on'; +CREATE TABLE t1 (a1 INT, b1 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4,'b'),(5,'y'); + +CREATE TABLE t2 (b2 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('z'),('b'); + +CREATE TABLE t3 (a3 INT, b3 CHAR(1)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (4,'j'),(6,'v'); + +SELECT * FROM t1 LEFT JOIN t2 ON ( b2 = b1 ) +WHERE NOT EXISTS ( SELECT * FROM t3 WHERE b3 = b2 AND a3 = a1 ) ; + +drop table t1, t2, t3; + + + +--echo # +--echo # MDEV-3881: Endless loop and crash in Item_ref::real_item with +--echo # exists_to_in=on, NOT EXISTS subquery, merge view or from subquery, +--echo # constant table +--echo # +SET optimizer_switch = 'exists_to_in=on'; + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(7); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (8); +CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t2; + +CREATE TABLE t3 (c INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (4),(6); + +SELECT * FROM t1, v1 WHERE NOT EXISTS ( SELECT * FROM t3 WHERE c = b ) AND a = b; + +drop view v1; +drop table t1, t2, t3; + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(7); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (8); + +CREATE TABLE t3 (c INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (4),(6); + +SELECT * FROM t1, ( SELECT * FROM t2 ) alias WHERE NOT EXISTS ( SELECT * FROM t3 WHERE c = b ) AND a = b; + +drop table t1, t2, t3; + +--echo # +--echo # MDEV-3906: Server crashes in Dependency_marker::visit_field +--echo # on 2nd execution of PS with exists_to_in and NOT EXISTS subquery +--echo # +SET optimizer_switch='exists_to_in=on'; + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(7); + +PREPARE stmt FROM ' +SELECT * FROM t1 AS alias +WHERE NOT EXISTS ( SELECT * FROM t1 WHERE t1.a = alias.a ) +'; + +EXECUTE stmt; +EXECUTE stmt; + +drop table t1; + +--echo # +--echo # MDEV-3904: Assertion `in_subs->has_strategy()' failed in +--echo # JOIN::choose_subquery_plan on 2nd execution of PS with +--echo # exists_to_in+semijoin, EXISTS subquery, MERGE view or FROM subquery +--echo # +SET optimizer_switch='in_to_exists=on,semijoin=on,exists_to_in=on'; + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (4),(6); + +CREATE ALGORITHM=MERGE VIEW v AS +SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t2 WHERE b = a ); + +PREPARE stmt FROM ' SELECT * FROM v '; + +EXECUTE stmt; +EXECUTE stmt; + +drop view v; +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +--echo # +--echo # MDEV-3903: Server crashes in Item_cond::fix_fields on 2nd execution +--echo # of a prepared stmt with exists_to_in+materialization+semijoin, +--echo # EXISTS subquery, STRAIGHT_JOIN +--echo # + +SET optimizer_switch='materialization=on,semijoin=on,exists_to_in=on'; + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3),(4); + +PREPARE stmt FROM +'SELECT STRAIGHT_JOIN * FROM t1 +WHERE EXISTS ( SELECT * FROM t2 WHERE b = a )'; + +EXECUTE stmt; +EXECUTE stmt; + +drop table t1,t2; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +--echo # +--echo # MDEV-4152: Wrong result (missing rows) with exists_to_in=on, +--echo # inner joins +--echo # +SET optimizer_switch='materialization=on,semijoin=on,exists_to_in=on'; + +CREATE TABLE t1 (i INT, c1 CHAR(5), c2 CHAR(5), t1_field VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,'test1','test2','f'), (2,'test3','test4','d'); + +CREATE TABLE t2 (t2_field VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('m'), ('b'); + +CREATE TABLE t3 (t3_field VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t3 VALUES ('b'),('c'); + +SELECT * FROM t1, t2 outer_t2 +WHERE EXISTS ( SELECT 1 FROM t2, t3 WHERE t3_field = outer_t2.t2_field AND t2_field <= t1_field ); + +drop table t1,t2,t3; +set optimizer_switch=default; +set optimizer_switch='exists_to_in=on'; + +#restore defaults +set optimizer_switch=default; diff --git a/mysql-test/t/subselect_exists2in_costmat.test b/mysql-test/t/subselect_exists2in_costmat.test new file mode 100644 index 00000000000..5d5eeaee268 --- /dev/null +++ b/mysql-test/t/subselect_exists2in_costmat.test @@ -0,0 +1,83 @@ +# +# Tests of cost-based choice between the materialization and in-to-exists +# subquery execution strategies (MWL#89) +# +# The test file is divided into two groups of tests: +# A. Typical cases when either of the two strategies is selected: +# 1. Subquery in disjunctive WHERE clause of the outer query. +# 2. NOT IN subqueries +# 3. Subqueries with GROUP BY, HAVING, and aggregate functions +# 4. Subqueries in the SELECT and HAVING clauses +# 5. Subqueries with UNION +# B. Reasonably exhaustive tests of the various combinations of optimizer +# switches, data distribution, available indexes, and typical queries. +# + +set @subselect_mat_cost=@@optimizer_switch; +set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; +# +# Test logging to slow log (there was some errors in the log files about +# the slow log when running under valgrind, so better to get this tested) +# +set long_query_time=0.1; + + +--disable_warnings +drop database if exists world; +--enable_warnings + +set names utf8; + +create database world; +use world; + +--source include/world_schema.inc +--disable_query_log +--disable_result_log +--disable_warnings +--source include/world.inc +--enable_warnings +--enable_result_log +--enable_query_log + +-- echo Make the schema and data more diverse by adding more indexes, nullable +-- echo columns, and NULL data. +create index SurfaceArea on Country(SurfaceArea); +create index Language on CountryLanguage(Language); +create index CityName on City(Name); +alter table City change population population int(11) null default 0; + +select max(id) from City into @max_city_id; +insert into City values (@max_city_id + 1,'Kilifarevo','BGR',NULL); + + +SELECT COUNT(*) FROM Country; +SELECT COUNT(*) FROM City; +SELECT COUNT(*) FROM CountryLanguage; + +set @@optimizer_switch = 'exists_to_in=on,in_to_exists=on,semijoin=on,materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on'; + +-- echo +-- echo 1. Subquery in a disjunctive WHERE clause of the outer query. +-- echo + +-- echo +-- echo Q1.1m: +-- echo MATERIALIZATION: there are too many rows in the outer query +-- echo to be looked up in the inner table. +EXPLAIN +SELECT Name FROM Country +WHERE (EXISTS (select 1 from City where City.Population > 100000 and +Code = Country) OR + Name LIKE 'L%') AND + surfacearea > 1000000; + +SELECT Name FROM Country +WHERE (EXISTS (select 1 from City where City.Population > 100000 and +Code = Country) OR + Name LIKE 'L%') AND + surfacearea > 1000000; + +drop database world; + +set optimizer_switch=@subselect_mat_cost; diff --git a/mysql-test/t/subselect_exists_to_in.test b/mysql-test/t/subselect_exists_to_in.test new file mode 100644 index 00000000000..1b97aa13955 --- /dev/null +++ b/mysql-test/t/subselect_exists_to_in.test @@ -0,0 +1,11 @@ +# +# Run subselect.test with exists to in transformation +# +select @@optimizer_switch like '%exists_to_in=on%'; +set optimizer_switch='exists_to_in=on'; + +--source t/subselect.test + +set optimizer_switch=default; +select @@optimizer_switch like '%exists_to_in=on%'; + diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index efbd2b00f24..e2abb8040b3 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2482,6 +2482,15 @@ deallocate prepare stmt; drop table t1,t2; --echo # +--echo # MDEV-4335: Unexpected results when selecting on information_schema +--echo # +CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL); +INSERT INTO t1 VALUES ('mysql'),('information_schema'); +SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA); +DROP TABLE t1; + + +--echo # --echo # MySQL Bug#13340270: assertion table->sort.record_pointers == __null --echo # diff --git a/mysql-test/t/subselect_sj2_mat.test b/mysql-test/t/subselect_sj2_mat.test index 7c3b37b517a..61d9b09edff 100644 --- a/mysql-test/t/subselect_sj2_mat.test +++ b/mysql-test/t/subselect_sj2_mat.test @@ -36,4 +36,230 @@ WHERE a IN DROP TABLE t1, t2; set max_join_size= @tmp_906385; +--echo # +--echo # mdev-3995: Wrong result for semijoin with materialization +--echo # + +set @save_optimizer_switch=@@optimizer_switch; + +CREATE TABLE t1 ( + cat_id int(10) unsigned NOT NULL, + PRIMARY KEY (cat_id) +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES +(709411),(709412),(709413),(709414),(709416),(709417),(709418),(709419),(709421),(709422), +(709424),(709425),(709427),(709428),(709429),(709431),(709432),(709433),(709434),(709435), +(709438),(709439),(709441),(709442),(709443),(709444),(709445),(709446),(709447),(709450), +(709451),(709454),(709455),(709456),(709457),(709459),(709460),(709461),(709462),(709463), +(709464),(709465),(709467),(709469),(709470),(709471),(709472),(709473),(709474),(709475), +(709476),(709477),(709478),(709479),(709480),(709481),(709483),(709484),(709485),(709487), +(709490),(709491),(709492),(709493),(709494),(709495),(709496),(709497),(709498),(709499), +(709500),(709501),(709502),(709503),(709504),(709505),(709506),(709507),(709509),(709510), +(709511),(709512),(709513),(709514),(709515),(709516),(709517),(709518),(709519),(709520), +(709521),(709522),(709523),(709524),(709525),(709526),(709527),(709528),(709529),(709530), +(709531),(709532),(709533),(709534),(709535),(709536),(709537),(709538),(709539),(709540), +(709541),(709542),(709543),(709544),(709545),(709546),(709548),(709549),(709551),(709552), +(709553),(709555),(709556),(709557),(709558),(709559),(709560),(709561),(709562),(709563), +(709564),(709565),(709566),(709567),(709568),(709569),(709570),(709571),(709572),(709573), +(709574),(709575),(709576),(709577),(709578),(709579),(709580),(709581),(709582),(709583), +(709584),(709585),(709586),(709587),(709588),(709590),(709591),(709592),(709593),(709594), +(709595),(709596),(709597),(709598),(709600),(709601),(709602),(709603),(709604),(709605), +(709606),(709608),(709609),(709610),(709611),(709612),(709613),(709614),(709615),(709616), +(709617),(709618),(709619),(709620),(709621),(709622),(709623),(709624),(709625),(709626), +(709627),(709628),(709629),(709630),(709631),(709632),(709633),(709634),(709635),(709637), +(709638),(709639),(709640),(709641),(709642),(709643),(709644),(709645),(709646),(709649), +(709650),(709651),(709652),(709653),(709654),(709655),(709656),(709657),(709658),(709659); + +CREATE TABLE t2 ( + cat_id int(10) NOT NULL, + KEY cat_id (cat_id) +) ENGINE=MyISAM; + +INSERT INTO t2 VALUES +(708742),(708755),(708759),(708761),(708766),(708769),(708796),(708798),(708824),(708825), +(708838),(708844),(708861),(708882),(708887),(708889),(708890),(709586),(709626); + +CREATE TABLE t3 ( + sack_id int(10) unsigned NOT NULL, + kit_id tinyint(3) unsigned NOT NULL DEFAULT '0', + cat_id int(10) unsigned NOT NULL, + PRIMARY KEY (sack_id,kit_id,cat_id) +) ENGINE=MyISAM; + +INSERT INTO t3 VALUES +(33479,6,708523),(33479,6,708632),(33479,6,709085),(33479,6,709586),(33479,6,709626); + +CREATE TABLE t4 ( + cat_id int(10) unsigned NOT NULL, + KEY cat_id (cat_id) +) ENGINE=MyISAM; + +INSERT INTO t4 (cat_id) SELECT cat_id from t2; + +set optimizer_switch='materialization=off'; + +EXPLAIN +SELECT count(*) FROM t1, t3 + WHERE t1.cat_id = t3.cat_id AND + t3.cat_id IN (SELECT cat_id FROM t2) AND + t3.sack_id = 33479 AND t3.kit_id = 6; + +SELECT count(*) FROM t1, t3 + WHERE t1.cat_id = t3.cat_id AND + t3.cat_id IN (SELECT cat_id FROM t2) AND + t3.sack_id = 33479 AND t3.kit_id = 6; + +set optimizer_switch='materialization=on'; + +EXPLAIN +SELECT count(*) FROM t1, t3 + WHERE t1.cat_id = t3.cat_id AND + t3.cat_id IN (SELECT cat_id FROM t4) AND + t3.sack_id = 33479 AND t3.kit_id = 6; + +SELECT count(*) FROM t1, t3 + WHERE t1.cat_id = t3.cat_id AND + t3.cat_id IN (SELECT cat_id FROM t4) AND + t3.sack_id = 33479 AND t3.kit_id = 6; + +EXPLAIN +SELECT count(*) FROM t1, t3 + WHERE t1.cat_id = t3.cat_id AND + t3.cat_id IN (SELECT cat_id FROM t2) AND + t3.sack_id = 33479 AND t3.kit_id = 6; + +SELECT count(*) FROM t1, t3 + WHERE t1.cat_id = t3.cat_id AND + t3.cat_id IN (SELECT cat_id FROM t2) AND + t3.sack_id = 33479 AND t3.kit_id = 6; + + +DROP TABLE t1,t2,t3,t4; + +set optimizer_switch=@save_optimizer_switch; + +--echo # +--echo # mdev-3913: LEFT JOIN with materialized multi-table IN subquery in WHERE +--echo # + +set @save_optimizer_switch=@@optimizer_switch; + +CREATE TABLE t1 (a1 char(1), b1 char(1), index idx(b1,a1)); +INSERT INTO t1 VALUES ('f','c'),('d','m'),('g','y'); +INSERT INTO t1 VALUES ('f','c'),('d','m'),('g','y'); + +CREATE TABLE t2 (a2 char(1), b2 char(1)); +INSERT INTO t2 VALUES ('y','y'),('y','y'),('w','w'); + +CREATE TABLE t3 (a3 int); +INSERT INTO t3 VALUES (8),(6); + +CREATE TABLE t4 (a4 char(1), b4 char(1)); +INSERT INTO t4 VALUES ('y','y'),('y','y'),('w','w'); + +set optimizer_switch='materialization=off'; + +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) + WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) + WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); + +set optimizer_switch='materialization=on'; + +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) + WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); +SELECT * FROM t1 LEFT JOIN t2 ON ( b1 = a2 ) + WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4); + +DROP TABLE t1,t2,t3,t4; + +set optimizer_switch=@save_optimizer_switch; + +--echo # +--echo # mdev-4172: LEFT JOIN with materialized multi-table IN subquery in WHERE +--echo # and OR in ON condition +--echo # + +set @save_optimizer_switch=@@optimizer_switch; + +CREATE TABLE t1 (a1 int, c1 varchar(1)); +INSERT t1 VALUES (7,'v'), (3,'y'); + +CREATE TABLE t2 (c2 varchar(1)); +INSERT INTO t2 VALUES ('y'), ('y'); + +CREATE TABLE t3 (c3 varchar(1)); +INSERT INTO t3 VALUES + ('j'), ('v'), ('c'), ('m'), ('d'), + ('d'), ('y'), ('t'), ('d'), ('s'); + +CREATE TABLE t4 (a4 int, c4 varchar(1)); +INSERT INTO t4 SELECT * FROM t1; + +set optimizer_switch='materialization=off'; + +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') + WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') + WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); + +set optimizer_switch='materialization=on'; + +EXPLAIN EXTENDED +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') + WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); +SELECT * FROM t1 LEFT JOIN t2 ON (c2 = c1 OR c1 > 'z') + WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4); + +DROP TABLE t1,t2,t3,t4; + +set optimizer_switch=@save_optimizer_switch; + +--echo # +--echo # mdev-4177: materialization of a subquery whose WHERE condition is OR +--echo # formula with two disjucts such that the second one is always false +--echo # + +set @save_optimizer_switch=@@optimizer_switch; +set @save_join_cache_level=@@join_cache_level; + +CREATE TABLE t1 (i1 int) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1), (7), (4), (8), (4); + +CREATE TABLE t2 (i2 int) ENGINE=MyISAM; +INSERT INTO t2 VALUES (7), (5); + +CREATE TABLE t3 (i3 int) ENGINE=MyISAM; +INSERT INTO t3 VALUES (7), (2), (9); + +set join_cache_level=3; + +set optimizer_switch='materialization=off,semijoin=off'; + +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); + +set optimizer_switch='materialization=on,semijoin=on'; + +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); +SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); + +EXPLAIN EXTENDED +SELECT * FROM t1 + WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2); +SELECT * FROM t1 + WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2); +SELECT * FROM t1 + WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 7 AND i3 = i2 OR 1=2); + +DROP TABLE t1,t2,t3; + +set join_cache_level= @save_join_cache_level; +set optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/t/sum_distinct-big.test b/mysql-test/t/sum_distinct-big.test index d3710056c9a..fee406ee46d 100644 --- a/mysql-test/t/sum_distinct-big.test +++ b/mysql-test/t/sum_distinct-big.test @@ -3,15 +3,23 @@ # --source include/big_test.inc +--source include/have_innodb.inc --disable_warnings DROP TABLE IF EXISTS t1, t2; --enable_warnings +set @save_tmp_table_size=@@tmp_table_size; +set @save_max_heap_table_size=@@max_heap_table_size; + +set @save_storage_engine=@@storage_engine; + # # Test the case when distinct values doesn't fit in memory and # filesort is used (see uniques.cc:merge_walk) # +set storage_engine=MYISAM; + CREATE TABLE t1 (id INTEGER); CREATE TABLE t2 (id INTEGER); @@ -82,3 +90,64 @@ SELECT SUM(DISTINCT id) sm FROM t2; DROP TABLE t1; DROP TABLE t2; + +SET @@tmp_table_size=@save_tmp_table_size; +SET @@max_heap_table_size=@save_max_heap_table_size; + +--echo # +--echo # Bug mdev-4311: COUNT(DISTINCT...) requiring a file for Unique +--echo # (bug #68749) +--echo # + +set @save_storage_engine=@@storage_engine; +set storage_engine=INNODB; + +CREATE TABLE t1 (id INTEGER) ENGINE=InnoDB; +CREATE TABLE t2 (id INTEGER) ENGINE=InnoDB; + +INSERT INTO t1 (id) VALUES (1), (1), (1),(1); +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 (id) SELECT id FROM t1; +INSERT INTO t1 SELECT id+1 FROM t1; +INSERT INTO t1 SELECT id+2 FROM t1; +INSERT INTO t1 SELECT id+4 FROM t1; +INSERT INTO t1 SELECT id+8 FROM t1; +INSERT INTO t1 SELECT id+16 FROM t1; +INSERT INTO t1 SELECT id+32 FROM t1; +INSERT INTO t1 SELECT id+64 FROM t1; +INSERT INTO t1 SELECT id+128 FROM t1; +INSERT INTO t1 SELECT id+256 FROM t1; +INSERT INTO t1 SELECT id+512 FROM t1; +INSERT INTO t1 SELECT id+1024 FROM t1; +INSERT INTO t1 SELECT id+2048 FROM t1; +INSERT INTO t1 SELECT id+4096 FROM t1; +INSERT INTO t1 SELECT id+8192 FROM t1; + +INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand(); +INSERT INTO t2 VALUE(NULL); + +--echo # With default tmp_table_size / max_heap_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; + +set @@tmp_table_size=1024*256; + +--echo # With reduced tmp_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; + +set @@tmp_table_size=@save_tmp_table_size; +SET @@max_heap_table_size=1024*256; + +--echo # With reduced max_heap_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; + +SET @@max_heap_table_size=@save_max_heap_table_size; + +--echo # Back to default tmp_table_size / max_heap_table_size +SELECT SQL_NO_CACHE count(DISTINCT id) sm FROM t2; + +DROP TABLE t1,t2; + +set storage_engine=@save_storage_engine; diff --git a/mysql-test/t/temporal_scale_4283.test b/mysql-test/t/temporal_scale_4283.test new file mode 100644 index 00000000000..d79ca7caa54 --- /dev/null +++ b/mysql-test/t/temporal_scale_4283.test @@ -0,0 +1,13 @@ +# +# MDEV-4283 Assertion `scale <= precision' fails in strings/decimal.c +# +create table t1 (a int); +insert into t1 values (4),(8); +select distinct 100 mod timestampadd( week, a, '2002-05-20' ) from t1; +drop table t1; + +create table t1 (i int); +insert into t1 values (2),(4); +select distinct convert_tz( '2001-03-21', 'utc', 'met' ) mod i from t1; +drop table t1; + diff --git a/mysql-test/t/truncate_badse.test b/mysql-test/t/truncate_badse.test new file mode 100644 index 00000000000..71545cab11a --- /dev/null +++ b/mysql-test/t/truncate_badse.test @@ -0,0 +1,15 @@ +# +# test what TRUNCATE TABLE does, if the table was created in +# now-unknown storage engine. +# +--source include/have_example_plugin.inc +install plugin example soname 'ha_example'; +create table t1 (a int) engine=example; +select 1; +uninstall plugin example; +flush tables; +select count(*) from information_schema.plugins where plugin_name='example'; +--error ER_UNKNOWN_STORAGE_ENGINE +truncate table t1; +drop table t1; + diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 989e0d29210..d1648254fb2 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -463,6 +463,16 @@ DROP TABLE t1; --echo End of 5.1 tests +# +# MDEV-4281 Assertion `maybe_null && item->null_value' fails in make_sortkey on CASE with different return types, GROUP_CONCAT, GROUP BY +# +create table t1 (d date, t time) engine=myisam; +insert into t1 values ('2000-12-03','22:55:23'),('2008-05-03','10:19:31'); +select case when d = '2012-12-12' then d else t end as cond, group_concat( d ) from t1 group by cond; +drop table t1; + +--echo End of 5.3 tests + --echo # --echo # Start of 5.5 tests --echo # diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index 2043342e2c8..5b0b70631a5 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -221,3 +221,18 @@ SELECT a FROM t1 WHERE a=0; DROP TABLE t1; --echo End of 5.1 tests + +--echo # +--echo # MDEV-4241: Assertion failure: scale >= 0 && precision > 0 && +--echo # scale <= precision in decimal_bin_size +--echo # +CREATE TABLE t1 ( + f1 enum('1','2','3','4','5') +) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +--enable_metadata +SELECT AVG(f1) FROM t1; +--disable_metadata +drop table t1; + +--echo End of 5.3 tests diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test index a8c875ef764..c6d01a16f49 100644 --- a/mysql-test/t/upgrade.test +++ b/mysql-test/t/upgrade.test @@ -33,18 +33,15 @@ drop database `mysqltest-1`; # # Bug#17142: Crash if create with encoded name # ---disable_warnings -drop table if exists `txu@0023p@0023p1`; -drop table if exists `txu#p#p1`; ---enable_warnings create table `txu#p#p1` (s1 int); insert into `txu#p#p1` values (1); --error 1146 select * from `txu@0023p@0023p1`; ---error ER_TABLE_EXISTS_ERROR create table `txu@0023p@0023p1` (s1 int); +show tables; select * from `txu#p#p1`; drop table `txu#p#p1`; +drop table `txu@0023p@0023p1`; --echo # --echo # Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1 diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index c6930a7e468..2c889c2cc0c 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -364,7 +364,7 @@ SELECT (@v:=a) <> (@v:=1) FROM t1; DROP TABLE t1; # -# LP BUG#1001506 Crash on a query with GROUP BY and user variables +# lp:1001506 Crash on a query with GROUP BY and user variables # MySQL Bug #11764372 57197: EVEN MORE USER VARIABLE CRASHING FUN # @@ -374,15 +374,49 @@ SELECT DISTINCT @a:=MIN(t1.a) FROM t1, t1 AS t2 GROUP BY @b:=(SELECT COUNT(*) > t2.a); DROP TABLE t1; +# +# +# Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT +# SAME USER VARIABLE = CRASH +# +SET @bug12408412=1; +SELECT GROUP_CONCAT(@bug12408412 ORDER BY 1) INTO @bug12408412; + --echo End of 5.1 tests # -# Bug#50511: Sometimes wrong handling of user variables containing NULL. +# MDEV-616 lp:1002126 +# Bug #11764371 57196: MORE FUN WITH ASSERTION: !TABLE->FILE || +# TABLE->FILE->INITED == HANDLER:: # ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0); +SELECT DISTINCT POW(COUNT(*), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a)) +AS b FROM t1 GROUP BY a; +SELECT @a; +DROP TABLE t1; +CREATE TABLE t1(f1 INT, f2 INT); +INSERT INTO t1 VALUES (1,2),(2,3),(3,1); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (1); +SET @var=NULL; +SELECT @var:=(SELECT f2 FROM t2 WHERE @var) FROM t1 GROUP BY f1 ORDER BY f2 DESC +LIMIT 1; +SELECT @var; +DROP TABLE t1, t2; + +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0),(1),(3); +SELECT DISTINCT POW(COUNT(distinct a), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a limit 1)) AS b FROM t1 GROUP BY a; +SELECT @a; +DROP TABLE t1; + +--echo End of 5.2 tests + +# +# Bug#50511: Sometimes wrong handling of user variables containing NULL. +# CREATE TABLE t1(f1 INT AUTO_INCREMENT, PRIMARY KEY(f1)); @@ -415,7 +449,6 @@ SELECT f1, f2 FROM t1 ORDER BY f2; DROP TRIGGER trg1; DROP TABLE t1; - --echo # --echo # Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT --echo # SAME USER VARIABLE = CRASH @@ -452,6 +485,8 @@ SELECT DISTINCT POW(COUNT(distinct a), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 SELECT @a; DROP TABLE t1; +--echo End of 5.5 tests + --echo # --echo # Check that used memory extends if we set a variable --echo # @@ -466,4 +501,3 @@ eval select $tmp < $tmp2; --enable_column_names --enable_query_log ---echo End of 5.5 tests diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 792859386e9..08e7e68c225 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1206,22 +1206,6 @@ SET GLOBAL server_id = -1; SELECT @@GLOBAL.server_id; SET GLOBAL server_id = @old_server_id; -# -# Bug #42778: delete order by null global variable causes -# assertion .\filesort.cc, line 797 -# - -SELECT @@GLOBAL.INIT_CONNECT, @@GLOBAL.INIT_CONNECT IS NULL; - -CREATE TABLE t1 (a INT); -INSERT INTO t1 VALUES (); -SET @bug42778= @@sql_safe_updates; -SET @@sql_safe_updates= 0; -DELETE FROM t1 ORDER BY (@@GLOBAL.INIT_CONNECT) ASC LIMIT 10; -SET @@sql_safe_updates= @bug42778; - -DROP TABLE t1; - --echo # --echo # BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB always rollsback --echo # |