diff options
Diffstat (limited to 'mysql-test')
125 files changed, 6386 insertions, 859 deletions
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index dc244d479e7..900ee14bd4e 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -18,7 +18,6 @@ ## Process this file with automake to create Makefile.in SUBDIRS = ndb -DIST_SUBDIRS=ndb benchdir_root= $(prefix) testdir = $(benchdir_root)/mysql-test diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc index 202c508a9c9..9ee0a40c8ce 100644 --- a/mysql-test/include/ctype_common.inc +++ b/mysql-test/include/ctype_common.inc @@ -51,6 +51,15 @@ SELECT c1 as want1result from t1 where c1 like 'locatio%'; SELECT c1 as want1result from t1 where c1 like 'location%'; DROP TABLE t1; +# +# Bug #31070: crash during conversion of charsets +# +create table t1 (a set('a') not null); +insert into t1 values (),(); +select cast(a as char(1)) from t1; +select a sounds like a from t1; +drop table t1; + DROP DATABASE d1; # Restore settings USE test; diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc index 437dd6ced4d..71647112126 100644 --- a/mysql-test/include/handler.inc +++ b/mysql-test/include/handler.inc @@ -498,3 +498,71 @@ handler t1_alias read a next; handler t1_alias READ a next where inexistent > 0; handler t1_alias close; drop table t1; + +# +# Bug#21587 FLUSH TABLES causes server crash when used with HANDLER statements +# + +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +create table t1 (c1 int); +create table t2 (c1 int); +insert into t1 values (1); +insert into t2 values (2); +--echo connection: default +handler t1 open; +handler t1 read first; +connect (flush,localhost,root,,); +connection flush; +--echo connection: flush +--send flush tables; +connection default; +--echo connection: default +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Flushing tables"; +--source include/wait_condition.inc +handler t2 open; +handler t2 read first; +handler t1 read next; +handler t1 close; +handler t2 close; +connection flush; +reap; +connection default; +drop table t1,t2; +disconnect flush; + +# +# Bug#31409 RENAME TABLE causes server crash or deadlock when used with HANDLER statements +# + +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +create table t1 (c1 int); +--echo connection: default +handler t1 open; +handler t1 read first; +connect (flush,localhost,root,,); +connection flush; +--echo connection: flush +--send rename table t1 to t2; +connection default; +--echo connection: default +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = "Waiting for table" and info = "rename table t1 to t2"; +--source include/wait_condition.inc +handler t2 open; +handler t2 read first; +--error ER_NO_SUCH_TABLE +handler t1 read next; +handler t1 close; +handler t2 close; +connection flush; +reap; +connection default; +drop table t2; +disconnect flush; diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index e2a22303d9d..2887a1ac40a 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -1019,6 +1019,15 @@ SELECT * FROM t1 ORDER BY b DESC, a ASC; DROP TABLE t1; +# +# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0 +# +create table t1(a char(10) not null, unique key aa(a(1)), + b char(4) not null, unique key bb(b(4))) engine=innodb; +desc t1; +show create table t1; +drop table t1; + --echo End of 5.0 tests # Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY @@ -1146,4 +1155,46 @@ select @b:=f2 from t1; select if(@a=@b,"ok","wrong"); drop table t1; +# +# Bug#30747 Create table with identical constraint names behaves incorrectly +# + +if ($test_foreign_keys) +{ + CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)) engine=innodb; + --error ER_WRONG_FK_DEF + CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), + CONSTRAINT c2 FOREIGN KEY f2 (c) REFERENCES t1 (a,b) ON UPDATE NO ACTION) engine=innodb; + --error ER_WRONG_FK_DEF + CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), + CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a,b) ON UPDATE NO ACTION) engine=innodb; + CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), + CONSTRAINT c1 FOREIGN KEY c2 (c) REFERENCES t1 (a) ON DELETE NO ACTION, + CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a) ON UPDATE NO ACTION) engine=innodb; + ALTER TABLE t2 DROP FOREIGN KEY c2; + DROP TABLE t2; + --error ER_WRONG_FK_DEF + CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), + FOREIGN KEY (c) REFERENCES t1 (a,k) ON UPDATE NO ACTION) engine=innodb; + --error ER_WRONG_FK_DEF + CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), + FOREIGN KEY f1 (c) REFERENCES t1 (a,k) ON UPDATE NO ACTION) engine=innodb; + CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), + CONSTRAINT c1 FOREIGN KEY f1 (c) REFERENCES t1 (a) ON DELETE NO ACTION, + CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a) ON UPDATE NO ACTION, + FOREIGN KEY f3 (c) REFERENCES t1 (a) ON UPDATE NO ACTION, + FOREIGN KEY (c) REFERENCES t1 (a) ON UPDATE NO ACTION) engine=innodb; + SHOW CREATE TABLE t2; + DROP TABLE t2; + DROP TABLE t1; +} + +# +# Bug #26447: "ALTER TABLE .. ORDER" does not work with InnoDB and +# auto_increment keys +# +create table t1 (a int auto_increment primary key) engine=innodb; +alter table t1 order by a; +drop table t1; + --echo End of 5.1 tests diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 9ba7d737b9e..d17a1c6f0dc 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -28,6 +28,24 @@ sub collect_one_test_case ($$$$$$$$$); sub mtr_options_from_test_file($$); +my $do_test; +my $skip_test; + +sub init_pattern { + my ($from, $what)= @_; + if ( $from =~ /^[a-z0-9]$/ ) { + # Does not contain any regex, make the pattern match + # beginning of string + $from= "^$from"; + } + # Check that pattern is a valid regex + eval { "" =~/$from/; 1 } or + mtr_error("Invalid regex '$from' passed to $what\nPerl says: $@"); + return $from; +} + + + ############################################################################## # # Collect information about test cases we are to run @@ -35,6 +53,9 @@ sub mtr_options_from_test_file($$); ############################################################################## sub collect_test_cases ($) { + $do_test= init_pattern($::opt_do_test, "--do-test"); + $skip_test= init_pattern($::opt_skip_test, "--skip-test"); + my $suites= shift; # Semicolon separated list of test suites my $cases = []; # Array of hash @@ -48,13 +69,14 @@ sub collect_test_cases ($) { { # Check that the tests specified was found # in at least one suite - foreach my $tname ( @::opt_cases ) + foreach my $test_name_spec ( @::opt_cases ) { my $found= 0; + my ($sname, $tname, $extension)= split_testname($test_name_spec); foreach my $test ( @$cases ) { - if ( $test->{'name'} eq $tname || - mtr_match_extension($test->{'name'}, $tname) ) + # test->{name} is always in suite.name format + if ( $test->{name} =~ /.*\.$tname/ ) { $found= 1; } @@ -144,6 +166,45 @@ sub collect_test_cases ($) { } +# Valid extensions and their corresonding component id +my %exts = ( 'test' => 'mysqld', + 'imtest' => 'im' + ); + + +# Returns (suitename, testname, extension) +sub split_testname { + my ($test_name)= @_; + + # Get rid of directory part and split name on .'s + my @parts= split(/\./, basename($test_name)); + + if (@parts == 1){ + # Only testname given, ex: alias + return (undef , $parts[0], undef); + } elsif (@parts == 2) { + # Either testname.test or suite.testname given + # Ex. main.alias or alias.test + + if (defined $exts{$parts[1]}) + { + return (undef , $parts[0], $parts[1]); + } + else + { + return ($parts[0], $parts[1], undef); + } + + } elsif (@parts == 3) { + # Fully specified suitename.testname.test + # ex main.alias.test + return ( $parts[0], $parts[1], $parts[2]); + } + + mtr_error("Illegal format of test name: $test_name"); +} + + sub collect_one_suite($$) { my $suite= shift; # Test suite name @@ -189,77 +250,55 @@ sub collect_one_suite($$) if ( @::opt_cases ) { - # Collect in specified order, no sort - foreach my $tname2 ( @::opt_cases ) + # Collect in specified order + foreach my $test_name_spec ( @::opt_cases ) { - my $tname= $tname2; # Don't modify @::opt_cases ! - my $elem= undef; - my $component_id= undef; + my ($sname, $tname, $extension)= split_testname($test_name_spec); - # Get rid of directory part (path). Leave the extension since it is used - # to understand type of the test. + # The test name parts have now been defined + #print " suite_name: $sname\n"; + #print " tname: $tname\n"; + #print " extension: $extension\n"; - $tname = basename($tname); + # Check cirrect suite if suitename is defined + next if (defined $sname and $suite ne $sname); - # Get rid of suite part - $tname =~ s/^(.*)\.//; - - # Check if the extenstion has been specified. - - if ( mtr_match_extension($tname, "test") ) - { - $elem= $tname; - $tname=~ s/\.test$//; - $component_id= 'mysqld'; - } - elsif ( mtr_match_extension($tname, "imtest") ) - { - $elem= $tname; - $tname =~ s/\.imtest$//; - $component_id= 'im'; - } - - # If target component is known, check that the specified test case - # exists. - # - # Otherwise, try to guess the target component. - - if ( $component_id ) + my $component_id; + if ( defined $extension ) { - if ( ! -f "$testdir/$elem") + my $full_name= "$testdir/$tname.$extension"; + # Extension was specified, check if the test exists + if ( ! -f $full_name) { - mtr_error("Test case $tname ($testdir/$elem) is not found"); + # This is only an error if suite was specified, otherwise it + # could exist in another suite + mtr_error("Test '$full_name' was not found in suite '$sname'") + if $sname; + + next; } + $component_id= $exts{$extension}; } else { - my $mysqld_test_exists = -f "$testdir/$tname.test"; - my $im_test_exists = -f "$testdir/$tname.imtest"; + # No extension was specified + my ($ext, $component); + while (($ext, $component)= each %exts) { + my $full_name= "$testdir/$tname.$ext"; - if ( $mysqld_test_exists and $im_test_exists ) - { - mtr_error("Ambiguous test case name ($tname)"); - } - elsif ( ! $mysqld_test_exists and ! $im_test_exists ) - { - # Silently skip, could exist in another suite - next; - } - elsif ( $mysqld_test_exists ) - { - $elem= "$tname.test"; - $component_id= 'mysqld'; - } - elsif ( $im_test_exists ) - { - $elem= "$tname.imtest"; - $component_id= 'im'; - } + if ( ! -f $full_name ) { + next; + } + $component_id= $component; + $extension= $ext; + } + # Test not found here, could exist in other suite + next unless $component_id; } collect_one_test_case($testdir,$resdir,$suite,$tname, - $elem,$cases,\%disabled,$component_id, - $suite_opts); + "$tname.$extension",$cases,\%disabled, + $component_id,$suite_opts); } } else @@ -285,8 +324,7 @@ sub collect_one_suite($$) } # Skip tests that does not match the --do-test= filter - next if $::opt_do_test and - ! defined mtr_match_prefix($elem,$::opt_do_test); + next if ($do_test and not $tname =~ /$do_test/o); collect_one_test_case($testdir,$resdir,$suite,$tname, $elem,$cases,\%disabled,$component_id, @@ -339,7 +377,7 @@ sub collect_one_test_case($$$$$$$$$) { # Skip some tests but include in list, just mark them to skip # ---------------------------------------------------------------------- - if ( $::opt_skip_test and defined mtr_match_prefix($tname,$::opt_skip_test) ) + if ( $skip_test and $tname =~ /$skip_test/o ) { $tinfo->{'skip'}= 1; return; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index dcd7d1ec842..7cd6c1362b3 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -196,7 +196,7 @@ sub mtr_report_stats ($) { "of what went wrong.\n", "If you want to report this error, please read first ", "the documentation at\n", - "http://www.mysql.com/doc/en/MySQL_test_suite.html\n"; + "http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n"; } if (!$::opt_extern) { diff --git a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh index ab511a932e6..ea8ce1b76d4 100644 --- a/mysql-test/mysql-test-run-shell.sh +++ b/mysql-test/mysql-test-run-shell.sh @@ -990,7 +990,7 @@ show_failed_diff () $DIFF -c $result_file $reject_file echo "-------------------------------------------------------" echo "Please follow the instructions outlined at" - echo "http://dev.mysql.com/doc/mysql/en/reporting-mysqltest-bugs.html" + echo "http://forge.mysql.com/wiki/MySQL_Internals_Porting#Debugging_a_MySQL_Server" echo "to find the reason to this problem and how to report this." echo "" fi diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7ad83087a5c..5cf00fb653c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -255,13 +255,13 @@ our $opt_timer= 1; our $opt_user; -our $opt_valgrind= 0; -our $opt_valgrind_mysqld= 0; -our $opt_valgrind_mysqltest= 0; -our $default_valgrind_options= "--show-reachable=yes"; -our $opt_valgrind_options; -our $opt_valgrind_path; -our $opt_callgrind; +my $opt_valgrind= 0; +my $opt_valgrind_mysqld= 0; +my $opt_valgrind_mysqltest= 0; +my @default_valgrind_args= ("--show-reachable=yes"); +my @valgrind_args; +my $opt_valgrind_path; +my $opt_callgrind; our $opt_stress= ""; our $opt_stress_suite= "main"; @@ -574,7 +574,18 @@ sub command_line_setup () { 'valgrind|valgrind-all' => \$opt_valgrind, 'valgrind-mysqltest' => \$opt_valgrind_mysqltest, 'valgrind-mysqld' => \$opt_valgrind_mysqld, - 'valgrind-options=s' => \$opt_valgrind_options, + 'valgrind-options=s' => sub { + my ($opt, $value)= @_; + # Deprecated option unless it's what we know pushbuild uses + if ($value eq "--gen-suppressions=all --show-reachable=yes") { + push(@valgrind_args, $_) for (split(' ', $value)); + return; + } + die("--valgrind-options=s is deprecated. Use ", + "--valgrind-option=s, to be specified several", + " times if necessary"); + }, + 'valgrind-option=s' => \@valgrind_args, 'valgrind-path=s' => \$opt_valgrind_path, 'callgrind' => \$opt_callgrind, @@ -977,7 +988,7 @@ sub command_line_setup () { # -------------------------------------------------------------------------- # Check valgrind arguments # -------------------------------------------------------------------------- - if ( $opt_valgrind or $opt_valgrind_path or defined $opt_valgrind_options) + if ( $opt_valgrind or $opt_valgrind_path or @valgrind_args) { mtr_report("Turning on valgrind for all executables"); $opt_valgrind= 1; @@ -1002,17 +1013,18 @@ sub command_line_setup () { $opt_valgrind_mysqld= 1; # Set special valgrind options unless options passed on command line - $opt_valgrind_options="--trace-children=yes" - unless defined $opt_valgrind_options; + push(@valgrind_args, "--trace-children=yes") + unless @valgrind_args; } if ( $opt_valgrind ) { # Set valgrind_options to default unless already defined - $opt_valgrind_options=$default_valgrind_options - unless defined $opt_valgrind_options; + push(@valgrind_args, @default_valgrind_args) + unless @valgrind_args; - mtr_report("Running valgrind with options \"$opt_valgrind_options\""); + mtr_report("Running valgrind with options \"", + join(" ", @valgrind_args), "\""); } if ( ! $opt_testcase_timeout ) @@ -1354,6 +1366,7 @@ sub datadir_list_setup () { sub collect_mysqld_features () { my $found_variable_list_start= 0; + my $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function # # Execute "mysqld --help --verbose" to get a list @@ -1364,7 +1377,7 @@ sub collect_mysqld_features () { # # --datadir must exist, mysqld will chdir into it # - my $list= `$exe_mysqld --no-defaults --datadir=$path_language --language=$path_language --skip-grant-tables --verbose --help`; + my $list= `$exe_mysqld --no-defaults --datadir=$tmpdir --language=$path_language --skip-grant-tables --verbose --help`; foreach my $line (split('\n', $list)) { @@ -1419,7 +1432,7 @@ sub collect_mysqld_features () { } } } - + rmtree($tmpdir); mtr_error("Could not find version of MySQL") unless $mysql_version_id; mtr_error("Could not find variabes list") unless $found_variable_list_start; @@ -3082,6 +3095,7 @@ sub install_db ($$) { mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql", $bootstrap_sql_file); + # Remove anonymous users mtr_tofile($bootstrap_sql_file, "DELETE FROM mysql.user where user= '';"); @@ -3747,6 +3761,16 @@ sub mysqld_arguments ($$$$) { # see BUG#28359 mtr_add_arg($args, "%s--connect-timeout=60", $prefix); + + # When mysqld is run by a root user(euid is 0), it will fail + # to start unless we specify what user to run as. If not running + # as root it will be ignored, see BUG#30630 + my $euid= $>; + if (!$glob_win32 and $euid == 0 and + grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) { + mtr_add_arg($args, "%s--user=root"); + } + if ( $opt_valgrind_mysqld ) { mtr_add_arg($args, "%s--skip-safemalloc", $prefix); @@ -5043,7 +5067,7 @@ sub valgrind_arguments { } # Add valgrind options, can be overriden by user - mtr_add_arg($args, '%s', $_) for (split(' ', $opt_valgrind_options)); + mtr_add_arg($args, '%s', $_) for (@valgrind_args); mtr_add_arg($args, $$exe); @@ -5116,14 +5140,18 @@ Options to control what test suites or cases to run skip-ndb[cluster] Skip all tests that need cluster skip-ndb[cluster]-slave Skip all tests that need a slave cluster ndb-extra Run extra tests from ndb directory - do-test=PREFIX Run test cases which name are prefixed with PREFIX + do-test=PREFIX or REGEX + Run test cases which name are prefixed with PREFIX + or fulfills REGEX + skip-test=PREFIX or REGEX + Skip test cases which name are prefixed with PREFIX + or fulfills REGEX start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated list of suite names. The default is: "$opt_suites" skip-rpl Skip the replication test cases. skip-im Don't start IM, and skip the IM test cases - skip-test=PREFIX Skip test cases which name are prefixed with PREFIX big-test Set the environment variable BIG_TEST, which can be checked from test cases. @@ -5181,12 +5209,14 @@ Options for coverage, profiling etc gcov FIXME gprof FIXME valgrind Run the "mysqltest" and "mysqld" executables using - valgrind with options($default_valgrind_options) + valgrind with default options valgrind-all Synonym for --valgrind valgrind-mysqltest Run the "mysqltest" and "mysql_client_test" executable with valgrind valgrind-mysqld Run the "mysqld" executable with valgrind - valgrind-options=ARGS Options to give valgrind, replaces default options + valgrind-options=ARGS Deprecated, use --valgrind-option + valgrind-option=ARGS Option to give valgrind, replaces default option(s), + can be specified more then once valgrind-path=[EXE] Path to the valgrind executable callgrind Instruct valgrind to use callgrind diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 9ee64ee6dbd..d408a0b6153 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2; +drop table if exists t1, t2; select CASE "b" when "a" then 1 when "b" then 2 END; CASE "b" when "a" then 1 when "b" then 2 END 2 @@ -200,3 +200,21 @@ CEMPNUM EMPMUM1 EMPNUM2 0.00 0 0.00 2.00 2 NULL DROP TABLE t1,t2; +End of 4.1 tests +create table t1 (a int, b bigint unsigned); +create table t2 (c int); +insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997), +(3,11120436154190595086); +insert into t2 (c) values (1), (2), (3); +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 +join t2 on t1.a=t2.c order by d; +a d +1 4572794622775114594 +3 11120436154190595086 +2 18196094287899841997 +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 +join t2 on t1.a=t2.c where b=11120436154190595086 order by d; +a d +3 11120436154190595086 +drop table t1, t2; +End of 5.0 tests diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result new file mode 100644 index 00000000000..cb409621d56 --- /dev/null +++ b/mysql-test/r/change_user.result @@ -0,0 +1,46 @@ +Bug#20023 +SELECT @@session.sql_big_selects; +@@session.sql_big_selects +1 +SELECT @@global.max_join_size; +@@global.max_join_size +-1 +change_user +SELECT @@session.sql_big_selects; +@@session.sql_big_selects +1 +SELECT @@global.max_join_size; +@@global.max_join_size +-1 +SET @@global.max_join_size = 10000; +SET @@session.max_join_size = default; +change_user +SELECT @@session.sql_big_selects; +@@session.sql_big_selects +0 +SET @@global.max_join_size = -1; +SET @@session.max_join_size = default; +change_user +SELECT @@session.sql_big_selects; +@@session.sql_big_selects +1 +Bug#31418 +SELECT IS_FREE_LOCK('bug31418'); +IS_FREE_LOCK('bug31418') +1 +SELECT IS_USED_LOCK('bug31418'); +IS_USED_LOCK('bug31418') +NULL +SELECT GET_LOCK('bug31418', 1); +GET_LOCK('bug31418', 1) +1 +SELECT IS_USED_LOCK('bug31418') = CONNECTION_ID(); +IS_USED_LOCK('bug31418') = CONNECTION_ID() +1 +change_user +SELECT IS_FREE_LOCK('bug31418'); +IS_FREE_LOCK('bug31418') +1 +SELECT IS_USED_LOCK('bug31418'); +IS_USED_LOCK('bug31418') +NULL diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index b370fbf6fbe..bead320751f 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -763,6 +763,44 @@ t2 CREATE TABLE `t2` ( drop table t1, t2; create table t1(a set("a,b","c,d") not null); ERROR 22007: Illegal set 'a,b' value found during parsing +create database mysqltest; +use mysqltest; +grant create on mysqltest.* to mysqltest@localhost; +create table t1 (i INT); +insert into t1 values (1); +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1' +create table t2 (i INT); +create table t4 (i INT); +grant select, insert on mysqltest.t2 to mysqltest@localhost; +grant insert on mysqltest.t4 to mysqltest@localhost; +grant create, insert on mysqltest.t5 to mysqltest@localhost; +grant create, insert on mysqltest.t6 to mysqltest@localhost; +flush privileges; +insert into t2 values (1); +create table if not exists t1 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1' +create table if not exists t3 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't3' +create table if not exists t4 select * from t2; +Warnings: +Note 1050 Table 't4' already exists +create table if not exists t5 select * from t2; +create table t6 select * from t2; +create table t7 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't7' +create table t4 select * from t2; +ERROR 42S01: Table 't4' already exists +create table t1 select * from t2; +ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1' +drop table t1,t2,t4,t5,t6; +revoke create on mysqltest.* from mysqltest@localhost; +revoke select, insert on mysqltest.t2 from mysqltest@localhost; +revoke insert on mysqltest.t4 from mysqltest@localhost; +revoke create, insert on mysqltest.t5 from mysqltest@localhost; +revoke create, insert on mysqltest.t6 from mysqltest@localhost; +flush privileges; +drop database mysqltest; +use test; create table t1 (i int) engine=myisam max_rows=100000000000; show create table t1; Table Create Table @@ -1588,14 +1626,6 @@ CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' -RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a; -ERROR 42000: Unknown database 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' -RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; -ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' -create database mysqltest; -RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; -ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' -drop database mysqltest; USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' SHOW CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; @@ -1699,4 +1729,18 @@ ERROR 42000: Identifier name 'очень_очень_очень_очень_оче drop view имÑ_вью_кодировке_утф8_длиной_больше_чем_42; drop table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; set names default; +drop table if exists t1,t2,t3; +drop function if exists f1; +create function f1() returns int +begin +declare res int; +create temporary table t3 select 1 i; +set res:= (select count(*) from t1); +drop temporary table t3; +return res; +end| +create table t1 as select 1; +create table t2 as select f1() from t1; +drop table t1,t2; +drop function f1; End of 5.1 tests diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 86ba5002af8..69f77dc3cd8 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -4929,7 +4929,7 @@ Note 1051 Unknown table 't2' Note 1051 Unknown table 't3' Note 1051 Unknown table 't4' DROP TABLE IF EXISTS bug13894; -CREATE TABLE bug13894 ( val integer ) ENGINE = CSV; +CREATE TABLE bug13894 ( val integer not null ) ENGINE = CSV; INSERT INTO bug13894 VALUES (5); INSERT INTO bug13894 VALUES (10); INSERT INTO bug13894 VALUES (11); @@ -4949,7 +4949,7 @@ val 11 DROP TABLE bug13894; DROP TABLE IF EXISTS bug14672; -CREATE TABLE bug14672 (c1 integer) engine = CSV; +CREATE TABLE bug14672 (c1 integer not null) engine = CSV; INSERT INTO bug14672 VALUES (1), (2), (3); SELECT * FROM bug14672; c1 @@ -4975,7 +4975,7 @@ c1 4 5 DROP TABLE bug14672; -CREATE TABLE test_concurrent_insert ( val integer ) ENGINE = CSV; +CREATE TABLE test_concurrent_insert ( val integer not null ) ENGINE = CSV; LOCK TABLES test_concurrent_insert READ LOCAL; INSERT INTO test_concurrent_insert VALUES (1); SELECT * FROM test_concurrent_insert; @@ -4992,7 +4992,7 @@ val 2 UNLOCK TABLES; DROP TABLE test_concurrent_insert; -CREATE TABLE test_repair_table ( val integer ) ENGINE = CSV; +CREATE TABLE test_repair_table ( val integer not null ) ENGINE = CSV; CHECK TABLE test_repair_table; Table Op Msg_type Msg_text test.test_repair_table check status OK @@ -5000,7 +5000,7 @@ REPAIR TABLE test_repair_table; Table Op Msg_type Msg_text test.test_repair_table repair status OK DROP TABLE test_repair_table; -CREATE TABLE test_repair_table2 ( val integer ) ENGINE = CSV; +CREATE TABLE test_repair_table2 ( val integer not null ) ENGINE = CSV; SELECT * from test_repair_table2; val Warnings: @@ -5011,7 +5011,7 @@ CHECK TABLE test_repair_table2; Table Op Msg_type Msg_text test.test_repair_table2 check status OK DROP TABLE test_repair_table2; -CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV; +CREATE TABLE test_repair_table3 ( val integer not null ) ENGINE = CSV; CHECK TABLE test_repair_table3; Table Op Msg_type Msg_text test.test_repair_table3 check error Corrupt @@ -5114,7 +5114,7 @@ num magic_no company_name founded 1 0102 CORRECT 1876 1 0102 CORRECT2 1876 DROP TABLE test_repair_table5; -create table t1 (a int) engine=csv; +create table t1 (a int not null) engine=csv; insert t1 values (1); delete from t1; affected rows: 1 @@ -5138,7 +5138,7 @@ insert t1 values (1),(2),(3),(4),(5); truncate table t1; affected rows: 0 drop table t1; -create table t1 (v varchar(32)); +create table t1 (v varchar(32) not null); insert into t1 values ('def'),('abc'),('hij'),('3r4f'); select * from t1; v @@ -5193,8 +5193,8 @@ select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn'); i v 4 3r4f drop table t1; -create table bug15205 (val int(11) default null) engine=csv; -create table bug15205_2 (val int(11) default null) engine=csv; +create table bug15205 (val int(11) not null) engine=csv; +create table bug15205_2 (val int(11) not null) engine=csv; select * from bug15205; ERROR HY000: Can't get stat of './test/bug15205.CSV' (Errcode: 2) select * from bug15205_2; @@ -5205,8 +5205,8 @@ drop table bug15205; drop table bug15205_2; set names latin1; create table t1 ( -c varchar(1), -name varchar(64) +c varchar(1) not null, +name varchar(64) not null ) character set latin1 engine=csv; insert into t1 values (0xC0,'LATIN CAPITAL LETTER A WITH GRAVE'); insert into t1 values (0xE0,'LATIN SMALL LETTER A WITH GRAVE'); @@ -5224,9 +5224,9 @@ FE þ LATIN SMALL LETTER THORN FF ÿ LATIN SMALL LETTER Y WITH DIAERESIS drop table t1; End of 5.0 tests -create table bug22080_1 (id int,string varchar(64)) Engine=CSV; -create table bug22080_2 (id int,string varchar(64)) Engine=CSV; -create table bug22080_3 (id int,string varchar(64)) Engine=CSV; +create table bug22080_1 (id int not null,string varchar(64) not null) Engine=CSV; +create table bug22080_2 (id int not null,string varchar(64) not null) Engine=CSV; +create table bug22080_3 (id int not null,string varchar(64) not null) Engine=CSV; insert into bug22080_1 values(1,'string'); insert into bug22080_1 values(2,'string'); insert into bug22080_1 values(3,'string'); @@ -5237,7 +5237,7 @@ check table bug22080_3; Table Op Msg_type Msg_text test.bug22080_3 check error Corrupt drop tables bug22080_1,bug22080_2,bug22080_3; -create table float_test (id float,string varchar(64)) Engine=CSV; +create table float_test (id float not null,string varchar(64) not null) Engine=CSV; insert into float_test values(1.0,'string'); insert into float_test values(2.23,'serg.g'); insert into float_test values(0.03,'string'); @@ -5254,14 +5254,14 @@ id string 9.67 string drop table float_test; CREATE TABLE `bug21328` ( -`col1` int(11) DEFAULT NULL, -`col2` int(11) DEFAULT NULL, -`col3` int(11) DEFAULT NULL +`col1` int(11) NOT NULL, +`col2` int(11) NOT NULL, +`col3` int(11) NOT NULL ) ENGINE=CSV; -insert into bug21328 values (1,NULL,NULL); +insert into bug21328 values (1,0,0); alter table bug21328 engine=myisam; drop table bug21328; -create table t1(a blob, b int) engine=csv; +create table t1(a blob not null, b int not null) engine=csv; insert into t1 values('a', 1); flush tables; update t1 set b=2; @@ -5269,7 +5269,7 @@ select * from t1; a b a 2 drop table t1; -create table t1(a int) engine=csv; +create table t1(a int not null) engine=csv; insert into t1 values(-1), (-123.34), (2), (-23); select * from t1; a @@ -5281,7 +5281,7 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; -create table t1(a int, b int) engine=csv; +create table t1(a int not null, b int not null) engine=csv; repair table t1; Table Op Msg_type Msg_text test.t1 repair Warning Data truncated for column 'a' at row 5 @@ -5299,7 +5299,7 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; -create table t1(a int) engine=csv; +create table t1(a int not null) engine=csv; insert into t1 values (0), (1), (2); delete from t1 limit 2; check table t1; @@ -5315,4 +5315,62 @@ test.t1 check status OK select * from t1; a drop table t1; +create table t1(a datetime not null) engine=csv; +insert into t1 values(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select * from t1; +a +0000-00-00 00:00:00 +drop table t1; +create table t1(a set('foo','bar') not null) engine=csv; +insert into t1 values(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select * from t1; +a + +drop table t1; +create table t1(a varchar(32) not null) engine=csv; +insert into t1 values(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select * from t1; +a + +drop table t1; +create table t1(a int not null) engine=csv; +insert into t1 values(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select * from t1; +a +0 +drop table t1; +create table t1(a blob not null) engine=csv; +insert into t1 values(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select * from t1; +a + +drop table t1; +create table t1(a bit(1) not null) engine=csv; +insert into t1 values(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select BIN(a) from t1; +BIN(a) +0 +drop table t1; +create table t1(a enum('foo','bar') default null) engine=csv; +ERROR HY000: Can't create table 'test.t1' (errno: -1) +create table t1(a enum('foo','bar') default 'foo') engine=csv; +ERROR HY000: Can't create table 'test.t1' (errno: -1) +create table t1(a enum('foo','bar') default 'foo' not null) engine=csv; +insert into t1 values(); +select * from t1; +a +foo +drop table t1; End of 5.1 tests diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 6d318a445f5..b190273cc64 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result index 6017bc07763..b9619370d4c 100644 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result index 314c336bab9..90c94c3b299 100644 --- a/mysql-test/r/ctype_gb2312.result +++ b/mysql-test/r/ctype_gb2312.result @@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result index 3f5d8b0d8c6..fe90c7bff29 100644 --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@ -52,6 +52,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 889702e380c..e676d5a5ca0 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2587,6 +2587,19 @@ SELECT c1 as want1result from t1 where c1 like 'location%'; want1result location DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +drop table t1; DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 1097486f185..06774125b30 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -811,6 +811,14 @@ quote(name) ???????? ???????????????? drop table bug20536; +set names ucs2; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' +set names ucs2 collate ucs2_bin; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' +set character_set_client= ucs2; +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' +set character_set_client= concat('ucs', substr('2', 1)); +ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' End of 4.1 tests CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index fb8dc9af71a..c520ab52ab3 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -255,3 +255,32 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); INSERT DELAYED INTO t2 VALUES(1); ERROR HY000: Table storage engine for 't2' doesn't have this option DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1,t2; +SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; +CREATE TABLE `t1` ( +`id` int(11) PRIMARY KEY auto_increment, +`f1` varchar(10) NOT NULL UNIQUE +); +INSERT DELAYED INTO t1 VALUES(0,"test1"); +SELECT * FROM t1; +id f1 +0 test1 +SET SQL_MODE='PIPES_AS_CONCAT'; +INSERT DELAYED INTO t1 VALUES(0,'a' || 'b'); +SELECT * FROM t1; +id f1 +0 test1 +1 ab +SET SQL_MODE='ERROR_FOR_DIVISION_BY_ZERO,STRICT_ALL_TABLES'; +INSERT DELAYED INTO t1 VALUES(mod(1,0),"test3"); +ERROR 22012: Division by 0 +CREATE TABLE t2 ( +`id` int(11) PRIMARY KEY auto_increment, +`f1` date +); +SET SQL_MODE='NO_ZERO_DATE,STRICT_ALL_TABLES,NO_ZERO_IN_DATE'; +INSERT DELAYED INTO t2 VALUES (0,'0000-00-00'); +ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1 +INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); +ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1 +DROP TABLE t1,t2; diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index b17c5e5409c..7ae7806baea 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -825,4 +825,46 @@ id group_concat(b.name) 1 óra,óra 2 óra,óra drop table t1; +create table t1(a bit not null); +insert into t1 values (), (), (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select group_concat(distinct a) from t1; +group_concat(distinct a) +0 +select group_concat(distinct a order by a) from t1; +group_concat(distinct a order by a) +0 +drop table t1; +create table t1(a bit(2) not null); +insert into t1 values (1), (0), (0), (3), (1); +select group_concat(distinct a) from t1; +group_concat(distinct a) +1,0,3 +select group_concat(distinct a order by a) from t1; +group_concat(distinct a order by a) +0,1,3 +select group_concat(distinct a order by a desc) from t1; +group_concat(distinct a order by a desc) +3,1,0 +drop table t1; +create table t1(a bit(2), b varchar(10), c bit); +insert into t1 values (1, 'a', 0), (0, 'b', 1), (0, 'c', 0), (3, 'd', 1), +(1, 'e', 1), (3, 'f', 1), (0, 'g', 1); +select group_concat(distinct a, c) from t1; +group_concat(distinct a, c) +10,01,00,31,11 +select group_concat(distinct a, c order by a) from t1; +group_concat(distinct a, c order by a) +00,01,11,10,31 +select group_concat(distinct a, c) from t1; +group_concat(distinct a, c) +10,01,00,31,11 +select group_concat(distinct a, c order by a, c) from t1; +group_concat(distinct a, c order by a, c) +00,01,10,11,31 +select group_concat(distinct a, c order by a desc, c desc) from t1; +group_concat(distinct a, c order by a desc, c desc) +31,11,10,01,00 +drop table t1; End of 5.0 tests diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 39bf1470afe..946a07d0eb2 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -190,6 +190,12 @@ ERROR 21000: Operand should contain 1 column(s) drop table table_26093; drop function func_26093_a; drop function func_26093_b; +create table t1 (a int not null); +insert into t1 values (-1), (-2); +select min(a) from t1 group by inet_ntoa(a); +min(a) +-2 +drop table t1; End of 5.0 tests select connection_id() > 0; connection_id() > 0 diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index b7dbfc670a8..5d7a564b187 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -93,6 +93,9 @@ makedate(9999,365) select makedate(9999,366); makedate(9999,366) NULL +select makedate(100,1); +makedate(100,1) +0100-01-01 select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002"); addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002") 1998-01-02 01:01:01.000001 diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 0d4dad39882..4e25ada43a0 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1210,6 +1210,9 @@ SELECT * FROM test.t1; f1 f2 1 1 2 2 +REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; +REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; +REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; DROP DATABASE db27878; use test; DROP TABLE t1; diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result index 6193c4fd49d..cc7f46855b2 100644 --- a/mysql-test/r/grant3.result +++ b/mysql-test/r/grant3.result @@ -16,3 +16,125 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; +grant select on test.* to CUser@localhost; +grant select on test.* to CUser@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; +user host db select_priv +CUser LOCALHOST test Y +CUser localhost test Y +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; +user host db select_priv +CUser localhost test Y +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; +user host db select_priv +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; +create table t1 (a int); +grant select on test.t1 to CUser@localhost; +grant select on test.t1 to CUser@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser LOCALHOST test t1 Select +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; +grant select(a) on test.t1 to CUser@localhost; +grant select(a) on test.t1 to CUser@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser LOCALHOST test t1 Select +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +CUser localhost test t1 Select +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +user host +CUser LOCALHOST +CUser localhost +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; +user host db Table_name Table_priv Column_priv +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; +drop table t1; +grant select on test.* to CUser2@localhost; +grant select on test.* to CUser2@LOCALHOST; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +user host +CUser2 LOCALHOST +CUser2 localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; +user host db select_priv +CUser2 LOCALHOST test Y +CUser2 localhost test Y +REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +user host +CUser2 LOCALHOST +CUser2 localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; +user host db select_priv +CUser2 localhost test Y +REVOKE SELECT ON test.* FROM 'CUser2'@'localhost'; +flush privileges; +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +user host +CUser2 LOCALHOST +CUser2 localhost +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; +user host db select_priv +DROP USER CUser2@localhost; +DROP USER CUser2@LOCALHOST; diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result index 98b8922bc5f..e9e5c7dbdd5 100644 --- a/mysql-test/r/handler_innodb.result +++ b/mysql-test/r/handler_innodb.result @@ -535,3 +535,43 @@ handler t1_alias READ a next where inexistent > 0; ERROR 42S22: Unknown column 'inexistent' in 'field list' handler t1_alias close; drop table t1; +drop table if exists t1,t2; +create table t1 (c1 int); +create table t2 (c1 int); +insert into t1 values (1); +insert into t2 values (2); +connection: default +handler t1 open; +handler t1 read first; +c1 +1 +connection: flush +flush tables;; +connection: default +handler t2 open; +handler t2 read first; +c1 +2 +handler t1 read next; +c1 +1 +handler t1 close; +handler t2 close; +drop table t1,t2; +drop table if exists t1,t2; +create table t1 (c1 int); +connection: default +handler t1 open; +handler t1 read first; +c1 +connection: flush +rename table t1 to t2;; +connection: default +handler t2 open; +handler t2 read first; +c1 +handler t1 read next; +ERROR 42S02: Table 'test.t1' doesn't exist +handler t1 close; +handler t2 close; +drop table t2; diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index 464b775b795..715e5ab03d6 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -535,3 +535,43 @@ handler t1_alias READ a next where inexistent > 0; ERROR 42S22: Unknown column 'inexistent' in 'field list' handler t1_alias close; drop table t1; +drop table if exists t1,t2; +create table t1 (c1 int); +create table t2 (c1 int); +insert into t1 values (1); +insert into t2 values (2); +connection: default +handler t1 open; +handler t1 read first; +c1 +1 +connection: flush +flush tables;; +connection: default +handler t2 open; +handler t2 read first; +c1 +2 +handler t1 read next; +c1 +1 +handler t1 close; +handler t2 close; +drop table t1,t2; +drop table if exists t1,t2; +create table t1 (c1 int); +connection: default +handler t1 open; +handler t1 read first; +c1 +connection: flush +rename table t1 to t2;; +connection: default +handler t2 open; +handler t2 read first; +c1 +handler t1 read next; +ERROR 42S02: Table 'test.t1' doesn't exist +handler t1 close; +handler t2 close; +drop table t2; diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result index ab4b892170a..9db03855c01 100644 --- a/mysql-test/r/heap_btree.result +++ b/mysql-test/r/heap_btree.result @@ -307,6 +307,13 @@ UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; +CREATE TABLE t1 (a INT, KEY USING BTREE(a)) ENGINE=MEMORY; +INSERT INTO t1 VALUES(1),(2),(2); +DELETE FROM t1 WHERE a=2; +SELECT * FROM t1; +a +1 +DROP TABLE t1; End of 4.1 tests CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory; INSERT INTO t1 VALUES(0); @@ -321,4 +328,12 @@ DROP TABLE t1; CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY; INSERT INTO t1 VALUES(NULL),(NULL); DROP TABLE t1; +create table t1(a varchar(255), b varchar(255), +key using btree (a,b)) engine=memory; +insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0); +select * from t1 where a is null; +a b +NULL NULL +NULL 1 +drop table t1; End of 5.0 tests diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 885acf5c744..d1120d24884 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -578,7 +578,7 @@ proc sql_data_access enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL proc is_deterministic enum('YES','NO') proc security_type enum('INVOKER','DEFINER') proc param_list blob -proc returns char(64) +proc returns longblob proc body longblob proc definer char(77) proc created timestamp diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index d0b67e90afb..086bd714078 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -962,7 +962,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL b 4 NULL # Using index explain select a,b from t1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL b 4 NULL # Using index +1 SIMPLE t1 index NULL PRIMARY 4 NULL # explain select a,b,c from t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # @@ -1177,14 +1177,14 @@ UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; SELECT * from t1; a b 1 1 -102 2 -103 3 4 4 5 5 6 6 7 7 8 8 9 9 +102 2 +103 3 drop table t1; CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; @@ -1208,7 +1208,6 @@ a b update t1,t2 set t1.a=t1.a+100 where t1.a=101; select * from t1; a b -201 1 102 2 103 3 104 4 @@ -1220,10 +1219,11 @@ a b 110 10 111 11 112 12 +201 1 update t1,t2 set t1.b=t1.b+10 where t1.b=2; select * from t1; a b -201 1 +102 12 103 3 104 4 105 5 @@ -1233,34 +1233,34 @@ a b 109 9 110 10 111 11 -102 12 112 12 +201 1 update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; select * from t1; a b -201 1 +102 12 103 5 104 6 -106 6 105 7 +106 6 107 7 108 8 109 9 110 10 111 11 -102 12 112 12 +201 1 select * from t2; a b 1 1 2 2 +3 13 +4 14 +5 15 6 6 7 7 8 8 9 9 -3 13 -4 14 -5 15 drop table t1,t2; CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; @@ -1311,11 +1311,11 @@ insert into t1 (id) values (null),(null),(null),(null),(null); update t1 set fk=69 where fk is null order by id limit 1; SELECT * from t1; id fk +1 69 2 NULL 3 NULL 4 NULL 5 NULL -1 69 drop table t1; create table t1 (a int not null, b int not null, key (a)); insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3); @@ -2444,8 +2444,8 @@ insert into t1 (b) values (1); replace into t1 (b) values (2), (1), (3); select * from t1; a b -3 1 2 2 +3 1 4 3 truncate table t1; insert into t1 (b) values (1); @@ -2454,8 +2454,8 @@ replace into t1 (b) values (1); replace into t1 (b) values (3); select * from t1; a b -3 1 2 2 +3 1 4 3 drop table t1; create table t1 (rowid int not null auto_increment, val int not null,primary diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 0757936a8f7..775151db9f0 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -352,13 +352,13 @@ EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index +1 SIMPLE t1 index PRIMARY,name PRIMARY 4 NULL 3 Using where 1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%' OR FALSE; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index +1 SIMPLE t2 index NULL PRIMARY 4 NULL 5 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where DROP TABLE t1,t2; CREATE TABLE t1 ( @@ -1260,11 +1260,11 @@ select_type SIMPLE table t1 type index possible_keys NULL -key b -key_len 5 +key PRIMARY +key_len 4 ref NULL rows 3 -Extra Using index; Using filesort +Extra Using filesort SELECT * FROM t1 ORDER BY b ASC, a DESC; a b 1 1 @@ -1276,17 +1276,32 @@ select_type SIMPLE table t1 type index possible_keys NULL -key b -key_len 5 +key PRIMARY +key_len 4 ref NULL rows 3 -Extra Using index; Using filesort +Extra Using filesort SELECT * FROM t1 ORDER BY b DESC, a ASC; a b 2 2 3 2 1 1 DROP TABLE t1; +create table t1(a char(10) not null, unique key aa(a(1)), +b char(4) not null, unique key bb(b(4))) engine=innodb; +desc t1; +Field Type Null Key Default Extra +a char(10) NO UNI NULL +b char(4) NO PRI NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) NOT NULL, + `b` char(4) NOT NULL, + UNIQUE KEY `bb` (`b`), + UNIQUE KEY `aa` (`a`(1)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; End of 5.0 tests CREATE TABLE `t2` ( `k` int(11) NOT NULL auto_increment, @@ -1419,4 +1434,45 @@ select if(@a=@b,"ok","wrong"); if(@a=@b,"ok","wrong") ok drop table t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)) engine=innodb; +CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), +CONSTRAINT c2 FOREIGN KEY f2 (c) REFERENCES t1 (a,b) ON UPDATE NO ACTION) engine=innodb; +ERROR 42000: Incorrect foreign key definition for 'f2': Key reference and table reference don't match +CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), +CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a,b) ON UPDATE NO ACTION) engine=innodb; +ERROR 42000: Incorrect foreign key definition for 'c2': Key reference and table reference don't match +CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), +CONSTRAINT c1 FOREIGN KEY c2 (c) REFERENCES t1 (a) ON DELETE NO ACTION, +CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a) ON UPDATE NO ACTION) engine=innodb; +ALTER TABLE t2 DROP FOREIGN KEY c2; +DROP TABLE t2; +CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), +FOREIGN KEY (c) REFERENCES t1 (a,k) ON UPDATE NO ACTION) engine=innodb; +ERROR 42000: Incorrect foreign key definition for 'foreign key without name': Key reference and table reference don't match +CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), +FOREIGN KEY f1 (c) REFERENCES t1 (a,k) ON UPDATE NO ACTION) engine=innodb; +ERROR 42000: Incorrect foreign key definition for 'f1': Key reference and table reference don't match +CREATE TABLE t2 (c INT NOT NULL, d INT NOT NULL, PRIMARY KEY (c,d), +CONSTRAINT c1 FOREIGN KEY f1 (c) REFERENCES t1 (a) ON DELETE NO ACTION, +CONSTRAINT c2 FOREIGN KEY (c) REFERENCES t1 (a) ON UPDATE NO ACTION, +FOREIGN KEY f3 (c) REFERENCES t1 (a) ON UPDATE NO ACTION, +FOREIGN KEY (c) REFERENCES t1 (a) ON UPDATE NO ACTION) engine=innodb; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `c` int(11) NOT NULL, + `d` int(11) NOT NULL, + PRIMARY KEY (`c`,`d`), + CONSTRAINT `c1` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON DELETE NO ACTION, + CONSTRAINT `c2` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION, + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION, + CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`c`) REFERENCES `t1` (`a`) ON UPDATE NO ACTION +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t2; +DROP TABLE t1; +create table t1 (a int auto_increment primary key) engine=innodb; +alter table t1 order by a; +Warnings: +Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1' +drop table t1; End of 5.1 tests diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 658093f9f8c..707cdb27768 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -619,4 +619,18 @@ CREATE TABLE t (a CHAR(10),b INT); INSERT INTO t VALUES (),(),(); INSERT INTO t(a) SELECT rand() FROM t; DROP TABLE t; +CREATE TABLE t1 (c1 INT NOT NULL); +INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500), +('4188.32999999999992724042385816574096679687500'), (4188); +SELECT * FROM t1; +c1 +4188 +4188 +4188 +CREATE TABLE t2 (c1 BIGINT); +INSERT INTO t2 VALUES('15449237462.0000000000'); +SELECT * FROM t2; +c1 +15449237462 +DROP TABLE t1, t2; End of 5.0 tests. diff --git a/mysql-test/r/join_outer_innodb.result b/mysql-test/r/join_outer_innodb.result index e8a2d6f668b..24a11b12b03 100644 --- a/mysql-test/r/join_outer_innodb.result +++ b/mysql-test/r/join_outer_innodb.result @@ -8,12 +8,12 @@ EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index +1 SIMPLE t1 index PRIMARY,name PRIMARY 4 NULL 3 Using where 1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index EXPLAIN SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id WHERE t1.name LIKE 'A%' OR FALSE; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index +1 SIMPLE t2 index NULL PRIMARY 4 NULL 5 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where DROP TABLE t1,t2; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index a2bed75a709..a3e63a0bdf4 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -530,3 +530,48 @@ ORDER BY c.b, c.d a b c d e f g h i j a b c d 2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL DROP TABLE t1, t2; +create table t1(a int not null, key aa(a), +b char(10) not null, unique key bb(b(1)), +c char(4) not null, unique key cc(c)); +desc t1; +Field Type Null Key Default Extra +a int(11) NO MUL NULL +b char(10) NO UNI NULL +c char(4) NO PRI NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` char(10) NOT NULL, + `c` char(4) NOT NULL, + UNIQUE KEY `cc` (`c`), + UNIQUE KEY `bb` (`b`(1)), + KEY `aa` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1(a int not null, key aa(a), +b char(10) not null, unique key bb(b(1)), +c char(4) not null); +desc t1; +Field Type Null Key Default Extra +a int(11) NO MUL NULL +b char(10) NO UNI NULL +c char(4) NO NULL +alter table t1 add unique key cc(c); +desc t1; +Field Type Null Key Default Extra +a int(11) NO MUL NULL +b char(10) NO UNI NULL +c char(4) NO PRI NULL +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` char(10) NOT NULL, + `c` char(4) NOT NULL, + UNIQUE KEY `cc` (`c`), + UNIQUE KEY `bb` (`b`(1)), + KEY `aa` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result index 3a3ef584ce3..407d93cf321 100644 --- a/mysql-test/r/log_state.result +++ b/mysql-test/r/log_state.result @@ -175,3 +175,16 @@ SET GLOBAL slow_query_log = ON; SET GLOBAL READ_ONLY = OFF; SET GLOBAL general_log = @old_general_log_state; SET GLOBAL slow_query_log = @old_slow_log_state; +set @old_general_log_file= @@global.general_log_file; +set @old_slow_query_log_file= @@global.slow_query_log_file; +set global general_log_file= concat('/not exiting path/log.maste', 'r'); +ERROR 42000: Variable 'general_log_file' can't be set to the value of '/not exiting path/log.master' +set global general_log_file= NULL; +ERROR 42000: Variable 'general_log_file' can't be set to the value of 'NULL' +set global slow_query_log_file= concat('/not exiting path/log.maste', 'r'); +ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of '/not exiting path/log.master' +set global slow_query_log_file= NULL; +ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'NULL' +set global general_log_file= @old_general_log_file; +set global slow_query_log_file= @old_slow_query_log_file; +End of 5.1 tests diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 5e18e1273c0..261e3292f4d 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -42,20 +42,20 @@ show create table mysql.general_log; Table Create Table general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `user_host` mediumtext, - `thread_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, - `command_type` varchar(64) DEFAULT NULL, - `argument` mediumtext + `user_host` mediumtext NOT NULL, + `thread_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' show fields from mysql.general_log; Field Type Null Key Default Extra event_time timestamp NO CURRENT_TIMESTAMP -user_host mediumtext YES NULL -thread_id int(11) YES NULL -server_id int(11) YES NULL -command_type varchar(64) YES NULL -argument mediumtext YES NULL +user_host mediumtext NO NULL +thread_id int(11) NO NULL +server_id int(11) NO NULL +command_type varchar(64) NO NULL +argument mediumtext NO NULL show create table mysql.slow_log; Table Create Table slow_log CREATE TABLE `slow_log` ( @@ -65,10 +65,10 @@ slow_log CREATE TABLE `slow_log` ( `lock_time` time NOT NULL, `rows_sent` int(11) NOT NULL, `rows_examined` int(11) NOT NULL, - `db` varchar(512) DEFAULT NULL, - `last_insert_id` int(11) DEFAULT NULL, - `insert_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' show fields from mysql.slow_log; @@ -79,10 +79,10 @@ query_time time NO NULL lock_time time NO NULL rows_sent int(11) NO NULL rows_examined int(11) NO NULL -db varchar(512) YES NULL -last_insert_id int(11) YES NULL -insert_id int(11) YES NULL -server_id int(11) YES NULL +db varchar(512) NO NULL +last_insert_id int(11) NO NULL +insert_id int(11) NO NULL +server_id int(11) NO NULL sql_text mediumtext NO NULL flush logs; flush tables; @@ -141,11 +141,11 @@ show create table mysql.general_log; Table Create Table general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `user_host` mediumtext, - `thread_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, - `command_type` varchar(64) DEFAULT NULL, - `argument` mediumtext + `user_host` mediumtext NOT NULL, + `thread_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' show create table mysql.slow_log; Table Create Table @@ -156,10 +156,10 @@ slow_log CREATE TABLE `slow_log` ( `lock_time` time NOT NULL, `rows_sent` int(11) NOT NULL, `rows_examined` int(11) NOT NULL, - `db` varchar(512) DEFAULT NULL, - `last_insert_id` int(11) DEFAULT NULL, - `insert_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' alter table mysql.general_log engine=myisam; @@ -168,11 +168,11 @@ show create table mysql.general_log; Table Create Table general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `user_host` mediumtext, - `thread_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, - `command_type` varchar(64) DEFAULT NULL, - `argument` mediumtext + `user_host` mediumtext NOT NULL, + `thread_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='General log' show create table mysql.slow_log; Table Create Table @@ -183,10 +183,10 @@ slow_log CREATE TABLE `slow_log` ( `lock_time` time NOT NULL, `rows_sent` int(11) NOT NULL, `rows_examined` int(11) NOT NULL, - `db` varchar(512) DEFAULT NULL, - `last_insert_id` int(11) DEFAULT NULL, - `insert_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Slow log' set global general_log='ON'; @@ -241,11 +241,11 @@ use mysql; CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -`user_host` mediumtext, -`thread_id` int(11) DEFAULT NULL, -`server_id` int(11) DEFAULT NULL, -`command_type` varchar(64) DEFAULT NULL, -`argument` mediumtext +`user_host` mediumtext NOT NULL, +`thread_id` int(11) NOT NULL, +`server_id` int(11) NOT NULL, +`command_type` varchar(64) NOT NULL, +`argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; CREATE TABLE `slow_log` ( `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP @@ -255,10 +255,10 @@ ON UPDATE CURRENT_TIMESTAMP, `lock_time` time NOT NULL, `rows_sent` int(11) NOT NULL, `rows_examined` int(11) NOT NULL, -`db` varchar(512) DEFAULT NULL, -`last_insert_id` int(11) DEFAULT NULL, -`insert_id` int(11) DEFAULT NULL, -`server_id` int(11) DEFAULT NULL, +`db` varchar(512) NOT NULL, +`last_insert_id` int(11) NOT NULL, +`insert_id` int(11) NOT NULL, +`server_id` int(11) NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; set global general_log='ON'; @@ -270,6 +270,10 @@ use mysql; lock tables general_log read local, help_category read local; ERROR HY000: You can't use locks with log tables. unlock tables; +drop table if exists mysql.renamed_general_log; +drop table if exists mysql.renamed_slow_log; +drop table if exists mysql.general_log_new; +drop table if exists mysql.slow_log_new; use mysql; RENAME TABLE general_log TO renamed_general_log; ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log' @@ -399,9 +403,9 @@ My own slow query sleep(2) My own slow query 0 SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3; start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text seq -START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test NULL NULL 1 SELECT "My own slow query", sleep(2) 2 -START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test NULL NULL 1 SELECT "My own slow query", sleep(2) 3 -START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test NULL NULL 1 SELECT "My own slow query", sleep(2) 4 +START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 2 +START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 +START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 4 SET GLOBAL slow_query_log = 0; SET SESSION long_query_time =@old_long_query_time; FLUSH LOGS; @@ -601,3 +605,218 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`; DROP DATABASE IF EXISTS `db_17876`; SET GLOBAL general_log = @old_general_log_state; SET GLOBAL slow_query_log = @old_slow_log_state; +truncate table mysql.general_log; +set @old_general_log_state = @@global.general_log; +set global general_log = on; +set @lparam = "000 001 002 003 004 005 006 007 008 009" + "010 011 012 013 014 015 016 017 018 019" + "020 021 022 023 024 025 026 027 028 029" + "030 031 032 033 034 035 036 037 038 039" + "040 041 042 043 044 045 046 047 048 049" + "050 051 052 053 054 055 056 057 058 059" + "060 061 062 063 064 065 066 067 068 069" + "070 071 072 073 074 075 076 077 078 079" + "080 081 082 083 084 085 086 087 088 089" + "090 091 092 093 094 095 096 097 098 099" + "100 101 102 103 104 105 106 107 108 109" + "110 111 112 113 114 115 116 117 118 119" + "120 121 122 123 124 125 126 127 128 129" + "130 131 132 133 134 135 136 137 138 139" + "140 141 142 143 144 145 146 147 148 149" + "150 151 152 153 154 155 156 157 158 159" + "160 161 162 163 164 165 166 167 168 169" + "170 171 172 173 174 175 176 177 178 179" + "180 181 182 183 184 185 186 187 188 189" + "190 191 192 193 194 195 196 197 198 199" + "200 201 202 203 204 205 206 207 208 209" + "210 211 212 213 214 215 216 217 218 219" + "220 221 222 223 224 225 226 227 228 229" + "230 231 232 233 234 235 236 237 238 239" + "240 241 242 243 244 245 246 247 248 249" + "250 251 252 253 254 255 256 257 258 259" + "260 261 262 263 264 265 266 267 268 269" + "270 271 272 273 274 275 276 277 278 279" + "280 281 282 283 284 285 286 287 288 289" + "290 291 292 293 294 295 296 297 298 299" + "300 301 302 303 304 305 306 307 308 309" + "310 311 312 313 314 315 316 317 318 319" + "320 321 322 323 324 325 326 327 328 329" + "330 331 332 333 334 335 336 337 338 339" + "340 341 342 343 344 345 346 347 348 349" + "350 351 352 353 354 355 356 357 358 359" + "360 361 362 363 364 365 366 367 368 369" + "370 371 372 373 374 375 376 377 378 379" + "380 381 382 383 384 385 386 387 388 389" + "390 391 392 393 394 395 396 397 398 399" + "400 401 402 403 404 405 406 407 408 409" + "410 411 412 413 414 415 416 417 418 419" + "420 421 422 423 424 425 426 427 428 429" + "430 431 432 433 434 435 436 437 438 439" + "440 441 442 443 444 445 446 447 448 449" + "450 451 452 453 454 455 456 457 458 459" + "460 461 462 463 464 465 466 467 468 469" + "470 471 472 473 474 475 476 477 478 479" + "480 481 482 483 484 485 486 487 488 489" + "490 491 492 493 494 495 496 497 498 499" + "500 501 502 503 504 505 506 507 508 509" + "510 511 512 513 514 515 516 517 518 519" + "520 521 522 523 524 525 526 527 528 529" + "530 531 532 533 534 535 536 537 538 539" + "540 541 542 543 544 545 546 547 548 549" + "550 551 552 553 554 555 556 557 558 559" + "560 561 562 563 564 565 566 567 568 569" + "570 571 572 573 574 575 576 577 578 579" + "580 581 582 583 584 585 586 587 588 589" + "590 591 592 593 594 595 596 597 598 599" + "600 601 602 603 604 605 606 607 608 609" + "610 611 612 613 614 615 616 617 618 619" + "620 621 622 623 624 625 626 627 628 629" + "630 631 632 633 634 635 636 637 638 639" + "640 641 642 643 644 645 646 647 648 649" + "650 651 652 653 654 655 656 657 658 659" + "660 661 662 663 664 665 666 667 668 669" + "670 671 672 673 674 675 676 677 678 679" + "680 681 682 683 684 685 686 687 688 689" + "690 691 692 693 694 695 696 697 698 699" + "700 701 702 703 704 705 706 707 708 709" + "710 711 712 713 714 715 716 717 718 719" + "720 721 722 723 724 725 726 727 728 729" + "730 731 732 733 734 735 736 737 738 739" + "740 741 742 743 744 745 746 747 748 749" + "750 751 752 753 754 755 756 757 758 759" + "760 761 762 763 764 765 766 767 768 769" + "770 771 772 773 774 775 776 777 778 779" + "780 781 782 783 784 785 786 787 788 789" + "790 791 792 793 794 795 796 797 798 799" + "800 801 802 803 804 805 806 807 808 809" + "810 811 812 813 814 815 816 817 818 819" + "820 821 822 823 824 825 826 827 828 829" + "830 831 832 833 834 835 836 837 838 839" + "840 841 842 843 844 845 846 847 848 849" + "850 851 852 853 854 855 856 857 858 859" + "860 861 862 863 864 865 866 867 868 869" + "870 871 872 873 874 875 876 877 878 879" + "880 881 882 883 884 885 886 887 888 889" + "890 891 892 893 894 895 896 897 898 899" + "900 901 902 903 904 905 906 907 908 909" + "910 911 912 913 914 915 916 917 918 919" + "920 921 922 923 924 925 926 927 928 929" + "930 931 932 933 934 935 936 937 938 939" + "940 941 942 943 944 945 946 947 948 949" + "950 951 952 953 954 955 956 957 958 959" + "960 961 962 963 964 965 966 967 968 969" + "970 971 972 973 974 975 976 977 978 979" + "980 981 982 983 984 985 986 987 988 989" + "990 991 992 993 994 995 996 997 998 999"; +prepare long_query from "select ? as long_query"; +execute long_query using @lparam; +set global general_log = off; +select command_type, argument from mysql.general_log; +command_type argument +Query set @lparam = "000 001 002 003 004 005 006 007 008 009" + "010 011 012 013 014 015 016 017 018 019" + "020 021 022 023 024 025 026 027 028 029" + "030 031 032 033 034 035 036 037 038 039" + "040 041 042 043 044 045 046 047 048 049" + "050 051 052 053 054 055 056 057 058 059" + "060 061 062 063 064 065 066 067 068 069" + "070 071 072 073 074 075 076 077 078 079" + "080 081 082 083 084 085 086 087 088 089" + "090 091 092 093 094 095 096 097 098 099" + "100 101 102 103 104 105 106 107 108 109" + "110 111 112 113 114 115 116 117 118 119" + "120 121 122 123 124 125 126 127 128 129" + "130 131 132 133 134 135 136 137 138 139" + "140 141 142 143 144 145 146 147 148 149" + "150 151 152 153 154 155 156 157 158 159" + "160 161 162 163 164 165 166 167 168 169" + "170 171 172 173 174 175 176 177 178 179" + "180 181 182 183 184 185 186 187 188 189" + "190 191 192 193 194 195 196 197 198 199" + "200 201 202 203 204 205 206 207 208 209" + "210 211 212 213 214 215 216 217 218 219" + "220 221 222 223 224 225 226 227 228 229" + "230 231 232 233 234 235 236 237 238 239" + "240 241 242 243 244 245 246 247 248 249" + "250 251 252 253 254 255 256 257 258 259" + "260 261 262 263 264 265 266 267 268 269" + "270 271 272 273 274 275 276 277 278 279" + "280 281 282 283 284 285 286 287 288 289" + "290 291 292 293 294 295 296 297 298 299" + "300 301 302 303 304 305 306 307 308 309" + "310 311 312 313 314 315 316 317 318 319" + "320 321 322 323 324 325 326 327 328 329" + "330 331 332 333 334 335 336 337 338 339" + "340 341 342 343 344 345 346 347 348 349" + "350 351 352 353 354 355 356 357 358 359" + "360 361 362 363 364 365 366 367 368 369" + "370 371 372 373 374 375 376 377 378 379" + "380 381 382 383 384 385 386 387 388 389" + "390 391 392 393 394 395 396 397 398 399" + "400 401 402 403 404 405 406 407 408 409" + "410 411 412 413 414 415 416 417 418 419" + "420 421 422 423 424 425 426 427 428 429" + "430 431 432 433 434 435 436 437 438 439" + "440 441 442 443 444 445 446 447 448 449" + "450 451 452 453 454 455 456 457 458 459" + "460 461 462 463 464 465 466 467 468 469" + "470 471 472 473 474 475 476 477 478 479" + "480 481 482 483 484 485 486 487 488 489" + "490 491 492 493 494 495 496 497 498 499" + "500 501 502 503 504 505 506 507 508 509" + "510 511 512 513 514 515 516 517 518 519" + "520 521 522 523 524 525 526 527 528 529" + "530 531 532 533 534 535 536 537 538 539" + "540 541 542 543 544 545 546 547 548 549" + "550 551 552 553 554 555 556 557 558 559" + "560 561 562 563 564 565 566 567 568 569" + "570 571 572 573 574 575 576 577 578 579" + "580 581 582 583 584 585 586 587 588 589" + "590 591 592 593 594 595 596 597 598 599" + "600 601 602 603 604 605 606 607 608 609" + "610 611 612 613 614 615 616 617 618 619" + "620 621 622 623 624 625 626 627 628 629" + "630 631 632 633 634 635 636 637 638 639" + "640 641 642 643 644 645 646 647 648 649" + "650 651 652 653 654 655 656 657 658 659" + "660 661 662 663 664 665 666 667 668 669" + "670 671 672 673 674 675 676 677 678 679" + "680 681 682 683 684 685 686 687 688 689" + "690 691 692 693 694 695 696 697 698 699" + "700 701 702 703 704 705 706 707 708 709" + "710 711 712 713 714 715 716 717 718 719" + "720 721 722 723 724 725 726 727 728 729" + "730 731 732 733 734 735 736 737 738 739" + "740 741 742 743 744 745 746 747 748 749" + "750 751 752 753 754 755 756 757 758 759" + "760 761 762 763 764 765 766 767 768 769" + "770 771 772 773 774 775 776 777 778 779" + "780 781 782 783 784 785 786 787 788 789" + "790 791 792 793 794 795 796 797 798 799" + "800 801 802 803 804 805 806 807 808 809" + "810 811 812 813 814 815 816 817 818 819" + "820 821 822 823 824 825 826 827 828 829" + "830 831 832 833 834 835 836 837 838 839" + "840 841 842 843 844 845 846 847 848 849" + "850 851 852 853 854 855 856 857 858 859" + "860 861 862 863 864 865 866 867 868 869" + "870 871 872 873 874 875 876 877 878 879" + "880 881 882 883 884 885 886 887 888 889" + "890 891 892 893 894 895 896 897 898 899" + "900 901 902 903 904 905 906 907 908 909" + "910 911 912 913 914 915 916 917 918 919" + "920 921 922 923 924 925 926 927 928 929" + "930 931 932 933 934 935 936 937 938 939" + "940 941 942 943 944 945 946 947 948 949" + "950 951 952 953 954 955 956 957 958 959" + "960 961 962 963 964 965 966 967 968 969" + "970 971 972 973 974 975 976 977 978 979" + "980 981 982 983 984 985 986 987 988 989" + "990 991 992 993 994 995 996 997 998 999" +Query prepare long_query from "select ? as long_query" +Prepare select ? as long_query +Query execute long_query using @lparam +Execute select '000 001 002 003 004 005 006 007 008 009010 011 012 013 014 015 016 017 018 019020 021 022 023 024 025 026 027 028 029030 031 032 033 034 035 036 037 038 039040 041 042 043 044 045 046 047 048 049050 051 052 053 054 055 056 057 058 059060 061 062 063 064 065 066 067 068 069070 071 072 073 074 075 076 077 078 079080 081 082 083 084 085 086 087 088 089090 091 092 093 094 095 096 097 098 099100 101 102 103 104 105 106 107 108 109110 111 112 113 114 115 116 117 118 119120 121 122 123 124 125 126 127 128 129130 131 132 133 134 135 136 137 138 139140 141 142 143 144 145 146 147 148 149150 151 152 153 154 155 156 157 158 159160 161 162 163 164 165 166 167 168 169170 171 172 173 174 175 176 177 178 179180 181 182 183 184 185 186 187 188 189190 191 192 193 194 195 196 197 198 199200 201 202 203 204 205 206 207 208 209210 211 212 213 214 215 216 217 218 219220 221 222 223 224 225 226 227 228 229230 231 232 233 234 235 236 237 238 239240 241 242 243 244 245 246 247 248 249250 251 252 253 254 255 256 257 258 259260 261 262 263 264 265 266 267 268 269270 271 272 273 274 275 276 277 278 279280 281 282 283 284 285 286 287 288 289290 291 292 293 294 295 296 297 298 299300 301 302 303 304 305 306 307 308 309310 311 312 313 314 315 316 317 318 319320 321 322 323 324 325 326 327 328 329330 331 332 333 334 335 336 337 338 339340 341 342 343 344 345 346 347 348 349350 351 352 353 354 355 356 357 358 359360 361 362 363 364 365 366 367 368 369370 371 372 373 374 375 376 377 378 379380 381 382 383 384 385 386 387 388 389390 391 392 393 394 395 396 397 398 399400 401 402 403 404 405 406 407 408 409410 411 412 413 414 415 416 417 418 419420 421 422 423 424 425 426 427 428 429430 431 432 433 434 435 436 437 438 439440 441 442 443 444 445 446 447 448 449450 451 452 453 454 455 456 457 458 459460 461 462 463 464 465 466 467 468 469470 471 472 473 474 475 476 477 478 479480 481 482 483 484 485 486 487 488 489490 491 492 493 494 495 496 497 498 499500 501 502 503 504 505 506 507 508 509510 511 512 513 514 515 516 517 518 519520 521 522 523 524 525 526 527 528 529530 531 532 533 534 535 536 537 538 539540 541 542 543 544 545 546 547 548 549550 551 552 553 554 555 556 557 558 559560 561 562 563 564 565 566 567 568 569570 571 572 573 574 575 576 577 578 579580 581 582 583 584 585 586 587 588 589590 591 592 593 594 595 596 597 598 599600 601 602 603 604 605 606 607 608 609610 611 612 613 614 615 616 617 618 619620 621 622 623 624 625 626 627 628 629630 631 632 633 634 635 636 637 638 639640 641 642 643 644 645 646 647 648 649650 651 652 653 654 655 656 657 658 659660 661 662 663 664 665 666 667 668 669670 671 672 673 674 675 676 677 678 679680 681 682 683 684 685 686 687 688 689690 691 692 693 694 695 696 697 698 699700 701 702 703 704 705 706 707 708 709710 711 712 713 714 715 716 717 718 719720 721 722 723 724 725 726 727 728 729730 731 732 733 734 735 736 737 738 739740 741 742 743 744 745 746 747 748 749750 751 752 753 754 755 756 757 758 759760 761 762 763 764 765 766 767 768 769770 771 772 773 774 775 776 777 778 779780 781 782 783 784 785 786 787 788 789790 791 792 793 794 795 796 797 798 799800 801 802 803 804 805 806 807 808 809810 811 812 813 814 815 816 817 818 819820 821 822 823 824 825 826 827 828 829830 831 832 833 834 835 836 837 838 839840 841 842 843 844 845 846 847 848 849850 851 852 853 854 855 856 857 858 859860 861 862 863 864 865 866 867 868 869870 871 872 873 874 875 876 877 878 879880 881 882 883 884 885 886 887 888 889890 891 892 893 894 895 896 897 898 899900 901 902 903 904 905 906 907 908 909910 911 912 913 914 915 916 917 918 919920 921 922 923 924 925 926 927 928 929930 931 932 933 934 935 936 937 938 939940 941 942 943 944 945 946 947 948 949950 951 952 953 954 955 956 957 958 959960 961 962 963 964 965 966 967 968 969970 971 972 973 974 975 976 977 978 979980 981 982 983 984 985 986 987 988 989990 991 992 993 994 995 996 997 998 999' as long_query +Query set global general_log = off +deallocate prepare long_query; +set global general_log = @old_general_log_state; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 5aa4288500c..d6e19107ec4 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -879,4 +879,9 @@ CHECK TABLE tm1; Table Op Msg_type Msg_text test.tm1 check status OK DROP TABLE tm1, t1, t2; +CREATE TABLE t1(c1 INT); +CREATE TABLE t2 (c1 INT) ENGINE=MERGE UNION=(t1) INSERT_METHOD=FIRST; +CREATE TABLE IF NOT EXISTS t1 SELECT * FROM t2; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +DROP TABLE t1, t2; End of 5.0 tests diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index b8ada0adff9..047b2662b1b 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, `t``1`, `t 1`; drop view if exists v1; drop database if exists client_test_db; mysql.columns_priv OK @@ -57,4 +57,27 @@ test.t1 OK test.t1 OK drop view v1; drop table t1; +create table `t``1`(a int); +create table `t 1`(a int); +test.t 1 OK +test.t`1 OK +drop table `t``1`, `t 1`; End of 5.0 tests +create table t1(a int); +create view v1 as select * from t1; +show tables; +Tables_in_test +t1 +v1 +show tables; +Tables_in_test +t1 +#mysql50#v-1 +v1 +show tables; +Tables_in_test +t1 +v1 +v-1 +drop view v1, `v-1`; +drop table t1; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index d03e21b1bb0..a7df1a523cf 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -722,4 +722,7 @@ a int(11) YES NULL b varchar(255) YES NULL c datetime YES NULL drop table t1; +mysqltest: At line 1: change user failed: Unknown database 'inexistent' +mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO) +mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES) End of tests diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 5d985d053fc..4e4bd0bbc0a 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1259,6 +1259,10 @@ INSERT INTO t1 SELECT a + 8, b FROM t1; ALTER TABLE t1 ADD PARTITION (PARTITION p1 VALUES LESS THAN (64)); ALTER TABLE t1 DROP PARTITION p1; DROP TABLE t1; +create table t (s1 int) engine=myisam partition by key (s1); +create trigger t_ad after delete on t for each row insert into t values (old.s1); +insert into t values (1); +drop table t; USE mysql; SET GLOBAL general_log = 0; ALTER TABLE general_log ENGINE = MyISAM; @@ -1267,4 +1271,24 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time)) ERROR HY000: Incorrect usage of PARTITION and log table ALTER TABLE general_log ENGINE = CSV; SET GLOBAL general_log = default; +use test; +create table t2 (b int); +create table t1 (b int) +PARTITION BY RANGE (t2.b) ( +PARTITION p1 VALUES LESS THAN (10), +PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +ERROR 42S22: Unknown column 't2.b' in 'partition function' +create table t1 (a int) +PARTITION BY RANGE (b) ( +PARTITION p1 VALUES LESS THAN (10), +PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (20) ENGINE = MyISAM) */ +drop table t1, t2; End of 5.1 tests diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 8282cfc212a..5b755b6bfd5 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -129,3 +129,10 @@ insert into t1 (time, first_name, last_name) values ('2007-02-07', 'Q', 'Robert' SELECT * FROM t1 WHERE first_name='Andy' OR last_name='Jake'; id time first_name last_name drop table t1; +CREATE TABLE t1 (a DOUBLE NOT NULL, KEY(a)) ENGINE=InnoDB +PARTITION BY KEY(a) PARTITIONS 10; +INSERT INTO t1 VALUES(1),(2); +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +DROP TABLE t1; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index edac68a88d6..14dec382244 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1143,6 +1143,11 @@ a 13 DEALLOCATE PREPARE st1; DROP TABLE t1; +create table t1 (a int, b tinyint); +prepare st1 from 'update t1 set b= (str_to_date(a, a))'; +execute st1; +deallocate prepare st1; +drop table t1; End of 4.1 tests. create table t1 (a varchar(20)); insert into t1 values ('foo'); diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 321b08628ee..73436dc392f 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1650,86 +1650,8 @@ a (select count(*) from t2) 3 0 4 0 drop table t1,t2; -DROP DATABASE IF EXISTS bug30269; -FLUSH STATUS; -CREATE DATABASE bug30269; -USE bug30269; -CREATE TABLE test1 (id int, name varchar(23)); -CREATE VIEW view1 AS SELECT * FROM test1; -INSERT INTO test1 VALUES (5, 'testit'); -GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost'; -GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost'; -set global query_cache_size= 81920; -USE bug30269; -show status like 'Qcache_queries_in_cache'; -Variable_name Value -Qcache_queries_in_cache 0 -# Select statement not stored in query cache because of column privileges. -SELECT id FROM test1 WHERE id>2; -id -5 -show status like 'Qcache_queries_in_cache'; -Variable_name Value -Qcache_queries_in_cache 0 -SELECT id FROM view1 WHERE id>2; -id -5 -show status like 'Qcache_queries_in_cache'; -Variable_name Value -Qcache_queries_in_cache 1 -DROP DATABASE bug30269; -DROP USER 'bug30269'@'localhost'; +End of 5.0 tests set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; -End of 5.0 tests -drop database if exists db1; -drop database if exists db2; -set GLOBAL query_cache_size=15*1024*1024; -create database db1; -use db1; -create table t1(c1 int)engine=myisam; -insert into t1(c1) values (1); -select * from db1.t1 f; -c1 -1 -show status like 'Qcache_queries_in_cache'; -Variable_name Value -Qcache_queries_in_cache 1 -rename schema db1 to db2; -show status like 'Qcache_queries_in_cache'; -Variable_name Value -Qcache_queries_in_cache 0 -drop database db2; -set global query_cache_size=default; -drop database if exists db1; -drop database if exists db3; -set GLOBAL query_cache_size=15*1024*1024; -create database db1; -create database db3; -use db1; -create table t1(c1 int) engine=myisam; -use db3; -create table t1(c1 int) engine=myisam; -use db1; -insert into t1(c1) values (1); -use mysql; -select * from db1.t1; -c1 -1 -select c1+1 from db1.t1; -c1+1 -2 -select * from db3.t1; -c1 -show status like 'Qcache_queries_in_cache'; -Variable_name Value -Qcache_queries_in_cache 3 -rename schema db1 to db2; -show status like 'Qcache_queries_in_cache'; -Variable_name Value -Qcache_queries_in_cache 1 -drop database db2; -drop database db3; -End of 5.1 tests diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result index 05ef28a3180..ec78c2267d2 100644 --- a/mysql-test/r/query_cache_notembedded.result +++ b/mysql-test/r/query_cache_notembedded.result @@ -347,3 +347,36 @@ drop table t1; drop function f1; set GLOBAL query_cache_size=0; SET GLOBAL log_bin_trust_function_creators = 0; +DROP DATABASE IF EXISTS bug30269; +FLUSH STATUS; +CREATE DATABASE bug30269; +USE bug30269; +CREATE TABLE test1 (id int, name varchar(23)); +CREATE VIEW view1 AS SELECT * FROM test1; +INSERT INTO test1 VALUES (5, 'testit'); +GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost'; +GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost'; +set global query_cache_size= 81920; +USE bug30269; +show status like 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 0 +# Select statement not stored in query cache because of column privileges. +SELECT id FROM test1 WHERE id>2; +id +5 +show status like 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 0 +SELECT id FROM view1 WHERE id>2; +id +5 +show status like 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 1 +DROP DATABASE bug30269; +DROP USER 'bug30269'@'localhost'; +set GLOBAL query_cache_type=default; +set GLOBAL query_cache_limit=default; +set GLOBAL query_cache_min_res_unit=default; +set GLOBAL query_cache_size=default; diff --git a/mysql-test/r/renamedb.result b/mysql-test/r/renamedb.result index b22322fbe8d..ff8f89592fc 100644 --- a/mysql-test/r/renamedb.result +++ b/mysql-test/r/renamedb.result @@ -1,33 +1,12 @@ -drop database if exists testdb1; -create database testdb1 default character set latin2; -use testdb1; -create table t1 (a int); -insert into t1 values (1),(2),(3); -show create database testdb1; -Database Create Database -testdb1 CREATE DATABASE `testdb1` /*!40100 DEFAULT CHARACTER SET latin2 */ -show tables; -Tables_in_testdb1 -t1 rename database testdb1 to testdb2; -show create database testdb1; -ERROR 42000: Unknown database 'testdb1' -show create database testdb2; -Database Create Database -testdb2 CREATE DATABASE `testdb2` /*!40100 DEFAULT CHARACTER SET latin2 */ -select database(); -database() -testdb2 -show tables; -Tables_in_testdb2 -t1 -select a from t1 order by a; -a -1 -2 -3 -drop database testdb2; -create database testdb1; -rename database testdb1 to testdb1; -ERROR HY000: Can't create database 'testdb1'; database exists -drop database testdb1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database testdb1 to testdb2' at line 1 +ALTER DATABASE wrong UPGRADE DATA DIRECTORY NAME; +ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name +ALTER DATABASE `#mysql41#not-supported` UPGRADE DATA DIRECTORY NAME; +ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name +ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME; +ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name +ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME; +ERROR HY000: Incorrect usage of ALTER DATABASE UPGRADE DATA DIRECTORY NAME and name +ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; +ERROR 42000: Unknown database '#mysql50#upgrade-me' diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index 7fc09c43f4b..8c0671ad740 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -88,6 +88,33 @@ test.t1 repair status OK SET myisam_repair_threads=@@global.myisam_repair_threads; SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; +CREATE TABLE t1(a CHAR(255), KEY(a)); +SET myisam_sort_buffer_size=4496; +INSERT INTO t1 VALUES +('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'), +('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'), +('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'), +('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'); +SET myisam_repair_threads=2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SET myisam_repair_threads=@@global.myisam_repair_threads; +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +DROP TABLE t1; +End of 4.1 tests DROP TABLE IF EXISTS tt1; CREATE TEMPORARY TABLE tt1 (c1 INT); REPAIR TABLE tt1 USE_FRM; diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result index b2bcfff0fdb..018173e723d 100644 --- a/mysql-test/r/sp-code.result +++ b/mysql-test/r/sp-code.result @@ -155,11 +155,11 @@ Pos Instruction 0 stmt 9 "drop temporary table if exists sudoku..." 1 stmt 1 "create temporary table sudoku_work ( ..." 2 stmt 1 "create temporary table sudoku_schedul..." -3 stmt 95 "call sudoku_init()" +3 stmt 94 "call sudoku_init()" 4 jump_if_not 7(8) p_naive@0 5 stmt 4 "update sudoku_work set cnt = 0 where ..." 6 jump 8 -7 stmt 95 "call sudoku_count()" +7 stmt 94 "call sudoku_count()" 8 stmt 6 "insert into sudoku_schedule (row,col)..." 9 set v_scounter@2 0 10 set v_i@3 1 diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 2e0d437aeb6..1b14d75cd9c 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -142,7 +142,10 @@ declare c cursor for insert into test.t1 values ("foo", 42); open c; close c; end| -ERROR 42000: Cursor statement must be a SELECT +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insert into test.t1 values ("foo", 42); +open c; +close c; +end' at line 3 create procedure p() begin declare x int; @@ -1223,7 +1226,7 @@ ERROR 42S02: Unknown table 'c' in field list drop procedure bug15091; drop function if exists bug16896; create aggregate function bug16896() returns int return 1; -ERROR 42000: AGGREGATE is not supported for stored functions +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '() returns int return 1' at line 1 DROP PROCEDURE IF EXISTS bug14702; CREATE IF NOT EXISTS PROCEDURE bug14702() BEGIN @@ -1478,3 +1481,45 @@ end until true end repeat retry; end// ERROR 42000: LEAVE with no matching label: retry +drop procedure if exists proc_28360; +drop function if exists func_28360; +CREATE PROCEDURE proc_28360() +BEGIN +ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; +END// +ERROR HY000: Can't drop or alter a DATABASE from within another stored routine +CREATE FUNCTION func_28360() RETURNS int +BEGIN +ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; +RETURN 0; +END// +ERROR HY000: Can't drop or alter a DATABASE from within another stored routine +DROP PROCEDURE IF EXISTS p1; +CREATE PROCEDURE p1() +BEGIN +DECLARE c char(100); +DECLARE cur1 CURSOR FOR SHOW TABLES; +OPEN cur1; +FETCH cur1 INTO c; +select c; +CLOSE cur1; +END| +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SHOW TABLES; +OPEN cur1; +FETCH cur1 INTO c; +select c; +CLOSE cur1; +END' at line 4 +DROP DATABASE IF EXISTS mysqltest; +CREATE DATABASE mysqltest; +USE mysqltest; +DROP DATABASE mysqltest; +SELECT inexistent(), 1 + ,; +ERROR 42000: FUNCTION inexistent does not exist +SELECT inexistent(); +ERROR 42000: FUNCTION inexistent does not exist +SELECT .inexistent(); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '()' at line 1 +SELECT ..inexistent(); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.inexistent()' at line 1 +USE test; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 55b27b0a733..412f6b94fa2 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -4914,7 +4914,7 @@ create table t3 as select * from v1| show create table t3| Table Create Table t3 CREATE TABLE `t3` ( - `j` bigint(11) DEFAULT NULL + `j` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t3| j @@ -6620,4 +6620,295 @@ DROP TABLE t1; DROP PROCEDURE p1; DROP PROCEDURE p2; + +# +# Bug#31035. +# + +# +# - Prepare. +# + +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; +DROP FUNCTION IF EXISTS f2; +DROP FUNCTION IF EXISTS f3; +DROP FUNCTION IF EXISTS f4; + +# +# - Create required objects. +# + +CREATE TABLE t1(c1 INT); + +INSERT INTO t1 VALUES (1), (2), (3); + +CREATE FUNCTION f1() +RETURNS INT +NOT DETERMINISTIC +RETURN 1; + +CREATE FUNCTION f2(p INT) +RETURNS INT +NOT DETERMINISTIC +RETURN 1; + +CREATE FUNCTION f3() +RETURNS INT +DETERMINISTIC +RETURN 1; + +CREATE FUNCTION f4(p INT) +RETURNS INT +DETERMINISTIC +RETURN 1; + +# +# - Check. +# + +SELECT f1() AS a FROM t1 GROUP BY a; +a +1 + +SELECT f2(@a) AS a FROM t1 GROUP BY a; +a +1 + +SELECT f3() AS a FROM t1 GROUP BY a; +a +1 + +SELECT f4(0) AS a FROM t1 GROUP BY a; +a +1 + +SELECT f4(@a) AS a FROM t1 GROUP BY a; +a +1 + +# +# - Cleanup. +# + +DROP TABLE t1; +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP FUNCTION f3; +DROP FUNCTION f4; + +# +# Bug#31191. +# + +# +# - Prepare. +# + +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP FUNCTION IF EXISTS f1; + +# +# - Create required objects. +# + +CREATE TABLE t1 ( +id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +barcode INT(8) UNSIGNED ZEROFILL nOT NULL, +PRIMARY KEY (id), +UNIQUE KEY barcode (barcode) +); + +INSERT INTO t1 (id, barcode) VALUES (1, 12345678); +INSERT INTO t1 (id, barcode) VALUES (2, 12345679); + +CREATE TABLE test.t2 ( +id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +barcode BIGINT(11) UNSIGNED ZEROFILL NOT NULL, +PRIMARY KEY (id) +); + +INSERT INTO test.t2 (id, barcode) VALUES (1, 12345106708); +INSERT INTO test.t2 (id, barcode) VALUES (2, 12345106709); + +CREATE FUNCTION f1(p INT(8)) +RETURNS BIGINT(11) UNSIGNED +READS SQL DATA +RETURN FLOOR(p/1000)*1000000 + 100000 + FLOOR((p MOD 1000)/10)*100 + (p MOD 10); + +# +# - Check. +# + +SELECT DISTINCT t1.barcode, f1(t1.barcode) +FROM t1 +INNER JOIN t2 +ON f1(t1.barcode) = t2.barcode +WHERE t1.barcode=12345678; +barcode f1(t1.barcode) +12345678 12345106708 + +# +# - Cleanup. +# + +DROP TABLE t1; +DROP TABLE t2; +DROP FUNCTION f1; + +# +# Bug#31226. +# + +# +# - Prepare. +# + +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; + +# +# - Create required objects. +# + +CREATE TABLE t1(id INT); + +INSERT INTO t1 VALUES (1), (2), (3); + +CREATE FUNCTION f1() +RETURNS DATETIME +NOT DETERMINISTIC NO SQL +RETURN NOW(); + +# +# - Check. +# + +SELECT f1() FROM t1 GROUP BY 1; +f1() +<timestamp> + +# +# - Cleanup. +# + +DROP TABLE t1; +DROP FUNCTION f1; + +DROP PROCEDURE IF EXISTS db28318_a.t1; +DROP PROCEDURE IF EXISTS db28318_b.t2; +DROP DATABASE IF EXISTS db28318_a; +DROP DATABASE IF EXISTS db28318_b; +CREATE DATABASE db28318_a; +CREATE DATABASE db28318_b; +CREATE PROCEDURE db28318_a.t1() SELECT "db28318_a.t1"; +CREATE PROCEDURE db28318_b.t2() CALL t1(); +use db28318_a; +CALL db28318_b.t2(); +ERROR 42000: PROCEDURE db28318_b.t1 does not exist +DROP PROCEDURE db28318_a.t1; +DROP PROCEDURE db28318_b.t2; +DROP DATABASE db28318_a; +DROP DATABASE db28318_b; +use test; End of 5.0 tests + +# +# Bug#20550. +# + +# +# - Prepare. +# + +DROP VIEW IF EXISTS v1; +DROP VIEW IF EXISTS v2; +DROP FUNCTION IF EXISTS f1; +DROP FUNCTION IF EXISTS f2; + +# +# - Create required objects. +# + +CREATE FUNCTION f1() RETURNS VARCHAR(65525) RETURN 'Hello'; + +CREATE FUNCTION f2() RETURNS TINYINT RETURN 1; + +CREATE VIEW v1 AS SELECT f1(); + +CREATE VIEW v2 AS SELECT f2(); + +# +# - Check. +# + +SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'v1'; +DATA_TYPE +varchar + +SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'v2'; +DATA_TYPE +tinyint + +# +# - Cleanup. +# + +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP VIEW v1; +DROP VIEW v2; + +# +# - Bug#24923: prepare. +# + +DROP FUNCTION IF EXISTS f1; + +# +# - Bug#24923: create required objects. +# + +CREATE FUNCTION f1(p INT) +RETURNS ENUM ('Very_long_enum_element_identifier', +'Another_very_long_enum_element_identifier') +BEGIN +CASE p +WHEN 1 THEN +RETURN 'Very_long_enum_element_identifier'; +ELSE +RETURN 'Another_very_long_enum_element_identifier'; +END CASE; +END| + +# +# - Bug#24923: check. +# + +SELECT f1(1); +f1(1) +Very_long_enum_element_identifier + +SELECT f1(2); +f1(2) +Another_very_long_enum_element_identifier + +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function character_set_client collation_connection Database Collation +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`(p INT) RETURNS enum('Very_long_enum_element_identifier','Another_very_long_enum_element_identifier') CHARSET latin1 +BEGIN +CASE p +WHEN 1 THEN +RETURN 'Very_long_enum_element_identifier'; +ELSE +RETURN 'Another_very_long_enum_element_identifier'; +END CASE; +END latin1 latin1_swedish_ci latin1_swedish_ci +# +# - Bug#24923: cleanup. +# + +DROP FUNCTION f1; + +End of 5.1 tests diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index db75044ee5d..c95b09597fc 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -8,6 +8,8 @@ VARIABLE_NAME VARIABLE_VALUE TABLE_LOCKS_IMMEDIATE 2 TABLE_LOCKS_WAITED 0 SET SQL_LOG_BIN=0; +set @old_general_log = @@global.general_log; +set global general_log = 'OFF'; drop table if exists t1; create table t1(n int) engine=myisam; insert into t1 values(1); @@ -20,6 +22,7 @@ show status like 'Table_locks_waited'; Variable_name Value Table_locks_waited 1 drop table t1; +set global general_log = @old_general_log; select 1; 1 1 diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 7696afdf06d..d1aff0fa657 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -196,7 +196,7 @@ proc CREATE TABLE `proc` ( `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', `param_list` blob NOT NULL, - `returns` char(64) NOT NULL DEFAULT '', + `returns` longblob NOT NULL, `body` longblob NOT NULL, `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, @@ -240,11 +240,11 @@ show create table general_log; Table Create Table general_log CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `user_host` mediumtext, - `thread_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, - `command_type` varchar(64) DEFAULT NULL, - `argument` mediumtext + `user_host` mediumtext NOT NULL, + `thread_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' show create table slow_log; Table Create Table @@ -255,10 +255,10 @@ slow_log CREATE TABLE `slow_log` ( `lock_time` time NOT NULL, `rows_sent` int(11) NOT NULL, `rows_examined` int(11) NOT NULL, - `db` varchar(512) DEFAULT NULL, - `last_insert_id` int(11) DEFAULT NULL, - `insert_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' show tables; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index ffe4bac142d..432fe1e6c4a 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -427,6 +427,22 @@ f1 Warnings: Warning 1292 Incorrect datetime value: '2007010100000' for column 'f1' at row 1 drop table t1; +create table t1 (f1 time); +insert into t1 set f1 = '45:44:44'; +insert into t1 set f1 = '15:44:44'; +select * from t1 where (convert(f1,datetime)) != 1; +f1 +15:44:44 +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00 45:44:44' +drop table t1; +create table t1 (a tinyint); +insert into t1 values (), (), (); +select sum(a) from t1 group by convert(a, datetime); +sum(a) +NULL +drop table t1; +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'); Warnings: diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index efac8cbe580..fa7bf91b113 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -683,6 +683,7 @@ select * from t1; a b 123.12345 123.1 drop table t1; +End of 4.1 tests CREATE TABLE t1 (EMPNUM CHAR(3) NOT NULL, HOURS DECIMAL(5)); @@ -799,3 +800,10 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1; ROUND(qty,3) dps ROUND(qty,dps) 1.133 3 1.133 DROP TABLE t1; +create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill); +insert into t1 values (-0.123456,0.123456); +select group_concat(f1),group_concat(f2) from t1; +group_concat(f1) group_concat(f2) +-0.123456 0.123456 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 33ad3928835..6fbc8268a64 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -344,6 +344,22 @@ create table t1 (s1 float(0,2)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). create table t1 (s1 float(1,2)); ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1'). +CREATE TABLE t1 ( +f1 real zerofill, +f2 double zerofill, +f3 float zerofill); +INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1); +PREPARE stmt1 FROM 'select f1, f2, f3 FROM t1'; +select f1, f2, f3 FROM t1; +f1 f2 f3 +0000000000000003.14152 0000000000000003.14152 000003.14152 +select f1, f2, f3 FROM t1; +f1 f2 f3 +0000000000000003.14152 0000000000000003.14152 000003.14152 +EXECUTE stmt1; +f1 f2 f3 +0000000000000003.14152 0000000000000003.14152 000003.14152 +DROP TABLE t1; create table t1 (f1 double(200, 0)); insert into t1 values (1e199), (-1e199); insert into t1 values (1e200), (-1e200); diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 24be10a7a29..71be41b106f 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1509,6 +1509,26 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b; 1 1 DROP TABLE t1; +CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +Warnings: +Note 1265 Data truncated for column 'f1' at row 1 +DESC t1; +Field Type Null Key Default Extra +f1 decimal(31,30) NO 0.000000000000000000000000000000 +SELECT f1 FROM t1; +f1 +0.123456789012345678901234567890 +DROP TABLE t1; +CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1; +Warnings: +Warning 1264 Out of range value for column 'f1' at row 1 +DESC t1; +Field Type Null Key Default Extra +f1 decimal(59,30) NO 0.000000000000000000000000000000 +SELECT f1 FROM t1; +f1 +99999999999999999999999999999.999999999999999999999999999999 +DROP TABLE t1; End of 5.0 tests select cast(143.481 as decimal(4,1)); cast(143.481 as decimal(4,1)) diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index f1e47905f5d..da27a71c1a1 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -95,10 +95,10 @@ FR DROP TABLE bug19904; CREATE DEFINER=CURRENT_USER() FUNCTION should_not_parse RETURNS STRING SONAME "should_not_parse.so"; -ERROR HY000: Incorrect usage of SONAME and DEFINER +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURNS STRING SONAME "should_not_parse.so"' at line 2 CREATE DEFINER=someone@somewhere FUNCTION should_not_parse RETURNS STRING SONAME "should_not_parse.so"; -ERROR HY000: Incorrect usage of SONAME and DEFINER +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURNS STRING SONAME "should_not_parse.so"' at line 2 create table t1(f1 int); insert into t1 values(1),(2); explain select myfunc_int(f1) from t1 order by 1; @@ -214,7 +214,7 @@ DROP FUNCTION IF EXISTS metaphon; CREATE FUNCTION metaphon(a int) RETURNS int return 0; CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB"; -ERROR HY000: Function 'metaphon' already exists +DROP FUNCTION metaphon; DROP FUNCTION metaphon; CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB"; CREATE FUNCTION metaphon(a int) RETURNS int @@ -334,6 +334,13 @@ Qcache_queries_in_cache 0 drop table t1; drop function metaphon; set GLOBAL query_cache_size=default; +DROP DATABASE IF EXISTS mysqltest; +CREATE DATABASE mysqltest; +USE mysqltest; +DROP DATABASE mysqltest; +CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB"; +DROP FUNCTION metaphon; +USE test; CREATE TABLE const_len_bug ( str_const varchar(4000), result1 varchar(4000), diff --git a/mysql-test/r/upgrade.result b/mysql-test/r/upgrade.result index 76e0359c405..adf81efe8e3 100644 --- a/mysql-test/r/upgrade.result +++ b/mysql-test/r/upgrade.result @@ -59,3 +59,28 @@ drop table `txu@0023p@0023p1`; drop table `txu#p#p1`; truncate t1; drop table t1; +drop database if exists `tabc`; +drop database if exists `a-b-c`; +create database `tabc` default character set latin2; +create table tabc.t1 (a int); +FLUSH TABLES; +show databases like '%a-b-c%'; +Database (%a-b-c%) +#mysql50#a-b-c +ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME; +show databases like '%a-b-c%'; +Database (%a-b-c%) +a-b-c +show create database `a-b-c`; +Database Create Database +a-b-c CREATE DATABASE `a-b-c` /*!40100 DEFAULT CHARACTER SET latin2 */ +show tables in `a-b-c`; +Tables_in_a-b-c +t1 +show create table `a-b-c`.`t1`; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin2 +drop database `a-b-c`; +drop database `tabc`; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 19b48efe6b4..638d71c6940 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -286,6 +286,8 @@ select * from information_schema.session_variables where variable_name like 'net VARIABLE_NAME VARIABLE_VALUE NET_BUFFER_LENGTH 1024 set net_buffer_length=2000000000; +Warnings: +Warning 1292 Truncated incorrect net_buffer_length value: '2000000000' show variables like 'net_buffer_length'; Variable_name Value net_buffer_length 1048576 diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index a1f2c80e766..552f4896698 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1012,3 +1012,14 @@ select ExtractValue('<a>a</a>', '/a[@x=@y0123456789_0123456789_0123456789_012345 ERROR HY000: XPATH error: comparison of two nodesets is not supported: '=@y0123456789_0123456789_0123456' select ExtractValue('<a>a</a>', '/a[@x=$y0123456789_0123456789_0123456789_0123456789]'); ERROR HY000: Unknown XPATH variable at: '$y0123456789_0123456789_01234567' +select updatexml(NULL, 1, 1), updatexml(1, NULL, 1), updatexml(1, 1, NULL); +updatexml(NULL, 1, 1) updatexml(1, NULL, 1) updatexml(1, 1, NULL) +NULL NULL NULL +select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL), +updatexml(NULL, 1, NULL); +updatexml(NULL, NULL, 1) updatexml(1, NULL, NULL) updatexml(NULL, 1, NULL) +NULL NULL NULL +select updatexml(NULL, NULL, NULL); +updatexml(NULL, NULL, NULL) +NULL +End of 5.1 tests diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test index 6c0b4b46a4e..0b3c64eb5d8 100644 --- a/mysql-test/suite/binlog/t/binlog_killed.test +++ b/mysql-test/suite/binlog/t/binlog_killed.test @@ -242,7 +242,7 @@ drop function bug27563; drop function bug27565; } -system rm $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ; +remove_file $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog ; drop table t1,t2,t3; diff --git a/mysql-test/suite/funcs_1/r/innodb__datadict.result b/mysql-test/suite/funcs_1/r/innodb__datadict.result index fa141602a55..4ac0f2e16ea 100644 --- a/mysql-test/suite/funcs_1/r/innodb__datadict.result +++ b/mysql-test/suite/funcs_1/r/innodb__datadict.result @@ -10,9 +10,8 @@ . *__datadict.test are started. This can be a result of showing e.g. maximum . values of the number of rows of tables. . -. This .result file has been checked OK with Linux 5.0.48, -. build tree ChangeSet@1.2477.6.3, 2007-07-30 -. except that the not fixed Bug#30020 causes a difference. +. This .result file has been checked OK with Linux 5.0.23-bk, +. ChangeSet@1.2211, 2006-06-28 10:11:43-07:00. . -------------------------------------------------------------------------------- @@ -21,21 +20,11 @@ FIXME: There are subtests that are switched off due to known bugs: SELECT 1 AS "have_bug_11589"; have_bug_11589 1 -SELECT 1 AS "have_bug_30689"; -have_bug_30689 -1 There are some statements where the ps-protocol is switched off. This may come from the bug listed below, ir from other problems. Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill -------------------------------------------------------------------------------- - -Selects on INFORMATION_SCHEMA.VIEWS present incomplete -content for the column VIEW_DEFINITION in cases where -the view selects(=is based) on an INFORMATION_SCHEMA table. ----> VIEWS vu and vu1 -Bug#30689 Wrong content in I_S.VIEWS.VIEW_DEFINITION if VIEW is based on I_S --------------------------------------------------------------------------------- SET @NO_REFRESH = IF( '' = '', 0, 1); DROP DATABASE IF EXISTS test1; CREATE DATABASE test1; @@ -1046,8 +1035,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -1218,6 +1206,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -3141,7 +3213,7 @@ cp932 cp932_japanese_ci SJIS for Windows Japanese 2 eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3 select sum(id) from collations; sum(id) -11094 +10840 select collation_name, character_set_name into @x,@y from collation_character_set_applicability limit 1; select @x, @y; @@ -3155,8 +3227,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh select count(*) from routines; count(*) 1 -select * from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select * from statistics; 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 NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql columns_priv 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE @@ -3170,6 +3241,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE @@ -3400,10 +3479,9 @@ NULL mysql PRIMARY NULL mysql user User 2 NULL NULL NULL NULL select count(*) as max_recs from key_column_usage; max_recs 45 -select max(cardinality) from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select max(cardinality) from statistics; max(cardinality) -393 +901 select concat("View '", table_name, "' is associated with the database '", table_schema, "'.") AS "Who is Who for the Views" @@ -4293,8 +4371,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -4465,6 +4542,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -5582,10 +5743,10 @@ COUNT(*) 36 SELECT COUNT(*) FROM information_schema. collations ; COUNT(*) -128 +127 SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ; COUNT(*) -129 +128 SELECT COUNT(*) FROM information_schema. routines ; COUNT(*) 1 @@ -5662,10 +5823,10 @@ utf8_esperanto_ci utf8 utf8_estonian_ci utf8 select routine_definition from routines; routine_definition -select * from statistics where table_name not like 'help_%' -group by index_name asc limit 0, 5; +select * from statistics group by index_name asc limit 0, 5; 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 NULL mysql procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE select concat(table_schema, ', ', table_name, ', ', view_definition) view_info @@ -5779,9 +5940,9 @@ NULL test latin1 latin1_swedish_ci NULL NULL test1 latin1 latin1_swedish_ci NULL select distinct grantee from user_privileges; grantee -'root'@'127.0.0.1' -'root'@'<SERVER_NAME>' 'root'@'localhost' +'root'@'<SERVER_NAME>' +'root'@'127.0.0.1' select all grantee from user_privileges order by grantee, privilege_type; grantee 'root'@'127.0.0.1' @@ -7731,7 +7892,7 @@ Testcase 3.2.1.14: DROP DATABASE IF EXISTS db_datadict; CREATE DATABASE db_datadict; USE db_datadict; -create table res_t_401014(f1 char(10), f2 varchar(25), f3 int); +create table res_t_401014(f1 char(10), f2 text(25), f3 int); create view res_v_401014 as select * from res_t_401014; create procedure sp_6_401014() select 'db_datadict'; create function fn_6_401014() returns int return 0; @@ -7754,10 +7915,10 @@ from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references NULL db_datadict res_v_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_v_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_v_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_v_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable from information_schema.views @@ -7876,7 +8037,7 @@ WHERE trigger_schema LIKE 'db_datadict%'; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION use db_datadict; alter table res_t_401014 change f1 ff1 int; -alter table res_t_401014 engine = MEMORY; +alter table res_t_401014 engine = innodb; alter table res_t_401014 change f3 f3_new bigint; alter view res_v_401014 as select ff1 from res_t_401014; alter procedure sp_6_401014 sql security invoker; @@ -7894,14 +8055,14 @@ select table_catalog, table_schema, engine from information_schema.tables where table_schema like 'db_datadict%'; table_catalog table_schema engine -NULL db_datadict MEMORY +NULL db_datadict InnoDB NULL db_datadict NULL select * from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3_new 3 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL db_datadict res_v_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable @@ -8542,7 +8703,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -9324,7 +9484,6 @@ utf8_roman_ci utf8_persian_ci utf8_esperanto_ci utf8_hungarian_ci -utf8_general_cs ucs2_general_ci ucs2_bin ucs2_unicode_ci @@ -9690,7 +9849,6 @@ utf8_roman_ci utf8 207 Yes 8 utf8_persian_ci utf8 208 Yes 8 utf8_esperanto_ci utf8 209 Yes 8 utf8_hungarian_ci utf8 210 Yes 8 -utf8_general_cs utf8 254 Yes 1 ucs2_general_ci ucs2 35 Yes Yes 1 ucs2_bin ucs2 90 Yes 1 ucs2_unicode_ci ucs2 128 Yes 8 @@ -9854,7 +10012,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -14179,7 +14336,7 @@ NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# # NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# NULL information_schema VIEWS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -14190,6 +14347,10 @@ NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY- NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log +NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories +NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords +NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation +NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL mysql plugin BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL MySQL plugins @@ -14418,8 +14579,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_ root@localhost db_datadict_2 REVOKE SELECT ON db_datadict.tb_6_401402_1 FROM 'user_1'@'localhost'; -SELECT * FROM information_schema.statistics -WHERE NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +SELECT * FROM information_schema.statistics; 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 NULL db_datadict tb_6_401402_1 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE NULL db_datadict tb_6_401402_1 1 db_datadict f2_ind 1 f2 A NULL NULL NULL YES BTREE @@ -14441,6 +14601,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result index ce3a882000b..689ff606bd9 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result @@ -81,6 +81,7 @@ BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1' +USE db_storedproc_1; root@localhost db_storedproc_1 GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost'; @@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20)) BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// +USE db_storedproc_1; root@localhost db_storedproc_1 DROP USER 'user_1'@'localhost'; @@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int BEGIN return v1; END// +USE db_storedproc_1; root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result index 5bb5b3cbbc2..84ef164b0dc 100755 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result @@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11; Section 3.1.10 - CALL checks: -------------------------------------------------------------------------------- -USE db_storedproc; Testcase 3.1.10.2 + 3.1.10.5: ----------------------------- @@ -95,6 +94,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc CALL sp31102(); @@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000 SELECT fn31105( 9 ); fn31105( 9 ) 81 +USE db_storedproc; root@localhost db_storedproc REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost'; @@ -131,6 +132,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc DROP PROCEDURE sp31102; diff --git a/mysql-test/suite/funcs_1/r/memory__datadict.result b/mysql-test/suite/funcs_1/r/memory__datadict.result index 544a03955b7..2f9bbe6eafe 100644 --- a/mysql-test/suite/funcs_1/r/memory__datadict.result +++ b/mysql-test/suite/funcs_1/r/memory__datadict.result @@ -10,9 +10,8 @@ . *__datadict.test are started. This can be a result of showing e.g. maximum . values of the number of rows of tables. . -. This .result file has been checked OK with Linux 5.0.48, -. build tree ChangeSet@1.2477.6.3, 2007-07-30 -. except that the not fixed Bug#30020 causes a difference. +. This .result file has been checked OK with Linux 5.0.23-bk, +. ChangeSet@1.2211, 2006-06-28 10:11:43-07:00. . -------------------------------------------------------------------------------- @@ -21,21 +20,11 @@ FIXME: There are subtests that are switched off due to known bugs: SELECT 1 AS "have_bug_11589"; have_bug_11589 1 -SELECT 1 AS "have_bug_30689"; -have_bug_30689 -1 There are some statements where the ps-protocol is switched off. This may come from the bug listed below, ir from other problems. Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill -------------------------------------------------------------------------------- - -Selects on INFORMATION_SCHEMA.VIEWS present incomplete -content for the column VIEW_DEFINITION in cases where -the view selects(=is based) on an INFORMATION_SCHEMA table. ----> VIEWS vu and vu1 -Bug#30689 Wrong content in I_S.VIEWS.VIEW_DEFINITION if VIEW is based on I_S --------------------------------------------------------------------------------- SET @NO_REFRESH = IF( '' = '', 0, 1); DROP DATABASE IF EXISTS test1; CREATE DATABASE test1; @@ -1044,8 +1033,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -1216,6 +1204,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -3124,7 +3196,7 @@ cp932 cp932_japanese_ci SJIS for Windows Japanese 2 eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3 select sum(id) from collations; sum(id) -11094 +10840 select collation_name, character_set_name into @x,@y from collation_character_set_applicability limit 1; select @x, @y; @@ -3138,8 +3210,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh select count(*) from routines; count(*) 1 -select * from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select * from statistics; 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 NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql columns_priv 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE @@ -3153,6 +3224,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE @@ -3383,10 +3462,9 @@ NULL mysql PRIMARY NULL mysql user User 2 NULL NULL NULL NULL select count(*) as max_recs from key_column_usage; max_recs 45 -select max(cardinality) from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select max(cardinality) from statistics; max(cardinality) -393 +901 select concat("View '", table_name, "' is associated with the database '", table_schema, "'.") AS "Who is Who for the Views" @@ -4276,8 +4354,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -4448,6 +4525,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -5565,10 +5726,10 @@ COUNT(*) 36 SELECT COUNT(*) FROM information_schema. collations ; COUNT(*) -128 +127 SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ; COUNT(*) -129 +128 SELECT COUNT(*) FROM information_schema. routines ; COUNT(*) 1 @@ -5645,10 +5806,10 @@ utf8_esperanto_ci utf8 utf8_estonian_ci utf8 select routine_definition from routines; routine_definition -select * from statistics where table_name not like 'help_%' -group by index_name asc limit 0, 5; +select * from statistics group by index_name asc limit 0, 5; 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 NULL mysql procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE select concat(table_schema, ', ', table_name, ', ', view_definition) view_info @@ -5762,9 +5923,9 @@ NULL test latin1 latin1_swedish_ci NULL NULL test1 latin1 latin1_swedish_ci NULL select distinct grantee from user_privileges; grantee -'root'@'127.0.0.1' -'root'@'<SERVER_NAME>' 'root'@'localhost' +'root'@'<SERVER_NAME>' +'root'@'127.0.0.1' select all grantee from user_privileges order by grantee, privilege_type; grantee 'root'@'127.0.0.1' @@ -7714,7 +7875,7 @@ Testcase 3.2.1.14: DROP DATABASE IF EXISTS db_datadict; CREATE DATABASE db_datadict; USE db_datadict; -create table res_t_401014(f1 char(10), f2 varchar(25), f3 int); +create table res_t_401014(f1 char(10), f2 text(25), f3 int); create view res_v_401014 as select * from res_t_401014; create procedure sp_6_401014() select 'db_datadict'; create function fn_6_401014() returns int return 0; @@ -7737,10 +7898,10 @@ from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references NULL db_datadict res_v_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_v_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_v_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_v_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable from information_schema.views @@ -7859,7 +8020,7 @@ WHERE trigger_schema LIKE 'db_datadict%'; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION use db_datadict; alter table res_t_401014 change f1 ff1 int; -alter table res_t_401014 engine = MyISAM; +alter table res_t_401014 engine = innodb; alter table res_t_401014 change f3 f3_new bigint; alter view res_v_401014 as select ff1 from res_t_401014; alter procedure sp_6_401014 sql security invoker; @@ -7877,14 +8038,14 @@ select table_catalog, table_schema, engine from information_schema.tables where table_schema like 'db_datadict%'; table_catalog table_schema engine -NULL db_datadict MyISAM +NULL db_datadict InnoDB NULL db_datadict NULL select * from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3_new 3 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL db_datadict res_v_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable @@ -8525,7 +8686,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -9292,7 +9452,6 @@ utf8_roman_ci utf8_persian_ci utf8_esperanto_ci utf8_hungarian_ci -utf8_general_cs ucs2_general_ci ucs2_bin ucs2_unicode_ci @@ -9658,7 +9817,6 @@ utf8_roman_ci utf8 207 Yes 8 utf8_persian_ci utf8 208 Yes 8 utf8_esperanto_ci utf8 209 Yes 8 utf8_hungarian_ci utf8 210 Yes 8 -utf8_general_cs utf8 254 Yes 1 ucs2_general_ci ucs2 35 Yes Yes 1 ucs2_bin ucs2 90 Yes 1 ucs2_unicode_ci ucs2 128 Yes 8 @@ -9822,7 +9980,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -14077,7 +14234,7 @@ NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# # NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# NULL information_schema VIEWS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -14088,6 +14245,10 @@ NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY- NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log +NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories +NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords +NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation +NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL mysql plugin BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL MySQL plugins @@ -14316,8 +14477,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_ root@localhost db_datadict_2 REVOKE SELECT ON db_datadict.tb_6_401402_1 FROM 'user_1'@'localhost'; -SELECT * FROM information_schema.statistics -WHERE NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +SELECT * FROM information_schema.statistics; 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 NULL db_datadict tb_6_401402_1 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE NULL db_datadict tb_6_401402_1 1 db_datadict f2_ind 1 f2 A NULL NULL NULL YES BTREE @@ -14339,6 +14499,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result index a627de4b534..2b93431ba5b 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result @@ -81,6 +81,7 @@ BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1' +USE db_storedproc_1; root@localhost db_storedproc_1 GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost'; @@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20)) BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// +USE db_storedproc_1; root@localhost db_storedproc_1 DROP USER 'user_1'@'localhost'; @@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int BEGIN return v1; END// +USE db_storedproc_1; root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result index e924cf0731a..c316ce36dde 100755 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result @@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11; Section 3.1.10 - CALL checks: -------------------------------------------------------------------------------- -USE db_storedproc; Testcase 3.1.10.2 + 3.1.10.5: ----------------------------- @@ -95,6 +94,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc CALL sp31102(); @@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000 SELECT fn31105( 9 ); fn31105( 9 ) 81 +USE db_storedproc; root@localhost db_storedproc REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost'; @@ -131,6 +132,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc DROP PROCEDURE sp31102; diff --git a/mysql-test/suite/funcs_1/r/myisam__datadict.result b/mysql-test/suite/funcs_1/r/myisam__datadict.result index b7fc541dea8..d4571c5d718 100644 --- a/mysql-test/suite/funcs_1/r/myisam__datadict.result +++ b/mysql-test/suite/funcs_1/r/myisam__datadict.result @@ -10,9 +10,8 @@ . *__datadict.test are started. This can be a result of showing e.g. maximum . values of the number of rows of tables. . -. This .result file has been checked OK with Linux 5.0.48, -. build tree ChangeSet@1.2477.6.3, 2007-07-30 -. except that the not fixed Bug#30020 causes a difference. +. This .result file has been checked OK with Linux 5.0.23-bk, +. ChangeSet@1.2211, 2006-06-28 10:11:43-07:00. . -------------------------------------------------------------------------------- @@ -21,21 +20,11 @@ FIXME: There are subtests that are switched off due to known bugs: SELECT 1 AS "have_bug_11589"; have_bug_11589 1 -SELECT 1 AS "have_bug_30689"; -have_bug_30689 -1 There are some statements where the ps-protocol is switched off. This may come from the bug listed below, ir from other problems. Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill -------------------------------------------------------------------------------- - -Selects on INFORMATION_SCHEMA.VIEWS present incomplete -content for the column VIEW_DEFINITION in cases where -the view selects(=is based) on an INFORMATION_SCHEMA table. ----> VIEWS vu and vu1 -Bug#30689 Wrong content in I_S.VIEWS.VIEW_DEFINITION if VIEW is based on I_S --------------------------------------------------------------------------------- SET @NO_REFRESH = IF( '' = '', 0, 1); DROP DATABASE IF EXISTS test1; CREATE DATABASE test1; @@ -1074,8 +1063,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -1246,6 +1234,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -3194,7 +3266,7 @@ cp932 cp932_japanese_ci SJIS for Windows Japanese 2 eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3 select sum(id) from collations; sum(id) -11094 +10840 select collation_name, character_set_name into @x,@y from collation_character_set_applicability limit 1; select @x, @y; @@ -3208,8 +3280,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh select count(*) from routines; count(*) 1 -select * from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select * from statistics; 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 NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql columns_priv 0 mysql PRIMARY 2 Db A NULL NULL NULL BTREE @@ -3223,6 +3294,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE @@ -3453,10 +3532,9 @@ NULL mysql PRIMARY NULL mysql user User 2 NULL NULL NULL NULL select count(*) as max_recs from key_column_usage; max_recs 45 -select max(cardinality) from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select max(cardinality) from statistics; max(cardinality) -393 +901 select concat("View '", table_name, "' is associated with the database '", table_schema, "'.") AS "Who is Who for the Views" @@ -4346,8 +4424,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -4518,6 +4595,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -5635,10 +5796,10 @@ COUNT(*) 36 SELECT COUNT(*) FROM information_schema. collations ; COUNT(*) -128 +127 SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ; COUNT(*) -129 +128 SELECT COUNT(*) FROM information_schema. routines ; COUNT(*) 1 @@ -5715,10 +5876,10 @@ utf8_esperanto_ci utf8 utf8_estonian_ci utf8 select routine_definition from routines; routine_definition -select * from statistics where table_name not like 'help_%' -group by index_name asc limit 0, 5; +select * from statistics group by index_name asc limit 0, 5; 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 NULL mysql procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE NULL mysql columns_priv 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE select concat(table_schema, ', ', table_name, ', ', view_definition) view_info @@ -5832,9 +5993,9 @@ NULL test latin1 latin1_swedish_ci NULL NULL test1 latin1 latin1_swedish_ci NULL select distinct grantee from user_privileges; grantee -'root'@'127.0.0.1' -'root'@'<SERVER_NAME>' 'root'@'localhost' +'root'@'<SERVER_NAME>' +'root'@'127.0.0.1' select all grantee from user_privileges order by grantee, privilege_type; grantee 'root'@'127.0.0.1' @@ -7784,7 +7945,7 @@ Testcase 3.2.1.14: DROP DATABASE IF EXISTS db_datadict; CREATE DATABASE db_datadict; USE db_datadict; -create table res_t_401014(f1 char(10), f2 varchar(25), f3 int); +create table res_t_401014(f1 char(10), f2 text(25), f3 int); create view res_v_401014 as select * from res_t_401014; create procedure sp_6_401014() select 'db_datadict'; create function fn_6_401014() returns int return 0; @@ -7807,10 +7968,10 @@ from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references NULL db_datadict res_v_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_v_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_v_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_v_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable from information_schema.views @@ -7929,7 +8090,7 @@ WHERE trigger_schema LIKE 'db_datadict%'; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION use db_datadict; alter table res_t_401014 change f1 ff1 int; -alter table res_t_401014 engine = MEMORY; +alter table res_t_401014 engine = innodb; alter table res_t_401014 change f3 f3_new bigint; alter view res_v_401014 as select ff1 from res_t_401014; alter procedure sp_6_401014 sql security invoker; @@ -7947,14 +8108,14 @@ select table_catalog, table_schema, engine from information_schema.tables where table_schema like 'db_datadict%'; table_catalog table_schema engine -NULL db_datadict MEMORY +NULL db_datadict InnoDB NULL db_datadict NULL select * from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3_new 3 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL db_datadict res_v_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable @@ -8595,7 +8756,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -9394,7 +9554,6 @@ utf8_roman_ci utf8_persian_ci utf8_esperanto_ci utf8_hungarian_ci -utf8_general_cs ucs2_general_ci ucs2_bin ucs2_unicode_ci @@ -9760,7 +9919,6 @@ utf8_roman_ci utf8 207 Yes 8 utf8_persian_ci utf8 208 Yes 8 utf8_esperanto_ci utf8 209 Yes 8 utf8_hungarian_ci utf8 210 Yes 8 -utf8_general_cs utf8 254 Yes 1 ucs2_general_ci ucs2 35 Yes Yes 1 ucs2_bin ucs2 90 Yes 1 ucs2_unicode_ci ucs2 128 Yes 8 @@ -9924,7 +10082,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -14331,7 +14488,7 @@ NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# # NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# NULL information_schema VIEWS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -14342,6 +14499,10 @@ NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY- NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log +NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories +NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords +NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation +NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL mysql plugin BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL MySQL plugins @@ -14570,8 +14731,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_ root@localhost db_datadict_2 REVOKE SELECT ON db_datadict.tb_6_401402_1 FROM 'user_1'@'localhost'; -SELECT * FROM information_schema.statistics -WHERE NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +SELECT * FROM information_schema.statistics; 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 NULL db_datadict tb_6_401402_1 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE NULL db_datadict tb_6_401402_1 1 db_datadict f2_ind 1 f2 A NULL NULL NULL YES BTREE @@ -14593,6 +14753,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A 0 NULL NULL BTREE diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result index 11b1d3873b3..3a9c437cfc3 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result @@ -81,6 +81,7 @@ BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1' +USE db_storedproc_1; root@localhost db_storedproc_1 GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost'; @@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20)) BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// +USE db_storedproc_1; root@localhost db_storedproc_1 DROP USER 'user_1'@'localhost'; @@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int BEGIN return v1; END// +USE db_storedproc_1; root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result index f41d5d7d440..13b14b242fe 100755 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result @@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11; Section 3.1.10 - CALL checks: -------------------------------------------------------------------------------- -USE db_storedproc; Testcase 3.1.10.2 + 3.1.10.5: ----------------------------- @@ -95,6 +94,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc CALL sp31102(); @@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000 SELECT fn31105( 9 ); fn31105( 9 ) 81 +USE db_storedproc; root@localhost db_storedproc REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost'; @@ -131,6 +132,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc DROP PROCEDURE sp31102; diff --git a/mysql-test/suite/funcs_1/r/ndb__datadict.result b/mysql-test/suite/funcs_1/r/ndb__datadict.result index a996b7ba645..ebb45bf6ea2 100644 --- a/mysql-test/suite/funcs_1/r/ndb__datadict.result +++ b/mysql-test/suite/funcs_1/r/ndb__datadict.result @@ -10,9 +10,8 @@ . *__datadict.test are started. This can be a result of showing e.g. maximum . values of the number of rows of tables. . -. This .result file has been checked OK with Linux 5.0.48, -. build tree ChangeSet@1.2477.6.3, 2007-07-30 -. except that the not fixed Bug#30020 causes a difference. +. This .result file has been checked OK with Linux 5.0.23-bk, +. ChangeSet@1.2211, 2006-06-28 10:11:43-07:00. . -------------------------------------------------------------------------------- @@ -21,21 +20,11 @@ FIXME: There are subtests that are switched off due to known bugs: SELECT 1 AS "have_bug_11589"; have_bug_11589 1 -SELECT 1 AS "have_bug_30689"; -have_bug_30689 -1 There are some statements where the ps-protocol is switched off. This may come from the bug listed below, ir from other problems. Bug#11589: mysqltest, --ps-protocol, strange output, float/double/real with zerofill -------------------------------------------------------------------------------- - -Selects on INFORMATION_SCHEMA.VIEWS present incomplete -content for the column VIEW_DEFINITION in cases where -the view selects(=is based) on an INFORMATION_SCHEMA table. ----> VIEWS vu and vu1 -Bug#30689 Wrong content in I_S.VIEWS.VIEW_DEFINITION if VIEW is based on I_S --------------------------------------------------------------------------------- SET @NO_REFRESH = IF( '' = '', 0, 1); DROP DATABASE IF EXISTS test1; CREATE DATABASE test1; @@ -731,8 +720,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -924,6 +912,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -1406,6 +1478,90 @@ CHECKSUM NULL CREATE_OPTIONS TABLE_COMMENT TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb1 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 10 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb2 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 54 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb3 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 11 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT +TABLE_CATALOG NULL +TABLE_SCHEMA test +TABLE_NAME tb4 +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 10 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION latin1_swedish_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT +TABLE_CATALOG NULL TABLE_SCHEMA test4 TABLE_NAME t6 TABLE_TYPE BASE TABLE @@ -1458,17 +1614,19 @@ NULL db_datadict latin1 BASE TABLE MyISAM NULL db_datadict latin1 BASE TABLE MyISAM NULL db_datadict latin1 BASE TABLE MyISAM NULL db_datadict latin1 BASE TABLE MyISAM -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 SYSTEM VIEW MEMORY +NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY @@ -1486,8 +1644,6 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY -NULL db_datadict latin1 SYSTEM VIEW MyISAM -NULL db_datadict latin1 SYSTEM VIEW MyISAM NULL db_datadict latin1 SYSTEM VIEW MyISAM NULL db_datadict latin1 SYSTEM VIEW MyISAM NULL db_datadict latin1 SYSTEM VIEW MyISAM @@ -1526,17 +1682,19 @@ NULL information_schema utf8 BASE TABLE MyISAM NULL information_schema utf8 BASE TABLE MyISAM NULL information_schema utf8 BASE TABLE MyISAM NULL information_schema utf8 BASE TABLE MyISAM -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 SYSTEM VIEW MEMORY +NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY @@ -1554,8 +1712,6 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY -NULL information_schema utf8 SYSTEM VIEW MyISAM -NULL information_schema utf8 SYSTEM VIEW MyISAM NULL information_schema utf8 SYSTEM VIEW MyISAM NULL information_schema utf8 SYSTEM VIEW MyISAM NULL information_schema utf8 SYSTEM VIEW MyISAM @@ -1594,17 +1750,19 @@ NULL mysql latin1 BASE TABLE MyISAM NULL mysql latin1 BASE TABLE MyISAM NULL mysql latin1 BASE TABLE MyISAM NULL mysql latin1 BASE TABLE MyISAM -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 SYSTEM VIEW MEMORY +NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY @@ -1622,8 +1780,6 @@ NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY -NULL mysql latin1 SYSTEM VIEW MyISAM -NULL mysql latin1 SYSTEM VIEW MyISAM NULL mysql latin1 SYSTEM VIEW MyISAM NULL mysql latin1 SYSTEM VIEW MyISAM NULL mysql latin1 SYSTEM VIEW MyISAM @@ -1662,17 +1818,19 @@ NULL test latin1 BASE TABLE MyISAM NULL test latin1 BASE TABLE MyISAM NULL test latin1 BASE TABLE MyISAM NULL test latin1 BASE TABLE MyISAM -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 SYSTEM VIEW MEMORY +NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY @@ -1690,8 +1848,6 @@ NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY -NULL test latin1 SYSTEM VIEW MyISAM -NULL test latin1 SYSTEM VIEW MyISAM NULL test latin1 SYSTEM VIEW MyISAM NULL test latin1 SYSTEM VIEW MyISAM NULL test latin1 SYSTEM VIEW MyISAM @@ -1730,17 +1886,19 @@ NULL test1 latin1 BASE TABLE MyISAM NULL test1 latin1 BASE TABLE MyISAM NULL test1 latin1 BASE TABLE MyISAM NULL test1 latin1 BASE TABLE MyISAM -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 SYSTEM VIEW MEMORY +NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY @@ -1758,8 +1916,6 @@ NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY -NULL test1 latin1 SYSTEM VIEW MyISAM -NULL test1 latin1 SYSTEM VIEW MyISAM NULL test1 latin1 SYSTEM VIEW MyISAM NULL test1 latin1 SYSTEM VIEW MyISAM NULL test1 latin1 SYSTEM VIEW MyISAM @@ -1798,17 +1954,19 @@ NULL test4 latin1 BASE TABLE MyISAM NULL test4 latin1 BASE TABLE MyISAM NULL test4 latin1 BASE TABLE MyISAM NULL test4 latin1 BASE TABLE MyISAM -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 SYSTEM VIEW MEMORY +NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY @@ -1826,8 +1984,6 @@ NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY -NULL test4 latin1 SYSTEM VIEW MyISAM -NULL test4 latin1 SYSTEM VIEW MyISAM NULL test4 latin1 SYSTEM VIEW MyISAM NULL test4 latin1 SYSTEM VIEW MyISAM NULL test4 latin1 SYSTEM VIEW MyISAM @@ -2713,7 +2869,7 @@ cp932 cp932_japanese_ci SJIS for Windows Japanese 2 eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3 select sum(id) from collations; sum(id) -11094 +10840 select collation_name, character_set_name into @x,@y from collation_character_set_applicability limit 1; select @x, @y; @@ -2727,8 +2883,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh select count(*) from routines; count(*) 1 -select * from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select * from statistics; 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 NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql user 0 mysql PRIMARY 2 User A 3 NULL NULL BTREE @@ -2744,6 +2899,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_apply_status 0 mysql PRIMARY 1 server_id NULL 0 NULL NULL HASH @@ -2975,10 +3138,9 @@ NULL mysql PRIMARY NULL mysql time_zone_transition_type Transition_type_id 2 NUL select count(*) as max_recs from key_column_usage; max_recs 46 -select max(cardinality) from statistics -where not (table_schema = 'mysql' and table_name like 'help_%'); +select max(cardinality) from statistics; max(cardinality) -393 +901 select concat("View '", table_name, "' is associated with the database '", table_schema, "'.") AS "Who is Who for the Views" @@ -3869,8 +4031,7 @@ CHECKSUM NULL CREATE_OPTIONS #CO# TABLE_COMMENT SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') -AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG NULL TABLE_SCHEMA db_datadict TABLE_NAME v1 @@ -4062,6 +4223,90 @@ CREATE_OPTIONS TABLE_COMMENT General log TABLE_CATALOG NULL TABLE_SCHEMA mysql +TABLE_NAME help_category +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 37 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help categories +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_keyword +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 424 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help keywords +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_relation +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Fixed +TABLE_ROWS 901 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT keyword-topic relation +TABLE_CATALOG NULL +TABLE_SCHEMA mysql +TABLE_NAME help_topic +TABLE_TYPE BASE TABLE +ENGINE MyISAM +VERSION 10 +ROW_FORMAT Dynamic +TABLE_ROWS 479 +AVG_ROW_LENGTH #ARL# +DATA_LENGTH #DL# +MAX_DATA_LENGTH #MDL# +INDEX_LENGTH #IL# +DATA_FREE #DF# +AUTO_INCREMENT NULL +CREATE_TIME YYYY-MM-DD hh:mm:ss +UPDATE_TIME YYYY-MM-DD hh:mm:ss +CHECK_TIME YYYY-MM-DD hh:mm:ss +TABLE_COLLATION utf8_general_ci +CHECKSUM NULL +CREATE_OPTIONS +TABLE_COMMENT help topics +TABLE_CATALOG NULL +TABLE_SCHEMA mysql TABLE_NAME host TABLE_TYPE BASE TABLE ENGINE MyISAM @@ -4680,17 +4925,19 @@ NULL db_datadict latin1 BASE TABLE MyISAM NULL db_datadict latin1 BASE TABLE MyISAM NULL db_datadict latin1 BASE TABLE MyISAM NULL db_datadict latin1 BASE TABLE MyISAM -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER -NULL db_datadict latin1 BASE TABLE NDBCLUSTER +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 BASE TABLE ndbcluster +NULL db_datadict latin1 SYSTEM VIEW MEMORY +NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY @@ -4708,8 +4955,6 @@ NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY NULL db_datadict latin1 SYSTEM VIEW MEMORY -NULL db_datadict latin1 SYSTEM VIEW MyISAM -NULL db_datadict latin1 SYSTEM VIEW MyISAM NULL db_datadict latin1 SYSTEM VIEW MyISAM NULL db_datadict latin1 SYSTEM VIEW MyISAM NULL db_datadict latin1 SYSTEM VIEW MyISAM @@ -4748,17 +4993,19 @@ NULL information_schema utf8 BASE TABLE MyISAM NULL information_schema utf8 BASE TABLE MyISAM NULL information_schema utf8 BASE TABLE MyISAM NULL information_schema utf8 BASE TABLE MyISAM -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER -NULL information_schema utf8 BASE TABLE NDBCLUSTER +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 BASE TABLE ndbcluster +NULL information_schema utf8 SYSTEM VIEW MEMORY +NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY @@ -4776,8 +5023,6 @@ NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY NULL information_schema utf8 SYSTEM VIEW MEMORY -NULL information_schema utf8 SYSTEM VIEW MyISAM -NULL information_schema utf8 SYSTEM VIEW MyISAM NULL information_schema utf8 SYSTEM VIEW MyISAM NULL information_schema utf8 SYSTEM VIEW MyISAM NULL information_schema utf8 SYSTEM VIEW MyISAM @@ -4816,17 +5061,19 @@ NULL mysql latin1 BASE TABLE MyISAM NULL mysql latin1 BASE TABLE MyISAM NULL mysql latin1 BASE TABLE MyISAM NULL mysql latin1 BASE TABLE MyISAM -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER -NULL mysql latin1 BASE TABLE NDBCLUSTER +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 BASE TABLE ndbcluster +NULL mysql latin1 SYSTEM VIEW MEMORY +NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY @@ -4844,8 +5091,6 @@ NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY NULL mysql latin1 SYSTEM VIEW MEMORY -NULL mysql latin1 SYSTEM VIEW MyISAM -NULL mysql latin1 SYSTEM VIEW MyISAM NULL mysql latin1 SYSTEM VIEW MyISAM NULL mysql latin1 SYSTEM VIEW MyISAM NULL mysql latin1 SYSTEM VIEW MyISAM @@ -4884,17 +5129,19 @@ NULL test latin1 BASE TABLE MyISAM NULL test latin1 BASE TABLE MyISAM NULL test latin1 BASE TABLE MyISAM NULL test latin1 BASE TABLE MyISAM -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER -NULL test latin1 BASE TABLE NDBCLUSTER +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 BASE TABLE ndbcluster +NULL test latin1 SYSTEM VIEW MEMORY +NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY @@ -4912,8 +5159,6 @@ NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY NULL test latin1 SYSTEM VIEW MEMORY -NULL test latin1 SYSTEM VIEW MyISAM -NULL test latin1 SYSTEM VIEW MyISAM NULL test latin1 SYSTEM VIEW MyISAM NULL test latin1 SYSTEM VIEW MyISAM NULL test latin1 SYSTEM VIEW MyISAM @@ -4952,17 +5197,19 @@ NULL test1 latin1 BASE TABLE MyISAM NULL test1 latin1 BASE TABLE MyISAM NULL test1 latin1 BASE TABLE MyISAM NULL test1 latin1 BASE TABLE MyISAM -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER -NULL test1 latin1 BASE TABLE NDBCLUSTER +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 BASE TABLE ndbcluster +NULL test1 latin1 SYSTEM VIEW MEMORY +NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY @@ -4980,8 +5227,6 @@ NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY NULL test1 latin1 SYSTEM VIEW MEMORY -NULL test1 latin1 SYSTEM VIEW MyISAM -NULL test1 latin1 SYSTEM VIEW MyISAM NULL test1 latin1 SYSTEM VIEW MyISAM NULL test1 latin1 SYSTEM VIEW MyISAM NULL test1 latin1 SYSTEM VIEW MyISAM @@ -5020,17 +5265,19 @@ NULL test4 latin1 BASE TABLE MyISAM NULL test4 latin1 BASE TABLE MyISAM NULL test4 latin1 BASE TABLE MyISAM NULL test4 latin1 BASE TABLE MyISAM -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER -NULL test4 latin1 BASE TABLE NDBCLUSTER +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 BASE TABLE ndbcluster +NULL test4 latin1 SYSTEM VIEW MEMORY +NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY @@ -5048,8 +5295,6 @@ NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY NULL test4 latin1 SYSTEM VIEW MEMORY -NULL test4 latin1 SYSTEM VIEW MyISAM -NULL test4 latin1 SYSTEM VIEW MyISAM NULL test4 latin1 SYSTEM VIEW MyISAM NULL test4 latin1 SYSTEM VIEW MyISAM NULL test4 latin1 SYSTEM VIEW MyISAM @@ -5149,19 +5394,19 @@ COUNT(*) 6 SELECT COUNT(*) FROM information_schema. tables ; COUNT(*) -64 +68 SELECT COUNT(*) FROM information_schema. columns ; COUNT(*) -590 +832 SELECT COUNT(*) FROM information_schema. character_sets ; COUNT(*) 36 SELECT COUNT(*) FROM information_schema. collations ; COUNT(*) -128 +127 SELECT COUNT(*) FROM information_schema. collation_character_set_applicability ; COUNT(*) -129 +128 SELECT COUNT(*) FROM information_schema. routines ; COUNT(*) 1 @@ -5214,10 +5459,10 @@ NULL test1 latin1 NULL test4 latin1 select count(*) as tot_tabs from tables; tot_tabs -61 +65 select count(*) as the_cols from columns; the_cols -565 +807 select max(maxlen) as the_max from character_sets; the_max 3 @@ -5238,10 +5483,10 @@ utf8_esperanto_ci utf8 utf8_estonian_ci utf8 select routine_definition from routines; routine_definition -select * from statistics where table_name not like 'help_%' -group by index_name asc limit 0, 5; +select * from statistics group by index_name asc limit 0, 5; 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 NULL mysql procs_priv 1 mysql Grantor 1 Grantor A NULL NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE NULL mysql user 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE select concat(table_schema, ', ', table_name, ', ', view_definition) view_info @@ -5355,9 +5600,9 @@ NULL test latin1 latin1_swedish_ci NULL NULL test1 latin1 latin1_swedish_ci NULL select distinct grantee from user_privileges; grantee -'root'@'127.0.0.1' -'root'@'<SERVER_NAME>' 'root'@'localhost' +'root'@'<SERVER_NAME>' +'root'@'127.0.0.1' select all grantee from user_privileges order by grantee, privilege_type; grantee 'root'@'127.0.0.1' @@ -7307,7 +7552,7 @@ Testcase 3.2.1.14: DROP DATABASE IF EXISTS db_datadict; CREATE DATABASE db_datadict; USE db_datadict; -create table res_t_401014(f1 char(10), f2 varchar(25), f3 int); +create table res_t_401014(f1 char(10), f2 text(25), f3 int); create view res_v_401014 as select * from res_t_401014; create procedure sp_6_401014() select 'db_datadict'; create function fn_6_401014() returns int return 0; @@ -7330,10 +7575,10 @@ from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references NULL db_datadict res_v_401014 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) select,insert,update,references -NULL db_datadict res_v_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_v_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_v_401014 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable from information_schema.views @@ -7452,7 +7697,7 @@ WHERE trigger_schema LIKE 'db_datadict%'; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION use db_datadict; alter table res_t_401014 change f1 ff1 int; -alter table res_t_401014 engine = MEMORY; +alter table res_t_401014 engine = innodb; alter table res_t_401014 change f3 f3_new bigint; alter view res_v_401014 as select ff1 from res_t_401014; alter procedure sp_6_401014 sql security invoker; @@ -7470,14 +7715,14 @@ select table_catalog, table_schema, engine from information_schema.tables where table_schema like 'db_datadict%'; table_catalog table_schema engine -NULL db_datadict MEMORY +NULL db_datadict InnoDB NULL db_datadict NULL select * from information_schema.columns where table_schema like 'db_datadict%'; 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 CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT NULL db_datadict res_t_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references -NULL db_datadict res_t_401014 f2 2 NULL YES varchar 25 25 NULL NULL latin1 latin1_swedish_ci varchar(25) select,insert,update,references +NULL db_datadict res_t_401014 f2 2 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NULL db_datadict res_t_401014 f3_new 3 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL db_datadict res_v_401014 ff1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references select table_schema, table_name, is_updatable @@ -7936,15 +8181,15 @@ information_schema TRIGGERS MyISAM information_schema USER_PRIVILEGES MEMORY information_schema VIEWS MyISAM db_datadict res_t_401016 MyISAM -test t1 NDBCLUSTER -test t10 NDBCLUSTER -test t11 NDBCLUSTER -test t2 NDBCLUSTER -test t3 NDBCLUSTER -test t4 NDBCLUSTER -test t7 NDBCLUSTER -test t8 NDBCLUSTER -test t9 NDBCLUSTER +test t1 ndbcluster +test t10 ndbcluster +test t11 ndbcluster +test t2 ndbcluster +test t3 ndbcluster +test t4 ndbcluster +test t7 ndbcluster +test t8 ndbcluster +test t9 ndbcluster test tb1 MyISAM test tb2 MyISAM test tb3 MyISAM @@ -8118,7 +8363,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -8917,7 +9161,6 @@ utf8_roman_ci utf8_persian_ci utf8_esperanto_ci utf8_hungarian_ci -utf8_general_cs ucs2_general_ci ucs2_bin ucs2_unicode_ci @@ -9283,7 +9526,6 @@ utf8_roman_ci utf8 207 Yes 8 utf8_persian_ci utf8 208 Yes 8 utf8_esperanto_ci utf8 209 Yes 8 utf8_hungarian_ci utf8 210 Yes 8 -utf8_general_cs utf8 254 Yes 1 ucs2_general_ci ucs2 35 Yes Yes 1 ucs2_bin ucs2 90 Yes 1 ucs2_unicode_ci ucs2 128 Yes 8 @@ -9447,7 +9689,6 @@ utf8_roman_ci utf8 utf8_persian_ci utf8 utf8_esperanto_ci utf8 utf8_hungarian_ci utf8 -utf8_general_cs utf8 ucs2_general_ci ucs2 ucs2_bin ucs2 ucs2_unicode_ci ucs2 @@ -13604,15 +13845,15 @@ NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NUL NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW -NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 +NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -13653,15 +13894,15 @@ WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL -NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 +NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -13702,15 +13943,15 @@ WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL db_datadict tb3 BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict v3 VIEW NULL NULL NULL NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss NULL NULL NULL VIEW -NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 +NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -13748,7 +13989,7 @@ NULL information_schema TRIGGERS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# # NULL information_schema USER_PRIVILEGES SYSTEM VIEW MEMORY 10 Fixed NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# NULL information_schema VIEWS SYSTEM VIEW MyISAM 10 Dynamic NULL #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL #CO# SELECT * FROM information_schema.tables -WHERE NOT( table_schema = 'information_schema') AND NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +WHERE NOT( table_schema = 'information_schema'); TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT NULL db_datadict tb1 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL db_datadict tb2 BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -13760,6 +14001,10 @@ NULL mysql db BASE TABLE MyISAM 10 Fixed 3 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY- NULL mysql event BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Events NULL mysql func BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL User defined functions NULL mysql general_log BASE TABLE CSV 10 Dynamic 1 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL General log +NULL mysql help_category BASE TABLE MyISAM 10 Fixed 37 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories +NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 424 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords +NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 901 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation +NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 479 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics NULL mysql host BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_bin NULL Host privileges; Merged with database privileges NULL mysql ndb_apply_status BASE TABLE ndbcluster 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL mysql ndb_binlog_index BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL @@ -13774,20 +14019,20 @@ NULL mysql time_zone_leap_second BASE TABLE MyISAM 10 Fixed 22 #ARL# #DL# #MDL# NULL mysql time_zone_name BASE TABLE MyISAM 10 Fixed 6 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone names NULL mysql time_zone_transition BASE TABLE MyISAM 10 Fixed 393 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transitions NULL mysql time_zone_transition_type BASE TABLE MyISAM 10 Fixed 31 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL Time zone transition types -NULL test t1 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t10 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t11 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t2 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t3 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t4 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t7 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t8 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 -NULL test t9 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 +NULL test t1 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t10 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t11 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t2 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t3 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t4 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t7 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t8 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL +NULL test t9 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb1 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb2 BASE TABLE MyISAM 10 Dynamic 54 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb3 BASE TABLE MyISAM 10 Dynamic 11 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL NULL test tb4 BASE TABLE MyISAM 10 Dynamic 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL -NULL test4 t6 BASE TABLE NDBCLUSTER 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL number_of_replicas: 2 +NULL test4 t6 BASE TABLE ndbcluster 10 Fixed 10 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss latin1_swedish_ci NULL DROP USER 'user_1'@'localhost'; DROP USER 'user_2'@'localhost'; DROP USER 'user_3'@'localhost'; @@ -13987,8 +14232,7 @@ TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_ root@localhost db_datadict_2 REVOKE SELECT ON db_datadict.tb_6_401402_1 FROM 'user_1'@'localhost'; -SELECT * FROM information_schema.statistics -WHERE NOT (table_schema = 'mysql' AND table_name LIKE 'help_%'); +SELECT * FROM information_schema.statistics; 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 NULL db_datadict tb_6_401402_1 0 db_datadict PRIMARY 1 f1 A 0 NULL NULL BTREE NULL db_datadict tb_6_401402_1 1 db_datadict f2_ind 1 f2 A NULL NULL NULL YES BTREE @@ -14012,6 +14256,14 @@ NULL mysql db 1 mysql User 1 User A 1 NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 1 db A NULL NULL NULL BTREE NULL mysql event 0 mysql PRIMARY 2 name A 0 NULL NULL BTREE NULL mysql func 0 mysql PRIMARY 1 name A 0 NULL NULL BTREE +NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 37 NULL NULL BTREE +NULL mysql help_category 0 mysql name 1 name A 37 NULL NULL BTREE +NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 424 NULL NULL BTREE +NULL mysql help_keyword 0 mysql name 1 name A 424 NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE +NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 901 NULL NULL BTREE +NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 479 NULL NULL BTREE +NULL mysql help_topic 0 mysql name 1 name A 479 NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 1 Host A NULL NULL NULL BTREE NULL mysql host 0 mysql PRIMARY 2 Db A 0 NULL NULL BTREE NULL mysql ndb_apply_status 0 mysql PRIMARY 1 server_id NULL 0 NULL NULL HASH diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result index 62aa5432e98..7fced87fc3d 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result @@ -81,6 +81,7 @@ BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1' +USE db_storedproc_1; root@localhost db_storedproc_1 GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost'; @@ -92,6 +93,7 @@ CREATE PROCEDURE sp1(v1 char(20)) BEGIN SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz'; END// +USE db_storedproc_1; root@localhost db_storedproc_1 DROP USER 'user_1'@'localhost'; @@ -117,6 +119,7 @@ CREATE FUNCTION fn1(v1 int) returns int BEGIN return v1; END// +USE db_storedproc_1; root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result index 4c1f226401f..ffedbec83fe 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result @@ -58,7 +58,6 @@ load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11; Section 3.1.10 - CALL checks: -------------------------------------------------------------------------------- -USE db_storedproc; Testcase 3.1.10.2 + 3.1.10.5: ----------------------------- @@ -95,6 +94,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc CALL sp31102(); @@ -114,6 +114,7 @@ a` a` 1000-01-01 -5000 a` -5000 SELECT fn31105( 9 ); fn31105( 9 ) 81 +USE db_storedproc; root@localhost db_storedproc REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost'; @@ -131,6 +132,7 @@ CALL sp31102(); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' SELECT fn31105( 9 ); ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' +USE db_storedproc; root@localhost db_storedproc DROP PROCEDURE sp31102; diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc index e2b9e846b97..02b8690f687 100755 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc @@ -18,9 +18,9 @@ let $message= Section 3.1.6 - Privilege Checks:; --source include/show_msg80.inc -USE db_storedproc_1; connection default; +USE db_storedproc_1; --source suite/funcs_1/include/show_connection.inc # ------------------------------------------------------------------------------ @@ -58,6 +58,7 @@ disconnect user1a; # add privilege again and check connection default; +USE db_storedproc_1; --source suite/funcs_1/include/show_connection.inc GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost'; @@ -77,6 +78,7 @@ disconnect user1b; # cleanup connection default; +USE db_storedproc_1; --source suite/funcs_1/include/show_connection.inc DROP USER 'user_1'@'localhost'; @@ -132,6 +134,7 @@ disconnect user2; # cleanup connection default; +USE db_storedproc_1; --source suite/funcs_1/include/show_connection.inc drop user 'user_1'@'localhost'; diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc index e69a95a724e..2c2e99dc8f4 100755 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc @@ -21,7 +21,6 @@ let $message= Section 3.1.10 - CALL checks:; --source include/show_msg80.inc -USE db_storedproc; # ------------------------------------------------------------------------------ let $message= Testcase 3.1.10.2 + 3.1.10.5:; @@ -80,6 +79,7 @@ SELECT fn31105( 9 ); # now 'add' EXECUTE to INVOKER connection default; +USE db_storedproc; --source suite/funcs_1/include/show_connection.inc # root can execute ... CALL sp31102(); @@ -98,6 +98,7 @@ disconnect user2_3; # now 'remove' SELECT from INVOKER connection default; +USE db_storedproc; --source suite/funcs_1/include/show_connection.inc REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost'; FLUSH PRIVILEGES; @@ -115,6 +116,7 @@ disconnect user2_4; # cleanup connection default; +USE db_storedproc; --source suite/funcs_1/include/show_connection.inc DROP PROCEDURE sp31102; diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result new file mode 100644 index 00000000000..fb819b03ad3 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_bug31076.result @@ -0,0 +1,65 @@ +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; +CREATE DATABASE track; +USE track; +CREATE TABLE `visits` ( +`visits_id` int(11) unsigned NOT NULL AUTO_INCREMENT, +`myid` varchar(32) NOT NULL DEFAULT '', +`src` varchar(64) NOT NULL DEFAULT '', +`ip` int(10) unsigned NOT NULL DEFAULT '0', +`cc` char(2) NOT NULL DEFAULT '', +`org` varchar(80) DEFAULT NULL, +`ref` varchar(255) NOT NULL DEFAULT '', +`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +`host` varchar(30) NOT NULL DEFAULT '', +`entry` varchar(255) NOT NULL DEFAULT '', +`visit_exit` varchar(255) NOT NULL DEFAULT '', +`user_id` int(11) unsigned NOT NULL DEFAULT '0', +`visit_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +PRIMARY KEY (`visits_id`), +KEY `ip` (`ip`), +KEY `time` (`time`), +KEY `user_id` (`user_id`) +) ENGINE=MyISAM AUTO_INCREMENT=21293381 DEFAULT CHARSET=latin1; +CREATE TABLE `visits_events` ( +`event_id` mediumint(8) unsigned NOT NULL DEFAULT '0', +`visit_id` int(11) unsigned NOT NULL DEFAULT '0', +`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, +`src` varchar(64) NOT NULL DEFAULT '', +`data` varchar(255) NOT NULL DEFAULT '', +`visits_events_id` int(11) unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`visits_events_id`), +KEY `event_id` (`event_id`), +KEY `visit_id` (`visit_id`), +KEY `data` (`data`) +) ENGINE=MyISAM AUTO_INCREMENT=33900731 DEFAULT CHARSET=latin1; +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +BINLOG ' +Bk3vRhO0AQAAOAAAALcLyQkAAJlXFwIAAAAABXRyYWNrAA12aXNpdHNfZXZlbnRzAAYJAwcPDwM= +Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR +TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC +'/*!*/; +SET INSERT_ID=21231039/*!*/; +use track/*!*/; +SET TIMESTAMP=1190087942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.time_zone='UTC'/*!*/; +INSERT INTO visits (myid, user_id, src, ip, cc, org, ref, time, host, entry, visit_exit, visit_start) +VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'), '', '', 'http://dev.mysql.com/downloads/connector/j/3.0.html', NULL, 'dev.mysql.com', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', NOW())/*!*/; +Warnings: +Warning 1366 Incorrect integer value: '' for column 'user_id' at row 1 +SELECT * FROM visits; +visits_id myid src ip cc org ref time host entry visit_exit user_id visit_start +21231039 3m3l4rhs6do0sf5p1i9lr94g928a272v 1198947426 http://dev.mysql.com/downloads/connector/j/3.0.html 2007-09-18 03:59:02 dev.mysql.com /get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick /get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick 0 2007-09-18 03:59:02 +SELECT * FROM visits_events; +event_id visit_id timestamp src data visits_events_id +20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207 +DROP DATABASE track; +End of 5.1 tests diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result new file mode 100644 index 00000000000..fb2782ed9f4 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result @@ -0,0 +1,167 @@ +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; +use test; +CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, +dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, +fkid MEDIUMINT, filler VARCHAR(255), +PRIMARY KEY(id)) ENGINE='innodb'; +CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, +dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, +fkid MEDIUMINT, filler VARCHAR(255), +PRIMARY KEY(id)) ENGINE='innodb' +PARTITION BY KEY(id) partitions 5; +CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, +dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, +fkid MEDIUMINT, filler VARCHAR(255), +PRIMARY KEY(id)) ENGINE='innodb' +PARTITION BY RANGE(id) +SUBPARTITION BY hash(id) subpartitions 2 +(PARTITION pa1 values less than (10), +PARTITION pa2 values less than (20), +PARTITION pa3 values less than (30), +PARTITION pa4 values less than (40), +PARTITION pa5 values less than (50), +PARTITION pa6 values less than (60), +PARTITION pa7 values less than (70), +PARTITION pa8 values less than (80), +PARTITION pa9 values less than (90), +PARTITION pa10 values less than (100), +PARTITION pa11 values less than MAXVALUE); +CREATE PROCEDURE test.proc_norm() +BEGIN +DECLARE ins_count INT DEFAULT 1000; +DECLARE del_count INT; +DECLARE cur_user VARCHAR(255); +DECLARE local_uuid VARCHAR(255); +DECLARE local_time TIMESTAMP; +SET local_time= NOW(); +SET cur_user= CURRENT_USER(); +SET local_uuid= UUID(); +WHILE ins_count > 0 DO +INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(), +ins_count,'Going to test MBR for MySQL'); +SET ins_count = ins_count - 1; +END WHILE; +SELECT MAX(id) FROM test.regular_tbl INTO del_count; +WHILE del_count > 0 DO +DELETE FROM test.regular_tbl WHERE id = del_count; +SET del_count = del_count - 2; +END WHILE; +END| +CREATE PROCEDURE test.proc_bykey() +BEGIN +DECLARE ins_count INT DEFAULT 1000; +DECLARE del_count INT; +DECLARE cur_user VARCHAR(255); +DECLARE local_uuid VARCHAR(255); +DECLARE local_time TIMESTAMP; +SET local_time= NOW(); +SET cur_user= CURRENT_USER(); +SET local_uuid= UUID(); +WHILE ins_count > 0 DO +INSERT INTO test.bykey_tbl VALUES (NULL, NOW(), USER() , UUID(), +ins_count,'Going to test MBR for MySQL'); +SET ins_count = ins_count - 1; +END WHILE; +SELECT MAX(id) FROM test.bykey_tbl INTO del_count; +WHILE del_count > 0 DO +DELETE FROM test.bykey_tbl WHERE id = del_count; +SET del_count = del_count - 2; +END WHILE; +END| +CREATE PROCEDURE test.proc_byrange() +BEGIN +DECLARE ins_count INT DEFAULT 1000; +DECLARE del_count INT; +DECLARE cur_user VARCHAR(255); +DECLARE local_uuid VARCHAR(255); +DECLARE local_time TIMESTAMP; +SET local_time= NOW(); +SET cur_user = CURRENT_USER(); +SET local_uuid=UUID(); +WHILE ins_count > 0 DO +INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), USER(), UUID(), +ins_count,'Going to test MBR for MySQL'); +SET ins_count = ins_count - 1; +END WHILE; +SELECT MAX(id) FROM test.byrange_tbl INTO del_count; +WHILE del_count > 0 DO +DELETE FROM test.byrange_tbl WHERE id = del_count; +SET del_count = del_count - 2; +END WHILE; +END| +CALL test.proc_norm(); +SELECT count(*) as "Master regular" FROM test.regular_tbl; +Master regular 500 +CALL test.proc_bykey(); +SELECT count(*) as "Master bykey" FROM test.bykey_tbl; +Master bykey 500 +CALL test.proc_byrange(); +SELECT count(*) as "Master byrange" FROM test.byrange_tbl; +Master byrange 500 +show create table test.byrange_tbl; +Table byrange_tbl +Create Table CREATE TABLE `byrange_tbl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `user` char(255) DEFAULT NULL, + `uuidf` longblob, + `fkid` mediumint(9) DEFAULT NULL, + `filler` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION pa2 VALUES LESS THAN (20) ENGINE = InnoDB, PARTITION pa3 VALUES LESS THAN (30) ENGINE = InnoDB, PARTITION pa4 VALUES LESS THAN (40) ENGINE = InnoDB, PARTITION pa5 VALUES LESS THAN (50) ENGINE = InnoDB, PARTITION pa6 VALUES LESS THAN (60) ENGINE = InnoDB, PARTITION pa7 VALUES LESS THAN (70) ENGINE = InnoDB, PARTITION pa8 VALUES LESS THAN (80) ENGINE = InnoDB, PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */ +show slave status; +Slave_IO_State Waiting for master to send event +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_PORT +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 945470 +Relay_Log_File slave-relay-bin.000003 +Relay_Log_Pos 945616 +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +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 945470 +Relay_Log_Space 945771 +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +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 +SELECT count(*) "Slave norm" FROM test.regular_tbl; +Slave norm 500 +SELECT count(*) "Slave bykey" FROM test.bykey_tbl; +Slave bykey 500 +SELECT count(*) "Slave byrange" FROM test.byrange_tbl; +Slave byrange 500 +DROP PROCEDURE test.proc_norm; +DROP PROCEDURE test.proc_bykey; +DROP PROCEDURE test.proc_byrange; +DROP TABLE test.regular_tbl; +DROP TABLE test.bykey_tbl; +DROP TABLE test.byrange_tbl; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result new file mode 100644 index 00000000000..abff02b4b07 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result @@ -0,0 +1,35 @@ +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; +use test; +CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, +dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, +fkid MEDIUMINT, filler VARCHAR(255), +PRIMARY KEY(id)) ENGINE='innodb'; +CREATE PROCEDURE test.proc_norm() +BEGIN +DECLARE ins_count INT DEFAULT 1000; +DECLARE del_count INT; +DECLARE cur_user VARCHAR(255); +DECLARE local_uuid VARCHAR(255); +DECLARE local_time TIMESTAMP; +SET local_time= NOW(); +SET cur_user= CURRENT_USER(); +SET local_uuid= UUID(); +WHILE ins_count > 0 DO +INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(), +ins_count,'Going to test MBR for MySQL'); +SET ins_count = ins_count - 1; +END WHILE; +SELECT MAX(id) FROM test.regular_tbl INTO del_count; +WHILE del_count > 0 DO +DELETE FROM test.regular_tbl WHERE id = del_count; +SET del_count = del_count - 2; +END WHILE; +END| +CALL test.proc_norm(); +DROP PROCEDURE test.proc_norm; +DROP TABLE test.regular_tbl; diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result new file mode 100644 index 00000000000..42aa4ff302b --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30919.result @@ -0,0 +1,1043 @@ +use test; +CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, +dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, +fkid MEDIUMINT, filler VARCHAR(255), +PRIMARY KEY(id)) ENGINE='innodb' +PARTITION BY RANGE(id) +SUBPARTITION BY hash(id) subpartitions 2 +(PARTITION pa3 values less than (42), +PARTITION pa6 values less than (60), +PARTITION pa7 values less than (70), +PARTITION pa8 values less than (80), +PARTITION pa9 values less than (90), +PARTITION pa10 values less than (100), +PARTITION pa11 values less than MAXVALUE); +CREATE PROCEDURE test.proc_part() +BEGIN +DECLARE ins_count INT DEFAULT 1000; +DECLARE del_count INT; +DECLARE cur_user VARCHAR(255); +DECLARE local_uuid VARCHAR(255); +DECLARE local_time TIMESTAMP; +SET local_time= NOW(); +SET cur_user= CURRENT_USER(); +SET local_uuid= UUID(); +WHILE ins_count > 0 DO +INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(), +ins_count,'Going to test MBR for MySQL'); +SET ins_count = ins_count - 1; +END WHILE; +SELECT MAX(id) FROM test.part_tbl INTO del_count; +WHILE del_count > 0 DO +DELETE FROM test.part_tbl WHERE id = del_count; +select count(*) as internal_count, del_count -- these two lines are for +FROM test.part_tbl; -- debug to show the problem +SET del_count = del_count - 2; +END WHILE; +END| +CALL test.proc_part(); +internal_count del_count +999 1000 +internal_count del_count +998 998 +internal_count del_count +997 996 +internal_count del_count +996 994 +internal_count del_count +995 992 +internal_count del_count +994 990 +internal_count del_count +993 988 +internal_count del_count +992 986 +internal_count del_count +991 984 +internal_count del_count +990 982 +internal_count del_count +989 980 +internal_count del_count +988 978 +internal_count del_count +987 976 +internal_count del_count +986 974 +internal_count del_count +985 972 +internal_count del_count +984 970 +internal_count del_count +983 968 +internal_count del_count +982 966 +internal_count del_count +981 964 +internal_count del_count +980 962 +internal_count del_count +979 960 +internal_count del_count +978 958 +internal_count del_count +977 956 +internal_count del_count +976 954 +internal_count del_count +975 952 +internal_count del_count +974 950 +internal_count del_count +973 948 +internal_count del_count +972 946 +internal_count del_count +971 944 +internal_count del_count +970 942 +internal_count del_count +969 940 +internal_count del_count +968 938 +internal_count del_count +967 936 +internal_count del_count +966 934 +internal_count del_count +965 932 +internal_count del_count +964 930 +internal_count del_count +963 928 +internal_count del_count +962 926 +internal_count del_count +961 924 +internal_count del_count +960 922 +internal_count del_count +959 920 +internal_count del_count +958 918 +internal_count del_count +957 916 +internal_count del_count +956 914 +internal_count del_count +955 912 +internal_count del_count +954 910 +internal_count del_count +953 908 +internal_count del_count +952 906 +internal_count del_count +951 904 +internal_count del_count +950 902 +internal_count del_count +949 900 +internal_count del_count +948 898 +internal_count del_count +947 896 +internal_count del_count +946 894 +internal_count del_count +945 892 +internal_count del_count +944 890 +internal_count del_count +943 888 +internal_count del_count +942 886 +internal_count del_count +941 884 +internal_count del_count +940 882 +internal_count del_count +939 880 +internal_count del_count +938 878 +internal_count del_count +937 876 +internal_count del_count +936 874 +internal_count del_count +935 872 +internal_count del_count +934 870 +internal_count del_count +933 868 +internal_count del_count +932 866 +internal_count del_count +931 864 +internal_count del_count +930 862 +internal_count del_count +929 860 +internal_count del_count +928 858 +internal_count del_count +927 856 +internal_count del_count +926 854 +internal_count del_count +925 852 +internal_count del_count +924 850 +internal_count del_count +923 848 +internal_count del_count +922 846 +internal_count del_count +921 844 +internal_count del_count +920 842 +internal_count del_count +919 840 +internal_count del_count +918 838 +internal_count del_count +917 836 +internal_count del_count +916 834 +internal_count del_count +915 832 +internal_count del_count +914 830 +internal_count del_count +913 828 +internal_count del_count +912 826 +internal_count del_count +911 824 +internal_count del_count +910 822 +internal_count del_count +909 820 +internal_count del_count +908 818 +internal_count del_count +907 816 +internal_count del_count +906 814 +internal_count del_count +905 812 +internal_count del_count +904 810 +internal_count del_count +903 808 +internal_count del_count +902 806 +internal_count del_count +901 804 +internal_count del_count +900 802 +internal_count del_count +899 800 +internal_count del_count +898 798 +internal_count del_count +897 796 +internal_count del_count +896 794 +internal_count del_count +895 792 +internal_count del_count +894 790 +internal_count del_count +893 788 +internal_count del_count +892 786 +internal_count del_count +891 784 +internal_count del_count +890 782 +internal_count del_count +889 780 +internal_count del_count +888 778 +internal_count del_count +887 776 +internal_count del_count +886 774 +internal_count del_count +885 772 +internal_count del_count +884 770 +internal_count del_count +883 768 +internal_count del_count +882 766 +internal_count del_count +881 764 +internal_count del_count +880 762 +internal_count del_count +879 760 +internal_count del_count +878 758 +internal_count del_count +877 756 +internal_count del_count +876 754 +internal_count del_count +875 752 +internal_count del_count +874 750 +internal_count del_count +873 748 +internal_count del_count +872 746 +internal_count del_count +871 744 +internal_count del_count +870 742 +internal_count del_count +869 740 +internal_count del_count +868 738 +internal_count del_count +867 736 +internal_count del_count +866 734 +internal_count del_count +865 732 +internal_count del_count +864 730 +internal_count del_count +863 728 +internal_count del_count +862 726 +internal_count del_count +861 724 +internal_count del_count +860 722 +internal_count del_count +859 720 +internal_count del_count +858 718 +internal_count del_count +857 716 +internal_count del_count +856 714 +internal_count del_count +855 712 +internal_count del_count +854 710 +internal_count del_count +853 708 +internal_count del_count +852 706 +internal_count del_count +851 704 +internal_count del_count +850 702 +internal_count del_count +849 700 +internal_count del_count +848 698 +internal_count del_count +847 696 +internal_count del_count +846 694 +internal_count del_count +845 692 +internal_count del_count +844 690 +internal_count del_count +843 688 +internal_count del_count +842 686 +internal_count del_count +841 684 +internal_count del_count +840 682 +internal_count del_count +839 680 +internal_count del_count +838 678 +internal_count del_count +837 676 +internal_count del_count +836 674 +internal_count del_count +835 672 +internal_count del_count +834 670 +internal_count del_count +833 668 +internal_count del_count +832 666 +internal_count del_count +831 664 +internal_count del_count +830 662 +internal_count del_count +829 660 +internal_count del_count +828 658 +internal_count del_count +827 656 +internal_count del_count +826 654 +internal_count del_count +825 652 +internal_count del_count +824 650 +internal_count del_count +823 648 +internal_count del_count +822 646 +internal_count del_count +821 644 +internal_count del_count +820 642 +internal_count del_count +819 640 +internal_count del_count +818 638 +internal_count del_count +817 636 +internal_count del_count +816 634 +internal_count del_count +815 632 +internal_count del_count +814 630 +internal_count del_count +813 628 +internal_count del_count +812 626 +internal_count del_count +811 624 +internal_count del_count +810 622 +internal_count del_count +809 620 +internal_count del_count +808 618 +internal_count del_count +807 616 +internal_count del_count +806 614 +internal_count del_count +805 612 +internal_count del_count +804 610 +internal_count del_count +803 608 +internal_count del_count +802 606 +internal_count del_count +801 604 +internal_count del_count +800 602 +internal_count del_count +799 600 +internal_count del_count +798 598 +internal_count del_count +797 596 +internal_count del_count +796 594 +internal_count del_count +795 592 +internal_count del_count +794 590 +internal_count del_count +793 588 +internal_count del_count +792 586 +internal_count del_count +791 584 +internal_count del_count +790 582 +internal_count del_count +789 580 +internal_count del_count +788 578 +internal_count del_count +787 576 +internal_count del_count +786 574 +internal_count del_count +785 572 +internal_count del_count +784 570 +internal_count del_count +783 568 +internal_count del_count +782 566 +internal_count del_count +781 564 +internal_count del_count +780 562 +internal_count del_count +779 560 +internal_count del_count +778 558 +internal_count del_count +777 556 +internal_count del_count +776 554 +internal_count del_count +775 552 +internal_count del_count +774 550 +internal_count del_count +773 548 +internal_count del_count +772 546 +internal_count del_count +771 544 +internal_count del_count +770 542 +internal_count del_count +769 540 +internal_count del_count +768 538 +internal_count del_count +767 536 +internal_count del_count +766 534 +internal_count del_count +765 532 +internal_count del_count +764 530 +internal_count del_count +763 528 +internal_count del_count +762 526 +internal_count del_count +761 524 +internal_count del_count +760 522 +internal_count del_count +759 520 +internal_count del_count +758 518 +internal_count del_count +757 516 +internal_count del_count +756 514 +internal_count del_count +755 512 +internal_count del_count +754 510 +internal_count del_count +753 508 +internal_count del_count +752 506 +internal_count del_count +751 504 +internal_count del_count +750 502 +internal_count del_count +749 500 +internal_count del_count +748 498 +internal_count del_count +747 496 +internal_count del_count +746 494 +internal_count del_count +745 492 +internal_count del_count +744 490 +internal_count del_count +743 488 +internal_count del_count +742 486 +internal_count del_count +741 484 +internal_count del_count +740 482 +internal_count del_count +739 480 +internal_count del_count +738 478 +internal_count del_count +737 476 +internal_count del_count +736 474 +internal_count del_count +735 472 +internal_count del_count +734 470 +internal_count del_count +733 468 +internal_count del_count +732 466 +internal_count del_count +731 464 +internal_count del_count +730 462 +internal_count del_count +729 460 +internal_count del_count +728 458 +internal_count del_count +727 456 +internal_count del_count +726 454 +internal_count del_count +725 452 +internal_count del_count +724 450 +internal_count del_count +723 448 +internal_count del_count +722 446 +internal_count del_count +721 444 +internal_count del_count +720 442 +internal_count del_count +719 440 +internal_count del_count +718 438 +internal_count del_count +717 436 +internal_count del_count +716 434 +internal_count del_count +715 432 +internal_count del_count +714 430 +internal_count del_count +713 428 +internal_count del_count +712 426 +internal_count del_count +711 424 +internal_count del_count +710 422 +internal_count del_count +709 420 +internal_count del_count +708 418 +internal_count del_count +707 416 +internal_count del_count +706 414 +internal_count del_count +705 412 +internal_count del_count +704 410 +internal_count del_count +703 408 +internal_count del_count +702 406 +internal_count del_count +701 404 +internal_count del_count +700 402 +internal_count del_count +699 400 +internal_count del_count +698 398 +internal_count del_count +697 396 +internal_count del_count +696 394 +internal_count del_count +695 392 +internal_count del_count +694 390 +internal_count del_count +693 388 +internal_count del_count +692 386 +internal_count del_count +691 384 +internal_count del_count +690 382 +internal_count del_count +689 380 +internal_count del_count +688 378 +internal_count del_count +687 376 +internal_count del_count +686 374 +internal_count del_count +685 372 +internal_count del_count +684 370 +internal_count del_count +683 368 +internal_count del_count +682 366 +internal_count del_count +681 364 +internal_count del_count +680 362 +internal_count del_count +679 360 +internal_count del_count +678 358 +internal_count del_count +677 356 +internal_count del_count +676 354 +internal_count del_count +675 352 +internal_count del_count +674 350 +internal_count del_count +673 348 +internal_count del_count +672 346 +internal_count del_count +671 344 +internal_count del_count +670 342 +internal_count del_count +669 340 +internal_count del_count +668 338 +internal_count del_count +667 336 +internal_count del_count +666 334 +internal_count del_count +665 332 +internal_count del_count +664 330 +internal_count del_count +663 328 +internal_count del_count +662 326 +internal_count del_count +661 324 +internal_count del_count +660 322 +internal_count del_count +659 320 +internal_count del_count +658 318 +internal_count del_count +657 316 +internal_count del_count +656 314 +internal_count del_count +655 312 +internal_count del_count +654 310 +internal_count del_count +653 308 +internal_count del_count +652 306 +internal_count del_count +651 304 +internal_count del_count +650 302 +internal_count del_count +649 300 +internal_count del_count +648 298 +internal_count del_count +647 296 +internal_count del_count +646 294 +internal_count del_count +645 292 +internal_count del_count +644 290 +internal_count del_count +643 288 +internal_count del_count +642 286 +internal_count del_count +641 284 +internal_count del_count +640 282 +internal_count del_count +639 280 +internal_count del_count +638 278 +internal_count del_count +637 276 +internal_count del_count +636 274 +internal_count del_count +635 272 +internal_count del_count +634 270 +internal_count del_count +633 268 +internal_count del_count +632 266 +internal_count del_count +631 264 +internal_count del_count +630 262 +internal_count del_count +629 260 +internal_count del_count +628 258 +internal_count del_count +627 256 +internal_count del_count +626 254 +internal_count del_count +625 252 +internal_count del_count +624 250 +internal_count del_count +623 248 +internal_count del_count +622 246 +internal_count del_count +621 244 +internal_count del_count +620 242 +internal_count del_count +619 240 +internal_count del_count +618 238 +internal_count del_count +617 236 +internal_count del_count +616 234 +internal_count del_count +615 232 +internal_count del_count +614 230 +internal_count del_count +613 228 +internal_count del_count +612 226 +internal_count del_count +611 224 +internal_count del_count +610 222 +internal_count del_count +609 220 +internal_count del_count +608 218 +internal_count del_count +607 216 +internal_count del_count +606 214 +internal_count del_count +605 212 +internal_count del_count +604 210 +internal_count del_count +603 208 +internal_count del_count +602 206 +internal_count del_count +601 204 +internal_count del_count +600 202 +internal_count del_count +599 200 +internal_count del_count +598 198 +internal_count del_count +597 196 +internal_count del_count +596 194 +internal_count del_count +595 192 +internal_count del_count +594 190 +internal_count del_count +593 188 +internal_count del_count +592 186 +internal_count del_count +591 184 +internal_count del_count +590 182 +internal_count del_count +589 180 +internal_count del_count +588 178 +internal_count del_count +587 176 +internal_count del_count +586 174 +internal_count del_count +585 172 +internal_count del_count +584 170 +internal_count del_count +583 168 +internal_count del_count +582 166 +internal_count del_count +581 164 +internal_count del_count +580 162 +internal_count del_count +579 160 +internal_count del_count +578 158 +internal_count del_count +577 156 +internal_count del_count +576 154 +internal_count del_count +575 152 +internal_count del_count +574 150 +internal_count del_count +573 148 +internal_count del_count +572 146 +internal_count del_count +571 144 +internal_count del_count +570 142 +internal_count del_count +569 140 +internal_count del_count +568 138 +internal_count del_count +567 136 +internal_count del_count +566 134 +internal_count del_count +565 132 +internal_count del_count +564 130 +internal_count del_count +563 128 +internal_count del_count +562 126 +internal_count del_count +561 124 +internal_count del_count +560 122 +internal_count del_count +559 120 +internal_count del_count +558 118 +internal_count del_count +557 116 +internal_count del_count +556 114 +internal_count del_count +555 112 +internal_count del_count +554 110 +internal_count del_count +553 108 +internal_count del_count +552 106 +internal_count del_count +551 104 +internal_count del_count +550 102 +internal_count del_count +549 100 +internal_count del_count +548 98 +internal_count del_count +547 96 +internal_count del_count +546 94 +internal_count del_count +545 92 +internal_count del_count +544 90 +internal_count del_count +543 88 +internal_count del_count +542 86 +internal_count del_count +541 84 +internal_count del_count +540 82 +internal_count del_count +539 80 +internal_count del_count +538 78 +internal_count del_count +537 76 +internal_count del_count +536 74 +internal_count del_count +535 72 +internal_count del_count +534 70 +internal_count del_count +533 68 +internal_count del_count +532 66 +internal_count del_count +531 64 +internal_count del_count +530 62 +internal_count del_count +529 60 +internal_count del_count +528 58 +internal_count del_count +527 56 +internal_count del_count +526 54 +internal_count del_count +525 52 +internal_count del_count +524 50 +internal_count del_count +523 48 +internal_count del_count +522 46 +internal_count del_count +521 44 +internal_count del_count +520 42 +internal_count del_count +519 40 +internal_count del_count +518 38 +internal_count del_count +517 36 +internal_count del_count +516 34 +internal_count del_count +515 32 +internal_count del_count +514 30 +internal_count del_count +513 28 +internal_count del_count +512 26 +internal_count del_count +511 24 +internal_count del_count +510 22 +internal_count del_count +509 20 +internal_count del_count +508 18 +internal_count del_count +507 16 +internal_count del_count +506 14 +internal_count del_count +505 12 +internal_count del_count +504 10 +internal_count del_count +503 8 +internal_count del_count +502 6 +internal_count del_count +501 4 +internal_count del_count +500 2 +select count(*) as Part from test.part_tbl; +Part +500 +DROP PROCEDURE test.proc_part; +DROP TABLE test.part_tbl; diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test new file mode 100644 index 00000000000..cc8b26ac8f4 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -0,0 +1,117 @@ +source include/master-slave.inc; + +CREATE DATABASE track; +USE track; + +CREATE TABLE `visits` ( + `visits_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `myid` varchar(32) NOT NULL DEFAULT '', + `src` varchar(64) NOT NULL DEFAULT '', + `ip` int(10) unsigned NOT NULL DEFAULT '0', + `cc` char(2) NOT NULL DEFAULT '', + `org` varchar(80) DEFAULT NULL, + `ref` varchar(255) NOT NULL DEFAULT '', + `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `host` varchar(30) NOT NULL DEFAULT '', + `entry` varchar(255) NOT NULL DEFAULT '', + `visit_exit` varchar(255) NOT NULL DEFAULT '', + `user_id` int(11) unsigned NOT NULL DEFAULT '0', + `visit_start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`visits_id`), + KEY `ip` (`ip`), + KEY `time` (`time`), + KEY `user_id` (`user_id`) +) ENGINE=MyISAM AUTO_INCREMENT=21293381 DEFAULT CHARSET=latin1; + +CREATE TABLE `visits_events` ( + `event_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `visit_id` int(11) unsigned NOT NULL DEFAULT '0', + `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `src` varchar(64) NOT NULL DEFAULT '', + `data` varchar(255) NOT NULL DEFAULT '', + `visits_events_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`visits_events_id`), + KEY `event_id` (`event_id`), + KEY `visit_id` (`visit_id`), + KEY `data` (`data`) +) ENGINE=MyISAM AUTO_INCREMENT=33900731 DEFAULT CHARSET=latin1; + +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +--delimiter /*!*/; +# at 164170623 +# at 164170679 +#7918 3:59:2 server id 436 end_log_pos 164170679 +# 9c90b7f 06 4d ef 46 13 b4 01 00 00 38 00 00 00 b7 0b c9 |.M.F.....8......| +# 9c90b8f 09 00 00 99 57 17 02 00 00 00 00 05 74 72 61 63 |....W.......trac| +# 9c90b9f 6b 00 0d 76 69 |k..vi| +# Table_map: `track`.`visits_events` mapped to number 35084185 +#7918 3:59:2 server id 436 end_log_pos 164170769 +# 9c90bb7 06 4d ef 46 17 b4 01 00 00 5a 00 00 00 11 0c c9 |.M.F.....Z......| +# 9c90bc7 09 10 00 99 57 17 02 00 00 01 00 06 ff c0 20 4e |....W..........N| +# 9c90bd7 00 be f5 43 01 06 4d ef 46 00 2b 44 6f 77 6e 6c |...C..M.F..Downl| +# 9c90be7 6f 61 64 73 2f 4d 79 53 51 4c 2d 34 2e 31 2f 6d |oads.MySQL.4.1.m| +# 9c90bf7 79 73 71 6c 2d 34 2e |ysql.4.| +# Write_rows: table id 35084185 flags: STMT_END_F + +BINLOG ' +Bk3vRhO0AQAAOAAAALcLyQkAAJlXFwIAAAAABXRyYWNrAA12aXNpdHNfZXZlbnRzAAYJAwcPDwM= +Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR +TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC +'/*!*/; +# at 164170769 +#7918 3:59:2 server id 436 end_log_pos 164170797 +# 9c90c11 06 4d ef 46 05 b4 01 00 00 |.M.F.....| +# Intvar +SET INSERT_ID=21231039/*!*/; +# at 164170797 +#7918 3:59:2 server id 436 end_log_pos 164171293 +# 9c90c2d 06 4d ef 46 02 b4 01 00 00 f0 01 00 00 1d 0e c9 |.M.F............| +# 9c90c3d 09 10 00 28 80 af 01 00 00 00 00 05 00 00 1f 00 |................| +# 9c90c4d 00 00 40 00 00 01 00 00 00 00 00 00 00 00 06 03 |................| +# 9c90c5d 73 74 64 04 08 00 08 00 08 00 05 03 55 54 43 74 |std.........UTCt| +# 9c90c6d 72 61 63 6b 00 49 4e 53 45 52 54 20 49 4e 54 4f |rack.INSERT.INTO| +# 9c90c7d 20 76 69 73 69 74 73 20 28 6d 79 69 64 2c 20 75 |.visits..myid..u| +# 9c90c8d 73 65 72 5f 69 64 2c 20 73 72 63 2c 20 69 70 2c |ser.id..src..ip.| +# 9c90c9d 20 63 63 2c 20 6f 72 67 2c 20 72 65 66 2c 20 74 |.cc..org..ref..t| +# 9c90cad 69 6d 65 2c 20 68 6f 73 74 2c 20 65 6e 74 72 79 |ime..host..entry| +# 9c90cbd 2c 20 76 69 73 69 74 5f 65 78 69 74 2c 20 76 69 |..visit.exit..vi| +# 9c90ccd 73 69 74 5f 73 74 61 72 74 29 0a 09 09 09 56 41 |sit.start.....VA| +# 9c90cdd 4c 55 45 53 20 28 27 33 6d 33 6c 34 72 68 73 36 |LUES...3m3l4rhs6| +# 9c90ced 64 6f 30 73 66 35 70 31 69 39 6c 72 39 34 67 39 |do0sf5p1i9lr94g9| +# 9c90cfd 32 38 61 32 37 32 76 27 2c 20 27 27 2c 20 27 27 |28a272v.........| +# 9c90d0d 2c 20 49 4e 45 54 5f 41 54 4f 4e 28 27 37 31 2e |..INET.ATON..71.| +# 9c90d1d 31 31 38 2e 31 32 34 2e 39 38 27 29 2c 20 27 27 |118.124.98......| +# 9c90d2d 2c 20 27 27 2c 20 27 68 74 74 70 3a 2f 2f 64 65 |.......http...de| +# 9c90d3d 76 2e 6d 79 73 71 6c 2e 63 6f 6d 2f 64 6f 77 6e |v.mysql.com.down| +# 9c90d4d 6c 6f 61 64 73 2f 63 6f 6e 6e 65 63 74 6f 72 2f |loads.connector.| +# 9c90d5d 6a 2f 33 2e 30 2e 68 74 6d 6c 27 2c 20 4e 55 4c |j.3.0.html...NUL| +# 9c90d6d 4c 2c 20 27 64 65 76 2e 6d 79 73 71 6c 2e 63 6f |L...dev.mysql.co| +# 9c90d7d 6d 27 2c 20 27 2f 67 65 74 2f 44 6f 77 6e 6c 6f |m.....get.Downlo| +# 9c90d8d 61 64 73 2f 43 6f 6e 6e 65 63 74 6f 72 2d 4a 2f |ads.Connector.J.| +# 9c90d9d 6d 79 73 71 6c 2d 63 6f 6e 6e 65 63 74 6f 72 2d |mysql.connector.| +# 9c90dad 6a 61 76 61 2d 33 2e 30 2e 31 37 2d 67 61 2e 7a |java.3.0.17.ga.z| +# 9c90dbd 69 70 2f 66 72 6f 6d 2f 70 69 63 6b 27 2c 20 27 |ip.from.pick....| +# 9c90dcd 2f 67 65 74 2f 44 6f 77 6e 6c 6f 61 64 73 2f 43 |.get.Downloads.C| +# 9c90ddd 6f 6e 6e 65 63 74 6f 72 2d 4a 2f 6d 79 73 71 6c |onnector.J.mysql| +# 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 +use track/*!*/; +SET TIMESTAMP=1190087942/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.sql_mode=0/*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.time_zone='UTC'/*!*/; +INSERT INTO visits (myid, user_id, src, ip, cc, org, ref, time, host, entry, visit_exit, visit_start) +VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'), '', '', 'http://dev.mysql.com/downloads/connector/j/3.0.html', NULL, 'dev.mysql.com', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', '/get/Downloads/Connector-J/mysql-connector-java-3.0.17-ga.zip/from/pick', NOW())/*!*/; +# at 164171293 + +--delimiter ; + +SELECT * FROM visits; +SELECT * FROM visits_events; + +# Cleanup +DROP DATABASE track; +--echo End of 5.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_innodb-master.opt new file mode 100644 index 00000000000..8636d2d8734 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb-master.opt @@ -0,0 +1 @@ +--innodb --innodb_autoinc_lock_mode=0 diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt new file mode 100644 index 00000000000..8636d2d8734 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-master.opt @@ -0,0 +1 @@ +--innodb --innodb_autoinc_lock_mode=0 diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt new file mode 100644 index 00000000000..8636d2d8734 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430-slave.opt @@ -0,0 +1 @@ +--innodb --innodb_autoinc_lock_mode=0 diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test new file mode 100644 index 00000000000..fe3881ab08f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test @@ -0,0 +1,154 @@ +--source include/have_innodb.inc +--source include/have_binlog_format_mixed_or_row.inc +--source include/master-slave.inc + +# Set the default connection to 'master' + +--vertical_results + +let $engine_type= 'innodb'; + +######## Creat Table Section ######### +use test; + +eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, + dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, + fkid MEDIUMINT, filler VARCHAR(255), + PRIMARY KEY(id)) ENGINE=$engine_type; + +eval CREATE TABLE test.bykey_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, + dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, + fkid MEDIUMINT, filler VARCHAR(255), + PRIMARY KEY(id)) ENGINE=$engine_type + PARTITION BY KEY(id) partitions 5; + +eval CREATE TABLE test.byrange_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, + dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, + fkid MEDIUMINT, filler VARCHAR(255), + PRIMARY KEY(id)) ENGINE=$engine_type + PARTITION BY RANGE(id) + SUBPARTITION BY hash(id) subpartitions 2 + (PARTITION pa1 values less than (10), + PARTITION pa2 values less than (20), + PARTITION pa3 values less than (30), + PARTITION pa4 values less than (40), + PARTITION pa5 values less than (50), + PARTITION pa6 values less than (60), + PARTITION pa7 values less than (70), + PARTITION pa8 values less than (80), + PARTITION pa9 values less than (90), + PARTITION pa10 values less than (100), + PARTITION pa11 values less than MAXVALUE); + +######## Create SPs, Functions, Views and Triggers Section ############## + +delimiter |; +CREATE PROCEDURE test.proc_norm() +BEGIN + DECLARE ins_count INT DEFAULT 1000; + DECLARE del_count INT; + DECLARE cur_user VARCHAR(255); + DECLARE local_uuid VARCHAR(255); + DECLARE local_time TIMESTAMP; + + SET local_time= NOW(); + SET cur_user= CURRENT_USER(); + SET local_uuid= UUID(); + + WHILE ins_count > 0 DO + INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(), + ins_count,'Going to test MBR for MySQL'); + SET ins_count = ins_count - 1; + END WHILE; + + SELECT MAX(id) FROM test.regular_tbl INTO del_count; + WHILE del_count > 0 DO + DELETE FROM test.regular_tbl WHERE id = del_count; + SET del_count = del_count - 2; + END WHILE; +END| + +CREATE PROCEDURE test.proc_bykey() +BEGIN + DECLARE ins_count INT DEFAULT 1000; + DECLARE del_count INT; + DECLARE cur_user VARCHAR(255); + DECLARE local_uuid VARCHAR(255); + DECLARE local_time TIMESTAMP; + + SET local_time= NOW(); + SET cur_user= CURRENT_USER(); + SET local_uuid= UUID(); + + WHILE ins_count > 0 DO + INSERT INTO test.bykey_tbl VALUES (NULL, NOW(), USER() , UUID(), + ins_count,'Going to test MBR for MySQL'); + SET ins_count = ins_count - 1; + END WHILE; + + SELECT MAX(id) FROM test.bykey_tbl INTO del_count; + WHILE del_count > 0 DO + DELETE FROM test.bykey_tbl WHERE id = del_count; + SET del_count = del_count - 2; + END WHILE; +END| + +CREATE PROCEDURE test.proc_byrange() +BEGIN + DECLARE ins_count INT DEFAULT 1000; + DECLARE del_count INT; + DECLARE cur_user VARCHAR(255); + DECLARE local_uuid VARCHAR(255); + DECLARE local_time TIMESTAMP; + + SET local_time= NOW(); + SET cur_user = CURRENT_USER(); + SET local_uuid=UUID(); + + WHILE ins_count > 0 DO + INSERT INTO test.byrange_tbl VALUES (NULL, NOW(), USER(), UUID(), + ins_count,'Going to test MBR for MySQL'); + SET ins_count = ins_count - 1; + END WHILE; + + SELECT MAX(id) FROM test.byrange_tbl INTO del_count; + WHILE del_count > 0 DO + DELETE FROM test.byrange_tbl WHERE id = del_count; + SET del_count = del_count - 2; + END WHILE; +END| + +delimiter ;| + +############ Finish Setup Section ################### + + +############ Test Section ################### + +CALL test.proc_norm(); +SELECT count(*) as "Master regular" FROM test.regular_tbl; +CALL test.proc_bykey(); +SELECT count(*) as "Master bykey" FROM test.bykey_tbl; +CALL test.proc_byrange(); +SELECT count(*) as "Master byrange" FROM test.byrange_tbl; + +--sync_slave_with_master +connection slave; +show create table test.byrange_tbl; +--replace_column 4 MASTER_PORT 33 # +show slave status; +SELECT count(*) "Slave norm" FROM test.regular_tbl; +SELECT count(*) "Slave bykey" FROM test.bykey_tbl; +SELECT count(*) "Slave byrange" FROM test.byrange_tbl; + +###### CLEAN UP SECTION ############## + +connection master; +DROP PROCEDURE test.proc_norm; +DROP PROCEDURE test.proc_bykey; +DROP PROCEDURE test.proc_byrange; +DROP TABLE test.regular_tbl; +DROP TABLE test.bykey_tbl; +DROP TABLE test.byrange_tbl; + +--source include/master-slave-end.inc diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test new file mode 100644 index 00000000000..4311328b064 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test @@ -0,0 +1,66 @@ +--source include/have_innodb.inc +--source include/have_binlog_format_mixed_or_row.inc +--source include/master-slave.inc + +# Set the default connection to 'master' + +--vertical_results + +#let $engine_type= 'myisam'; +let $engine_type= 'innodb'; + +######## Creat Table Section ######### +use test; + +eval CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, + dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, + fkid MEDIUMINT, filler VARCHAR(255), + PRIMARY KEY(id)) ENGINE=$engine_type; + +######## Create SPs, Functions, Views and Triggers Section ############## + +delimiter |; +CREATE PROCEDURE test.proc_norm() +BEGIN + DECLARE ins_count INT DEFAULT 1000; + DECLARE del_count INT; + DECLARE cur_user VARCHAR(255); + DECLARE local_uuid VARCHAR(255); + DECLARE local_time TIMESTAMP; + + SET local_time= NOW(); + SET cur_user= CURRENT_USER(); + SET local_uuid= UUID(); + + WHILE ins_count > 0 DO + INSERT INTO test.regular_tbl VALUES (NULL, NOW(), USER() , UUID(), + ins_count,'Going to test MBR for MySQL'); + SET ins_count = ins_count - 1; + END WHILE; + + SELECT MAX(id) FROM test.regular_tbl INTO del_count; + WHILE del_count > 0 DO + DELETE FROM test.regular_tbl WHERE id = del_count; + SET del_count = del_count - 2; + END WHILE; +END| + +delimiter ;| + +############ Finish Setup Section ################### + + +############ Test Section ################### + +CALL test.proc_norm(); + +--sync_slave_with_master + +###### CLEAN UP SECTION ############## + +connection master; +DROP PROCEDURE test.proc_norm; +DROP TABLE test.regular_tbl; + +--source include/master-slave-end.inc + diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt b/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt new file mode 100644 index 00000000000..8636d2d8734 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30919-master.opt @@ -0,0 +1 @@ +--innodb --innodb_autoinc_lock_mode=0 diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test b/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test new file mode 100644 index 00000000000..a3779c68021 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30919.test @@ -0,0 +1,67 @@ +--source include/have_innodb.inc +--vertical_results +let $engine_type= 'innodb'; + +######## Creat Table Section ######### +use test; + +eval CREATE TABLE test.part_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT, + dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, + fkid MEDIUMINT, filler VARCHAR(255), + PRIMARY KEY(id)) ENGINE=$engine_type + PARTITION BY RANGE(id) + SUBPARTITION BY hash(id) subpartitions 2 + (PARTITION pa3 values less than (42), + PARTITION pa6 values less than (60), + PARTITION pa7 values less than (70), + PARTITION pa8 values less than (80), + PARTITION pa9 values less than (90), + PARTITION pa10 values less than (100), + PARTITION pa11 values less than MAXVALUE); + +######## Create SPs, Functions, Views and Triggers Section ############## + +delimiter |; + +CREATE PROCEDURE test.proc_part() +BEGIN + DECLARE ins_count INT DEFAULT 1000; + DECLARE del_count INT; + DECLARE cur_user VARCHAR(255); + DECLARE local_uuid VARCHAR(255); + DECLARE local_time TIMESTAMP; + + SET local_time= NOW(); + SET cur_user= CURRENT_USER(); + SET local_uuid= UUID(); + + WHILE ins_count > 0 DO + INSERT INTO test.part_tbl VALUES (NULL, NOW(), USER() , UUID(), + ins_count,'Going to test MBR for MySQL'); + SET ins_count = ins_count - 1; + END WHILE; + SELECT MAX(id) FROM test.part_tbl INTO del_count; + WHILE del_count > 0 DO + DELETE FROM test.part_tbl WHERE id = del_count; + select count(*) as internal_count, del_count -- these two lines are for + FROM test.part_tbl; -- debug to show the problem + SET del_count = del_count - 2; + END WHILE; +END| + +delimiter ;| + +############ Finish Setup Section ################### + +############ Test Section ################### +--horizontal_results + +CALL test.proc_part(); + +select count(*) as Part from test.part_tbl; + +###### CLEAN UP SECTION ############## + +DROP PROCEDURE test.proc_part; +DROP TABLE test.part_tbl; + diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index c1b7bc2097b..59f0bf6a6f8 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -76,6 +76,16 @@ if (`select $slave_count != $master_count`) echo master and slave differed in number of rows; echo master: $master_count; echo slave: $slave_count; + + connection master; + echo === master ===; + select count(*) t1; + select * from t1; + connection slave; + echo === slave ===; + select count(*) t1; + select * from t1; + query_vertical show slave status; } connection master; diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 63baeebcf12..028c64d6de7 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -1,9 +1,9 @@ -# + # Testing of CASE # --disable_warnings -drop table if exists t1,t2; +drop table if exists t1, t2; --enable_warnings select CASE "b" when "a" then 1 when "b" then 2 END; @@ -152,4 +152,21 @@ SELECT IFNULL(t2.EMPNUM,t1.EMPNUM) AS CEMPNUM, FROM t1 LEFT JOIN t2 ON t1.EMPNUM=t2.EMPNUM; DROP TABLE t1,t2; -# End of 4.1 tests + +--echo End of 4.1 tests + +# +# #30782: Truncated UNSIGNED BIGINT columns +# +create table t1 (a int, b bigint unsigned); +create table t2 (c int); +insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997), + (3,11120436154190595086); +insert into t2 (c) values (1), (2), (3); +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 + join t2 on t1.a=t2.c order by d; +select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1 + join t2 on t1.a=t2.c where b=11120436154190595086 order by d; +drop table t1, t2; + +--echo End of 5.0 tests diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test new file mode 100644 index 00000000000..d0cdfc8a741 --- /dev/null +++ b/mysql-test/t/change_user.test @@ -0,0 +1,35 @@ +# +# Bug#20023 mysql_change_user() resets the value of SQL_BIG_SELECTS +# + +--echo Bug#20023 +SELECT @@session.sql_big_selects; +SELECT @@global.max_join_size; +--echo change_user +--change_user +SELECT @@session.sql_big_selects; +SELECT @@global.max_join_size; +SET @@global.max_join_size = 10000; +SET @@session.max_join_size = default; +--echo change_user +--change_user +SELECT @@session.sql_big_selects; +SET @@global.max_join_size = -1; +SET @@session.max_join_size = default; +--echo change_user +--change_user +SELECT @@session.sql_big_selects; + +# +# Bug#31418 User locks misfunctioning after mysql_change_user() +# + +--echo Bug#31418 +SELECT IS_FREE_LOCK('bug31418'); +SELECT IS_USED_LOCK('bug31418'); +SELECT GET_LOCK('bug31418', 1); +SELECT IS_USED_LOCK('bug31418') = CONNECTION_ID(); +--echo change_user +--change_user +SELECT IS_FREE_LOCK('bug31418'); +SELECT IS_USED_LOCK('bug31418'); diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 341c019af6e..05ca9dca26d 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -658,6 +658,82 @@ drop table t1, t2; --error 1367 create table t1(a set("a,b","c,d") not null); +# +# Bug #20901 - CREATE privilege is enough to insert into a table +# + +create database mysqltest; +use mysqltest; + +grant create on mysqltest.* to mysqltest@localhost; +create table t1 (i INT); + +connect (user1,localhost,mysqltest,,mysqltest); +connection user1; +# show we don't have INSERT +--error 1142 +insert into t1 values (1); +# show we have CREATE +create table t2 (i INT); +create table t4 (i INT); + +connection default; +grant select, insert on mysqltest.t2 to mysqltest@localhost; +grant insert on mysqltest.t4 to mysqltest@localhost; +# to specify ACLs for non-existent objects, must explictly |CREATE +grant create, insert on mysqltest.t5 to mysqltest@localhost; +grant create, insert on mysqltest.t6 to mysqltest@localhost; +flush privileges; + +connection user1; +insert into t2 values (1); + + +# CREATE IF NOT EXISTS...SELECT, t1 exists, no INSERT, must fail +--error 1142 +create table if not exists t1 select * from t2; + +# CREATE IF NOT EXISTS...SELECT, no t3 yet, no INSERT, must fail +--error 1142 +create table if not exists t3 select * from t2; + +# CREATE IF NOT EXISTS...SELECT, t4 exists, have INSERT, must succeed +create table if not exists t4 select * from t2; + +# CREATE IF NOT EXISTS...SELECT, no t5 yet, have INSERT, must succeed +create table if not exists t5 select * from t2; + + +# CREATE...SELECT, no t6 yet, have INSERT, must succeed +create table t6 select * from t2; + +# CREATE...SELECT, no t7 yet, no INSERT, must fail +--error 1142 +create table t7 select * from t2; + +# CREATE...SELECT, t4 exists, have INSERT, must still fail (exists) +--error 1050 +create table t4 select * from t2; + +# CREATE...SELECT, t1 exists, no INSERT, must fail +--error 1142 +create table t1 select * from t2; + + +connection default; +drop table t1,t2,t4,t5,t6; + +revoke create on mysqltest.* from mysqltest@localhost; +revoke select, insert on mysqltest.t2 from mysqltest@localhost; +revoke insert on mysqltest.t4 from mysqltest@localhost; +revoke create, insert on mysqltest.t5 from mysqltest@localhost; +revoke create, insert on mysqltest.t6 from mysqltest@localhost; +flush privileges; + +disconnect user1; +drop database mysqltest; +use test; + # End of 4.1 tests @@ -1197,14 +1273,17 @@ drop table t1,t2; CREATE DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; --error 1102 DROP DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; ---error 1049 -RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a; ---error 1102 -RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; -create database mysqltest; ---error 1102 -RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; -drop database mysqltest; + +# TODO: enable these tests when RENAME DATABASE is implemented. +# --error 1049 +# RENAME DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa TO a; +# --error 1102 +# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; +# create database mysqltest; +# --error 1102 +# RENAME DATABASE mysqltest TO aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; +# drop database mysqltest; + --error 1102 USE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; --error 1102 @@ -1300,4 +1379,29 @@ return 0; drop view имÑ_вью_кодировке_утф8_длиной_больше_чем_42; drop table имÑ_таблицы_в_кодировке_утф8_длиной_больше_чем_48; set names default; + +# +# Bug#21136 CREATE TABLE SELECT within CREATE TABLE SELECT causes server crash +# + +--disable_warnings +drop table if exists t1,t2,t3; +drop function if exists f1; +--enable_warnings + +--delimiter | +create function f1() returns int +begin + declare res int; + create temporary table t3 select 1 i; + set res:= (select count(*) from t1); + drop temporary table t3; + return res; +end| +--delimiter ; +create table t1 as select 1; +create table t2 as select f1() from t1; +drop table t1,t2; +drop function f1; + --echo End of 5.1 tests diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 5c877557dfc..6c83fbfdc9c 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1322,7 +1322,7 @@ drop table if exists t1,t2,t3,t4; DROP TABLE IF EXISTS bug13894; --enable_warnings -CREATE TABLE bug13894 ( val integer ) ENGINE = CSV; +CREATE TABLE bug13894 ( val integer not null ) ENGINE = CSV; INSERT INTO bug13894 VALUES (5); INSERT INTO bug13894 VALUES (10); INSERT INTO bug13894 VALUES (11); @@ -1340,7 +1340,7 @@ DROP TABLE bug13894; DROP TABLE IF EXISTS bug14672; --enable_warnings -CREATE TABLE bug14672 (c1 integer) engine = CSV; +CREATE TABLE bug14672 (c1 integer not null) engine = CSV; INSERT INTO bug14672 VALUES (1), (2), (3); SELECT * FROM bug14672; DELETE FROM bug14672 WHERE c1 = 2; @@ -1357,7 +1357,7 @@ DROP TABLE bug14672; # Test CONCURRENT INSERT (5.1) # -CREATE TABLE test_concurrent_insert ( val integer ) ENGINE = CSV; +CREATE TABLE test_concurrent_insert ( val integer not null ) ENGINE = CSV; connect (con1,localhost,root,,); connect (con2,localhost,root,,); @@ -1393,7 +1393,7 @@ DROP TABLE test_concurrent_insert; # Check that repair on the newly created table works fine -CREATE TABLE test_repair_table ( val integer ) ENGINE = CSV; +CREATE TABLE test_repair_table ( val integer not null ) ENGINE = CSV; CHECK TABLE test_repair_table; REPAIR TABLE test_repair_table; @@ -1405,7 +1405,7 @@ DROP TABLE test_repair_table; # restore the meta-file # -CREATE TABLE test_repair_table2 ( val integer ) ENGINE = CSV; +CREATE TABLE test_repair_table2 ( val integer not null ) ENGINE = CSV; --remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table2.CSM # Should give a warning and perform autorepair. We also disable ps-protocol @@ -1423,7 +1423,7 @@ DROP TABLE test_repair_table2; # Corrupt csv file and see if we can repair it -CREATE TABLE test_repair_table3 ( val integer ) ENGINE = CSV; +CREATE TABLE test_repair_table3 ( val integer not null ) ENGINE = CSV; --remove_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV --write_file $MYSQLTEST_VARDIR/master-data/test/test_repair_table3.CSV "1" @@ -1517,7 +1517,7 @@ DROP TABLE test_repair_table5; # BUG#13406 - incorrect amount of "records deleted" # -create table t1 (a int) engine=csv; +create table t1 (a int not null) engine=csv; insert t1 values (1); --enable_info delete from t1; # delete_row @@ -1549,7 +1549,7 @@ drop table t1; # whole alter table code is being tested all around the test suite already. # -create table t1 (v varchar(32)); +create table t1 (v varchar(32) not null); insert into t1 values ('def'),('abc'),('hij'),('3r4f'); select * from t1; # Fast alter, no copy performed @@ -1583,8 +1583,8 @@ drop table t1; # resulted in scanning through deleted memory and we were geting a crash. # that's why we need two tables in the bugtest -create table bug15205 (val int(11) default null) engine=csv; -create table bug15205_2 (val int(11) default null) engine=csv; +create table bug15205 (val int(11) not null) engine=csv; +create table bug15205_2 (val int(11) not null) engine=csv; --remove_file $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV # system error (can't open the datafile) --replace_result $MYSQLTEST_VARDIR . master-data/ '' @@ -1604,8 +1604,8 @@ drop table bug15205_2; # set names latin1; create table t1 ( - c varchar(1), - name varchar(64) + c varchar(1) not null, + name varchar(64) not null ) character set latin1 engine=csv; insert into t1 values (0xC0,'LATIN CAPITAL LETTER A WITH GRAVE'); insert into t1 values (0xE0,'LATIN SMALL LETTER A WITH GRAVE'); @@ -1623,9 +1623,9 @@ drop table t1; # Bug#22080 "CHECK fails to identify some corruption" # -create table bug22080_1 (id int,string varchar(64)) Engine=CSV; -create table bug22080_2 (id int,string varchar(64)) Engine=CSV; -create table bug22080_3 (id int,string varchar(64)) Engine=CSV; +create table bug22080_1 (id int not null,string varchar(64) not null) Engine=CSV; +create table bug22080_2 (id int not null,string varchar(64) not null) Engine=CSV; +create table bug22080_3 (id int not null,string varchar(64) not null) Engine=CSV; insert into bug22080_1 values(1,'string'); insert into bug22080_1 values(2,'string'); insert into bug22080_1 values(3,'string'); @@ -1655,7 +1655,7 @@ drop tables bug22080_1,bug22080_2,bug22080_3; # # Testing float type # -create table float_test (id float,string varchar(64)) Engine=CSV; +create table float_test (id float not null,string varchar(64) not null) Engine=CSV; insert into float_test values(1.0,'string'); insert into float_test values(2.23,'serg.g'); insert into float_test values(0.03,'string'); @@ -1670,12 +1670,12 @@ drop table float_test; # CREATE TABLE `bug21328` ( - `col1` int(11) DEFAULT NULL, - `col2` int(11) DEFAULT NULL, - `col3` int(11) DEFAULT NULL + `col1` int(11) NOT NULL, + `col2` int(11) NOT NULL, + `col3` int(11) NOT NULL ) ENGINE=CSV; -insert into bug21328 values (1,NULL,NULL); +insert into bug21328 values (1,0,0); alter table bug21328 engine=myisam; drop table bug21328; @@ -1683,7 +1683,7 @@ drop table bug21328; # BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table make server # crash # -create table t1(a blob, b int) engine=csv; +create table t1(a blob not null, b int not null) engine=csv; insert into t1 values('a', 1); flush tables; update t1 set b=2; @@ -1693,13 +1693,13 @@ drop table t1; # # Bug #29353: negative values # -create table t1(a int) engine=csv; +create table t1(a int not null) engine=csv; insert into t1 values(-1), (-123.34), (2), (-23); select * from t1; check table t1; drop table t1; -create table t1(a int, b int) engine=csv; +create table t1(a int not null, b int not null) engine=csv; --remove_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV --write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV 1, 1E-2 @@ -1717,7 +1717,7 @@ drop table t1; # # Bug #29411: deleting from a csv table leads to the table corruption # -create table t1(a int) engine=csv; +create table t1(a int not null) engine=csv; insert into t1 values (0), (1), (2); delete from t1 limit 2; check table t1; @@ -1727,4 +1727,43 @@ check table t1; select * from t1; drop table t1; +# +# Bug #31473: does not work with NULL value in datetime field +# +create table t1(a datetime not null) engine=csv; +insert into t1 values(); +select * from t1; +drop table t1; +create table t1(a set('foo','bar') not null) engine=csv; +insert into t1 values(); +select * from t1; +drop table t1; +create table t1(a varchar(32) not null) engine=csv; +insert into t1 values(); +select * from t1; +drop table t1; +create table t1(a int not null) engine=csv; +insert into t1 values(); +select * from t1; +drop table t1; +create table t1(a blob not null) engine=csv; +insert into t1 values(); +select * from t1; +drop table t1; +create table t1(a bit(1) not null) engine=csv; +insert into t1 values(); +select BIN(a) from t1; +drop table t1; +# We prevent creation of table with nullable ENUM +--error ER_CANT_CREATE_TABLE +create table t1(a enum('foo','bar') default null) engine=csv; +--error ER_CANT_CREATE_TABLE +create table t1(a enum('foo','bar') default 'foo') engine=csv; +# Enum columns must be specified as NOT NULL +create table t1(a enum('foo','bar') default 'foo' not null) engine=csv; +insert into t1 values(); +select * from t1; +drop table t1; + + --echo End of 5.1 tests diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index bca3a9c3a96..a56a8b6eeed 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -547,6 +547,18 @@ select quote(name) from bug20536; drop table bug20536; +# +# Bug #31615: crash after set names ucs2 collate xxx +# +--error 1231 +set names ucs2; +--error 1231 +set names ucs2 collate ucs2_bin; +--error 1231 +set character_set_client= ucs2; +--error 1231 +set character_set_client= concat('ucs', substr('2', 1)); + --echo End of 4.1 tests # diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 396c06f43e7..03b4f8b3013 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -251,4 +251,35 @@ CREATE TABLE t2(c1 INT) ENGINE=MERGE UNION=(t1); --error 1031 INSERT DELAYED INTO t2 VALUES(1); DROP TABLE t1, t2; +# +# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client +# +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings +SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; +CREATE TABLE `t1` ( + `id` int(11) PRIMARY KEY auto_increment, + `f1` varchar(10) NOT NULL UNIQUE +); +INSERT DELAYED INTO t1 VALUES(0,"test1"); +sleep 1; +SELECT * FROM t1; +SET SQL_MODE='PIPES_AS_CONCAT'; +INSERT DELAYED INTO t1 VALUES(0,'a' || 'b'); +sleep 1; +SELECT * FROM t1; +SET SQL_MODE='ERROR_FOR_DIVISION_BY_ZERO,STRICT_ALL_TABLES'; +--error 1365 +INSERT DELAYED INTO t1 VALUES(mod(1,0),"test3"); +CREATE TABLE t2 ( + `id` int(11) PRIMARY KEY auto_increment, + `f1` date +); +SET SQL_MODE='NO_ZERO_DATE,STRICT_ALL_TABLES,NO_ZERO_IN_DATE'; +--error ER_TRUNCATED_WRONG_VALUE +INSERT DELAYED INTO t2 VALUES (0,'0000-00-00'); +--error ER_TRUNCATED_WRONG_VALUE +INSERT DELAYED INTO t2 VALUES (0,'2007-00-00'); +DROP TABLE t1,t2; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 6f9b5399b7b..4c5dd6467bd 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -562,4 +562,32 @@ insert into t1 (id, name) values (2, "óra"); select b.id, group_concat(b.name) from t1 a, t1 b group by b.id; drop table t1; +# +# Bug #31154: group_concat() and bit fields; +# +create table t1(a bit not null); +insert into t1 values (), (), (); +select group_concat(distinct a) from t1; +select group_concat(distinct a order by a) from t1; +drop table t1; + +create table t1(a bit(2) not null); +insert into t1 values (1), (0), (0), (3), (1); +select group_concat(distinct a) from t1; +select group_concat(distinct a order by a) from t1; +select group_concat(distinct a order by a desc) from t1; +drop table t1; + +create table t1(a bit(2), b varchar(10), c bit); +insert into t1 values (1, 'a', 0), (0, 'b', 1), (0, 'c', 0), (3, 'd', 1), +(1, 'e', 1), (3, 'f', 1), (0, 'g', 1); +select group_concat(distinct a, c) from t1; +select group_concat(distinct a, c order by a) from t1; +select group_concat(distinct a, c) from t1; +select group_concat(distinct a, c order by a, c) from t1; +select group_concat(distinct a, c order by a desc, c desc) from t1; + +drop table t1; + + --echo End of 5.0 tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 01eff55d1f6..db4df9ef244 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -198,6 +198,14 @@ drop table table_26093; drop function func_26093_a; drop function func_26093_b; +# +# Bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key' +# +create table t1 (a int not null); +insert into t1 values (-1), (-2); +select min(a) from t1 group by inet_ntoa(a); +drop table t1; + --echo End of 5.0 tests # diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index bb65cbaa774..5db6db70e8f 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -47,6 +47,7 @@ select makedate(1997,1); select makedate(1997,0); select makedate(9999,365); select makedate(9999,366); +select makedate(100,1); #Time functions diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index e33712e1ebf..8d909d63f51 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1257,6 +1257,9 @@ UPDATE v1 SET f2 = 4; SELECT * FROM test.t1; disconnect user1; connection default; +REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost'; +REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost'; +REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; DROP DATABASE db27878; use test; DROP TABLE t1; diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test index 115586e807d..fac577ef0ff 100644 --- a/mysql-test/t/grant3.test +++ b/mysql-test/t/grant3.test @@ -34,3 +34,103 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; + +# +# Bug: #19828 Case sensitivity in Grant/Revoke +# + +grant select on test.* to CUser@localhost; +grant select on test.* to CUser@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; + +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; + +#### table grants +create table t1 (a int); +grant select on test.t1 to CUser@localhost; +grant select on test.t1 to CUser@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; + +### column grants + +grant select(a) on test.t1 to CUser@localhost; +grant select(a) on test.t1 to CUser@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; +SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; + +DROP USER CUser@localhost; +DROP USER CUser@LOCALHOST; + +drop table t1; + +# revoke on a specific DB only + +grant select on test.* to CUser2@localhost; +grant select on test.* to CUser2@LOCALHOST; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; + +REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; + +REVOKE SELECT ON test.* FROM 'CUser2'@'localhost'; +flush privileges; + +SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; +SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; + +DROP USER CUser2@localhost; +DROP USER CUser2@LOCALHOST; diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 0e8cc71dab5..b51eeb27331 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -213,6 +213,15 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; +# +# BUG#30590 - delete from memory table with composite btree primary key +# +CREATE TABLE t1 (a INT, KEY USING BTREE(a)) ENGINE=MEMORY; +INSERT INTO t1 VALUES(1),(2),(2); +DELETE FROM t1 WHERE a=2; +SELECT * FROM t1; +DROP TABLE t1; + --echo End of 4.1 tests # @@ -235,5 +244,14 @@ CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY; INSERT INTO t1 VALUES(NULL),(NULL); DROP TABLE t1; +# +# Bug #30885: MEMORY returns incorrect data if BTREE index is used for NULL lookup +# +create table t1(a varchar(255), b varchar(255), + key using btree (a,b)) engine=memory; +insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0); +select * from t1 where a is null; +drop table t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 6bcc14d4e49..9ad658645bd 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -953,7 +953,7 @@ BEGIN DECLARE col1, col2, col3, col4, col6 CHAR(255); DECLARE default_val VARCHAR(65532); DECLARE done INT DEFAULT 0; - DECLARE cur1 CURSOR FOR SHOW COLUMNS FROM bug23037; + DECLARE cur1 CURSOR FOR SELECT COLUMN_NAME, COLUMN_TYPE, IS_NULLABLE, COLUMN_KEY, COLUMN_DEFAULT, EXTRA FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='bug23037'; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; OPEN cur1; FETCH cur1 INTO col1, col2, col3, col4, default_val, col6; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index bc75192cbd5..b9415a3b08b 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -468,5 +468,20 @@ INSERT INTO t VALUES (),(),(); INSERT INTO t(a) SELECT rand() FROM t; DROP TABLE t; +# +# Bug #30453: String not cast to int correctly +# + +CREATE TABLE t1 (c1 INT NOT NULL); +INSERT INTO t1 VALUES(4188.32999999999992724042385816574096679687500), +('4188.32999999999992724042385816574096679687500'), (4188); +SELECT * FROM t1; + +CREATE TABLE t2 (c1 BIGINT); +INSERT INTO t2 VALUES('15449237462.0000000000'); +SELECT * FROM t2; + +DROP TABLE t1, t2; + --echo End of 5.0 tests. diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index f1eb8e68b49..f4d99024206 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -501,3 +501,23 @@ ORDER BY c.b, c.d ; DROP TABLE t1, t2; + +# +# Bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0 +# +create table t1(a int not null, key aa(a), + b char(10) not null, unique key bb(b(1)), + c char(4) not null, unique key cc(c)); +desc t1; +show create table t1; +drop table t1; +create table t1(a int not null, key aa(a), + b char(10) not null, unique key bb(b(1)), + c char(4) not null); +desc t1; +alter table t1 add unique key cc(c); +desc t1; +show create table t1; +drop table t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test index c67da261ef1..ec3644cbff1 100644 --- a/mysql-test/t/log_state.test +++ b/mysql-test/t/log_state.test @@ -189,3 +189,23 @@ disconnect con1; # Remove the log files that was created in the "default location" # i.e var/run --remove_file $MYSQLTEST_VARDIR/run/master.log + +# +# Bug #31604: server crash when setting slow_query_log_file/general_log_file +# +set @old_general_log_file= @@global.general_log_file; +set @old_slow_query_log_file= @@global.slow_query_log_file; + +--error 1231 +set global general_log_file= concat('/not exiting path/log.maste', 'r'); +--error 1231 +set global general_log_file= NULL; +--error 1231 +set global slow_query_log_file= concat('/not exiting path/log.maste', 'r'); +--error 1231 +set global slow_query_log_file= NULL; + +set global general_log_file= @old_general_log_file; +set global slow_query_log_file= @old_slow_query_log_file; + +--echo End of 5.1 tests diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 89c7c255554..12098b4543b 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -253,11 +253,11 @@ use mysql; CREATE TABLE `general_log` ( `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `user_host` mediumtext, - `thread_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, - `command_type` varchar(64) DEFAULT NULL, - `argument` mediumtext + `user_host` mediumtext NOT NULL, + `thread_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; CREATE TABLE `slow_log` ( @@ -268,10 +268,10 @@ CREATE TABLE `slow_log` ( `lock_time` time NOT NULL, `rows_sent` int(11) NOT NULL, `rows_examined` int(11) NOT NULL, - `db` varchar(512) DEFAULT NULL, - `last_insert_id` int(11) DEFAULT NULL, - `insert_id` int(11) DEFAULT NULL, - `server_id` int(11) DEFAULT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(11) NOT NULL, `sql_text` mediumtext NOT NULL ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; @@ -295,6 +295,13 @@ unlock tables; # Bug #21785 Server crashes after rename of the log table # +--disable_warnings +drop table if exists mysql.renamed_general_log; +drop table if exists mysql.renamed_slow_log; +drop table if exists mysql.general_log_new; +drop table if exists mysql.slow_log_new; +--enable_warnings + use mysql; # Should result in error --error ER_CANT_RENAME_LOG_TABLE @@ -359,6 +366,55 @@ drop table renamed_general_log, renamed_slow_log; use test; # +# Bug#27858 (Failing to log to a log table doesn't log anything to error log) +# +# This test works as expected, it's a negative test. +# The message "[ERROR] Failed to write to mysql.general_log" +# is printed to master.err when writing to the table mysql.general_log +# failed. +# However, this message is picked up by mysql-test-run.pl, +# and reported as a test failure, which is a false negative. +# There is no current way to *selectively* filter out these expected error conditions +# (see mysql-test/lib/mtr_report.pl, mtr_report_stats()). +# Instead of filtering all occurences of "Failed to write to +# mysql.general_log", which could hide bugs when the error is not expected, +# this test case is commented instead. +# TODO: improve filtering of expected errors in master.err in +# mysql-test-run.pl (based on the test name ?), and uncomment this test. + +# --disable_warnings +# drop table if exists mysql.bad_general_log; +# drop table if exists mysql.bad_slow_log; +# drop table if exists mysql.general_log_hide; +# drop table if exists mysql.slow_log_hide; +# --enable_warnings +# +# create table mysql.bad_general_log (a int) engine= CSV; +# create table mysql.bad_slow_log (a int) engine= CSV; +# +# # Rename does not perform checks on the table structure, +# # exploiting this to force a failure to log +# rename table mysql.general_log to mysql.general_log_hide, mysql.bad_general_log TO mysql.general_log; +# rename table mysql.slow_log to mysql.slow_log_hide, mysql.bad_slow_log TO mysql.slow_log; +# +# # The following message should be printed in master.log: +# # [ERROR] Failed to write to mysql.general_log +# # TODO: See how verifying this could be automated +# +# flush tables; +# select "logging this should fail"; +# +# # Restore the log tables +# +# rename table mysql.general_log to mysql.bad_general_log, mysql.general_log_hide TO mysql.general_log; +# rename table mysql.slow_log to mysql.bad_slow_log, mysql.slow_log_hide TO mysql.slow_log; +# +# flush tables; +# +# drop table mysql.bad_general_log; +# drop table mysql.bad_slow_log; + +# # Bug #21966 Strange warnings on repair of the log tables # @@ -751,3 +807,120 @@ DROP DATABASE IF EXISTS `db_17876`; SET GLOBAL general_log = @old_general_log_state; SET GLOBAL slow_query_log = @old_slow_log_state; +# +# Bug#21557 entries in the general query log truncated at 1000 characters. +# + +truncate table mysql.general_log; +set @old_general_log_state = @@global.general_log; +set global general_log = on; +--disable_result_log +set @lparam = "000 001 002 003 004 005 006 007 008 009" + "010 011 012 013 014 015 016 017 018 019" + "020 021 022 023 024 025 026 027 028 029" + "030 031 032 033 034 035 036 037 038 039" + "040 041 042 043 044 045 046 047 048 049" + "050 051 052 053 054 055 056 057 058 059" + "060 061 062 063 064 065 066 067 068 069" + "070 071 072 073 074 075 076 077 078 079" + "080 081 082 083 084 085 086 087 088 089" + "090 091 092 093 094 095 096 097 098 099" + "100 101 102 103 104 105 106 107 108 109" + "110 111 112 113 114 115 116 117 118 119" + "120 121 122 123 124 125 126 127 128 129" + "130 131 132 133 134 135 136 137 138 139" + "140 141 142 143 144 145 146 147 148 149" + "150 151 152 153 154 155 156 157 158 159" + "160 161 162 163 164 165 166 167 168 169" + "170 171 172 173 174 175 176 177 178 179" + "180 181 182 183 184 185 186 187 188 189" + "190 191 192 193 194 195 196 197 198 199" + "200 201 202 203 204 205 206 207 208 209" + "210 211 212 213 214 215 216 217 218 219" + "220 221 222 223 224 225 226 227 228 229" + "230 231 232 233 234 235 236 237 238 239" + "240 241 242 243 244 245 246 247 248 249" + "250 251 252 253 254 255 256 257 258 259" + "260 261 262 263 264 265 266 267 268 269" + "270 271 272 273 274 275 276 277 278 279" + "280 281 282 283 284 285 286 287 288 289" + "290 291 292 293 294 295 296 297 298 299" + "300 301 302 303 304 305 306 307 308 309" + "310 311 312 313 314 315 316 317 318 319" + "320 321 322 323 324 325 326 327 328 329" + "330 331 332 333 334 335 336 337 338 339" + "340 341 342 343 344 345 346 347 348 349" + "350 351 352 353 354 355 356 357 358 359" + "360 361 362 363 364 365 366 367 368 369" + "370 371 372 373 374 375 376 377 378 379" + "380 381 382 383 384 385 386 387 388 389" + "390 391 392 393 394 395 396 397 398 399" + "400 401 402 403 404 405 406 407 408 409" + "410 411 412 413 414 415 416 417 418 419" + "420 421 422 423 424 425 426 427 428 429" + "430 431 432 433 434 435 436 437 438 439" + "440 441 442 443 444 445 446 447 448 449" + "450 451 452 453 454 455 456 457 458 459" + "460 461 462 463 464 465 466 467 468 469" + "470 471 472 473 474 475 476 477 478 479" + "480 481 482 483 484 485 486 487 488 489" + "490 491 492 493 494 495 496 497 498 499" + "500 501 502 503 504 505 506 507 508 509" + "510 511 512 513 514 515 516 517 518 519" + "520 521 522 523 524 525 526 527 528 529" + "530 531 532 533 534 535 536 537 538 539" + "540 541 542 543 544 545 546 547 548 549" + "550 551 552 553 554 555 556 557 558 559" + "560 561 562 563 564 565 566 567 568 569" + "570 571 572 573 574 575 576 577 578 579" + "580 581 582 583 584 585 586 587 588 589" + "590 591 592 593 594 595 596 597 598 599" + "600 601 602 603 604 605 606 607 608 609" + "610 611 612 613 614 615 616 617 618 619" + "620 621 622 623 624 625 626 627 628 629" + "630 631 632 633 634 635 636 637 638 639" + "640 641 642 643 644 645 646 647 648 649" + "650 651 652 653 654 655 656 657 658 659" + "660 661 662 663 664 665 666 667 668 669" + "670 671 672 673 674 675 676 677 678 679" + "680 681 682 683 684 685 686 687 688 689" + "690 691 692 693 694 695 696 697 698 699" + "700 701 702 703 704 705 706 707 708 709" + "710 711 712 713 714 715 716 717 718 719" + "720 721 722 723 724 725 726 727 728 729" + "730 731 732 733 734 735 736 737 738 739" + "740 741 742 743 744 745 746 747 748 749" + "750 751 752 753 754 755 756 757 758 759" + "760 761 762 763 764 765 766 767 768 769" + "770 771 772 773 774 775 776 777 778 779" + "780 781 782 783 784 785 786 787 788 789" + "790 791 792 793 794 795 796 797 798 799" + "800 801 802 803 804 805 806 807 808 809" + "810 811 812 813 814 815 816 817 818 819" + "820 821 822 823 824 825 826 827 828 829" + "830 831 832 833 834 835 836 837 838 839" + "840 841 842 843 844 845 846 847 848 849" + "850 851 852 853 854 855 856 857 858 859" + "860 861 862 863 864 865 866 867 868 869" + "870 871 872 873 874 875 876 877 878 879" + "880 881 882 883 884 885 886 887 888 889" + "890 891 892 893 894 895 896 897 898 899" + "900 901 902 903 904 905 906 907 908 909" + "910 911 912 913 914 915 916 917 918 919" + "920 921 922 923 924 925 926 927 928 929" + "930 931 932 933 934 935 936 937 938 939" + "940 941 942 943 944 945 946 947 948 949" + "950 951 952 953 954 955 956 957 958 959" + "960 961 962 963 964 965 966 967 968 969" + "970 971 972 973 974 975 976 977 978 979" + "980 981 982 983 984 985 986 987 988 989" + "990 991 992 993 994 995 996 997 998 999"; +--enable_result_log +prepare long_query from "select ? as long_query"; +--disable_result_log +execute long_query using @lparam; +--enable_result_log +set global general_log = off; +select command_type, argument from mysql.general_log; +deallocate prepare long_query; +set global general_log = @old_general_log_state; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index fd479276b3b..a50588b1e78 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -511,4 +511,18 @@ SELECT * FROM tm1; CHECK TABLE tm1; DROP TABLE tm1, t1, t2; +# +# Bug#15522 - create ... select and with merge tables +# +# This was fixed together with Bug#20662 (Infinite loop in CREATE TABLE +# IF NOT EXISTS ... SELECT with locked tables). +# The new behavior for MERGE tables is consistent with the +# CREATE TABLE SELECT behavior for ordinary tables. +# +CREATE TABLE t1(c1 INT); +CREATE TABLE t2 (c1 INT) ENGINE=MERGE UNION=(t1) INSERT_METHOD=FIRST; +--error ER_UPDATE_TABLE_USED +CREATE TABLE IF NOT EXISTS t1 SELECT * FROM t2; +DROP TABLE t1, t2; + --echo End of 5.0 tests diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 66a27abd61a..7667522feaf 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -8,8 +8,8 @@ # server or run mysql-test-run --debug mysql_client_test and check # var/log/mysql_client_test.trace ---exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.log 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.log 2>&1 +--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 # End of 4.1 tests echo ok; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index d233546f9e3..6a7f44b4dbe 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -11,7 +11,7 @@ # --disable_warnings -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, `t``1`, `t 1`; drop view if exists v1; drop database if exists client_test_db; --enable_warnings @@ -37,4 +37,26 @@ create view v1 as select * from t1; drop view v1; drop table t1; +# +# Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks +# +create table `t``1`(a int); +create table `t 1`(a int); +--replace_result 'Table is already up to date' OK +--exec $MYSQL_CHECK --databases test +drop table `t``1`, `t 1`; + --echo End of 5.0 tests + +# +# Bug #30679: 5.1 name encoding not performed for views during upgrade +# +create table t1(a int); +create view v1 as select * from t1; +show tables; +--copy_file $MYSQLTEST_VARDIR/master-data/test/v1.frm $MYSQLTEST_VARDIR/master-data/test/v-1.frm +show tables; +--exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test +show tables; +drop view v1, `v-1`; +drop table t1; diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 8a38972c00f..d0c8c0b4e38 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1435,7 +1435,10 @@ select "this will be executed"; --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result; +--error 0,1 remove_file $MYSQLTEST_VARDIR/log/zero_length_file.reject; +--error 0,1 +remove_file $MYSQL_TEST_DIR/r/zero_length_file.reject; # # Test that a test file that does not generate any output fails. @@ -2080,5 +2083,23 @@ eval $show_statement; drop table t1; +# ---------------------------------------------------------------------------- +# Test change_user command +# ---------------------------------------------------------------------------- + +--error 1 +--exec echo "--change_user root,,inexistent" | $MYSQL_TEST 2>&1 + +--error 1 +--exec echo "--change_user inexistent,,test" | $MYSQL_TEST 2>&1 + +--error 1 +--exec echo "--change_user root,inexistent,test" | $MYSQL_TEST 2>&1 + +--change_user +--change_user root +--change_user root,, +--change_user root,,test + --echo End of tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 42db23dadef..2906b4640cd 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1481,6 +1481,15 @@ ALTER TABLE t1 DROP PARTITION p1; DROP TABLE t1; # +# Bug #30484: Partitions: crash with self-referencing trigger +# + +create table t (s1 int) engine=myisam partition by key (s1); +create trigger t_ad after delete on t for each row insert into t values (old.s1); +insert into t values (1); +drop table t; + +# # Bug #27816: Log tables ran with partitions crashes the server when logging # is enabled. # @@ -1493,10 +1502,30 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time)) (PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000)); ALTER TABLE general_log ENGINE = CSV; SET GLOBAL general_log = default; +use test; # # Bug #27084 partitioning by list seems failing when using case # BUG #18198: Case no longer supported, test case removed # +# +# Bug #29444: crash with partition refering to table in create-select +# + +create table t2 (b int); +--error 1054 +create table t1 (b int) +PARTITION BY RANGE (t2.b) ( + PARTITION p1 VALUES LESS THAN (10), + PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +create table t1 (a int) +PARTITION BY RANGE (b) ( + PARTITION p1 VALUES LESS THAN (10), + PARTITION p2 VALUES LESS THAN (20) +) select * from t2; +show create table t1; +drop table t1, t2; + --echo End of 5.1 tests diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index f4320c5c56a..4a50332b3df 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -134,3 +134,11 @@ SELECT * FROM t1 WHERE first_name='Andy' OR last_name='Jake'; drop table t1; +# +# BUG#30583 - Partition on DOUBLE key + INNODB + count(*) == crash +# +CREATE TABLE t1 (a DOUBLE NOT NULL, KEY(a)) ENGINE=InnoDB +PARTITION BY KEY(a) PARTITIONS 10; +INSERT INTO t1 VALUES(1),(2); +SELECT COUNT(*) FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index dea86bdd2fa..2c35a57e5a6 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1223,6 +1223,16 @@ EXECUTE st1; DEALLOCATE PREPARE st1; DROP TABLE t1; + +# +# Bug #32137: prepared statement crash with str_to_date in update clause +# +create table t1 (a int, b tinyint); +prepare st1 from 'update t1 set b= (str_to_date(a, a))'; +execute st1; +deallocate prepare st1; +drop table t1; + --echo End of 4.1 tests. ############################# 5.0 tests start ################################ diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index d06698cdb17..7571e60859f 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -1,10 +1,5 @@ -- source include/have_query_cache.inc -# Disabled on embedded due to bug #30710, "query_cache.test fails on -# embedded w/ per-column privs test". Please re-enable when that bug -# is resolved. --- source include/not_embedded.inc - # # Tests with query cache # @@ -1255,82 +1250,52 @@ disconnect user1; disconnect user2; disconnect user3; -# -# Bug #30269 Query cache eats memory -# ---disable_warnings -DROP DATABASE IF EXISTS bug30269; ---enable_warnings -FLUSH STATUS; -CREATE DATABASE bug30269; -USE bug30269; -CREATE TABLE test1 (id int, name varchar(23)); -CREATE VIEW view1 AS SELECT * FROM test1; -INSERT INTO test1 VALUES (5, 'testit'); -GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost'; -GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost'; -set global query_cache_size= 81920; -connect (bug30269, localhost, bug30269,,); -connection bug30269; -USE bug30269; -show status like 'Qcache_queries_in_cache'; ---echo # Select statement not stored in query cache because of column privileges. -SELECT id FROM test1 WHERE id>2; -show status like 'Qcache_queries_in_cache'; -SELECT id FROM view1 WHERE id>2; -show status like 'Qcache_queries_in_cache'; +--echo End of 5.0 tests -connection default; -DROP DATABASE bug30269; -disconnect bug30269; -DROP USER 'bug30269'@'localhost'; +# +# Bug #28211 RENAME DATABASE and query cache don't play nicely together +# TODO: enable these tests when RENAME DATABASE is implemented. +# --disable_warnings +# drop database if exists db1; +# drop database if exists db2; +# --enable_warnings +# set GLOBAL query_cache_size=15*1024*1024; +# create database db1; +# use db1; +# create table t1(c1 int)engine=myisam; +# insert into t1(c1) values (1); +# select * from db1.t1 f; +# show status like 'Qcache_queries_in_cache'; +# rename schema db1 to db2; +# show status like 'Qcache_queries_in_cache'; +# drop database db2; +# set global query_cache_size=default; +# +# --disable_warnings +# drop database if exists db1; +# drop database if exists db3; +# --enable_warnings +# set GLOBAL query_cache_size=15*1024*1024; +# create database db1; +# create database db3; +# use db1; +# create table t1(c1 int) engine=myisam; +# use db3; +# create table t1(c1 int) engine=myisam; +# use db1; +# insert into t1(c1) values (1); +# use mysql; +# select * from db1.t1; +# select c1+1 from db1.t1; +# select * from db3.t1; +# show status like 'Qcache_queries_in_cache'; +# rename schema db1 to db2; +# show status like 'Qcache_queries_in_cache'; +# drop database db2; +# drop database db3; set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; ---echo End of 5.0 tests - -# -# Bug #28211 RENAME DATABASE and query cache don't play nicely together -# ---disable_warnings -drop database if exists db1; -drop database if exists db2; ---enable_warnings -set GLOBAL query_cache_size=15*1024*1024; -create database db1; -use db1; -create table t1(c1 int)engine=myisam; -insert into t1(c1) values (1); -select * from db1.t1 f; -show status like 'Qcache_queries_in_cache'; -rename schema db1 to db2; -show status like 'Qcache_queries_in_cache'; -drop database db2; -set global query_cache_size=default; ---disable_warnings -drop database if exists db1; -drop database if exists db3; ---enable_warnings -set GLOBAL query_cache_size=15*1024*1024; -create database db1; -create database db3; -use db1; -create table t1(c1 int) engine=myisam; -use db3; -create table t1(c1 int) engine=myisam; -use db1; -insert into t1(c1) values (1); -use mysql; -select * from db1.t1; -select c1+1 from db1.t1; -select * from db3.t1; -show status like 'Qcache_queries_in_cache'; -rename schema db1 to db2; -show status like 'Qcache_queries_in_cache'; -drop database db2; -drop database db3; - ---echo End of 5.1 tests diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test index a0085c0ba31..929b93e10d5 100644 --- a/mysql-test/t/query_cache_notembedded.test +++ b/mysql-test/t/query_cache_notembedded.test @@ -225,3 +225,39 @@ connection default; set GLOBAL query_cache_size=0; SET GLOBAL log_bin_trust_function_creators = 0; + +# +# Bug #30269 Query cache eats memory +# +--disable_warnings +DROP DATABASE IF EXISTS bug30269; +--enable_warnings +FLUSH STATUS; +CREATE DATABASE bug30269; +USE bug30269; +CREATE TABLE test1 (id int, name varchar(23)); +CREATE VIEW view1 AS SELECT * FROM test1; +INSERT INTO test1 VALUES (5, 'testit'); +GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost'; +GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost'; +set global query_cache_size= 81920; +connect (bug30269, localhost, bug30269,,); +connection bug30269; +USE bug30269; +show status like 'Qcache_queries_in_cache'; +--echo # Select statement not stored in query cache because of column privileges. +SELECT id FROM test1 WHERE id>2; +show status like 'Qcache_queries_in_cache'; +SELECT id FROM view1 WHERE id>2; +show status like 'Qcache_queries_in_cache'; + +connection default; +DROP DATABASE bug30269; +disconnect bug30269; +DROP USER 'bug30269'@'localhost'; + +set GLOBAL query_cache_type=default; +set GLOBAL query_cache_limit=default; +set GLOBAL query_cache_min_res_unit=default; +set GLOBAL query_cache_size=default; + diff --git a/mysql-test/t/renamedb.test b/mysql-test/t/renamedb.test index 1e71adb3bf3..84315090b7a 100644 --- a/mysql-test/t/renamedb.test +++ b/mysql-test/t/renamedb.test @@ -1,26 +1,53 @@ ---disable_warnings -drop database if exists testdb1; ---enable_warnings - -create database testdb1 default character set latin2; -use testdb1; -create table t1 (a int); -insert into t1 values (1),(2),(3); -show create database testdb1; -show tables; -rename database testdb1 to testdb2; ---error 1049 -show create database testdb1; -show create database testdb2; -select database(); -show tables; -select a from t1 order by a; -drop database testdb2; +# TODO: enable these tests when RENAME DATABASE is implemented. +# +# --disable_warnings +# drop database if exists testdb1; +# --enable_warnings +# +# create database testdb1 default character set latin2; +# use testdb1; +# create table t1 (a int); +# insert into t1 values (1),(2),(3); +# show create database testdb1; +# show tables; +# rename database testdb1 to testdb2; +# --error 1049 +# show create database testdb1; +# show create database testdb2; +# select database(); +# show tables; +# select a from t1 order by a; +# drop database testdb2; +# # # Bug#19392 Rename Database: Crash if case change # -create database testdb1; ---error 1007 -rename database testdb1 to testdb1; -drop database testdb1; +# create database testdb1; +# --error 1007 +# rename database testdb1 to testdb1; +# drop database testdb1; + +# +# WL#4030 (Deprecate RENAME DATABASE: replace with ALTER DATABASE <name> UPGRADE) +# + +--error ER_PARSE_ERROR +rename database testdb1 to testdb2; + +--error ER_WRONG_USAGE +ALTER DATABASE wrong UPGRADE DATA DIRECTORY NAME; + +--error ER_WRONG_USAGE +ALTER DATABASE `#mysql41#not-supported` UPGRADE DATA DIRECTORY NAME; + +--error ER_WRONG_USAGE +ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME; + +--error ER_WRONG_USAGE +ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME; + +--error ER_BAD_DB_ERROR +ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; + + diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index 6ef21cde465..b433b8720b9 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -83,7 +83,36 @@ SET myisam_repair_threads=@@global.myisam_repair_threads; SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; -# End of 4.1 tests +# +# BUG#31174 - "Repair" command on MyISAM crashes with small +# myisam_sort_buffer_size +# +CREATE TABLE t1(a CHAR(255), KEY(a)); +SET myisam_sort_buffer_size=4496; +INSERT INTO t1 VALUES +('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'), +('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'), +('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'), +('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'); +SET myisam_repair_threads=2; +REPAIR TABLE t1; +SET myisam_repair_threads=@@global.myisam_repair_threads; +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +DROP TABLE t1; + +--echo End of 4.1 tests # End of 5.0 tests # diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 012f2b33225..a956a246770 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -196,7 +196,7 @@ select f(10)| drop function f| ---error 1322 +--error ER_PARSE_ERROR create procedure p() begin declare c cursor for insert into test.t1 values ("foo", 42); @@ -1763,7 +1763,7 @@ drop procedure bug15091; drop function if exists bug16896; --enable_warnings ---error ER_SP_NO_AGGREGATE +--error ER_PARSE_ERROR create aggregate function bug16896() returns int return 1; # @@ -2150,6 +2150,78 @@ end// delimiter ;// + +# +# Bug#28360 (RENAME DATABASE destroys routines) +# + +--disable_warnings +drop procedure if exists proc_28360; +drop function if exists func_28360; +--enable_warnings + +delimiter //; + +--error ER_SP_NO_DROP_SP +CREATE PROCEDURE proc_28360() +BEGIN + ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; +END// + +--error ER_SP_NO_DROP_SP +CREATE FUNCTION func_28360() RETURNS int +BEGIN + ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME; + RETURN 0; +END// + +delimiter ;// + + +# +# Bug#29223 declare cursor c for SHOW ..... +# + +--disable_warnings +DROP PROCEDURE IF EXISTS p1; +--enable_warnings +--delimiter | +--error ER_PARSE_ERROR +CREATE PROCEDURE p1() +BEGIN + DECLARE c char(100); + DECLARE cur1 CURSOR FOR SHOW TABLES; + + OPEN cur1; + FETCH cur1 INTO c; + select c; + CLOSE cur1; +END| +--delimiter ; + +# +# Bug#29816 Syntactically wrong query fails with misleading error message +# + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest; +--enable_warnings +CREATE DATABASE mysqltest; +USE mysqltest; +DROP DATABASE mysqltest; +# Both ER_SP_DOES_NOT_EXIST and ER_PARSE_ERROR are valid here, +# the result is implementation dependent: +# See Bug#29816 for details +--error ER_SP_DOES_NOT_EXIST +SELECT inexistent(), 1 + ,; +--error ER_SP_DOES_NOT_EXIST +SELECT inexistent(); +--error ER_PARSE_ERROR +SELECT .inexistent(); +--error ER_PARSE_ERROR +SELECT ..inexistent(); +USE test; + # # BUG#NNNN: New bug synopsis # diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 4e4102dd1ef..004e1c4ddd2 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -7581,4 +7581,479 @@ DROP TABLE t1; DROP PROCEDURE p1; DROP PROCEDURE p2; +########################################################################### + +# +# Bug#31035: select from function, group by result crasher. +# + +########################################################################### + +--echo + +--echo # +--echo # Bug#31035. +--echo # + +--echo + +--echo # +--echo # - Prepare. +--echo # + +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; +DROP FUNCTION IF EXISTS f2; +DROP FUNCTION IF EXISTS f3; +DROP FUNCTION IF EXISTS f4; +--enable_warnings + +--echo + +--echo # +--echo # - Create required objects. +--echo # + +--echo + +CREATE TABLE t1(c1 INT); + +--echo + +INSERT INTO t1 VALUES (1), (2), (3); + +--echo + +CREATE FUNCTION f1() + RETURNS INT + NOT DETERMINISTIC + RETURN 1; + +--echo + +CREATE FUNCTION f2(p INT) + RETURNS INT + NOT DETERMINISTIC + RETURN 1; + +--echo + +CREATE FUNCTION f3() + RETURNS INT + DETERMINISTIC + RETURN 1; + +--echo + +CREATE FUNCTION f4(p INT) + RETURNS INT + DETERMINISTIC + RETURN 1; + +--echo + +--echo # +--echo # - Check. +--echo # + +--echo + +# Not deterministic function, no arguments. + +SELECT f1() AS a FROM t1 GROUP BY a; + +--echo + +# Not deterministic function, non-constant argument. + +SELECT f2(@a) AS a FROM t1 GROUP BY a; + +--echo + +# Deterministic function, no arguments. + +SELECT f3() AS a FROM t1 GROUP BY a; + +--echo + +# Deterministic function, constant argument. + +SELECT f4(0) AS a FROM t1 GROUP BY a; + +--echo + +# Deterministic function, non-constant argument. + +SELECT f4(@a) AS a FROM t1 GROUP BY a; + +--echo + +--echo # +--echo # - Cleanup. +--echo # + +--echo + +DROP TABLE t1; +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP FUNCTION f3; +DROP FUNCTION f4; + +--echo + +########################################################################### + +# +# Bug#31191: JOIN in combination with stored function crashes the server. +# + +########################################################################### + +--echo # +--echo # Bug#31191. +--echo # + +--echo + +--echo # +--echo # - Prepare. +--echo # + +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +--echo + +--echo # +--echo # - Create required objects. +--echo # + +--echo + +CREATE TABLE t1 ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + barcode INT(8) UNSIGNED ZEROFILL nOT NULL, + PRIMARY KEY (id), + UNIQUE KEY barcode (barcode) +); + +--echo + +INSERT INTO t1 (id, barcode) VALUES (1, 12345678); +INSERT INTO t1 (id, barcode) VALUES (2, 12345679); + +--echo + +CREATE TABLE test.t2 ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + barcode BIGINT(11) UNSIGNED ZEROFILL NOT NULL, + PRIMARY KEY (id) +); + +--echo + +INSERT INTO test.t2 (id, barcode) VALUES (1, 12345106708); +INSERT INTO test.t2 (id, barcode) VALUES (2, 12345106709); + +--echo + +CREATE FUNCTION f1(p INT(8)) + RETURNS BIGINT(11) UNSIGNED + READS SQL DATA + RETURN FLOOR(p/1000)*1000000 + 100000 + FLOOR((p MOD 1000)/10)*100 + (p MOD 10); + +--echo + +--echo # +--echo # - Check. +--echo # + +--echo + +SELECT DISTINCT t1.barcode, f1(t1.barcode) +FROM t1 +INNER JOIN t2 +ON f1(t1.barcode) = t2.barcode +WHERE t1.barcode=12345678; + +--echo + +--echo # +--echo # - Cleanup. +--echo # + +--echo + +DROP TABLE t1; +DROP TABLE t2; +DROP FUNCTION f1; + +--echo + +########################################################################### + +# +# Bug#31226: Group by function crashes mysql. +# + +########################################################################### + +--echo # +--echo # Bug#31226. +--echo # + +--echo + +--echo # +--echo # - Prepare. +--echo # + +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +--echo + +--echo # +--echo # - Create required objects. +--echo # + +--echo + +CREATE TABLE t1(id INT); + +--echo + +INSERT INTO t1 VALUES (1), (2), (3); + +--echo + +CREATE FUNCTION f1() + RETURNS DATETIME + NOT DETERMINISTIC NO SQL + RETURN NOW(); + +--echo + +--echo # +--echo # - Check. +--echo # + +--echo + +--replace_column 1 <timestamp> +SELECT f1() FROM t1 GROUP BY 1; + +--echo + +--echo # +--echo # - Cleanup. +--echo # + +--echo + +DROP TABLE t1; +DROP FUNCTION f1; + +--echo + +########################################################################### + +# +# Bug#28318 (CREATE FUNCTION (UDF) requires a schema) +# + +--disable_warnings +DROP PROCEDURE IF EXISTS db28318_a.t1; +DROP PROCEDURE IF EXISTS db28318_b.t2; +DROP DATABASE IF EXISTS db28318_a; +DROP DATABASE IF EXISTS db28318_b; +--enable_warnings + +CREATE DATABASE db28318_a; +CREATE DATABASE db28318_b; + +CREATE PROCEDURE db28318_a.t1() SELECT "db28318_a.t1"; +CREATE PROCEDURE db28318_b.t2() CALL t1(); + +use db28318_a; + +# In db28318_b.t2, t1 refers to db28318_b.t1 +--error ER_SP_DOES_NOT_EXIST +CALL db28318_b.t2(); + +DROP PROCEDURE db28318_a.t1; +DROP PROCEDURE db28318_b.t2; +DROP DATABASE db28318_a; +DROP DATABASE db28318_b; +use test; + +########################################################################### + --echo End of 5.0 tests + +########################################################################### + +# +# Bug#20550: Stored function: wrong RETURN type metadata when used in a VIEW. +# + +########################################################################### + +--echo + +--echo # +--echo # Bug#20550. +--echo # + +--echo + +--echo # +--echo # - Prepare. +--echo # + +--echo + +--disable_warnings +DROP VIEW IF EXISTS v1; +DROP VIEW IF EXISTS v2; +DROP FUNCTION IF EXISTS f1; +DROP FUNCTION IF EXISTS f2; +--enable_warnings + +--echo + +--echo # +--echo # - Create required objects. +--echo # + +--echo + +CREATE FUNCTION f1() RETURNS VARCHAR(65525) RETURN 'Hello'; + +--echo + +CREATE FUNCTION f2() RETURNS TINYINT RETURN 1; + +--echo + +CREATE VIEW v1 AS SELECT f1(); + +--echo + +CREATE VIEW v2 AS SELECT f2(); + +--echo + +--echo # +--echo # - Check. +--echo # + +--echo + +SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'v1'; + +--echo + +SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'v2'; + +--echo + +--echo # +--echo # - Cleanup. +--echo # + +--echo + +DROP FUNCTION f1; +DROP FUNCTION f2; +DROP VIEW v1; +DROP VIEW v2; + +--echo + +########################################################################### + +# +# Bug#24923: Functions with ENUM issues. +# + +########################################################################### + +--echo # +--echo # - Bug#24923: prepare. +--echo # + +--echo + +--disable_warnings +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +--echo + +--echo # +--echo # - Bug#24923: create required objects. +--echo # + +--echo + +delimiter |; + +CREATE FUNCTION f1(p INT) + RETURNS ENUM ('Very_long_enum_element_identifier', + 'Another_very_long_enum_element_identifier') + BEGIN + CASE p + WHEN 1 THEN + RETURN 'Very_long_enum_element_identifier'; + ELSE + RETURN 'Another_very_long_enum_element_identifier'; + END CASE; + END| + +delimiter ;| + +--echo + +--echo # +--echo # - Bug#24923: check. +--echo # + +--echo + +SELECT f1(1); + +--echo + +SELECT f1(2); + +--echo + +SHOW CREATE FUNCTION f1; + +--echo # +--echo # - Bug#24923: cleanup. +--echo # + +--echo + +DROP FUNCTION f1; + +--echo + +########################################################################### + +--echo End of 5.1 tests diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 1cd5aa1726a..6a11791924a 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -21,6 +21,8 @@ select * from information_schema.session_status where variable_name like 'Table_ connection con1; # ++Immediate = 3 SET SQL_LOG_BIN=0; +set @old_general_log = @@global.general_log; +set global general_log = 'OFF'; --disable_warnings # ++Immediate = 4 drop table if exists t1; @@ -60,6 +62,7 @@ reap; # ++Immediate = 16 + $wait_condition_reps show status like 'Table_locks_waited'; drop table t1; +set global general_log = @old_general_log; disconnect con2; disconnect con1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index d8d137d81e6..6aa6edd128e 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -284,6 +284,26 @@ select * from t1 where f1 between 20020101 and 2007010100000; drop table t1; # +# Bug #31253: crash comparing datetime to double +# Should return 1st row only. Crashes if NULL propagation fails. +# +create table t1 (f1 time); +insert into t1 set f1 = '45:44:44'; +insert into t1 set f1 = '15:44:44'; +select * from t1 where (convert(f1,datetime)) != 1; +drop table t1; + +# +# Bug #31249: problem with convert(..., datetime) +# +create table t1 (a tinyint); +insert into t1 values (), (), (); +select sum(a) from t1 group by convert(a, datetime); +drop table t1; + +--echo End of 5.0 tests + +# # Test of storing datetime into date fields # diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 5538f19f5f9..458583fca81 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -278,7 +278,7 @@ update t1 set b=a; select * from t1; drop table t1; -# End of 4.1 tests +--echo End of 4.1 tests # # Test for BUG#8397: decimal type in subselects (Item_cache_decimal) @@ -408,3 +408,14 @@ INSERT INTO t1 VALUES (1.1325,3); SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1; DROP TABLE t1; + +# +# Bug #31227: memory overrun with decimal (6,6) and zerofill and group_concat +# valgrind will complain about this (the group_concat(f2)) on unpatched mysqld. +# +create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill); +insert into t1 values (-0.123456,0.123456); +select group_concat(f1),group_concat(f2) from t1; +drop table t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index f67a1b1719b..9aa8c00d24a 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -219,6 +219,22 @@ create table t1 (s1 float(0,2)); create table t1 (s1 float(1,2)); # +# MySQL Bugs: #11589: mysqltest --ps-protocol, strange output, float/double/real with zerofill +# + +CREATE TABLE t1 ( + f1 real zerofill, + f2 double zerofill, + f3 float zerofill); +INSERT INTO t1 VALUES ( 0.314152e+1, 0.314152e+1, 0.314152e+1); + +let $my_stmt= select f1, f2, f3 FROM t1; +eval PREPARE stmt1 FROM '$my_stmt'; +select f1, f2, f3 FROM t1; +eval $my_stmt; +EXECUTE stmt1; + +DROP TABLE t1; # Bug #28121 "INSERT or UPDATE into DOUBLE(200,0) field being truncated to 31 digits" # diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index b1776d09744..4b052a3d1fb 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1205,6 +1205,27 @@ SELECT 1 FROM t1 GROUP BY @b := @a, @b; DROP TABLE t1; +# +# Bug #24907: unpredictable (display) precission, if input precission +# increases +# + +# As per 10.1.1. Overview of Numeric Types, type (new) DECIMAL has a +# maxmimum precision of 30 places after the decimal point. Show that +# temp field creation beyond that works and throws a truncation warning. +# DECIMAL(37,36) should be adjusted to DECIMAL(31,30). +CREATE TABLE t1 SELECT 0.123456789012345678901234567890123456 AS f1; +DESC t1; +SELECT f1 FROM t1; +DROP TABLE t1; + +# too many decimal places, AND too many digits altogether (90 = 45+45). +# should preserve integers (65 = 45+20) +CREATE TABLE t1 SELECT 123451234512345123451234512345123451234512345.678906789067890678906789067890678906789067890 AS f1; +DESC t1; +SELECT f1 FROM t1; +DROP TABLE t1; + --echo End of 5.0 tests # diff --git a/mysql-test/t/udf.test b/mysql-test/t/udf.test index 2f1d197cb9e..663dc08d72e 100644 --- a/mysql-test/t/udf.test +++ b/mysql-test/t/udf.test @@ -113,11 +113,11 @@ DROP TABLE bug19904; # Bug#21269: DEFINER-clause is allowed for UDF-functions # ---error ER_WRONG_USAGE +--error ER_PARSE_ERROR CREATE DEFINER=CURRENT_USER() FUNCTION should_not_parse RETURNS STRING SONAME "should_not_parse.so"; ---error ER_WRONG_USAGE +--error ER_PARSE_ERROR CREATE DEFINER=someone@somewhere FUNCTION should_not_parse RETURNS STRING SONAME "should_not_parse.so"; # @@ -206,11 +206,12 @@ DROP FUNCTION IF EXISTS metaphon; CREATE FUNCTION metaphon(a int) RETURNS int return 0; +# this currently passes, and eclipse the stored function --replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB ---error ER_UDF_EXISTS eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB"; DROP FUNCTION metaphon; +DROP FUNCTION metaphon; --replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB"; @@ -363,6 +364,20 @@ drop table t1; drop function metaphon; set GLOBAL query_cache_size=default; +# +# Bug#28318 CREATE FUNCTION (UDF) requires a schema +# + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest; +--enable_warnings +CREATE DATABASE mysqltest; +USE mysqltest; +DROP DATABASE mysqltest; +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_LIB"; +DROP FUNCTION metaphon; +USE test; # # Bug #29804 UDF parameters don't contain correct string length diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test index f517c7787f8..05f430b087b 100644 --- a/mysql-test/t/upgrade.test +++ b/mysql-test/t/upgrade.test @@ -1,5 +1,10 @@ -- source include/not_embedded.inc +# Temporary disabled on windows, +# because of --exec mkdir +# TODO: implement Bug#31004 and remove this limitation +--source include/not_windows.inc + --disable_warnings drop database if exists `mysqltest1`; drop database if exists `mysqltest-1`; @@ -56,3 +61,33 @@ system cp $MYSQL_TEST_DIR/std_data/old_table-323.frm $MYSQLTEST_VARDIR/master-da truncate t1; drop table t1; +# +# Bug#28360 (RENAME DATABASE destroys routines) +# + +--disable_warnings +drop database if exists `tabc`; +drop database if exists `a-b-c`; +--enable_warnings + +create database `tabc` default character set latin2; +create table tabc.t1 (a int); +FLUSH TABLES; + +# Manually make a 5.0 database from the template +--exec mkdir $MYSQLTEST_VARDIR/master-data/a-b-c +--copy_file $MYSQLTEST_VARDIR/master-data/tabc/db.opt $MYSQLTEST_VARDIR/master-data/a-b-c/db.opt +--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.frm $MYSQLTEST_VARDIR/master-data/a-b-c/t1.frm +--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYD $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYD +--copy_file $MYSQLTEST_VARDIR/master-data/tabc/t1.MYI $MYSQLTEST_VARDIR/master-data/a-b-c/t1.MYI + +show databases like '%a-b-c%'; +ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME; +# The physical directory name is now a@002db@002dc, the logical name still a-b-c +show databases like '%a-b-c%'; +show create database `a-b-c`; +show tables in `a-b-c`; +show create table `a-b-c`.`t1`; +drop database `a-b-c`; +drop database `tabc`; + diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index b6aebb34ac4..310e3e2233c 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -159,6 +159,7 @@ select * from information_schema.session_variables where variable_name like 'net set net_buffer_length=1; show variables like 'net_buffer_length'; select * from information_schema.session_variables where variable_name like 'net_buffer_length'; +--warning 1292 set net_buffer_length=2000000000; show variables like 'net_buffer_length'; select * from information_schema.session_variables where variable_name like 'net_buffer_length'; diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 1d16652ab1e..6c7d9af1b63 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -533,3 +533,14 @@ select UpdateXML('<a>a</a>',repeat('a b ',1000),''); select ExtractValue('<a>a</a>', '/a[@x=@y0123456789_0123456789_0123456789_0123456789]'); --error 1105 select ExtractValue('<a>a</a>', '/a[@x=$y0123456789_0123456789_0123456789_0123456789]'); + +# +# Bug #31438: updatexml still crashes +# + +select updatexml(NULL, 1, 1), updatexml(1, NULL, 1), updatexml(1, 1, NULL); +select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL), + updatexml(NULL, 1, NULL); +select updatexml(NULL, NULL, NULL); + +--echo End of 5.1 tests |