diff options
Diffstat (limited to 'mysql-test')
233 files changed, 5132 insertions, 2248 deletions
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test index abac3861c66..3b2c2a46590 100644 --- a/mysql-test/include/check-testcase.test +++ b/mysql-test/include/check-testcase.test @@ -79,5 +79,9 @@ if (!$tmp) { } call mtr.check_testcase(); + +let $datadir=`select @@datadir`; +list_files $datadir mysql_upgrade_info; + --enable_query_log diff --git a/mysql-test/include/gap_lock_error_all.inc b/mysql-test/include/gap_lock_error_all.inc new file mode 100644 index 00000000000..fc69dfb56f0 --- /dev/null +++ b/mysql-test/include/gap_lock_error_all.inc @@ -0,0 +1,27 @@ +--source include/have_partition.inc +--source include/gap_lock_error_init.inc + +let $select_lock=for update; +let $autocommit = 0; +--source include/gap_lock_error_select.inc +let $autocommit = 1; +--source include/gap_lock_error_select.inc + +let $select_lock=lock in share mode; +let $autocommit = 0; +--source include/gap_lock_error_select.inc +let $autocommit = 1; +--source include/gap_lock_error_select.inc + +let $select_lock=; +let $autocommit = 0; +--source include/gap_lock_error_select.inc +let $autocommit = 1; +--source include/gap_lock_error_select.inc + +let $autocommit = 0; +--source include/gap_lock_error_update.inc +let $autocommit = 1; +--source include/gap_lock_error_update.inc + +--source include/gap_lock_error_cleanup.inc diff --git a/mysql-test/include/gap_lock_error_cleanup.inc b/mysql-test/include/gap_lock_error_cleanup.inc new file mode 100644 index 00000000000..8558b5a528f --- /dev/null +++ b/mysql-test/include/gap_lock_error_cleanup.inc @@ -0,0 +1 @@ +drop table gap1, gap2, gap3, gap4; diff --git a/mysql-test/include/gap_lock_error_init.inc b/mysql-test/include/gap_lock_error_init.inc new file mode 100644 index 00000000000..26aa852a398 --- /dev/null +++ b/mysql-test/include/gap_lock_error_init.inc @@ -0,0 +1,24 @@ +eval CREATE TABLE gap1 (id1 INT, id2 INT, id3 INT, c1 INT, value INT, + PRIMARY KEY (id1, id2, id3), + INDEX i (c1)) ENGINE=$engine; +CREATE TABLE gap2 like gap1; +eval CREATE TABLE gap3 (id INT, value INT, + PRIMARY KEY (id), + UNIQUE KEY ui(value)) ENGINE=$engine; +eval CREATE TABLE gap4 (id INT, value INT, + PRIMARY KEY (id)) ENGINE=$engine + PARTITION BY HASH(id) PARTITIONS 2; +--disable_query_log +let $max = 1000; +let $i = 1; +while ($i <= $max) { + eval INSERT INTO gap1 (id1, id2, id3, c1, value) + VALUES ($i div 2, $i div 10, $i, $i, $i); + eval INSERT INTO gap2 (id1, id2, id3, c1, value) + VALUES ($i div 2, $i div 10, $i, $i, $i); + inc $i; +} +--enable_query_log + +insert into gap3 values (1,1), (2,2),(3,3),(4,4),(5,5); +insert into gap4 values (1,1), (2,2),(3,3),(4,4),(5,5); diff --git a/mysql-test/include/gap_lock_error_select.inc b/mysql-test/include/gap_lock_error_select.inc new file mode 100644 index 00000000000..91db9bed68a --- /dev/null +++ b/mysql-test/include/gap_lock_error_select.inc @@ -0,0 +1,89 @@ +eval set session autocommit=$autocommit; +let $is_gaplock_target = `SELECT @@autocommit = 0 && '$select_lock' != '' && '$expect_gap_lock_errors' = 1`; + +if ($is_gaplock_target) +{ +# rnd_init +--error ER_UNKNOWN_ERROR +eval select * from gap1 limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where value != 100 limit 1 $select_lock; +# index_read_map +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 $select_lock; +# read_range_first +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 and id3 != 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 and id3 + between 1 and 3 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 order by id3 asc + limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 where id1=1 and id2= 1 order by id3 desc + limit 1 $select_lock; +# index_first +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 asc limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 asc, id2 asc, id3 asc limit 1 $select_lock; +# index_last +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 desc limit 1 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap1 order by id1 desc, id2 desc, id3 desc + limit 1 $select_lock; +# secondary index lookup +--error ER_UNKNOWN_ERROR +eval select * from gap1 force index(i) where c1=1 $select_lock; +# unique index lookup, ensure no gap lock errors as this is effectively a +# single point select that does not lock ranges or gaps of keys +eval select * from gap3 force index(ui) where value=1 $select_lock; +# primary key lookup, ensure no gap lock errors as these are effectively +# single point selects that do not lock ranges or gaps of keys +eval select * from gap1 where id1=1 and id2=1 and id3=1 $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3 in (1, 2, 3) $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3=1 and value=1 + order by c1 $select_lock; +eval select * from gap3 where id=1 $select_lock; +eval select * from gap4 where id=1 $select_lock; +eval select * from gap4 where id in (1, 2, 3) $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap4 $select_lock; +--error ER_UNKNOWN_ERROR +eval select * from gap4 where id between 3 and 7 $select_lock; +} + +if (!$is_gaplock_target) +{ +eval select * from gap1 limit 1 $select_lock; +eval select * from gap1 where value != 100 limit 1 $select_lock; +eval select * from gap1 where id1=1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 and id3 != 1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 and id3 + between 1 and 3 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 order by id3 asc + limit 1 $select_lock; +eval select * from gap1 where id1=1 and id2= 1 order by id3 desc + limit 1 $select_lock; +eval select * from gap1 order by id1 asc limit 1 $select_lock; +eval select * from gap1 order by id1 asc, id2 asc, id3 asc limit 1 $select_lock; +eval select * from gap1 order by id1 desc limit 1 $select_lock; +eval select * from gap1 order by id1 desc, id2 desc, id3 desc + limit 1 $select_lock; +eval select * from gap1 force index(i) where c1=1 $select_lock; +eval select * from gap3 force index(ui) where value=1 $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3=1 $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3 in (1, 2, 3) $select_lock; +eval select * from gap1 where id1=1 and id2=1 and id3=1 and value=1 + order by c1 $select_lock; +eval select * from gap3 where id=1 $select_lock; +eval select * from gap4 where id=1 $select_lock; +eval select * from gap4 where id in (1, 2, 3) $select_lock; +eval select * from gap4 $select_lock; +eval select * from gap4 where id between 3 and 7 $select_lock; +} diff --git a/mysql-test/include/gap_lock_error_update.inc b/mysql-test/include/gap_lock_error_update.inc new file mode 100644 index 00000000000..d456cf81588 --- /dev/null +++ b/mysql-test/include/gap_lock_error_update.inc @@ -0,0 +1,91 @@ +eval set session autocommit=$autocommit; +let $is_gaplock_target = `SELECT @@autocommit = 0 && '$expect_gap_lock_errors' = 1`; + +if ($is_gaplock_target) +{ +## single-table insert,update,delete +insert into gap1 (id1, id2, id3) values (-1,-1,-1); +insert into gap1 (id1, id2, id3) values (-1,-1,-1) + on duplicate key update value=100; +--error ER_UNKNOWN_ERROR +update gap1 set value=100 where id1=1; +update gap1 set value=100 where id1=1 and id2=1 and id3=1; +--error ER_UNKNOWN_ERROR +delete from gap1 where id1=2; +delete from gap1 where id1=-1 and id2=-1 and id3=-1; +commit; + +## multi-table statements (preventing all gap locks with autocommit) +# insert into select +--error ER_UNKNOWN_ERROR +insert into gap2 select * from gap1; +--error ER_UNKNOWN_ERROR +insert into gap2 select * from gap1 where id1=1; +insert into gap2 select * from gap1 where id1=1 and id2=1 and id3=1; + +# create table select +create table t4 select * from gap1 where id1=1 and id2=1 and id3=1; +drop table t4; +--error ER_UNKNOWN_ERROR +create table t4 select * from gap1; +--error ER_UNKNOWN_ERROR +create table t4 select * from gap1 where id1=1; + +# update join +update gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 set gap1.value=100 where gap2.id1=3 + and gap2.id2=3 and gap2.id3=3; +--error ER_UNKNOWN_ERROR +update gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 set gap1.value=100 where gap2.id1=3; +--error ER_UNKNOWN_ERROR +update gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 join gap3 on gap1.id1=gap3.id + set gap1.value=100 where gap2.id1=3; +--error ER_UNKNOWN_ERROR +update gap1 set gap1.value= (select count(*) from gap2); + +# delete join +delete gap1 from gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 where gap2.id1=3 + and gap2.id2=3 and gap2.id3=3; +--error ER_UNKNOWN_ERROR +delete gap1 from gap1 join gap2 on gap1.id1 and gap1.id2=gap2.id2 where gap2.id1=3; + +# select join / self join +--error ER_UNKNOWN_ERROR +select * from gap1, gap2 limit 1 for update; +--error ER_UNKNOWN_ERROR +select * from gap1 a, gap1 b limit 1 for update; + +# unique secondary key +create table u1( + c1 int, + c2 int, + c3 int, + c4 int, + primary key (c1, c2, c3), + unique key (c3, c1) +); +begin; +insert into u1 values (1,1,1,1); +commit; +begin; +insert into u1 values (1,2,1,1) on duplicate key update c4=10; +commit; +begin; +select * from u1 where c3=1 and c1 = 1 for update; +--error ER_UNKNOWN_ERROR +select * from u1 where c3=1 for update; +commit; +drop table u1; +} + +if (!$is_gaplock_target) +{ +# autocommit doesn't prevent single table operations +insert into gap1 (id1, id2, id3) values (-1,-1,-1); +insert into gap1 (id1, id2, id3) values (-1,-1,-1) + on duplicate key update value=100; +update gap1 set value=100 where id1=1; +update gap1 set value=100 where id1=1 and id2=1 and id3=1; +delete from gap1 where id1=2; +delete from gap1 where id1=-1 and id2=-1 and id3=-1; +commit; +} diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 635dfd9b8c3..71c693961c1 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -284,6 +284,7 @@ CREATE DEFINER=root@localhost PROCEDURE add_suppression(pattern VARCHAR(255)) BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); + FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END */|| diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm index f9f7b3d8d4b..a421d51ec98 100644 --- a/mysql-test/lib/My/CoreDump.pm +++ b/mysql-test/lib/My/CoreDump.pm @@ -53,9 +53,19 @@ sub _verify_binpath { sub _gdb { my ($core_name)= @_; - print "\nTrying 'gdb' to get a backtrace\n"; + # Check that gdb exists + `gdb --version`; + if ($?) { + print "gdb not found, cannot get the stack trace\n"; + return; + } - return unless -f $core_name; + if (-f $core_name) { + print "\nTrying 'gdb' to get a backtrace from coredump $core_name\n"; + } else { + print "\nCoredump $core_name does not exist, cannot run 'gdb'\n"; + return; + } # Find out name of binary that generated core `gdb -c '$core_name' --batch 2>&1` =~ diff --git a/mysql-test/lib/generate-ssl-certs.sh b/mysql-test/lib/generate-ssl-certs.sh index 5dca21a755d..cc919dfe32e 100755 --- a/mysql-test/lib/generate-ssl-certs.sh +++ b/mysql-test/lib/generate-ssl-certs.sh @@ -1,4 +1,4 @@ -#/bin/sh -xe +#!/bin/sh -xe # simply run me from mysql-test/ cd std_data/ diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index dbc2c775e72..296a646d9ba 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1028,7 +1028,7 @@ sub print_global_resfile { resfile_global("gprof", $opt_gprof ? 1 : 0); resfile_global("valgrind", $opt_valgrind ? 1 : 0); resfile_global("callgrind", $opt_callgrind ? 1 : 0); - resfile_global("mem", $opt_mem ? 1 : 0); + resfile_global("mem", $opt_mem); resfile_global("tmpdir", $opt_tmpdir); resfile_global("vardir", $opt_vardir); resfile_global("fast", $opt_fast ? 1 : 0); @@ -1423,12 +1423,14 @@ sub command_line_setup { # Search through list of locations that are known # to be "fast disks" to find a suitable location - # Use --mem=<dir> as first location to look. - my @tmpfs_locations= ($opt_mem,"/run/shm", "/dev/shm", "/tmp"); + my @tmpfs_locations= ("/run/shm", "/dev/shm", "/tmp"); + + # Use $ENV{'MTR_MEM'} as first location to look (if defined) + unshift(@tmpfs_locations, $ENV{'MTR_MEM'}) if defined $ENV{'MTR_MEM'}; foreach my $fs (@tmpfs_locations) { - if ( -d $fs ) + if ( -d $fs && ! -l $fs ) { my $template= "var_${opt_build_thread}_XXXX"; $opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0); @@ -4348,7 +4350,7 @@ sub extract_warning_lines ($$) { qr/InnoDB: Warning: a long semaphore wait:/, qr/InnoDB: Dumping buffer pool.*/, qr/InnoDB: Buffer pool.*/, - qr/InnoDB: Warning: Writer thread is waiting this semaphore/, + qr/InnoDB: Warning: Writer thread is waiting this semaphore:/, qr/Slave: Unknown table 't1' .* 1051/, qr/Slave SQL:.*(Internal MariaDB error code: [[:digit:]]+|Query:.*)/, qr/slave SQL thread aborted/, @@ -5974,9 +5976,9 @@ Options to control directories to use vardir=DIR The directory where files generated from the test run is stored (default: ./var). Specifying a ramdisk or tmpfs will speed up tests. - mem Run testsuite in "memory" using tmpfs or ramdisk - Attempts to find a suitable location - using a builtin list of standard locations + mem[=DIR] Run testsuite in "memory" using tmpfs or ramdisk + Attempts to use DIR first if specified else + uses a builtin list of standard locations for tmpfs (/run/shm, /dev/shm, /tmp) The option can also be set using environment variable MTR_MEM=[DIR] diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 7cdd042e0a6..c88abd9867e 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1925,8 +1925,8 @@ ALTER TABLE ti1 FORCE; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE tm1 FORCE; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 AUTO_INCREMENT 3; affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 @@ -2104,6 +2104,27 @@ Note 1061 Duplicate key name 'id1' DROP TABLE t2; DROP TABLE t1; # +# MDEV-6390 CONVERT TO CHARACTER SET utf8 doesn't change DEFAULT CHARSET. +# +CREATE TABLE t1 (id int(11) NOT NULL, a int(11) NOT NULL, b int(11)) +ENGINE=InnoDB DEFAULT CHARSET=latin1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `a` int(11) NOT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE t1; +# # Start of 10.1 tests # # diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result index f3f5e227d3a..4a26d0f19dd 100644 --- a/mysql-test/r/contributors.result +++ b/mysql-test/r/contributors.result @@ -1,15 +1,17 @@ SHOW CONTRIBUTORS; Name Location Comment -Booking.com http://www.booking.com Founding member, Platinum Sponsor of the MariaDB Foundation +Booking.com https://www.booking.com Founding member, Platinum Sponsor of the MariaDB Foundation +Alibaba Cloud https://intl.aliyun.com Platinum Sponsor of the MariaDB Foundation MariaDB Corporation https://mariadb.com Founding member, Gold Sponsor of the MariaDB Foundation -Visma http://visma.com Gold Sponsor of the MariaDB Foundation -DBS http://dbs.com Gold Sponsor of the MariaDB Foundation +Visma https://visma.com Gold Sponsor of the MariaDB Foundation +DBS https://dbs.com Gold Sponsor of the MariaDB Foundation Nexedi https://www.nexedi.com Silver Sponsor of the MariaDB Foundation Acronis http://www.acronis.com Silver Sponsor of the MariaDB Foundation Auttomattic https://automattic.com Bronze Sponsor of the MariaDB Foundation -Verkkokauppa.com https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation -Virtuozzo https://virtuozzo.com/ Bronze Sponsor of the MariaDB Foundation -Tencent Game DBA http://tencentdba.com/about/ Bronze Sponsor of the MariaDB Foundation +Verkkokauppa.com https://www.verkkokauppa.com Bronze Sponsor of the MariaDB Foundation +Virtuozzo https://virtuozzo.com Bronze Sponsor of the MariaDB Foundation +Tencent Game DBA http://tencentdba.com/about Bronze Sponsor of the MariaDB Foundation +Tencent TDSQL http://tdsql.org Bronze Sponsor of the MariaDB Foundation Google USA Sponsoring encryption, parallel replication and GTID Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction diff --git a/mysql-test/r/ctype_upgrade.result b/mysql-test/r/ctype_upgrade.result index b317be42d5c..53cb858035b 100644 --- a/mysql-test/r/ctype_upgrade.result +++ b/mysql-test/r/ctype_upgrade.result @@ -227,7 +227,7 @@ DROP TABLE mysql050614_xxx_croatian_ci; # Checking mysql_upgrade # # Running mysql_upgrade -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -258,10 +258,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -280,11 +281,11 @@ test.maria050313_ucs2_croatian_ci_def OK test.maria050313_utf8_croatian_ci OK test.maria050533_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK # Running mysql_upgrade for the second time # This should report OK for all tables -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -315,10 +316,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -331,7 +333,7 @@ test.maria050313_utf8_croatian_ci OK test.maria050533_xxx_croatian_ci OK test.maria100004_xxx_croatian_ci OK test.mysql050614_xxx_croatian_ci OK -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def; Table Create Table diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index d0ac61493c2..8a7422ba5ec 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -1018,6 +1018,29 @@ David Yes 210 Edward Yes 150 DROP TABLE example1463; set sql_mode= @save_sql_mode; +# +# MDEV-9028: SELECT DISTINCT constant column of derived table +# used as the second operand of LEFT JOIN +# +create table t1 (id int, data varchar(255)); +insert into t1 values (1,'yes'),(2,'yes'); +select distinct t1.id, tt.id, tt.data +from t1 +left join +(select t1.id, 'yes' as data from t1) as tt +on t1.id = tt.id; +id id data +1 1 yes +2 2 yes +select distinct t1.id, tt.id, tt.data +from t1 +left join +(select t1.id, 'yes' as data from t1 where id > 1) as tt +on t1.id = tt.id; +id id data +2 2 yes +1 NULL NULL +drop table t1; # end of 5.5 # # Start of 10.1 tests diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index fd58ee038c7..021633200e1 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -8317,7 +8317,7 @@ EXPLAIN "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "<in_optimizer>(1,<exists>(subquery#2)) or v1.c = 'foo'", + "attached_condition": "<cache>(<in_optimizer>(1,<exists>(subquery#2))) or v1.c = 'foo'", "materialized": { "query_block": { "select_id": 3, diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index 316d7bdc4bc..7a451a312ca 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -2305,6 +2305,11 @@ GROUP BY TABLE_SCHEMA) AS UNIQUES ON ( COLUMNS.TABLE_SCHEMA = UNIQUES.TABLE_SCHEMA); COUNT(*) > 0 1 +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' DROP TABLE t1; SET SESSION optimizer_switch= @save_optimizer_switch; # diff --git a/mysql-test/r/drop_bad_db_type.result b/mysql-test/r/drop_bad_db_type.result index 6a125cdccf5..de22373e0fd 100644 --- a/mysql-test/r/drop_bad_db_type.result +++ b/mysql-test/r/drop_bad_db_type.result @@ -4,6 +4,27 @@ create table t1 (a int) engine=archive; insert t1 values (1),(2),(3); flush tables; uninstall soname 'ha_archive'; +select table_schema, table_name from information_schema.tables where table_name like 't1'; +table_schema test +table_name t1 +select table_schema, table_name, engine, version from information_schema.tables where table_name like 't1'; +table_schema test +table_name t1 +engine ARCHIVE +version NULL +Warnings: +Level Warning +Code 1286 +Message Unknown storage engine 'ARCHIVE' +select table_schema, table_name, engine, row_format from information_schema.tables where table_name like 't1'; +table_schema test +table_name t1 +engine ARCHIVE +row_format NULL +Warnings: +Level Warning +Code 1286 +Message Unknown storage engine 'ARCHIVE' install soname 'ha_archive'; t1.ARZ t1.frm diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 005b4239e9c..b9ee2a9136f 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1730,7 +1730,7 @@ SPATIAL_REF_SYS CREATE TEMPORARY TABLE `SPATIAL_REF_SYS` ( ) ENGINE=MEMORY DEFAULT CHARSET=utf8 create table t1(g GEOMETRY, pt POINT); create table t2(g LINESTRING, pl POLYGON); -select * from information_schema.geometry_columns; +select * from information_schema.geometry_columns where f_table_schema='test'; F_TABLE_CATALOG F_TABLE_SCHEMA F_TABLE_NAME F_GEOMETRY_COLUMN G_TABLE_CATALOG G_TABLE_SCHEMA G_TABLE_NAME G_GEOMETRY_COLUMN STORAGE_TYPE GEOMETRY_TYPE COORD_DIMENSION MAX_PPR SRID def test t1 def test t1 g 1 0 2 0 0 def test t1 def test t1 pt 1 1 2 0 0 @@ -1739,7 +1739,7 @@ def test t2 def test t2 pl 1 3 2 0 0 drop table t1, t2; 10.1 tests create table t1(g GEOMETRY(9,4) REF_SYSTEM_ID=101, pt POINT(8,2), pg GEOMETRY REF_SYSTEM_ID=102); -SELECT SRID from information_schema.geometry_columns WHERE G_TABLE_NAME='t1'; +SELECT SRID from information_schema.geometry_columns WHERE f_table_schema='test' and G_TABLE_NAME='t1'; SRID 101 0 diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 2d6d9f3b632..b250137ebf8 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -2616,6 +2616,61 @@ DROP USER mysqltest_u1@localhost; # End of Bug#38347. # +# BUG#11759114 - '51401: GRANT TREATS NONEXISTENT FUNCTIONS/PRIVILEGES +# DIFFERENTLY'. +# +drop database if exists mysqltest_db1; +create database mysqltest_db1; +create user mysqltest_u1; +# Both GRANT statements below should fail with the same error. +grant execute on function mysqltest_db1.f1 to mysqltest_u1; +ERROR 42000: FUNCTION or PROCEDURE f1 does not exist +grant execute on procedure mysqltest_db1.p1 to mysqltest_u1; +ERROR 42000: FUNCTION or PROCEDURE p1 does not exist +# Let us show that GRANT behaviour for routines is consistent +# with GRANT behaviour for tables. Attempt to grant privilege +# on non-existent table also results in an error. +grant select on mysqltest_db1.t1 to mysqltest_u1; +ERROR 42S02: Table 'mysqltest_db1.t1' doesn't exist +show grants for mysqltest_u1; +Grants for mysqltest_u1@% +GRANT USAGE ON *.* TO 'mysqltest_u1'@'%' +drop database mysqltest_db1; +drop user mysqltest_u1; +# +# Bug#12766319 - 61865: RENAME USER DOES NOT WORK CORRECTLY - +# REQUIRES FLUSH PRIVILEGES +# +CREATE USER foo@'127.0.0.1'; +GRANT ALL ON *.* TO foo@'127.0.0.1'; +# First attempt, should connect successfully +connect conn1, '127.0.0.1', foo,,test; +SELECT user(), current_user(); +user() current_user() +foo@localhost foo@127.0.0.1 +# Rename the user +RENAME USER foo@'127.0.0.1' to foo@'127.0.0.0/255.0.0.0'; +# Second attempt, should connect successfully as its valid mask +# This was failing without fix +connect conn2, '127.0.0.1', foo,,test; +SELECT user(), current_user(); +user() current_user() +foo@localhost foo@127.0.0.0/255.0.0.0 +# Rename the user back to original +RENAME USER foo@'127.0.0.0/255.0.0.0' to foo@'127.0.0.1'; +# Third attempt, should connect successfully +connect conn3, '127.0.0.1', foo,,test; +SELECT user(), current_user(); +user() current_user() +foo@localhost foo@127.0.0.1 +# Clean-up +connection default; +disconnect conn1; +disconnect conn2; +disconnect conn3; +DROP USER foo@'127.0.0.1'; +# End of Bug#12766319 +# # Bug#11756966 - 48958: STORED PROCEDURES CAN BE LEVERAGED TO BYPASS # DATABASE SECURITY # @@ -2642,28 +2697,6 @@ connection default; disconnect con1; DROP USER untrusted@localhost; DROP DATABASE secret; -# -# BUG#11759114 - '51401: GRANT TREATS NONEXISTENT FUNCTIONS/PRIVILEGES -# DIFFERENTLY'. -# -drop database if exists mysqltest_db1; -create database mysqltest_db1; -create user mysqltest_u1; -# Both GRANT statements below should fail with the same error. -grant execute on function mysqltest_db1.f1 to mysqltest_u1; -ERROR 42000: FUNCTION or PROCEDURE f1 does not exist -grant execute on procedure mysqltest_db1.p1 to mysqltest_u1; -ERROR 42000: FUNCTION or PROCEDURE p1 does not exist -# Let us show that GRANT behaviour for routines is consistent -# with GRANT behaviour for tables. Attempt to grant privilege -# on non-existent table also results in an error. -grant select on mysqltest_db1.t1 to mysqltest_u1; -ERROR 42S02: Table 'mysqltest_db1.t1' doesn't exist -show grants for mysqltest_u1; -Grants for mysqltest_u1@% -GRANT USAGE ON *.* TO 'mysqltest_u1'@'%' -drop database mysqltest_db1; -drop user mysqltest_u1; set GLOBAL sql_mode=default; # # Start of 10.2 tests diff --git a/mysql-test/r/handlersocket.result b/mysql-test/r/handlersocket.result index e38de6bf5c2..26c77813b26 100644 --- a/mysql-test/r/handlersocket.result +++ b/mysql-test/r/handlersocket.result @@ -5,7 +5,7 @@ plugin_version 1.0 plugin_status ACTIVE plugin_type DAEMON plugin_library handlersocket.so -plugin_library_version 1.11 +plugin_library_version 1.12 plugin_author higuchi dot akira at dena dot jp plugin_description Direct access into InnoDB plugin_license BSD diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 17e48ae329c..aea2d604b03 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -759,6 +759,9 @@ from information_schema.statistics join information_schema.columns using(table_n TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA 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 COLUMN_COMMENT user Host def mysql 0 mysql PRIMARY 1 A NULL NULL BTREE def mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI user User def mysql 0 mysql PRIMARY 2 A NULL NULL BTREE def mysql NO char 80 240 NULL NULL utf8 utf8_bin char(80) PRI +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' drop table t1; drop table t2; drop table t3; diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result index 28f8a1e5990..917a31e2a79 100644 --- a/mysql-test/r/join_nested.result +++ b/mysql-test/r/join_nested.result @@ -1870,4 +1870,99 @@ f4 NULL NULL DROP TABLE t1,t2,t3,t4,t5; +# +# MDEV-7992: Nested left joins + 'not exists' optimization +# +CREATE TABLE t1( +K1 INT PRIMARY KEY, +Name VARCHAR(15) +); +INSERT INTO t1 VALUES +(1,'T1Row1'), (2,'T1Row2'); +CREATE TABLE t2( +K2 INT PRIMARY KEY, +K1r INT, +rowTimestamp DATETIME, +Event VARCHAR(15) +); +INSERT INTO t2 VALUES +(1, 1, '2015-04-13 10:42:11' ,'T1Row1Event1'), +(2, 1, '2015-04-13 10:42:12' ,'T1Row1Event2'), +(3, 1, '2015-04-13 10:42:12' ,'T1Row1Event3'); +SELECT t1a.*, t2a.*, +t2i.K2 AS K2B, t2i.K1r AS K1rB, +t2i.rowTimestamp AS rowTimestampB, t2i.Event AS EventB +FROM +t1 t1a JOIN t2 t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +( t1 t1i LEFT JOIN t2 t2i ON t2i.K1r = t1i.K1) +ON (t1i.K1 = 1) AND +(((t2i.K1r = t1a.K1 AND t2i.rowTimestamp > t2a.rowTimestamp ) OR +(t2i.rowTimestamp = t2a.rowTimestamp AND t2i.K2 > t2a.K2)) +OR (t2i.K2 IS NULL)) +WHERE +t2a.K1r = 1 AND t2i.K2 IS NULL; +K1 Name K2 K1r rowTimestamp Event K2B K1rB rowTimestampB EventB +1 T1Row1 3 1 2015-04-13 10:42:12 T1Row1Event3 NULL NULL NULL NULL +EXPLAIN EXTENDED SELECT t1a.*, t2a.*, +t2i.K2 AS K2B, t2i.K1r AS K1rB, +t2i.rowTimestamp AS rowTimestampB, t2i.Event AS EventB +FROM +t1 t1a JOIN t2 t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +( t1 t1i LEFT JOIN t2 t2i ON t2i.K1r = t1i.K1) +ON (t1i.K1 = 1) AND +(((t2i.K1r = t1a.K1 AND t2i.rowTimestamp > t2a.rowTimestamp ) OR +(t2i.rowTimestamp = t2a.rowTimestamp AND t2i.K2 > t2a.K2)) +OR (t2i.K2 IS NULL)) +WHERE +t2a.K1r = 1 AND t2i.K2 IS NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1a const PRIMARY PRIMARY 4 const 1 100.00 +1 SIMPLE t2a ALL NULL NULL NULL NULL 3 100.00 Using where +1 SIMPLE t1i const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2i ALL NULL NULL NULL NULL 3 100.00 Using where; Not exists +Warnings: +Note 1003 select 1 AS `K1`,'T1Row1' AS `Name`,`test`.`t2a`.`K2` AS `K2`,`test`.`t2a`.`K1r` AS `K1r`,`test`.`t2a`.`rowTimestamp` AS `rowTimestamp`,`test`.`t2a`.`Event` AS `Event`,`test`.`t2i`.`K2` AS `K2B`,`test`.`t2i`.`K1r` AS `K1rB`,`test`.`t2i`.`rowTimestamp` AS `rowTimestampB`,`test`.`t2i`.`Event` AS `EventB` from `test`.`t1` `t1a` join `test`.`t2` `t2a` left join (`test`.`t1` `t1i` left join `test`.`t2` `t2i` on(`test`.`t2i`.`K1r` = 1)) on(`test`.`t1i`.`K1` = 1 and (`test`.`t2i`.`K1r` = 1 and `test`.`t2i`.`rowTimestamp` > `test`.`t2a`.`rowTimestamp` or `test`.`t2i`.`rowTimestamp` = `test`.`t2a`.`rowTimestamp` and `test`.`t2i`.`K2` > `test`.`t2a`.`K2` or `test`.`t2i`.`K2` is null)) where `test`.`t2a`.`K1r` = 1 and `test`.`t2i`.`K2` is null +CREATE VIEW v1 AS +SELECT t2i.* +FROM t1 as t1i LEFT JOIN t2 as t2i ON t2i.K1r = t1i.K1 +WHERE t1i.K1 = 1 ; +SELECT +t1a.*, t2a.*, t2b.K2 as K2B, t2b.K1r as K1rB, +t2b.rowTimestamp as rowTimestampB, t2b.Event as EventB +FROM +t1 as t1a JOIN t2 as t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +v1 as t2b +ON ((t2b.K1r = t1a.K1 AND t2b.rowTimestamp > t2a.rowTimestamp) OR +(t2b.rowTimestamp = t2a.rowTimestamp AND t2b.K2 > t2a.K2)) +OR (t2b.K2 IS NULL) +WHERE +t1a.K1 = 1 AND +t2b.K2 IS NULL; +K1 Name K2 K1r rowTimestamp Event K2B K1rB rowTimestampB EventB +1 T1Row1 3 1 2015-04-13 10:42:12 T1Row1Event3 NULL NULL NULL NULL +EXPLAIN EXTENDED SELECT +t1a.*, t2a.*, t2b.K2 as K2B, t2b.K1r as K1rB, +t2b.rowTimestamp as rowTimestampB, t2b.Event as EventB +FROM +t1 as t1a JOIN t2 as t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +v1 as t2b +ON ((t2b.K1r = t1a.K1 AND t2b.rowTimestamp > t2a.rowTimestamp) OR +(t2b.rowTimestamp = t2a.rowTimestamp AND t2b.K2 > t2a.K2)) +OR (t2b.K2 IS NULL) +WHERE +t1a.K1 = 1 AND +t2b.K2 IS NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1a const PRIMARY PRIMARY 4 const 1 100.00 +1 SIMPLE t2a ALL NULL NULL NULL NULL 3 100.00 Using where +1 SIMPLE t1i const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2i ALL NULL NULL NULL NULL 3 100.00 Using where; Not exists +Warnings: +Note 1003 select 1 AS `K1`,'T1Row1' AS `Name`,`t2a`.`K2` AS `K2`,`t2a`.`K1r` AS `K1r`,`t2a`.`rowTimestamp` AS `rowTimestamp`,`t2a`.`Event` AS `Event`,`test`.`t2i`.`K2` AS `K2B`,`test`.`t2i`.`K1r` AS `K1rB`,`test`.`t2i`.`rowTimestamp` AS `rowTimestampB`,`test`.`t2i`.`Event` AS `EventB` from `test`.`t1` `t1a` join `test`.`t2` `t2a` left join (`test`.`t1` `t1i` left join `test`.`t2` `t2i` on(`test`.`t2i`.`K1r` = 1)) on(`test`.`t1i`.`K1` = 1 and (`test`.`t2i`.`K1r` = 1 and `test`.`t2i`.`rowTimestamp` > `t2a`.`rowTimestamp` or `test`.`t2i`.`rowTimestamp` = `t2a`.`rowTimestamp` and `test`.`t2i`.`K2` > `t2a`.`K2` or `test`.`t2i`.`K2` is null)) where `t2a`.`K1r` = 1 and `test`.`t2i`.`K2` is null +DROP VIEW v1; +DROP TABLE t1,t2; set optimizer_search_depth= @tmp_mdev621; diff --git a/mysql-test/r/join_nested_jcl6.result b/mysql-test/r/join_nested_jcl6.result index d1f402054cf..1ffd94547cc 100644 --- a/mysql-test/r/join_nested_jcl6.result +++ b/mysql-test/r/join_nested_jcl6.result @@ -1881,6 +1881,101 @@ f4 NULL NULL DROP TABLE t1,t2,t3,t4,t5; +# +# MDEV-7992: Nested left joins + 'not exists' optimization +# +CREATE TABLE t1( +K1 INT PRIMARY KEY, +Name VARCHAR(15) +); +INSERT INTO t1 VALUES +(1,'T1Row1'), (2,'T1Row2'); +CREATE TABLE t2( +K2 INT PRIMARY KEY, +K1r INT, +rowTimestamp DATETIME, +Event VARCHAR(15) +); +INSERT INTO t2 VALUES +(1, 1, '2015-04-13 10:42:11' ,'T1Row1Event1'), +(2, 1, '2015-04-13 10:42:12' ,'T1Row1Event2'), +(3, 1, '2015-04-13 10:42:12' ,'T1Row1Event3'); +SELECT t1a.*, t2a.*, +t2i.K2 AS K2B, t2i.K1r AS K1rB, +t2i.rowTimestamp AS rowTimestampB, t2i.Event AS EventB +FROM +t1 t1a JOIN t2 t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +( t1 t1i LEFT JOIN t2 t2i ON t2i.K1r = t1i.K1) +ON (t1i.K1 = 1) AND +(((t2i.K1r = t1a.K1 AND t2i.rowTimestamp > t2a.rowTimestamp ) OR +(t2i.rowTimestamp = t2a.rowTimestamp AND t2i.K2 > t2a.K2)) +OR (t2i.K2 IS NULL)) +WHERE +t2a.K1r = 1 AND t2i.K2 IS NULL; +K1 Name K2 K1r rowTimestamp Event K2B K1rB rowTimestampB EventB +1 T1Row1 3 1 2015-04-13 10:42:12 T1Row1Event3 NULL NULL NULL NULL +EXPLAIN EXTENDED SELECT t1a.*, t2a.*, +t2i.K2 AS K2B, t2i.K1r AS K1rB, +t2i.rowTimestamp AS rowTimestampB, t2i.Event AS EventB +FROM +t1 t1a JOIN t2 t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +( t1 t1i LEFT JOIN t2 t2i ON t2i.K1r = t1i.K1) +ON (t1i.K1 = 1) AND +(((t2i.K1r = t1a.K1 AND t2i.rowTimestamp > t2a.rowTimestamp ) OR +(t2i.rowTimestamp = t2a.rowTimestamp AND t2i.K2 > t2a.K2)) +OR (t2i.K2 IS NULL)) +WHERE +t2a.K1r = 1 AND t2i.K2 IS NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1a const PRIMARY PRIMARY 4 const 1 100.00 +1 SIMPLE t2a ALL NULL NULL NULL NULL 3 100.00 Using where +1 SIMPLE t1i const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2i ALL NULL NULL NULL NULL 3 100.00 Using where; Not exists +Warnings: +Note 1003 select 1 AS `K1`,'T1Row1' AS `Name`,`test`.`t2a`.`K2` AS `K2`,`test`.`t2a`.`K1r` AS `K1r`,`test`.`t2a`.`rowTimestamp` AS `rowTimestamp`,`test`.`t2a`.`Event` AS `Event`,`test`.`t2i`.`K2` AS `K2B`,`test`.`t2i`.`K1r` AS `K1rB`,`test`.`t2i`.`rowTimestamp` AS `rowTimestampB`,`test`.`t2i`.`Event` AS `EventB` from `test`.`t1` `t1a` join `test`.`t2` `t2a` left join (`test`.`t1` `t1i` left join `test`.`t2` `t2i` on(`test`.`t2i`.`K1r` = 1)) on(`test`.`t1i`.`K1` = 1 and (`test`.`t2i`.`K1r` = 1 and `test`.`t2i`.`rowTimestamp` > `test`.`t2a`.`rowTimestamp` or `test`.`t2i`.`rowTimestamp` = `test`.`t2a`.`rowTimestamp` and `test`.`t2i`.`K2` > `test`.`t2a`.`K2` or `test`.`t2i`.`K2` is null)) where `test`.`t2a`.`K1r` = 1 and `test`.`t2i`.`K2` is null +CREATE VIEW v1 AS +SELECT t2i.* +FROM t1 as t1i LEFT JOIN t2 as t2i ON t2i.K1r = t1i.K1 +WHERE t1i.K1 = 1 ; +SELECT +t1a.*, t2a.*, t2b.K2 as K2B, t2b.K1r as K1rB, +t2b.rowTimestamp as rowTimestampB, t2b.Event as EventB +FROM +t1 as t1a JOIN t2 as t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +v1 as t2b +ON ((t2b.K1r = t1a.K1 AND t2b.rowTimestamp > t2a.rowTimestamp) OR +(t2b.rowTimestamp = t2a.rowTimestamp AND t2b.K2 > t2a.K2)) +OR (t2b.K2 IS NULL) +WHERE +t1a.K1 = 1 AND +t2b.K2 IS NULL; +K1 Name K2 K1r rowTimestamp Event K2B K1rB rowTimestampB EventB +1 T1Row1 3 1 2015-04-13 10:42:12 T1Row1Event3 NULL NULL NULL NULL +EXPLAIN EXTENDED SELECT +t1a.*, t2a.*, t2b.K2 as K2B, t2b.K1r as K1rB, +t2b.rowTimestamp as rowTimestampB, t2b.Event as EventB +FROM +t1 as t1a JOIN t2 as t2a ON t2a.K1r = t1a.K1 +LEFT JOIN +v1 as t2b +ON ((t2b.K1r = t1a.K1 AND t2b.rowTimestamp > t2a.rowTimestamp) OR +(t2b.rowTimestamp = t2a.rowTimestamp AND t2b.K2 > t2a.K2)) +OR (t2b.K2 IS NULL) +WHERE +t1a.K1 = 1 AND +t2b.K2 IS NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1a const PRIMARY PRIMARY 4 const 1 100.00 +1 SIMPLE t2a ALL NULL NULL NULL NULL 3 100.00 Using where +1 SIMPLE t1i const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2i ALL NULL NULL NULL NULL 3 100.00 Using where; Not exists +Warnings: +Note 1003 select 1 AS `K1`,'T1Row1' AS `Name`,`t2a`.`K2` AS `K2`,`t2a`.`K1r` AS `K1r`,`t2a`.`rowTimestamp` AS `rowTimestamp`,`t2a`.`Event` AS `Event`,`test`.`t2i`.`K2` AS `K2B`,`test`.`t2i`.`K1r` AS `K1rB`,`test`.`t2i`.`rowTimestamp` AS `rowTimestampB`,`test`.`t2i`.`Event` AS `EventB` from `test`.`t1` `t1a` join `test`.`t2` `t2a` left join (`test`.`t1` `t1i` left join `test`.`t2` `t2i` on(`test`.`t2i`.`K1r` = 1)) on(`test`.`t1i`.`K1` = 1 and (`test`.`t2i`.`K1r` = 1 and `test`.`t2i`.`rowTimestamp` > `t2a`.`rowTimestamp` or `test`.`t2i`.`rowTimestamp` = `t2a`.`rowTimestamp` and `test`.`t2i`.`K2` > `t2a`.`K2` or `test`.`t2i`.`K2` is null)) where `t2a`.`K1r` = 1 and `test`.`t2i`.`K2` is null +DROP VIEW v1; +DROP TABLE t1,t2; set optimizer_search_depth= @tmp_mdev621; CREATE TABLE t5 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b)); CREATE TABLE t6 (a int, b int, c int, PRIMARY KEY(a), KEY b_i (b)); diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 2ec12bfe1c4..126230a8765 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -436,9 +436,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 thread_id rows_affected seq -START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 0 2 -START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 0 3 -START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 0 4 +START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 4 0 2 +START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 4 0 3 +START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 4 0 4 SET GLOBAL slow_query_log = 0; SET SESSION long_query_time =@saved_long_query_time; FLUSH LOGS; diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result index 6cbb25bd1d4..a56d067c2cd 100644 --- a/mysql-test/r/log_tables_upgrade.result +++ b/mysql-test/r/log_tables_upgrade.result @@ -11,7 +11,7 @@ Table Op Msg_type Msg_text test.bug49823 repair status OK RENAME TABLE general_log TO renamed_general_log; RENAME TABLE test.bug49823 TO general_log; -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -43,10 +43,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -54,7 +55,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK DROP TABLE general_log; RENAME TABLE renamed_general_log TO general_log; diff --git a/mysql-test/r/mysql_upgrade-6984.result b/mysql-test/r/mysql_upgrade-6984.result index fec0fcacb5f..59c9a865b7c 100644 --- a/mysql-test/r/mysql_upgrade-6984.result +++ b/mysql-test/r/mysql_upgrade-6984.result @@ -1,5 +1,5 @@ update mysql.user set password=password("foo") where user='root'; -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -42,10 +42,11 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -53,7 +54,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK connect con1,localhost,root,foo,,,; update mysql.user set password='' where user='root'; diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 99446cd9d6f..a337a939acc 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -1,6 +1,6 @@ set sql_mode=""; Run mysql_upgrade once -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -31,10 +31,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -42,12 +43,12 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK Run it again - should say already completed This installation of MySQL is already upgraded to VERSION, use --force if you still need to run mysql_upgrade Force should run it regardless of whether it has been run before -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -78,10 +79,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -89,12 +91,12 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila'; GRANT ALL ON *.* TO mysqltest1@'%'; Run mysql_upgrade with password protected account -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -125,10 +127,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -136,7 +139,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK DROP USER mysqltest1@'%'; Version check failed. Got the following error when calling the 'mysql' command line client @@ -146,7 +149,7 @@ Run mysql_upgrade with a non existing server socket mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect FATAL ERROR: Upgrade failed set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -177,10 +180,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -188,7 +192,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK set GLOBAL sql_mode=default; # @@ -199,7 +203,7 @@ CREATE PROCEDURE testproc() BEGIN END; UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc'; UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc'; UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc'; -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -230,10 +234,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -241,7 +246,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK CALL testproc(); DROP PROCEDURE testproc; @@ -255,7 +260,7 @@ WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been GRANT USAGE ON *.* TO 'user3'@'%'; GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'; Run mysql_upgrade with all privileges on a user -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -286,10 +291,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -297,7 +303,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK SHOW GRANTS FOR 'user3'@'%'; Grants for user3@% @@ -306,7 +312,7 @@ GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%' DROP USER 'user3'@'%'; End of 5.1 tests The --upgrade-system-tables option was used, user tables won't be touched. -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -337,11 +343,12 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views... Skipped -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names ... Skipped -Phase 5/6: Checking and upgrading tables... Skipped -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views... Skipped +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names ... Skipped +Phase 6/7: Checking and upgrading tables... Skipped +Phase 7/7: Running 'FLUSH PRIVILEGES' OK # # Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION @@ -349,7 +356,7 @@ OK # # Droping the previously created mysql_upgrade_info file.. # Running mysql_upgrade with --skip-write-binlog.. -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -380,10 +387,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -391,7 +399,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK # # Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR @@ -413,7 +421,7 @@ GRANT INSERT ON mysql.user TO very_long_user_name_number_2; GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1; GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2; CREATE PROCEDURE test.pr() BEGIN END; -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -444,10 +452,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -455,7 +464,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr'; definer @@ -471,7 +480,7 @@ set sql_mode=default; create table test.t1(a int) engine=MyISAM; # Trying to enforce InnoDB for all tables SET GLOBAL enforce_storage_engine=InnoDB; -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -502,10 +511,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -514,7 +524,7 @@ mtr.test_suppressions OK performance_schema test test.t1 OK -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK # Should return 2 SELECT count(*) FROM information_schema.tables where ENGINE="InnoDB"; diff --git a/mysql-test/r/mysql_upgrade_no_innodb.result b/mysql-test/r/mysql_upgrade_no_innodb.result index acbca131587..6ad818278f8 100644 --- a/mysql-test/r/mysql_upgrade_no_innodb.result +++ b/mysql-test/r/mysql_upgrade_no_innodb.result @@ -1,5 +1,5 @@ The --upgrade-system-tables option was used, user tables won't be touched. -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -42,9 +42,10 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/6: Fixing views... Skipped -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names ... Skipped -Phase 5/6: Checking and upgrading tables... Skipped -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views... Skipped +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names ... Skipped +Phase 6/7: Checking and upgrading tables... Skipped +Phase 7/7: Running 'FLUSH PRIVILEGES' OK diff --git a/mysql-test/r/mysql_upgrade_noengine.result b/mysql-test/r/mysql_upgrade_noengine.result new file mode 100644 index 00000000000..09e705abb69 --- /dev/null +++ b/mysql-test/r/mysql_upgrade_noengine.result @@ -0,0 +1,297 @@ +install soname 'ha_blackhole'; +install soname 'ha_archive'; +create table t1 (a int) engine=blackhole; +create table t2 (a int) engine=archive; +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; +table_catalog def +table_schema test +table_name t1 +table_type BASE TABLE +engine BLACKHOLE +row_format Fixed +table_rows 0 +data_length 0 +table_comment +table_catalog def +table_schema test +table_name t2 +table_type BASE TABLE +engine ARCHIVE +row_format Compressed +table_rows 0 +data_length 521 +table_comment +flush tables; +uninstall plugin blackhole; +uninstall plugin archive; +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; +table_catalog def +table_schema test +table_name t1 +table_type BASE TABLE +engine BLACKHOLE +row_format NULL +table_rows NULL +data_length NULL +table_comment Unknown storage engine 'BLACKHOLE' +table_catalog def +table_schema test +table_name t2 +table_type BASE TABLE +engine ARCHIVE +row_format NULL +table_rows NULL +data_length NULL +table_comment Unknown storage engine 'ARCHIVE' +Warnings: +Level Warning +Code 1286 +Message Unknown storage engine 'BLACKHOLE' +Level Warning +Code 1286 +Message Unknown storage engine 'ARCHIVE' +Phase 1/7: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.index_stats OK +mysql.innodb_index_stats OK +mysql.innodb_table_stats OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +test.t1 +Error : Unknown storage engine 'BLACKHOLE' +error : Corrupt +test.t2 +Error : Unknown storage engine 'ARCHIVE' +error : Corrupt + +Repairing tables +test.t1 +Error : Unknown storage engine 'BLACKHOLE' +error : Corrupt +test.t2 +Error : Unknown storage engine 'ARCHIVE' +error : Corrupt +Phase 7/7: Running 'FLUSH PRIVILEGES' +OK +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; +table_catalog def +table_schema test +table_name t1 +table_type BASE TABLE +engine BLACKHOLE +row_format NULL +table_rows NULL +data_length NULL +table_comment Unknown storage engine 'BLACKHOLE' +table_catalog def +table_schema test +table_name t2 +table_type BASE TABLE +engine ARCHIVE +row_format NULL +table_rows NULL +data_length NULL +table_comment Unknown storage engine 'ARCHIVE' +Warnings: +Level Warning +Code 1286 +Message Unknown storage engine 'BLACKHOLE' +Level Warning +Code 1286 +Message Unknown storage engine 'ARCHIVE' +alter table mysql.user drop column default_role, drop column max_statement_time; +Phase 1/7: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.index_stats OK +mysql.innodb_index_stats OK +mysql.innodb_table_stats OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +test.t1 +Error : Unknown storage engine 'BLACKHOLE' +error : Corrupt +test.t2 +Error : Unknown storage engine 'ARCHIVE' +error : Corrupt + +Repairing tables +test.t1 +Error : Unknown storage engine 'BLACKHOLE' +error : Corrupt +test.t2 +Error : Unknown storage engine 'ARCHIVE' +error : Corrupt +Phase 7/7: Running 'FLUSH PRIVILEGES' +OK +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; +table_catalog def +table_schema test +table_name t1 +table_type BASE TABLE +engine BLACKHOLE +row_format NULL +table_rows NULL +data_length NULL +table_comment Unknown storage engine 'BLACKHOLE' +table_catalog def +table_schema test +table_name t2 +table_type BASE TABLE +engine ARCHIVE +row_format NULL +table_rows NULL +data_length NULL +table_comment Unknown storage engine 'ARCHIVE' +Warnings: +Level Warning +Code 1286 +Message Unknown storage engine 'BLACKHOLE' +Level Warning +Code 1286 +Message Unknown storage engine 'ARCHIVE' +alter table mysql.user drop column default_role, drop column max_statement_time; +Phase 1/7: Checking and upgrading mysql database +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.gtid_slave_pos OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.index_stats OK +mysql.innodb_index_stats OK +mysql.innodb_table_stats OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.roles_mapping OK +mysql.servers OK +mysql.table_stats OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +Upgrading from a version before MariaDB-10.1 +Phase 2/7: Installing used storage engines +Checking for tables with unknown storage engine +installing plugin for 'blackhole' storage engine +installing plugin for 'archive' storage engine +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +test.t1 OK +test.t2 OK +Phase 7/7: Running 'FLUSH PRIVILEGES' +OK +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; +table_catalog def +table_schema test +table_name t1 +table_type BASE TABLE +engine BLACKHOLE +row_format Fixed +table_rows 0 +data_length 0 +table_comment +table_catalog def +table_schema test +table_name t2 +table_type BASE TABLE +engine ARCHIVE +row_format Compressed +table_rows 0 +data_length 521 +table_comment +drop table t1, t2; +uninstall plugin blackhole; +uninstall plugin archive; diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result index e06d1bb1671..918a24ffc71 100644 --- a/mysql-test/r/mysql_upgrade_ssl.result +++ b/mysql-test/r/mysql_upgrade_ssl.result @@ -1,7 +1,7 @@ # # Bug#55672 mysql_upgrade dies with internal error # -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -32,10 +32,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/6: Fixing views -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -43,5 +44,5 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result index f43f42f97fd..dc31592566a 100644 --- a/mysql-test/r/mysql_upgrade_view.result +++ b/mysql-test/r/mysql_upgrade_view.result @@ -63,7 +63,7 @@ test.v2 check error Upgrade required. Please do "REPAIR VIEW `v2`" or dump/reloa check view v3 for upgrade; Table Op Msg_type Msg_text test.v3 check error Upgrade required. Please do "REPAIR VIEW `v3`" or dump/reload to fix it! -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -106,14 +106,15 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/6: Fixing views +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views test.v1 OK test.v1badcheck OK test.v2 OK test.v3 OK -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -123,7 +124,7 @@ performance_schema test test.kv OK test.t1 OK -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK show create view v1; View Create View character_set_client collation_connection @@ -205,7 +206,7 @@ show create view v4; View Create View character_set_client collation_connection v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci MySQL upgrade detected -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -249,14 +250,15 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/6: Fixing views from mysql +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views from mysql test.v1 OK test.v2 OK test.v3 OK test.v4 OK -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names -Phase 5/6: Checking and upgrading tables +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names +Phase 6/7: Checking and upgrading tables Processing databases information_schema mtr @@ -266,7 +268,7 @@ performance_schema test test.kv OK test.t1 OK -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 7/7: Running 'FLUSH PRIVILEGES' OK flush tables; show create view v1; @@ -323,7 +325,7 @@ rename table mysql.event to mysql.ev_bk; flush tables; The --upgrade-system-tables option was used, user tables won't be touched. MySQL upgrade detected -Phase 1/6: Checking and upgrading mysql database +Phase 1/7: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -367,14 +369,15 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/6: Fixing views from mysql +Phase 2/7: Installing used storage engines... Skipped +Phase 3/7: Fixing views from mysql test.v1 OK test.v2 OK test.v3 OK -Phase 3/6: Running 'mysql_fix_privilege_tables' -Phase 4/6: Fixing table and database names ... Skipped -Phase 5/6: Checking and upgrading tables... Skipped -Phase 6/6: Running 'FLUSH PRIVILEGES' +Phase 4/7: Running 'mysql_fix_privilege_tables' +Phase 5/7: Fixing table and database names ... Skipped +Phase 6/7: Checking and upgrading tables... Skipped +Phase 7/7: Running 'FLUSH PRIVILEGES' OK drop table mysql.event; rename table mysql.ev_bk to mysql.event; diff --git a/mysql-test/r/mysqlbinlog_row_compressed.result b/mysql-test/r/mysqlbinlog_row_compressed.result index 0583ee354df..24fff723ec8 100644 --- a/mysql-test/r/mysqlbinlog_row_compressed.result +++ b/mysql-test/r/mysqlbinlog_row_compressed.result @@ -29,10 +29,10 @@ ROLLBACK/*!*/; /*!100001 SET @@session.server_id=1*//*!*/; /*!100001 SET @@session.gtid_seq_no=1*//*!*/; # at 371 -#<date> server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 use `test`/*!*/; SET TIMESTAMP=X/*!*/; -SET @@session.pseudo_thread_id=4/*!*/; +SET @@session.pseudo_thread_id=5/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1411383296/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; @@ -46,7 +46,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f #<date> server id 1 end_log_pos 575 CRC32 XXX GTID 0-1-2 ddl /*!100001 SET @@session.gtid_seq_no=2*//*!*/; # at 575 -#<date> server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)) /*!*/; @@ -74,7 +74,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 967 -#<date> server id 1 end_log_pos 1040 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1040 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -102,7 +102,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ # at 1281 -#<date> server id 1 end_log_pos 1354 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1354 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -130,7 +130,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 1596 -#<date> server id 1 end_log_pos 1669 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1669 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -158,7 +158,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 1909 -#<date> server id 1 end_log_pos 1982 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1982 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -219,7 +219,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 2225 -#<date> server id 1 end_log_pos 2298 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2298 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -299,7 +299,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 2561 -#<date> server id 1 end_log_pos 2634 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2634 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -360,7 +360,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 2861 -#<date> server id 1 end_log_pos 2934 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2934 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -421,7 +421,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 3154 -#<date> server id 1 end_log_pos 3227 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 3227 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; diff --git a/mysql-test/r/mysqlbinlog_row_minimal.result b/mysql-test/r/mysqlbinlog_row_minimal.result index 6d36ec0e82f..ca8e43bfb33 100644 --- a/mysql-test/r/mysqlbinlog_row_minimal.result +++ b/mysql-test/r/mysqlbinlog_row_minimal.result @@ -27,10 +27,10 @@ ROLLBACK/*!*/; /*!100001 SET @@session.server_id=1*//*!*/; /*!100001 SET @@session.gtid_seq_no=1*//*!*/; # at 371 -#<date> server id 1 end_log_pos 555 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 555 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 use `test`/*!*/; SET TIMESTAMP=X/*!*/; -SET @@session.pseudo_thread_id=4/*!*/; +SET @@session.pseudo_thread_id=5/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1411383296/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; @@ -44,7 +44,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f #<date> server id 1 end_log_pos 597 CRC32 XXX GTID 0-1-2 ddl /*!100001 SET @@session.gtid_seq_no=2*//*!*/; # at 597 -#<date> server id 1 end_log_pos 774 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 774 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)) /*!*/; @@ -72,7 +72,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 1015 -#<date> server id 1 end_log_pos 1088 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1088 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -100,7 +100,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ # at 1330 -#<date> server id 1 end_log_pos 1403 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1403 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -128,7 +128,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 1646 -#<date> server id 1 end_log_pos 1719 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1719 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -156,7 +156,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 1962 -#<date> server id 1 end_log_pos 2035 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2035 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -217,7 +217,7 @@ BEGIN ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ # at 2354 -#<date> server id 1 end_log_pos 2427 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2427 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -252,7 +252,7 @@ BEGIN ### SET ### @5=5 /* INT meta=0 nullable=1 is_null=0 */ # at 2665 -#<date> server id 1 end_log_pos 2738 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2738 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -281,7 +281,7 @@ BEGIN ### WHERE ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ # at 2927 -#<date> server id 1 end_log_pos 3000 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 3000 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -310,7 +310,7 @@ BEGIN ### WHERE ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ # at 3189 -#<date> server id 1 end_log_pos 3262 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 3262 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; diff --git a/mysql-test/r/mysqlbinlog_stmt_compressed.result b/mysql-test/r/mysqlbinlog_stmt_compressed.result index cb268cac0d4..cd8e98c1ee3 100644 --- a/mysql-test/r/mysqlbinlog_stmt_compressed.result +++ b/mysql-test/r/mysqlbinlog_stmt_compressed.result @@ -29,10 +29,10 @@ ROLLBACK/*!*/; /*!100001 SET @@session.server_id=1*//*!*/; /*!100001 SET @@session.gtid_seq_no=1*//*!*/; # at 371 -#<date> server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 use `test`/*!*/; SET TIMESTAMP=X/*!*/; -SET @@session.pseudo_thread_id=4/*!*/; +SET @@session.pseudo_thread_id=5/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=1411383296/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; @@ -46,7 +46,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f #<date> server id 1 end_log_pos 575 CRC32 XXX GTID 0-1-2 ddl /*!100001 SET @@session.gtid_seq_no=2*//*!*/; # at 575 -#<date> server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)) /*!*/; @@ -56,12 +56,12 @@ CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMIN BEGIN /*!*/; # at 769 -#<date> server id 1 end_log_pos 897 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 897 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "") /*!*/; # at 897 -#<date> server id 1 end_log_pos 970 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 970 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -71,12 +71,12 @@ COMMIT BEGIN /*!*/; # at 1012 -#<date> server id 1 end_log_pos 1140 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1140 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL) /*!*/; # at 1140 -#<date> server id 1 end_log_pos 1213 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1213 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -86,12 +86,12 @@ COMMIT BEGIN /*!*/; # at 1255 -#<date> server id 1 end_log_pos 1385 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1385 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A") /*!*/; # at 1385 -#<date> server id 1 end_log_pos 1458 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1458 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -101,12 +101,12 @@ COMMIT BEGIN /*!*/; # at 1500 -#<date> server id 1 end_log_pos 1627 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1627 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A") /*!*/; # at 1627 -#<date> server id 1 end_log_pos 1700 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1700 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -116,12 +116,12 @@ COMMIT BEGIN /*!*/; # at 1742 -#<date> server id 1 end_log_pos 1850 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1850 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; INSERT INTO t2 SELECT * FROM t1 /*!*/; # at 1850 -#<date> server id 1 end_log_pos 1923 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 1923 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -131,12 +131,12 @@ COMMIT BEGIN /*!*/; # at 1965 -#<date> server id 1 end_log_pos 2082 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2082 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL /*!*/; # at 2082 -#<date> server id 1 end_log_pos 2155 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2155 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -146,12 +146,12 @@ COMMIT BEGIN /*!*/; # at 2197 -#<date> server id 1 end_log_pos 2288 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2288 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; DELETE FROM t1 /*!*/; # at 2288 -#<date> server id 1 end_log_pos 2361 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2361 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; @@ -161,12 +161,12 @@ COMMIT BEGIN /*!*/; # at 2403 -#<date> server id 1 end_log_pos 2494 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2494 CRC32 XXX Query_compressed thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; DELETE FROM t2 /*!*/; # at 2494 -#<date> server id 1 end_log_pos 2567 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +#<date> server id 1 end_log_pos 2567 CRC32 XXX Query thread_id=5 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 277c7ab64dc..b46115c26f9 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5533,3 +5533,4 @@ USE `db1`; DROP DATABASE db1; DROP DATABASE db2; +FOUND /Database: mysql/ in bug11505.sql diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result index 06d39771466..3df31078a50 100644 --- a/mysql-test/r/partition_column.result +++ b/mysql-test/r/partition_column.result @@ -540,7 +540,7 @@ a b drop table t1; create table t1 as select to_seconds(null) as to_seconds; select data_type from information_schema.columns -where column_name='to_seconds'; +where table_schema='test' and column_name='to_seconds'; data_type int drop table t1; diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index c1eff91de53..047b6dac2b6 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -740,6 +740,97 @@ SELECT * FROM t1 WHERE d = '1991-01-01'; d 1991-01-01 DROP TABLE t1; +set global default_storage_engine=default; +# +# MDEV-9455: [ERROR] mysqld got signal 11 +# +CREATE TABLE `t1` ( +`DIARY_TOTAL_DAY_SEQ` bigint(20) unsigned NOT NULL AUTO_INCREMENT, +`IMORY_ID` bigint(20) NOT NULL, +`NAME` varchar(75) DEFAULT NULL, +`DATETIME` varchar(10) NOT NULL DEFAULT '', +`DAILY_CALL_CNT` int(11) DEFAULT NULL, +`DAILY_SMS_CNT` int(11) DEFAULT NULL, +`NUMBER` varchar(64) DEFAULT NULL, +`DURATION` varchar(16) DEFAULT NULL, +PRIMARY KEY (`DIARY_TOTAL_DAY_SEQ`,`DATETIME`), +KEY `IDX_t1_01` (`IMORY_ID`,`DATETIME`) +) AUTO_INCREMENT=328702514 DEFAULT CHARSET=utf8mb4 +PARTITION BY RANGE COLUMNS(`DATETIME`) +(PARTITION p0 VALUES LESS THAN ('2015-10-01') ENGINE = InnoDB, +PARTITION p1 VALUES LESS THAN ('2015-11-01') ENGINE = InnoDB, +PARTITION p2 VALUES LESS THAN ('2015-12-01') ENGINE = InnoDB, +PARTITION p3 VALUES LESS THAN ('2016-01-01') ENGINE = InnoDB, +PARTITION p4 VALUES LESS THAN ('2016-02-01') ENGINE = InnoDB, +PARTITION p5 VALUES LESS THAN ('2016-03-01') ENGINE = InnoDB, +PARTITION p6 VALUES LESS THAN ('2016-04-01') ENGINE = InnoDB, +PARTITION p7 VALUES LESS THAN ('2016-05-01') ENGINE = InnoDB, +PARTITION p8 VALUES LESS THAN ('2016-06-01') ENGINE = InnoDB, +PARTITION p9 VALUES LESS THAN ('2016-07-01') ENGINE = InnoDB, +PARTITION p10 VALUES LESS THAN ('2016-08-01') ENGINE = InnoDB) +; +CREATE TABLE `t2` ( +`DIARY_SEQ` bigint(20) unsigned NOT NULL AUTO_INCREMENT, +`IMORY_ID` bigint(20) NOT NULL, +`CALL_TYPE` varchar(1) DEFAULT NULL, +`DATA_TYPE` varchar(1) DEFAULT NULL, +`FEATURES` varchar(1) DEFAULT NULL, +`NAME` varchar(75) DEFAULT NULL, +`NUMBER` varchar(64) DEFAULT NULL, +`DATETIME` datetime NOT NULL, +`REG_DATE` datetime NOT NULL, +`TITLE` varchar(50) DEFAULT NULL, +`BODY` varchar(4200) DEFAULT NULL, +`MIME_TYPE` varchar(32) DEFAULT NULL, +`DURATION` varchar(16) DEFAULT NULL, +`DEVICE_ID` varchar(64) DEFAULT NULL, +`DEVICE_NAME` varchar(32) DEFAULT NULL, +PRIMARY KEY (`DIARY_SEQ`,`DATETIME`,`REG_DATE`), +KEY `IDX_TB_DIARY_01` (`IMORY_ID`,`DATETIME`,`CALL_TYPE`,`NUMBER`), +KEY `IDX_TB_DIARY_02` (`REG_DATE`) +) AUTO_INCREMENT=688799006 DEFAULT CHARSET=utf8mb4 +PARTITION BY RANGE COLUMNS(REG_DATE) +(PARTITION p0 VALUES LESS THAN ('2015-10-01') ENGINE = InnoDB, +PARTITION p1 VALUES LESS THAN ('2015-11-01') ENGINE = InnoDB, +PARTITION p2 VALUES LESS THAN ('2015-12-01') ENGINE = InnoDB, +PARTITION p3 VALUES LESS THAN ('2016-01-01') ENGINE = InnoDB, +PARTITION p4 VALUES LESS THAN ('2016-02-01') ENGINE = InnoDB, +PARTITION p5 VALUES LESS THAN ('2016-03-01') ENGINE = InnoDB, +PARTITION p6 VALUES LESS THAN ('2016-04-01') ENGINE = InnoDB, +PARTITION p7 VALUES LESS THAN ('2016-05-01') ENGINE = InnoDB, +PARTITION p8 VALUES LESS THAN ('2016-06-01') ENGINE = InnoDB, +PARTITION p9 VALUES LESS THAN ('2016-07-01') ENGINE = InnoDB, +PARTITION p10 VALUES LESS THAN ('2016-08-01') ENGINE = InnoDB) +; +SELECT +A.IMORY_ID, +A.NUMBER, +A.NAME, +DATE_FORMAT(A.DATETIME, '%Y-%m-%d') AS TARGET_DATE, +SUM( CASE WHEN A.DATA_TYPE='1' THEN 1 ELSE 0 END) AS CALL_CNT, +SUM( CASE WHEN A.DATA_TYPE IN ('2', '3') THEN 1 ELSE 0 END) AS SMS_CNT, +SUM(CAST(A.DURATION AS INT)) AS DURATION, +( SELECT COUNT(*) +FROM t1 +WHERE IMORY_ID=A.IMORY_ID +AND NUMBER=A.NUMBER +AND NAME=A.NAME +AND DATETIME = DATE_FORMAT(A.DATETIME, '%Y-%m-%d') +) STATS_COUNT +FROM t2 A +WHERE A.IMORY_ID = 55094102 +AND A.DATETIME LIKE ( +SELECT CONCAT (DATE_FORMAT(DATETIME, '%Y-%m-%d') ,'%') +FROM t2 +WHERE IMORY_ID=55094102 +AND DIARY_SEQ IN ( 608351221, 608351225, 608351229 ) +group by DATE_FORMAT(DATETIME, '%Y-%m-%d') +) +GROUP BY A.IMORY_ID, A.NUMBER, A.NAME, DATE_FORMAT(A.DATETIME, '%Y-%m-%d') +; +IMORY_ID NUMBER NAME TARGET_DATE CALL_CNT SMS_CNT DURATION STATS_COUNT +drop table t2, t1; +set global default_storage_engine='innodb'; # # MDEV-5963: InnoDB: Assertion failure in file row0sel.cc line 2503, # Failing assertion: 0 with "key ptr now exceeds key end by 762 bytes" diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result index f9f917a2803..664eb60c2c5 100644 --- a/mysql-test/r/partition_myisam.result +++ b/mysql-test/r/partition_myisam.result @@ -230,6 +230,22 @@ PARTITION pMax VALUES LESS THAN MAXVALUE); INSERT INTO t1 VALUES (1, "Partition p1, first row"); DROP TABLE t1; # +# MDEV-10418 Assertion `m_extra_cache' failed +# in ha_partition::late_extra_cache(uint) +# +CREATE TABLE t1 (f1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (f2 INT) ENGINE=MyISAM PARTITION BY RANGE(f2) (PARTITION pmax VALUES LESS THAN MAXVALUE); +INSERT INTO t2 VALUES (8); +CREATE ALGORITHM = MERGE VIEW v AS SELECT f2 FROM t2, t1; +UPDATE v SET f2 = 1; +SELECT * FROM t2; +f2 +1 +DROP VIEW v; +DROP TABLE t2; +DROP TABLE t1; +# # bug#11760213-52599: ALTER TABLE REMOVE PARTITIONING ON NON-PARTITIONED # TABLE CORRUPTS MYISAM DROP TABLE if exists `t1`; diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index c23c4f2d8a2..f278724cc9a 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -12,7 +12,7 @@ PLUGIN_STATUS ACTIVE PLUGIN_TYPE STORAGE ENGINE PLUGIN_TYPE_VERSION # PLUGIN_LIBRARY ha_example.so -PLUGIN_LIBRARY_VERSION 1.11 +PLUGIN_LIBRARY_VERSION 1.12 PLUGIN_AUTHOR Brian Aker, MySQL AB PLUGIN_DESCRIPTION Example storage engine PLUGIN_LICENSE GPL @@ -25,7 +25,7 @@ PLUGIN_STATUS ACTIVE PLUGIN_TYPE DAEMON PLUGIN_TYPE_VERSION # PLUGIN_LIBRARY ha_example.so -PLUGIN_LIBRARY_VERSION 1.11 +PLUGIN_LIBRARY_VERSION 1.12 PLUGIN_AUTHOR Sergei Golubchik PLUGIN_DESCRIPTION Unusable Daemon PLUGIN_LICENSE GPL @@ -64,7 +64,7 @@ PLUGIN_STATUS DELETED PLUGIN_TYPE STORAGE ENGINE PLUGIN_TYPE_VERSION # PLUGIN_LIBRARY ha_example.so -PLUGIN_LIBRARY_VERSION 1.11 +PLUGIN_LIBRARY_VERSION 1.12 PLUGIN_AUTHOR Brian Aker, MySQL AB PLUGIN_DESCRIPTION Example storage engine PLUGIN_LICENSE GPL diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index eb21f8ed7ea..40746d2e6c6 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1208,12 +1208,21 @@ prepare my_stmt from @aux; execute my_stmt; COUNT(*) 46 +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' execute my_stmt; COUNT(*) 46 +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' execute my_stmt; COUNT(*) 46 +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' deallocate prepare my_stmt; drop procedure if exists p1| drop table if exists t1| @@ -3930,8 +3939,6 @@ c1 c2 count(c3) 2012-03-01 01:00:00 3 1 2012-03-01 02:00:00 3 1 DEALLOCATE PREPARE s1; -# -# End of 5.5 tests. prepare stmt from "select date('2010-10-10') between '2010-09-09' and ?"; set @a='2010-11-11'; execute stmt using @a; @@ -4123,6 +4130,78 @@ NULL NULL deallocate prepare stmt; drop table t1,t2,t3,t4; +# +# MDEV-11859: the plans for the first and the second executions +# of PS are not the same +# +create table t1 (id int, c varchar(3), key idx(c))engine=myisam; +insert into t1 values (3,'bar'), (1,'xxx'), (2,'foo'), (5,'yyy'); +prepare stmt1 from +"explain extended + select * from t1 where (1, 2) in ( select 3, 4 ) or c = 'foo'"; +execute stmt1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ref idx idx 6 const 1 100.00 Using index condition +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`c` = 'foo' +execute stmt1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ref idx idx 6 const 1 100.00 Using index condition +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`c` AS `c` from `test`.`t1` where `test`.`t1`.`c` = 'foo' +deallocate prepare stmt1; +prepare stmt1 from +"select * from t1 where (1, 2) in ( select 3, 4 ) or c = 'foo'"; +flush status; +execute stmt1; +id c +2 foo +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_last 0 +Handler_read_next 1 +Handler_read_prev 0 +Handler_read_retry 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 0 +flush status; +execute stmt1; +id c +2 foo +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_last 0 +Handler_read_next 1 +Handler_read_prev 0 +Handler_read_retry 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 0 +deallocate prepare stmt1; +prepare stmt2 from +"explain extended + select * from t1 where (1, 2) in ( select 3, 4 )"; +execute stmt2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`c` AS `c` from `test`.`t1` where 0 +execute stmt2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`c` AS `c` from `test`.`t1` where 0 +deallocate prepare stmt2; +drop table t1; # End of 5.5 tests # # Start of 10.2 tests diff --git a/mysql-test/r/range_vs_index_merge.result b/mysql-test/r/range_vs_index_merge.result index 9af359a55f3..6813c40a5cf 100644 --- a/mysql-test/r/range_vs_index_merge.result +++ b/mysql-test/r/range_vs_index_merge.result @@ -60,11 +60,11 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM City WHERE Population > 100000 AND Name LIKE 'Aba%' OR -Country IN ('CAN', 'ARG') AND ID < 3800 OR -Country < 'U' AND Name LIKE 'Zhu%' OR -ID BETWEEN 3800 AND 3810; +Country IN ('CAN', 'ARG') AND ID BETWEEN 120 AND 130 OR +Country <= 'ALB' AND Name LIKE 'L%' OR +ID BETWEEN 3807 AND 3810; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,PRIMARY 35,3,4 NULL 132 Using sort_union(Name,Country,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,PRIMARY,Country 35,4,3 NULL 31 Using sort_union(Name,PRIMARY,Country); Using where EXPLAIN SELECT * FROM City WHERE (Population > 101000 AND Population < 115000); @@ -1769,4 +1769,42 @@ a b 167 9999 168 10000 DROP TABLE t1; +# +# MDEV-8603: Wrong result OR/AND condition over index fields +# +CREATE TABLE t1 ( +id INT NOT NULL, +state VARCHAR(64), +capital VARCHAR(64), +UNIQUE KEY (id), +KEY state (state,id), +KEY capital (capital, id) +); +INSERT INTO t1 VALUES +(1,'Arizona','Phoenix'), +(2,'Hawaii','Honolulu'), +(3,'Georgia','Atlanta'), +(4,'Florida','Tallahassee'), +(5,'Alaska','Juneau'), +(6,'Michigan','Lansing'), +(7,'Pennsylvania','Harrisburg'), +(8,'Virginia','Richmond') +; +EXPLAIN +SELECT * FROM t1 FORCE KEY (state,capital) +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range state,capital state 71 NULL 12 Using index condition; Using where +SELECT * FROM t1 FORCE KEY (state,capital) +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; +id state capital +4 Florida Tallahassee +3 Georgia Atlanta +2 Hawaii Honolulu +6 Michigan Lansing +7 Pennsylvania Harrisburg +8 Virginia Richmond +DROP TABLE t1; set session optimizer_switch='index_merge_sort_intersection=default'; diff --git a/mysql-test/r/range_vs_index_merge_innodb.result b/mysql-test/r/range_vs_index_merge_innodb.result index 225d341f1de..0c3b682b197 100644 --- a/mysql-test/r/range_vs_index_merge_innodb.result +++ b/mysql-test/r/range_vs_index_merge_innodb.result @@ -61,11 +61,11 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM City WHERE Population > 100000 AND Name LIKE 'Aba%' OR -Country IN ('CAN', 'ARG') AND ID < 3800 OR -Country < 'U' AND Name LIKE 'Zhu%' OR -ID BETWEEN 3800 AND 3810; +Country IN ('CAN', 'ARG') AND ID BETWEEN 120 AND 130 OR +Country <= 'ALB' AND Name LIKE 'L%' OR +ID BETWEEN 3807 AND 3810; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,PRIMARY 35,7,4 NULL 125 Using sort_union(Name,Country,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,PRIMARY 35,3,4 NULL 32 Using sort_union(Name,Country,PRIMARY); Using where EXPLAIN SELECT * FROM City WHERE (Population > 101000 AND Population < 115000); @@ -369,7 +369,7 @@ WHERE ((ID < 200) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 200) AND (Name LIKE 'Pa%' OR (Population > 103000 AND Population < 104000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country,Name PRIMARY 4 NULL 200 Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Population,PRIMARY 39,4,4 NULL 307 Using sort_union(Name,Population,PRIMARY); Using where SELECT * FROM City USE INDEX () WHERE ((ID < 10) AND (Name LIKE 'H%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 100 AND 110) AND @@ -1770,5 +1770,43 @@ a b 167 9999 168 10000 DROP TABLE t1; +# +# MDEV-8603: Wrong result OR/AND condition over index fields +# +CREATE TABLE t1 ( +id INT NOT NULL, +state VARCHAR(64), +capital VARCHAR(64), +UNIQUE KEY (id), +KEY state (state,id), +KEY capital (capital, id) +); +INSERT INTO t1 VALUES +(1,'Arizona','Phoenix'), +(2,'Hawaii','Honolulu'), +(3,'Georgia','Atlanta'), +(4,'Florida','Tallahassee'), +(5,'Alaska','Juneau'), +(6,'Michigan','Lansing'), +(7,'Pennsylvania','Harrisburg'), +(8,'Virginia','Richmond') +; +EXPLAIN +SELECT * FROM t1 FORCE KEY (state,capital) +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range state,capital state 71 NULL 12 Using index condition; Using where +SELECT * FROM t1 FORCE KEY (state,capital) +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 +OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; +id state capital +4 Florida Tallahassee +3 Georgia Atlanta +2 Hawaii Honolulu +6 Michigan Lansing +7 Pennsylvania Harrisburg +8 Virginia Richmond +DROP TABLE t1; set session optimizer_switch='index_merge_sort_intersection=default'; SET SESSION STORAGE_ENGINE=DEFAULT; diff --git a/mysql-test/r/repair_symlink-5543.result b/mysql-test/r/repair_symlink-5543.result index 98ded32686e..c77e7162a51 100644 --- a/mysql-test/r/repair_symlink-5543.result +++ b/mysql-test/r/repair_symlink-5543.result @@ -1,13 +1,18 @@ create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR'; insert t1 values (1); +# Some systems fail with errcode 40, when doing openat, while others +# don't have openat and fail with errcode 20. repair table t1; Table Op Msg_type Msg_text -test.t1 repair status OK +test.t1 repair error 20 for record at pos 0 +test.t1 repair Error File 'MYSQL_TMP_DIR/t1.MYD' not found (Errcode: 20 "<errmsg>") +test.t1 repair status Operation failed drop table t1; create table t2 (a int) engine=aria data directory='MYSQL_TMP_DIR'; insert t2 values (1); repair table t2; Table Op Msg_type Msg_text -test.t2 repair status OK +test.t2 repair error 20 for record at pos 256 +test.t2 repair Error File 'MYSQL_TMP_DIR/t2.MAD' not found (Errcode: 20 "<errmsg>") +test.t2 repair status Operation failed drop table t2; -foobar5543 diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index a39ca3379c6..90216c6cedc 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2956,7 +2956,7 @@ insert into t1 values (1,'x',5); select * from t1 natural join v1; s1 s2 s3 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DECIMAL value: 'x' drop table t1; drop view v1; create table t1(a1 int); diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index 482fca0d530..054aa94763a 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -2967,7 +2967,7 @@ insert into t1 values (1,'x',5); select * from t1 natural join v1; s1 s2 s3 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DECIMAL value: 'x' drop table t1; drop view v1; create table t1(a1 int); diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result index a39ca3379c6..90216c6cedc 100644 --- a/mysql-test/r/select_pkeycache.result +++ b/mysql-test/r/select_pkeycache.result @@ -2956,7 +2956,7 @@ insert into t1 values (1,'x',5); select * from t1 natural join v1; s1 s2 s3 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DECIMAL value: 'x' drop table t1; drop view v1; create table t1(a1 int); diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index a843b9a5f95..47adafa93ba 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -7963,6 +7963,44 @@ set global table_open_cache= @tmp_toc; set global table_definition_cache= @tmp_tdc; drop procedure p1; drop table t1,t2,t3,t4,t5,t6; +# +# MDEV-11935: Queries in stored procedures with and +# EXISTS(SELECT * FROM VIEW) crashes and closes hte conneciton. +# +CREATE TABLE ANY_TABLE ( +ENTITY_UID BIGINT NOT NULL +); +CREATE TABLE SECURITY_PATH( +origid BIGINT UNSIGNED NOT NULL, +destid BIGINT UNSIGNED NOT NULL, +KEY (destid) +); +CREATE VIEW ENTITY_ACCESS ( +ENTITY_UID, +OWNER_UID +) AS +SELECT SP1.origid, +SP2.destid +FROM SECURITY_PATH SP1 +JOIN SECURITY_PATH SP2 ON SP1.destid = SP2.origid +; +CREATE PROCEDURE SP_EXAMPLE_SELECT () +BEGIN +SELECT * +FROM ANY_TABLE AT1 +WHERE EXISTS ( SELECT * +FROM ENTITY_ACCESS EA +WHERE AT1.ENTITY_UID = EA.ENTITY_UID +AND EA.OWNER_UID IS NULL ); +END +// +CALL SP_EXAMPLE_SELECT (); +ENTITY_UID +CALL SP_EXAMPLE_SELECT (); +ENTITY_UID +drop procedure SP_EXAMPLE_SELECT; +drop view ENTITY_ACCESS; +drop table ANY_TABLE, SECURITY_PATH; # End of 10.0 test CREATE FUNCTION f(f1 VARCHAR(64) COLLATE latin1_german2_ci) RETURNS VARCHAR(64) diff --git a/mysql-test/r/stat_tables_par.result b/mysql-test/r/stat_tables_par.result index b965e289e1d..006df89f358 100644 --- a/mysql-test/r/stat_tables_par.result +++ b/mysql-test/r/stat_tables_par.result @@ -46,14 +46,14 @@ dbt3_s001 supplier PRIMARY 1 1.0000 dbt3_s001 supplier i_s_nationkey 1 1.1111 flush table lineitem; set use_stat_tables='never'; -select sum(l_extendedprice*l_discount) as revenue +select round(sum(l_extendedprice*l_discount),4) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < date '1994-01-01' + interval '1' year and l_discount between 0.06 - 0.01 and 0.06 + 0.01 and l_quantity < 24; revenue -77949.91860000002 +77949.9186 connect con1, localhost, root,,; connect con2, localhost, root,,; connection con1; @@ -61,7 +61,7 @@ set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too' set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working'; use dbt3_s001; set use_stat_tables='preferably'; -select sum(l_extendedprice*l_discount) as revenue +select round(sum(l_extendedprice*l_discount),4) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < date '1994-01-01' + interval '1' year @@ -72,7 +72,7 @@ set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too'; set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working'; use dbt3_s001; set use_stat_tables='preferably'; -select sum(l_extendedprice*l_discount) as revenue +select round(sum(l_extendedprice*l_discount),4) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < date '1994-01-01' + interval '1' year @@ -80,10 +80,10 @@ and l_discount between 0.06 - 0.01 and 0.06 + 0.01 and l_quantity < 24; connection con1; revenue -77949.91860000002 +77949.9186 connection con2; revenue -77949.91860000002 +77949.9186 connection default; set use_stat_tables='preferably'; disconnect con1; diff --git a/mysql-test/r/stat_tables_par_innodb.result b/mysql-test/r/stat_tables_par_innodb.result index 155582c9192..8fc0483d9aa 100644 --- a/mysql-test/r/stat_tables_par_innodb.result +++ b/mysql-test/r/stat_tables_par_innodb.result @@ -49,14 +49,14 @@ dbt3_s001 supplier PRIMARY 1 1.0000 dbt3_s001 supplier i_s_nationkey 1 1.1111 flush table lineitem; set use_stat_tables='never'; -select sum(l_extendedprice*l_discount) as revenue +select round(sum(l_extendedprice*l_discount),4) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < date '1994-01-01' + interval '1' year and l_discount between 0.06 - 0.01 and 0.06 + 0.01 and l_quantity < 24; revenue -77949.91860000002 +77949.9186 connect con1, localhost, root,,; connect con2, localhost, root,,; connection con1; @@ -64,7 +64,7 @@ set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too' set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working'; use dbt3_s001; set use_stat_tables='preferably'; -select sum(l_extendedprice*l_discount) as revenue +select round(sum(l_extendedprice*l_discount),4) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < date '1994-01-01' + interval '1' year @@ -75,7 +75,7 @@ set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too'; set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working'; use dbt3_s001; set use_stat_tables='preferably'; -select sum(l_extendedprice*l_discount) as revenue +select round(sum(l_extendedprice*l_discount),4) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < date '1994-01-01' + interval '1' year @@ -83,10 +83,10 @@ and l_discount between 0.06 - 0.01 and 0.06 + 0.01 and l_quantity < 24; connection con1; revenue -77949.91860000002 +77949.9186 connection con2; revenue -77949.91860000002 +77949.9186 connection default; set use_stat_tables='preferably'; disconnect con1; diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result index 6bbb80c0662..3d0dfd189a8 100644 --- a/mysql-test/r/subselect4.result +++ b/mysql-test/r/subselect4.result @@ -2440,6 +2440,53 @@ EXECUTE stmt; i 6 drop table t1, t2, t3; +# +# MDEV-11078: NULL NOT IN (non-empty subquery) should never return results +# +create table t1(a int,b int); +create table t2(a int,b int); +insert into t1 value (1,2); +select (NULL) in (select 1 from t1); +(NULL) in (select 1 from t1) +NULL +select (null) in (select 1 from t2); +(null) in (select 1 from t2) +0 +select 1 in (select 1 from t1); +1 in (select 1 from t1) +1 +select 1 in (select 1 from t2); +1 in (select 1 from t2) +0 +select 1 from dual where null in (select 1 from t1); +1 +select 1 from dual where null in (select 1 from t2); +1 +select (null,null) in (select * from t1); +(null,null) in (select * from t1) +NULL +select (null,null) in (select * from t2); +(null,null) in (select * from t2) +0 +select 1 from dual where null not in (select 1 from t1); +1 +select 1 from dual where null not in (select 1 from t2); +1 +1 +drop table t1,t2; +# +# MDEV-6486: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' +# failed with SELECT SQ, TEXT field +# +CREATE TABLE t1 (a VARCHAR(8), KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'),( 'bar'); +CREATE TABLE t2 (b VARCHAR(8), c TINYTEXT, KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('baz','baz'),('qux', 'qux'); +SELECT ( SELECT COUNT(*) FROM t1 WHERE a = c ) AS field, COUNT(DISTINCT c) +FROM t2 WHERE b <= 'quux' GROUP BY field; +field COUNT(DISTINCT c) +0 1 +drop table t1,t2; SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; # diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index cfbe5d41418..11221c797ff 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -494,6 +494,21 @@ HAVING SQ2_alias1 . col_int_key >= 7 drop table t1; set optimizer_switch=@subselect_innodb_tmp; # +# MDEV-9635:Server crashes in part_of_refkey or assertion +# `!created && key_to_save < (int)s->keys' failed in +# TABLE::use_index(int) or with join_cache_level>2 +# +SET join_cache_level=3; +CREATE TABLE t1 (f1 VARCHAR(1024)) ENGINE=InnoDB; +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; +CREATE TABLE t2 (f2 VARCHAR(4)) ENGINE=InnoDB; +INSERT INTO t2 VALUES ('foo'),('bar'); +SELECT * FROM v1, t2 WHERE ( f1, f2 ) IN ( SELECT f1, f1 FROM t1 ); +f1 f2 +set join_cache_level = default; +drop view v1; +drop table t1,t2; +# # MDEV-6041: ORDER BY+subqueries: subquery_table.key=outer_table.col is not recongized as binding # create table t1(a int) engine=innodb; diff --git a/mysql-test/r/symlink-aria-11902.result b/mysql-test/r/symlink-aria-11902.result new file mode 100644 index 00000000000..4d8f179dac9 --- /dev/null +++ b/mysql-test/r/symlink-aria-11902.result @@ -0,0 +1,43 @@ +set default_storage_engine=Aria; +call mtr.add_suppression("File.*t1.* not found"); +create table mysql.t1 (a int, b char(16), index(a)); +insert mysql.t1 values (100, 'test'),(101,'test'); +create table t1 (a int, b char(16), index(a)) +data directory="MYSQLTEST_VARDIR/tmp/foo"; +insert t1 values (200, 'some'),(201,'some'); +select * from t1; +a b +200 some +201 some +flush tables; +set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go'; +select * from t1; +connect con1, localhost, root; +set debug_sync='now WAIT_FOR ok'; +set debug_sync='now SIGNAL go'; +connection default; +ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MAD' not found (Errcode: 20 <errmsg>) +flush tables; +drop table if exists t1; +create table t1 (a int, b char(16), index (a)) +index directory="MYSQLTEST_VARDIR/tmp/foo"; +insert t1 values (200, 'some'),(201,'some'); +explain select a from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL 2 Using index +select a from t1; +a +200 +201 +flush tables; +set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run'; +select a from t1; +connection con1; +set debug_sync='now WAIT_FOR waiting'; +set debug_sync='now SIGNAL run'; +connection default; +ERROR HY000: Can't find file: './test/t1.MAI' (errno: 20 <errmsg>) +flush tables; +drop table if exists t1; +drop table mysql.t1; +set debug_sync='RESET'; diff --git a/mysql-test/r/symlink-myisam-11902.result b/mysql-test/r/symlink-myisam-11902.result new file mode 100644 index 00000000000..bc9a0316bab --- /dev/null +++ b/mysql-test/r/symlink-myisam-11902.result @@ -0,0 +1,42 @@ +call mtr.add_suppression("File.*t1.* not found"); +create table mysql.t1 (a int, b char(16), index(a)); +insert mysql.t1 values (100, 'test'),(101,'test'); +create table t1 (a int, b char(16), index(a)) +data directory="MYSQLTEST_VARDIR/tmp/foo"; +insert t1 values (200, 'some'),(201,'some'); +select * from t1; +a b +200 some +201 some +flush tables; +set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go'; +select * from t1; +connect con1, localhost, root; +set debug_sync='now WAIT_FOR ok'; +set debug_sync='now SIGNAL go'; +connection default; +ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MYD' not found (Errcode: 20 <errmsg>) +flush tables; +drop table if exists t1; +create table t1 (a int, b char(16), index (a)) +index directory="MYSQLTEST_VARDIR/tmp/foo"; +insert t1 values (200, 'some'),(201,'some'); +explain select a from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL a 5 NULL 2 Using index +select a from t1; +a +200 +201 +flush tables; +set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run'; +select a from t1; +connection con1; +set debug_sync='now WAIT_FOR waiting'; +set debug_sync='now SIGNAL run'; +connection default; +ERROR HY000: Can't find file: './test/t1.MYI' (errno: 20 <errmsg>) +flush tables; +drop table if exists t1; +drop table mysql.t1; +set debug_sync='RESET'; diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result index a7b0842d14f..764a1b2780e 100644 --- a/mysql-test/r/table_elim.result +++ b/mysql-test/r/table_elim.result @@ -597,7 +597,8 @@ CREATE TABLE t1 (a int(11), b varchar(1)) ; INSERT IGNORE INTO t1 VALUES (0,'g'); CREATE TABLE t3 ( a varchar(1)) ; INSERT IGNORE INTO t3 VALUES ('g'); -CREATE TABLE t2 ( a int(11) NOT NULL, PRIMARY KEY (a)) ; +CREATE TABLE t2 ( a int(11) NOT NULL, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (9), (10); create view v1 as SELECT t1.* FROM t1 LEFT JOIN t2 ON ( t1.a = t2.a ) WHERE t2.a <> 0; SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b ); a b @@ -606,7 +607,7 @@ EXPLAIN SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b ); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 system NULL NULL NULL NULL 1 1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using index +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using index drop view v1; DROP TABLE t1,t2,t3; # diff --git a/mysql-test/r/trigger_no_defaults-11698.result b/mysql-test/r/trigger_no_defaults-11698.result index 40546cee41d..8ce495eaf3a 100644 --- a/mysql-test/r/trigger_no_defaults-11698.result +++ b/mysql-test/r/trigger_no_defaults-11698.result @@ -20,3 +20,23 @@ a b 10 10 0 30 drop table t1; +set sql_mode=default; +set sql_mode=''; +create table t1 ( +id int(11) not null auto_increment primary key, +data1 varchar(10) not null, +data2 varchar(10) not null +); +insert into t1 (data2) values ('x'); +Warnings: +Warning 1364 Field 'data1' doesn't have a default value +create trigger test_trigger before insert on t1 for each row begin end; +insert into t1 (data2) values ('y'); +Warnings: +Warning 1364 Field 'data1' doesn't have a default value +select * from t1; +id data1 data2 +1 x +2 y +drop table t1; +set sql_mode=default; diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 313894b4b77..ab0e2dbc71d 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -2239,11 +2239,50 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; # +# Bug#18408499 UNSIGNED BIGINT HIGH VALUES +# WRONG NUMERICAL COMPARISON RESULTS +# +CREATE TABLE t1(value DECIMAL(24,0) NOT NULL); +INSERT INTO t1(value) +VALUES('100000000000000000000001'), +('100000000000000000000002'), +('100000000000000000000003'); +SELECT * FROM t1 WHERE value = '100000000000000000000002'; +value +100000000000000000000002 +SELECT * FROM t1 WHERE '100000000000000000000002' = value; +value +100000000000000000000002 +SELECT * FROM t1 WHERE value + 0 = '100000000000000000000002'; +value +100000000000000000000002 +SELECT * FROM t1 WHERE value = 100000000000000000000002; +value +100000000000000000000002 +SELECT * FROM t1 WHERE value + 0 = 100000000000000000000002; +value +100000000000000000000002 +PREPARE stmt FROM 'SELECT * FROM t1 WHERE value = ?'; +set @a="100000000000000000000002"; +EXECUTE stmt using @a; +value +100000000000000000000002 +set @a=100000000000000000000002; +EXECUTE stmt using @a; +value +100000000000000000000002 +DEALLOCATE PREPARE stmt; +ALTER TABLE t1 ADD INDEX value (value); +SELECT * FROM t1 WHERE value = '100000000000000000000002'; +value +100000000000000000000002 +DROP TABLE t1; +# # End of 10.1 tests # # # Test CREATE .. SELECT - +# create or replace table t1 as select 1.000000000000000000000000000000000 as a; show create table t1; Table Create Table diff --git a/mysql-test/r/type_num.result b/mysql-test/r/type_num.result index 9573852ce72..193a59741f5 100644 --- a/mysql-test/r/type_num.result +++ b/mysql-test/r/type_num.result @@ -570,7 +570,7 @@ SELECT COUNT(*) FROM t1 WHERE d='1 '; COUNT(*) 2 Warnings: -Note 1292 Truncated incorrect DOUBLE value: '1 ' +Note 1292 Truncated incorrect DECIMAL value: '1 ' SELECT COUNT(*) FROM t1 WHERE f4=''; COUNT(*) 2 @@ -605,7 +605,7 @@ SELECT COUNT(*) FROM t1 WHERE d=''; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '' +Warning 1292 Truncated incorrect DECIMAL value: '' SELECT COUNT(*) FROM t1 WHERE f4='x'; COUNT(*) 2 @@ -640,7 +640,7 @@ SELECT COUNT(*) FROM t1 WHERE d='x'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' +Warning 1292 Truncated incorrect DECIMAL value: 'x' SELECT COUNT(*) FROM t1 WHERE f4=' x'; COUNT(*) 2 @@ -675,7 +675,7 @@ SELECT COUNT(*) FROM t1 WHERE d=' x'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: ' x' +Warning 1292 Truncated incorrect DECIMAL value: ' x' SELECT COUNT(*) FROM t1 WHERE f4='.'; COUNT(*) 2 @@ -710,7 +710,7 @@ SELECT COUNT(*) FROM t1 WHERE d='.'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '.' +Warning 1292 Truncated incorrect DECIMAL value: '.' SELECT COUNT(*) FROM t1 WHERE f4='-'; COUNT(*) 2 @@ -745,7 +745,7 @@ SELECT COUNT(*) FROM t1 WHERE d='-'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '-' +Warning 1292 Truncated incorrect DECIMAL value: '-' SELECT COUNT(*) FROM t1 WHERE f4='+'; COUNT(*) 2 @@ -780,7 +780,7 @@ SELECT COUNT(*) FROM t1 WHERE d='+'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '+' +Warning 1292 Truncated incorrect DECIMAL value: '+' SELECT COUNT(*) FROM t1 WHERE f4='1x'; COUNT(*) 2 @@ -815,7 +815,7 @@ SELECT COUNT(*) FROM t1 WHERE d='1x'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '1x' +Warning 1292 Truncated incorrect DECIMAL value: '1x' SELECT COUNT(*) FROM t1 WHERE f4='1e'; COUNT(*) 2 @@ -850,7 +850,7 @@ SELECT COUNT(*) FROM t1 WHERE d='1e'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '1e' +Warning 1292 Truncated incorrect DECIMAL value: '1e' SELECT COUNT(*) FROM t1 WHERE f4='1e+'; COUNT(*) 2 @@ -885,7 +885,7 @@ SELECT COUNT(*) FROM t1 WHERE d='1e+'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '1e+' +Warning 1292 Truncated incorrect DECIMAL value: '1e+' SELECT COUNT(*) FROM t1 WHERE f4='1E-'; COUNT(*) 2 @@ -920,7 +920,7 @@ SELECT COUNT(*) FROM t1 WHERE d='1E-'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '1E-' +Warning 1292 Truncated incorrect DECIMAL value: '1E-' SELECT COUNT(*) FROM t1 WHERE f4='1Ex'; COUNT(*) 2 @@ -955,7 +955,7 @@ SELECT COUNT(*) FROM t1 WHERE d='1Ex'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '1Ex' +Warning 1292 Truncated incorrect DECIMAL value: '1Ex' SELECT COUNT(*) FROM t1 WHERE f4='1e+x'; COUNT(*) 2 @@ -990,7 +990,7 @@ SELECT COUNT(*) FROM t1 WHERE d='1e+x'; COUNT(*) 2 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '1e+x' +Warning 1292 Truncated incorrect DECIMAL value: '1e+x' SELECT COUNT(*) FROM t1 WHERE f4='1e1000'; COUNT(*) 0 @@ -1025,7 +1025,8 @@ SELECT COUNT(*) FROM t1 WHERE d='1e1000'; COUNT(*) 0 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '1e1000' +Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated +Warning 1292 Truncated incorrect DECIMAL value: '1e1000' ALTER TABLE t1 ADD KEY f4(f4), ADD KEY f8(f8), diff --git a/mysql-test/r/update_innodb.result b/mysql-test/r/update_innodb.result index 88c86c50625..5fcc584035a 100644 --- a/mysql-test/r/update_innodb.result +++ b/mysql-test/r/update_innodb.result @@ -29,3 +29,29 @@ CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON vw.c2 = del.c2 SET a.c2 = ( SELECT max(t.c1) FROM t3 t, v1 i WHERE del.c2 = t.c2 AND vw.c3 = i.c3 AND t.c3 = 4 ) WHERE a.c2 IS NULL OR a.c2 < '2011-05-01'; drop view v1; drop table t1,t2,t3,t4; +# +# MDEV-10232 Scalar result of subquery changes after adding an outer select stmt +# +CREATE TABLE t1 ( +a_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +b_id INT(20) UNSIGNED NULL DEFAULT NULL, +c_id VARCHAR(255) NULL DEFAULT NULL, +PRIMARY KEY (a_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB; +CREATE TABLE t2 ( +b_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +c_id VARCHAR(255) NULL DEFAULT NULL, +PRIMARY KEY (b_id), +INDEX idx_c_id (c_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB; +INSERT INTO t1 (b_id, c_id) VALUES (NULL, NULL); +INSERT INTO t2 (c_id) VALUES (NULL); +INSERT INTO t2 (c_id) VALUES (NULL); +SELECT * FROM t1; +a_id b_id c_id +1 NULL NULL +SELECT t2.b_id FROM t1,t2 WHERE t2.c_id = t1.c_id; +b_id +UPDATE t1 SET b_id = (SELECT t2.b_id FROM t2 t2 WHERE t2.c_id = t1.c_id); +SELECT * FROM t1; +a_id b_id c_id +1 NULL NULL +drop table t1,t2; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 5d8f71ef708..b899695f11f 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -5583,6 +5583,89 @@ Warnings: Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them drop view v1; drop table t1,t2; +# +# MDEV-12099: usage of mergeable view with LEFT JOIN +# that can be converted to INNER JOIN +# +create table t1 (a int, b int, key(a)) engine=myisam; +insert into t1 values +(3,20), (7,10), (2,10), (4,30), (8,70), +(7,70), (9,100), (9,60), (8,80), (7,60); +create table t2 (c int, d int, key (c)) engine=myisam; +insert into t2 values +(50,100), (20, 200), (10,300), +(150,100), (120, 200), (110,300), +(250,100), (220, 200), (210,300); +create table t3(e int, f int not null, key(e), unique (f)) engine=myisam; +insert into t3 values +(100, 3), (300, 5), (400, 4), (300,7), +(300,2), (600, 13), (800, 15), (700, 14), +(600, 23), (800, 25), (700, 24); +create view v1 as +select * from t2 left join t3 on t3.e=t2.d where t3.f is not null; +select * +from t1 left join v1 on v1.c=t1.b +where t1.a < 5; +a b c d e f +2 10 10 300 300 5 +2 10 10 300 300 7 +2 10 10 300 300 2 +3 20 NULL NULL NULL NULL +4 30 NULL NULL NULL NULL +select * +from t1 left join ( t2 left join t3 on t3.e=t2.d ) +on t2.c=t1.b and t3.f is not null +where t1.a < 5; +a b c d e f +2 10 10 300 300 5 +2 10 10 300 300 7 +2 10 10 300 300 2 +3 20 NULL NULL NULL NULL +4 30 NULL NULL NULL NULL +explain extended +select * +from t1 left join v1 on v1.c=t1.b +where t1.a < 5; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition +1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where +1 SIMPLE t3 ref f,e e 5 test.t2.d 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`e` = `test`.`t2`.`d` and `test`.`t3`.`f` is not null and `test`.`t1`.`b` is not null and `test`.`t2`.`d` is not null) where `test`.`t1`.`a` < 5 +explain extended +select * +from t1 left join ( t2 left join t3 on t3.e=t2.d ) +on t2.c=t1.b and t3.f is not null +where t1.a < 5; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition +1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where +1 SIMPLE t3 ref f,e e 5 test.t2.d 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`e` = `test`.`t2`.`d` and `test`.`t3`.`f` is not null and `test`.`t1`.`b` is not null and `test`.`t2`.`d` is not null) where `test`.`t1`.`a` < 5 +explain extended +select * +from t1 left join v1 on v1.c=t1.b and v1.f=t1.a +where t1.a < 5; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition +1 SIMPLE t3 eq_ref f,e f 4 test.t1.a 1 100.00 Using where +1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`f` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t3`.`e` and `test`.`t1`.`a` is not null and `test`.`t1`.`a` is not null and `test`.`t1`.`b` is not null) where `test`.`t1`.`a` < 5 +explain extended +select * +from t1 left join ( t2 left join t3 on t3.e=t2.d ) +on t2.c=t1.b and t3.f=t1.a and t3.f is not null +where t1.a < 5; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition +1 SIMPLE t3 eq_ref f,e f 4 test.t1.a 1 100.00 Using where +1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`f` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t3`.`e` and `test`.`t1`.`a` is not null and `test`.`t1`.`a` is not null and `test`.`t1`.`b` is not null) where `test`.`t1`.`a` < 5 +drop view v1; +drop table t1,t2,t3; # ----------------------------------------------------------------- # -- End of 5.5 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/suite/encryption/r/debug_key_management.result b/mysql-test/suite/encryption/r/debug_key_management.result index 8793e6ba363..02e05b4d221 100644 --- a/mysql-test/suite/encryption/r/debug_key_management.result +++ b/mysql-test/suite/encryption/r/debug_key_management.result @@ -6,16 +6,12 @@ innodb_encrypt_tables ON innodb_encryption_rotate_key_age 2 innodb_encryption_rotation_iops 100 innodb_encryption_threads 4 -select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space; -space name current_key_version -0 NULL 1 -1 mysql/innodb_table_stats 1 -2 mysql/innodb_index_stats 1 +select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 1; +count(*) +0 set global debug_key_management_version=10; -select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space; -space name current_key_version -0 NULL 10 -1 mysql/innodb_table_stats 10 -2 mysql/innodb_index_stats 10 +select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 10; +count(*) +0 set global innodb_encrypt_tables=OFF; set global debug_key_management_version=1; diff --git a/mysql-test/suite/encryption/r/encrypt_and_grep.result b/mysql-test/suite/encryption/r/encrypt_and_grep.result index f95e70bf19e..bd20b79aafe 100644 --- a/mysql-test/suite/encryption/r/encrypt_and_grep.result +++ b/mysql-test/suite/encryption/r/encrypt_and_grep.result @@ -6,6 +6,16 @@ insert t1 values (repeat('foobar', 42)); insert t2 values (repeat('temp', 42)); insert t3 values (repeat('dummy', 42)); # Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +NAME +test/t3 +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +mysql/innodb_table_stats +mysql/innodb_index_stats +test/t1 +test/t2 +innodb_system # t1 yes on expecting NOT FOUND NOT FOUND /foobar/ in t1.ibd # t2 ... on expecting NOT FOUND @@ -15,13 +25,23 @@ FOUND /dummy/ in t3.ibd # ibdata1 expecting NOT FOUND NOT FOUND /foobar/ in ibdata1 # Now turn off encryption and wait for threads to decrypt everything -SET GLOBAL innodb_encryption_threads = 4; +SET GLOBAL innodb_encryption_threads = 1; SET GLOBAL innodb_encrypt_tables = off; # Wait max 10 min for key encryption threads to decrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +NAME +mysql/innodb_table_stats +mysql/innodb_index_stats +test/t2 +test/t3 +innodb_system +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +test/t1 # t1 yes on expecting NOT FOUND NOT FOUND /foobar/ in t1.ibd # t2 ... on expecting FOUND -FOUND /temp/ in t2.ibd +NOT FOUND /temp/ in t2.ibd # t3 no on expecting FOUND FOUND /dummy/ in t3.ibd # ibdata1 expecting NOT FOUND @@ -30,6 +50,16 @@ NOT FOUND /foobar/ in ibdata1 SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encrypt_tables = on; # Wait max 10 min for key encryption threads to encrypt all spaces +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +NAME +test/t3 +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +mysql/innodb_table_stats +mysql/innodb_index_stats +test/t1 +test/t2 +innodb_system # t1 yes on expecting NOT FOUND NOT FOUND /foobar/ in t1.ibd # t2 ... on expecting NOT FOUND @@ -38,5 +68,4 @@ NOT FOUND /temp/ in t2.ibd FOUND /dummy/ in t3.ibd # ibdata1 expecting NOT FOUND NOT FOUND /foobar/ in ibdata1 -# TODO: add shutdown + grep tests drop table t1, t2, t3; diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result index dc5be714f66..798057e3fb5 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result @@ -1,14 +1,7 @@ call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); -call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*"); call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -call mtr.add_suppression("mysqld: File .*"); -call mtr.add_suppression("InnoDB: Tablespace id .* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace."); -call mtr.add_suppression("InnoDB: InnoDB: Page may be an index page where index id is .*"); +call mtr.add_suppression("InnoDB: The page .* in file test/.* cannot be decrypted"); +call mtr.add_suppression("mysqld: File .* not found"); # Start server with keys2.txt CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2; diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result index ea760e7a213..adf984b9708 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result @@ -1,9 +1,5 @@ -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); select * from t1; @@ -24,3 +20,4 @@ show warnings; Level Code Message Warning 192 Table test/t1 is encrypted but encryption service or used key_id is not available. Can't continue reading table. Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB +DROP TABLE t1; diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result index d6c2706e8bf..69f11d8745b 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result @@ -1,9 +1,5 @@ -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); CHECK TABLE t1; diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change5.result b/mysql-test/suite/encryption/r/innodb-bad-key-change5.result index 75a0587d35d..13b74f3b23d 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change5.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change5.result @@ -1,9 +1,5 @@ -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); OPTIMIZE TABLE t1; diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result b/mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result index 630fba146bf..447329a74da 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result @@ -1,17 +1,13 @@ -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); -# +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); +# # Restart the server with key 4 in the key file -# +# CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1); -# +# # Restart the server with a different value for key 4 in the key file -# +# SELECT * FROM t1; ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB SELECT * FROM t1; diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result index 63ad0cf13fb..d19124ab602 100644 --- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result +++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result @@ -1,10 +1,5 @@ -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); -call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace."); +call mtr.add_suppression("InnoDB: The page .* in file test/t[15] cannot be decrypted"); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); create table t5 ( `intcol1` int(32) DEFAULT NULL, `intcol2` int(32) DEFAULT NULL, diff --git a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result new file mode 100644 index 00000000000..07f6f98b88a --- /dev/null +++ b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result @@ -0,0 +1,66 @@ +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +NAME +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +NAME +mysql/innodb_table_stats +mysql/innodb_index_stats +innodb_system +create database enctests; +use enctests; +create table t1(a int not null primary key, b char(200)) engine=innodb; +create table t2(a int not null primary key, b char(200)) engine=innodb row_format=compressed; +create table t3(a int not null primary key, b char(200)) engine=innodb page_compressed=yes; +create table t4(a int not null primary key, b char(200)) engine=innodb encrypted=yes; +create table t5(a int not null primary key, b char(200)) engine=innodb encrypted=yes row_format=compressed; +create table t6(a int not null primary key, b char(200)) engine=innodb encrypted=yes page_compressed=yes; +create table t7(a int not null primary key, b char(200)) engine=innodb encrypted=no; +create table t8(a int not null primary key, b char(200)) engine=innodb encrypted=no row_format=compressed; +create table t9(a int not null primary key, b char(200)) engine=innodb encrypted=no page_compressed=yes; +insert into t1 values (1, 'secredmessage'); +insert into t2 values (1, 'secredmessage'); +insert into t3 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); +insert into t4 values (1, 'secredmessage'); +insert into t5 values (1, 'secredmessage'); +insert into t6 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); +insert into t7 values (1, 'publicmessage'); +insert into t8 values (1, 'publicmessage'); +insert into t9 values (1, 'pugliccompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); +# should list tables t1-t6 +SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'enctests%'; +NAME ENCRYPTION_SCHEME CURRENT_KEY_ID +enctests/t1 1 1 +enctests/t2 1 1 +enctests/t3 1 1 +enctests/t4 1 1 +enctests/t5 1 1 +enctests/t6 1 1 +# should list tables t7-t9 +SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 and NAME LIKE 'enctests%'; +NAME ENCRYPTION_SCHEME CURRENT_KEY_ID +enctests/t7 0 1 +enctests/t8 0 1 +enctests/t9 0 1 +SET GLOBAL innodb_encrypt_tables=OFF; +ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'OFF' +SET GLOBAL innodb_encrypt_tables=ON; +ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'ON' +# t1 default on expecting NOT FOUND +NOT FOUND /secred/ in t1.ibd +# t2 default on expecting NOT FOUND +NOT FOUND /secred/ in t2.ibd +# t3 default on expecting NOT FOUND +NOT FOUND /secred/ in t3.ibd +# t4 on expecting NOT FOUND +NOT FOUND /secred/ in t4.ibd +# t5 on expecting NOT FOUND +NOT FOUND /secred/ in t5.ibd +# t6 on expecting NOT FOUND +NOT FOUND /secred/ in t6.ibd +# t7 off expecting FOUND +FOUND /public/ in t7.ibd +# t8 row compressed expecting NOT FOUND +FOUND /public/ in t8.ibd +# t9 page compressed expecting NOT FOUND +NOT FOUND /public/ in t9.ibd +use test; +drop database enctests; diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result index b59ec158273..2d2bc91c321 100644 --- a/mysql-test/suite/encryption/r/innodb-missing-key.result +++ b/mysql-test/suite/encryption/r/innodb-missing-key.result @@ -1,6 +1,4 @@ -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); +call mtr.add_suppression("InnoDB: The page .* in file test/t. cannot be decrypted"); # Start server with keys2.txt CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19; diff --git a/mysql-test/suite/encryption/r/innodb-spatial-index.result b/mysql-test/suite/encryption/r/innodb-spatial-index.result index 7ad0af72bcd..852be0b9a73 100644 --- a/mysql-test/suite/encryption/r/innodb-spatial-index.result +++ b/mysql-test/suite/encryption/r/innodb-spatial-index.result @@ -36,7 +36,7 @@ mysql/innodb_table_stats mysql/innodb_index_stats test/t1 test/t2 -NULL +innodb_system SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; NAME DROP TABLE t1, t2; diff --git a/mysql-test/suite/encryption/r/innodb_encryption.result b/mysql-test/suite/encryption/r/innodb_encryption.result index 9b762bbba11..26c77499d25 100644 --- a/mysql-test/suite/encryption/r/innodb_encryption.result +++ b/mysql-test/suite/encryption/r/innodb_encryption.result @@ -17,6 +17,7 @@ CURRENT_KEY_VERSION int(11) unsigned NO 0 KEY_ROTATION_PAGE_NUMBER bigint(21) unsigned YES NULL KEY_ROTATION_MAX_PAGE_NUMBER bigint(21) unsigned YES NULL CURRENT_KEY_ID int(11) unsigned NO 0 +ROTATING_OR_FLUSHING int(1) unsigned NO 0 # Wait max 5 min for key encryption threads to encrypt one space # Success! # Wait max 10 min for key encryption threads to encrypt all space diff --git a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result index d04525b0d5a..26765229a2e 100644 --- a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result +++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result @@ -22,7 +22,7 @@ end while; end// commit; set autocommit=0; -call innodb_insert_proc(15000); +call innodb_insert_proc(1500); commit; set autocommit=1; # Wait max 10 min for key encryption threads to encrypt all spaces @@ -40,6 +40,8 @@ NOT FOUND /author/ in t5.ibd NOT FOUND /mangled/ in t6.ibd # t7 ... on expecting NOT FOUND NOT FOUND /mysql/ in t7.ibd +SET GLOBAL innodb_file_format = `Barracuda`; +SET GLOBAL innodb_file_per_table = ON; ALTER TABLE t1 ADD COLUMN b int default 2; ALTER TABLE t2 ADD COLUMN b int default 2; ALTER TABLE t7 ADD COLUMN b int default 2; @@ -133,42 +135,5 @@ NOT FOUND /author/ in t5.ibd NOT FOUND /mangled/ in t6.ibd # t7 ... on expecting NOT FOUND NOT FOUND /mysql/ in t7.ibd -# Restarting server -# Done restarting server -select count(1) from t1; -count(1) -15000 -select count(1) from t2; -count(1) -15000 -select count(1) from t3; -count(1) -15000 -select count(1) from t4; -count(1) -15000 -select count(1) from t5; -count(1) -15000 -select count(1) from t6; -count(1) -15000 -select count(1) from t7; -count(1) -15000 -# t1 yes on expecting NOT FOUND -NOT FOUND /foobar/ in t1.ibd -# t2 ... on expecting NOT FOUND -NOT FOUND /temp/ in t2.ibd -# t3 ... on expecting NOT FOUND -NOT FOUND /barfoo/ in t3.ibd -# t4 ... on expecting NOT FOUND -NOT FOUND /repeat/ in t4.ibd -# t5 ... on expecting NOT FOUND -NOT FOUND /author/ in t5.ibd -# t6 ... on expecting NOT FOUND -NOT FOUND /mangled/ in t6.ibd -# t7 ... on expecting NOT FOUND -NOT FOUND /mysql/ in t7.ibd DROP PROCEDURE innodb_insert_proc; DROP TABLE t1, t2, t3, t4, t5, t6, t7; diff --git a/mysql-test/suite/encryption/t/debug_key_management.test b/mysql-test/suite/encryption/t/debug_key_management.test index b4dc8c41916..5001ac6a516 100644 --- a/mysql-test/suite/encryption/t/debug_key_management.test +++ b/mysql-test/suite/encryption/t/debug_key_management.test @@ -11,14 +11,15 @@ show variables like 'innodb_encrypt%'; let $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=1; --source include/wait_condition.inc -select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space; +select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 1; set global debug_key_management_version=10; let $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=10; --source include/wait_condition.inc -select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space; +select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 10; # Note that we expect that key_version is increasing so disable encryption before reset + set global innodb_encrypt_tables=OFF; set global debug_key_management_version=1; diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.opt b/mysql-test/suite/encryption/t/encrypt_and_grep.opt index bcff011eb82..5c9aaf65b06 100644 --- a/mysql-test/suite/encryption/t/encrypt_and_grep.opt +++ b/mysql-test/suite/encryption/t/encrypt_and_grep.opt @@ -1,8 +1,7 @@ --innodb-encrypt-tables=ON --innodb-encrypt-log=ON --innodb-encryption-rotate-key-age=15 ---innodb-encryption-threads=4 +--innodb-encryption-threads=1 --innodb-tablespaces-encryption ---innodb-max-dirty-pages-pct=0.001 diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test index 2a5fcbcebf8..fd54fc74f0a 100644 --- a/mysql-test/suite/encryption/t/encrypt_and_grep.test +++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test @@ -1,5 +1,5 @@ -- source include/have_innodb.inc --- source include/have_example_key_management_plugin.inc +-- source include/have_file_key_management_plugin.inc # embedded does not support restart -- source include/not_embedded.inc @@ -30,7 +30,10 @@ insert t3 values (repeat('dummy', 42)); --let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 --source include/wait_condition.inc ---sleep 5 +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +--source include/shutdown_mysqld.inc --let SEARCH_PATTERN=foobar --echo # t1 yes on expecting NOT FOUND @@ -49,15 +52,21 @@ insert t3 values (repeat('dummy', 42)); -- let SEARCH_FILE=$ib1_IBD -- source include/search_pattern_in_file.inc +-- source include/start_mysqld.inc + --echo # Now turn off encryption and wait for threads to decrypt everything -SET GLOBAL innodb_encryption_threads = 4; +SET GLOBAL innodb_encryption_threads = 1; SET GLOBAL innodb_encrypt_tables = off; --echo # Wait max 10 min for key encryption threads to decrypt all spaces --let $wait_timeout= 600 ---let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +--let $wait_condition=SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND KEY_ROTATION_PAGE_NUMBER IS NULL; --source include/wait_condition.inc ---sleep 5 + +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +--source include/shutdown_mysqld.inc --let SEARCH_PATTERN=foobar --echo # t1 yes on expecting NOT FOUND @@ -76,6 +85,8 @@ SET GLOBAL innodb_encrypt_tables = off; -- let SEARCH_FILE=$ib1_IBD -- source include/search_pattern_in_file.inc +-- source include/start_mysqld.inc + --echo # Now turn on encryption and wait for threads to encrypt all spaces SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_encrypt_tables = on; @@ -84,7 +95,11 @@ SET GLOBAL innodb_encrypt_tables = on; --let $wait_timeout= 600 --let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; --source include/wait_condition.inc ---sleep 5 + +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; + +--source include/shutdown_mysqld.inc --let SEARCH_PATTERN=foobar --echo # t1 yes on expecting NOT FOUND @@ -103,6 +118,6 @@ SET GLOBAL innodb_encrypt_tables = on; -- let SEARCH_FILE=$ib1_IBD -- source include/search_pattern_in_file.inc ---echo # TODO: add shutdown + grep tests +-- source include/start_mysqld.inc drop table t1, t2, t3; diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test index cc5e6b36ac3..e8b5de99d80 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test @@ -13,16 +13,9 @@ # call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); -call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*"); call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -call mtr.add_suppression("mysqld: File .*"); -call mtr.add_suppression("InnoDB: Tablespace id .* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace."); -call mtr.add_suppression("InnoDB: InnoDB: Page may be an index page where index id is .*"); +call mtr.add_suppression("InnoDB: The page .* in file test/.* cannot be decrypted"); +call mtr.add_suppression("mysqld: File .* not found"); --echo --echo # Start server with keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test index 7c61c34ec59..c7c9e66dcf8 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test @@ -8,42 +8,28 @@ # # MDEV-8750: Server crashes in page_cur_is_after_last on altering table using a wrong encryption key # -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); # Suppression for builds where file_key_management plugin is linked statically -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); - ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); --write_file $MYSQLTEST_VARDIR/keys1.txt 1;770A8A65DA156D24EE2A093277530142 4;770A8A65DA156D24EE2A093277530143 EOF ---exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - --write_file $MYSQLTEST_VARDIR/keys2.txt 1;770A8A65DA156D24EE2A093277530142 4;770A8A65DA156D24EE2A093277530144 EOF ---exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt +--source include/restart_mysqld.inc --error ER_GET_ERRMSG select * from t1; @@ -55,5 +41,9 @@ show warnings; alter table t1 engine=InnoDB; show warnings; +--let $restart_parameters= --innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc + +DROP TABLE t1; --remove_file $MYSQLTEST_VARDIR/keys1.txt --remove_file $MYSQLTEST_VARDIR/keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test index 0b1db40b866..0459c433ece 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test @@ -8,66 +8,36 @@ # # MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys # -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); # Suppression for builds where file_key_management plugin is linked statically -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); - ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); --write_file $MYSQLTEST_VARDIR/keys1.txt 1;770A8A65DA156D24EE2A093277530142 4;770A8A65DA156D24EE2A093277530143 EOF ---exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc - ---let $MYSQLD_TMPDIR = `SELECT @@tmpdir` ---let $MYSQLD_DATADIR = `SELECT @@datadir` +--let $restart_parameters= --innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - --write_file $MYSQLTEST_VARDIR/keys2.txt 1;770A8A65DA156D24EE2A093277530142 4;770A8A65DA156D24EE2A093277530144 EOF ---exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt +--source include/restart_mysqld.inc --replace_regex /tablespace [0-9]*/tablespace #/ CHECK TABLE t1; SHOW WARNINGS; ---remove_file $MYSQLTEST_VARDIR/keys1.txt ---remove_file $MYSQLTEST_VARDIR/keys2.txt - ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - ---write_file $MYSQLTEST_VARDIR/keys1.txt -1;770A8A65DA156D24EE2A093277530142 -4;770A8A65DA156D24EE2A093277530143 -EOF - ---exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc DROP TABLE t1; - --remove_file $MYSQLTEST_VARDIR/keys1.txt +--remove_file $MYSQLTEST_VARDIR/keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change5.test b/mysql-test/suite/encryption/t/innodb-bad-key-change5.test index 5f63eebe034..b205d203374 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change5.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change5.test @@ -8,64 +8,35 @@ # # MDEV-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keys # -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); # Suppression for builds where file_key_management plugin is linked statically -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); - ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); --write_file $MYSQLTEST_VARDIR/keys1.txt 1;770A8A65DA156D24EE2A093277530142 4;770A8A65DA156D24EE2A093277530143 EOF ---exec echo "restart:--innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc - ---let $MYSQLD_TMPDIR = `SELECT @@tmpdir` ---let $MYSQLD_DATADIR = `SELECT @@datadir` +--let $restart_parameters= --innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - --write_file $MYSQLTEST_VARDIR/keys2.txt 1;770A8A65DA156D24EE2A093277530142 4;770A8A65DA156D24EE2A093277530144 EOF ---exec echo "restart:--innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt +--source include/restart_mysqld.inc OPTIMIZE TABLE t1; SHOW WARNINGS; ---remove_file $MYSQLTEST_VARDIR/keys1.txt ---remove_file $MYSQLTEST_VARDIR/keys2.txt - ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - ---write_file $MYSQLTEST_VARDIR/keys1.txt -1;770A8A65DA156D24EE2A093277530142 -4;770A8A65DA156D24EE2A093277530143 -EOF - ---exec echo "restart:--innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc DROP TABLE t1; --remove_file $MYSQLTEST_VARDIR/keys1.txt +--remove_file $MYSQLTEST_VARDIR/keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-shutdown.test b/mysql-test/suite/encryption/t/innodb-bad-key-shutdown.test index d27402edaa8..d1b009fad93 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-shutdown.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-shutdown.test @@ -2,67 +2,51 @@ # MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key # -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -# Suppression for builds where file_key_management plugin is linked statically -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); - ---echo # ---echo # Restart the server with key 4 in the key file ---echo # - --source include/have_innodb.inc --source include/not_embedded.inc ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc +call mtr.add_suppression("InnoDB: The page .* in file test/t1 cannot be decrypted"); +# Suppression for builds where file_key_management plugin is linked statically +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); + +--echo # +--echo # Restart the server with key 4 in the key file +--echo # --write_file $MYSQLTEST_VARDIR/keys1.txt 1;770A8A65DA156D24EE2A093277530142 4;18420B5CBA31CCDFFE9716E91EB61374D05914F3ADE23E03 EOF ---exec echo "restart:--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4; INSERT INTO t1 VALUES (1); ---echo # +--echo # --echo # Restart the server with a different value for key 4 in the key file ---echo # - ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc +--echo # --write_file $MYSQLTEST_VARDIR/keys2.txt 1;770A8A65DA156D24EE2A093277530142 4;22222222222222222222222222222222 EOF ---exec echo "restart:--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt +--source include/restart_mysqld.inc ---error 1296 +--error ER_GET_ERRMSG SELECT * FROM t1; ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - ---exec echo "restart:--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc SELECT * FROM t1; DROP TABLE t1; +--let $restart_parameters= +--source include/restart_mysqld.inc + --remove_file $MYSQLTEST_VARDIR/keys2.txt --remove_file $MYSQLTEST_VARDIR/keys1.txt diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test index 8a8b451f5b1..fed9878ffbc 100644 --- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test +++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test @@ -9,29 +9,15 @@ # # MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table # -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); -call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); -call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); -# Suppression for builds where file_key_management plugin is linked statically -call mtr.add_suppression("Couldn't load plugins from 'file_key_management*"); -call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace."); +call mtr.add_suppression("InnoDB: The page .* in file test/t[15] cannot be decrypted"); +call mtr.add_suppression("Couldn't load plugins from 'file_key_management"); ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - ---error 0,1,2 ---remove_file $MYSQLTEST_VARDIR/encryption-disable-keys1.txt ---write_file $MYSQLTEST_VARDIR/encryption-disable-keys1.txt +--write_file $MYSQLTEST_VARDIR/keys1.txt 1;770A8A65DA156D24EE2A093277530142 -4;770A8A65DA156D24EE2A093277530143 EOF ---exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/encryption-disable-keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc create table t5 ( `intcol1` int(32) DEFAULT NULL, @@ -61,28 +47,18 @@ alter table t1 encrypted='yes' `encryption_key_id`=1; select * from t1; select * from t5; ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - ---exec echo "restart:--innodb-encrypt-tables=OFF" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables=OFF +--source include/restart_mysqld.inc ---error 1296 +--error ER_GET_ERRMSG select * from t1; ---error 1296 +--error ER_GET_ERRMSG select * from t5; ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---shutdown_server ---source include/wait_until_disconnected.inc - ---exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/encryption-disable-keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---enable_reconnect ---source include/wait_until_connected_again.inc +--let $restart_parameters= --innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt +--source include/restart_mysqld.inc drop table t1; drop table t5; ---remove_file $MYSQLTEST_VARDIR/encryption-disable-keys1.txt +--remove_file $MYSQLTEST_VARDIR/keys1.txt diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.opt b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.opt new file mode 100644 index 00000000000..03a0028d371 --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.opt @@ -0,0 +1,5 @@ +--innodb-encrypt-tables +--innodb-encrypt-log +--innodb-encryption-rotate-key-age=0 +--innodb-encryption-threads=4 +--innodb-tablespaces-encryption diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test new file mode 100644 index 00000000000..fdbd6c8da7c --- /dev/null +++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test @@ -0,0 +1,102 @@ +-- source include/have_innodb.inc +-- source include/have_file_key_management_plugin.inc +# not embedded because of restarts +-- source include/not_embedded.inc + +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0; +SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0; + +--disable_query_log +--disable_warnings +let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; +let $innodb_file_format_orig = `SELECT @@innodb_file_format`; +let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; +let $encryption = `SELECT @@innodb_encrypt_tables`; +SET GLOBAL innodb_file_format = `Barracuda`; +SET GLOBAL innodb_file_per_table = ON; +# zlib +set global innodb_compression_algorithm = 1; +--enable_warnings +--enable_query_log + +create database enctests; +use enctests; +create table t1(a int not null primary key, b char(200)) engine=innodb; +create table t2(a int not null primary key, b char(200)) engine=innodb row_format=compressed; +create table t3(a int not null primary key, b char(200)) engine=innodb page_compressed=yes; +create table t4(a int not null primary key, b char(200)) engine=innodb encrypted=yes; +create table t5(a int not null primary key, b char(200)) engine=innodb encrypted=yes row_format=compressed; +create table t6(a int not null primary key, b char(200)) engine=innodb encrypted=yes page_compressed=yes; +create table t7(a int not null primary key, b char(200)) engine=innodb encrypted=no; +create table t8(a int not null primary key, b char(200)) engine=innodb encrypted=no row_format=compressed; +create table t9(a int not null primary key, b char(200)) engine=innodb encrypted=no page_compressed=yes; + +insert into t1 values (1, 'secredmessage'); +insert into t2 values (1, 'secredmessage'); +insert into t3 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); +insert into t4 values (1, 'secredmessage'); +insert into t5 values (1, 'secredmessage'); +insert into t6 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); +insert into t7 values (1, 'publicmessage'); +insert into t8 values (1, 'publicmessage'); +insert into t9 values (1, 'pugliccompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); + +--echo # should list tables t1-t6 +SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'enctests%'; +--echo # should list tables t7-t9 +SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 and NAME LIKE 'enctests%'; + +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL innodb_encrypt_tables=OFF; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL innodb_encrypt_tables=ON; + +--let $MYSQLD_DATADIR=`select @@datadir` + +-- source include/shutdown_mysqld.inc + +--let SEARCH_RANGE = 10000000 +--let SEARCH_PATTERN=secred +--echo # t1 default on expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t1.ibd +-- source include/search_pattern_in_file.inc +--echo # t2 default on expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t2.ibd +-- source include/search_pattern_in_file.inc +--echo # t3 default on expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t3.ibd +-- source include/search_pattern_in_file.inc +--echo # t4 on expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t4.ibd +-- source include/search_pattern_in_file.inc +--echo # t5 on expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t5.ibd +-- source include/search_pattern_in_file.inc +--echo # t6 on expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t6.ibd +-- source include/search_pattern_in_file.inc +--let SEARCH_PATTERN=public +--echo # t7 off expecting FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t7.ibd +-- source include/search_pattern_in_file.inc +--echo # t8 row compressed expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t8.ibd +-- source include/search_pattern_in_file.inc +--echo # t9 page compressed expecting NOT FOUND +-- let SEARCH_FILE=$MYSQLD_DATADIR/enctests/t9.ibd +-- source include/search_pattern_in_file.inc + +-- source include/start_mysqld.inc + +use test; +drop database enctests; +# reset system + +--disable_query_log +--disable_warnings +EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; +EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; +EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; +set global innodb_compression_algorithm = DEFAULT; +--enable_warnings +--enable_query_log diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test index 8fcfb766117..84ca92010e9 100644 --- a/mysql-test/suite/encryption/t/innodb-missing-key.test +++ b/mysql-test/suite/encryption/t/innodb-missing-key.test @@ -2,16 +2,11 @@ -- source include/have_file_key_management_plugin.inc # embedded does not support restart -- source include/not_embedded.inc --- source include/not_valgrind.inc -# Avoid CrashReporter popup on Mac --- source include/not_crashrep.inc # # MDEV-11004: Unable to start (Segfault or os error 2) when encryption key missing # -call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); -call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match."); -call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); +call mtr.add_suppression("InnoDB: The page .* in file test/t. cannot be decrypted"); --echo --echo # Start server with keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test index eb90c446a81..e7e8405e839 100644 --- a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test +++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test @@ -1,18 +1,7 @@ -- source include/have_innodb.inc --- source include/have_example_key_management_plugin.inc --- source include/not_valgrind.inc +-- source include/have_file_key_management_plugin.inc +# test uses restart -- source include/not_embedded.inc --- source include/not_windows.inc - ---let $MYSQLD_DATADIR=`select @@datadir` ---let SEARCH_RANGE = 10000000 ---let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd ---let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd ---let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd ---let t4_IBD = $MYSQLD_DATADIR/test/t4.ibd ---let t5_IBD = $MYSQLD_DATADIR/test/t5.ibd ---let t6_IBD = $MYSQLD_DATADIR/test/t6.ibd ---let t7_IBD = $MYSQLD_DATADIR/test/t7.ibd CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB encrypted=yes; CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB; @@ -42,7 +31,7 @@ delimiter ;// commit; set autocommit=0; -call innodb_insert_proc(15000); +call innodb_insert_proc(1500); commit; set autocommit=1; @@ -50,37 +39,48 @@ set autocommit=1; --let $wait_timeout= 600 --let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 --source include/wait_condition.inc +--let $MYSQLD_DATADIR=`select @@datadir` ---sleep 10 +--source include/shutdown_mysqld.inc +--source include/wait_until_disconnected.inc + +--let SEARCH_RANGE = 10000000 --let SEARCH_PATTERN=foobar --echo # t1 yes on expecting NOT FOUND --- let SEARCH_FILE=$t1_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t1.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=temp --echo # t2 ... on expecting NOT FOUND --- let SEARCH_FILE=$t2_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t2.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=barfoo --echo # t3 ... on expecting NOT FOUND --- let SEARCH_FILE=$t3_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t3.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=repeat --echo # t4 ... on expecting NOT FOUND --- let SEARCH_FILE=$t4_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t4.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=author --echo # t5 ... on expecting NOT FOUND --- let SEARCH_FILE=$t5_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t5.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=mangled --echo # t6 ... on expecting NOT FOUND --- let SEARCH_FILE=$t6_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t6.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=mysql --echo # t7 ... on expecting NOT FOUND --- let SEARCH_FILE=$t7_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t7.ibd -- source include/search_pattern_in_file.inc +-- source include/start_mysqld.inc + +--disable_warnings +SET GLOBAL innodb_file_format = `Barracuda`; +SET GLOBAL innodb_file_per_table = ON; +--enable_warnings + ALTER TABLE t1 ADD COLUMN b int default 2; ALTER TABLE t2 ADD COLUMN b int default 2; ALTER TABLE t7 ADD COLUMN b int default 2; @@ -102,76 +102,39 @@ SHOW CREATE TABLE t5; SHOW CREATE TABLE t6; SHOW CREATE TABLE t7; ---sleep 10 ---let SEARCH_PATTERN=foobar ---echo # t1 yes on expecting NOT FOUND --- let SEARCH_FILE=$t1_IBD --- source include/search_pattern_in_file.inc ---let SEARCH_PATTERN=temp ---echo # t2 ... on expecting NOT FOUND --- let SEARCH_FILE=$t2_IBD --- source include/search_pattern_in_file.inc ---let SEARCH_PATTERN=barfoo ---echo # t3 ... on expecting NOT FOUND --- let SEARCH_FILE=$t3_IBD --- source include/search_pattern_in_file.inc ---let SEARCH_PATTERN=repeat ---echo # t4 ... on expecting NOT FOUND --- let SEARCH_FILE=$t4_IBD --- source include/search_pattern_in_file.inc ---let SEARCH_PATTERN=author ---echo # t5 ... on expecting NOT FOUND --- let SEARCH_FILE=$t5_IBD --- source include/search_pattern_in_file.inc ---let SEARCH_PATTERN=mangled ---echo # t6 ... on expecting NOT FOUND --- let SEARCH_FILE=$t6_IBD --- source include/search_pattern_in_file.inc ---let SEARCH_PATTERN=mysql ---echo # t7 ... on expecting NOT FOUND --- let SEARCH_FILE=$t7_IBD --- source include/search_pattern_in_file.inc - ---echo # Restarting server --- source include/restart_mysqld.inc ---echo # Done restarting server - -select count(1) from t1; -select count(1) from t2; -select count(1) from t3; -select count(1) from t4; -select count(1) from t5; -select count(1) from t6; -select count(1) from t7; +--source include/shutdown_mysqld.inc +--source include/wait_until_disconnected.inc --let SEARCH_PATTERN=foobar --echo # t1 yes on expecting NOT FOUND --- let SEARCH_FILE=$t1_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t1.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=temp --echo # t2 ... on expecting NOT FOUND --- let SEARCH_FILE=$t2_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t2.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=barfoo --echo # t3 ... on expecting NOT FOUND --- let SEARCH_FILE=$t3_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t3.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=repeat --echo # t4 ... on expecting NOT FOUND --- let SEARCH_FILE=$t4_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t4.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=author --echo # t5 ... on expecting NOT FOUND --- let SEARCH_FILE=$t5_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t5.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=mangled --echo # t6 ... on expecting NOT FOUND --- let SEARCH_FILE=$t6_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t6.ibd -- source include/search_pattern_in_file.inc --let SEARCH_PATTERN=mysql --echo # t7 ... on expecting NOT FOUND --- let SEARCH_FILE=$t7_IBD +-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t7.ibd -- source include/search_pattern_in_file.inc +-- source include/start_mysqld.inc + DROP PROCEDURE innodb_insert_proc; DROP TABLE t1, t2, t3, t4, t5, t6, t7; diff --git a/mysql-test/suite/federated/federated_bug_35333.test b/mysql-test/suite/federated/federated_bug_35333.test index 47feefd75a1..d43f4e930f8 100644 --- a/mysql-test/suite/federated/federated_bug_35333.test +++ b/mysql-test/suite/federated/federated_bug_35333.test @@ -61,6 +61,7 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo # --echo # Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query --echo # +--replace_result 20 2 SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result index 338f3064a71..26a8677495b 100644 --- a/mysql-test/suite/funcs_1/r/is_columns.result +++ b/mysql-test/suite/funcs_1/r/is_columns.result @@ -103,6 +103,9 @@ GENERATION_EXPRESSION longtext YES NULL SELECT table_catalog, table_schema, table_name, column_name FROM information_schema.columns WHERE table_catalog IS NULL OR table_catalog <> 'def'; table_catalog table_schema table_name column_name +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' ############################################################################### # Testcase 3.2.6.2 + 3.2.6.3: INFORMATION_SCHEMA.COLUMNS accessible information ############################################################################### diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result index 73e9579f7f2..b12574a0dc4 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result @@ -117,6 +117,20 @@ def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_ def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI select,insert,update,references NEVER NULL def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL +def mysql innodb_index_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL +def mysql innodb_index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL +def mysql innodb_index_stats last_update 4 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL +def mysql innodb_index_stats sample_size 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL +def mysql innodb_index_stats stat_description 8 NULL NO varchar 1024 3072 NULL NULL NULL utf8 utf8_bin varchar(1024) select,insert,update,references NEVER NULL +def mysql innodb_index_stats stat_name 5 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL +def mysql innodb_index_stats stat_value 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL +def mysql innodb_index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL +def mysql innodb_table_stats clustered_index_size 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL +def mysql innodb_table_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL +def mysql innodb_table_stats last_update 3 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL +def mysql innodb_table_stats n_rows 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL +def mysql innodb_table_stats sum_of_other_index_sizes 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL +def mysql innodb_table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8 utf8_bin varchar(64) PRI select,insert,update,references NEVER NULL def mysql plugin dl 2 NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL def mysql plugin name 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) PRI select,insert,update,references NEVER NULL def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL @@ -438,6 +452,20 @@ NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) 3.0000 mysql index_stats index_name varchar 64 192 utf8 utf8_bin varchar(64) NULL mysql index_stats prefix_arity int NULL NULL NULL NULL int(11) unsigned NULL mysql index_stats avg_frequency decimal NULL NULL NULL NULL decimal(12,4) +3.0000 mysql innodb_index_stats database_name varchar 64 192 utf8 utf8_bin varchar(64) +3.0000 mysql innodb_index_stats table_name varchar 64 192 utf8 utf8_bin varchar(64) +3.0000 mysql innodb_index_stats index_name varchar 64 192 utf8 utf8_bin varchar(64) +NULL mysql innodb_index_stats last_update timestamp NULL NULL NULL NULL timestamp +3.0000 mysql innodb_index_stats stat_name varchar 64 192 utf8 utf8_bin varchar(64) +NULL mysql innodb_index_stats stat_value bigint NULL NULL NULL NULL bigint(20) unsigned +NULL mysql innodb_index_stats sample_size bigint NULL NULL NULL NULL bigint(20) unsigned +3.0000 mysql innodb_index_stats stat_description varchar 1024 3072 utf8 utf8_bin varchar(1024) +3.0000 mysql innodb_table_stats database_name varchar 64 192 utf8 utf8_bin varchar(64) +3.0000 mysql innodb_table_stats table_name varchar 64 192 utf8 utf8_bin varchar(64) +NULL mysql innodb_table_stats last_update timestamp NULL NULL NULL NULL timestamp +NULL mysql innodb_table_stats n_rows bigint NULL NULL NULL NULL bigint(20) unsigned +NULL mysql innodb_table_stats clustered_index_size bigint NULL NULL NULL NULL bigint(20) unsigned +NULL mysql innodb_table_stats sum_of_other_index_sizes bigint NULL NULL NULL NULL bigint(20) unsigned 3.0000 mysql plugin name varchar 64 192 utf8 utf8_general_ci varchar(64) 3.0000 mysql plugin dl varchar 128 384 utf8 utf8_general_ci varchar(128) 3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64) diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result index cbfe9daef70..9beb736edc6 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result +++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result @@ -251,6 +251,9 @@ def mysql user Update_priv 6 N NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci e def mysql user User 2 NO char 80 240 NULL NULL NULL utf8 utf8_bin char(80) PRI NEVER NULL def mysql user x509_issuer 35 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL def mysql user x509_subject 36 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' ########################################################################## # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH ########################################################################## @@ -272,6 +275,9 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 1.0000 text utf8 utf8_bin 1.0000 mediumtext utf8 utf8_general_ci 1.0000 text utf8 utf8_general_ci +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -289,6 +295,9 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME 3.0000 enum utf8 utf8_general_ci 3.0000 set utf8 utf8_general_ci 3.0000 varchar utf8 utf8_general_ci +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' SELECT DISTINCT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, DATA_TYPE, @@ -307,6 +316,9 @@ NULL smallint NULL NULL NULL time NULL NULL NULL timestamp NULL NULL NULL tinyint NULL NULL +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' --> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, @@ -572,3 +584,6 @@ NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) 3.0000 mysql user is_role enum 1 3 utf8 utf8_general_ci enum('N','Y') 3.0000 mysql user default_role char 80 240 utf8 utf8_bin char(80) NULL mysql user max_statement_time decimal NULL NULL NULL NULL decimal(12,6) +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result index 8197f043e48..749b09fa87d 100644 --- a/mysql-test/suite/funcs_1/r/is_statistics.result +++ b/mysql-test/suite/funcs_1/r/is_statistics.result @@ -151,6 +151,9 @@ def mysql time_zone_transition_type mysql PRIMARY def mysql time_zone_transition_type mysql PRIMARY def mysql user mysql PRIMARY def mysql user mysql PRIMARY +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1286 Unknown storage engine 'InnoDB' #################################################################################### # Testcase 3.2.14.2 + 3.2.14.3: INFORMATION_SCHEMA.STATISTICS accessible information #################################################################################### diff --git a/mysql-test/suite/funcs_1/t/is_columns_mysql.test b/mysql-test/suite/funcs_1/t/is_columns_mysql.test index a844e18f5be..0566241bd20 100644 --- a/mysql-test/suite/funcs_1/t/is_columns_mysql.test +++ b/mysql-test/suite/funcs_1/t/is_columns_mysql.test @@ -13,6 +13,7 @@ # --source include/not_embedded.inc +--source include/have_innodb.inc let $my_where = WHERE table_schema = 'mysql'; --source suite/funcs_1/datadict/columns.inc diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def index 9f8de75ae14..631f01a8e65 100644 --- a/mysql-test/suite/innodb/disabled.def +++ b/mysql-test/suite/innodb/disabled.def @@ -11,4 +11,4 @@ ############################################################################## innodb_defragment_fill_factor : MDEV-10771 - +innodb_bug14147491 : MDEV-12253 ut_ad(buf_pool->n_pend_reads > 0) diff --git a/mysql-test/suite/innodb/include/ibd_convert.pl b/mysql-test/suite/innodb/include/ibd_convert.pl index 32eef96fd23..9c7e829f455 100644 --- a/mysql-test/suite/innodb/include/ibd_convert.pl +++ b/mysql-test/suite/innodb/include/ibd_convert.pl @@ -1,4 +1,3 @@ -#!/usr/bin/perl # Convert tablespace flags to the format understood by MariaDB 10.1.0..10.1.20, # with the assumption that the flags were correct. diff --git a/mysql-test/suite/innodb/r/alter_key_block_size-11757.result b/mysql-test/suite/innodb/r/alter_key_block_size-11757.result new file mode 100644 index 00000000000..6e3b35b6f1a --- /dev/null +++ b/mysql-test/suite/innodb/r/alter_key_block_size-11757.result @@ -0,0 +1,50 @@ +create table t1 ( +id1 bigint(20) not null, +id2 bigint(20) not null, +primary key (id1), +unique key id2 (id2) +) engine=innodb row_format=compressed key_block_size=8; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id1` bigint(20) NOT NULL, + `id2` bigint(20) NOT NULL, + PRIMARY KEY (`id1`), + UNIQUE KEY `id2` (`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 +SET innodb_strict_mode=ON; +alter table t1 row_format=dynamic; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SET innodb_strict_mode=OFF; +alter table t1 row_format=dynamic; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8 unless ROW_FORMAT=COMPRESSED. +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id1` bigint(20) NOT NULL, + `id2` bigint(20) NOT NULL, + PRIMARY KEY (`id1`), + UNIQUE KEY `id2` (`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=8 +SET innodb_strict_mode=ON; +alter table t1 key_block_size=0; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id1` bigint(20) NOT NULL, + `id2` bigint(20) NOT NULL, + PRIMARY KEY (`id1`) KEY_BLOCK_SIZE=8, + UNIQUE KEY `id2` (`id2`) KEY_BLOCK_SIZE=8 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +alter table t1 drop primary key, add primary key (id1), +drop key id2, add unique (id2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id1` bigint(20) NOT NULL, + `id2` bigint(20) NOT NULL, + PRIMARY KEY (`id1`), + UNIQUE KEY `id2` (`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-32k-crash.result b/mysql-test/suite/innodb/r/innodb-32k-crash.result index 4fcb6ab19ef..d0bc25968c6 100644 --- a/mysql-test/suite/innodb/r/innodb-32k-crash.result +++ b/mysql-test/suite/innodb/r/innodb-32k-crash.result @@ -115,6 +115,7 @@ UPDATE t2 SET ka=@l,la=@l,ma=@l,na=@l,oa=@l,pa=@l; UPDATE t2 SET qa=@l,ra=@l,sa=@l,ta=@l,ua=@l; UPDATE t2 SET va=@l,wa=@l,xa=@l,ya=@l,za=@l; COMMIT; +BEGIN; INSERT INTO t1 SELECT * from t2; BEGIN; UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e; diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result index fe4b1908fcb..afdaca9acd2 100644 --- a/mysql-test/suite/innodb/r/innodb-blob.result +++ b/mysql-test/suite/innodb/r/innodb-blob.result @@ -41,11 +41,9 @@ a 1 2 3 -SET DEBUG='+d,crash_commit_before'; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +BEGIN; INSERT INTO t2 VALUES (42); -ERROR HY000: Lost connection to MySQL server during query +# Kill and restart disconnect con1; disconnect con2; connection default; @@ -100,11 +98,7 @@ SELECT info FROM information_schema.processlist WHERE state = 'debug sync point: before_row_upd_extern'; info UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2 -SET DEBUG='+d,crash_commit_before'; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead -COMMIT; -ERROR HY000: Lost connection to MySQL server during query +# Kill and restart disconnect con2; connection default; ERROR HY000: Lost connection to MySQL server during query @@ -136,11 +130,7 @@ SELECT info FROM information_schema.processlist WHERE state = 'debug sync point: after_row_upd_extern'; info UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2 -SET DEBUG='+d,crash_commit_before'; -Warnings: -Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead -COMMIT; -ERROR HY000: Lost connection to MySQL server during query +# Kill and restart disconnect con2; connection default; ERROR HY000: Lost connection to MySQL server during query diff --git a/mysql-test/suite/innodb/r/innodb-get-fk.result b/mysql-test/suite/innodb/r/innodb-get-fk.result index 928fa322f81..ee17f262854 100644 --- a/mysql-test/suite/innodb/r/innodb-get-fk.result +++ b/mysql-test/suite/innodb/r/innodb-get-fk.result @@ -26,7 +26,8 @@ KEY `fk_crewRoleAssigned_roleCode` (`role_code`), CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB COMMENT="This is a comment about tables"; -# Restart mysqld --innodb_read_only=1 +ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only'; +ERROR HY000: Table 'crew_role_assigned' is read only SHOW CREATE TABLE `repro`.`crew_role_assigned`; Table Create Table crew_role_assigned CREATE TABLE `crew_role_assigned` ( @@ -52,7 +53,6 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` ( CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables' -# Restart mysqld --innodb_read_only=1 SHOW CREATE TABLE `repro`.`crew_role_assigned`; Table Create Table crew_role_assigned CREATE TABLE `crew_role_assigned` ( diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result index 54f8797f0cb..27909b57df8 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result @@ -10,12 +10,6 @@ call mtr.add_suppression("InnoDB: Page for tablespace "); call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS="); FLUSH TABLES; SET GLOBAL innodb_file_per_table = 1; -SELECT @@innodb_file_per_table; -@@innodb_file_per_table -1 -DROP DATABASE IF EXISTS test_wl5522; -Warnings: -Note 1008 Can't drop database 'test_wl5522'; database doesn't exist CREATE DATABASE test_wl5522; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); @@ -31,9 +25,6 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ERROR HY000: Lost connection to MySQL server during query DROP TABLE test_wl5522.t1; SET GLOBAL innodb_file_per_table = 1; -SELECT @@innodb_file_per_table; -@@innodb_file_per_table -1 CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); FLUSH TABLES test_wl5522.t1 FOR EXPORT; diff --git a/mysql-test/suite/innodb/r/innodb_bug14676111.result b/mysql-test/suite/innodb/r/innodb_bug14676111.result index eda04736cc0..d1e21c92d95 100644 --- a/mysql-test/suite/innodb/r/innodb_bug14676111.result +++ b/mysql-test/suite/innodb/r/innodb_bug14676111.result @@ -40,7 +40,7 @@ test.t1 analyze status OK select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME = 'test/t1'; CLUST_INDEX_SIZE 5 -set global innodb_limit_optimistic_insert_debug = 0; +set global innodb_limit_optimistic_insert_debug = 10000; connection con2; rollback; disconnect con2; diff --git a/mysql-test/suite/innodb/r/innodb_bug53756.result b/mysql-test/suite/innodb/r/innodb_bug53756.result index 6b44479677f..9809682a4b2 100644 --- a/mysql-test/suite/innodb/r/innodb_bug53756.result +++ b/mysql-test/suite/innodb/r/innodb_bug53756.result @@ -1,4 +1,3 @@ -DROP TABLE IF EXISTS bug_53756 ; CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB; ALTER TABLE bug_53756 ADD PRIMARY KEY (pk); INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44); @@ -76,15 +75,9 @@ pk c1 2 22 3 77 4 44 -connection default; -# -# Crash server. START TRANSACTION; INSERT INTO bug_53756 VALUES (666,666); -SET SESSION debug_dbug="+d,crash_commit_before"; -COMMIT; -ERROR HY000: Lost connection to MySQL server during query - +# Kill and restart disconnect con1; disconnect con2; disconnect con3; @@ -92,9 +85,6 @@ disconnect con4; disconnect con5; disconnect con6; # -# Restart server. - -# # Select recovered data. # Delete of row 1 was committed. # Update of row 3 was committed. @@ -106,6 +96,4 @@ pk c1 2 22 3 77 4 44 - -# Clean up. DROP TABLE bug_53756; diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index a031cfaa278..4cde68b5505 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -383,11 +383,11 @@ Warnings: Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_datafiles but the InnoDB storage engine is not installed select * from information_schema.innodb_changed_pages; select * from information_schema.innodb_tablespaces_encryption; -SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER CURRENT_KEY_ID +SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER CURRENT_KEY_ID ROTATING_OR_FLUSHING Warnings: Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_encryption but the InnoDB storage engine is not installed select * from information_schema.innodb_tablespaces_scrubbing; -SPACE NAME COMPRESSED LAST_SCRUB_COMPLETED CURRENT_SCRUB_STARTED CURRENT_SCRUB_ACTIVE_THREADS CURRENT_SCRUB_PAGE_NUMBER CURRENT_SCRUB_MAX_PAGE_NUMBER +SPACE NAME COMPRESSED LAST_SCRUB_COMPLETED CURRENT_SCRUB_STARTED CURRENT_SCRUB_ACTIVE_THREADS CURRENT_SCRUB_PAGE_NUMBER CURRENT_SCRUB_MAX_PAGE_NUMBER ROTATING_OR_FLUSHING Warnings: Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_tablespaces_scrubbing but the InnoDB storage engine is not installed select * from information_schema.innodb_mutexes; diff --git a/mysql-test/suite/innodb/t/alter_key_block_size-11757.test b/mysql-test/suite/innodb/t/alter_key_block_size-11757.test new file mode 100644 index 00000000000..c11da6e8cc5 --- /dev/null +++ b/mysql-test/suite/innodb/t/alter_key_block_size-11757.test @@ -0,0 +1,25 @@ +# +# MDEV-11757 KEY_BLOCK_SIZE strangeness when UNCOMPRESSing COMPRESSed InnoDB tables +# +source include/have_innodb.inc; + +create table t1 ( + id1 bigint(20) not null, + id2 bigint(20) not null, + primary key (id1), + unique key id2 (id2) +) engine=innodb row_format=compressed key_block_size=8; +show create table t1; +SET innodb_strict_mode=ON; +--error ER_ILLEGAL_HA_CREATE_OPTION +alter table t1 row_format=dynamic; +SET innodb_strict_mode=OFF; +alter table t1 row_format=dynamic; +show create table t1; +SET innodb_strict_mode=ON; +alter table t1 key_block_size=0; +show create table t1; +alter table t1 drop primary key, add primary key (id1), + drop key id2, add unique (id2); +show create table t1; +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-32k-crash.test b/mysql-test/suite/innodb/t/innodb-32k-crash.test index 42d2b5adc9f..c77e44ce9d6 100644 --- a/mysql-test/suite/innodb/t/innodb-32k-crash.test +++ b/mysql-test/suite/innodb/t/innodb-32k-crash.test @@ -139,6 +139,7 @@ UPDATE t2 SET qa=@l,ra=@l,sa=@l,ta=@l,ua=@l; UPDATE t2 SET va=@l,wa=@l,xa=@l,ya=@l,za=@l; COMMIT; +BEGIN; INSERT INTO t1 SELECT * from t2; BEGIN; diff --git a/mysql-test/suite/innodb/t/innodb-64k-crash.test b/mysql-test/suite/innodb/t/innodb-64k-crash.test index 39fbf974efe..78f14d539a5 100644 --- a/mysql-test/suite/innodb/t/innodb-64k-crash.test +++ b/mysql-test/suite/innodb/t/innodb-64k-crash.test @@ -299,6 +299,7 @@ UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c, ac=@c,bc=@c,cc=@c,dc=@c,ec=@c,fc=@c,gc=@c,hc=@c,ic=@c,jc=@c, kc=@c,lc=@c,mc=@c,nc=@c,oc=@c,pc=@c,qc=@c,rc=@c,sc=@c,tc=@c,uc=@c, vc=@c,wc=@c,xc=@c,yc=@c,zc=@c; + --source include/kill_and_restart_mysqld.inc UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e,f=@e,g=@e,h=@e,i=@e,j=@e, diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test index c1f9ee5992f..ea50af4a7fc 100644 --- a/mysql-test/suite/innodb/t/innodb-blob.test +++ b/mysql-test/suite/innodb/t/innodb-blob.test @@ -9,12 +9,8 @@ # DEBUG_SYNC must be compiled in. --source include/have_debug_sync.inc -# Valgrind would complain about memory leaks when we crash on purpose. ---source include/not_valgrind.inc -# Embedded server does not support crashing +# Embedded server does not support restarting --source include/not_embedded.inc -# Avoid CrashReporter popup on Mac ---source include/not_crashrep.inc call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles!"); @@ -71,12 +67,11 @@ SELECT a, RIGHT(b,20) FROM t1; SELECT a FROM t1; # Request a crash, and restart the server. -SET DEBUG='+d,crash_commit_before'; -# Write file to make mysql-test-run.pl restart the server ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---error 2013 +BEGIN; INSERT INTO t2 VALUES (42); +--source include/kill_and_restart_mysqld.inc + disconnect con1; disconnect con2; connection default; @@ -143,12 +138,7 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch'; SELECT info FROM information_schema.processlist WHERE state = 'debug sync point: before_row_upd_extern'; -# Request a crash, and restart the server. -SET DEBUG='+d,crash_commit_before'; -# Write file to make mysql-test-run.pl restart the server ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---error 2013 -COMMIT; +--source include/kill_and_restart_mysqld.inc disconnect con2; connection default; @@ -187,12 +177,7 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch'; SELECT info FROM information_schema.processlist WHERE state = 'debug sync point: after_row_upd_extern'; -# Request a crash, and restart the server. -SET DEBUG='+d,crash_commit_before'; -# Write file to make mysql-test-run.pl restart the server ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---error 2013 -COMMIT; +--source include/kill_and_restart_mysqld.inc disconnect con2; connection default; @@ -203,7 +188,6 @@ reap; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect - CHECK TABLE t1,t2,t3; SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3; SELECT a FROM t3; diff --git a/mysql-test/suite/innodb/t/innodb-get-fk.test b/mysql-test/suite/innodb/t/innodb-get-fk.test index 3e330ffeda3..339a7968623 100644 --- a/mysql-test/suite/innodb/t/innodb-get-fk.test +++ b/mysql-test/suite/innodb/t/innodb-get-fk.test @@ -33,10 +33,11 @@ CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repr CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB COMMENT="This is a comment about tables"; ---echo # Restart mysqld --innodb_read_only=1 --- let $restart_parameters=--innodb-read-only=1 +-- let $restart_parameters=--innodb-read-only -- source include/restart_mysqld.inc +--error ER_OPEN_AS_READONLY +ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only'; SHOW CREATE TABLE `repro`.`crew_role_assigned`; -- let $restart_parameters= @@ -45,8 +46,7 @@ SHOW CREATE TABLE `repro`.`crew_role_assigned`; ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables"; SHOW CREATE TABLE `repro`.`crew_role_assigned`; ---echo # Restart mysqld --innodb_read_only=1 --- let $restart_parameters=--innodb-read-only=1 +-- let $restart_parameters=--innodb-read-only -- source include/restart_mysqld.inc # diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test index b57ac62e1d8..68c5d3000cb 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test @@ -33,9 +33,7 @@ let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/; let $strerrfix=/ (\(.+\))//; SET GLOBAL innodb_file_per_table = 1; -SELECT @@innodb_file_per_table; -DROP DATABASE IF EXISTS test_wl5522; CREATE DATABASE test_wl5522; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; @@ -68,7 +66,6 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; DROP TABLE test_wl5522.t1; SET GLOBAL innodb_file_per_table = 1; -SELECT @@innodb_file_per_table; # Create the table that we will use for crash recovery (during IMPORT) CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test index c73571af6dd..c848d24294d 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14147491.test +++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test @@ -22,7 +22,6 @@ CALL mtr.add_suppression("\\[ERROR\\] \\[FATAL\\] InnoDB: Unable to read page \\ CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Database page corruption on disk or a failed"); --enable_query_log - CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=InnoDB; INSERT INTO t1 (b) VALUES ('corrupt me'); --disable_query_log @@ -94,8 +93,5 @@ SLEEP 1; --source include/start_mysqld.inc -# Note SET DEBUG = '-d,innodb_page_corruption_retries' is not required -# because the session information is lost after server restart - --echo # Cleanup DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_bug14676111.test b/mysql-test/suite/innodb/t/innodb_bug14676111.test index d8b78394cc2..3abc574a8d2 100644 --- a/mysql-test/suite/innodb/t/innodb_bug14676111.test +++ b/mysql-test/suite/innodb/t/innodb_bug14676111.test @@ -82,7 +82,7 @@ select CLUST_INDEX_SIZE from information_schema.INNODB_SYS_TABLESTATS where NAME # #disable the artificial limitation of records in a page -set global innodb_limit_optimistic_insert_debug = 0; +set global innodb_limit_optimistic_insert_debug = 10000; --connection con2 rollback; --disconnect con2 @@ -117,7 +117,6 @@ insert into t1 values (2); #current tree form # (1) # (1, 2, 3) <- lift up this level next, because the father is root - rollback; #current tree form # (1, 3) diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test index 4aee0f87746..d6bccf70147 100644 --- a/mysql-test/suite/innodb/t/innodb_bug53756.test +++ b/mysql-test/suite/innodb/t/innodb_bug53756.test @@ -6,24 +6,8 @@ # metadata in the function dict_load_table_on_id() during crash recovery. # -# innobackup needs to connect to the server. Not supported in embedded. +# The embedded server test does not support restarting. --source include/not_embedded.inc -# -# This test case needs to crash the server. Needs a debug server. ---source include/have_debug.inc -# -# Don't test this under valgrind, memory leaks will occur. ---source include/not_valgrind.inc - -# Avoid CrashReporter popup on Mac ---source include/not_crashrep.inc - -# -# Precautionary clean up. -# ---disable_warnings -DROP TABLE IF EXISTS bug_53756 ; ---enable_warnings # # Create test data. @@ -34,9 +18,6 @@ INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44); --echo --echo # Select a less restrictive isolation level. -# Don't use user variables. They won't survive server crash. ---let $global_isolation= `SELECT @@global.tx_isolation` ---let $session_isolation= `SELECT @@session.tx_isolation` SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; COMMIT; @@ -100,45 +81,16 @@ ROLLBACK; --connection default SELECT * FROM bug_53756; ---connection default ---echo # ---echo # Crash server. -# -# Write file to make mysql-test-run.pl expect the "crash", but don't start -# it until it's told to ---exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -# START TRANSACTION; INSERT INTO bug_53756 VALUES (666,666); -# -# Request a crash on next execution of commit. -SET SESSION debug_dbug="+d,crash_commit_before"; -# -# Write file to make mysql-test-run.pl start up the server again ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -# -# Execute the statement that causes the crash. ---error 2013 -COMMIT; ---echo + +--source include/kill_and_restart_mysqld.inc --disconnect con1 --disconnect con2 --disconnect con3 --disconnect con4 --disconnect con5 --disconnect con6 ---echo # ---echo # Restart server. -# -# Turn on reconnect ---enable_reconnect -# -# Call script that will poll the server waiting for it to be back online again ---source include/wait_until_connected_again.inc -# -# Turn off reconnect again ---disable_reconnect ---echo --echo # --echo # Select recovered data. @@ -149,11 +101,4 @@ COMMIT; --echo # Delete of row 2 and insert of row 5 should be rolled back SELECT * FROM bug_53756; ---echo ---echo # Clean up. DROP TABLE bug_53756; - ---disable_query_log -eval SET GLOBAL tx_isolation= '$global_isolation'; -eval SET SESSION tx_isolation= '$session_isolation'; ---enable_query_log diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_stopword_charset.result b/mysql-test/suite/innodb_fts/r/innodb_fts_stopword_charset.result index adec37c930f..c49c7f8ae6c 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_stopword_charset.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_stopword_charset.result @@ -316,6 +316,3 @@ id title 13 lòve 14 LÒVE DROP TABLE articles; -SET SESSION innodb_ft_enable_stopword=1; -SET GLOBAL innodb_ft_server_stopword_table=default; -SET SESSION innodb_ft_user_stopword_table=default; diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_stopword_charset.test b/mysql-test/suite/innodb_fts/t/innodb_fts_stopword_charset.test index 4974783b9be..16ee91c30f4 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_fts_stopword_charset.test +++ b/mysql-test/suite/innodb_fts/t/innodb_fts_stopword_charset.test @@ -2,16 +2,8 @@ -- source include/have_innodb.inc -# Valgrind would complain about memory leaks when we crash on purpose. ---source include/not_valgrind.inc -# Embedded server does not support crashing +# Embedded server tests do not support restarting --source include/not_embedded.inc -# Avoid CrashReporter popup on Mac ---source include/not_crashrep.inc - -let $innodb_ft_server_stopword_table_orig=`SELECT @@innodb_ft_server_stopword_table`; -let $innodb_ft_enable_stopword_orig=`SELECT @@innodb_ft_enable_stopword`; -let $innodb_ft_user_stopword_table_orig=`SELECT @@innodb_ft_user_stopword_table`; SELECT @@innodb_ft_server_stopword_table; SELECT @@innodb_ft_enable_stopword; @@ -414,8 +406,3 @@ SELECT * FROM articles WHERE MATCH (title) AGAINST ('love' IN NATURAL LANGUAGE MODE); DROP TABLE articles; - -# Restore Values -eval SET SESSION innodb_ft_enable_stopword=$innodb_ft_enable_stopword_orig; -eval SET GLOBAL innodb_ft_server_stopword_table=default; -eval SET SESSION innodb_ft_user_stopword_table=default; diff --git a/mysql-test/suite/parts/r/partition_bigint_innodb.result b/mysql-test/suite/parts/r/partition_bigint_innodb.result new file mode 100644 index 00000000000..c11e72d85d3 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_bigint_innodb.result @@ -0,0 +1,121 @@ +create table t1 (a bigint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) +insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); +select * from t1; +a +1 +18446744073709551612 +18446744073709551613 +18446744073709551614 +18446744073709551615 +2 +65535 +select * from t1 where a=-2; +a +delete from t1 where a=-2; +select * from t1; +a +1 +18446744073709551612 +18446744073709551613 +18446744073709551614 +18446744073709551615 +2 +65535 +select * from t1 where a=18446744073709551615; +a +18446744073709551615 +delete from t1 where a=18446744073709551615; +select * from t1; +a +1 +18446744073709551612 +18446744073709551613 +18446744073709551614 +2 +65535 +drop table t1; +create table t2 (a bigint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); +select * from t2; +a +18446744073709551612 +18446744073709551613 +18446744073709551614 +18446744073709551615 +select * from t2 where a=18446744073709551615; +a +18446744073709551615 +delete from t2 where a=18446744073709551615; +select * from t2; +a +18446744073709551612 +18446744073709551613 +18446744073709551614 +delete from t2; +1024 inserts; +select count(*) from t2; +count(*) +1024 +drop table t2; +create table t3 (a bigint not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` bigint(20) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); +select * from t3; +a +-1 +-9223372036854775807 +-9223372036854775808 +0 +1 +9223372036854775804 +9223372036854775805 +9223372036854775806 +9223372036854775807 +select * from t3 where a=9223372036854775806; +a +9223372036854775806 +delete from t3 where a=9223372036854775806; +select * from t3; +a +-1 +-9223372036854775807 +-9223372036854775808 +0 +1 +9223372036854775804 +9223372036854775805 +9223372036854775807 +drop table t3; diff --git a/mysql-test/suite/parts/r/partition_bigint_myisam.result b/mysql-test/suite/parts/r/partition_bigint_myisam.result new file mode 100644 index 00000000000..6407fdf23d6 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_bigint_myisam.result @@ -0,0 +1,121 @@ +create table t1 (a bigint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) +insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); +select * from t1; +a +1 +18446744073709551612 +18446744073709551613 +18446744073709551614 +18446744073709551615 +2 +65535 +select * from t1 where a=-2; +a +delete from t1 where a=-2; +select * from t1; +a +1 +18446744073709551612 +18446744073709551613 +18446744073709551614 +18446744073709551615 +2 +65535 +select * from t1 where a=18446744073709551615; +a +18446744073709551615 +delete from t1 where a=18446744073709551615; +select * from t1; +a +1 +18446744073709551612 +18446744073709551613 +18446744073709551614 +2 +65535 +drop table t1; +create table t2 (a bigint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); +select * from t2; +a +18446744073709551612 +18446744073709551613 +18446744073709551614 +18446744073709551615 +select * from t2 where a=18446744073709551615; +a +18446744073709551615 +delete from t2 where a=18446744073709551615; +select * from t2; +a +18446744073709551612 +18446744073709551613 +18446744073709551614 +delete from t2; +65535 inserts; +select count(*) from t2; +count(*) +65535 +drop table t2; +create table t3 (a bigint not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` bigint(20) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); +select * from t3; +a +-1 +-9223372036854775807 +-9223372036854775808 +0 +1 +9223372036854775804 +9223372036854775805 +9223372036854775806 +9223372036854775807 +select * from t3 where a=9223372036854775806; +a +9223372036854775806 +delete from t3 where a=9223372036854775806; +select * from t3; +a +-1 +-9223372036854775807 +-9223372036854775808 +0 +1 +9223372036854775804 +9223372036854775805 +9223372036854775807 +drop table t3; diff --git a/mysql-test/suite/parts/r/partition_double_innodb.result b/mysql-test/suite/parts/r/partition_double_innodb.result new file mode 100644 index 00000000000..f2618519930 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_double_innodb.result @@ -0,0 +1,82 @@ +create table t1 (a double not null, primary key(a)) engine='InnoDB' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) +insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); +select * from t1; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1.5 +1234.567 +2.2250738585072016e208 +select * from t1 where a=1.5; +a +1.5 +delete from t1 where a=1.5; +select * from t1; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1234.567 +2.2250738585072016e208 +drop table t1; +create table t2 (a double not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 10; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` double NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 10 +insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); +select * from t2; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1.5 +1234.567 +2.2250738585072016e208 +select * from t2 where a=1234.567; +a +1234.567 +delete from t2 where a=1234.567; +select * from t2; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1.5 +2.2250738585072016e208 +delete from t2; +1024*3 inserts; +select count(*) from t2; +count(*) +3072 +drop table t2; diff --git a/mysql-test/suite/parts/r/partition_double_myisam.result b/mysql-test/suite/parts/r/partition_double_myisam.result new file mode 100644 index 00000000000..b01db2f7d31 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_double_myisam.result @@ -0,0 +1,82 @@ +create table t1 (a double not null, primary key(a)) engine='MYISAM' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` double NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) +insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); +select * from t1; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1.5 +1234.567 +2.2250738585072016e208 +select * from t1 where a=1.5; +a +1.5 +delete from t1 where a=1.5; +select * from t1; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1234.567 +2.2250738585072016e208 +drop table t1; +create table t2 (a double not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 10; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` double NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 10 +insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); +select * from t2; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1.5 +1234.567 +2.2250738585072016e208 +select * from t2 where a=1234.567; +a +1234.567 +delete from t2 where a=1234.567; +select * from t2; +a +-2.2250738585072016e208 +-1.5 +-1 +-2.2250738585072014e-208 +0 +1.5 +2.2250738585072016e208 +delete from t2; +16384*3 inserts; +select count(*) from t2; +count(*) +49152 +drop table t2; diff --git a/mysql-test/suite/parts/r/partition_exch_innodb.result b/mysql-test/suite/parts/r/partition_exch_innodb.result index d444e2e3558..d444e2e3558 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_innodb.result +++ b/mysql-test/suite/parts/r/partition_exch_innodb.result diff --git a/mysql-test/suite/parts/r/partition_exch_myisam.result b/mysql-test/suite/parts/r/partition_exch_myisam.result index d444e2e3558..d444e2e3558 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_myisam.result +++ b/mysql-test/suite/parts/r/partition_exch_myisam.result diff --git a/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result b/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result index 9ff4afcfe35..9ff4afcfe35 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result +++ b/mysql-test/suite/parts/r/partition_exch_myisam_innodb.result diff --git a/mysql-test/suite/parts/r/partition_exch_qa.result b/mysql-test/suite/parts/r/partition_exch_qa.result index d444e2e3558..d444e2e3558 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_qa.result +++ b/mysql-test/suite/parts/r/partition_exch_qa.result diff --git a/mysql-test/suite/parts/r/partition_exch_qa_11.result b/mysql-test/suite/parts/r/partition_exch_qa_11.result index 2fe6c05e29c..2fe6c05e29c 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_qa_11.result +++ b/mysql-test/suite/parts/r/partition_exch_qa_11.result diff --git a/mysql-test/suite/parts/r/partition_exch_qa_14.result b/mysql-test/suite/parts/r/partition_exch_qa_14.result index f6866727184..f6866727184 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_qa_14.result +++ b/mysql-test/suite/parts/r/partition_exch_qa_14.result diff --git a/mysql-test/suite/parts/r/partition_exch_qa_3.result b/mysql-test/suite/parts/r/partition_exch_qa_3.result index 9f4043a055a..9f4043a055a 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_qa_3.result +++ b/mysql-test/suite/parts/r/partition_exch_qa_3.result diff --git a/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result index 35f3499fce7..35f3499fce7 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result +++ b/mysql-test/suite/parts/r/partition_exch_qa_4_innodb.result diff --git a/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result index 35f3499fce7..35f3499fce7 100755..100644 --- a/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result +++ b/mysql-test/suite/parts/r/partition_exch_qa_4_myisam.result diff --git a/mysql-test/suite/parts/r/partition_float_innodb.result b/mysql-test/suite/parts/r/partition_float_innodb.result index d7f6e4bb4ac..863d9bfe000 100644 --- a/mysql-test/suite/parts/r/partition_float_innodb.result +++ b/mysql-test/suite/parts/r/partition_float_innodb.result @@ -88,85 +88,3 @@ select count(*) from t2; count(*) 3072 drop table t2; -create table t1 (a double not null, primary key(a)) engine='InnoDB' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) -insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); -select * from t1; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1.5 -1234.567 -2.2250738585072016e208 -select * from t1 where a=1.5; -a -1.5 -delete from t1 where a=1.5; -select * from t1; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1234.567 -2.2250738585072016e208 -drop table t1; -create table t2 (a double not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` double NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 10 -insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); -select * from t2; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1.5 -1234.567 -2.2250738585072016e208 -select * from t2 where a=1234.567; -a -1234.567 -delete from t2 where a=1234.567; -select * from t2; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1.5 -2.2250738585072016e208 -delete from t2; -1024*3 inserts; -select count(*) from t2; -count(*) -3072 -drop table t2; diff --git a/mysql-test/suite/parts/r/partition_float_myisam.result b/mysql-test/suite/parts/r/partition_float_myisam.result index f4b57fc271a..ff77ae17b37 100644 --- a/mysql-test/suite/parts/r/partition_float_myisam.result +++ b/mysql-test/suite/parts/r/partition_float_myisam.result @@ -88,85 +88,3 @@ select count(*) from t2; count(*) 49152 drop table t2; -create table t1 (a double not null, primary key(a)) engine='MYISAM' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` double NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) -insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); -select * from t1; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1.5 -1234.567 -2.2250738585072016e208 -select * from t1 where a=1.5; -a -1.5 -delete from t1 where a=1.5; -select * from t1; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1234.567 -2.2250738585072016e208 -drop table t1; -create table t2 (a double not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` double NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 10 -insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208); -select * from t2; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1.5 -1234.567 -2.2250738585072016e208 -select * from t2 where a=1234.567; -a -1234.567 -delete from t2 where a=1234.567; -select * from t2; -a --2.2250738585072016e208 --1.5 --1 --2.2250738585072014e-208 -0 -1.5 -2.2250738585072016e208 -delete from t2; -16384*3 inserts; -select count(*) from t2; -count(*) -49152 -drop table t2; diff --git a/mysql-test/suite/parts/r/partition_int_innodb.result b/mysql-test/suite/parts/r/partition_int_innodb.result index 9556aca2a96..31a61209d4d 100644 --- a/mysql-test/suite/parts/r/partition_int_innodb.result +++ b/mysql-test/suite/parts/r/partition_int_innodb.result @@ -1,221 +1,3 @@ -create table t1 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) -insert into t1 values (255), (254), (253), (252), (1), (2), (128); -select * from t1; -a -1 -128 -2 -252 -253 -254 -255 -select * from t1 where a=253; -a -253 -delete from t1 where a=253; -select * from t1; -a -1 -128 -2 -252 -254 -255 -drop table t1; -create table t2 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (255), (254), (253), (252); -select * from t2; -a -252 -253 -254 -255 -select * from t2 where a=253; -a -253 -delete from t2 where a=253; -select * from t2; -a -252 -254 -255 -delete from t2; -255 inserts; -select count(*) from t2; -count(*) -255 -drop table t2; -create table t3 (a tinyint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` tinyint(4) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); -select * from t3; -a --1 --127 --128 -0 -1 -124 -125 -126 -127 -select * from t3 where a=125; -a -125 -delete from t3 where a=125; -select * from t3; -a --1 --127 --128 -0 -1 -124 -126 -127 -drop table t3; -create table t1 (a smallint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) -insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); -select * from t1; -a -1 -2 -256 -65532 -65533 -65534 -65535 -select * from t1 where a=65533; -a -65533 -delete from t1 where a=65533; -select * from t1; -a -1 -2 -256 -65532 -65534 -65535 -drop table t1; -create table t2 (a smallint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (65535), (65534), (65533), (65532); -select * from t2; -a -65532 -65533 -65534 -65535 -select * from t2 where a=65533; -a -65533 -delete from t2 where a=65533; -select * from t2; -a -65532 -65534 -65535 -delete from t2; -1024 inserts; -select count(*) from t2; -count(*) -1024 -drop table t2; -create table t3 (a smallint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` smallint(6) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); -select * from t3; -a --1 --32767 --32768 -0 -1 -32764 -32765 -32766 -32767 -select * from t3 where a=32765; -a -32765 -delete from t3 where a=32765; -select * from t3; -a --1 --32767 --32768 -0 -1 -32764 -32766 -32767 -drop table t3; create table t1 (a int unsigned not null, primary key(a)) engine='InnoDB' partition by key (a) ( partition pa1 max_rows=20 min_rows=2, @@ -325,233 +107,3 @@ a 2147483646 2147483647 drop table t3; -create table t1 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` mediumint(8) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) -insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); -select * from t1; -a -1 -16777212 -16777213 -16777214 -16777215 -2 -65535 -select * from t1 where a=16777213; -a -16777213 -delete from t1 where a=16777213; -select * from t1; -a -1 -16777212 -16777214 -16777215 -2 -65535 -drop table t1; -create table t2 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` mediumint(8) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (16777215), (16777214), (16777213), (16777212); -select * from t2; -a -16777212 -16777213 -16777214 -16777215 -select * from t2 where a=16777213; -a -16777213 -delete from t2 where a=16777213; -select * from t2; -a -16777212 -16777214 -16777215 -delete from t2; -1024 inserts; -select count(*) from t2; -count(*) -1024 -drop table t2; -create table t3 (a mediumint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` mediumint(9) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); -select * from t3; -a --1 --8388607 --8388608 -0 -1 -8388604 -8388605 -8388606 -8388607 -select * from t3 where a=8388605; -a -8388605 -delete from t3 where a=8388605; -select * from t3; -a --1 --8388607 --8388608 -0 -1 -8388604 -8388606 -8388607 -drop table t3; -create table t1 (a bigint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) -insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); -select * from t1; -a -1 -18446744073709551612 -18446744073709551613 -18446744073709551614 -18446744073709551615 -2 -65535 -select * from t1 where a=-2; -a -delete from t1 where a=-2; -select * from t1; -a -1 -18446744073709551612 -18446744073709551613 -18446744073709551614 -18446744073709551615 -2 -65535 -select * from t1 where a=18446744073709551615; -a -18446744073709551615 -delete from t1 where a=18446744073709551615; -select * from t1; -a -1 -18446744073709551612 -18446744073709551613 -18446744073709551614 -2 -65535 -drop table t1; -create table t2 (a bigint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); -select * from t2; -a -18446744073709551612 -18446744073709551613 -18446744073709551614 -18446744073709551615 -select * from t2 where a=18446744073709551615; -a -18446744073709551615 -delete from t2 where a=18446744073709551615; -select * from t2; -a -18446744073709551612 -18446744073709551613 -18446744073709551614 -delete from t2; -1024 inserts; -select count(*) from t2; -count(*) -1024 -drop table t2; -create table t3 (a bigint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` bigint(20) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); -select * from t3; -a --1 --9223372036854775807 --9223372036854775808 -0 -1 -9223372036854775804 -9223372036854775805 -9223372036854775806 -9223372036854775807 -select * from t3 where a=9223372036854775806; -a -9223372036854775806 -delete from t3 where a=9223372036854775806; -select * from t3; -a --1 --9223372036854775807 --9223372036854775808 -0 -1 -9223372036854775804 -9223372036854775805 -9223372036854775807 -drop table t3; diff --git a/mysql-test/suite/parts/r/partition_int_myisam.result b/mysql-test/suite/parts/r/partition_int_myisam.result index 9eaa98af38f..813d4b20e1a 100644 --- a/mysql-test/suite/parts/r/partition_int_myisam.result +++ b/mysql-test/suite/parts/r/partition_int_myisam.result @@ -1,221 +1,3 @@ -create table t1 (a tinyint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) -insert into t1 values (255), (254), (253), (252), (1), (2), (128); -select * from t1; -a -1 -128 -2 -252 -253 -254 -255 -select * from t1 where a=253; -a -253 -delete from t1 where a=253; -select * from t1; -a -1 -128 -2 -252 -254 -255 -drop table t1; -create table t2 (a tinyint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` tinyint(3) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (255), (254), (253), (252); -select * from t2; -a -252 -253 -254 -255 -select * from t2 where a=253; -a -253 -delete from t2 where a=253; -select * from t2; -a -252 -254 -255 -delete from t2; -255 inserts; -select count(*) from t2; -count(*) -255 -drop table t2; -create table t3 (a tinyint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` tinyint(4) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); -select * from t3; -a --1 --127 --128 -0 -1 -124 -125 -126 -127 -select * from t3 where a=125; -a -125 -delete from t3 where a=125; -select * from t3; -a --1 --127 --128 -0 -1 -124 -126 -127 -drop table t3; -create table t1 (a smallint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) -insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); -select * from t1; -a -1 -2 -256 -65532 -65533 -65534 -65535 -select * from t1 where a=65533; -a -65533 -delete from t1 where a=65533; -select * from t1; -a -1 -2 -256 -65532 -65534 -65535 -drop table t1; -create table t2 (a smallint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (65535), (65534), (65533), (65532); -select * from t2; -a -65532 -65533 -65534 -65535 -select * from t2 where a=65533; -a -65533 -delete from t2 where a=65533; -select * from t2; -a -65532 -65534 -65535 -delete from t2; -65535 inserts; -select count(*) from t2; -count(*) -65535 -drop table t2; -create table t3 (a smallint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` smallint(6) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); -select * from t3; -a --1 --32767 --32768 -0 -1 -32764 -32765 -32766 -32767 -select * from t3 where a=32765; -a -32765 -delete from t3 where a=32765; -select * from t3; -a --1 --32767 --32768 -0 -1 -32764 -32766 -32767 -drop table t3; create table t1 (a int unsigned not null, primary key(a)) engine='MYISAM' partition by key (a) ( partition pa1 max_rows=20 min_rows=2, @@ -325,233 +107,3 @@ a 2147483646 2147483647 drop table t3; -create table t1 (a mediumint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` mediumint(8) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) -insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); -select * from t1; -a -1 -16777212 -16777213 -16777214 -16777215 -2 -65535 -select * from t1 where a=16777213; -a -16777213 -delete from t1 where a=16777213; -select * from t1; -a -1 -16777212 -16777214 -16777215 -2 -65535 -drop table t1; -create table t2 (a mediumint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` mediumint(8) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (16777215), (16777214), (16777213), (16777212); -select * from t2; -a -16777212 -16777213 -16777214 -16777215 -select * from t2 where a=16777213; -a -16777213 -delete from t2 where a=16777213; -select * from t2; -a -16777212 -16777214 -16777215 -delete from t2; -65535 inserts; -select count(*) from t2; -count(*) -65535 -drop table t2; -create table t3 (a mediumint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` mediumint(9) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); -select * from t3; -a --1 --8388607 --8388608 -0 -1 -8388604 -8388605 -8388606 -8388607 -select * from t3 where a=8388605; -a -8388605 -delete from t3 where a=8388605; -select * from t3; -a --1 --8388607 --8388608 -0 -1 -8388604 -8388606 -8388607 -drop table t3; -create table t1 (a bigint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) ( -partition pa1 max_rows=20 min_rows=2, -partition pa2 max_rows=30 min_rows=3, -partition pa3 max_rows=30 min_rows=4, -partition pa4 max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) -insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); -select * from t1; -a -1 -18446744073709551612 -18446744073709551613 -18446744073709551614 -18446744073709551615 -2 -65535 -select * from t1 where a=-2; -a -delete from t1 where a=-2; -select * from t1; -a -1 -18446744073709551612 -18446744073709551613 -18446744073709551614 -18446744073709551615 -2 -65535 -select * from t1 where a=18446744073709551615; -a -18446744073709551615 -delete from t1 where a=18446744073709551615; -select * from t1; -a -1 -18446744073709551612 -18446744073709551613 -18446744073709551614 -2 -65535 -drop table t1; -create table t2 (a bigint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 8; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 8 -insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); -select * from t2; -a -18446744073709551612 -18446744073709551613 -18446744073709551614 -18446744073709551615 -select * from t2 where a=18446744073709551615; -a -18446744073709551615 -delete from t2 where a=18446744073709551615; -select * from t2; -a -18446744073709551612 -18446744073709551613 -18446744073709551614 -delete from t2; -65535 inserts; -select count(*) from t2; -count(*) -65535 -drop table t2; -create table t3 (a bigint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 7; -show create table t3; -Table Create Table -t3 CREATE TABLE `t3` ( - `a` bigint(20) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - PARTITION BY KEY (a) -PARTITIONS 7 -insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); -select * from t3; -a --1 --9223372036854775807 --9223372036854775808 -0 -1 -9223372036854775804 -9223372036854775805 -9223372036854775806 -9223372036854775807 -select * from t3 where a=9223372036854775806; -a -9223372036854775806 -delete from t3 where a=9223372036854775806; -select * from t3; -a --1 --9223372036854775807 --9223372036854775808 -0 -1 -9223372036854775804 -9223372036854775805 -9223372036854775807 -drop table t3; diff --git a/mysql-test/suite/parts/r/partition_mediumint_innodb.result b/mysql-test/suite/parts/r/partition_mediumint_innodb.result new file mode 100644 index 00000000000..3e04cf23754 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mediumint_innodb.result @@ -0,0 +1,109 @@ +create table t1 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) +insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); +select * from t1; +a +1 +16777212 +16777213 +16777214 +16777215 +2 +65535 +select * from t1 where a=16777213; +a +16777213 +delete from t1 where a=16777213; +select * from t1; +a +1 +16777212 +16777214 +16777215 +2 +65535 +drop table t1; +create table t2 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (16777215), (16777214), (16777213), (16777212); +select * from t2; +a +16777212 +16777213 +16777214 +16777215 +select * from t2 where a=16777213; +a +16777213 +delete from t2 where a=16777213; +select * from t2; +a +16777212 +16777214 +16777215 +delete from t2; +1024 inserts; +select count(*) from t2; +count(*) +1024 +drop table t2; +create table t3 (a mediumint not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` mediumint(9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); +select * from t3; +a +-1 +-8388607 +-8388608 +0 +1 +8388604 +8388605 +8388606 +8388607 +select * from t3 where a=8388605; +a +8388605 +delete from t3 where a=8388605; +select * from t3; +a +-1 +-8388607 +-8388608 +0 +1 +8388604 +8388606 +8388607 +drop table t3; diff --git a/mysql-test/suite/parts/r/partition_mediumint_myisam.result b/mysql-test/suite/parts/r/partition_mediumint_myisam.result new file mode 100644 index 00000000000..21e2d29ea14 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_mediumint_myisam.result @@ -0,0 +1,109 @@ +create table t1 (a mediumint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) +insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); +select * from t1; +a +1 +16777212 +16777213 +16777214 +16777215 +2 +65535 +select * from t1 where a=16777213; +a +16777213 +delete from t1 where a=16777213; +select * from t1; +a +1 +16777212 +16777214 +16777215 +2 +65535 +drop table t1; +create table t2 (a mediumint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (16777215), (16777214), (16777213), (16777212); +select * from t2; +a +16777212 +16777213 +16777214 +16777215 +select * from t2 where a=16777213; +a +16777213 +delete from t2 where a=16777213; +select * from t2; +a +16777212 +16777214 +16777215 +delete from t2; +65535 inserts; +select count(*) from t2; +count(*) +65535 +drop table t2; +create table t3 (a mediumint not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` mediumint(9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); +select * from t3; +a +-1 +-8388607 +-8388608 +0 +1 +8388604 +8388605 +8388606 +8388607 +select * from t3 where a=8388605; +a +8388605 +delete from t3 where a=8388605; +select * from t3; +a +-1 +-8388607 +-8388608 +0 +1 +8388604 +8388606 +8388607 +drop table t3; diff --git a/mysql-test/suite/parts/r/partition_smallint_innodb.result b/mysql-test/suite/parts/r/partition_smallint_innodb.result new file mode 100644 index 00000000000..baf9255bae1 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_smallint_innodb.result @@ -0,0 +1,109 @@ +create table t1 (a smallint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) +insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); +select * from t1; +a +1 +2 +256 +65532 +65533 +65534 +65535 +select * from t1 where a=65533; +a +65533 +delete from t1 where a=65533; +select * from t1; +a +1 +2 +256 +65532 +65534 +65535 +drop table t1; +create table t2 (a smallint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (65535), (65534), (65533), (65532); +select * from t2; +a +65532 +65533 +65534 +65535 +select * from t2 where a=65533; +a +65533 +delete from t2 where a=65533; +select * from t2; +a +65532 +65534 +65535 +delete from t2; +1024 inserts; +select count(*) from t2; +count(*) +1024 +drop table t2; +create table t3 (a smallint not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` smallint(6) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); +select * from t3; +a +-1 +-32767 +-32768 +0 +1 +32764 +32765 +32766 +32767 +select * from t3 where a=32765; +a +32765 +delete from t3 where a=32765; +select * from t3; +a +-1 +-32767 +-32768 +0 +1 +32764 +32766 +32767 +drop table t3; diff --git a/mysql-test/suite/parts/r/partition_smallint_myisam.result b/mysql-test/suite/parts/r/partition_smallint_myisam.result new file mode 100644 index 00000000000..57a5dbe67a7 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_smallint_myisam.result @@ -0,0 +1,109 @@ +create table t1 (a smallint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) +insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); +select * from t1; +a +1 +2 +256 +65532 +65533 +65534 +65535 +select * from t1 where a=65533; +a +65533 +delete from t1 where a=65533; +select * from t1; +a +1 +2 +256 +65532 +65534 +65535 +drop table t1; +create table t2 (a smallint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (65535), (65534), (65533), (65532); +select * from t2; +a +65532 +65533 +65534 +65535 +select * from t2 where a=65533; +a +65533 +delete from t2 where a=65533; +select * from t2; +a +65532 +65534 +65535 +delete from t2; +65535 inserts; +select count(*) from t2; +count(*) +65535 +drop table t2; +create table t3 (a smallint not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` smallint(6) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); +select * from t3; +a +-1 +-32767 +-32768 +0 +1 +32764 +32765 +32766 +32767 +select * from t3 where a=32765; +a +32765 +delete from t3 where a=32765; +select * from t3; +a +-1 +-32767 +-32768 +0 +1 +32764 +32766 +32767 +drop table t3; diff --git a/mysql-test/suite/parts/r/partition_tinyint_innodb.result b/mysql-test/suite/parts/r/partition_tinyint_innodb.result new file mode 100644 index 00000000000..a607b29a78a --- /dev/null +++ b/mysql-test/suite/parts/r/partition_tinyint_innodb.result @@ -0,0 +1,109 @@ +create table t1 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = InnoDB, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = InnoDB, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = InnoDB, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = InnoDB) +insert into t1 values (255), (254), (253), (252), (1), (2), (128); +select * from t1; +a +1 +128 +2 +252 +253 +254 +255 +select * from t1 where a=253; +a +253 +delete from t1 where a=253; +select * from t1; +a +1 +128 +2 +252 +254 +255 +drop table t1; +create table t2 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (255), (254), (253), (252); +select * from t2; +a +252 +253 +254 +255 +select * from t2 where a=253; +a +253 +delete from t2 where a=253; +select * from t2; +a +252 +254 +255 +delete from t2; +255 inserts; +select count(*) from t2; +count(*) +255 +drop table t2; +create table t3 (a tinyint not null, primary key(a)) engine='InnoDB' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` tinyint(4) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); +select * from t3; +a +-1 +-127 +-128 +0 +1 +124 +125 +126 +127 +select * from t3 where a=125; +a +125 +delete from t3 where a=125; +select * from t3; +a +-1 +-127 +-128 +0 +1 +124 +126 +127 +drop table t3; diff --git a/mysql-test/suite/parts/r/partition_tinyint_myisam.result b/mysql-test/suite/parts/r/partition_tinyint_myisam.result new file mode 100644 index 00000000000..dded4068b11 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_tinyint_myisam.result @@ -0,0 +1,109 @@ +create table t1 (a tinyint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) ( +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = MyISAM, + PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = MyISAM, + PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = MyISAM, + PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = MyISAM) +insert into t1 values (255), (254), (253), (252), (1), (2), (128); +select * from t1; +a +1 +128 +2 +252 +253 +254 +255 +select * from t1 where a=253; +a +253 +delete from t1 where a=253; +select * from t1; +a +1 +128 +2 +252 +254 +255 +drop table t1; +create table t2 (a tinyint unsigned not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 8; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 8 +insert into t2 values (255), (254), (253), (252); +select * from t2; +a +252 +253 +254 +255 +select * from t2 where a=253; +a +253 +delete from t2 where a=253; +select * from t2; +a +252 +254 +255 +delete from t2; +255 inserts; +select count(*) from t2; +count(*) +255 +drop table t2; +create table t3 (a tinyint not null, primary key(a)) engine='MYISAM' +partition by key (a) partitions 7; +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` tinyint(4) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + PARTITION BY KEY (a) +PARTITIONS 7 +insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); +select * from t3; +a +-1 +-127 +-128 +0 +1 +124 +125 +126 +127 +select * from t3 where a=125; +a +125 +delete from t3 where a=125; +select * from t3; +a +-1 +-127 +-128 +0 +1 +124 +126 +127 +drop table t3; diff --git a/mysql-test/suite/parts/t/partition_bigint_innodb.test b/mysql-test/suite/parts/t/partition_bigint_innodb.test new file mode 100644 index 00000000000..348ee0add05 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_bigint_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_bigint_innodb.test # +# # +# Purpose: # +# Tests around integer type # +# INNODB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_innodb # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +##### max rows to be inserted +let $maxrows=1024; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_bigint.inc diff --git a/mysql-test/suite/parts/t/partition_bigint_myisam.test b/mysql-test/suite/parts/t/partition_bigint_myisam.test new file mode 100644 index 00000000000..f427ffce08d --- /dev/null +++ b/mysql-test/suite/parts/t/partition_bigint_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_bigint_myisam.test # +# # +# Purpose: # +# Tests around integer type # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_myisam # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +--source include/long_test.inc + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +let $engine= 'MYISAM'; +##### number of rows to be inserted +let $maxrows=65535; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_bigint.inc diff --git a/mysql-test/suite/parts/t/partition_double_innodb.test b/mysql-test/suite/parts/t/partition_double_innodb.test new file mode 100644 index 00000000000..e31f7049502 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_double_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_double_innodb.test # +# # +# Purpose: # +# Tests around float type # +# INNODB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_float_innodb # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +##### Number of row to be inserted. +let $maxrows=1024; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_double.inc diff --git a/mysql-test/suite/parts/t/partition_double_myisam.test b/mysql-test/suite/parts/t/partition_double_myisam.test new file mode 100644 index 00000000000..6228d657c48 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_double_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_double_myisam.test # +# # +# Purpose: # +# Tests around float type # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_float_myisam # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +--source include/long_test.inc + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +let $engine= 'MYISAM'; +##### Number of row to be inserted. +let $maxrows=16384; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_double.inc diff --git a/mysql-test/suite/parts/t/partition_float_innodb.test b/mysql-test/suite/parts/t/partition_float_innodb.test index 2f1fe723dad..8d96eafbb06 100644 --- a/mysql-test/suite/parts/t/partition_float_innodb.test +++ b/mysql-test/suite/parts/t/partition_float_innodb.test @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: HH # # Original Date: 2006-08-01 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test for double type has been spawned into a separate test file # ################################################################################ # @@ -44,4 +44,3 @@ let $maxrows=1024; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_float.inc ---source suite/parts/inc/partition_double.inc diff --git a/mysql-test/suite/parts/t/partition_float_myisam.test b/mysql-test/suite/parts/t/partition_float_myisam.test index f15e6ad3636..bdc0edd41bb 100644 --- a/mysql-test/suite/parts/t/partition_float_myisam.test +++ b/mysql-test/suite/parts/t/partition_float_myisam.test @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: HH # # Original Date: 2006-08-01 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test for double type has been spawned into a separate test file # ################################################################################ # @@ -44,4 +44,3 @@ let $maxrows=16384; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_float.inc ---source suite/parts/inc/partition_double.inc diff --git a/mysql-test/suite/parts/t/partition_int_innodb.test b/mysql-test/suite/parts/t/partition_int_innodb.test index 698a2c93c22..fd00e6a0d80 100644 --- a/mysql-test/suite/parts/t/partition_int_innodb.test +++ b/mysql-test/suite/parts/t/partition_int_innodb.test @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: HH # # Original Date: 2006-08-01 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: Int subtypes (tinyint etc.) have been spawned into separate tests # ################################################################################ # @@ -43,8 +43,4 @@ let $maxrows=1024; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines ---source suite/parts/inc/partition_tinyint.inc ---source suite/parts/inc/partition_smallint.inc --source suite/parts/inc/partition_int.inc ---source suite/parts/inc/partition_mediumint.inc ---source suite/parts/inc/partition_bigint.inc diff --git a/mysql-test/suite/parts/t/partition_int_myisam.test b/mysql-test/suite/parts/t/partition_int_myisam.test index 5f29b575244..e8de09f1bf3 100644 --- a/mysql-test/suite/parts/t/partition_int_myisam.test +++ b/mysql-test/suite/parts/t/partition_int_myisam.test @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: HH # # Original Date: 2006-08-01 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: Int subtypes (tinyint etc.) have been spawned into separate tests # ################################################################################ # @@ -43,8 +43,4 @@ let $maxrows=65535; #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines ---source suite/parts/inc/partition_tinyint.inc ---source suite/parts/inc/partition_smallint.inc --source suite/parts/inc/partition_int.inc ---source suite/parts/inc/partition_mediumint.inc ---source suite/parts/inc/partition_bigint.inc diff --git a/mysql-test/suite/parts/t/partition_mediumint_innodb.test b/mysql-test/suite/parts/t/partition_mediumint_innodb.test new file mode 100644 index 00000000000..9218b55fa78 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mediumint_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_mediumint_innodb.test # +# # +# Purpose: # +# Tests around integer type # +# INNODB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_innodb # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +##### max rows to be inserted +let $maxrows=1024; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mediumint.inc diff --git a/mysql-test/suite/parts/t/partition_mediumint_myisam.test b/mysql-test/suite/parts/t/partition_mediumint_myisam.test new file mode 100644 index 00000000000..bbf1775ba97 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_mediumint_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_mediumint_myisam.test # +# # +# Purpose: # +# Tests around integer type # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_myisam # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +--source include/long_test.inc + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +let $engine= 'MYISAM'; +##### number of rows to be inserted +let $maxrows=65535; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_mediumint.inc diff --git a/mysql-test/suite/parts/t/partition_smallint_innodb.test b/mysql-test/suite/parts/t/partition_smallint_innodb.test new file mode 100644 index 00000000000..22d16cf9d55 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_smallint_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_smallint_innodb.test # +# # +# Purpose: # +# Tests around integer type # +# INNODB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_innodb # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +##### max rows to be inserted +let $maxrows=1024; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_smallint.inc diff --git a/mysql-test/suite/parts/t/partition_smallint_myisam.test b/mysql-test/suite/parts/t/partition_smallint_myisam.test new file mode 100644 index 00000000000..f473a6772f8 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_smallint_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_smallint_myisam.test # +# # +# Purpose: # +# Tests around integer type # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_myisam # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +--source include/long_test.inc + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +let $engine= 'MYISAM'; +##### number of rows to be inserted +let $maxrows=65535; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_smallint.inc diff --git a/mysql-test/suite/parts/t/partition_tinyint_innodb.test b/mysql-test/suite/parts/t/partition_tinyint_innodb.test new file mode 100644 index 00000000000..aec10c1aea5 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_tinyint_innodb.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_tinyint_innodb.test # +# # +# Purpose: # +# Tests around integer type # +# INNODB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_innodb # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +##### max rows to be inserted +let $maxrows=1024; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_tinyint.inc diff --git a/mysql-test/suite/parts/t/partition_tinyint_myisam.test b/mysql-test/suite/parts/t/partition_tinyint_myisam.test new file mode 100644 index 00000000000..9807bffb1da --- /dev/null +++ b/mysql-test/suite/parts/t/partition_tinyint_myisam.test @@ -0,0 +1,46 @@ +################################################################################ +# t/partition_tinyint_myisam.test # +# # +# Purpose: # +# Tests around integer type # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: HH # +# Original Date: 2006-08-01 # +# Change Author: Elena Stepanova # +# Change Date: 2017-02-18 # +# Change: The test file is spawned from the mega-test partition_int_myisam # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +--source include/long_test.inc + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; + +# The server must support partitioning. +--source include/have_partition.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +let $engine= 'MYISAM'; +##### number of rows to be inserted +let $maxrows=65535; + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_tinyint.inc diff --git a/mysql-test/suite/perfschema/include/pfs_no_running_event_scheduler.inc b/mysql-test/suite/perfschema/include/pfs_no_running_event_scheduler.inc new file mode 100644 index 00000000000..eff3d7df854 --- /dev/null +++ b/mysql-test/suite/perfschema/include/pfs_no_running_event_scheduler.inc @@ -0,0 +1,10 @@ +# threads are removed from: +# - information_schema.processlist +# - performance_schema.threads +# at different times, so we may have to wait a little more +# for the event_scheduler to shutdown +# +let $wait_condition= + SELECT COUNT(*) = 0 FROM performance_schema.threads + WHERE name like 'thread/sql/event%'; +--source include/wait_condition.inc diff --git a/mysql-test/suite/perfschema/include/pfs_running_event_scheduler.inc b/mysql-test/suite/perfschema/include/pfs_running_event_scheduler.inc new file mode 100644 index 00000000000..219a41051fb --- /dev/null +++ b/mysql-test/suite/perfschema/include/pfs_running_event_scheduler.inc @@ -0,0 +1,10 @@ +# threads are removed from: +# - information_schema.processlist +# - performance_schema.threads +# at different times, so we may have to wait a little more +# for the event_scheduler to shutdown +# +let $wait_condition= + SELECT COUNT(*) = 1 FROM performance_schema.threads + WHERE name like 'thread/sql/event%'; +--source include/wait_condition.inc diff --git a/mysql-test/suite/perfschema/include/table_io_result_helper.inc b/mysql-test/suite/perfschema/include/table_io_result_helper.inc index 789f7135a1a..4732806488e 100644 --- a/mysql-test/suite/perfschema/include/table_io_result_helper.inc +++ b/mysql-test/suite/perfschema/include/table_io_result_helper.inc @@ -14,7 +14,8 @@ eval select event_name, order by thread_id, event_id; # In case of failures, this will tell if table io are lost. -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and + Variable_name not like 'performance_schema_%_classes_lost'; # Cleanup truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc index 327d63cc633..79a81311b05 100644 --- a/mysql-test/suite/perfschema/include/upgrade_check.inc +++ b/mysql-test/suite/perfschema/include/upgrade_check.inc @@ -3,15 +3,14 @@ # --source include/count_sessions.inc ---exec $MYSQL_UPGRADE --skip-verbose --force > $out_file 2> $err_file +--exec $MYSQL_UPGRADE --skip-verbose --force > $MYSQLTEST_VARDIR/tmp/out_file 2> $MYSQLTEST_VARDIR/tmp/err_file --source include/wait_until_count_sessions.inc # Verify that mysql_upgrade does not complain about the performance_schema --replace_regex /at line [0-9]+/at line ###/ ---cat_file $err_file ---error 0,1 ---remove_file $out_file ---error 0,1 ---remove_file $err_file +--cat_file $MYSQLTEST_VARDIR/tmp/err_file +--remove_file $MYSQLTEST_VARDIR/tmp/out_file +--remove_file $MYSQLTEST_VARDIR/tmp/err_file +--remove_file $MYSQLD_DATADIR/mysql_upgrade_info diff --git a/mysql-test/suite/perfschema/r/csv_table_io.result b/mysql-test/suite/perfschema/r/csv_table_io.result index f0b5a6bb935..84b39119dd8 100644 --- a/mysql-test/suite/perfschema/r/csv_table_io.result +++ b/mysql-test/suite/perfschema/r/csv_table_io.result @@ -111,29 +111,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/innodb_table_io.result b/mysql-test/suite/perfschema/r/innodb_table_io.result index 460518aeb65..c37c1035e5a 100644 --- a/mysql-test/suite/perfschema/r/innodb_table_io.result +++ b/mysql-test/suite/perfschema/r/innodb_table_io.result @@ -112,29 +112,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/memory_table_io.result b/mysql-test/suite/perfschema/r/memory_table_io.result index 230de713846..7942015f618 100644 --- a/mysql-test/suite/perfschema/r/memory_table_io.result +++ b/mysql-test/suite/perfschema/r/memory_table_io.result @@ -113,29 +113,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/merge_table_io.result b/mysql-test/suite/perfschema/r/merge_table_io.result index 7f0b602778c..d390ba67b5f 100644 --- a/mysql-test/suite/perfschema/r/merge_table_io.result +++ b/mysql-test/suite/perfschema/r/merge_table_io.result @@ -143,29 +143,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/multi_table_io.result b/mysql-test/suite/perfschema/r/multi_table_io.result index 74c8b94c1d5..929e1791c61 100644 --- a/mysql-test/suite/perfschema/r/multi_table_io.result +++ b/mysql-test/suite/perfschema/r/multi_table_io.result @@ -72,29 +72,22 @@ wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL wait/io/table/sql/handler handler.cc: TABLE test t1 delete NULL wait/io/table/sql/handler handler.cc: TABLE test1 t2 fetch NULL wait/io/table/sql/handler handler.cc: TABLE test1 t2 delete NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/myisam_table_io.result b/mysql-test/suite/perfschema/r/myisam_table_io.result index 432e5964802..97a099581d4 100644 --- a/mysql-test/suite/perfschema/r/myisam_table_io.result +++ b/mysql-test/suite/perfschema/r/myisam_table_io.result @@ -111,29 +111,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/part_table_io.result b/mysql-test/suite/perfschema/r/part_table_io.result index 0fd8653734d..1958801d8d2 100644 --- a/mysql-test/suite/perfschema/r/part_table_io.result +++ b/mysql-test/suite/perfschema/r/part_table_io.result @@ -113,29 +113,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result index 6397ef7d90c..2bcebe06e96 100644 --- a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result +++ b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result @@ -1,4 +1,3 @@ -drop event if exists test.user_event; "Testing mysql_upgrade with EVENT performance_schema.user_event" create event test.user_event on schedule every 1 day do select "not supposed to be here"; diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result index e03b526b045..b91cb5d14a8 100644 --- a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result +++ b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result @@ -1,4 +1,3 @@ -drop function if exists test.user_func; "Testing mysql_upgrade with FUNCTION performance_schema.user_func" create function test.user_func() returns integer return 0; diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result index 95e0943d326..651bc506eee 100644 --- a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result +++ b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result @@ -1,4 +1,3 @@ -drop procedure if exists test.user_proc; "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc" create procedure test.user_proc() select "Not supposed to be here"; diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result index a5f5ad5ae17..5ff608a825f 100644 --- a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result +++ b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result @@ -1,4 +1,3 @@ -drop table if exists test.user_table; "Testing mysql_upgrade with TABLE performance_schema.user_table" create table test.user_table(a int); use performance_schema; diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result index 3c6df20a62c..14a1d8deae4 100644 --- a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result +++ b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result @@ -1,4 +1,3 @@ -drop view if exists test.user_view; "Testing mysql_upgrade with VIEW performance_schema.user_view" create view test.user_view as select "Not supposed to be here"; use performance_schema; diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index aeacd0ba011..ea5fb2bc703 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -114,29 +114,22 @@ wait/io/table/sql/handler handler.cc: TABLE mysql servers fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/rollback_table_io.result b/mysql-test/suite/perfschema/r/rollback_table_io.result index f08d11e21d8..a9cc5b1da39 100644 --- a/mysql-test/suite/perfschema/r/rollback_table_io.result +++ b/mysql-test/suite/perfschema/r/rollback_table_io.result @@ -54,29 +54,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test t1 insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/temp_table_io.result b/mysql-test/suite/perfschema/r/temp_table_io.result index c5de365dbf4..0e1bf01ef9a 100644 --- a/mysql-test/suite/perfschema/r/temp_table_io.result +++ b/mysql-test/suite/perfschema/r/temp_table_io.result @@ -84,29 +84,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/trigger_table_io.result b/mysql-test/suite/perfschema/r/trigger_table_io.result index e77e7d864f1..9fc63e69675 100644 --- a/mysql-test/suite/perfschema/r/trigger_table_io.result +++ b/mysql-test/suite/perfschema/r/trigger_table_io.result @@ -169,29 +169,22 @@ wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL wait/io/table/sql/handler handler.cc: TABLE test t2 fetch NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/r/view_table_io.result b/mysql-test/suite/perfschema/r/view_table_io.result index db6acf65c73..5d8ad26ae77 100644 --- a/mysql-test/suite/perfschema/r/view_table_io.result +++ b/mysql-test/suite/perfschema/r/view_table_io.result @@ -120,29 +120,22 @@ wait/io/table/sql/handler handler.cc: TABLE test no_index_tab fetch NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL wait/io/table/sql/handler handler.cc: TABLE test marker insert NULL -show status like 'performance_schema_%'; +show status where Variable_name like 'performance_schema_%' and +Variable_name not like 'performance_schema_%_classes_lost'; Variable_name Value Performance_schema_accounts_lost 0 -Performance_schema_cond_classes_lost 0 Performance_schema_cond_instances_lost 0 Performance_schema_digest_lost 0 -Performance_schema_file_classes_lost 0 Performance_schema_file_handles_lost 0 Performance_schema_file_instances_lost 0 Performance_schema_hosts_lost 0 Performance_schema_locker_lost 0 -Performance_schema_mutex_classes_lost 0 Performance_schema_mutex_instances_lost 0 -Performance_schema_rwlock_classes_lost 0 Performance_schema_rwlock_instances_lost 0 Performance_schema_session_connect_attrs_lost 0 -Performance_schema_socket_classes_lost 0 Performance_schema_socket_instances_lost 0 -Performance_schema_stage_classes_lost 0 -Performance_schema_statement_classes_lost 0 Performance_schema_table_handles_lost 0 Performance_schema_table_instances_lost 0 -Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 truncate performance_schema.events_waits_history_long; diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_event.test b/mysql-test/suite/perfschema/t/pfs_upgrade_event.test index db7613052d4..f16a073f212 100644 --- a/mysql-test/suite/perfschema/t/pfs_upgrade_event.test +++ b/mysql-test/suite/perfschema/t/pfs_upgrade_event.test @@ -7,18 +7,7 @@ --source include/have_perfschema.inc --source include/have_innodb.inc -# Some initial settings + Preemptive cleanup let $MYSQLD_DATADIR= `SELECT @@datadir`; -let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_event.err; -let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_event.out; ---error 0,1 ---remove_file $out_file ---error 0,1 ---remove_file $err_file - ---disable_warnings -drop event if exists test.user_event; ---enable_warnings --echo "Testing mysql_upgrade with EVENT performance_schema.user_event" @@ -33,4 +22,3 @@ select name from mysql.event where db='performance_schema'; update mysql.event set db='test' where name='user_event'; drop event test.user_event; - diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_func.test b/mysql-test/suite/perfschema/t/pfs_upgrade_func.test index 4f53aa1bdd1..da2bc371308 100644 --- a/mysql-test/suite/perfschema/t/pfs_upgrade_func.test +++ b/mysql-test/suite/perfschema/t/pfs_upgrade_func.test @@ -7,18 +7,7 @@ --source include/have_perfschema.inc --source include/have_innodb.inc -# Some initial settings + Preemptive cleanup let $MYSQLD_DATADIR= `SELECT @@datadir`; -let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_func.err; -let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_func.out; ---error 0,1 ---remove_file $out_file ---error 0,1 ---remove_file $err_file - ---disable_warnings -drop function if exists test.user_func; ---enable_warnings --echo "Testing mysql_upgrade with FUNCTION performance_schema.user_func" @@ -33,4 +22,3 @@ select name from mysql.proc where db='performance_schema'; update mysql.proc set db='test' where name='user_func'; drop function test.user_func; - diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test b/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test index 432cee6fb1a..99e0816ccbd 100644 --- a/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test +++ b/mysql-test/suite/perfschema/t/pfs_upgrade_proc.test @@ -7,18 +7,7 @@ --source include/have_perfschema.inc --source include/have_innodb.inc -# Some initial settings + Preemptive cleanup let $MYSQLD_DATADIR= `SELECT @@datadir`; -let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_proc.err; -let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_proc.out; ---error 0,1 ---remove_file $out_file ---error 0,1 ---remove_file $err_file - ---disable_warnings -drop procedure if exists test.user_proc; ---enable_warnings --echo "Testing mysql_upgrade with PROCEDURE performance_schema.user_proc" @@ -33,4 +22,3 @@ select name from mysql.proc where db='performance_schema'; update mysql.proc set db='test' where name='user_proc'; drop procedure test.user_proc; - diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_table.test b/mysql-test/suite/perfschema/t/pfs_upgrade_table.test index c68e156a2db..897ec23c552 100644 --- a/mysql-test/suite/perfschema/t/pfs_upgrade_table.test +++ b/mysql-test/suite/perfschema/t/pfs_upgrade_table.test @@ -7,25 +7,12 @@ --source include/have_perfschema.inc --source include/have_innodb.inc -# Some initial settings + Preemptive cleanup let $MYSQLD_DATADIR= `SELECT @@datadir`; -let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_table.err; -let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_table.out; ---error 0,1 ---remove_file $out_file ---error 0,1 ---remove_file $err_file - ---disable_warnings -drop table if exists test.user_table; ---enable_warnings --echo "Testing mysql_upgrade with TABLE performance_schema.user_table" create table test.user_table(a int); ---error 0,1 ---remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm --copy_file $MYSQLD_DATADIR/test/user_table.frm $MYSQLD_DATADIR/performance_schema/user_table.frm # Make sure the table is visible @@ -41,4 +28,3 @@ use test; --remove_file $MYSQLD_DATADIR/performance_schema/user_table.frm drop table test.user_table; - diff --git a/mysql-test/suite/perfschema/t/pfs_upgrade_view.test b/mysql-test/suite/perfschema/t/pfs_upgrade_view.test index 38ce377f235..0c9af73a1d4 100644 --- a/mysql-test/suite/perfschema/t/pfs_upgrade_view.test +++ b/mysql-test/suite/perfschema/t/pfs_upgrade_view.test @@ -7,25 +7,12 @@ --source include/have_perfschema.inc --source include/have_innodb.inc -# Some initial settings + Preemptive cleanup let $MYSQLD_DATADIR= `SELECT @@datadir`; -let $err_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_view.err; -let $out_file= $MYSQLTEST_VARDIR/tmp/pfs_upgrade_view.out; ---error 0,1 ---remove_file $out_file ---error 0,1 ---remove_file $err_file - ---disable_warnings -drop view if exists test.user_view; ---enable_warnings --echo "Testing mysql_upgrade with VIEW performance_schema.user_view" create view test.user_view as select "Not supposed to be here"; ---error 0,1 ---remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm --copy_file $MYSQLD_DATADIR/test/user_view.frm $MYSQLD_DATADIR/performance_schema/user_view.frm # Make sure the view is visible @@ -41,4 +28,3 @@ use test; --remove_file $MYSQLD_DATADIR/performance_schema/user_view.frm drop view test.user_view; - diff --git a/mysql-test/suite/perfschema/t/table_name.test b/mysql-test/suite/perfschema/t/table_name.test index a8179f2d1f8..5fb8ccd0f7f 100644 --- a/mysql-test/suite/perfschema/t/table_name.test +++ b/mysql-test/suite/perfschema/t/table_name.test @@ -31,6 +31,7 @@ INSERT INTO `sql_1` VALUES(1,'one'); --echo --echo # Verify that the tables are treated as normal tables . --echo +--sorted_result SELECT object_type, object_schema, object_name FROM performance_schema.objects_summary_global_by_type WHERE object_schema="test"; diff --git a/mysql-test/suite/perfschema/t/threads_mysql.test b/mysql-test/suite/perfschema/t/threads_mysql.test index 8576c8767d6..c33f421863e 100644 --- a/mysql-test/suite/perfschema/t/threads_mysql.test +++ b/mysql-test/suite/perfschema/t/threads_mysql.test @@ -9,22 +9,10 @@ # Ensure that the event scheduler (started via threads_mysql-master.opt) # is really running. ---source include/running_event_scheduler.inc +--source include/pfs_running_event_scheduler.inc SET GLOBAL event_scheduler = OFF; ---source include/no_running_event_scheduler.inc - -# threads are removed from: -# - information_schema.processlist -# - performance_schema.threads -# at different times, so we may have to wait a little more -# for the event_scheduler to shutdown -# -let $wait_timeout= 1; -let $wait_condition= - SELECT COUNT(*) = 0 FROM performance_schema.threads - WHERE name like 'thread/sql/event%'; ---source include/wait_condition.inc +--source include/pfs_no_running_event_scheduler.inc --vertical_results @@ -59,7 +47,7 @@ WHERE name LIKE 'thread/sql%'; SET GLOBAL event_scheduler = ON; ---source include/running_event_scheduler.inc +--source include/pfs_running_event_scheduler.inc # Show entries belonging to the just started event scheduler SELECT name, type, processlist_user, processlist_host, processlist_db, diff --git a/mysql-test/suite/plugins/r/auth_ed25519.result b/mysql-test/suite/plugins/r/auth_ed25519.result new file mode 100644 index 00000000000..5c5581d37b0 --- /dev/null +++ b/mysql-test/suite/plugins/r/auth_ed25519.result @@ -0,0 +1,54 @@ +create function ed25519_password returns string soname "auth_ed25519.so"; +select ed25519_password(); +ERROR HY000: Can't initialize function 'ed25519_password'; Wrong arguments to ed25519_password() +select ed25519_password(1); +ERROR HY000: Can't initialize function 'ed25519_password'; Wrong arguments to ed25519_password() +select ed25519_password("foo", "bar"); +ERROR HY000: Can't initialize function 'ed25519_password'; Wrong arguments to ed25519_password() +select ed25519_password("foo"); +ERROR HY000: Can't initialize function 'ed25519_password'; Authentication plugin ed25519 is not loaded +install soname 'auth_ed25519'; +select ed25519_password("foo"); +ed25519_password("foo") +vubFBzIrapbfHct1/J72dnUryz5VS7lA6XHH8sIx4TI +select ed25519_password("foobar"); +ed25519_password("foobar") +qv2mG6HWCuy32Slb5xhV4THStewNz2VINVPbgk+XAJ8 +select ed25519_password("foo bar"); +ed25519_password("foo bar") +Y5fV74JAVRMOK2cdnUsYS+WW9sXaaL/o+6WGKOgqnzc +select ed25519_password(NULL); +ed25519_password(NULL) +NULL +select * from information_schema.plugins where plugin_name='ed25519'; +PLUGIN_NAME ed25519 +PLUGIN_VERSION 1.0 +PLUGIN_STATUS ACTIVE +PLUGIN_TYPE AUTHENTICATION +PLUGIN_TYPE_VERSION 2.1 +PLUGIN_LIBRARY auth_ed25519.so +PLUGIN_LIBRARY_VERSION 1.12 +PLUGIN_AUTHOR Sergei Golubchik +PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication +PLUGIN_LICENSE GPL +LOAD_OPTION ON +PLUGIN_MATURITY Beta +PLUGIN_AUTH_VERSION 1.0-alpha +create user test1@localhost identified via ed25519 using 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY'; +show grants for test1@localhost; +Grants for test1@localhost +GRANT USAGE ON *.* TO 'test1'@'localhost' IDENTIFIED VIA ed25519 USING 'ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY' +connect(localhost,test1,public,test,PORT,SOCKET); +connect con1, localhost, test1, public; +ERROR 28000: Access denied for user 'test1'@'localhost' (using password: YES) +connect con1, localhost, test1, secret; +select current_user(); +current_user() +test1@localhost +disconnect con1; +connection default; +drop user test1@localhost; +uninstall plugin ed25519; +select ed25519_password("foo"); +ERROR HY000: Can't initialize function 'ed25519_password'; Authentication plugin ed25519 is not loaded +drop function ed25519_password; diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result index 158a7501240..479b4b00698 100644 --- a/mysql-test/suite/plugins/r/cracklib_password_check.result +++ b/mysql-test/suite/plugins/r/cracklib_password_check.result @@ -6,7 +6,7 @@ PLUGIN_STATUS ACTIVE PLUGIN_TYPE PASSWORD VALIDATION PLUGIN_TYPE_VERSION 1.0 PLUGIN_LIBRARY cracklib_password_check.so -PLUGIN_LIBRARY_VERSION 1.11 +PLUGIN_LIBRARY_VERSION 1.12 PLUGIN_AUTHOR Sergei Golubchik PLUGIN_DESCRIPTION Password validation via CrackLib PLUGIN_LICENSE GPL diff --git a/mysql-test/suite/plugins/r/show_all_plugins.result b/mysql-test/suite/plugins/r/show_all_plugins.result index fae706f56fa..7ed26b8aef6 100644 --- a/mysql-test/suite/plugins/r/show_all_plugins.result +++ b/mysql-test/suite/plugins/r/show_all_plugins.result @@ -4,8 +4,8 @@ Variable_name Value Opened_plugin_libraries 0 select * from information_schema.all_plugins where plugin_library='ha_example.so'; PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION -EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.11 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1 -UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.11 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926 +EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.12 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1 +UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.12 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926 show status like '%libraries%'; Variable_name Value Opened_plugin_libraries 1 diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result index 015a26adc87..11385bd6b01 100644 --- a/mysql-test/suite/plugins/r/simple_password_check.result +++ b/mysql-test/suite/plugins/r/simple_password_check.result @@ -6,7 +6,7 @@ PLUGIN_STATUS ACTIVE PLUGIN_TYPE PASSWORD VALIDATION PLUGIN_TYPE_VERSION 1.0 PLUGIN_LIBRARY simple_password_check.so -PLUGIN_LIBRARY_VERSION 1.11 +PLUGIN_LIBRARY_VERSION 1.12 PLUGIN_AUTHOR Sergei Golubchik PLUGIN_DESCRIPTION Simple password strength checks PLUGIN_LICENSE GPL diff --git a/mysql-test/suite/plugins/t/auth_ed25519.test b/mysql-test/suite/plugins/t/auth_ed25519.test new file mode 100644 index 00000000000..3e02bdf97d2 --- /dev/null +++ b/mysql-test/suite/plugins/t/auth_ed25519.test @@ -0,0 +1,44 @@ +# +# MDEV-12160 Modern alternative to the SHA1 authentication plugin +# +source include/not_embedded.inc; +if (!$AUTH_ED25519_SO) { + skip No auth_ed25519 plugin; +} + +replace_result dll so; +eval create function ed25519_password returns string soname "$AUTH_ED25519_SO"; +error ER_CANT_INITIALIZE_UDF; +select ed25519_password(); +error ER_CANT_INITIALIZE_UDF; +select ed25519_password(1); +error ER_CANT_INITIALIZE_UDF; +select ed25519_password("foo", "bar"); +error ER_CANT_INITIALIZE_UDF; +select ed25519_password("foo"); + +install soname 'auth_ed25519'; +select ed25519_password("foo"); +select ed25519_password("foobar"); +select ed25519_password("foo bar"); +select ed25519_password(NULL); + +replace_result dll so; +query_vertical select * from information_schema.plugins where plugin_name='ed25519'; +let $pwd=`select ed25519_password("secret")`; +eval create user test1@localhost identified via ed25519 using '$pwd'; +show grants for test1@localhost; + +replace_result $MASTER_MYPORT PORT $MASTER_MYSOCK SOCKET; +error ER_ACCESS_DENIED_ERROR; +connect con1, localhost, test1, public; +connect con1, localhost, test1, secret; +select current_user(); +disconnect con1; +connection default; + +drop user test1@localhost; +uninstall plugin ed25519; +error ER_CANT_INITIALIZE_UDF; +select ed25519_password("foo"); +drop function ed25519_password; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index 619ee41d1ed..4ffa8fc9883 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -9,7 +9,6 @@ SET @restore_slave_net_timeout=@@global.slave_net_timeout; connection master; RESET MASTER; SET @restore_slave_net_timeout=@@global.slave_net_timeout; -SET @restore_event_scheduler=@@global.event_scheduler; connection slave; *** Default value *** @@ -245,7 +244,9 @@ include/start_slave.inc connection master; SET @@global.event_scheduler=1; connection slave; -Number of received heartbeat events: 0 +connection master; +connection slave; +Received heartbeats meet expectations: TRUE connection master; DELETE FROM t1; DROP EVENT e1; diff --git a/mysql-test/suite/rpl/r/rpl_mdev6386.result b/mysql-test/suite/rpl/r/rpl_mdev6386.result index 00838127302..91ba9569343 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev6386.result +++ b/mysql-test/suite/rpl/r/rpl_mdev6386.result @@ -2,7 +2,6 @@ include/master-slave.inc [connection master] connection master; ALTER TABLE mysql.gtid_slave_pos ENGINE = InnoDB; -FLUSH LOGS; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) Engine=InnoDB; connection slave; connection slave; @@ -26,6 +25,7 @@ INSERT INTO t2 VALUE (4, 1); INSERT INTO t2 VALUE (5, 1); INSERT INTO t1 SELECT * FROM t2; DROP TEMPORARY TABLE t2; +INSERT INTO t1 VALUE (6, 3); include/save_master_gtid.inc Contents on master: SELECT * FROM t1 ORDER BY a; @@ -35,6 +35,7 @@ a b 3 1 4 1 5 1 +6 3 connection slave; START SLAVE; include/wait_for_slave_sql_error.inc [errno=1062] @@ -56,6 +57,7 @@ a b 3 1 4 1 5 1 +6 3 connection master; DROP TABLE t1; connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index 5b55f11da85..4c8d3a1fedb 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -34,7 +34,6 @@ eval SET @restore_slave_heartbeat_timeout=$slave_heartbeat_timeout; --connection master RESET MASTER; SET @restore_slave_net_timeout=@@global.slave_net_timeout; -SET @restore_event_scheduler=@@global.event_scheduler; --echo # @@ -352,21 +351,54 @@ eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTE --connection master # Enable scheduler SET @@global.event_scheduler=1; + --sync_slave_with_master let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); -# Wait some updates for table t1 from master -let $wait_condition= SELECT COUNT(*)=1 FROM t1 WHERE a > 5; ---source include/wait_condition.inc + +--connection master + +# Whether or not to send a heartbeat is decided on the master, based on +# whether the binlog was updated during the period or not. +# Even with the 1-second event, we cannot make the master to write binary +# logs (or execute SQL) in a timely manner. We can only check that they +# were executed in a timely manner, and if they were not, neutralize the +# heartbeat check on the slave. +# We will wait for 5 events, and keep checking 'Binlog_commits' on master. +# Time interval between consequent events will be measured. +# We can only expect that no heartbeats have been sent if the interval +# between events never exceeded MASTER_HEARTBEAT_PERIOD. +# If it has exceeded the value at least once, the slave can legitimately +# receive a heartbeat (but we cannot require it, because the delay +# could have occurred somewhere else, e.g. upon checking the status). +# So, if the delay is detected, we will signal slave to ignore possible +# heartbeats. + +let $possible_heartbeats= 0; +let $commits_to_wait= 5; +while ($commits_to_wait) +{ + let $tm= `SELECT UNIX_TIMESTAMP(NOW(3))`; + let $binlog_commits= query_get_value(SHOW STATUS LIKE 'Binlog_commits', Value, 1); + let $wait_condition= SELECT VARIABLE_VALUE > $binlog_commits FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME= 'BINLOG_COMMITS'; + --source include/wait_condition.inc + dec $commits_to_wait; + if (`SELECT UNIX_TIMESTAMP(NOW(3)) > $tm + 5`) + { + let $possible_heartbeats= 1; + let $commits_to_wait= 0; + } +} + +--connection slave let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1); -let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1); ---echo Number of received heartbeat events: $result +let $result= `SELECT CASE WHEN $possible_heartbeats THEN 'TRUE' WHEN $rcvd_heartbeats_after - $rcvd_heartbeats_before > 0 THEN 'FALSE' ELSE 'TRUE' END`; +--echo Received heartbeats meet expectations: $result --connection master DELETE FROM t1; DROP EVENT e1; --sync_slave_with_master --echo - # Check received heartbeat events while logs flushed on slave --echo *** Flush logs on slave *** STOP SLAVE; diff --git a/mysql-test/suite/rpl/t/rpl_mdev6386.test b/mysql-test/suite/rpl/t/rpl_mdev6386.test index 3e4e79ea5a3..e85b1ae0132 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev6386.test +++ b/mysql-test/suite/rpl/t/rpl_mdev6386.test @@ -2,9 +2,7 @@ --source include/master-slave.inc --connection master -# ToDo: Remove this FLUSH LOGS when MDEV-6403 is fixed. ALTER TABLE mysql.gtid_slave_pos ENGINE = InnoDB; -FLUSH LOGS; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) Engine=InnoDB; --sync_slave_with_master @@ -31,6 +29,7 @@ INSERT INTO t2 VALUE (4, 1); INSERT INTO t2 VALUE (5, 1); INSERT INTO t1 SELECT * FROM t2; DROP TEMPORARY TABLE t2; +INSERT INTO t1 VALUE (6, 3); --source include/save_master_gtid.inc --echo Contents on master: SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test index e99a233ac34..1931e2eab2a 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test +++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test @@ -43,6 +43,9 @@ connection master; #With '--force' option, mysql_upgrade always executes all sql statements for upgrading. --exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1 +let $datadir= `select @@datadir`; +remove_file $datadir/mysql_upgrade_info; + connection master; let $after_file= query_get_value(SHOW MASTER STATUS, File, 1); let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1); diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_include_delete_marked_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_include_delete_marked_basic.result new file mode 100644 index 00000000000..ffd208e7927 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_stats_include_delete_marked_basic.result @@ -0,0 +1,25 @@ +SELECT @@innodb_stats_include_delete_marked; +@@innodb_stats_include_delete_marked +0 +SET GLOBAL innodb_stats_include_delete_marked=1; +SELECT @@innodb_stats_include_delete_marked; +@@innodb_stats_include_delete_marked +1 +SET SESSION innodb_stats_include_delete_marked=1; +ERROR HY000: Variable 'innodb_stats_include_delete_marked' is a GLOBAL variable and should be set with SET GLOBAL +SET GLOBAL innodb_stats_include_delete_marked=100; +ERROR 42000: Variable 'innodb_stats_include_delete_marked' can't be set to the value of '100' +SET GLOBAL innodb_stats_include_delete_marked=foo; +ERROR 42000: Variable 'innodb_stats_include_delete_marked' can't be set to the value of 'foo' +SET GLOBAL innodb_stats_include_delete_marked=OFF ; +SELECT @@innodb_stats_include_delete_marked; +@@innodb_stats_include_delete_marked +0 +SET GLOBAL innodb_stats_include_delete_marked=ON ; +SELECT @@innodb_stats_include_delete_marked; +@@innodb_stats_include_delete_marked +1 +SET GLOBAL innodb_stats_include_delete_marked=Default ; +SELECT @@innodb_stats_include_delete_marked; +@@innodb_stats_include_delete_marked +0 diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled index 285caafb3d0..858df585a7b 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff-disabled @@ -1,7 +1,7 @@ --- suite/sys_vars/r/sysvars_innodb.result 2016-05-06 14:03:16.000000000 +0300 +++ suite/sys_vars/r/sysvars_innodb,32bit.reject 2016-05-08 13:28:44.312418574 +0300 @@ -47,13 +47,27 @@ - ENUM_VALUE_LIST NULL + ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_ADAPTIVE_HASH_INDEX_PARTITIONS @@ -97,7 +97,7 @@ NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 64 @@ -355,6 +369,20 @@ - ENUM_VALUE_LIST NULL + ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME INNODB_BUFFER_POOL_POPULATE @@ -418,15 +418,6 @@ VARIABLE_COMMENT Helps to save your data in case the disk image of the database becomes corrupt. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 6 -@@ -1047,7 +1215,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME - DEFAULT_VALUE 0 - VARIABLE_SCOPE GLOBAL --VARIABLE_TYPE BIGINT UNSIGNED -+VARIABLE_TYPE INT UNSIGNED - VARIABLE_COMMENT Kills the server during crash recovery. - NUMERIC_MIN_VALUE 0 - NUMERIC_MAX_VALUE 10 @@ -1055,6 +1223,20 @@ ENUM_VALUE_LIST NULL READ_ONLY YES @@ -1227,8 +1218,8 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.33 -+GLOBAL_VALUE 5.6.34-79.1 +-GLOBAL_VALUE 5.6.35 ++GLOBAL_VALUE 5.6.35-80.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled index a2e6c1d5c4c..d801270c6b6 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff-disabled @@ -661,8 +661,8 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_VERSION SESSION_VALUE NULL --GLOBAL_VALUE 5.6.33 -+GLOBAL_VALUE 5.6.34-79.1 +-GLOBAL_VALUE 5.6.35 ++GLOBAL_VALUE 5.6.35-80.0 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index a6a36ccf6d6..d7d35da8459 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -797,7 +797,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Key rotation - re-encrypt in background all pages that were encrypted with a key that many (or more) versions behind +VARIABLE_COMMENT Key rotation - re-encrypt in background all pages that were encrypted with a key that many (or more) versions behind. Value 0 indicates that key rotation is disabled. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 0 diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test new file mode 100644 index 00000000000..a3a9b99a133 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_stats_include_delete_marked_basic.test @@ -0,0 +1,58 @@ +############################################################################### +# # +# Variable Name: innodb_stats_include_delete_marked # +# Scope: Global # +# Access Type: Dynamic # +# Data Type: numeric # +# # +# # +# Creation Date: 2016-08-29 # +# Author : Aditya # +# # +# # +# Description: # +# * Value check # +# * Scope check # +# # +############################################################################### + +--source include/have_innodb.inc + +if (`select plugin_auth_version <= "5.7.17" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not present before MySQL 5.7.17 or 5.6.35 +} + +#################################################################### +# Display default value # +#################################################################### +SELECT @@innodb_stats_include_delete_marked; + +SET GLOBAL innodb_stats_include_delete_marked=1; + +SELECT @@innodb_stats_include_delete_marked; + +# check error +--error ER_GLOBAL_VARIABLE +SET SESSION innodb_stats_include_delete_marked=1; + +# check error +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL innodb_stats_include_delete_marked=100; + +# check error +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL innodb_stats_include_delete_marked=foo; + +SET GLOBAL innodb_stats_include_delete_marked=OFF ; + +SELECT @@innodb_stats_include_delete_marked; + +SET GLOBAL innodb_stats_include_delete_marked=ON ; + +SELECT @@innodb_stats_include_delete_marked; + +# Check with default setting +SET GLOBAL innodb_stats_include_delete_marked=Default ; + +SELECT @@innodb_stats_include_delete_marked; diff --git a/mysql-test/suite/sys_vars/t/max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test index b5e1d834d7e..38b493b3bab 100644 --- a/mysql-test/suite/sys_vars/t/max_digest_length_basic.test +++ b/mysql-test/suite/sys_vars/t/max_digest_length_basic.test @@ -11,7 +11,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA --source include/not_embedded.inc diff --git a/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test index 29b4232b7fa..31692081053 100644 --- a/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test +++ b/mysql-test/suite/sys_vars/t/pfs_digests_size_basic.test @@ -11,7 +11,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA --source include/not_embedded.inc --source include/have_perfschema.inc diff --git a/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test index 5c89dbda07f..cf87c1a7c68 100644 --- a/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test +++ b/mysql-test/suite/sys_vars/t/pfs_max_digest_length_basic.test @@ -11,7 +11,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA --source include/not_embedded.inc --source include/have_perfschema.inc diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv.test b/mysql-test/suite/sys_vars/t/secure_file_priv.test index 5c53da58275..a5a465d8c98 100644 --- a/mysql-test/suite/sys_vars/t/secure_file_priv.test +++ b/mysql-test/suite/sys_vars/t/secure_file_priv.test @@ -21,6 +21,9 @@ SHOW VARIABLES LIKE 'secure_file_priv'; --perl use File::Basename; my $protected_file= dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt'; +# Ensure bug50373.txt does not exist (e.g. leftover from previous +# test runs). +unlink $protected_file; open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/bug50373.inc") or die; print FILE "SELECT * FROM t1 INTO OUTFILE '".$protected_file."';\n"; print FILE "DELETE FROM t1;\n"; diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result index 88a9e608c9d..be3ea8109cc 100644 --- a/mysql-test/suite/vcol/r/vcol_select_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result @@ -298,6 +298,115 @@ DROP TABLE t1,t2; create table t1 ( pk integer auto_increment, bi integer not null, +vi integer generated always as (bi) persistent, +bc varchar(1) not null, +vc varchar(2) generated always as (concat(bc, bc)) persistent, +primary key (pk), +key (vi, vc)); +insert t1 (bi, bc) values (0, 'x'), (0, 'n'), (1, 'w'), (7, 's'), (0, 'a'), (4, 'd'), (1, 'w'), (1, 'j'), (1, 'm'), (4, 'k'), (7, 't'), (4, 'k'), (2, 'e'), (0, 'i'), (1, 't'), (6, 'z'), (3, 'c'), (6, 'i'), (8, 'v'); +create table t2 ( +pk integer auto_increment, +bi integer not null, +vi integer generated always as (bi) persistent, +bc varchar(257) not null, +vc varchar(2) generated always as (concat(bc, bc)) persistent, +primary key (pk), +key (vi, vc)); +insert t2 (bi, bc) values (1, 'c'), (8, 'm'), (9, 'd'), (6, 'y'), (1, 't'), (6, 'd'), (2, 's'), (4, 'r'), (8, 'm'), (4, 'b'), (4, 'x'), (7, 'g'), (4, 'p'), (1, 'q'), (9, 'w'), (4, 'd'), (8, 'e'), (4, 'b'), (8, 'y'); +explain # should be using join buffer +select t2.vi from (t2 as t3 right join (t2 left join t1 on (t1.bi = t2.vi)) on (t1.vc = t2.vc)); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index NULL vi 10 NULL 19 Using index +1 SIMPLE t1 ALL NULL NULL NULL NULL 19 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t3 index NULL PRIMARY 4 NULL 19 Using where; Using index; Using join buffer (incremental, BNL join) +select t2.vi from (t2 as t3 right join (t2 left join t1 on (t1.bi = t2.vi)) on (t1.vc = t2.vc)); +vi +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +2 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +4 +6 +6 +6 +6 +7 +7 +8 +8 +8 +8 +9 +9 +drop table t2,t1; +create table t1 ( +pk integer auto_increment, +bi integer not null, vi integer generated always as (bi) virtual, bc varchar(1) not null, vc varchar(2) generated always as (concat(bc, bc)), diff --git a/mysql-test/suite/vcol/t/vcol_select_myisam.test b/mysql-test/suite/vcol/t/vcol_select_myisam.test index 5dd08894fea..2570526af71 100644 --- a/mysql-test/suite/vcol/t/vcol_select_myisam.test +++ b/mysql-test/suite/vcol/t/vcol_select_myisam.test @@ -70,7 +70,40 @@ SELECT * FROM t1 NATURAL JOIN t2; DROP TABLE t1,t2; # +# MDEV-11525 Assertion `cp + len <= buff + buff_size' failed in JOIN_CACHE::write_record_data +# + +create table t1 ( + pk integer auto_increment, + bi integer not null, + vi integer generated always as (bi) persistent, + bc varchar(1) not null, + vc varchar(2) generated always as (concat(bc, bc)) persistent, + primary key (pk), + key (vi, vc)); +insert t1 (bi, bc) values (0, 'x'), (0, 'n'), (1, 'w'), (7, 's'), (0, 'a'), (4, 'd'), (1, 'w'), (1, 'j'), (1, 'm'), (4, 'k'), (7, 't'), (4, 'k'), (2, 'e'), (0, 'i'), (1, 't'), (6, 'z'), (3, 'c'), (6, 'i'), (8, 'v'); +create table t2 ( + pk integer auto_increment, + bi integer not null, + vi integer generated always as (bi) persistent, + bc varchar(257) not null, + vc varchar(2) generated always as (concat(bc, bc)) persistent, + primary key (pk), + key (vi, vc)); +insert t2 (bi, bc) values (1, 'c'), (8, 'm'), (9, 'd'), (6, 'y'), (1, 't'), (6, 'd'), (2, 's'), (4, 'r'), (8, 'm'), (4, 'b'), (4, 'x'), (7, 'g'), (4, 'p'), (1, 'q'), (9, 'w'), (4, 'd'), (8, 'e'), (4, 'b'), (8, 'y'); +explain # should be using join buffer +select t2.vi from (t2 as t3 right join (t2 left join t1 on (t1.bi = t2.vi)) on (t1.vc = t2.vc)); +--sorted_result +select t2.vi from (t2 as t3 right join (t2 left join t1 on (t1.bi = t2.vi)) on (t1.vc = t2.vc)); +drop table t2,t1; + +# +# End of 5.5 tests +# + +# # MDEV-11640 gcol.gcol_select_myisam fails in buildbot on Power +# (same as MDEV-11525 above, but for virtual columns) # create table t1 ( diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index bf16757efd6..143ba80c53b 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1755,6 +1755,17 @@ DROP TABLE t2; DROP TABLE t1; --echo # +--echo # MDEV-6390 CONVERT TO CHARACTER SET utf8 doesn't change DEFAULT CHARSET. +--echo # + +CREATE TABLE t1 (id int(11) NOT NULL, a int(11) NOT NULL, b int(11)) + ENGINE=InnoDB DEFAULT CHARSET=latin1; +SHOW CREATE TABLE t1; +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--echo # --echo # Start of 10.1 tests --echo # diff --git a/mysql-test/t/ctype_upgrade.test b/mysql-test/t/ctype_upgrade.test index cc59d1e4401..62567c5afe4 100644 --- a/mysql-test/t/ctype_upgrade.test +++ b/mysql-test/t/ctype_upgrade.test @@ -191,6 +191,7 @@ SELECT GROUP_CONCAT(a ORDER BY BINARY a) FROM maria100004_xxx_croatian_ci GROUP SHOW CREATE TABLE mysql050614_xxx_croatian_ci; SELECT GROUP_CONCAT(a ORDER BY BINARY a) FROM mysql050614_xxx_croatian_ci GROUP BY a; +remove_file $MYSQLD_DATADIR/mysql_upgrade_info; DROP TABLE maria050313_ucs2_croatian_ci_def; DROP TABLE maria050313_utf8_croatian_ci; DROP TABLE maria050533_xxx_croatian_ci; diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 121e274ceeb..d30a6d7fd9e 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -875,6 +875,29 @@ SELECT Customer, Success, SUM(OrderSize) DROP TABLE example1463; set sql_mode= @save_sql_mode; +--echo # +--echo # MDEV-9028: SELECT DISTINCT constant column of derived table +--echo # used as the second operand of LEFT JOIN +--echo # + +create table t1 (id int, data varchar(255)); +insert into t1 values (1,'yes'),(2,'yes'); + +select distinct t1.id, tt.id, tt.data + from t1 + left join + (select t1.id, 'yes' as data from t1) as tt + on t1.id = tt.id; + +select distinct t1.id, tt.id, tt.data + from t1 + left join + (select t1.id, 'yes' as data from t1 where id > 1) as tt + on t1.id = tt.id; + +drop table t1; + + --echo # end of 5.5 --echo # diff --git a/mysql-test/t/drop_bad_db_type.test b/mysql-test/t/drop_bad_db_type.test index 69e1a889b18..00b79dabddf 100644 --- a/mysql-test/t/drop_bad_db_type.test +++ b/mysql-test/t/drop_bad_db_type.test @@ -15,6 +15,12 @@ insert t1 values (1),(2),(3); flush tables; uninstall soname 'ha_archive'; +--vertical_results +select table_schema, table_name from information_schema.tables where table_name like 't1'; +select table_schema, table_name, engine, version from information_schema.tables where table_name like 't1'; +select table_schema, table_name, engine, row_format from information_schema.tables where table_name like 't1'; +--horizontal_results + install soname 'ha_archive'; --list_files $mysqld_datadir/test drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 09d7a29744f..3bb0044c7fb 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -1460,12 +1460,12 @@ SHOW CREATE TABLE information_schema.spatial_ref_sys; create table t1(g GEOMETRY, pt POINT); create table t2(g LINESTRING, pl POLYGON); -select * from information_schema.geometry_columns; +select * from information_schema.geometry_columns where f_table_schema='test'; drop table t1, t2; --echo 10.1 tests create table t1(g GEOMETRY(9,4) REF_SYSTEM_ID=101, pt POINT(8,2), pg GEOMETRY REF_SYSTEM_ID=102); -SELECT SRID from information_schema.geometry_columns WHERE G_TABLE_NAME='t1'; +SELECT SRID from information_schema.geometry_columns WHERE f_table_schema='test' and G_TABLE_NAME='t1'; drop table t1; -- echo # Expect an int(1) column to be created diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index b816afed851..c945e818181 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -2116,6 +2116,68 @@ DROP USER mysqltest_u1@localhost; --echo # End of Bug#38347. --echo + +--echo # +--echo # BUG#11759114 - '51401: GRANT TREATS NONEXISTENT FUNCTIONS/PRIVILEGES +--echo # DIFFERENTLY'. +--echo # +--disable_warnings +drop database if exists mysqltest_db1; +--enable_warnings +create database mysqltest_db1; +create user mysqltest_u1; +--echo # Both GRANT statements below should fail with the same error. +--error ER_SP_DOES_NOT_EXIST +grant execute on function mysqltest_db1.f1 to mysqltest_u1; +--error ER_SP_DOES_NOT_EXIST +grant execute on procedure mysqltest_db1.p1 to mysqltest_u1; +--echo # Let us show that GRANT behaviour for routines is consistent +--echo # with GRANT behaviour for tables. Attempt to grant privilege +--echo # on non-existent table also results in an error. +--error ER_NO_SUCH_TABLE +grant select on mysqltest_db1.t1 to mysqltest_u1; +show grants for mysqltest_u1; +drop database mysqltest_db1; +drop user mysqltest_u1; + + +--echo # +--echo # Bug#12766319 - 61865: RENAME USER DOES NOT WORK CORRECTLY - +--echo # REQUIRES FLUSH PRIVILEGES +--echo # + +CREATE USER foo@'127.0.0.1'; +GRANT ALL ON *.* TO foo@'127.0.0.1'; + +--echo # First attempt, should connect successfully +connect (conn1, '127.0.0.1', foo,,test); +SELECT user(), current_user(); + +--echo # Rename the user +RENAME USER foo@'127.0.0.1' to foo@'127.0.0.0/255.0.0.0'; + +--echo # Second attempt, should connect successfully as its valid mask +--echo # This was failing without fix +connect (conn2, '127.0.0.1', foo,,test); +SELECT user(), current_user(); + +--echo # Rename the user back to original +RENAME USER foo@'127.0.0.0/255.0.0.0' to foo@'127.0.0.1'; + +--echo # Third attempt, should connect successfully +connect (conn3, '127.0.0.1', foo,,test); +SELECT user(), current_user(); + +--echo # Clean-up +connection default; +disconnect conn1; +disconnect conn2; +disconnect conn3; +DROP USER foo@'127.0.0.1'; + +--echo # End of Bug#12766319 + + --echo # --echo # Bug#11756966 - 48958: STORED PROCEDURES CAN BE LEVERAGED TO BYPASS --echo # DATABASE SECURITY @@ -2146,29 +2208,6 @@ disconnect con1; DROP USER untrusted@localhost; DROP DATABASE secret; ---echo # ---echo # BUG#11759114 - '51401: GRANT TREATS NONEXISTENT FUNCTIONS/PRIVILEGES ---echo # DIFFERENTLY'. ---echo # ---disable_warnings -drop database if exists mysqltest_db1; ---enable_warnings -create database mysqltest_db1; -create user mysqltest_u1; ---echo # Both GRANT statements below should fail with the same error. ---error ER_SP_DOES_NOT_EXIST -grant execute on function mysqltest_db1.f1 to mysqltest_u1; ---error ER_SP_DOES_NOT_EXIST -grant execute on procedure mysqltest_db1.p1 to mysqltest_u1; ---echo # Let us show that GRANT behaviour for routines is consistent ---echo # with GRANT behaviour for tables. Attempt to grant privilege ---echo # on non-existent table also results in an error. ---error ER_NO_SUCH_TABLE -grant select on mysqltest_db1.t1 to mysqltest_u1; -show grants for mysqltest_u1; -drop database mysqltest_db1; -drop user mysqltest_u1; - set GLOBAL sql_mode=default; # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test index 7b7d9236835..e60b7827f75 100644 --- a/mysql-test/t/join_nested.test +++ b/mysql-test/t/join_nested.test @@ -1309,5 +1309,74 @@ LEFT JOIN t4 AS alias5 JOIN t5 ON alias5.f5 ON alias2.f3 ON alias1.f2; DROP TABLE t1,t2,t3,t4,t5; -set optimizer_search_depth= @tmp_mdev621; +--echo # +--echo # MDEV-7992: Nested left joins + 'not exists' optimization +--echo # + +CREATE TABLE t1( + K1 INT PRIMARY KEY, + Name VARCHAR(15) +); + +INSERT INTO t1 VALUES + (1,'T1Row1'), (2,'T1Row2'); + + +CREATE TABLE t2( + K2 INT PRIMARY KEY, + K1r INT, + rowTimestamp DATETIME, + Event VARCHAR(15) +); + +INSERT INTO t2 VALUES + (1, 1, '2015-04-13 10:42:11' ,'T1Row1Event1'), + (2, 1, '2015-04-13 10:42:12' ,'T1Row1Event2'), + (3, 1, '2015-04-13 10:42:12' ,'T1Row1Event3'); + +let $q1= +SELECT t1a.*, t2a.*, + t2i.K2 AS K2B, t2i.K1r AS K1rB, + t2i.rowTimestamp AS rowTimestampB, t2i.Event AS EventB +FROM + t1 t1a JOIN t2 t2a ON t2a.K1r = t1a.K1 + LEFT JOIN + ( t1 t1i LEFT JOIN t2 t2i ON t2i.K1r = t1i.K1) + ON (t1i.K1 = 1) AND + (((t2i.K1r = t1a.K1 AND t2i.rowTimestamp > t2a.rowTimestamp ) OR + (t2i.rowTimestamp = t2a.rowTimestamp AND t2i.K2 > t2a.K2)) + OR (t2i.K2 IS NULL)) +WHERE +t2a.K1r = 1 AND t2i.K2 IS NULL; + +eval $q1; +eval EXPLAIN EXTENDED $q1; + +CREATE VIEW v1 AS + SELECT t2i.* + FROM t1 as t1i LEFT JOIN t2 as t2i ON t2i.K1r = t1i.K1 + WHERE t1i.K1 = 1 ; + +let $q2= +SELECT + t1a.*, t2a.*, t2b.K2 as K2B, t2b.K1r as K1rB, + t2b.rowTimestamp as rowTimestampB, t2b.Event as EventB +FROM + t1 as t1a JOIN t2 as t2a ON t2a.K1r = t1a.K1 + LEFT JOIN + v1 as t2b + ON ((t2b.K1r = t1a.K1 AND t2b.rowTimestamp > t2a.rowTimestamp) OR + (t2b.rowTimestamp = t2a.rowTimestamp AND t2b.K2 > t2a.K2)) + OR (t2b.K2 IS NULL) +WHERE + t1a.K1 = 1 AND + t2b.K2 IS NULL; + +eval $q2; +eval EXPLAIN EXTENDED $q2; + +DROP VIEW v1; +DROP TABLE t1,t2; + +set optimizer_search_depth= @tmp_mdev621; diff --git a/mysql-test/t/log_tables_upgrade.test b/mysql-test/t/log_tables_upgrade.test index d08d74174db..36802fb38ad 100644 --- a/mysql-test/t/log_tables_upgrade.test +++ b/mysql-test/t/log_tables_upgrade.test @@ -24,4 +24,5 @@ RENAME TABLE test.bug49823 TO general_log; DROP TABLE general_log; RENAME TABLE renamed_general_log TO general_log; SET GLOBAL general_log = @saved_general_log; +remove_file $MYSQLD_DATADIR/mysql_upgrade_info; USE test; diff --git a/mysql-test/t/long_tmpdir-master.sh b/mysql-test/t/long_tmpdir-master.sh index 7bcbee26105..318955fbcca 100755..100644 --- a/mysql-test/t/long_tmpdir-master.sh +++ b/mysql-test/t/long_tmpdir-master.sh @@ -1,4 +1,3 @@ -#!/bin/sh d="$MYSQLTEST_VARDIR/tmp/long_temporary_directory_path_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789" test -d "$d" || mkdir "$d" rm -f "$d"/* diff --git a/mysql-test/t/lowercase_mixed_tmpdir-master.sh b/mysql-test/t/lowercase_mixed_tmpdir-master.sh index 9330d0581ee..95c26e3aa02 100755..100644 --- a/mysql-test/t/lowercase_mixed_tmpdir-master.sh +++ b/mysql-test/t/lowercase_mixed_tmpdir-master.sh @@ -1,4 +1,3 @@ -#!/bin/sh # This test requires a non-lowercase tmpdir directory on a case-sensitive # filesystem. diff --git a/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh b/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh index 95c26e3aa02..95c26e3aa02 100755..100644 --- a/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh +++ b/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh diff --git a/mysql-test/t/mysql_upgrade_noengine.test b/mysql-test/t/mysql_upgrade_noengine.test new file mode 100644 index 00000000000..cfc3a1dc406 --- /dev/null +++ b/mysql-test/t/mysql_upgrade_noengine.test @@ -0,0 +1,57 @@ +# +# MDEV-11942 BLACKHOLE is no longer active in 10.1 by default, mysql_upgrade not handling the situation +# +source include/have_innodb.inc; +source include/not_embedded.inc; + +if (!$HA_BLACKHOLE_SO) { + skip Need blackhole plugin; +} +if (!$HA_ARCHIVE_SO) { + skip Need Archive plugin; +} + +let $datadir= `select @@datadir`; + +install soname 'ha_blackhole'; +install soname 'ha_archive'; + +vertical_results; +create table t1 (a int) engine=blackhole; +create table t2 (a int) engine=archive; +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; + +flush tables; +uninstall plugin blackhole; +uninstall plugin archive; +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; + +# upgrade from 10.1 - engines aren't enabled +exec $MYSQL_UPGRADE 2>&1; +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; + +# pretend it's an upgrade from 10.0 +alter table mysql.user drop column default_role, drop column max_statement_time; + +# but mysql_upgrade_info tells otherwise +remove_file $datadir/mysql_upgrade_info; +write_file $datadir/mysql_upgrade_info; +10.1.10-MariaDB +EOF + +# still upgrade from 10.1 +exec $MYSQL_UPGRADE 2>&1; +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; + +alter table mysql.user drop column default_role, drop column max_statement_time; +remove_file $datadir/mysql_upgrade_info; + +# upgrade from 10.0 - engines are enabled +exec $MYSQL_UPGRADE 2>&1; +select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test'; + +drop table t1, t2; + +remove_file $datadir/mysql_upgrade_info; +uninstall plugin blackhole; +uninstall plugin archive; diff --git a/mysql-test/t/mysql_upgrade_ssl.test b/mysql-test/t/mysql_upgrade_ssl.test index 9049bf73821..daf5fad3df7 100644 --- a/mysql-test/t/mysql_upgrade_ssl.test +++ b/mysql-test/t/mysql_upgrade_ssl.test @@ -8,4 +8,5 @@ --echo # Bug#55672 mysql_upgrade dies with internal error --echo # --exec $MYSQL_UPGRADE --skip-verbose --skip-silent --ssl --force 2>&1 ---exit +--let $datadir= `select @@datadir` +--remove_file $datadir/mysql_upgrade_info diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test index 7afe1ad250d..6a496858d22 100644 --- a/mysql-test/t/mysql_upgrade_view.test +++ b/mysql-test/t/mysql_upgrade_view.test @@ -183,5 +183,6 @@ flush tables; # back to mariadb default drop table mysql.event; rename table mysql.ev_bk to mysql.event; +remove_file $MYSQLD_DATADIR/mysql_upgrade_info; drop view v1,v2,v3; drop table t1; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 090ed45c9f9..ea08f540cf3 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2518,6 +2518,7 @@ if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Wind } --exec $MYSQL_DUMP --routines --compact $shell_ready_db_name DROP DATABASE `a\"'``b`; + #" use test; @@ -2573,3 +2574,11 @@ CREATE VIEW nonunique_table_view_name AS SELECT 1; DROP DATABASE db1; DROP DATABASE db2; + +#" +# MDEV-11505 wrong databasename in mysqldump comment +# +let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/bug11505.sql; +let SEARCH_PATTERN=Database: mysql; +exec $MYSQL_DUMP mysql func > $SEARCH_FILE; +source include/search_pattern_in_file.inc; diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test index 95a2be36395..be34e4eac63 100644 --- a/mysql-test/t/partition_column.test +++ b/mysql-test/t/partition_column.test @@ -398,7 +398,7 @@ drop table t1; create table t1 as select to_seconds(null) as to_seconds; select data_type from information_schema.columns -where column_name='to_seconds'; +where table_schema='test' and column_name='to_seconds'; drop table t1; --error ER_PARSE_ERROR diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index a05e086d79b..300121e88fd 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -819,6 +819,104 @@ INSERT INTO t1 (d) VALUES ('1991-01-01'); SELECT * FROM t1 WHERE d = '1991-01-01'; DROP TABLE t1; +set global default_storage_engine=default; + +--echo # +--echo # MDEV-9455: [ERROR] mysqld got signal 11 +--echo # + +CREATE TABLE `t1` ( + `DIARY_TOTAL_DAY_SEQ` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `IMORY_ID` bigint(20) NOT NULL, + `NAME` varchar(75) DEFAULT NULL, + `DATETIME` varchar(10) NOT NULL DEFAULT '', + `DAILY_CALL_CNT` int(11) DEFAULT NULL, + `DAILY_SMS_CNT` int(11) DEFAULT NULL, + `NUMBER` varchar(64) DEFAULT NULL, + `DURATION` varchar(16) DEFAULT NULL, + PRIMARY KEY (`DIARY_TOTAL_DAY_SEQ`,`DATETIME`), + KEY `IDX_t1_01` (`IMORY_ID`,`DATETIME`) +) AUTO_INCREMENT=328702514 DEFAULT CHARSET=utf8mb4 +PARTITION BY RANGE COLUMNS(`DATETIME`) +(PARTITION p0 VALUES LESS THAN ('2015-10-01') ENGINE = InnoDB, + PARTITION p1 VALUES LESS THAN ('2015-11-01') ENGINE = InnoDB, + PARTITION p2 VALUES LESS THAN ('2015-12-01') ENGINE = InnoDB, + PARTITION p3 VALUES LESS THAN ('2016-01-01') ENGINE = InnoDB, + PARTITION p4 VALUES LESS THAN ('2016-02-01') ENGINE = InnoDB, + PARTITION p5 VALUES LESS THAN ('2016-03-01') ENGINE = InnoDB, + PARTITION p6 VALUES LESS THAN ('2016-04-01') ENGINE = InnoDB, + PARTITION p7 VALUES LESS THAN ('2016-05-01') ENGINE = InnoDB, + PARTITION p8 VALUES LESS THAN ('2016-06-01') ENGINE = InnoDB, + PARTITION p9 VALUES LESS THAN ('2016-07-01') ENGINE = InnoDB, + PARTITION p10 VALUES LESS THAN ('2016-08-01') ENGINE = InnoDB) +; + +CREATE TABLE `t2` ( + `DIARY_SEQ` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `IMORY_ID` bigint(20) NOT NULL, + `CALL_TYPE` varchar(1) DEFAULT NULL, + `DATA_TYPE` varchar(1) DEFAULT NULL, + `FEATURES` varchar(1) DEFAULT NULL, + `NAME` varchar(75) DEFAULT NULL, + `NUMBER` varchar(64) DEFAULT NULL, + `DATETIME` datetime NOT NULL, + `REG_DATE` datetime NOT NULL, + `TITLE` varchar(50) DEFAULT NULL, + `BODY` varchar(4200) DEFAULT NULL, + `MIME_TYPE` varchar(32) DEFAULT NULL, + `DURATION` varchar(16) DEFAULT NULL, + `DEVICE_ID` varchar(64) DEFAULT NULL, + `DEVICE_NAME` varchar(32) DEFAULT NULL, + PRIMARY KEY (`DIARY_SEQ`,`DATETIME`,`REG_DATE`), + KEY `IDX_TB_DIARY_01` (`IMORY_ID`,`DATETIME`,`CALL_TYPE`,`NUMBER`), + KEY `IDX_TB_DIARY_02` (`REG_DATE`) +) AUTO_INCREMENT=688799006 DEFAULT CHARSET=utf8mb4 +PARTITION BY RANGE COLUMNS(REG_DATE) +(PARTITION p0 VALUES LESS THAN ('2015-10-01') ENGINE = InnoDB, + PARTITION p1 VALUES LESS THAN ('2015-11-01') ENGINE = InnoDB, + PARTITION p2 VALUES LESS THAN ('2015-12-01') ENGINE = InnoDB, + PARTITION p3 VALUES LESS THAN ('2016-01-01') ENGINE = InnoDB, + PARTITION p4 VALUES LESS THAN ('2016-02-01') ENGINE = InnoDB, + PARTITION p5 VALUES LESS THAN ('2016-03-01') ENGINE = InnoDB, + PARTITION p6 VALUES LESS THAN ('2016-04-01') ENGINE = InnoDB, + PARTITION p7 VALUES LESS THAN ('2016-05-01') ENGINE = InnoDB, + PARTITION p8 VALUES LESS THAN ('2016-06-01') ENGINE = InnoDB, + PARTITION p9 VALUES LESS THAN ('2016-07-01') ENGINE = InnoDB, + PARTITION p10 VALUES LESS THAN ('2016-08-01') ENGINE = InnoDB) +; + +SELECT + A.IMORY_ID, + A.NUMBER, + A.NAME, + DATE_FORMAT(A.DATETIME, '%Y-%m-%d') AS TARGET_DATE, + SUM( CASE WHEN A.DATA_TYPE='1' THEN 1 ELSE 0 END) AS CALL_CNT, + SUM( CASE WHEN A.DATA_TYPE IN ('2', '3') THEN 1 ELSE 0 END) AS SMS_CNT, + SUM(CAST(A.DURATION AS INT)) AS DURATION, + ( SELECT COUNT(*) + FROM t1 + WHERE IMORY_ID=A.IMORY_ID + AND NUMBER=A.NUMBER + AND NAME=A.NAME + AND DATETIME = DATE_FORMAT(A.DATETIME, '%Y-%m-%d') + ) STATS_COUNT +FROM t2 A +WHERE A.IMORY_ID = 55094102 + AND A.DATETIME LIKE ( + SELECT CONCAT (DATE_FORMAT(DATETIME, '%Y-%m-%d') ,'%') + FROM t2 + WHERE IMORY_ID=55094102 + AND DIARY_SEQ IN ( 608351221, 608351225, 608351229 ) + group by DATE_FORMAT(DATETIME, '%Y-%m-%d') + ) +GROUP BY A.IMORY_ID, A.NUMBER, A.NAME, DATE_FORMAT(A.DATETIME, '%Y-%m-%d') +; + +drop table t2, t1; + + +set global default_storage_engine='innodb'; + --echo # --echo # MDEV-5963: InnoDB: Assertion failure in file row0sel.cc line 2503, --echo # Failing assertion: 0 with "key ptr now exceeds key end by 762 bytes" diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test index d07637057e0..4d083c37b68 100644 --- a/mysql-test/t/partition_myisam.test +++ b/mysql-test/t/partition_myisam.test @@ -216,6 +216,28 @@ PARTITION BY RANGE (a) PARTITION pMax VALUES LESS THAN MAXVALUE); INSERT INTO t1 VALUES (1, "Partition p1, first row"); DROP TABLE t1; + +--echo # +--echo # MDEV-10418 Assertion `m_extra_cache' failed +--echo # in ha_partition::late_extra_cache(uint) +--echo # + +CREATE TABLE t1 (f1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (f2 INT) ENGINE=MyISAM PARTITION BY RANGE(f2) (PARTITION pmax VALUES LESS THAN MAXVALUE); +INSERT INTO t2 VALUES (8); + +CREATE ALGORITHM = MERGE VIEW v AS SELECT f2 FROM t2, t1; + +UPDATE v SET f2 = 1; + +SELECT * FROM t2; + +DROP VIEW v; +DROP TABLE t2; +DROP TABLE t1; + --echo # --echo # bug#11760213-52599: ALTER TABLE REMOVE PARTITIONING ON NON-PARTITIONED --echo # TABLE CORRUPTS MYISAM diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test index 81b8ba6e0a3..c3c18b7e427 100644 --- a/mysql-test/t/plugin_auth.test +++ b/mysql-test/t/plugin_auth.test @@ -522,6 +522,8 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND COLUMN_NAME IN ('plugin', 'authentication_string') ORDER BY COLUMN_NAME; +let $datadir= `select @@datadir`; +remove_file $datadir/mysql_upgrade_info; --echo # diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 549814724d2..b6d1b4862a6 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3548,9 +3548,6 @@ EXECUTE s1; DEALLOCATE PREPARE s1; ---echo # ---echo # End of 5.5 tests. - ########################################################################### # # restoring of the Item tree in BETWEEN with dates @@ -3697,6 +3694,40 @@ EXECUTE stmt; deallocate prepare stmt; drop table t1,t2,t3,t4; +--echo # +--echo # MDEV-11859: the plans for the first and the second executions +--echo # of PS are not the same +--echo # + +create table t1 (id int, c varchar(3), key idx(c))engine=myisam; +insert into t1 values (3,'bar'), (1,'xxx'), (2,'foo'), (5,'yyy'); + +prepare stmt1 from +"explain extended + select * from t1 where (1, 2) in ( select 3, 4 ) or c = 'foo'"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + +prepare stmt1 from +"select * from t1 where (1, 2) in ( select 3, 4 ) or c = 'foo'"; +flush status; +execute stmt1; +show status like '%Handler_read%'; +flush status; +execute stmt1; +show status like '%Handler_read%'; +deallocate prepare stmt1; + +prepare stmt2 from +"explain extended + select * from t1 where (1, 2) in ( select 3, 4 )"; +execute stmt2; +execute stmt2; +deallocate prepare stmt2; + +drop table t1; + --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/range_vs_index_merge.test b/mysql-test/t/range_vs_index_merge.test index 7ecca454f4c..5d12d46c9e9 100644 --- a/mysql-test/t/range_vs_index_merge.test +++ b/mysql-test/t/range_vs_index_merge.test @@ -57,9 +57,9 @@ SELECT * FROM City EXPLAIN SELECT * FROM City WHERE Population > 100000 AND Name LIKE 'Aba%' OR - Country IN ('CAN', 'ARG') AND ID < 3800 OR - Country < 'U' AND Name LIKE 'Zhu%' OR - ID BETWEEN 3800 AND 3810; + Country IN ('CAN', 'ARG') AND ID BETWEEN 120 AND 130 OR + Country <= 'ALB' AND Name LIKE 'L%' OR + ID BETWEEN 3807 AND 3810; # The output of the next 3 commands tells us about selectivities # of the conditions utilized in 2 queries following after them @@ -1206,6 +1206,41 @@ SELECT * FROM t1 DROP TABLE t1; + +--echo # +--echo # MDEV-8603: Wrong result OR/AND condition over index fields +--echo # + +CREATE TABLE t1 ( + id INT NOT NULL, + state VARCHAR(64), + capital VARCHAR(64), + UNIQUE KEY (id), + KEY state (state,id), + KEY capital (capital, id) +); + +INSERT INTO t1 VALUES + (1,'Arizona','Phoenix'), + (2,'Hawaii','Honolulu'), + (3,'Georgia','Atlanta'), + (4,'Florida','Tallahassee'), + (5,'Alaska','Juneau'), + (6,'Michigan','Lansing'), + (7,'Pennsylvania','Harrisburg'), + (8,'Virginia','Richmond') +; + +EXPLAIN +SELECT * FROM t1 FORCE KEY (state,capital) +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 + OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; +SELECT * FROM t1 FORCE KEY (state,capital) +WHERE ( state = 'Alabama' OR state >= 'Colorado' ) AND id != 9 + OR ( capital >= 'Topeka' OR state = 'Kansas' ) AND state != 'Texas'; + +DROP TABLE t1; + #the following command must be the last one in the file set session optimizer_switch='index_merge_sort_intersection=default'; diff --git a/mysql-test/t/repair_symlink-5543.test b/mysql-test/t/repair_symlink-5543.test index 58cc810b1a9..4c120334d05 100644 --- a/mysql-test/t/repair_symlink-5543.test +++ b/mysql-test/t/repair_symlink-5543.test @@ -9,7 +9,9 @@ eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR'; insert t1 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--echo # Some systems fail with errcode 40, when doing openat, while others +--echo # don't have openat and fail with errcode 20. +--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /40/20/ /".*"/"<errmsg>"/ repair table t1; drop table t1; @@ -17,7 +19,7 @@ drop table t1; eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR'; insert t2 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /40/20/ /".*"/"<errmsg>"/ repair table t2; drop table t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 08f7fa5035b..3ca210d9904 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9411,6 +9411,46 @@ drop procedure p1; drop table t1,t2,t3,t4,t5,t6; +--echo # +--echo # MDEV-11935: Queries in stored procedures with and +--echo # EXISTS(SELECT * FROM VIEW) crashes and closes hte conneciton. +--echo # + +CREATE TABLE ANY_TABLE ( + ENTITY_UID BIGINT NOT NULL +); +CREATE TABLE SECURITY_PATH( +origid BIGINT UNSIGNED NOT NULL, +destid BIGINT UNSIGNED NOT NULL, +KEY (destid) +); +CREATE VIEW ENTITY_ACCESS ( +ENTITY_UID, +OWNER_UID +) AS +SELECT SP1.origid, + SP2.destid +FROM SECURITY_PATH SP1 +JOIN SECURITY_PATH SP2 ON SP1.destid = SP2.origid +; +--delimiter // +CREATE PROCEDURE SP_EXAMPLE_SELECT () +BEGIN + SELECT * + FROM ANY_TABLE AT1 + WHERE EXISTS ( SELECT * + FROM ENTITY_ACCESS EA + WHERE AT1.ENTITY_UID = EA.ENTITY_UID + AND EA.OWNER_UID IS NULL ); +END +// +--delimiter ; +CALL SP_EXAMPLE_SELECT (); +CALL SP_EXAMPLE_SELECT (); + +drop procedure SP_EXAMPLE_SELECT; +drop view ENTITY_ACCESS; +drop table ANY_TABLE, SECURITY_PATH; --echo # End of 10.0 test DELIMITER |; diff --git a/mysql-test/t/stat_tables_par.test b/mysql-test/t/stat_tables_par.test index 7305d1453a8..1866eb71d3b 100644 --- a/mysql-test/t/stat_tables_par.test +++ b/mysql-test/t/stat_tables_par.test @@ -44,7 +44,7 @@ select * from mysql.index_stats; # let $Q6= -select sum(l_extendedprice*l_discount) as revenue +select round(sum(l_extendedprice*l_discount),4) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < date '1994-01-01' + interval '1' year diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 253160c46ac..d4ccbcf6f66 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -1997,6 +1997,41 @@ EXECUTE stmt; drop table t1, t2, t3; +--echo # +--echo # MDEV-11078: NULL NOT IN (non-empty subquery) should never return results +--echo # + +create table t1(a int,b int); +create table t2(a int,b int); +insert into t1 value (1,2); +select (NULL) in (select 1 from t1); +select (null) in (select 1 from t2); +select 1 in (select 1 from t1); +select 1 in (select 1 from t2); +select 1 from dual where null in (select 1 from t1); +select 1 from dual where null in (select 1 from t2); +select (null,null) in (select * from t1); +select (null,null) in (select * from t2); +select 1 from dual where null not in (select 1 from t1); +select 1 from dual where null not in (select 1 from t2); +drop table t1,t2; + + +--echo # +--echo # MDEV-6486: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' +--echo # failed with SELECT SQ, TEXT field +--echo # + +CREATE TABLE t1 (a VARCHAR(8), KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('foo'),( 'bar'); + +CREATE TABLE t2 (b VARCHAR(8), c TINYTEXT, KEY(b)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('baz','baz'),('qux', 'qux'); + +SELECT ( SELECT COUNT(*) FROM t1 WHERE a = c ) AS field, COUNT(DISTINCT c) +FROM t2 WHERE b <= 'quux' GROUP BY field; +drop table t1,t2; + SET optimizer_switch= @@global.optimizer_switch; set @@tmp_table_size= @@global.tmp_table_size; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index af6ec90ba74..b26c5036f3f 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -483,6 +483,26 @@ drop table t1; set optimizer_switch=@subselect_innodb_tmp; --echo # +--echo # MDEV-9635:Server crashes in part_of_refkey or assertion +--echo # `!created && key_to_save < (int)s->keys' failed in +--echo # TABLE::use_index(int) or with join_cache_level>2 +--echo # + +SET join_cache_level=3; + +CREATE TABLE t1 (f1 VARCHAR(1024)) ENGINE=InnoDB; +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; + +CREATE TABLE t2 (f2 VARCHAR(4)) ENGINE=InnoDB; +INSERT INTO t2 VALUES ('foo'),('bar'); + +SELECT * FROM v1, t2 WHERE ( f1, f2 ) IN ( SELECT f1, f1 FROM t1 ); + +set join_cache_level = default; +drop view v1; +drop table t1,t2; + +--echo # --echo # MDEV-6041: ORDER BY+subqueries: subquery_table.key=outer_table.col is not recongized as binding --echo # create table t1(a int) engine=innodb; @@ -535,4 +555,3 @@ from t1; drop table t1,t2; - diff --git a/mysql-test/t/symlink-aria-11902.test b/mysql-test/t/symlink-aria-11902.test new file mode 100644 index 00000000000..a2a266cbb25 --- /dev/null +++ b/mysql-test/t/symlink-aria-11902.test @@ -0,0 +1,6 @@ +# +# MDEV-11902 mi_open race condition +# +source include/have_maria.inc; +set default_storage_engine=Aria; +source symlink-myisam-11902.test; diff --git a/mysql-test/t/symlink-myisam-11902.test b/mysql-test/t/symlink-myisam-11902.test new file mode 100644 index 00000000000..8fd4961d1fb --- /dev/null +++ b/mysql-test/t/symlink-myisam-11902.test @@ -0,0 +1,60 @@ +# +# MDEV-11902 mi_open race condition +# +source include/have_debug_sync.inc; +source include/have_symlink.inc; +source include/not_windows.inc; +call mtr.add_suppression("File.*t1.* not found"); + +create table mysql.t1 (a int, b char(16), index(a)); +insert mysql.t1 values (100, 'test'),(101,'test'); +let $datadir=`select @@datadir`; + +exec mkdir $MYSQLTEST_VARDIR/tmp/foo; +replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR; +eval create table t1 (a int, b char(16), index(a)) + data directory="$MYSQLTEST_VARDIR/tmp/foo"; +insert t1 values (200, 'some'),(201,'some'); +select * from t1; +flush tables; +set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go'; +send select * from t1; +connect con1, localhost, root; +set debug_sync='now WAIT_FOR ok'; +exec rm -r $MYSQLTEST_VARDIR/tmp/foo; +exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo; +set debug_sync='now SIGNAL go'; +connection default; +replace_regex / '.*\/tmp\// 'MYSQLTEST_VARDIR\/tmp\// /31/20/ /40/20/ /20.*/20 <errmsg>)/; +error 29; +reap; +flush tables; +drop table if exists t1; +exec rm -r $MYSQLTEST_VARDIR/tmp/foo; + +# same with INDEX DIRECTORY +exec mkdir $MYSQLTEST_VARDIR/tmp/foo; +replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR; +eval create table t1 (a int, b char(16), index (a)) + index directory="$MYSQLTEST_VARDIR/tmp/foo"; +insert t1 values (200, 'some'),(201,'some'); +explain select a from t1; +select a from t1; +flush tables; +set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run'; +send select a from t1; +connection con1; +set debug_sync='now WAIT_FOR waiting'; +exec rm -r $MYSQLTEST_VARDIR/tmp/foo; +exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo; +set debug_sync='now SIGNAL run'; +connection default; +replace_regex / '.*\/test\// '.\/test\// /31/20/ /40/20/ /20.*/20 <errmsg>)/; +error ER_FILE_NOT_FOUND; +reap; +flush tables; +drop table if exists t1; +exec rm -r $MYSQLTEST_VARDIR/tmp/foo; + +drop table mysql.t1; +set debug_sync='RESET'; diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test index 52857f9169f..8de4743b9fd 100644 --- a/mysql-test/t/table_elim.test +++ b/mysql-test/t/table_elim.test @@ -534,12 +534,12 @@ INSERT IGNORE INTO t1 VALUES (0,'g'); CREATE TABLE t3 ( a varchar(1)) ; INSERT IGNORE INTO t3 VALUES ('g'); -CREATE TABLE t2 ( a int(11) NOT NULL, PRIMARY KEY (a)) ; +CREATE TABLE t2 ( a int(11) NOT NULL, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (9), (10); create view v1 as SELECT t1.* FROM t1 LEFT JOIN t2 ON ( t1.a = t2.a ) WHERE t2.a <> 0; SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b ); EXPLAIN SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b ); - drop view v1; DROP TABLE t1,t2,t3; diff --git a/mysql-test/t/trigger_no_defaults-11698.test b/mysql-test/t/trigger_no_defaults-11698.test index fab7845ad7d..c10bec68314 100644 --- a/mysql-test/t/trigger_no_defaults-11698.test +++ b/mysql-test/t/trigger_no_defaults-11698.test @@ -23,3 +23,20 @@ insert t1 (b) values (20); insert t1 (b) values (30); select * from t1; drop table t1; +set sql_mode=default; + +# +# MDEV-11842 Fail to insert on a table where a field has no default +# +set sql_mode=''; +create table t1 ( + id int(11) not null auto_increment primary key, + data1 varchar(10) not null, + data2 varchar(10) not null +); +insert into t1 (data2) values ('x'); +create trigger test_trigger before insert on t1 for each row begin end; +insert into t1 (data2) values ('y'); +select * from t1; +drop table t1; +set sql_mode=default; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index eb0fac57150..dd5311e4be3 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1738,12 +1738,39 @@ SHOW CREATE TABLE t1; DROP TABLE t1; --echo # +--echo # Bug#18408499 UNSIGNED BIGINT HIGH VALUES +--echo # WRONG NUMERICAL COMPARISON RESULTS +--echo # + +CREATE TABLE t1(value DECIMAL(24,0) NOT NULL); +INSERT INTO t1(value) +VALUES('100000000000000000000001'), + ('100000000000000000000002'), + ('100000000000000000000003'); +SELECT * FROM t1 WHERE value = '100000000000000000000002'; +SELECT * FROM t1 WHERE '100000000000000000000002' = value; +SELECT * FROM t1 WHERE value + 0 = '100000000000000000000002'; +SELECT * FROM t1 WHERE value = 100000000000000000000002; +SELECT * FROM t1 WHERE value + 0 = 100000000000000000000002; + +PREPARE stmt FROM 'SELECT * FROM t1 WHERE value = ?'; +set @a="100000000000000000000002"; +EXECUTE stmt using @a; +set @a=100000000000000000000002; +EXECUTE stmt using @a; +DEALLOCATE PREPARE stmt; + +ALTER TABLE t1 ADD INDEX value (value); +SELECT * FROM t1 WHERE value = '100000000000000000000002'; +DROP TABLE t1; + +--echo # --echo # End of 10.1 tests --echo # --echo # --echo # Test CREATE .. SELECT ---echo +--echo # create or replace table t1 as select 1.000000000000000000000000000000000 as a; show create table t1; diff --git a/mysql-test/t/update_innodb.test b/mysql-test/t/update_innodb.test index 67c356c4e2e..0e93e7d9593 100644 --- a/mysql-test/t/update_innodb.test +++ b/mysql-test/t/update_innodb.test @@ -37,3 +37,29 @@ UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON v drop view v1; drop table t1,t2,t3,t4; + +--echo # +--echo # MDEV-10232 Scalar result of subquery changes after adding an outer select stmt +--echo # + +CREATE TABLE t1 ( + a_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + b_id INT(20) UNSIGNED NULL DEFAULT NULL, + c_id VARCHAR(255) NULL DEFAULT NULL, + PRIMARY KEY (a_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB; + +CREATE TABLE t2 ( + b_id INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + c_id VARCHAR(255) NULL DEFAULT NULL, + PRIMARY KEY (b_id), + INDEX idx_c_id (c_id))COLLATE = 'utf8_general_ci' ENGINE = InnoDB; + +INSERT INTO t1 (b_id, c_id) VALUES (NULL, NULL); +INSERT INTO t2 (c_id) VALUES (NULL); +INSERT INTO t2 (c_id) VALUES (NULL); + +SELECT * FROM t1; +SELECT t2.b_id FROM t1,t2 WHERE t2.c_id = t1.c_id; +UPDATE t1 SET b_id = (SELECT t2.b_id FROM t2 t2 WHERE t2.c_id = t1.c_id); +SELECT * FROM t1; +drop table t1,t2; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index e5dd22c64c3..eaaebba166c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -5508,6 +5508,66 @@ SHOW CREATE VIEW v1; drop view v1; drop table t1,t2; + +--echo # +--echo # MDEV-12099: usage of mergeable view with LEFT JOIN +--echo # that can be converted to INNER JOIN +--echo # + +create table t1 (a int, b int, key(a)) engine=myisam; +insert into t1 values + (3,20), (7,10), (2,10), (4,30), (8,70), + (7,70), (9,100), (9,60), (8,80), (7,60); + +create table t2 (c int, d int, key (c)) engine=myisam; +insert into t2 values + (50,100), (20, 200), (10,300), + (150,100), (120, 200), (110,300), + (250,100), (220, 200), (210,300); + +create table t3(e int, f int not null, key(e), unique (f)) engine=myisam; +insert into t3 values + (100, 3), (300, 5), (400, 4), (300,7), + (300,2), (600, 13), (800, 15), (700, 14), + (600, 23), (800, 25), (700, 24); + +create view v1 as + select * from t2 left join t3 on t3.e=t2.d where t3.f is not null; + +select * + from t1 left join v1 on v1.c=t1.b + where t1.a < 5; + +select * + from t1 left join ( t2 left join t3 on t3.e=t2.d ) + on t2.c=t1.b and t3.f is not null + where t1.a < 5; + +explain extended +select * + from t1 left join v1 on v1.c=t1.b + where t1.a < 5; + +explain extended +select * + from t1 left join ( t2 left join t3 on t3.e=t2.d ) + on t2.c=t1.b and t3.f is not null + where t1.a < 5; + +explain extended +select * + from t1 left join v1 on v1.c=t1.b and v1.f=t1.a + where t1.a < 5; + +explain extended +select * + from t1 left join ( t2 left join t3 on t3.e=t2.d ) + on t2.c=t1.b and t3.f=t1.a and t3.f is not null + where t1.a < 5; + +drop view v1; +drop table t1,t2,t3; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.5 tests. --echo # ----------------------------------------------------------------- diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 42985e1d66d..4812456839d 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -1,17 +1,17 @@ ############################################################################## # # List the test cases which, unlike tests from disabled.def files, -# can still be run on the current tree meaningfully, but are known +# can still be run on the current tree meaningfully, but are known # or suspected to fail sporadically on different reasons. # # Most common reasons are either test failures observed in buildbot, -# or recent modifications to the tests which make their stability -# unknown. +# or recent modifications to the tests which make their stability +# unknown. # -# Tests included due to recent modifications are later removed from the -# list, if during a certain period they do not fail (and are not -# modified again). Tests included due to intermittent failures are -# removed when corresponding bug reports are closed. +# Tests included due to recent modifications are later removed from the +# list, if during a certain period they do not fail (and are not +# modified again). Tests included due to intermittent failures are +# removed when corresponding bug reports are closed. # # Separate the test case name and the comment with ':'. # @@ -19,17 +19,18 @@ # # '*' wildcard in testcase names is supported. # -# To use the list, run MTR with --skip-test-list=unstable-tests option. +# To use the list, run MTR with --skip-test-list=unstable-tests option. # ############################################################################## -main.alter_table : Modified in 10.1.21 +main.alter_table : Modified in 10.1.22 main.alter_table_trans : MDEV-11805 - timeout -main.analyze_stmt_slow_query_log : Modified in 10.1.21 +main.analyze_format_json : MDEV-11866 - Wrong result; also uses analyze-format.inc modified in 10.1.22 +main.analyze_stmt_orderby : MDEV-11866 - Wrong result; also uses analyze-format.inc modified in 10.1.22 +main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result; also modified in 10.1.21 main.cast : Modified in 10.1.21 main.create : Modified in 10.1.21 main.create_delayed : MDEV-10605 - failed with timeout -main.create_drop_binlog : Uses binlog_start_pos.inc modified in 10.1.20 main.ctype_ucs : Modified in 10.1.21 main.ctype_ucs2_def : Modified in 10.1.21 main.ctype_ucs2_query_cache : Modified in 10.1.21 @@ -37,64 +38,68 @@ main.ctype_utf16 : Modified in 10.1.21 main.ctype_utf16_def : Modified in 10.1.21 main.ctype_utf16le : MDEV-10675: timeout or extra warnings main.ctype_utf32 : Modified in 10.1.21 -main.ctype_utf8 : Modified in 10.1.20 -main.ctype_utf8mb4 : Modified in 10.1.20 -main.default : Modified in 10.1.20 -main.derived : Modified in 10.1.20 -main.derived_view : Modified in 10.1.20 -main.events_restart : MDEV-11221: assertion failure +main.derived : Modified in 10.1.22 +main.drop_bad_db_type : Modified in 10.1.22 +main.events_restart : MDEV-12236 - Server shutdown problem main.events_slowlog : Added in 10.1.21 -main.fulltext_charsets : Added in 10.1.20 +main.explain_json : Uses analyze-format.inc modified in 10.1.22 +main.explain_json_format_partitions : Uses analyze-format.inc modified in 10.1.22 main.func_time : Modified in 10.1.21 -main.group_by : Modified in 10.1.20 -main.group_by_innodb : Modified in 10.1.20 +main.gis : Modified in 10.1.22 +main.grant : Modified in 10.1.22 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout main.index_merge_innodb : MDEV-7142 - Wrong execution plan, also modified in 10.1.21 main.information_schema_part : Modified in 10.1.21 main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure main.join_cache : Modified in 10.1.21 +main.join_nested : MOdified in 10.1.22 main.kill_processlist-6619 : MDEV-10793 - wrong result in processlist main.loaddata : Modified in 10.1.21 main.log_slow : Modified in 10.1.21 -main.lowercase_fs_on : Uses search_pattern_in_file.inc modified in 10.1.20 main.mdev-504 : MDEV-10607 - sporadic "can't connect" main.mdev375 : MDEV-10607 - sporadic "can't connect" main.merge : MDEV-10607 - sporadic "can't connect" -main.mysqlbinlog : Uses binlog_start_pos.inc modified in 10.1.20 -main.mysqldump-max : Uses binlog_start_pos.inc modified in 10.1.20 +main.mysqldump : Modified in 10.1.22 main.mysqlslap : MDEV-11801 - timeout main.mysqltest : MDEV-9269 - fails on Alpha -main.named_pipe : Uses search_pattern_in_file.inc modified in 10.1.20 +main.mysql_upgrade_noengine : MDEV-12233 - Wrong result; added in 10.1.22 main.order_by : Modified in 10.1.21 main.order_by_optimizer_innodb : MDEV-10683 - wrong execution plan -main.parser : Modified in 10.1.20 +main.partition_column : Modified in 10.1.22 +main.partition_innodb : Modified in 10.1.22 +main.partition_myisam : Modified in 10.1.22 main.pool_of_threads : Modified in 10.1.21 -main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count -main.selectivity : Modified in 10.1.20 +main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; also modified in 10.1.22 +main.range_vs_index_merge : Modified in 10.1.22 +main.repair_symlink-5543 : MDEV-12215 - Wrong error codes; also modified in 10.1.22 main.show_explain : MDEV-10674 - sporadic failure main.signal_demo3 : MDEV-11720 - Thread stack overrun on labrador -main.sp : Modified in 10.1.21 +main.sp : Modified in 10.1.22 main.sp-prelocking : Modified in 10.1.21 main.sp-security : MDEV-10607 - sporadic "can't connect" -main.stat_tables_par_innodb : MDEV-10515 - sporadic wrong results -main.statistics : Modified in 10.1.20 +main.stat_tables_par : Modified in 10.1.22 main.status : MDEV-8510 - sporadic wrong result main.subselect : Modified in 10.1.21 main.subselect2 : Modified in 10.1.21 -main.subselect4 : Modified in 10.1.21 -main.subselect_innodb : MDEV-10614 - sporadic wrong results +main.subselect4 : Modified in 10.1.22 +main.subselect_cache : Modified in 10.1.22 +main.subselect_innodb : MDEV-10614 - sporadic wrong results; also modified in 10.1.22 main.subselect_no_exists_to_in : Uses subselect.test modified in 10.1.21 main.subselect_no_mat : Uses subselect.test modified in 10.1.21 main.subselect_no_opts : Uses subselect.test modified in 10.1.21 main.subselect_no_scache : Uses subselect.test modified in 10.1.21 main.subselect_no_semijoin : Uses subselect.test modified in 10.1.21 +main.symlink-aria-11902 : MDEV-12215 - Unexpected errors; also added in 10.1.22 +main.symlink-myisam-11902 : MDEV-12215 - Unexpected errors; also added in 10.1.22 +main.table_elim : Modified in 10.1.22 main.trigger_null-8605 : Modified in 10.1.21 +main.trigger_no_defaults-11698 : Modified in 10.1.22 main.type_datetime_hires : MDEV-10687 - timeout -main.type_decimal : Modified in 10.1.20 +main.type_newdecimal : Modified in 10.1.22 main.union : Modified in 10.1.21 -main.view : Modified in 10.1.21 -main.wait_timeout_not_windows : Uses search_pattern_in_file.inc modified in 10.1.20 +main.update_innodb : Modified in 10.1.22 +main.view : Modified in 10.1.22 #---------------------------------------------------------------- @@ -104,50 +109,49 @@ archive.discover : MDEV-10510 - table is marked as crashed; modified in 10.1. #---------------------------------------------------------------- binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed -binlog.binlog_incident : Uses binlog_start_pos.inc modified in 10.1.20 -binlog.binlog_killed : Uses binlog_start_pos.inc modified in 10.1.20 -binlog.binlog_killed_simulate : Uses binlog_start_pos.inc modified in 10.1.20 -binlog.binlog_mysqlbinlog2 : Uses binlog_start_pos.inc modified in 10.1.20 -binlog.mix_innodb_myisam_binlog : Uses binlog_start_pos.inc modified in 10.1.20 -binlog.binlog_row_annotate : Uses binlog_start_pos.inc modified in 10.1.20 +binlog.binlog_max_binlog_stmt_cache_size : Added in 10.1.22 binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint #---------------------------------------------------------------- -binlog_encryption.* : Added in 10.1.20 +binlog_encryption.* : Added in 10.1.20, still unstable (valgrind errors and such) + +binlog_encryption.rpl_parallel : MDEV-10653 - Timeout +binlog_encryption.rpl_semi_sync : MDEV-11220 - Wrong result +binlog_encryption.rpl_ssl : MDEV-11542 - Server crash #---------------------------------------------------------------- connect.jdbc : Modified in 10.1.21 connect.jdbc_new : Modified in 10.1.21 connect.tbl : MDEV-9844, MDEV-10179 - sporadic crashes, valgrind warnings, wrong results +connect.xml_zip : Added in 10.1.22 +connect.zip : Added in 10.1.22 #---------------------------------------------------------------- encryption.create_or_replace : MDEV-9359 - Assertion failure -encryption.encrypt_and_grep : MDEV-11222 - InnoDB error; also uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_emptyfile : Uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_encfile_bad : Uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_encfile_badfile : Uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_encfile_no : Uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_nofile : Uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_syntax : Uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_tooshort : Uses search_pattern_in_file.inc modified in 10.1.20 -encryption.filekeys_unencfile : Uses search_pattern_in_file.inc modified in 10.1.20 +encryption.encrypt_and_grep : MDEV-11222 - InnoDB error +encryption.innodb-bad-key-change : Modified in 10.1.22 +encryption.innodb-bad-key-change2 : Modified in 10.1.22 encryption.innodb-bad-key-change3 : Modified in 10.1.21 -encryption.innodb-bad-key-shutdown : MDEV-9105 - valgrind warnings, assertion failures +encryption.innodb-bad-key-change4 : Modified in 10.1.22 +encryption.innodb-bad-key-change5 : Modified in 10.1.22 +encryption.innodb-bad-key-shutdown : MDEV-9105 - valgrind warnings, assertion failures; also modified in 10.1.22 encryption.innodb-discard-import : Modified in 10.1.21 encryption.innodb-discard-import-change : Modified in 10.1.21 +encryption.innodb-encryption-disable : Modified in 10.1.22 encryption.innodb_encryption_discard_import : MDEV-11218 - wrong result, also modified in 10.1.21 encryption.innodb_encryption_filekeys : MDEV-9962 - timeouts encryption.innodb_encryption-page-compression : MDEV-11420 - Trying to access missing tablespace -encryption.innodb_encryption_row_compressed : Uses search_pattern_in_file.inc modified in 10.1.20 +encryption.innodb_encryption_tables : MDEV-9359 - Assertion failure encryption.innodb_first_page : MDEV-10689 - crashes encryption.innodb-log-encrypt : Modified in 10.1.21 encryption.innodb_lotoftables : MDEV-11531 - InnoDB error, also modified in 10.1.21 -encryption.innodb-missing-key : MDEV-9359 - assertion failure -encryption.innodb_onlinealter_encryption : MDEV-10099 - wrong results; also uses search_pattern_in_file.inc modified in 10.1.20 +encryption.innodb-missing-key : MDEV-9359 - assertion failure; also modified in 10.1.22 +encryption.innodb_onlinealter_encryption : MDEV-10099 - wrong results encryption.innodb-page_encryption : MDEV-10641 - mutex problem +encryption.innodb-read-only : Added in 10.1.22 encryption.innodb_scrub : MDEV-8139, also was modified in 10.1.21 encryption.innodb_scrub_background : MDEV_8139, also was modified in 10.1.21 encryption.innodb_scrub_compressed : MDEV-8139; also was modified and re-enabled in 10.1.21 @@ -159,13 +163,15 @@ engines/funcs.* : Not maintained in timely manner #---------------------------------------------------------------- -federated.federatedx : MDEV-10617 - Wrong checksum, timeouts +federated.federated_bug_35333 : Modified in 10.1.22 federated.federated_innodb : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips federated.federated_partition : MDEV-10417 - Fails on Mips federated.federated_transactions : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips +federated.federatedx : MDEV-10617 - Wrong checksum, timeouts #---------------------------------------------------------------- +funcs_1.is_columns_mysql : Modified in 10.1.22 funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result funcs_2.innodb_charset : Modified in 10.1.21 @@ -174,51 +180,58 @@ funcs_2.myisam_charset : MDEV-11535 - Timeout #---------------------------------------------------------------- +galera.* : suite.pm modified in 10.1.22 + +galera.galera_mdev_10812 : Added in 10.1.22 galera.galera_var_cluster_address : Modified in 10.1.21 galera.galera_var_dirty_reads : Modified in 10.1.21 galera.MW-284 : Modified in 10.1.21 -galera.rpl_row_annotate : Uses binlog_start_pos.inc modified in 10.1.20 -galera_split_brain : Modified in 10.1.21 +galera.galera_split_brain : Modified in 10.1.21 +galera.galera_var_certify_nonPK_off : Modified in 10.1.22 +galera.galera_var_max_ws_rows : Modified in 10.1.22 galera_3nodes.* : MDEV-11490 - Warnings not suppressed #---------------------------------------------------------------- -innodb.101_compatibility : Added in 10.1.21 -innodb.binlog_consistent : MDEV-10618 - Server fails to start; also uses binlog_start_pos.inc modified in 10.1.20 -innodb.doublewrite : Added in 10.1.21 -innodb.group_commit_binlog_pos : Uses binlog_start_pos.inc modified in 10.1.20 -innodb.group_commit_binlog_pos_no_optimize_thread : Uses binlog_start_pos.inc modified in 10.1.20 +innodb.101_compatibility : Modified in 10.1.22 +innodb.alter_key_block_size-11757 : Added in 10.1.22 +innodb.binlog_consistent : MDEV-10618 - Server fails to start +innodb.doublewrite : Modified in 10.1.22 innodb.group_commit_crash : Modified in 10.1.21 innodb.group_commit_crash_no_optimize_thread : Modified in 10.1.21 +innodb.innodb-32k-crash : Modified in 10.1.22 +innodb.innodb-64k-crash : Modified in 10.1.22 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout +innodb.innodb-blob : MDEV-12053 - Client crash; also modified in 10.1.22 +innodb.innodb_blob_unrecoverable_crash : Modified in 10.1.22 innodb.innodb-bug-14068765 : MDEV-9105 - valgrind warnings, assertion failures innodb.innodb-bug-14084530 : MDEV-9105 - valgrind warnings, assertion failures -innodb.innodb_bug14147491 : MDEV-11808, also modified in 10.1.21 -innodb.innodb_bug14676111 : MDEV-11802 - wrong result +innodb.innodb_bug11754376 : Modified in 10.1.22 +innodb.innodb_bug14147491 : MDEV-11808, also modified in 10.1.22 +innodb.innodb_bug14676111 : MDEV-11802 - wrong result; also modified in 10.1.22 innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan +innodb.innodb_bug53756 : Modified in 10.1.22 +innodb.innodb_bug56947 : Modified in 10.1.22 +innodb.innodb_bug59641 : Modified in 10.1.22 innodb.innodb-change-buffer-recovery : Modified in 10.1.21 -innodb.innodb_defragment_fill_factor : Modified in 10.1.20 -innodb.innodb-lock-schedule-algorithm : Modified in 10.1.20 +innodb.innodb-get-fk : Modified in 10.1.22 +innodb.innodb-page_compression_default : Added in 10.1.22 innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem innodb.innodb_stats : MDEV-10682 - wrong result innodb.innodb_sys_semaphore_waits : MDEV-10331 - wrong result innodb.innodb-wl5522 : MDEV-9105 - valgrind warnings, assertion failures innodb.innodb-wl5522-1 : MDEV-9105 - valgrind warnings, assertion failures -innodb.innodb-wl5522-debug-zip : Modified in 10.1.21 +innodb.innodb-wl5522-debug : Modified in 10.1.22 +innodb.innodb-wl5522-debug-zip : Modified in 10.1.22 innodb.log_data_file_size : Added in 10.1.21 -innodb.table_index_statistics : Added in 10.1.20 -innodb.trigger : Modified in 10.1.20 -innodb.xa_recovery : Modified in 10.1.21 - -#---------------------------------------------------------------- +innodb.log_file_size : Added in 10.1.22 +innodb.read_only_recovery : Added in 10.1.22 +innodb.xa_recovery : Modified in 10.1.22 -innodb_fts.create : Added in 10.1.20 - -#---------------------------------------------------------------- - -maria.collations : Added in 10.1.20 -maria.maria-connect : Uses binlog_start_pos.inc modified in 10.1.20 +innodb_fts.crash_recovery : Added in 10.1.22 +innodb_fts.innodb_fts_result_cache_limit : Modified in 10.1.22 +innodb_fts.misc_debug : Added in 10.1.22 #---------------------------------------------------------------- @@ -233,29 +246,61 @@ mroonga/storage.repair_table_no_index_file : MDEV-9364 - #---------------------------------------------------------------- -multi_source.gtid : MDEV-10620, MDEV-10417 - Timeout in wait condition, fails on Mips +multi_source.gtid : MDEV-10417 - Fails on Mips multi_source.info_logs : MDEV-10042 - wrong result -multi_source.multisource : MDEV-10417 - Fails on Mips; also uses binlog_start_pos.inc modified in 10.1.20 -multi_source.reset_slave : MDEV-10690 - wrong result; also uses binlog_start_pos.inc modified in 10.1.20 -multi_source.simple : MDEV-4633 - Wrong slave status output; also uses binlog_start_pos.inc modified in 10.1.20 +multi_source.multisource : MDEV-10417 - Fails on Mips +multi_source.reset_slave : MDEV-10690 - wrong result +multi_source.simple : MDEV-4633 - Wrong slave status output multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_heartbeats #---------------------------------------------------------------- -parts.partition_float_myisam : MDEV-10621 - Testcase timeout -parts.partition_int_myisam : MDEV-10621 - Testcase timeout +oqgraph.regression_mdev6282 : Modified in 10.1.22 +oqgraph.regression_mdev6345 : Modified in 10.1.22 #---------------------------------------------------------------- +parts.partition_bigint_innodb : Added in 10.1.22 +parts.partition_bigint_myisam : Added in 10.1.22 +parts.partition_double_innodb : Added in 10.1.22 +parts.partition_double_myisam : Added in 10.1.22 +parts.partition_float_innodb : Modified in 10.1.22 +parts.partition_float_myisam : Modified in 10.1.22 +parts.partition_int_innodb : Modified in 10.1.22 +parts.partition_int_myisam : Modified in 10.1.22 +parts.partition_mediumint_innodb : Added in 10.1.22 +parts.partition_mediumint_myisam : Added in 10.1.22 +parts.partition_smallint_innodb : Added in 10.1.22 +parts.partition_smallint_myisam : Added in 10.1.22 +parts.partition_tinyint_innodb : Added in 10.1.22 +parts.partition_tinyint_myisam : Added in 10.1.22 + +#---------------------------------------------------------------- + +perfschema.csv_table_io : Uses table_io_result_helper.inc modified in 10.1.22 perfschema.func_file_io : MDEV-5708 - fails for s390x perfschema.func_mutex : MDEV-5708 - fails for s390x +perfschema.indexed_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.innodb_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.memory_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.merge_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.multi_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.myisam_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.part_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.privilege_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.rollback_table_io : Uses table_io_result_helper.inc modified in 10.1.22 perfschema.setup_actors : MDEV-10679 - rare crash perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders -perfschema.threads_mysql : MDEV-10677 - sporadic wrong result +perfschema.table_name : Modified in 10.1.22 +perfschema.temp_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.threads_mysql : MDEV-10677 - sporadic wrong result; also modified in 10.1.22 +perfschema.trigger_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.view_table_io : Uses table_io_result_helper.inc modified in 10.1.22 #---------------------------------------------------------------- +plugins.auth_ed25519 : Added in 10.1.22 plugins.cracklib_password_check : MDEV-11650 - valgrind warnings plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url plugins.server_audit : MDEV-9562 - crashes on sol10-sparc @@ -264,47 +309,34 @@ plugins.two_password_validations : MDEV-11650 - valgrind warnings #---------------------------------------------------------------- -roles.role_case_sensitive-10744 : Added in 10.1.20 -roles.create_and_drop_role : Modified in 10.1.20 - -#---------------------------------------------------------------- - rpl.last_insert_id : MDEV-10625 - warnings in error log rpl.rpl_alter_extra_persistent : Added in 10.1.21 rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log rpl.rpl_binlog_index : MDEV-9501 - Warning: failed registering on master -rpl.rpl_checksum : Uses search_pattern_in_file.inc modified in 10.1.20 -rpl.rpl_checksum_cache : MDEV-10626 - Testcase timeout -rpl.rpl_circular_for_4_hosts : MDEV-10627 - Testcase timeout +rpl.rpl_checksum_cache : MDEV-12173 - Unexpected error rpl.rpl_ddl : MDEV-10417 - Fails on Mips rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result rpl.rpl_gtid_basic : MDEV-10681 - server startup problem rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering on master -rpl.rpl_gtid_errorlog : Uses search_pattern_in_file.inc modified in 10.1.20 -rpl.rpl_gtid_master_promote : MDEV-10628 - Timeout in sync_with_master rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown rpl.rpl_gtid_until : MDEV-10625 - warnings in error log -rpl.rpl_heartbeat_basic : MDEV-11668 - wrong result +rpl.rpl_heartbeat_basic : Modified in 10.1.22 rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips rpl.rpl_mariadb_slave_capability : MDEV-11018 - sporadic wrong events in binlog -rpl.rpl_mdev10863 : Added in 10.1.20 rpl.rpl_mdev6020 : MDEV-10630, MDEV-10417 - Timeouts, fails on Mips -rpl.rpl_mdev6386 : MDEV-10631 - Wrong result on slave -rpl.rpl_parallel : MDEV-10632, MDEV-10653 - Failures to sync, timeouts +rpl.rpl_mdev6386 : Modified in 10.1.22 +rpl.rpl_parallel : MDEV-10653 - Timeouts rpl.rpl_parallel_optimistic : MDEV-10511 - timeout rpl.rpl_parallel_retry : MDEV-11119 - Server crash rpl.rpl_parallel_temptable : MDEV-10356 - Crash in close_thread_tables rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips -rpl.rpl_row_annotate : Uses binlog_start_pos.inc modified in 10.1.20 rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_row_drop_create_temp_table : MDEV-10626 - Testcase timeout -rpl.rpl_row_flsh_tbls : Uses binlog_start_pos.inc modified in 10.1.20 rpl.rpl_row_log_innodb : MDEV-10688 - Wrong result rpl.rpl_row_mysqlbinlog : Modified in 10.1.21 rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x @@ -316,8 +348,6 @@ rpl.rpl_show_slave_hosts : MDEV-10681 - server startup problem rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha rpl.rpl_slave_grp_exec : MDEV-10514 - Unexpected deadlock rpl.rpl_special_charset : Modified in 10.1.21 -rpl.rpl_stm_flsh_tbls : Uses binlog_start_pos.inc modified in 10.1.20 -rpl.rpl_stop_slave_error : Uses search_pattern_in_file.inc modified in 10.1.20 rpl.rpl_sync : MDEV-10633 - Database page corruption rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries rpl.sec_behind_master-5114 : Modified in 10.1.21 @@ -353,16 +383,12 @@ sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s39 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.innodb_buffer_pool_dump_pct_basic : MDEV-10651 - sporadic failure on file_exists sys_vars.innodb_fatal_semaphore_wait_threshold : MDEV-10513 - crashes -sys_vars.replicate_do_db_basic : Modified in 10.1.20 -sys_vars.replicate_do_table_basic : Modified in 10.1.20 -sys_vars.replicate_ignore_db_basic : Modified in 10.1.20 -sys_vars.replicate_ignore_table_basic : Modified in 10.1.20 -sys_vars.replicate_wild_do_table_basic : Modified in 10.1.20 -sys_vars.replicate_wild_ignore_table_basic : Modified in 10.1.20 +sys_vars.innodb_stats_include_delete_marked_basic : Added in 10.1.22 +sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash sys_vars.rpl_init_slave_func : MDEV-10149 - wrong results +sys_vars.secure_file_priv : Modified in 10.1.22 sys_vars.sysvars_innodb : MDEV-6958 - error-prone rdiffs sys_vars.sysvars_server_embedded : MDEV-6958 - error-prone rdiffs -sys_vars.table_open_cache_instances_basic : Modified in 10.1.20 #---------------------------------------------------------------- @@ -370,15 +396,17 @@ tokudb.cluster_filter : MDEV-10678 - Wrong execution plan tokudb.cluster_filter_hidden : MDEV-10678 - Wrong execution plan tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan tokudb.dir_per_db : MDEV-11537 - Wrong result -tokudb.table_index_statistics : Added in 10.1.20 +tokudb.dir_per_db_rename_to_nonexisting_schema : Added in 10.1.22 +tokudb.gap_lock_error : Added in 10.1.22 +tokudb.locks-select-update-3 : Modified in 10.1.22 +tokudb.percona_kill_idle_trx_tokudb : Modified in 10.1.22 + +tokudb_backup.* : suite.opt modified in 10.1.22 tokudb_bugs.checkpoint_lock : MDEV-10637 - Wrong processlist output tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output tokudb_bugs.xa : MDEV-11804 - Lock wait timeout -tokudb_rpl.rpl_parallel_optimistic : Added in 10.1.20 -tokudb_rpl.rpl_tokudb_rfr_partition_table : Added in 10.1.20 - #---------------------------------------------------------------- unit.ma_test_loghandler : MDEV-10638 - record read not ok @@ -387,11 +415,12 @@ unit.ma_test_loghandler : MDEV-10638 - record read not ok vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout +vcol.vcol_select_myisam : Modified in 10.1.22 #---------------------------------------------------------------- -wsrep.binlog_format : MDEV-11532 - WSREP has not yet prepared node - -#---------------------------------------------------------------- +wsrep.binlog_format : MDEV-11532 - WSREP has not yet prepared node +wsrep.pool_of_threads : MDEV-12234 - Library problem on Power -wsrep_info.plugin : MDEV-11530 - Warnings; also modified in 10.1.20 +wsrep_info.* : suite.pm changed in 10.1.22 +wsrep_info.plugin : MDEV-12232 - Crash on Power diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 6bdbcab4530..eb03eae6045 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1072,6 +1072,15 @@ fun:SSL_library_init } +{ + OpenSSL still reachable. + Memcheck:Leak + fun:*alloc + fun:CRYPTO_malloc + fun:sk_new + fun:SSL_COMP_get_compression_methods + fun:SSL_library_init +} { OpenSSL still reachable. @@ -1130,6 +1139,16 @@ } { + Memory Leak in loader and valgrind malloc + Memcheck:Leak + match-leak-kinds:reachable + obj:*/vgpreload_memcheck*.so + ... + obj:*/ld-*.so + ... +} + +{ ConnectSE: unixODBC SQLAllocEnv leaves some "still reachable" pointers Memcheck:Leak fun:malloc |