diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-06-24 07:16:08 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2015-06-24 07:16:08 +0300 |
commit | 2e4984c185ddcd2da789017cd147338846ff409a (patch) | |
tree | 0293831900c860600efbaa747ea886d9d1cbf5bd /mysql-test | |
parent | 792b53e80806df893ee62c9a1c1bd117114c8c6d (diff) | |
parent | a6087e7dc1ef3561d8189c8db15e9591d0f9b520 (diff) | |
download | mariadb-git-10.0-FusionIO.tar.gz |
Merge tag 'mariadb-10.0.20' into 10.0-FusionIO10.0-FusionIO
Conflicts:
storage/innobase/os/os0file.cc
storage/xtradb/os/os0file.cc
storage/xtradb/srv/srv0start.cc
Diffstat (limited to 'mysql-test')
451 files changed, 12478 insertions, 1901 deletions
diff --git a/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test index d071415bf65..cd0266434ff 100644 --- a/mysql-test/extra/binlog_tests/database.test +++ b/mysql-test/extra/binlog_tests/database.test @@ -31,12 +31,47 @@ source include/show_binlog_events.inc; FLUSH STATUS; +--echo +--echo # 'DROP TABLE IF EXISTS <deleted tables>' is binlogged +--echo # when 'DROP DATABASE' fails and at least one table is deleted +--echo # from the database. +RESET MASTER; +CREATE DATABASE testing_1; +USE testing_1; +CREATE TABLE t1(c1 INT); +CREATE TABLE t2(c1 INT); + +let $prefix= `SELECT UUID()`; +--echo # Create a file in the database directory +--replace_result $prefix FAKE_FILE +eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix'; + +--echo +--echo # 'DROP DATABASE' will fail if there is any other file in the the +--echo # database directory + +# Use '/' instead of '\' in the error message. On windows platform, dir is +# formed with '\'. +--replace_regex /\\testing_1\\*/\/testing_1\// /66/39/ +--error 1010 +DROP DATABASE testing_1; +let $wait_binlog_event= DROP TABLE IF EXIST; +source include/wait_for_binlog_event.inc; +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +--echo +--echo # Remove the fake file. +--remove_file $MYSQLD_DATADIR/testing_1/fake_file.$prefix +--echo # Now we can drop the database. +DROP DATABASE testing_1; + --echo # --echo # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT --echo # BASED REPLICATION --echo # +USE test; --disable_warnings DROP DATABASE IF EXISTS db1; DROP TABLE IF EXISTS t3; diff --git a/mysql-test/extra/rpl_tests/rpl_row_annotate.test b/mysql-test/extra/rpl_tests/rpl_row_annotate.test index f3d8006ce01..0614ca97f1d 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_annotate.test +++ b/mysql-test/extra/rpl_tests/rpl_row_annotate.test @@ -101,6 +101,35 @@ if (!$annotate) { --echo # No Annotate_rows events should appear below } + + + +--echo ######################################################################## +--echo # Ensure that a replication failure doesn't segfault - MDEV-7864 +--echo ######################################################################## +DELETE FROM t3 WHERE a=2; +connection master; +INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d; +INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10; +DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a; +connection slave; +--echo ---- Wait until slave stops with an error ---- +# Wait until the slave tries to run the query, fails with key not +# found error, and stops the SQL thread. +let $slave_sql_errno= 1032; # Can't find record +source include/wait_for_slave_sql_error.inc; +--let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1) +--replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/ +--disable_query_log +--eval SELECT "$err" as 'Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can\'t find record in \'t3\'" error)' +--enable_query_log +call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032"); + +SET GLOBAL sql_slave_skip_counter=1; +START SLAVE; +connection master; +sync_slave_with_master; + --echo ######################################################################## FLUSH LOGS; diff --git a/mysql-test/include/ctype_utf8_ilseq.inc b/mysql-test/include/ctype_utf8_ilseq.inc new file mode 100644 index 00000000000..c400731c07f --- /dev/null +++ b/mysql-test/include/ctype_utf8_ilseq.inc @@ -0,0 +1,114 @@ +# +# Compare a field to an utf8 string literal with illegal byte sequences +# + +--echo # +--echo # Start of ctype_utf8_ilseq.inc +--echo # + +--eval CREATE TABLE t1 ENGINE=$ENGINE AS SELECT REPEAT(' ', 60) AS ch LIMIT 0; +ALTER TABLE t1 + ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + ADD KEY(ch); +SHOW CREATE TABLE t1; + +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='adminðŒ†'; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='adminðŒ†'; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='adminðŒ†'; +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +# LATIN SMALL LETTER A + LATIN CAPITAL LETTER E WITH GRAVE +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +# LATIN SMALL LETTER A + ARMENIAN SMALL LETTER REH +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); + +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; + +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; + +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; + +ALTER TABLE t1 DROP KEY ch; + +--echo # 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; + +# +# Non-equality comparison currently work differently depending on collation: +# +# - utf8_general_ci falls back to memcmp() on bad byte +# - utf8_unicode_ci treats bad bytes greater than any valid character +# +# For example, these two characters: +# _utf8 0xD080 (U+00C8 LATIN CAPITAL LETTER E WITH GRAVE) +# _utf8 0xD680 (U+0580 ARMENIAN SMALL LETTER REH) +# +# will give different results (depending on collation) when compared +# to an incomplete byte sequence 0xD1 (mb2head not followed by mb2tail). +# +# For utf8_general_ci the result depends on the valid side: +# - 0xD080 is smaller than 0xD1, because 0xD0 < 0xD1 +# - 0xD680 is greater than 0xD1, because 0xD6 > 0xD1 +# +# For utf8_unicode_ci the result does not depend on the valid side: +# - 0xD080 is smaller than 0xD1, because 0xD1 is greater than any valid character +# - 0xD680 is smaller than 0xD1, because 0xD1 is greater than any valid character +# +# utf8_general_ci should be eventually fixed to treat bad bytes greater +# than any valid character, similar to utf8_unicode_ci. +# + +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +--echo # 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +--echo # 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +--echo # 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; + +DROP TABLE t1; + +--echo # +--echo # End of ctype_utf8_ilseq.inc +--echo # diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 33881666b57..04321475691 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -31,6 +31,7 @@ debug-no-sync # Retry bind as this may fail on busy server port-open-timeout=10 +bind-address=127.0.0.1 log-bin-trust-function-creators=1 key_buffer_size= 1M diff --git a/mysql-test/include/have_ipv6.inc b/mysql-test/include/have_ipv6.inc deleted file mode 100644 index 752dd0db53e..00000000000 --- a/mysql-test/include/have_ipv6.inc +++ /dev/null @@ -1,20 +0,0 @@ -# Check if ipv6 is available. -# ---disable_query_log ---disable_result_log ---disable_abort_on_error -connect (checkcon123456789,::1,root,,test); -if($mysql_errno) -{ - skip No IPv6 support; -} -connection default; -if(!$mysql_errno) -{ - disconnect checkcon123456789; -} ---enable_abort_on_error ---enable_result_log ---enable_query_log -# end check - diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 9d97d23897c..345968cd3f0 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -227,6 +227,12 @@ INSERT INTO global_suppressions VALUES ("Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error.*"), ("Slave I/O: Setting master-side filtering of @@skip_replication failed with error:.*"), ("Slave I/O: Setting @mariadb_slave_capability failed with error:.*"), + ("Slave I/O: Get master @@GLOBAL.gtid_domain_id failed with error.*"), + ("Slave I/O: Setting @slave_connect_state failed with error.*"), + ("Slave I/O: Setting @slave_gtid_strict_mode failed with error.*"), + ("Slave I/O: Setting @slave_gtid_ignore_duplicates failed with error.*"), + ("Slave I/O: Setting @slave_until_gtid failed with error.*"), + ("Slave I/O: Get master GTID position failed with error.*"), ("THE_LAST_SUPPRESSION")|| diff --git a/mysql-test/suite/perfschema/include/no_protocol.inc b/mysql-test/include/no_protocol.inc index 451c22f62e3..8ffd3509afc 100644 --- a/mysql-test/suite/perfschema/include/no_protocol.inc +++ b/mysql-test/include/no_protocol.inc @@ -1,5 +1,3 @@ -# Tests for the performance schema - # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index 55eb83c25e5..ba2e1b0c48a 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -67,7 +67,21 @@ # # --let $slave_sql_mode= NO_BACKSLASH_ESCAPES # - +# $all_slaves_status +# If set, use SHOW ALL SLAVES STATUS instead of SHOW SLAVE STATUS +# and get the column values from all rows. Example: +# +# --let $all_slaves_status= 1 +# +# $slave_name +# If set, use SHOW SLAVE '<slave_name>' STATUS instead of SHOW SLAVE STATUS. +# The name must be quoted (can be a quoted empty string). +# Example: +# +# --let $slave_name= 'm1' +# +# Note: $all_slaves_status and $slave_name are mutually exclusive. +# --let $_show_slave_status_items=$status_items if (!$status_items) @@ -75,6 +89,21 @@ if (!$status_items) --die Bug in test case: The mysqltest variable $status_items is not set. } +--let $_show_query=SHOW SLAVE STATUS + +if ($all_slaves_status) +{ + if ($slave_name) + { + --die Bug in test case: Both $all_slaves_status and $slave_name are set. + } + --let $_show_query=SHOW ALL SLAVES STATUS +} +if ($slave_name) +{ + --let $_show_query=SHOW SLAVE $slave_name STATUS +} + --let $_slave_sql_mode= NO_BACKSLASH_ESCAPES if ($slave_sql_mode) @@ -86,18 +115,27 @@ if ($slave_sql_mode) eval SET sql_mode= '$_slave_sql_mode'; --enable_query_log +--let $_slave_field_result_replace= /[\\\\]/\// $slave_field_result_replace while ($_show_slave_status_items) { --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)` --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` - --replace_regex /\.[\\\/]master/master/ - --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1) - --let $_slave_field_result_replace= /[\\\\]/\// $slave_field_result_replace - --replace_regex $_slave_field_result_replace - --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` - --echo $_show_slave_status_name = '$_show_slave_status_value' + --let $num= 1 + --let $_show_slave_status_value= + while ($_show_slave_status_value != 'No such row') + { + --replace_regex /\.[\\\/]master/master/ + --let $_show_slave_status_value= query_get_value($_show_query, $_show_slave_status_name, $num) + if ($_show_slave_status_value != 'No such row') + { + --replace_regex $_slave_field_result_replace + --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` + --echo $_show_slave_status_name = '$_show_slave_status_value' + --inc $num + } + } } diff --git a/mysql-test/include/shutdown_mysqld.inc b/mysql-test/include/shutdown_mysqld.inc new file mode 100644 index 00000000000..54bba1318e7 --- /dev/null +++ b/mysql-test/include/shutdown_mysqld.inc @@ -0,0 +1,18 @@ +# This is the first half of include/restart_mysqld.inc. +if ($rpl_inited) +{ + if (!$allow_rpl_inited) + { + --die ERROR IN TEST: When using the replication test framework (master-slave.inc, rpl_init.inc etc), use rpl_restart_server.inc instead of restart_mysqld.inc. If you know what you are doing and you really have to use restart_mysqld.inc, set allow_rpl_inited=1 before you source restart_mysqld.inc + } +} + +# Write file to make mysql-test-run.pl expect the "crash", but don't start it +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--exec echo "wait" > $_expect_file_name + +# Send shutdown to the connected server +--shutdown_server +--source include/wait_until_disconnected.inc + diff --git a/mysql-test/include/start_mysqld.inc b/mysql-test/include/start_mysqld.inc new file mode 100644 index 00000000000..983c566821e --- /dev/null +++ b/mysql-test/include/start_mysqld.inc @@ -0,0 +1,14 @@ +# Include this script only after using shutdown_mysqld.inc +# where $_expect_file_name was initialized. +# Write file to make mysql-test-run.pl start up the server again +--exec echo "restart" > $_expect_file_name + +# 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 + diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index d6110f5f8c8..feb3eb4df66 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -125,7 +125,7 @@ extern "C" void handle_abort(int sig) message("Got signal %d, child_pid: %d, sending ABRT", sig, child_pid); if (child_pid > 0) { - kill (-child_pid, SIGABRT); // Don't wait for it to terminate + kill(-child_pid, SIGABRT); // Don't wait for it to terminate } } @@ -226,6 +226,18 @@ int main(int argc, char* const argv[] ) sleep(1); } + /* + Child: Make this process it's own process group to be able to kill + it and any its children that hasn't changed a group themselves) + + Parent: Detach from the parent's process group, so that killing a parent + group wouldn't kill us (if we're killed, there's no one to kill our child + processes that run in their own process group). There's a loop below + that monitors the parent, it's enough. + */ + setpgid(0, 0); + + if (child_pid == 0) { close(pfd[0]); // Close unused read end @@ -236,10 +248,6 @@ int main(int argc, char* const argv[] ) signal(SIGHUP, SIG_DFL); signal(SIGCHLD, SIG_DFL); - // Make this process it's own process group to be able to kill - // it and any childs(that hasn't changed group themself) - setpgid(0, 0); - if (nocore) { struct rlimit corelim = { 0, 0 }; diff --git a/mysql-test/lib/generate-ssl-certs.sh b/mysql-test/lib/generate-ssl-certs.sh new file mode 100755 index 00000000000..5dca21a755d --- /dev/null +++ b/mysql-test/lib/generate-ssl-certs.sh @@ -0,0 +1,30 @@ +#/bin/sh -xe + +# simply run me from mysql-test/ +cd std_data/ + +# boilerplace for "openssl ca" and /etc/ssl/openssl.cnf +rm -rf demoCA +mkdir demoCA demoCA/private demoCA/newcerts +touch demoCA/index.txt +echo 01 > demoCA/serial + +# CA certificate, self-signed +openssl req -x509 -newkey rsa:2048 -keyout demoCA/private/cakey.pem -out cacert.pem -days 7300 -nodes -subj '/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' -text + +# server certificate signing request and private key. Note the very long subject (for MDEV-7859) +openssl req -newkey rsa:1024 -keyout server-key.pem -out demoCA/server-req.pem -days 7300 -nodes -subj '/CN=localhost/C=FI/ST=state or province within country, in other certificates in this file it is the same as L/L=location, usually an address but often ambiguously used/OU=organizational unit name, a division name within an organization/O=organization name, typically a company name' +# convert the key to yassl compatible format +openssl rsa -in server-key.pem -out server-key.pem +# sign the server certificate with CA certificate +openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out server-cert.pem -infiles demoCA/server-req.pem + +openssl req -newkey rsa:8192 -keyout server8k-key.pem -out demoCA/server8k-req.pem -days 7300 -nodes -subj '/CN=server8k/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' +openssl rsa -in server8k-key.pem -out server8k-key.pem +openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out server8k-cert.pem -infiles demoCA/server8k-req.pem + +openssl req -newkey rsa:1024 -keyout client-key.pem -out demoCA/client-req.pem -days 7300 -nodes -subj '/CN=client/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB' +openssl rsa -in client-key.pem -out client-key.pem +openssl ca -days 7300 -batch -cert cacert.pem -policy policy_anything -out client-cert.pem -infiles demoCA/client-req.pem + +rm -rf demoCA diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ae037c2485e..befd47d9c94 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1036,15 +1036,7 @@ sub ignore_option { # Setup any paths that are $opt_vardir related sub set_vardir { - my ($vardir)= @_; - if(IS_WINDOWS) - { - $opt_vardir= $vardir; - } - else - { - $opt_vardir= realpath($vardir); - } + ($opt_vardir)= @_; $path_vardir_trace= $opt_vardir; # Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/... @@ -1478,7 +1470,7 @@ 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, "/dev/shm", "/tmp"); + my @tmpfs_locations= ($opt_mem,"/run/shm", "/dev/shm", "/tmp"); foreach my $fs (@tmpfs_locations) { @@ -1494,15 +1486,11 @@ sub command_line_setup { # -------------------------------------------------------------------------- # Set the "var/" directory, the base for everything else # -------------------------------------------------------------------------- - if(defined $ENV{MTR_BINDIR}) - { - $default_vardir= "$ENV{MTR_BINDIR}/mysql-test/var"; - } - else - { - $default_vardir= "$glob_mysql_test_dir/var"; - } - $default_vardir = realpath $default_vardir unless IS_WINDOWS; + my $vardir_location= (defined $ENV{MTR_BINDIR} + ? "$ENV{MTR_BINDIR}/mysql-test" + : $glob_mysql_test_dir); + $vardir_location= realpath $vardir_location unless IS_WINDOWS; + $default_vardir= "$vardir_location/var"; if ( ! $opt_vardir ) { @@ -4834,6 +4822,12 @@ sub extract_warning_lines ($$) { qr/Slave I\/O: Get master clock failed with error:.*/, qr/Slave I\/O: Get master COLLATION_SERVER failed with error:.*/, qr/Slave I\/O: Get master TIME_ZONE failed with error:.*/, + qr/Slave I\/O: Get master \@\@GLOBAL.gtid_domain_id failed with error:.*/, + qr/Slave I\/O: Setting \@slave_connect_state failed with error:.*/, + qr/Slave I\/O: Setting \@slave_gtid_strict_mode failed with error:.*/, + qr/Slave I\/O: Setting \@slave_gtid_ignore_duplicates failed with error:.*/, + qr/Slave I\/O: Setting \@slave_until_gtid failed with error:.*/, + qr/Slave I\/O: Get master GTID position failed with error:.*/, qr/Slave I\/O: error reconnecting to master '.*' - retry-time: [1-3] retries/, qr/Slave I\/0: Master command COM_BINLOG_DUMP failed/, qr/Error reading packet/, @@ -6437,7 +6431,7 @@ Options to control directories to use mem Run testsuite in "memory" using tmpfs or ramdisk Attempts to find a suitable location using a builtin list of standard locations - for tmpfs (/dev/shm) + for tmpfs (/run/shm, /dev/shm, /tmp) The option can also be set using environment variable MTR_MEM=[DIR] clean-vardir Clean vardir if tests were successful and if diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index ed6fd8b90bb..0975a5aa101 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1488,6 +1488,17 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; +CREATE TABLE t1 ( +`transaction_id` int(11) NOT NULL DEFAULT '0', +KEY `transaction_id` (`transaction_id`)); +ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `transaction_id` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`transaction_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't # identify correct column name. # @@ -1693,8 +1704,10 @@ INSERT INTO tm1 VALUES (1,1,1), (2,2,2); INSERT INTO tm2 VALUES (1,1,1), (2,2,2); ALTER TABLE ti1; affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE tm1; affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 ADD COLUMN d VARCHAR(200); affected rows: 0 info: Records: 0 Duplicates: 0 Warnings: 0 diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result index 02c7e5ac691..864ad724bc3 100644 --- a/mysql-test/r/alter_table_online.result +++ b/mysql-test/r/alter_table_online.result @@ -11,6 +11,10 @@ alter online table t1 comment "new comment"; ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. alter online table t1 rename to t2; ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE. +alter online table t1 algorithm=INPLACE, lock=NONE; +alter online table t1; +alter table t1 algorithm=INPLACE; +alter table t1 lock=NONE; drop table t1; create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')); insert into t1 (a) values (1),(2),(3); diff --git a/mysql-test/r/blackhole.result b/mysql-test/r/blackhole.result index 16a97927262..36f5459ff85 100644 --- a/mysql-test/r/blackhole.result +++ b/mysql-test/r/blackhole.result @@ -8,6 +8,13 @@ CREATE TABLE t2 (a INT UNSIGNED, b INT, UNIQUE KEY (a, b)) ENGINE=BLACKHOLE; SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2); 1 DROP TABLE t1, t2; +create temporary table t1 (a int) engine=blackhole; +lock table t1 write; +truncate table t1; +select * from t1; +a +unlock tables; +drop temporary table t1; End of 5.5 tests # # Bug#13948247 DIVISION BY 0 IN GET_BEST_DISJUNCT_QUICK WITH FORCE INDEX GROUP BY diff --git a/mysql-test/r/bootstrap.result b/mysql-test/r/bootstrap.result index c4775a787f2..bb80cf28b56 100644 --- a/mysql-test/r/bootstrap.result +++ b/mysql-test/r/bootstrap.result @@ -15,3 +15,14 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' and SUPPORT='YES'; End of 5.5 tests +flush tables; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select * from mysql.plugin; +name dl +EXAMPLE ha_example.so +truncate table mysql.plugin; diff --git a/mysql-test/r/bug46261.result b/mysql-test/r/bug46261.result deleted file mode 100644 index dcc950d1baf..00000000000 --- a/mysql-test/r/bug46261.result +++ /dev/null @@ -1,8 +0,0 @@ -# -# Bug#46261 Plugins can be installed with --skip-grant-tables -# -INSTALL PLUGIN example SONAME 'ha_example.so'; -ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement -UNINSTALL PLUGIN example; -ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement -End of 5.1 tests diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index ec70dba674f..fde821b801d 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -323,7 +323,7 @@ Level Code Message Note 1050 Table 't1' already exists show status like "Opened_tables"; Variable_name Value -Opened_tables 2 +Opened_tables 1 select * from t1; a b 1 1 diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index f35e6fd8265..aead73b3090 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -3008,5 +3008,11 @@ Warnings: Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where ('%' = concat(`test`.`t1`.`c1`)) DROP TABLE t1; # +# MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14 +# +SELECT _binary 0x7E, _binary X'7E', _binary B'01111110'; +_binary 0x7E _binary X'7E' _binary B'01111110' +~ ~ ~ +# # End of 10.0 tests # diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result index 35461fce45a..4128be82c23 100644 --- a/mysql-test/r/ctype_create.result +++ b/mysql-test/r/ctype_create.result @@ -76,3 +76,35 @@ ALTER DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ALTER DATABASE `` DEFAULT CHARACTER SET latin2; ERROR 42000: Incorrect database name '' +USE test; +# +# Start of 10.0 tests +# +# +# MDEV-7387 Alter table xxx CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1 should fail +# +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET utf8; +ERROR HY000: Conflicting declarations: 'CHARACTER SET DEFAULT' and 'CHARACTER SET utf8' +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET DEFAULT; +ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8' and 'CHARACTER SET DEFAULT' +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET utf8; +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET DEFAULT; +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARCHAR(10) CHARACTER SET utf8); +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET latin1; +ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8' and 'CHARACTER SET latin1' +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET DEFAULT; +ERROR HY000: Conflicting declarations: 'CHARACTER SET utf8' and 'CHARACTER SET DEFAULT' +ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET utf8; +ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET utf8' +ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET DEFAULT; +ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET DEFAULT' +ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET utf8; +ERROR HY000: Conflicting declarations: 'CHARACTER SET latin5' and 'CHARACTER SET utf8' +ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET latin1; +ERROR HY000: Conflicting declarations: 'CHARACTER SET latin5' and 'CHARACTER SET latin1' +DROP TABLE t1; +# +# End of 10.0 tests +# diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 970c067b25c..383ea3ca8f2 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -7907,5 +7907,11 @@ HEX(a) a 3F23 ?# DROP TABLE t1; # +# MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14 +# +SELECT _latin1 0x7E, _latin1 X'7E', _latin1 B'01111110'; +_latin1 0x7E _latin1 X'7E' _latin1 B'01111110' +~ ~ ~ +# # End of 10.0 tests # diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 16b60aed07f..02809f3be22 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -6466,6 +6466,418 @@ a c1 10 => Ç„ drop table t1; # +# MDEV-7649 wrong result when comparing utf8 column with an invalid literal +# +SET NAMES utf8 COLLATE utf8_unicode_ci; +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=MyISAM AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='adminðŒ†'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='adminðŒ†'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# # End of 5.5 tests # # diff --git a/mysql-test/r/ctype_uca_innodb.result b/mysql-test/r/ctype_uca_innodb.result new file mode 100644 index 00000000000..a4e1ae09130 --- /dev/null +++ b/mysql-test/r/ctype_uca_innodb.result @@ -0,0 +1,218 @@ +# +# Start of 5.5 tests +# +# +# MDEV-7649 wrong result when comparing utf8 column with an invalid literal +# +SET NAMES utf8 COLLATE utf8_unicode_ci; +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=InnoDB AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='adminðŒ†'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_upgrade.result b/mysql-test/r/ctype_upgrade.result index 56e2ef96ead..6bef89f6cd6 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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -258,9 +258,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -279,11 +280,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 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK # Running mysql_upgrade for the second time # This should report OK for all tables -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -314,9 +315,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -329,7 +331,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 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK SHOW CREATE TABLE maria050313_ucs2_croatian_ci_def; Table Create Table diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index c752024ec7f..1f44d67661b 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5412,6 +5412,649 @@ a 1024 Warnings: Warning 1260 Row 2 was cut by GROUP_CONCAT() # +# MDEV-7814 Assertion `args[0]->fixed' fails in Item_func_conv_charset::Item_func_conv_charset +# +CREATE TABLE t1(a CHAR(1) CHARACTER SET latin1, b INT NOT NULL); +CREATE TABLE t2(a CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci, b INT NOT NULL); +SELECT (SELECT t2.a FROM t2 WHERE t2.a=t1.a) AS aa, b, COUNT(b) FROM t1 GROUP BY aa; +aa b COUNT(b) +DROP TABLE t1,t2; +# +# MDEV-7649 wrong result when comparing utf8 column with an invalid literal +# +SET NAMES utf8 COLLATE utf8_general_ci; +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=InnoDB AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='adminðŒ†'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +aÖ€ +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=MyISAM AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='adminðŒ†'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +aÖ€ +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# Start of ctype_utf8_ilseq.inc +# +CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT(' ', 60) AS ch LIMIT 0;; +ALTER TABLE t1 +ADD id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, +ADD KEY(ch); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ch` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '', + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`), + KEY `ch` (`ch`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 +INSERT INTO t1 (ch) VALUES ('admin'),('admin1'); +SELECT ch FROM t1 WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='adminðŒ†'; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='adminðŒ†'; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +DELETE FROM t1; +INSERT INTO t1 (ch) VALUES ('a'), ('a?'), ('a??'), ('a???'), ('a????'); +INSERT INTO t1 (ch) VALUES ('ab'),('a?b'),('a??b'),('a???b'),('a????b'); +INSERT INTO t1 (ch) VALUES ('az'),('a?z'),('a??z'),('a???z'),('a????z'); +INSERT INTO t1 (ch) VALUES ('z'); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D080); +INSERT INTO t1 (ch) VALUES (_utf8 0x61D680); +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86' for column 'ch' at row 1 +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch='aðŒ†b' ORDER BY ch; +ch +Warnings: +Warning 1366 Incorrect string value: '\xF0\x9D\x8C\x86b' for column 'ch' at row 1 +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch<'aðŒ†b' ORDER BY ch; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +aÖ€ +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 IGNORE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†' ORDER BY ch; +ch +z +SELECT ch FROM t1 FORCE KEY (ch) WHERE ch>'aðŒ†b' ORDER BY ch; +ch +z +ALTER TABLE t1 DROP KEY ch; +# 0xD18F would be a good 2-byte character, 0xD1 is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,''''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xD1,'b'''); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch<''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +a +a? +a?? +a??? +a???? +a????b +a????z +a???b +a???z +a??b +a??z +a?b +a?z +ab +az +aЀ +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch>''a', 0xD1,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +aÖ€ +z +# 0xEA9A96 would be a good 3-byte character, 0xEA9A is an incomplete sequence +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0xEA9A,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F is a bad byte sequence (an mb2tail without mb2head) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +# 0x8F8F is a bad byte sequence (an mb2tail without mb2head, two times) +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,''' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +SET @query=CONCAT('SELECT ch FROM t1 WHERE ch=''a', 0x8F8F,'b'' ORDER BY ch'); +PREPARE stmt FROM @query; +EXECUTE stmt; +ch +DROP TABLE t1; +# +# End of ctype_utf8_ilseq.inc +# +# +# MDEV-8067 correct fix for MySQL Bug # 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +(SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2) +1 +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1, t2; +# # End of 5.5 tests # # @@ -6259,6 +6902,12 @@ EXECUTE stmt USING @b,@b; ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat' DEALLOCATE PREPARE stmt; DROP TABLE t1; +# +# MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14 +# +SELECT _utf8 0x7E, _utf8 X'7E', _utf8 B'01111110'; +_utf8 0x7E _utf8 X'7E' _utf8 B'01111110' +~ ~ ~ # Start of ctype_unescape.inc SET @query=_binary'SELECT CHARSET(\'test\'),@@character_set_client,@@character_set_connection'; PREPARE stmt FROM @query; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index d0f42c3d3ec..7c44466ae92 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -568,3 +568,15 @@ update t1 set balance=(select sum(balance) from (SELECT balance FROM t1 where ac set optimizer_switch=@save_derived_optimizer_switch_bug; drop table t1; set optimizer_switch=@save_derived_optimizer_switch; +# +# MDEV-6892: WHERE does not apply +# +create table t1 (id int); +create table t2 (id int); +insert into t1 values(1),(2),(3); +insert into t2 values(4),(5),(6); +select x.id, message from (select id from t1) x left join +(select id, 1 as message from t2) y on x.id=y.id +where coalesce(message,0) <> 0; +id message +drop table t1,t2; diff --git a/mysql-test/r/derived_opt.result b/mysql-test/r/derived_opt.result index a2e08eacebc..04a76c2cbc8 100644 --- a/mysql-test/r/derived_opt.result +++ b/mysql-test/r/derived_opt.result @@ -413,64 +413,64 @@ create VIEW v27 AS select tab1_v27.f1,tab1_v27.f2 from t0 tab1_v27 join v26 tab2 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM v27; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE tab1_v27 ALL NULL NULL NULL NULL 5 Using where -1 SIMPLE tab1_v26 hash_ALL NULL #hash#$hj 63 test1.tab1_v27.f1,test1.tab1_v27.f2 5 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE tab1_v26 hash_ALL NULL #hash#$hj 62 test1.tab1_v27.f1,test1.tab1_v27.f2 5 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE tab1_v25 hash_ALL NULL #hash#$hj 31 test1.tab1_v26.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v24 hash_ALL NULL #hash#$hj 60 test1.tab1_v25.f1,test1.tab1_v25.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v23 hash_ALL NULL #hash#$hj 63 test1.tab1_v24.f1,test1.tab1_v24.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v23 hash_ALL NULL #hash#$hj 62 test1.tab1_v24.f1,test1.tab1_v24.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v22 hash_ALL NULL #hash#$hj 31 test1.tab1_v23.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v21 hash_ALL NULL #hash#$hj 60 test1.tab1_v22.f1,test1.tab1_v22.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v20 hash_ALL NULL #hash#$hj 63 test1.tab1_v21.f1,test1.tab1_v21.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v20 hash_ALL NULL #hash#$hj 62 test1.tab1_v21.f1,test1.tab1_v21.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v19 hash_ALL NULL #hash#$hj 31 test1.tab1_v20.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v18 hash_ALL NULL #hash#$hj 60 test1.tab1_v19.f1,test1.tab1_v19.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v17 hash_ALL NULL #hash#$hj 63 test1.tab1_v18.f1,test1.tab1_v18.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v17 hash_ALL NULL #hash#$hj 62 test1.tab1_v18.f1,test1.tab1_v18.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v16 hash_ALL NULL #hash#$hj 31 test1.tab1_v17.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v15 hash_ALL NULL #hash#$hj 60 test1.tab1_v16.f1,test1.tab1_v16.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v14 hash_ALL NULL #hash#$hj 63 test1.tab1_v15.f1,test1.tab1_v15.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v14 hash_ALL NULL #hash#$hj 62 test1.tab1_v15.f1,test1.tab1_v15.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v13 hash_ALL NULL #hash#$hj 31 test1.tab1_v14.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v12 hash_ALL NULL #hash#$hj 60 test1.tab1_v13.f1,test1.tab1_v13.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v11 hash_ALL NULL #hash#$hj 63 test1.tab1_v12.f1,test1.tab1_v12.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v11 hash_ALL NULL #hash#$hj 62 test1.tab1_v12.f1,test1.tab1_v12.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v10 hash_ALL NULL #hash#$hj 31 test1.tab1_v11.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v9 hash_ALL NULL #hash#$hj 60 test1.tab1_v10.f1,test1.tab1_v10.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v8 hash_ALL NULL #hash#$hj 63 test1.tab1_v9.f1,test1.tab1_v9.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v8 hash_ALL NULL #hash#$hj 62 test1.tab1_v9.f1,test1.tab1_v9.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v7 hash_ALL NULL #hash#$hj 31 test1.tab1_v8.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v6 hash_ALL NULL #hash#$hj 60 test1.tab1_v7.f1,test1.tab1_v7.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v5 hash_ALL NULL #hash#$hj 63 test1.tab1_v6.f1,test1.tab1_v6.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v5 hash_ALL NULL #hash#$hj 62 test1.tab1_v6.f1,test1.tab1_v6.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v4 hash_ALL NULL #hash#$hj 31 test1.tab1_v5.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v3 hash_ALL NULL #hash#$hj 60 test1.tab1_v4.f1,test1.tab1_v4.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v2 hash_ALL NULL #hash#$hj 63 test1.tab1_v3.f1,test1.tab1_v3.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v2 hash_ALL NULL #hash#$hj 62 test1.tab1_v3.f1,test1.tab1_v3.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v1 hash_ALL NULL #hash#$hj 31 test1.tab1_v2.f1 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE t1 hash_ALL NULL #hash#$hj 85 test1.tab1_v1.f1,test1.tab1_v1.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t1 hash_ALL NULL #hash#$hj 84 test1.tab1_v1.f1,test1.tab1_v1.f2 5 Using where; Using join buffer (incremental, BNLH join) # This used to hang forever: EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM v27; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE tab1_v27 ALL NULL NULL NULL NULL 5 Using where -1 SIMPLE tab1_v26 hash_ALL NULL #hash#$hj 63 test1.tab1_v27.f1,test1.tab1_v27.f2 5 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE tab1_v26 hash_ALL NULL #hash#$hj 62 test1.tab1_v27.f1,test1.tab1_v27.f2 5 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE tab1_v25 hash_ALL NULL #hash#$hj 31 test1.tab1_v26.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v24 hash_ALL NULL #hash#$hj 60 test1.tab1_v25.f1,test1.tab1_v25.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v23 hash_ALL NULL #hash#$hj 63 test1.tab1_v24.f1,test1.tab1_v24.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v23 hash_ALL NULL #hash#$hj 62 test1.tab1_v24.f1,test1.tab1_v24.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v22 hash_ALL NULL #hash#$hj 31 test1.tab1_v23.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v21 hash_ALL NULL #hash#$hj 60 test1.tab1_v22.f1,test1.tab1_v22.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v20 hash_ALL NULL #hash#$hj 63 test1.tab1_v21.f1,test1.tab1_v21.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v20 hash_ALL NULL #hash#$hj 62 test1.tab1_v21.f1,test1.tab1_v21.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v19 hash_ALL NULL #hash#$hj 31 test1.tab1_v20.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v18 hash_ALL NULL #hash#$hj 60 test1.tab1_v19.f1,test1.tab1_v19.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v17 hash_ALL NULL #hash#$hj 63 test1.tab1_v18.f1,test1.tab1_v18.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v17 hash_ALL NULL #hash#$hj 62 test1.tab1_v18.f1,test1.tab1_v18.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v16 hash_ALL NULL #hash#$hj 31 test1.tab1_v17.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v15 hash_ALL NULL #hash#$hj 60 test1.tab1_v16.f1,test1.tab1_v16.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v14 hash_ALL NULL #hash#$hj 63 test1.tab1_v15.f1,test1.tab1_v15.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v14 hash_ALL NULL #hash#$hj 62 test1.tab1_v15.f1,test1.tab1_v15.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v13 hash_ALL NULL #hash#$hj 31 test1.tab1_v14.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v12 hash_ALL NULL #hash#$hj 60 test1.tab1_v13.f1,test1.tab1_v13.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v11 hash_ALL NULL #hash#$hj 63 test1.tab1_v12.f1,test1.tab1_v12.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v11 hash_ALL NULL #hash#$hj 62 test1.tab1_v12.f1,test1.tab1_v12.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v10 hash_ALL NULL #hash#$hj 31 test1.tab1_v11.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v9 hash_ALL NULL #hash#$hj 60 test1.tab1_v10.f1,test1.tab1_v10.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v8 hash_ALL NULL #hash#$hj 63 test1.tab1_v9.f1,test1.tab1_v9.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v8 hash_ALL NULL #hash#$hj 62 test1.tab1_v9.f1,test1.tab1_v9.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v7 hash_ALL NULL #hash#$hj 31 test1.tab1_v8.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v6 hash_ALL NULL #hash#$hj 60 test1.tab1_v7.f1,test1.tab1_v7.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v5 hash_ALL NULL #hash#$hj 63 test1.tab1_v6.f1,test1.tab1_v6.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v5 hash_ALL NULL #hash#$hj 62 test1.tab1_v6.f1,test1.tab1_v6.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v4 hash_ALL NULL #hash#$hj 31 test1.tab1_v5.f1 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v3 hash_ALL NULL #hash#$hj 60 test1.tab1_v4.f1,test1.tab1_v4.f2 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE tab1_v2 hash_ALL NULL #hash#$hj 63 test1.tab1_v3.f1,test1.tab1_v3.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE tab1_v2 hash_ALL NULL #hash#$hj 62 test1.tab1_v3.f1,test1.tab1_v3.f2 5 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE tab1_v1 hash_ALL NULL #hash#$hj 31 test1.tab1_v2.f1 5 Using where; Using join buffer (incremental, BNLH join) -1 SIMPLE t1 hash_ALL NULL #hash#$hj 85 test1.tab1_v1.f1,test1.tab1_v1.f2 5 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t1 hash_ALL NULL #hash#$hj 84 test1.tab1_v1.f1,test1.tab1_v1.f2 5 Using where; Using join buffer (incremental, BNLH join) use test; drop database test1; set join_cache_level=@tmp_jcl; diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index e359a8f89c5..fa0a69a487d 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -770,7 +770,7 @@ SELECT * FROM t1, t2, v1 WHERE t2.a=t1.a AND t2.a=v1.a AND t2.a=v1.b; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 1 PRIMARY t2 ref a a 4 const 1 Using index -1 PRIMARY <derived2> ref key0 key0 10 const,const 1 +1 PRIMARY <derived2> ref key0 key0 8 const,const 1 2 DERIVED t3 ALL NULL NULL NULL NULL 12 Using temporary; Using filesort SELECT * FROM t1, t2, v1 WHERE t2.a=t1.a AND t2.a=v1.a AND t2.a=v1.b; a a a b @@ -1518,7 +1518,7 @@ WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY <derived3> ref key1 key1 10 const,const 0 Start temporary +1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join) 3 DERIVED t1 ALL NULL NULL NULL NULL 3 SELECT * FROM t3 @@ -1596,7 +1596,7 @@ EXPLAIN SELECT v1.a FROM v1,v2 WHERE v2.b = v1.b ORDER BY 1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using where; Using filesort -1 PRIMARY <derived3> ref key0 key0 5 v1.b 2 +1 PRIMARY <derived3> ref key0 key0 4 v1.b 2 3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort 2 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort DROP VIEW v1,v2; diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index cc4e8074395..04ab385bca6 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1455,6 +1455,12 @@ Warnings: Warning 1918 Encountered illegal value '18446744073709552001' when converting to INT Note 1105 Cast to signed converted positive out-of-range integer to it's negative complement # +# MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes +# mysqld +# +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); +ERROR 42000: Too big scale 34 specified for ''y''. Maximum is 30. +# # test of symbolic names # # creation test (names) diff --git a/mysql-test/r/empty_server_name-8224.result b/mysql-test/r/empty_server_name-8224.result new file mode 100644 index 00000000000..6423114470d --- /dev/null +++ b/mysql-test/r/empty_server_name-8224.result @@ -0,0 +1 @@ +create server '' foreign data wrapper w2 options (host '127.0.0.1'); diff --git a/mysql-test/r/error_simulation.result b/mysql-test/r/error_simulation.result index 006c51d1880..edb97d4ab2e 100644 --- a/mysql-test/r/error_simulation.result +++ b/mysql-test/r/error_simulation.result @@ -100,3 +100,24 @@ DROP TABLE t1,t2; # # End of 5.1 tests # +# +# BUG#11747548:DETECT ORPHAN TEMP-POOL FILES, AND HANDLE GRACEFULLY. +# +#Set up. +CREATE TABLE pid_table(pid_no INT); +CREATE TABLE t1 (a BLOB); +INSERT INTO t1 VALUES (1), (2); +#Create MYD and MYI files for intrinsic temp table. +LOAD DATA LOCAL INFILE 'pid_file' INTO TABLE pid_table; +#Reports an error since the temp file already exists. +SELECT a FROM t1 ORDER BY rand(1); +a +1 +2 +#With patch, the query executes successfully. +SELECT a FROM t1 ORDER BY rand(1); +a +1 +2 +#cleanup +DROP TABLE t1, pid_table; diff --git a/mysql-test/r/explain_non_select.result b/mysql-test/r/explain_non_select.result index 00ca481147b..0eee7ee9b1e 100644 --- a/mysql-test/r/explain_non_select.result +++ b/mysql-test/r/explain_non_select.result @@ -219,3 +219,16 @@ OK OK drop function f1; drop table t1; +# +# MDEV-7038: Assertion `status_var.memory_used == 0' failed in THD::~THD() +# on disconnect after executing EXPLAIN for multi-table UPDATE +# +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1),(2); +EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE user index NULL PRIMARY 420 NULL 4 Using index +DROP TABLE t1; +DROP VIEW v1; diff --git a/mysql-test/r/features.result b/mysql-test/r/features.result index 66d2c6bf71d..04e0df98ec7 100644 --- a/mysql-test/r/features.result +++ b/mysql-test/r/features.result @@ -120,6 +120,9 @@ drop trigger trg; drop table t1; show status like "%trigger%"; Variable_name Value +Binlog_group_commit_trigger_count 0 +Binlog_group_commit_trigger_lock_wait 0 +Binlog_group_commit_trigger_timeout 0 Com_create_trigger 1 Com_drop_trigger 1 Com_show_create_trigger 0 diff --git a/mysql-test/r/file_contents.result b/mysql-test/r/file_contents.result index 110769e12f8..0b0d5d598d6 100644 --- a/mysql-test/r/file_contents.result +++ b/mysql-test/r/file_contents.result @@ -1,6 +1,6 @@ Checking 'INFO_SRC' and 'INFO_BIN' -INFO_SRC: Found MySQL version number / Found BZR revision id +INFO_SRC: Found MySQL version number / Found GIT revision id INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line End of tests diff --git a/mysql-test/r/filesort_bad_i_s-7585.result b/mysql-test/r/filesort_bad_i_s-7585.result new file mode 100644 index 00000000000..edb1574288f --- /dev/null +++ b/mysql-test/r/filesort_bad_i_s-7585.result @@ -0,0 +1,9 @@ +SET sql_mode=STRICT_TRANS_TABLES; +CREATE TABLE t0 (i INT) ENGINE=MyISAM; +CREATE VIEW v1 AS SELECT * FROM t0; +CREATE VIEW v2 AS SELECT * FROM v1; +DROP VIEW IF EXISTS v1; +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS; +DROP VIEW v2; +DROP TABLE t1, t0; diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index b60deae1c80..f12a0c1127a 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1091,3 +1091,15 @@ insert into t1 values ('a'),('b'); select 1 from t1 where a in (select group_concat(a) from t1); 1 drop table t1; +CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('a'),('b'); +CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('c'); +CREATE TABLE t3 (f3 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t3 VALUES ('d'),('e'); +SELECT GROUP_CONCAT( f2 ORDER BY ( f2 IN ( SELECT f1 FROM t1 WHERE f1 <= f2 ) ) ) AS field +FROM ( SELECT * FROM t2 ) AS sq2, t3 +ORDER BY field; +field +c,c +drop table t3, t2, t1; diff --git a/mysql-test/r/func_regexp_pcre.result b/mysql-test/r/func_regexp_pcre.result index 641c4fddbf7..aa090c9faf6 100644 --- a/mysql-test/r/func_regexp_pcre.result +++ b/mysql-test/r/func_regexp_pcre.result @@ -845,3 +845,32 @@ SET default_regex_flags=DEFAULT; SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that') 1 this and that +# +# MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable +# +# Testing a warning +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +0 +Warnings: +Warning 1139 Got error 'pcre_exec: Invalid utf8 byte sequence in the subject string' from regexp +# Testing workaround N1: This makes the pattern to be a binary string: +SET NAMES latin1; +SET @regCheck= X'E001'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +1 +# Testing workaround N2: This also makes the pattern to be a binary string, using a different syntax: +SET NAMES latin1; +SET @regCheck= _binary '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; +0xE001 REGEXP @regCheck +1 +# Testing workarond N3: This makes derivation of the subject string stronger (IMLICIT instead of COERCIBLE) +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck; +CAST(0xE001 AS BINARY) REGEXP @regCheck +1 diff --git a/mysql-test/r/func_regexp_pcre_debug.result b/mysql-test/r/func_regexp_pcre_debug.result new file mode 100644 index 00000000000..e44492fca72 --- /dev/null +++ b/mysql-test/r/func_regexp_pcre_debug.result @@ -0,0 +1,10 @@ +SET debug_dbug='+d,pcre_exec_error_123'; +SELECT 'a' RLIKE 'a'; +'a' RLIKE 'a' +0 +Warnings: +Warning 1139 Got error 'pcre_exec: Internal error (-123)' from regexp +SET debug_dbug=''; +SELECT 'a' RLIKE 'a'; +'a' RLIKE 'a' +1 diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 93757800505..dfc3faf3fac 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -5,7 +5,7 @@ explain extended select INTERVAL(55,10,20,30,40,50,60,70,80,90,100),interval(3,1 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select interval((55,10,20,30,40,50,60,70,80,90,100)) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval((3,1,(1 + 1),(((1 + 1) + 1) + 1))) AS `interval(3,1,1+1,1+1+1+1)`,field('IBM','NCA','ICL','SUN','IBM','DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field('A','B','C') AS `field("A","B","C")`,elt(2,'ONE','TWO','THREE') AS `elt(2,"ONE","TWO","THREE")`,interval((0,1,2,3,4)) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` +Note 1003 select interval(55,10,20,30,40,50,60,70,80,90,100) AS `INTERVAL(55,10,20,30,40,50,60,70,80,90,100)`,interval(3,1,(1 + 1),(((1 + 1) + 1) + 1)) AS `interval(3,1,1+1,1+1+1+1)`,field('IBM','NCA','ICL','SUN','IBM','DIGITAL') AS `field("IBM","NCA","ICL","SUN","IBM","DIGITAL")`,field('A','B','C') AS `field("A","B","C")`,elt(2,'ONE','TWO','THREE') AS `elt(2,"ONE","TWO","THREE")`,interval(0,1,2,3,4) AS `interval(0,1,2,3,4)`,(elt(1,1,2,3) | 0) AS `elt(1,1,2,3)|0`,(elt(1,1.1,1.2,1.3) + 0) AS `elt(1,1.1,1.2,1.3)+0` SELECT INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56); INTERVAL(13, 7, 14, 21, 28, 35, 42, 49, 56) 1 diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 950d2e72666..b660df15fed 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -2701,3 +2701,45 @@ id date1 date2 DATE_ADD(a.date1,INTERVAL -10 DAY) TO_DAYS(a.date1)-10 17 NULL NULL NULL NULL 18 2010-10-13 2010-10-03 2010-10-03 734413 DROP TABLE t1; +# +# Start of 10.0 tests +# +# +# MDEV-8205 timediff returns null when comparing decimal time to time string value +# +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-01-01 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140101010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140101010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-01-01 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-01:00:00 -01:00:00.000 -01:00:00.000 -01:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-01-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140102010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140102010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-01-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-25:00:00 -25:00:00.000 -25:00:00.000 -25:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-02-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140202010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140202010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-02-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-769:00:00 -769:00:00.000 -769:00:00.000 -769:00:00.000 +SELECT +TIMEDIFF('2014-01-01 00:00:00' , '2014-03-02 01:00:00' ) AS str_str, +TIMEDIFF('2014-01-01 00:00:00' , 20140302010000.000 ) AS str_dec, +TIMEDIFF(20140101000000.000 , 20140302010000.000 ) AS dec_dec, +TIMEDIFF(20140101000000.000 , '2014-03-02 01:00:00' ) AS dec_str; +str_str str_dec dec_dec dec_str +-838:59:59 -838:59:59.999 -838:59:59.999 -838:59:59.999 +Warnings: +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +Warning 1292 Truncated incorrect time value: '-1441:00:00' +# +# End of 10.0 tests +# diff --git a/mysql-test/r/function_defaults.result b/mysql-test/r/function_defaults.result index 50183a1f416..b8f42b86c1f 100644 --- a/mysql-test/r/function_defaults.result +++ b/mysql-test/r/function_defaults.result @@ -660,7 +660,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -669,7 +669,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' + `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -678,7 +678,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -705,7 +705,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime DEFAULT NULL + `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -714,7 +714,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime DEFAULT NULL + `g` datetime DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -723,7 +723,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime DEFAULT NULL + `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -774,14 +774,14 @@ t12 CREATE TABLE `t12` ( `s` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `t` datetime DEFAULT NULL, `u` datetime DEFAULT '1986-09-27 03:00:00', - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, `d` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00', `e` timestamp NULL DEFAULT NULL, - `f` datetime DEFAULT NULL, - `g` datetime DEFAULT NULL, - `h` datetime DEFAULT NULL, + `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `g` datetime DEFAULT CURRENT_TIMESTAMP, + `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `i` datetime DEFAULT NULL, `j` datetime DEFAULT '1986-09-27 03:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -802,7 +802,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime DEFAULT NULL + `a` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -811,7 +811,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime DEFAULT NULL + `b` datetime DEFAULT CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -820,7 +820,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime DEFAULT NULL + `c` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2216,7 +2216,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2225,7 +2225,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2234,7 +2234,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2261,7 +2261,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime(6) DEFAULT NULL + `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -2270,7 +2270,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime(6) DEFAULT NULL + `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -2279,7 +2279,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime(6) DEFAULT NULL + `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -2330,14 +2330,14 @@ t12 CREATE TABLE `t12` ( `s` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), `t` datetime(6) DEFAULT NULL, `u` datetime(6) DEFAULT '1986-09-27 03:00:00.098765', - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', - `b` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), `d` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765', `e` timestamp(6) NULL DEFAULT NULL, - `f` datetime(6) DEFAULT NULL, - `g` datetime(6) DEFAULT NULL, - `h` datetime(6) DEFAULT NULL, + `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), `i` datetime(6) DEFAULT NULL, `j` datetime(6) DEFAULT '1986-09-27 03:00:00.098765' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -2358,7 +2358,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime(6) DEFAULT NULL + `a` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2367,7 +2367,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime(6) DEFAULT NULL + `b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2376,7 +2376,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime(6) DEFAULT NULL + `c` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SELECT * FROM t4; c diff --git a/mysql-test/r/function_defaults_innodb.result b/mysql-test/r/function_defaults_innodb.result index 302d4c85e05..2525d4e948a 100644 --- a/mysql-test/r/function_defaults_innodb.result +++ b/mysql-test/r/function_defaults_innodb.result @@ -661,7 +661,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -670,7 +670,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' + `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -679,7 +679,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -706,7 +706,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime DEFAULT NULL + `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -715,7 +715,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime DEFAULT NULL + `g` datetime DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -724,7 +724,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime DEFAULT NULL + `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -775,14 +775,14 @@ t12 CREATE TABLE `t12` ( `s` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `t` datetime DEFAULT NULL, `u` datetime DEFAULT '1986-09-27 03:00:00', - `a` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `b` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `b` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `c` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, `d` timestamp NOT NULL DEFAULT '1986-09-27 03:00:00', `e` timestamp NULL DEFAULT NULL, - `f` datetime DEFAULT NULL, - `g` datetime DEFAULT NULL, - `h` datetime DEFAULT NULL, + `f` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `g` datetime DEFAULT CURRENT_TIMESTAMP, + `h` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `i` datetime DEFAULT NULL, `j` datetime DEFAULT '1986-09-27 03:00:00' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -803,7 +803,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime DEFAULT NULL + `a` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -812,7 +812,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime DEFAULT NULL + `b` datetime DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -821,7 +821,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime DEFAULT NULL + `c` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2217,7 +2217,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2226,7 +2226,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2235,7 +2235,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c @@ -2262,7 +2262,7 @@ CREATE TABLE t7 SELECT f FROM t1; SHOW CREATE TABLE t7; Table Create Table t7 CREATE TABLE `t7` ( - `f` datetime(6) DEFAULT NULL + `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t7; f @@ -2271,7 +2271,7 @@ CREATE TABLE t8 SELECT g FROM t1; SHOW CREATE TABLE t8; Table Create Table t8 CREATE TABLE `t8` ( - `g` datetime(6) DEFAULT NULL + `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t8; g @@ -2280,7 +2280,7 @@ CREATE TABLE t9 SELECT h FROM t1; SHOW CREATE TABLE t9; Table Create Table t9 CREATE TABLE `t9` ( - `h` datetime(6) DEFAULT NULL + `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t9; h @@ -2331,14 +2331,14 @@ t12 CREATE TABLE `t12` ( `s` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), `t` datetime(6) DEFAULT NULL, `u` datetime(6) DEFAULT '1986-09-27 03:00:00.098765', - `a` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', - `b` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', - `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000', + `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `b` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), + `c` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ON UPDATE CURRENT_TIMESTAMP(6), `d` timestamp(6) NOT NULL DEFAULT '1986-09-27 03:00:00.098765', `e` timestamp(6) NULL DEFAULT NULL, - `f` datetime(6) DEFAULT NULL, - `g` datetime(6) DEFAULT NULL, - `h` datetime(6) DEFAULT NULL, + `f` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), + `g` datetime(6) DEFAULT CURRENT_TIMESTAMP(6), + `h` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6), `i` datetime(6) DEFAULT NULL, `j` datetime(6) DEFAULT '1986-09-27 03:00:00.098765' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 @@ -2359,7 +2359,7 @@ CREATE TABLE t2 SELECT a FROM t1; SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` datetime(6) DEFAULT NULL + `a` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t2; a @@ -2368,7 +2368,7 @@ CREATE TABLE t3 SELECT b FROM t1; SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( - `b` datetime(6) DEFAULT NULL + `b` datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t3; b @@ -2377,7 +2377,7 @@ CREATE TABLE t4 SELECT c FROM t1; SHOW CREATE TABLE t4; Table Create Table t4 CREATE TABLE `t4` ( - `c` datetime(6) DEFAULT NULL + `c` datetime(6) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(6) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM t4; c diff --git a/mysql-test/r/galera_sst_mode.result b/mysql-test/r/galera_sst_mode.result deleted file mode 100644 index ea25b322449..00000000000 --- a/mysql-test/r/galera_sst_mode.result +++ /dev/null @@ -1,24 +0,0 @@ -# -# Test for mysqldump's galera-sst-mode option -# -# -# MDEV-6490: mysqldump unknown option --galera-sst-mode -# -CREATE DATABASE bug6490; -USE bug6490; -CREATE TABLE t1(c1 INT); -INSERT INTO t1 values (1); -INSERT INTO t1 values (2); -# Save the current gtid_binlog_state. -# Take a dump of bug6490 database -DROP TABLE t1; -# Load the dump -RESET MASTER; -SELECT * from t1; -c1 -1 -2 -# Compare the two gtid_binlog_state's -# Cleanup -DROP DATABASE bug6490; -# End of test diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 4b7a9a5dc0c..174088bf944 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP VIEW IF EXISTS v1; CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING); CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON); @@ -489,7 +490,7 @@ explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimpl id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select st_issimple(st_multipoint(st_point(3,6),st_point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(st_point(3,6)) AS `issimple(Point(3, 6))` +Note 1003 select st_issimple(st_multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); @@ -1618,4 +1619,14 @@ create table t1 (pt point); insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))')); ERROR 22007: Incorrect POINT value: 'POLYGON' for column 'pt' at row 1 drop table t1; -End of 5.5 tests +SELECT st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)); +st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)) +GEOMETRYCOLLECTION EMPTY +CREATE VIEW v1 AS SELECT POINT(1,1) AS p; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select point(1,1) AS `p` latin1 latin1_swedish_ci +SELECT ASTEXT(p) FROM v1; +ASTEXT(p) +POINT(1 1) +DROP VIEW v1; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 9a259b3c4c6..38abbfef261 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2339,6 +2339,16 @@ MIN(a) b 0 a DROP TABLE t1; +create table t1 (a int, b int); +insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +create table t2 (c int, d int); +insert into t2 values (1,11), (2,22), (4,44); +select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); +a sum(b) (select d from t2 where c=a order by max(b) limit 1) +1 23 11 +2 45 22 +4 89 44 +drop table t1, t2; # # LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE # diff --git a/mysql-test/r/group_by_innodb.result b/mysql-test/r/group_by_innodb.result index 1098579a82d..381e0d7493c 100644 --- a/mysql-test/r/group_by_innodb.result +++ b/mysql-test/r/group_by_innodb.result @@ -79,4 +79,48 @@ oidGroup oid oid 1 3 3 1 4 NULL DROP TABLE t1, t2; +# +# MDEV-7193: Incorrect Query Result (MySQL Bug 68897) in MariaDB 10.0.14 +# (fixed by MDEV-5719) +# +CREATE TABLE `t1` ( +`param` int(11) NOT NULL, +`idx` int(11) NOT NULL, +`text` varchar(255) default NULL, +PRIMARY KEY (`param`,`idx`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `t1` (`param`, `idx`, `text`) VALUES +(1, 0, 'select'), +(1, 1, 'Kabel mit Stecker 5-polig'), +(1, 2, 'Kabel ohne Stecker'), +(2, 0, 'number'), +(2, 1, '22'), +(2, 2, '25'); +CREATE TABLE `t2` ( +`id` int PRIMARY KEY +); +INSERT INTO t2 VALUES (1),(2),(3),(4); +SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen +FROM t2 +LEFT JOIN t1 AS T ON(T.param=t2.id AND T.idx=0 ) +LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) +GROUP BY t2.id +ORDER BY id ASC; +id xtext optionen +1 select Kabel mit Stecker 5-polig,Kabel ohne Stecker +2 number 22,25 +3 NULL NULL +4 NULL NULL +SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen +FROM t2 +LEFT JOIN t1 AS T ON(T.param=t2.id AND T.idx=0 ) +LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) +GROUP BY t2.id +ORDER BY id DESC; +id xtext optionen +4 NULL NULL +3 NULL NULL +2 number 22,25 +1 select Kabel mit Stecker 5-polig,Kabel ohne Stecker +DROP TABLE t1, t2; # End of tests diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 99cc5d484bd..eda67460205 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -667,6 +667,37 @@ pk f DROP TABLE t1; End of 5.3 tests # +# Bug MDEV-7301: Unknown column quoted with backticks in HAVING clause when using function. +# Bug#16221433 MYSQL REJECTS QUERY DUE TO BAD RESOLUTION OF NAMES IN HAVING; VIEW UNREADABLE +# +CREATE TABLE `t1` ( +`id` int(11) NOT NULL, +`title` varchar(45) DEFAULT NULL, +PRIMARY KEY (`id`) +) DEFAULT CHARSET=utf8; +INSERT INTO `t1` VALUES ('1', 'Just for fun'); +INSERT INTO `t1` VALUES ('2', 'Wait until a sunhine'); +INSERT INTO `t1` VALUES ('3', 'Take a new turn'); +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING `column_1` LIKE '8%'; +id column_1 +1 80a12660d24a72460e5e292fe33f870276d7f40a +expected 1 row(s) returned +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(column_1) LIKE '8%'; +id column_1 +1 80a12660d24a72460e5e292fe33f870276d7f40a +expected -- 1 row(s) returned +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(`column_1`) LIKE '8%'; +id column_1 +1 80a12660d24a72460e5e292fe33f870276d7f40a +expected -- 1 row(s) returned not ER_BAD_FIELD_ERROR +drop table t1; +# # Bug mdev-5160: two-way join with HAVING over the second table # CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM; diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 41eb76f4e8d..6980b5d30ed 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1977,6 +1977,21 @@ drop view v1; # Clean-up. drop database mysqltest; # +# Test for bug #16869534 - "QUERYING SUBSET OF COLUMNS DOESN'T USE TABLE +# CACHE; OPENED_TABLES INCREASES" +# +SELECT * FROM INFORMATION_SCHEMA.TABLES; +SELECT VARIABLE_VALUE INTO @val1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE +VARIABLE_NAME LIKE 'Opened_tables'; +SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES; +# The below SELECT query should give same output as above SELECT query. +SELECT VARIABLE_VALUE INTO @val2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE +VARIABLE_NAME LIKE 'Opened_tables'; +# The below select should return '1' +SELECT @val1 = @val2; +@val1 = @val2 +1 +# # End of 5.5 tests # # diff --git a/mysql-test/r/information_schema2.result b/mysql-test/r/information_schema2.result index 60a20944839..f82301699a7 100644 --- a/mysql-test/r/information_schema2.result +++ b/mysql-test/r/information_schema2.result @@ -6,3 +6,15 @@ select variable_name from information_schema.session_variables where variable_na (select variable_name from information_schema.session_variables where variable_name = 'basedir'); variable_name BASEDIR +create table t1 (a char); +insert t1 values ('a'),('t'),('z'); +flush status; +select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; +a exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) +a 0 +t 1 +z 0 +show status like 'created_tmp_tables'; +Variable_name Value +Created_tmp_tables 43 +drop table t1; diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 49d69d13e40..478b0109816 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -528,6 +528,7 @@ SET DEBUG_SYNC= 'RESET'; # This should not do anything ALTER TABLE t1; affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild'; # Check that we rebuild the table ALTER TABLE t1 engine=innodb; diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result index 456e17a91f7..c1dbef08c04 100644 --- a/mysql-test/r/join_cache.result +++ b/mysql-test/r/join_cache.result @@ -5874,4 +5874,17 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 11 Using where set join_buffer_space_limit=default; drop table t1; +# +# MDEV-6687: Assertion `0' failed in Protocol::end_statement on query +# +SET join_cache_level = 3; +# The following should have +# - table order PROFILING,user, +# - table user accessed with hash_ALL: +explain +SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user WHERE password_expired = PAGE_FAULTS_MINOR; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE user hash_ALL NULL #hash#$hj 1 information_schema.PROFILING.PAGE_FAULTS_MINOR 4 Using where; Using join buffer (flat, BNLH join) +set join_cache_level=default; set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/r/log_errchk.result b/mysql-test/r/log_errchk.result index 407fba2323e..e1968e29662 100644 --- a/mysql-test/r/log_errchk.result +++ b/mysql-test/r/log_errchk.result @@ -1,5 +1,4 @@ -call mtr.add_suppression("Could not use"); -# Case 1: Setting fife file to general_log_file and slow_query_log_file +# Case 1: Setting fifo file to general_log_file and slow_query_log_file # system variable. SET GLOBAL general_log_file="MYSQLTEST_VARDIR/tmp/general_log.fifo";; ERROR 42000: Variable 'general_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/general_log.fifo' @@ -7,4 +6,6 @@ SET GLOBAL slow_query_log_file="MYSQLTEST_VARDIR/tmp/slow_log.fifo";; ERROR 42000: Variable 'slow_query_log_file' can't be set to the value of 'MYSQLTEST_VARDIR/tmp/slow_log.fifo' # Case 2: Starting server with fifo file as general log file # and slow query log file. +call mtr.add_suppression("Could not use .* for logging \\(error 6\\)"); +call mtr.add_suppression("File '.*' not found \\(Errcode: 6 "); Setting fifo file as general log file and slow query log failed. diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result index a609b222d53..6cbb25bd1d4 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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -43,9 +43,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -53,7 +54,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK DROP TABLE general_log; RENAME TABLE renamed_general_log TO general_log; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index f701e7fa085..688184f2f83 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -823,6 +823,200 @@ create view v3 as select t2.id, t3.b from t2 join t3 using(id); update t1 join v3 using (id) set t1.a=0; drop view v1, v2, v3; drop table t2, t3, t1; +# +# MDEV-7613: MariaDB 5.5.40 server crash on update table left join +# with a view +# +CREATE TABLE `t1` ( +`f1` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, +`f2` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, +`f3` varchar(7) COLLATE latin1_general_ci DEFAULT NULL, +`f4` varchar(15) COLLATE latin1_general_ci DEFAULT NULL, +`f5` datetime DEFAULT NULL, +`f6` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, +`f7` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, +`ff1` int(1) DEFAULT NULL, +`ff2` int(1) DEFAULT NULL, +`ff3` int(1) DEFAULT NULL, +`ff4` int(1) DEFAULT NULL, +`ff5` int(1) DEFAULT NULL, +`ff6` int(1) DEFAULT NULL, +`ff7` int(1) DEFAULT NULL, +`ff8` int(2) DEFAULT NULL, +`ff9` int(1) DEFAULT NULL, +`ff10` int(1) DEFAULT NULL, +`ff11` int(1) DEFAULT NULL, +`ff12` int(1) DEFAULT NULL, +`ff13` int(1) DEFAULT NULL, +`ff14` int(1) DEFAULT NULL, +`ff15` int(1) DEFAULT NULL, +`f8` varchar(70) COLLATE latin1_general_ci DEFAULT NULL, +`f9` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, +`f10` varchar(50) COLLATE latin1_general_ci NOT NULL, +`f11` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f12` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`f13` text COLLATE latin1_general_ci, +`f14` time DEFAULT NULL, +`f15` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, +`fg1` int(11) DEFAULT NULL, +`fg2` int(11) DEFAULT NULL, +`fg3` int(11) DEFAULT NULL, +`fg4` int(11) DEFAULT NULL, +`fg5` int(11) DEFAULT NULL, +`fg6` int(11) DEFAULT NULL, +`fg7` int(11) DEFAULT NULL, +`fg9` int(11) DEFAULT NULL, +`fg10` int(11) DEFAULT NULL, +`fg11` int(11) DEFAULT NULL, +`fg12` int(11) DEFAULT NULL, +`fg13` int(11) DEFAULT NULL, +`fg14` int(11) DEFAULT NULL, +`fg15` int(11) DEFAULT NULL, +`f16` double DEFAULT NULL, +`f17` double DEFAULT NULL, +`f18` int(11) DEFAULT NULL, +`f19` int(11) DEFAULT NULL, +`f20` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`f21` int(11) DEFAULT NULL, +`f22` int(11) DEFAULT NULL, +`f23` int(11) DEFAULT NULL, +`f24` double DEFAULT NULL, +`f25` int(11) DEFAULT NULL, +`f26` double DEFAULT NULL, +`f27` int(11) DEFAULT NULL, +`f28` int(11) DEFAULT NULL, +`f29` double DEFAULT NULL, +`f30` int(11) DEFAULT NULL, +`f31` double DEFAULT NULL, +`PZ` double DEFAULT NULL, +`f32` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f33` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f34` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f35` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, +`f36` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, +`f37` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, +`f20_2` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, +`f38` varchar(30) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Email = E-Mail / Whitemail = Brief', +`insert_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP, +PRIMARY KEY (`f10`), +KEY `f5_f12` (`f5`,`f12`), +KEY `f5_f20` (`f5`,`f20`), +KEY `f5_f33` (`f5`,`f33`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT; +INSERT INTO `t1` VALUES ('2011/2','201105','2011/19','gstfbnfr','2011-05-06 +00:00:00','gg','Ag',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'','','','','','','21:56:28','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,0,0,'Dffgult',1,0,0,NULL,0,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ggggil',NULL),('2008/4','200812','2008/50','hgckbgfx','2008-12-08 +00:00:00','gg','Ag',2,NULL,2,1,1,1,1,24,1,NULL,1,1,1,2,0,'gusschlifßlich +zugg +gflffonifrfn','88.77.79.214','10001614','fg-gtgggggdgtfn','fg-gtgggggdgtfn','birgit.tfrpfllf@gggx.df','11:55:21',NULL,1,0,1,1,1,1,1,1,0,1,1,1,0,0,NULL,NULL,0,4,'ffrtrgg',1,6,10,1.66666666666667,4,1,10,14,1.4,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/51','hgckbgfx','2008-12-15 +00:00:00','gg','Ag',4,5,5,4,5,5,5,NULL,4,5,1,1,1,4,0,'gusschlifßlich zugg +gflffonifrfn','79.197.185.64','10001686','fg-gtgggggdgtfn','fg-gtgggggdgtfn','kgtjg@swfftys.df','09:28:42',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,11,4.71428571428571,16,1.2,12,49,4.08111111111111,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/50','nufchti','2008-12-08 +00:00:00','gg','Ag',4,1,1,5,5,5,5,12,4,5,1,1,2,1,0,'gusschlifßlich zugg +gflffonifrfn','89.54.151.216','10001700','fg-gtgggggdgtfn','fg-gtgggggdgtfn','H_K2006@frffnft.df','16:41:45',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,10,4.28571428571429,11,2.6,12,41,1.58111111111111,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Nufchtfr, +Iris','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','junghdro','2008-12-11 +00:00:00','Do','Ag',2,2,5,5,4,4,2,72,2,5,2,2,1,1,0,'gusschlifßlich zugg +gflffonifrfn','84.61.20.216','10001849','fg-ggriff','fg-ggriff','schofnf-glftfr@grcor.df','20:18:05',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,24,1.42857142857141,12,2.4,12,16,1,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Junghfinrich, +Dorothfg','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','fbflktj','2008-12-08 +00:00:00','gg','Ag',4,2,2,5,1,1,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','217.84.62.6','10001888','fg-Kündigungfn','fg-Kündigungfn','f.frofschkf@gggx.df','21:05:59',NULL,1,1,1,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,7,16,2.28571428571429,0,NULL,7,16,2.28571428571429,0,NULL,NULL,'out',NULL,'gbfl, +Kgtjg','49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','gltggggri','2008-12-09 +00:00:00','Di','Ag',4,1,1,4,2,1,2,16,1,2,2,2,2,2,0,'gusschlifßlich zugg +gflffonifrfn','81.171.157.211','10001988','fg-gtgggggdgtfn','fg-gtgggggdgtfn','bistfr@nftcolognf.df','11:07:54',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,21,1,11,2.2,12,12,2.66666666666667,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','ggufllfsg','2008-12-09 +00:00:00','Di','Ag',2,2,2,2,1,1,2,12,2,2,2,1,1,2,0,'ggobilfs +Intfrnft','62.154.142.186','10002097','fg-gtgggggdgtfn','fg-gtgggggdgtfn','norbfrtwfdlich@fgggil.df','09:42:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,12,1.71428571428571,8,1.6,12,20,1.66666666666667,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Mufllfr, +ggbinf','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','wggnfg','2008-12-09 +00:00:00','Di','Ag',5,5,5,5,5,5,5,12,5,5,5,5,5,5,0,'gls grsgtz für +Ffstnftz','85.180.141.246','10002127','fg-Kündigungfn','fg-Kündigungfn','rfinhgrt.gdolph@yghoo.df','17:44:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,15,5,25,5,12,60,5,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Wggnfr, +Annftt','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','schubrbf','2008-12-10 +00:00:00','Mi','Ag',1,2,NULL,2,1,2,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','91.40.98.242','10002160','fg-gtgggggdgtfn','fg-gtgggggdgtfn','olgf.lifb@gggx.nft','18:18:25',NULL,1,1,0,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,6,11,1.81111111111111,0,NULL,6,11,1.81111111111111,0,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL); +CREATE TABLE `t2` ( +`ft1` datetime DEFAULT NULL, +`ft2` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +`ft3` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', +`ft4` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', +`ft5` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', +`ft6` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft6_2` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft7` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft8` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft9` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +`ft10` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, +PRIMARY KEY (`ft4`,`ft5`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +INSERT INTO `t2` VALUES ('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 2','Default','Intern','DEFAULT',NULL,NULL,NULL),('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 3','Default','Intern','DEFAULT',NULL,NULL,NULL); +CREATE TABLE `t3` ( +`fe1` int(10) NOT NULL DEFAULT '0', +`fe2` char(50) COLLATE latin1_general_ci DEFAULT 'nn', +`f34` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe3` double DEFAULT NULL, +`fe4` double DEFAULT NULL, +`fe5` char(4) COLLATE latin1_general_ci DEFAULT NULL, +`f32` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe6` int(3) DEFAULT '0', +`fe7` char(1) COLLATE latin1_general_ci DEFAULT NULL, +`ft6` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`f33` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'virtuelle f33s', +`fe8` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'aus dem ADS', +`f37` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe9` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe10` int(5) DEFAULT '0', +`fe11` int(10) DEFAULT '0', +`fe12` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe13` double DEFAULT NULL, +`fe14` char(50) COLLATE latin1_general_ci DEFAULT NULL, +`fe15` date DEFAULT NULL, +`fe16` date DEFAULT NULL, +`fe17` int(10) DEFAULT '0', +`fe18` date NOT NULL DEFAULT '0000-00-00', +`ft3` date NOT NULL DEFAULT '0000-00-00', +PRIMARY KEY (`fe1`), +KEY `fe2` (`fe2`,`fe18`,`ft3`), +KEY `f33` (`f33`), +KEY `fe8` (`fe8`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT COMMENT='CustomerService und Outsourcer Userinformationen'; +INSERT INTO `t3` VALUES (1,'aabggn','gab, glgna',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',91611,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2011-01-01','2014-08-11'),(4,'aabigr','gab, +Iggr',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',0,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2012-10-01','2014-08-11'),(7,'abgcrist','gbg, +ghristggna',15182,1,'ja','ggshilfg gxtgrn 1',1,NULL,'gg +galgs','ag1','ag1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'1900-01-01','2010-06-10'),(8,'abgcrist','gbg, +ghristggna',15182,1,'ja','Zgntralg gftgr galgs Bgtrgggng 1',1,NULL,'gg +galgs','sb1','sb1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2010-07-01','2012-08-11'),(9,'abgcrist','gbg, +ghristggna',15182,1,'ja','galgs Inbggnd 2',1,NULL,'gg +galgs','si2','si2','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2012-09-01','2014-01-11'),(10,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'1900-01-01','2010-11-10'),(11,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2010-12-01','2011-08-11'),(12,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2011-09-01','2012-01-11'),(13,'abgcgr','gbg, +ggrnglgg',14962,0.75,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,'2011-09-11',11800647,'2012-02-01','2011-08-11'),(14,'rgghrsgr','gbg, +gigrid',14781,1,'ja','Fgrdgrgngsmanaggmgnt 1',1,NULL,'gg +Zahlgng','fm1','fm1','grfgrt','0',12141,0,'0',1,NULL,NULL,NULL,11010781,'1900-01-01','2012-08-11'); +CREATE ALGORITHM=MERGE +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v1` AS select `t1a`.`ft1` AS `ft1`,`t1a`.`ft2` AS `ft2`,`t1a`.`ft3` AS `ft3`,`t1a`.`ft4` AS `ft4`,`t1a`.`ft5` AS `ft5`,`t1a`.`ft6` AS `ft6`,`t1a`.`ft6_2` AS `ft6_2`,`t1a`.`ft7` AS `ft7`,`t1a`.`ft8` AS `ft8`,`t1a`.`ft9` AS `ft9`,`t1a`.`ft10` AS `ft10` from `t2` `t1a` where (if((`t1a`.`ft10` = 'virtuell'),0,1) = 1); +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v2` AS select distinct `t1b`.`fe2` AS `fe2`,min(`t1b`.`fe18`) AS `fe18`,max(`t1b`.`ft3`) AS `ft3` from `t3` `t1b` where ((`t1b`.`fe2` <> '') and (curdate() >= `t1b`.`fe18`)) group by `t1b`.`fe2`; +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v3` AS select `t1c`.`fe2` AS `fe2`,`t1c`.`f34` AS `f34`,`t1c`.`f33` AS `f33`,`t1c`.`f32` AS `f32`,`t1c`.`f37` AS `f37`,`t1c`.`fe10` AS `fe10`,if((`tov`.`ft6` in ('klarmobil','callmobile')),`tov`.`ft9`,`tov`.`ft6`) AS `ft6_1`,`tov`.`ft6_2` AS `ft6_2`,`ua`.`fe18` AS `fe18`,`ua`.`ft3` AS `ft3` from ((`t3` `t1c` left join `v2` `ua` on((`t1c`.`fe2` = `ua`.`fe2`))) left join `v1` `tov` on((`t1c`.`fe8` = `tov`.`ft4`))) where (`t1c`.`ft3` = `ua`.`ft3`) group by `t1c`.`fe2`,`t1c`.`f34`,`t1c`.`f33`,`t1c`.`f32` order by `t1c`.`f34`; +UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'; +#MDEV-8018: main.multi_update fails with --ps-protocol +prepare stmt1 from "UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop view v3,v2,v1; +drop table t1,t2,t3; end of 5.5 tests # Bug mdev-5970 diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 3a6fa9a4673..5506e4e419c 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -2527,6 +2527,17 @@ test.t1 check error Size of indexfile is: 1024 Should be: 2048 test.t1 check warning Size of datafile is: 14 Should be: 7 test.t1 check error Corrupt DROP TABLE t1; +# +# MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +# disabled keys +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; show variables like 'myisam_block_size'; Variable_name Value myisam_block_size 1024 diff --git a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result index dda732937ee..f127e756987 100644 --- a/mysql-test/r/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/r/mysql_tzinfo_to_sql_symlink.result @@ -60,3 +60,12 @@ INSERT INTO time_zone_transition_type (Time_zone_id, Transition_type_id, Offset, # TRUNCATE TABLE time_zone_leap_second; ALTER TABLE time_zone_leap_second ORDER BY Transition_time; +# +# MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL +# +TRUNCATE TABLE time_zone; +TRUNCATE TABLE time_zone_name; +TRUNCATE TABLE time_zone_transition; +TRUNCATE TABLE time_zone_transition_type; +ALTER TABLE time_zone_transition ORDER BY Time_zone_id, Transition_time; +ALTER TABLE time_zone_transition_type ORDER BY Time_zone_id, Transition_type_id; diff --git a/mysql-test/r/mysql_upgrade-6984.result b/mysql-test/r/mysql_upgrade-6984.result index 6ae995cd030..7890b66d494 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/5: Checking mysql database +Phase 1/6: 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/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -52,7 +53,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK update mysql.user set password='' where user='root'; flush privileges; diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 64c2c0222fc..737f8b63783 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -1,5 +1,5 @@ Run mysql_upgrade once -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -30,9 +30,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -40,12 +41,12 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: 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 wether it's been run before -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -76,9 +77,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -86,12 +88,12 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila'; GRANT ALL ON *.* TO mysqltest1@'%'; Run mysql_upgrade with password protected account -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -122,9 +124,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -132,7 +135,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK DROP USER mysqltest1@'%'; Version check failed. Got the following error when calling the 'mysql' command line client @@ -142,7 +145,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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -173,9 +176,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -183,7 +187,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK set GLOBAL sql_mode=default; # @@ -194,7 +198,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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -225,9 +229,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -235,7 +240,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK CALL testproc(); DROP PROCEDURE testproc; @@ -249,7 +254,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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -280,9 +285,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -290,7 +296,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK SHOW GRANTS FOR 'user3'@'%'; Grants for user3@% @@ -299,7 +305,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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -330,8 +336,11 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 5/5: Running 'FLUSH PRIVILEGES'... +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' OK # # Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION @@ -339,7 +348,7 @@ OK # # Droping the previously created mysql_upgrade_info file.. # Running mysql_upgrade with --skip-write-binlog.. -Phase 1/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -370,9 +379,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -380,7 +390,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK # # MDEV-4332 Increase username length from 16 characters @@ -394,7 +404,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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -425,9 +435,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -435,7 +446,7 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr'; definer diff --git a/mysql-test/r/mysql_upgrade_no_innodb.result b/mysql-test/r/mysql_upgrade_no_innodb.result index e65c6ae05f7..acbca131587 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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -42,6 +42,9 @@ error : Corrupt mysql.innodb_table_stats Error : Unknown storage engine 'InnoDB' error : Corrupt -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 5/5: Running 'FLUSH PRIVILEGES'... +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' OK diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result index 1bbee22aba2..e06d1bb1671 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/5: Checking mysql database +Phase 1/6: Checking and upgrading mysql database Processing databases mysql mysql.column_stats OK @@ -32,9 +32,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK -Phase 2/5: Running 'mysql_fix_privilege_tables'... -Phase 3/5: Fixing table and database names -Phase 4/5: Checking and upgrading tables +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 Processing databases information_schema mtr @@ -42,5 +43,5 @@ mtr.global_suppressions OK mtr.test_suppressions OK performance_schema test -Phase 5/5: Running 'FLUSH PRIVILEGES'... +Phase 6/6: Running 'FLUSH PRIVILEGES' OK diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result new file mode 100644 index 00000000000..63f86af3591 --- /dev/null +++ b/mysql-test/r/mysql_upgrade_view.result @@ -0,0 +1,321 @@ +set sql_log_bin=0; +drop table if exists t1,v1,v2,v3,v4,v1badcheck; +drop view if exists t1,v1,v2,v3,v4,v1badcheck; +create table t1(a int); +create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); +create view v1 as select 1; +repair table t1 quick; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 extended; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 use_frm; +Table Op Msg_type Msg_text +test.t1 repair status OK +repair table t1 from mysql; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from mysql' at line 1 +repair view v1 quick; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'quick' at line 1 +repair view v1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 +repair view v1 use_frm; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'use_frm' at line 1 +repair view v1 from mysql; +Table Op Msg_type Msg_text +test.v1 repair status OK +check view v1 quick; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'quick' at line 1 +check view v1 fast; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'fast' at line 1 +check view v1 medium; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'medium' at line 1 +check view v1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'extended' at line 1 +check view v1 changed; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'changed' at line 1 +check view v1 for upgrade; +Table Op Msg_type Msg_text +test.v1 check status OK +drop view v1; +flush tables; +check view v1; +Table Op Msg_type Msg_text +test.v1 check status OK +check view v1badcheck; +Table Op Msg_type Msg_text +test.v1badcheck check note View text checksum failed +check view v2; +Table Op Msg_type Msg_text +test.v2 check status OK +check view v3; +Table Op Msg_type Msg_text +test.v3 check status OK +check view v1 for upgrade; +Table Op Msg_type Msg_text +test.v1 check error Upgrade required. Please do "REPAIR VIEW `v1`" or dump/reload to fix it! +check view v1badcheck for upgrade; +Table Op Msg_type Msg_text +test.v1badcheck check note View text checksum failed +check view v2 for upgrade; +Table Op Msg_type Msg_text +test.v2 check error Upgrade required. Please do "REPAIR VIEW `v2`" or dump/reload to fix it! +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 +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 +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +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 + +Repairing tables +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +Phase 2/6: 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 +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +test.kv OK +test.t1 OK +Phase 6/6: Running 'FLUSH PRIVILEGES' +OK +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +set sql_log_bin=1; +REPAIR VIEW v1,v2; +Table Op Msg_type Msg_text +test.v1 repair status OK +test.v2 repair status OK +REPAIR VIEW v1badcheck; +Table Op Msg_type Msg_text +test.v1badcheck repair status OK +REPAIR NO_WRITE_TO_BINLOG VIEW v3; +Table Op Msg_type Msg_text +test.v3 repair status OK +set sql_log_bin=0; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1,v2 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1badcheck +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 1 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v2.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 2 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v3.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 0 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1badcheck.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 1 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +drop view if exists v1,v2,v3,v1badcheck; +rename table mysql.event to mysql.ev_bk; +flush tables; +create algorithm=temptable view v4 as select a from t1; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +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 +Processing databases +mysql +mysql.column_stats OK +mysql.columns_priv OK +mysql.db OK +mysql.ev_bk 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 +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +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 + +Repairing tables +mysql.innodb_index_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +mysql.innodb_table_stats +Error : Unknown storage engine 'InnoDB' +error : Corrupt +Phase 2/6: 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 +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +performance_schema +test +test.kv OK +test.t1 OK +Phase 6/6: Running 'FLUSH PRIVILEGES' +OK +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a` from `t1` utf8 utf8_general_ci +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 +LOAD DATA INFILE 'MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +k v +algorithm 2 +md5 5e6eaf216e7b016fcedfd4e1113517af +SELECT k from kv where k ='mariadb-version'; +k +mariadb-version +truncate table kv; +drop view if exists v1,v2,v3; +drop table mysql.event; +rename table mysql.ev_bk to mysql.event; +test.kv OK +test.t1 OK +test.v1 OK +test.v2 OK +test.v3 OK +test.v4 OK +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1,v2 +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW v1badcheck +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR TABLE `kv` USE_FRM +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR TABLE `t1` USE_FRM +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v1` FROM MYSQL +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v2` FROM MYSQL +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v3` FROM MYSQL +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; REPAIR VIEW `v4` FROM MYSQL +drop table if exists kv; +drop view v1,v2,v3,v4; +drop table t1; diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index ba9ab47ea95..b4bcdc495ae 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -1,6 +1,6 @@ call mtr.add_suppression("Invalid .old.. table or database name"); -DROP TABLE IF EXISTS t1, `t``1`, `t 1`; -drop view if exists v1; +DROP TABLE IF EXISTS t1, `t``1`, `t 1`, test.`t.1`, v1; +drop view if exists t1, `t``1`, `t 1`, test.`t.1`, v1; drop database if exists client_test_db; mtr.global_suppressions OK mtr.test_suppressions OK @@ -340,3 +340,33 @@ CHECK TABLE bug47205 FOR UPGRADE; Table Op Msg_type Msg_text test.bug47205 check status OK DROP TABLE bug47205; +# +#MDEV-6128:[PATCH] mysqlcheck wrongly escapes '.' in table names +# +CREATE TABLE test.`t.1` (id int); +mysqlcheck test t.1 +test.t.1 OK +drop table test.`t.1`; +create view v1 as select 1; +mysqlcheck --process-views test +test.v1 OK +mysqlcheck --process-views --extended test +test.v1 OK +mysqlcheck --process-views --fast test +mysqlcheck --process-views --quick test +test.v1 OK +mysqlcheck --process-views --check-only-changed test +mysqlcheck --process-views --medium-check test +test.v1 OK +mysqlcheck --process-views --check-upgrade test +test.v1 OK +drop view v1; +create table t1(a int); +mysqlcheck --process-views --check-upgrade --auto-repair test +test.t1 OK +test.v1 Needs upgrade + +Repairing views +test.v1 OK +drop view v1; +drop table t1; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 360421514ac..0b8fb8e3d05 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -405,6 +405,8 @@ The following options may be given as the first argument: Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used + --max-digest-length=# + Maximum length considered for digest text. --max-error-count=# Max number of errors/warnings to store for a statement --max-heap-table-size=# Don't allow creation of heap tables bigger than this @@ -1172,6 +1174,7 @@ max-binlog-stmt-cache-size 18446744073709547520 max-connect-errors 100 max-connections 151 max-delayed-threads 20 +max-digest-length 1024 max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 4627f03a8a3..c5dd1500110 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -3,8 +3,8 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client" ISSUER "/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; connect(localhost,ssl_user2,,test,MASTER_PORT,MASTER_SOCKET); @@ -197,10 +197,6 @@ Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA Variable_name Value Ssl_cipher EDH-RSA-DES-CBC3-SHA -Variable_name Value -Ssl_cipher EDH-RSA-DES-CBC-SHA -Variable_name Value -Ssl_cipher RC4-SHA select 'is still running; no cipher request crashed the server' as result from dual; result is still running; no cipher request crashed the server diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 92c9c01db2d..798e3b9a6bf 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -380,33 +380,33 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; show table status like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (0), (1), (2), (3); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 4096 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 8192 16384 0 0 # 1 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 4096 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 8 2048 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) partition by key (a) @@ -588,6 +588,17 @@ a b 0 1 DROP TABLE t1; # +# Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE +# WRONG FOR PARTITIONED TABLES +# +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE +CREATE_TIME IS NOT NULL AND TABLE_NAME='t1'; +COUNT(*) +1 +DROP TABLE t1; +# # BUG#12912171 - ASSERTION FAILED: QUICK->HEAD->READ_SET == # SAVE_READ_SET # diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result index 7a84745e611..7057bb0a55b 100644 --- a/mysql-test/r/partition_innodb_plugin.result +++ b/mysql-test/r/partition_innodb_plugin.result @@ -141,12 +141,12 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction # First table reported in 'SHOW ENGINE InnoDB STATUS' SHOW ENGINE InnoDB STATUS; Type Name Status -InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ +InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ set @old_sql_mode = @@sql_mode; set sql_mode = 'ANSI_QUOTES'; SHOW ENGINE InnoDB STATUS; Type Name Status -InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ +InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ set @@sql_mode = @old_sql_mode; # con1 ROLLBACK; diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result index 80b3a9511ea..bb1a7b19a9d 100644 --- a/mysql-test/r/partition_myisam.result +++ b/mysql-test/r/partition_myisam.result @@ -90,7 +90,7 @@ ERROR HY000: Failed to read from the .par file # Note that it is currently impossible to drop a partitioned table # without the .par file DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Got error 1 "Operation not permitted" from storage engine partition # # Bug#50392: insert_id is not reset for partitioned tables # auto_increment on duplicate entry diff --git a/mysql-test/r/partition_not_blackhole.result b/mysql-test/r/partition_not_blackhole.result index 923d70c0ad6..7759f947c32 100644 --- a/mysql-test/r/partition_not_blackhole.result +++ b/mysql-test/r/partition_not_blackhole.result @@ -11,6 +11,6 @@ t1 SHOW CREATE TABLE t1; ERROR HY000: Incorrect information in file: './test/t1.frm' DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Got error 1 "Operation not permitted" from storage engine partition t1.frm t1.par diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 630f0141d18..510c812a30f 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -321,3 +321,16 @@ UNUSABLE uninstall soname 'ha_example'; select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; plugin_name +# +# MDEV-5309 - RENAME TABLE does not check for existence of the table's +# engine +# +INSTALL PLUGIN example SONAME 'ha_example'; +CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +SELECT * FROM t1; +a +FLUSH TABLES; +UNINSTALL PLUGIN example; +RENAME TABLE t1 TO t2; +ERROR 42S02: Table 'test.t1' doesn't exist +DROP TABLE t1; diff --git a/mysql-test/r/range_innodb.result b/mysql-test/r/range_innodb.result new file mode 100644 index 00000000000..794e6c7b3cc --- /dev/null +++ b/mysql-test/r/range_innodb.result @@ -0,0 +1,39 @@ +# +# Range optimizer (and related) tests that need InnoDB. +# +drop table if exists t0, t1, t2; +# +# MDEV-6735: Range checked for each record used with key +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 + D.a * 1000 +from t0 A, t0 B, t0 C, t0 D; +create table t2 ( +a int, +b int, +filler1 char(100), +filler2 char(100), +filler3 char(100), +filler4 char(100), +key(a), +key(b) +) engine=innodb; +insert into t2 +select +a,a, +repeat('0123456789', 10), +repeat('0123456789', 10), +repeat('0123456789', 10), +repeat('0123456789', 10) +from t1; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +# The following must not use "Range checked for each record": +explain select * from t0 left join t2 on t2.a <t0.a and t2.b between 50 and 250; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t0 ALL NULL NULL NULL NULL 10 +1 SIMPLE t2 range a,b b 5 NULL 201 Using where; Using join buffer (flat, BNL join) +drop table t0,t1,t2; diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index c5faa27085e..79bc6d55c55 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -207,3 +207,10 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1 (a blob); +create view v1 as select * from t1; +repair view v1; +Table Op Msg_type Msg_text +test.v1 repair status OK +drop view v1; +drop table t1; diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index 3b51efa26b0..3c62d0676ae 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -4423,7 +4423,7 @@ INSERT INTO t1 VALUES EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 hash_ALL a #hash#$hj 14 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL a #hash#$hj 6 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; 1 1 @@ -4433,7 +4433,7 @@ SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 hash_ALL a #hash#$hj 14 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL a #hash#$hj 6 test.t1.a 2 Using where; Using join buffer (flat, BNLH join) SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); 1 1 diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index 3f2343fa365..620bdc6bd50 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -1409,4 +1409,40 @@ Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS ` set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; +# +# Bug mdev-7316: a conjunct in WHERE with selectivity == 0 +# +CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB; +Warnings: +Warning 1286 Unknown storage engine 'INNODB' +Warning 1266 Using storage engine MyISAM for table 't1' +INSERT INTO t1 VALUES +('USAChinese',10), ('USAEnglish',20), ('USAFrench',30); +CREATE TABLE t2 (i int) ENGINE=INNODB; +Warnings: +Warning 1286 Unknown storage engine 'INNODB' +Warning 1266 Using storage engine MyISAM for table 't2' +INSERT INTO t2 VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +set use_stat_tables='preferably'; +set optimizer_use_condition_selectivity=3; +EXPLAIN EXTENDED +SELECT * FROM t1, t2 +WHERE a <> 'USARussian' AND b IS NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ref PRIMARY,b b 5 const 1 100.00 Using index condition; Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <> 'USARussian') and isnull(`test`.`t1`.`b`)) +SELECT * FROM t1, t2 +WHERE a <> 'USARussian' AND b IS NULL; +a b i +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 0b7f1c950e5..0acbb465ba8 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1419,6 +1419,36 @@ Note 1003 select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`b`.`a` AS ` set histogram_size=@save_histogram_size; set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; +# +# Bug mdev-7316: a conjunct in WHERE with selectivity == 0 +# +CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB; +INSERT INTO t1 VALUES +('USAChinese',10), ('USAEnglish',20), ('USAFrench',30); +CREATE TABLE t2 (i int) ENGINE=INNODB; +INSERT INTO t2 VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +set use_stat_tables='preferably'; +set optimizer_use_condition_selectivity=3; +EXPLAIN EXTENDED +SELECT * FROM t1, t2 +WHERE a <> 'USARussian' AND b IS NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ref PRIMARY,b b 5 const 2 66.67 Using where; Using index +1 SIMPLE t2 ALL NULL NULL NULL NULL 14 100.00 Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`i` AS `i` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` <> 'USARussian') and isnull(`test`.`t1`.`b`)) +SELECT * FROM t1, t2 +WHERE a <> 'USARussian' AND b IS NULL; +a b i +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; set @tmp_ust= @@use_stat_tables; @@ -1482,6 +1512,30 @@ select * from t1 where col2 != true; col1 col2 drop table t1; # +# MDEV-7413: optimizer_use_condition_selectivity > 2 crashes 10.0.15+maria-1~wheezy +# +CREATE TABLE t1 ( +parent_id int, +child_group_id int, +child_user_id int, +KEY (parent_id,child_group_id,child_user_id) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +id int, +lower_group_name varchar(255), +directory_id int(20), +UNIQUE KEY (directory_id) +) ENGINE=InnoDB; +CREATE TABLE t3 (id int) ENGINE=InnoDB; +insert into t1 values (1,1,1),(2,2,2); +insert into t2 values (10,'foo',10),(20,'bar',20); +insert into t3 values (101),(102); +set use_stat_tables = PREFERABLY, optimizer_use_condition_selectivity = 3; +select * from t1, t2, t3 +where t1.child_user_id=t3.id and t1.child_group_id is null and t2.lower_group_name='foo' and t1.parent_id=t2.id and t2.directory_id=10; +parent_id child_group_id child_user_id id lower_group_name directory_id id +drop table t1,t2,t3; +# # End of 10.0 tests # set use_stat_tables= @tmp_ust; diff --git a/mysql-test/r/show_grants_with_plugin-7985.result b/mysql-test/r/show_grants_with_plugin-7985.result new file mode 100644 index 00000000000..5accda75383 --- /dev/null +++ b/mysql-test/r/show_grants_with_plugin-7985.result @@ -0,0 +1,197 @@ +call mtr.add_suppression("password and an authentication plugin"); +# +# Create a user with mysql_native_password plugin. +# The user has no password or auth_string set. +# +create user u1; +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +user host password plugin authentication_string +u1 % mysql_native_password +# +# The user's grants should show no password at all. +# +show grants for u1; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +# +# Test to see if connecting with no password is succesful. +# +connect con1, localhost, u1,,; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Test after flushing privileges. +# +flush privileges; +connect con1, localhost, u1,,; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Now add a mysql_native password string in authentication_string. +# +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password +USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626'; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +user host password plugin authentication_string +u1 % mysql_native_password *7AFEFD08B6B720E781FB000CAA418F54FA662626 +# +# Test to see if connecting with password is succesful. +# +connect con1, localhost, u1,'SOMETHING',; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Test after flushing privileges. +# +flush privileges; +connect con1, localhost, u1,'SOMETHING',; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Now we also set a password for the user. +# +set password for u1 = PASSWORD('SOMETHINGELSE'); +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +user host password plugin authentication_string +u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password *7AFEFD08B6B720E781FB000CAA418F54FA662626 +# +# Here we should use the password field, as that primes over +# the authentication_string field. +# +show grants for u1; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +# +# Logging in with the user's password should work. +# +connect con1, localhost, u1,'SOMETHINGELSE',; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Reload privileges and test logging in again. +# +flush privileges; +show grants for u1; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +# +# Here we connect via the user's password again. +# +connect con1, localhost, u1,'SOMETHINGELSE',; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Now we remove the authentication plugin password, flush privileges and +# try again. +# +update mysql.user set authentication_string = '' where user='u1'; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +user host password plugin authentication_string +u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password +flush privileges; +show grants for u1; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +# +# Here we connect via the user's password. +# +connect con1, localhost, u1,'SOMETHINGELSE',; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +user host password plugin authentication_string +u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password +disconnect con1; +connection default; +# +# Try and set a wrong auth_string password, with mysql_native_password. +# Make sure it fails. +# +GRANT USAGE ON *.* TO u1 IDENTIFIED VIA mysql_native_password USING 'asd'; +ERROR HY000: Password hash should be a 41-digit hexadecimal number +# +# Now set a correct password. +# +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password +USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626'; +show grants for u1; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +# +# Test if the user can now use that password instead. +# +connect con1, localhost, u1,'SOMETHING',; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +# +# Test if the user can now use that password instead, after flushing privileges; +# +connection default; +flush privileges; +connect con1, localhost, u1,'SOMETHING',; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' IDENTIFIED BY PASSWORD '*7AFEFD08B6B720E781FB000CAA418F54FA662626' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Clear all passwords from the user. +# +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +user host password plugin authentication_string +u1 % mysql_native_password +# +# Test no password connect. +# +connect con1, localhost, u1,,; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +# +# Test no password connect, after flushing privileges. +# +flush privileges; +connect con1, localhost, u1,,; +show grants; +Grants for u1@% +GRANT USAGE ON *.* TO 'u1'@'%' +GRANT SELECT ON `mysql`.* TO 'u1'@'%' +disconnect con1; +connection default; +drop user u1; diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result index 172e40cb40c..81c0adb36cc 100644 --- a/mysql-test/r/sp-destruct.result +++ b/mysql-test/r/sp-destruct.result @@ -170,3 +170,7 @@ Error 1728 Cannot load from mysql.proc. The table is probably corrupted # Restore mysql.proc DROP TABLE mysql.proc; RENAME TABLE proc_backup TO mysql.proc; +create database mysqltest1; +create procedure mysqltest1.foo() select "foo"; +update mysql.proc set name='' where db='mysqltest1'; +drop database mysqltest1; diff --git a/mysql-test/r/sp-innodb.result b/mysql-test/r/sp-innodb.result index da02957d3c9..b3405705698 100644 --- a/mysql-test/r/sp-innodb.result +++ b/mysql-test/r/sp-innodb.result @@ -30,3 +30,103 @@ CALL p1(); CALL p1(); drop procedure p1; drop table t1,t2; + +# +# BUG 16041903: CONTINUE HANDLER NOT INVOKED +# IN A STORED FUNCTION AFTER A LOCK WAIT TIMEOUT +# + +# Save and set lock wait timeout +SET @lock_wait_timeout_saved= @@lock_wait_timeout; +SET @innodb_lock_wait_timeout_saved= @@innodb_lock_wait_timeout; +SET @@lock_wait_timeout= 1; +SET @@innodb_lock_wait_timeout= 1; + +# Create a function with exit handler: +CREATE FUNCTION f1() RETURNS VARCHAR(20) +BEGIN +DECLARE EXIT HANDLER FOR SQLSTATE '42S02' RETURN 'No such table'; +INSERT INTO no_such_table VALUES (1); +END// + +# Create a function calling f1(): +CREATE FUNCTION f2() RETURNS VARCHAR(20) +BEGIN +RETURN f1(); +END// + +# Create a function provoking deadlock: +CREATE FUNCTION f3() RETURNS VARCHAR(20) +BEGIN +UPDATE t1 SET i= 1 WHERE i= 1; +RETURN 'Will never get here'; +END// + +# Create a function calling f3, to create +# a deadlock indirectly: +CREATE FUNCTION f4() RETURNS VARCHAR(20) +BEGIN +RETURN f3(); +END// + +# Open another connection, create and initialize a table +# to be used for provoking deadlock, put a lock on the table: +CREATE TABLE t1 (i INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; + +# On the default connection, do an update to provoke a +# deadlock, then call the function with handler. This case +# fails without the patch (with error ER_NO_SUCH_TABLE): +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table + +# Provoke another deadlock, then call the function with +# handler indirectly. This case fails without the patch +# (with error ER_NO_SUCH_TABLE): +UPDATE t1 SET i= 1 WHERE i= 1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f2() AS 'f2():'; +f2(): +No such table + +# Provoke yet another deadlock, but now from within a function, +# then call the function with handler. This succeeds even +# without the patch because is_fatal_sub_stmt_error is reset +# in restore_sub_stmt after the failing function has been +# executed. The test case is included anyway for better coverage: +SELECT f3() AS 'f3():'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table +# Provoke yet another deadlock, but now from within a function, +# calling another function, then call the function with handler. +# This succeeds even without the patch because +# is_fatal_sub_stmt_error is reset in restore_sub_stmt after +# the failing function has been executed. The test case is +# included anyway for better coverage: +SELECT f4() AS 'f4():'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table + +# Disconnect, drop functions and table: +DROP FUNCTION f4; +DROP FUNCTION f3; +DROP FUNCTION f2; +DROP FUNCTION f1; +DROP TABLE t1; + +# Reset lock wait timeouts +SET @@lock_wait_timeout= @lock_wait_timeout_saved; +SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; +# +# BUG 16041903: End of test case +# diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 410441b63e3..3cc4ff4238b 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -284,4 +284,23 @@ DROP EVENT teste_bug11763507; # ------------------------------------------------------------------ # -- End of 5.1 tests # ------------------------------------------------------------------ +grant create routine on test.* to foo1@localhost identified by 'foo'; +update mysql.user set password = replace(password, '*', '-') where user='foo1'; +show grants; +Grants for foo1@localhost +GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF' +GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost' +flush privileges; +show grants; +Grants for foo1@localhost +GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF' +GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost' +create procedure spfoo() select 1; +show grants; +Grants for foo1@localhost +GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF' +GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost' +GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`spfoo` TO 'foo1'@'localhost' +drop procedure spfoo; +drop user foo1@localhost; set @@global.concurrent_insert= @old_concurrent_insert; diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result index 868efcbdf31..57427a228eb 100644 --- a/mysql-test/r/ssl.result +++ b/mysql-test/r/ssl.result @@ -3,10 +3,10 @@ Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_server_not_before'; Variable_name Value -Ssl_server_not_before Feb 20 02:55:06 2010 GMT +Ssl_server_not_before Apr 25 14:55:05 2015 GMT SHOW STATUS LIKE 'Ssl_server_not_after'; Variable_name Value -Ssl_server_not_after Sep 3 02:55:06 2030 GMT +Ssl_server_not_after Apr 20 14:55:05 2035 GMT drop table if exists t1,t2,t3,t4; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, @@ -2166,3 +2166,9 @@ drop table t1; SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA +select aes_decrypt('MySQL','adf'); +aes_decrypt('MySQL','adf') +NULL +select 'still connected?'; +still connected? +still connected? diff --git a/mysql-test/r/ssl_7937,nossl.result b/mysql-test/r/ssl_7937,nossl.result new file mode 100644 index 00000000000..72693233bc8 --- /dev/null +++ b/mysql-test/r/ssl_7937,nossl.result @@ -0,0 +1,15 @@ +create procedure have_ssl() +select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status +where variable_name='ssl_cipher'; +mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +have_ssl +no +mysql --ssl -e "call test.have_ssl()" +have_ssl +no +mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it +mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it +drop procedure have_ssl; diff --git a/mysql-test/r/ssl_7937.result b/mysql-test/r/ssl_7937.result new file mode 100644 index 00000000000..a94ca3b3529 --- /dev/null +++ b/mysql-test/r/ssl_7937.result @@ -0,0 +1,16 @@ +create procedure have_ssl() +select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status +where variable_name='ssl_cipher'; +mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +have_ssl +yes +mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate +drop procedure have_ssl; diff --git a/mysql-test/r/ssl_timeout.result b/mysql-test/r/ssl_timeout.result new file mode 100644 index 00000000000..356e931ba4d --- /dev/null +++ b/mysql-test/r/ssl_timeout.result @@ -0,0 +1,7 @@ +# connect with read timeout so SLEEP() should timeout +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +SELECT SLEEP(600); +ERROR HY000: Lost connection to MySQL server during query diff --git a/mysql-test/r/subselect_extra.result b/mysql-test/r/subselect_extra.result index 7616dd429b7..48b80e02e1a 100644 --- a/mysql-test/r/subselect_extra.result +++ b/mysql-test/r/subselect_extra.result @@ -447,7 +447,7 @@ WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY <derived3> ref key1 key1 10 const,const 0 Start temporary +1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join) 3 DERIVED t1 ALL NULL NULL NULL NULL 3 SELECT * FROM t3 diff --git a/mysql-test/r/subselect_extra_no_semijoin.result b/mysql-test/r/subselect_extra_no_semijoin.result index d178e45d07e..e5b36055c91 100644 --- a/mysql-test/r/subselect_extra_no_semijoin.result +++ b/mysql-test/r/subselect_extra_no_semijoin.result @@ -450,7 +450,7 @@ WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where 2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 -2 DEPENDENT SUBQUERY <derived3> ref key1 key1 10 const,const 0 Using where +2 DEPENDENT SUBQUERY <derived3> ref key1 key1 8 const,const 0 Using where 3 DERIVED t1 ALL NULL NULL NULL NULL 3 SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result index 4103a3424e9..7b421c624bf 100644 --- a/mysql-test/r/subselect_mat.result +++ b/mysql-test/r/subselect_mat.result @@ -2146,6 +2146,57 @@ drop database mysqltest2; drop database mysqltest3; drop database mysqltest4; # End of 5.5 tests +# +# MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int, b int, c int); +insert into t1 +select A.a+B.a*10+C.a*100, A.a+B.a*10+C.a*100, A.a+B.a*10+C.a*100 +from t0 A, t0 B, t0 C; +create table t2 (a int, b int, c int); +insert into t2 select A.a, A.a, A.a from t1 A; +insert into t2 select * from t2; +insert into t2 select * from t2; +create table t3 as select * from t2 limit 1; +# The testcase only makes sense if the following uses Materialization: +explain +select * from t1 where (a,b) in (select max(a),b from t2 group by b); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 Using where +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 4000 Using temporary +flush status; +replace into t3 +select * from t1 where (a,b) in (select max(a),b from t2 group by b); +# Sequential reads: +# 1K is read from t1 +# 4K is read from t2 +# 1K groups is read from the tmp. table +# +# Lookups: +# 4K lookups in group by table +# 1K lookups in temp.table +# +# Writes: +# 2x 1K writes to temporary tables (grouping table and subquery materialization table +# +# The point is that neither counter should be in the millions (this +# will happen if Materialization is not used +show status where Variable_name like 'Handler_read%' or Variable_name like 'Handler_%write%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 5000 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 6003 +Handler_tmp_write 2000 +Handler_write 1000 +drop table t0,t1,t2,t3; set @subselect_mat_test_optimizer_switch_value=null; set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off'; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 2bb00835a75..46c799c4f6e 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2988,4 +2988,13 @@ pk1 i1 i2 c2 pk3 i3 c3 SET join_cache_level=@tmp_mdev5059; set optimizer_switch=@tmp_os_mdev5059; DROP TABLE t1,t2,t3,t4; +# +# MDEV-7911: crash in Item_cond::eval_not_null_tables +# +create table t1(a int); +insert into t1 values(1),(2),(3),(null); +explain +select 1 from t1 where _cp932 "1" in (select '1' from t1); +ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' +drop table t1; set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index 43ba6ead575..9a5da710a4c 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -1178,5 +1178,89 @@ id nombre 2 row 2 3 row 3 DROP TABLE t1, t2; +# +# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +# +CREATE TABLE t1 ( +t1id BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t2 ( +t2id BIGINT(20) NOT NULL, +t1idref BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t2id), +INDEX FK_T2_T1Id (t1idref), +CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t3 ( +t3idref BIGINT(20) NOT NULL, +t2idref BIGINT(20) NOT NULL, +sequencenumber INT(10) NOT NULL, +PRIMARY KEY (t3idref, t2idref), +INDEX FK_T3_T2Id (t2idref), +CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +t1idref t2id +200001 200011 +200001 200012 +200001 200013 +explain SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary +1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/mysql-test/r/subselect_sj2_jcl6.result b/mysql-test/r/subselect_sj2_jcl6.result index c45ab02a646..c10b550d11a 100644 --- a/mysql-test/r/subselect_sj2_jcl6.result +++ b/mysql-test/r/subselect_sj2_jcl6.result @@ -891,7 +891,7 @@ WHERE t3.b IN (SELECT b FROM t4); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 1 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t3.a 1 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t3.a 1 Using where; Using join buffer (flat, BNLH join) 1 PRIMARY <derived3> ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join) 2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 3 DERIVED t1 ALL NULL NULL NULL NULL 1 @@ -1161,7 +1161,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary; Using join buffer (flat, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join) -1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 55:59 test.t3.t3_c 2 Using where; End temporary; Using join buffer (incremental, BNLH join) +1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 54:59 test.t3.t3_c 2 Using where; End temporary; Using join buffer (incremental, BNLH join) DROP TABLE t1,t2,t3,t4; # # MDEV-6263: Wrong result when using IN subquery with order by @@ -1193,6 +1193,90 @@ id nombre 2 row 2 3 row 3 DROP TABLE t1, t2; +# +# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +# +CREATE TABLE t1 ( +t1id BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t2 ( +t2id BIGINT(20) NOT NULL, +t1idref BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t2id), +INDEX FK_T2_T1Id (t1idref), +CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t3 ( +t3idref BIGINT(20) NOT NULL, +t2idref BIGINT(20) NOT NULL, +sequencenumber INT(10) NOT NULL, +PRIMARY KEY (t3idref, t2idref), +INDEX FK_T3_T2Id (t2idref), +CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +t1idref t2id +200001 200011 +200001 200012 +200001 200013 +explain SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary +1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 Using join buffer (flat, BKA join); Key-ordered scan +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; # diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index 0ff366b0d7a..4e75aee24a2 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -1180,6 +1180,90 @@ id nombre 2 row 2 3 row 3 DROP TABLE t1, t2; +# +# MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +# +CREATE TABLE t1 ( +t1id BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t2 ( +t2id BIGINT(20) NOT NULL, +t1idref BIGINT(20) NOT NULL, +code VARCHAR(20), +PRIMARY KEY (t2id), +INDEX FK_T2_T1Id (t1idref), +CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +CREATE TABLE t3 ( +t3idref BIGINT(20) NOT NULL, +t2idref BIGINT(20) NOT NULL, +sequencenumber INT(10) NOT NULL, +PRIMARY KEY (t3idref, t2idref), +INDEX FK_T3_T2Id (t2idref), +CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +t1idref t2id +200001 200011 +200001 200012 +200001 200013 +explain SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM +t2 T2_0_ +WHERE +T2_0_.t1idref IN ( +SELECT +T1_1_.t1id +FROM +t3 T3_0_ +INNER JOIN +t2 T2_1_ +ON T3_0_.t2idref=T2_1_.t2id +INNER JOIN +t1 T1_1_ +ON T2_1_.t1idref=T1_1_.t1id +WHERE +T3_0_.t3idref= 1 +); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary +1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; set optimizer_switch=default; diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index f388fd41ce8..ba582d7e008 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -3002,6 +3002,15 @@ pk1 i1 i2 c2 pk3 i3 c3 SET join_cache_level=@tmp_mdev5059; set optimizer_switch=@tmp_os_mdev5059; DROP TABLE t1,t2,t3,t4; +# +# MDEV-7911: crash in Item_cond::eval_not_null_tables +# +create table t1(a int); +insert into t1 values(1),(2),(3),(null); +explain +select 1 from t1 where _cp932 "1" in (select '1' from t1); +ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' +drop table t1; set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off diff --git a/mysql-test/r/subselect_sj_mat.result b/mysql-test/r/subselect_sj_mat.result index c6a0344c8a3..55b54ea4eb2 100644 --- a/mysql-test/r/subselect_sj_mat.result +++ b/mysql-test/r/subselect_sj_mat.result @@ -2186,3 +2186,54 @@ drop database mysqltest2; drop database mysqltest3; drop database mysqltest4; # End of 5.5 tests +# +# MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 (a int, b int, c int); +insert into t1 +select A.a+B.a*10+C.a*100, A.a+B.a*10+C.a*100, A.a+B.a*10+C.a*100 +from t0 A, t0 B, t0 C; +create table t2 (a int, b int, c int); +insert into t2 select A.a, A.a, A.a from t1 A; +insert into t2 select * from t2; +insert into t2 select * from t2; +create table t3 as select * from t2 limit 1; +# The testcase only makes sense if the following uses Materialization: +explain +select * from t1 where (a,b) in (select max(a),b from t2 group by b); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 Using where +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 4000 Using temporary +flush status; +replace into t3 +select * from t1 where (a,b) in (select max(a),b from t2 group by b); +# Sequential reads: +# 1K is read from t1 +# 4K is read from t2 +# 1K groups is read from the tmp. table +# +# Lookups: +# 4K lookups in group by table +# 1K lookups in temp.table +# +# Writes: +# 2x 1K writes to temporary tables (grouping table and subquery materialization table +# +# The point is that neither counter should be in the millions (this +# will happen if Materialization is not used +show status where Variable_name like 'Handler_read%' or Variable_name like 'Handler_%write%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 5000 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 6003 +Handler_tmp_write 2000 +Handler_write 1000 +drop table t0,t1,t2,t3; diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result index ff488fea427..c633261bcd3 100644 --- a/mysql-test/r/table_elim.result +++ b/mysql-test/r/table_elim.result @@ -677,3 +677,35 @@ USA CAN DROP TABLE t1, t2, t3; SET optimizer_switch=@save_optimizer_switch; +# +# MDEV-7893: table_elimination works wrong with on computed expression and compound unique key +# (just a testcase) +CREATE TABLE t1 ( +PostID int(10) unsigned NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 't1' +INSERT INTO t1 (PostID) VALUES (1), (2); +CREATE TABLE t2 ( +VoteID int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, +EntityID int(10) unsigned NOT NULL, +UserID int(10) unsigned NOT NULL, +UNIQUE KEY EntityID (EntityID,UserID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +Warnings: +Warning 1286 Unknown storage engine 'InnoDB' +Warning 1266 Using storage engine MyISAM for table 't2' +INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30); +SELECT t1.*, T.Voted as Voted +FROM +t1 LEFT JOIN ( +SELECT 1 AS Voted, EntityID +FROM t2 +WHERE t2.UserID = '20' ) AS T +ON T.EntityID = t1.PostID +WHERE t1.PostID='1' +LIMIT 1; +PostID Voted +1 NULL +DROP TABLE t1,t2; diff --git a/mysql-test/r/table_keyinfo-6838.result b/mysql-test/r/table_keyinfo-6838.result new file mode 100644 index 00000000000..55b035069ce --- /dev/null +++ b/mysql-test/r/table_keyinfo-6838.result @@ -0,0 +1,12 @@ +CREATE TABLE t1 (i INT, state VARCHAR(997)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (2,'Louisiana'),(9,'Maine'); +CREATE TABLE t2 (state VARCHAR(997), j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('Louisiana',9),('Alaska',5); +INSERT INTO t2 SELECT t2.* FROM t2 JOIN t2 AS t3 JOIN t2 AS t4 JOIN t2 AS t5 JOIN t2 AS t6; +SET @@max_heap_table_size= 16384; +set @@optimizer_switch='derived_merge=OFF'; +set @@optimizer_switch='extended_keys=ON'; +SELECT * FROM t1 AS t1_1 LEFT JOIN ( t1 AS t1_2 INNER JOIN (SELECT * FROM t2) v2 ON t1_2.i = j ) ON t1_1.state = v2.state LIMIT 1; +i state i state state j +2 Louisiana 9 Maine Louisiana 9 +DROP TABLE t1, t2; diff --git a/mysql-test/r/tmp_table_count-7586.result b/mysql-test/r/tmp_table_count-7586.result new file mode 100644 index 00000000000..0c526e0d4a3 --- /dev/null +++ b/mysql-test/r/tmp_table_count-7586.result @@ -0,0 +1,83 @@ +create table t2 (a int); +insert into t2 values (1),(2),(3); +create view v2 as select a from t2; +flush status; +select * from v2; +a +1 +2 +3 +show status like '%Created_tmp%'; +Variable_name Value +Created_tmp_disk_tables 0 +Created_tmp_files 0 +Created_tmp_tables 0 +explain select * from v2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +select * from (select * from t2) T1; +a +1 +2 +3 +show status like '%Created_tmp%'; +Variable_name Value +Created_tmp_disk_tables 0 +Created_tmp_files 0 +Created_tmp_tables 0 +explain select * from (select * from t2) T1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 3 +drop view v2; +drop table t2; +CREATE TABLE t1(a int); +INSERT INTO t1 values(1),(2); +CREATE TABLE t2(a int); +INSERT INTO t2 values(1),(2); +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using temporary +truncate table performance_schema.events_statements_history_long; +flush status; +CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1); +# Performance schema should be the same as "Created_tmp_tables" variable below +select sum(created_tmp_tables) from performance_schema.events_statements_history_long; +sum(created_tmp_tables) +2 +show status like '%Created_tmp%'; +Variable_name Value +Created_tmp_disk_tables 0 +Created_tmp_files 0 +Created_tmp_tables 2 +drop table t3; +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +truncate table performance_schema.events_statements_history_long; +flush status; +CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a); +# Performance schema should be the same as "Created_tmp_tables" variable below +select sum(created_tmp_tables) from performance_schema.events_statements_history_long; +sum(created_tmp_tables) +1 +show status like '%Created_tmp%'; +Variable_name Value +Created_tmp_disk_tables 0 +Created_tmp_files 0 +Created_tmp_tables 1 +drop table t1,t2,t3; +truncate table performance_schema.events_statements_history_long; +flush status; +# Performance schema should be the same as "Created_tmp_tables" variable below +select sum(created_tmp_tables) from performance_schema.events_statements_history_long; +sum(created_tmp_tables) +0 +show status like '%Created_tmp%'; +Variable_name Value +Created_tmp_disk_tables 0 +Created_tmp_files 0 +Created_tmp_tables 0 diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result index 722ac79854d..cab7336cbe5 100644 --- a/mysql-test/r/trigger-trans.result +++ b/mysql-test/r/trigger-trans.result @@ -195,3 +195,28 @@ b val 14 g drop trigger t1_after_insert; drop table t1,t2; +# +#Bug#19683834 SOME INNODB ERRORS CAUSES STORED FUNCTION +# AND TRIGGER HANDLERS TO BE IGNORED +#Code fixed in Bug#16041903 +CREATE TABLE t1 (id int unsigned PRIMARY KEY, val int DEFAULT 0) +ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (1), (2); +CREATE TABLE t2 (id int PRIMARY KEY); +CREATE TABLE t3 LIKE t2; +CREATE TRIGGER bef_insert BEFORE INSERT ON t2 FOR EACH ROW +BEGIN +DECLARE CONTINUE HANDLER FOR 1062 BEGIN END; +INSERT INTO t3 (id) VALUES (NEW.id); +INSERT INTO t3 (id) VALUES (NEW.id); +END// +START TRANSACTION; +UPDATE t1 SET val = val + 1; +connect con2,localhost,root,,test,,; +SET SESSION innodb_lock_wait_timeout = 2; +UPDATE t1 SET val = val + 1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +INSERT INTO t2 (id) VALUES (1); +disconnect con2; +connection default; +DROP TABLE t3, t2, t1; diff --git a/mysql-test/r/truncate-stale-6500.result b/mysql-test/r/truncate-stale-6500.result new file mode 100644 index 00000000000..b6222716953 --- /dev/null +++ b/mysql-test/r/truncate-stale-6500.result @@ -0,0 +1,33 @@ +SET GLOBAL query_cache_size=1024*1024*8; +CREATE TABLE `test` ( +`uniqueId` INT NOT NULL, +`partitionId` INT NOT NULL, +PRIMARY KEY (`uniqueId`,`partitionId`) +) ENGINE=InnoDB PARTITION BY LIST (partitionId) ( +PARTITION p01 VALUES IN (1), +PARTITION p02 VALUES IN (2) +); +INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2); +SELECT * FROM `test`; +uniqueId partitionId +407237055 2 +#Confirms 1 row in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +TABLE_NAME PARTITION_NAME TABLE_ROWS +test p01 0 +test p02 1 +ALTER TABLE `test` TRUNCATE PARTITION `p02`; +#Confirms no more rows in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +TABLE_NAME PARTITION_NAME TABLE_ROWS +test p01 0 +test p02 0 +#Before the patch, this returned the previously existing values. +SELECT * FROM `test`; +uniqueId partitionId +SELECT SQL_CACHE * FROM `test`; +uniqueId partitionId +SELECT SQL_NO_CACHE * FROM `test`; +uniqueId partitionId +DROP TABLE test; +SET GLOBAL query_cache_size=DEFAULT; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index f8649f030bb..cde8816dee4 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -994,3 +994,24 @@ GROUP BY t2.col0 WHERE CONCAT(t1.col1, CAST(subq.col0 AS DECIMAL)); 1 DROP TABLE t1, t2; +# +# Start of 5.5 tests +# +# +# MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL +# +SHOW CREATE TABLE t1dec102; +Table Create Table +t1dec102 CREATE TABLE `t1dec102` ( + `a` decimal(10,2)/*old*/ DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW COLUMNS FROM t1dec102; +Field Type Null Key Default Extra +a decimal(10,2)/*old*/ YES NULL +SELECT COLUMN_NAME, DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1dec102'; +COLUMN_NAME DATA_TYPE COLUMN_TYPE +a decimal decimal(10,2)/*old*/ +DROP TABLE t1dec102; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 5992b1347f3..53fc3104666 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -255,7 +255,7 @@ ushort smallint(5) unsigned zerofill NULL NO 00000 # umedium mediumint(8) unsigned NULL NO 0 # ulong int(11) unsigned NULL NO 0 # ulonglong bigint(13) unsigned NULL NO 0 # -time_stamp timestamp NULL NO 0000-00-00 00:00:00 # +time_stamp timestamp NULL NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP # date_field char(10) latin1_swedish_ci YES NULL # time_field time NULL YES NULL # date_time datetime NULL YES NULL # diff --git a/mysql-test/r/type_time_hires.result b/mysql-test/r/type_time_hires.result index 8096785dcc1..2620dac0794 100644 --- a/mysql-test/r/type_time_hires.result +++ b/mysql-test/r/type_time_hires.result @@ -115,7 +115,6 @@ NULL delete from t1 where a < 20110101; select * from t1; a -01:02:13.3332 NULL create table t2 select * from t1; create table t3 like t1; @@ -135,12 +134,11 @@ Warnings: Note 1265 Data truncated for column 'a' at row 1 select a, a+0, a-1, a*1, a/2 from t1; a a+0 a-1 a*1 a/2 -01:02:13.3332 10213.3332 10212.3332 10213.3332 5106.66660000 NULL NULL NULL NULL NULL 14:15:16.2222 141516.2222 141515.2222 141516.2222 70758.11110000 select max(a), min(a), sum(a), avg(a) from t1; max(a) min(a) sum(a) avg(a) -14:15:16.2222 01:02:13.3332 151729.5554 75864.77770000 +14:15:16.2222 14:15:16.2222 141516.2222 141516.22220000 create table t2 select a, a+0, a-1, a*1, a/2 from t1; create table t3 select max(a), min(a), sum(a), avg(a) from t1; show create table t2; diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 38838e72e96..1ec2dfc565f 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -690,4 +690,45 @@ drop table t1; drop function f1; set timestamp=0; SET time_zone=DEFAULT; +# +# MDEV-7778 impossible create copy of table, if table contain default value for timestamp field +# +SET sql_mode="NO_ZERO_DATE"; +CREATE TABLE t1 ( +ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP +); +CREATE TABLE t2 AS SELECT * from t1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1,t2; +SET sql_mode=DEFAULT; +# +# MDEV-8082 ON UPDATE is not preserved by CREATE TABLE .. SELECT +# +CREATE TABLE t1 ( +vc VARCHAR(10) NOT NULL DEFAULT 'test', +ts timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP +); +CREATE TABLE t2 AS SELECT * FROM t1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `vc` varchar(10) NOT NULL DEFAULT 'test', + `ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `vc` varchar(10) NOT NULL DEFAULT 'test', + `ts` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1,t2; End of 10.0 tests diff --git a/mysql-test/r/type_timestamp_hires.result b/mysql-test/r/type_timestamp_hires.result index dc1cbb377f9..6ebf83a09f0 100644 --- a/mysql-test/r/type_timestamp_hires.result +++ b/mysql-test/r/type_timestamp_hires.result @@ -109,7 +109,7 @@ create table t3 like t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000' + `a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 show create table t3; Table Create Table @@ -130,7 +130,7 @@ create table t3 select max(a), min(a), sum(a), avg(a) from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` timestamp(4) NOT NULL DEFAULT '0000-00-00 00:00:00.0000', + `a` timestamp(4) NOT NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4), `a+0` decimal(25,4) NOT NULL DEFAULT '0.0000', `a-1` decimal(25,4) NOT NULL DEFAULT '0.0000', `a*1` decimal(25,4) NOT NULL DEFAULT '0.0000', diff --git a/mysql-test/r/uniques_crash-7912.result b/mysql-test/r/uniques_crash-7912.result new file mode 100644 index 00000000000..bf3aab684ae --- /dev/null +++ b/mysql-test/r/uniques_crash-7912.result @@ -0,0 +1,11 @@ +call mtr.add_suppression("Out of memory"); +set sql_mode=""; +drop table if exists t1,t2; +create table `t1` (`a` datetime not null) engine=InnoDB; +create table `t2` (`a` int not null) engine=innodb; +replace into t1 values (),(); +insert into t2 values(0); +set session sort_buffer_size = 1024*1024*1024*1024; +delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a; +drop table t2; +drop table t1; diff --git a/mysql-test/r/update_innodb.result b/mysql-test/r/update_innodb.result new file mode 100644 index 00000000000..88c86c50625 --- /dev/null +++ b/mysql-test/r/update_innodb.result @@ -0,0 +1,31 @@ +CREATE TABLE `t1` ( +`c1` int(11) NOT NULL, +`c2` datetime DEFAULT NULL, +PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t2` ( +`c0` varchar(10) NOT NULL, +`c1` int(11) NOT NULL, +`c2` int(11) NOT NULL, +PRIMARY KEY (`c0`,`c1`), +KEY `c1` (`c1`), +KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t3` ( +`id` int(11) unsigned NOT NULL AUTO_INCREMENT, +`c1` datetime NOT NULL, +`c2` bigint(20) NOT NULL, +`c3` int(4) unsigned NOT NULL, +PRIMARY KEY (`id`), +KEY `c2` (`c2`), +KEY `c3` (`c3`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `t4` ( +`c1` int(11) NOT NULL, +`c2` bigint(20) DEFAULT NULL, +`c3` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c2`,`t4`.`c3` AS `c3` from `t4`; +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; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 23d1d76ca26..d534cf4023a 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4908,7 +4908,7 @@ Opened_views 3 show status like 'Opened_table%'; Variable_name Value Opened_table_definitions 2 -Opened_tables 3 +Opened_tables 2 # # MDEV-486 LP BUG#1010116 Incorrect query results in # view and derived tables @@ -5396,6 +5396,37 @@ DROP VIEW v1; DROP TABLE t1, t2; create view v1 as select 1; drop view v1; +# +# MDEV-7260: Crash in get_best_combination when executing multi-table +# UPDATE with nested views +# +CREATE TABLE `t1` (`id` bigint(20)); +INSERT INTO `t1` VALUES (1),(2); +CREATE TABLE `t2` (`id` bigint(20)); +CREATE TABLE `t3` (`id` bigint(20), `flag` tinyint(4)); +create view v1 as select id from t1; +create view v2 as select t2.* from (t2 left join v1 using (id)); +update t3 left join v2 using (id) set flag=flag+1; +drop view v2, v1; +drop table t1, t2, t3; +# +# MDEV-7207 - ALTER VIEW does not change ALGORITM +# +create table t1 (a int, b int); +create algorithm=temptable view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +alter algorithm=undefined view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +alter algorithm=merge view v2 (c) as select b+1 from t1; +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select (`t1`.`b` + 1) AS `c` from `t1` latin1 latin1_swedish_ci +drop view v2; +drop table t1; # ----------------------------------------------------------------- # -- End of 5.5 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/r/view_alias.result b/mysql-test/r/view_alias.result index 72c4bf29f25..e07b40dba13 100644 --- a/mysql-test/r/view_alias.result +++ b/mysql-test/r/view_alias.result @@ -109,3 +109,11 @@ DROP VIEW v1; CREATE VIEW v1 AS select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select ' a ' AS `alias` from `test`.`t1` group by ' a '); DROP VIEW v1; DROP TABLE t1, t2; +create view v1 as select interval(55,10) as my_col; +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select interval(55,10) AS `my_col` latin1 latin1_swedish_ci +select * from v1; +my_col +1 +drop view v1; diff --git a/mysql-test/std_data/cacert.pem b/mysql-test/std_data/cacert.pem index f5ba4fec58d..e934823eea3 100644 --- a/mysql-test/std_data/cacert.pem +++ b/mysql-test/std_data/cacert.pem @@ -1,22 +1,78 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 11580370790696127632 (0xa0b5bde0f2c08c90) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB + Validity + Not Before: Apr 25 14:55:05 2015 GMT + Not After : Apr 20 14:55:05 2035 GMT + Subject: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:c0:1f:90:7c:2b:c2:ea:01:93:ce:e0:c5:72:e8: + 1c:06:bd:63:4e:b6:d2:c6:00:32:13:27:42:9e:c9: + 3c:91:33:4d:15:90:67:7d:9d:d8:be:9b:12:e2:f6: + 1b:46:81:4a:8b:10:c5:b8:14:53:ab:6a:2c:c3:7f: + 66:87:6c:0e:18:51:4e:9c:93:7a:6d:a1:d4:06:47: + 58:61:a6:04:21:2c:bd:74:7a:e4:68:45:fe:91:fe: + fb:a6:29:47:ec:c5:c3:88:c8:c9:e7:d7:c6:1a:0d: + b8:f5:c5:02:57:25:01:cc:d5:8c:37:46:58:c6:71: + 30:ee:63:38:99:84:5e:9e:3c:af:40:d4:f0:f2:12: + 44:6e:2f:4d:cd:f9:da:4d:0e:1f:a6:fe:35:c3:9d: + 40:08:82:5e:6f:7d:4d:09:16:7d:a1:78:d6:9f:9f: + 44:d6:b1:ad:e7:50:25:1a:f3:4e:16:92:4a:17:5e: + 0b:e1:c8:9f:62:22:c4:e2:01:96:63:ed:37:a2:e5: + 70:b9:dc:c8:8e:c4:fe:00:21:f5:b9:48:c0:43:55: + 4a:d8:0c:9d:ce:d6:60:30:bb:81:31:c8:e9:0e:aa: + 1c:18:3d:e4:10:47:42:17:c0:4d:fb:f5:d9:c2:e4: + 07:33:f7:15:94:63:6d:11:ad:4f:d4:1d:11:41:c1: + e2:dd + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 + X509v3 Authority Key Identifier: + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 + + X509v3 Basic Constraints: + CA:TRUE + Signature Algorithm: sha1WithRSAEncryption + 40:6f:6a:54:f3:29:30:48:46:bd:da:46:71:64:52:14:a7:c2: + 34:b7:5e:1e:42:3d:e7:47:92:cd:87:e7:9d:5d:1a:82:77:82: + 62:32:d4:9d:b6:44:11:dc:88:78:38:a5:d3:1f:1e:be:c2:d6: + 14:b0:58:35:cd:66:22:43:97:ba:bb:e3:44:4f:9d:75:14:9f: + 6f:37:d3:50:07:09:36:bc:58:92:e8:fe:c0:a8:ba:29:55:65: + e2:6f:8f:ab:a5:1d:4f:56:37:de:c7:b4:39:20:4c:a8:4c:db: + 56:51:12:7e:e7:7f:83:9d:c4:c7:72:8f:6f:83:f0:af:e3:37: + 1c:40:fe:5e:38:26:2f:05:46:a7:0c:a5:81:79:d6:9c:9c:d7: + 56:eb:96:fe:c7:ae:8e:4f:5e:4a:6c:3a:fa:68:be:65:60:a2: + d3:3f:07:76:45:b3:95:3e:11:ef:3a:0e:6f:73:47:4c:90:dd: + 0b:36:b4:22:df:62:8d:58:d2:a6:34:5b:f0:06:5d:cd:bf:52: + fa:ee:9b:4f:e8:79:18:6e:1c:6e:5f:96:10:6d:2f:02:1b:dd: + bf:14:c9:32:3c:83:a5:6e:56:56:78:9d:ce:84:50:a4:df:cc: + b5:a9:b1:ec:09:07:74:02:27:7a:9d:d2:96:a9:80:95:9a:f2: + 8c:e9:ef:99 -----BEGIN CERTIFICATE----- -MIIDsjCCApqgAwIBAgIJAL5YrUwfPSWVMA0GCSqGSIb3DQEBBQUAMEQxCzAJBgNV -BAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxhMREwDwYD -VQQKEwhNeVNRTCBBQjAeFw0xMDAxMjkwNTU5NTNaFw0xNTAxMjgwNTU5NTNaMEQx -CzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBzYWxh -MREwDwYDVQQKEwhNeVNRTCBBQjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL6kNN4peX7uhK9rb06W/QbPEpVuejmdWdl2PqMshP/eSuXXw7kwVgfpxx9R -vC000CKQQSG9MCoZjtqPnFRsetmWLZgApRpEalGXTXJqq9sEbCfoFizg94U8G7d2 -u5XJjLVmcG34ru36KoBgVx1zeH1puBAf8dOzrE4L7Y+ZQBFzFohjh8C2LqWC4nM5 -qsLmOkDWMipGqYU5DvkKjIbTbwTyRNRgZHWSPfVDDPUIUOsY4BGUp2DpgeGY9aEv -lIs57Ev9JqlIUCV65lOhhDkG+xwmkHKHA+ECEU9cALI8+uXbh48MB9XpMOuk408X -/lX89aZwD0/G9kmObVGnE2G+H5UCAwEAAaOBpjCBozAdBgNVHQ4EFgQUsft+d7VA -jWgRftkR5cPG2k2sUbAwdAYDVR0jBG0wa4AUsft+d7VAjWgRftkR5cPG2k2sUbCh -SKRGMEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdV -cHBzYWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAL5YrUwfPSWVMAwGA1UdEwQFMAMB -Af8wDQYJKoZIhvcNAQEFBQADggEBALRUOAmdL8R8sl1y8kiEiFgDatdXK5RDqWai -8yZChfmwTIToHhmQsOEshJe2e8hky3huUj+33VyXjINoMbebIwMuXPwEkbJal8RZ -nSJmF0jN1Qz7J/jFffwK9xmejWZJx49Kt2+Qwrwp6kDeq9TLFqQOoVczgyJPYsTL -NAOib5WqTud3XWvCwxrhqmWu7JZq6sp1fomP/uunprb8y2miWfLESZN2mKAhm44Q -Lws867LT8v2lskEjq2dT1LutD5+R66XcdjgSr0uDziDs64jZwCD6ea94hVFM7ej0 -ZOXYeSEZJ56FjUxu632e9fY8NyMh30yKjjmQf1mM9PuGJvdvsWU= +MIIDfzCCAmegAwIBAgIJAKC1veDywIyQMA0GCSqGSIb3DQEBBQUAMFYxDzANBgNV +BAMMBmNhY2VydDELMAkGA1UEBhMCRkkxETAPBgNVBAgMCEhlbHNpbmtpMREwDwYD +VQQHDAhIZWxzaW5raTEQMA4GA1UECgwHTWFyaWFEQjAeFw0xNTA0MjUxNDU1MDVa +Fw0zNTA0MjAxNDU1MDVaMFYxDzANBgNVBAMMBmNhY2VydDELMAkGA1UEBhMCRkkx +ETAPBgNVBAgMCEhlbHNpbmtpMREwDwYDVQQHDAhIZWxzaW5raTEQMA4GA1UECgwH +TWFyaWFEQjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMAfkHwrwuoB +k87gxXLoHAa9Y0620sYAMhMnQp7JPJEzTRWQZ32d2L6bEuL2G0aBSosQxbgUU6tq +LMN/ZodsDhhRTpyTem2h1AZHWGGmBCEsvXR65GhF/pH++6YpR+zFw4jIyefXxhoN +uPXFAlclAczVjDdGWMZxMO5jOJmEXp48r0DU8PISRG4vTc352k0OH6b+NcOdQAiC +Xm99TQkWfaF41p+fRNaxredQJRrzThaSShdeC+HIn2IixOIBlmPtN6LlcLncyI7E +/gAh9blIwENVStgMnc7WYDC7gTHI6Q6qHBg95BBHQhfATfv12cLkBzP3FZRjbRGt +T9QdEUHB4t0CAwEAAaNQME4wHQYDVR0OBBYEFMcsAZUa9T7NBKYkNTUE2acWASp5 +MB8GA1UdIwQYMBaAFMcsAZUa9T7NBKYkNTUE2acWASp5MAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAEBvalTzKTBIRr3aRnFkUhSnwjS3Xh5CPedHks2H +551dGoJ3gmIy1J22RBHciHg4pdMfHr7C1hSwWDXNZiJDl7q740RPnXUUn28301AH +CTa8WJLo/sCouilVZeJvj6ulHU9WN97HtDkgTKhM21ZREn7nf4OdxMdyj2+D8K/j +NxxA/l44Ji8FRqcMpYF51pyc11brlv7Hro5PXkpsOvpovmVgotM/B3ZFs5U+Ee86 +Dm9zR0yQ3Qs2tCLfYo1Y0qY0W/AGXc2/Uvrum0/oeRhuHG5flhBtLwIb3b8UyTI8 +g6VuVlZ4nc6EUKTfzLWpsewJB3QCJ3qd0papgJWa8ozp75k= -----END CERTIFICATE----- diff --git a/mysql-test/std_data/client-cert.pem b/mysql-test/std_data/client-cert.pem index b83ae7c655d..cbe8bc2c677 100644 --- a/mysql-test/std_data/client-cert.pem +++ b/mysql-test/std_data/client-cert.pem @@ -1,69 +1,69 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 6 (0x6) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB + Serial Number: 3 (0x3) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Validity - Not Before: Feb 20 03:03:26 2010 GMT - Not After : Sep 3 03:03:26 2030 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB + Not Before: Apr 25 14:55:16 2015 GMT + Not After : Apr 20 14:55:16 2035 GMT + Subject: C=FI, ST=Helsinki, L=Helsinki, O=MariaDB, CN=client Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c2:e7:20:cf:89:59:2f:67:cb:4c:9f:e8:11:f2: - 23:e5:f1:b1:ee:3f:66:5f:c3:f5:fd:1e:31:ee:8f: - 4c:2a:bd:c0:4a:a5:9f:c8:44:d5:77:8f:15:1b:4d: - 78:6e:b2:a2:48:a5:24:33:05:40:02:b3:c1:87:8d: - 59:3c:1a:07:aa:86:f0:04:e1:9c:20:4b:22:32:c4: - 51:9e:40:e4:31:c3:57:f5:98:bf:2e:b1:fd:2c:56: - bf:49:d9:9b:e7:17:cc:95:5f:b5:08:19:5e:9d:df: - 65:22:39:2c:48:fb:69:96:31:7a:35:4d:de:60:b4: - c1:60:19:5f:96:56:7e:55:19 + Public-Key: (1024 bit) + Modulus: + 00:ce:a0:3d:3c:a4:bb:4f:a1:4f:91:0d:05:ac:5b: + 8a:15:7f:d7:aa:0c:a3:a7:9f:b2:c7:26:9d:65:28: + b1:84:d3:a0:ef:9e:b1:45:0f:33:df:98:6e:71:ff: + 2b:66:9c:9c:c1:25:13:27:42:b6:20:46:e7:e7:47: + a1:88:47:c2:9e:e2:45:25:99:9f:f9:28:1a:9a:13: + 67:5d:3e:b3:b8:fe:40:25:ac:26:49:46:2c:03:43: + 83:67:d8:0f:41:ae:2e:f4:d8:71:60:3c:8e:e7:91: + d0:bb:2c:ca:12:da:71:1a:7b:e3:fa:8c:8f:c3:bb: + 62:55:89:b3:bf:85:45:01:61 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate X509v3 Subject Key Identifier: - 8D:10:67:91:33:76:9C:02:E5:78:5D:D8:C5:EF:25:96:B2:D7:FA:1F + 5A:73:74:8E:14:29:C3:FB:B4:19:0F:97:8F:AA:6F:E1:E1:A8:F7:5B X509v3 Authority Key Identifier: - keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0 - DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB - serial:BE:58:AD:4C:1F:3D:25:95 + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 Signature Algorithm: sha1WithRSAEncryption - a9:88:10:3e:5d:2a:47:29:c8:03:27:7a:31:5a:8e:10:03:bc: - b5:4e:37:1d:12:7b:eb:5f:50:71:70:b1:a3:8e:93:0e:77:17: - 6c:47:b6:c9:a4:4d:2a:c4:38:f0:61:55:b2:7f:28:ba:06:79: - ee:67:11:7d:d4:c9:7f:0a:18:c8:c1:cb:d0:2c:f9:63:0f:bb: - 45:ca:de:ea:bb:ac:00:01:52:48:36:2b:07:2b:c8:46:c7:b1: - 21:81:bd:77:39:e7:4c:39:aa:bd:ac:60:d8:a7:bf:cf:14:98: - 4a:0b:a1:40:55:06:8d:6f:35:a9:39:a0:71:a9:97:ba:7c:73: - 3c:41:ba:c5:1c:11:4b:2b:43:1d:2d:ba:7b:5f:14:b5:3d:64: - 62:15:36:b4:16:bd:78:c8:43:8d:f9:1c:a5:d2:ac:a1:58:74: - e1:99:de:ad:04:19:43:a8:bd:0a:fd:19:9b:50:44:46:6d:18: - 55:4d:bf:b4:5b:a4:93:62:c7:64:91:6c:54:34:d1:f8:f3:ff: - 12:6d:5f:85:e7:35:9e:5c:42:81:5e:fb:c8:bb:44:51:98:b2: - ef:1b:9f:5a:22:77:28:7d:da:fb:08:c2:94:9a:0f:42:08:93: - 54:10:1e:ad:f2:4f:fc:62:98:51:e9:9b:b9:3a:93:d9:e4:1f: - 1d:c4:76:d0 + 32:42:4b:36:44:a5:6c:fb:70:d8:08:2b:cb:16:34:15:db:39: + 60:7b:7e:b4:4a:bc:fb:e5:16:04:97:0d:eb:f5:68:95:da:2f: + 23:57:4c:c9:29:2b:d1:1b:1b:9f:bd:f4:79:75:df:62:7f:63: + b4:84:7a:95:5c:c4:ee:f3:77:16:e4:0b:8a:5e:c9:64:bd:7c: + 04:50:ac:ff:9a:41:6b:b1:6a:9f:cd:45:10:72:83:10:8a:26: + 1d:7f:6c:84:34:5a:41:79:72:91:ee:87:5d:1d:3a:55:ff:91: + 7e:52:85:ff:42:41:eb:76:56:23:e5:bc:bc:79:b1:aa:4e:4c: + bf:7b:df:63:8b:1a:3c:4b:01:72:89:35:bb:0d:92:97:16:6e: + ae:50:cb:89:ee:c6:7a:d0:d3:32:22:0f:19:33:1e:ee:ff:41: + a5:a1:25:c5:4c:ce:8f:98:4c:b5:2c:1f:ec:cc:f1:21:e2:3a: + ff:7d:6a:87:fe:89:fd:2c:20:3e:fb:9b:b8:c0:f9:09:99:ce: + 45:63:82:09:1c:bb:79:d8:a8:40:21:46:c7:ae:3e:dd:89:9d: + 56:46:4a:f4:ed:7d:5b:a6:1e:a6:1b:26:f9:ec:26:b4:51:3a: + 87:b6:50:13:84:33:22:1a:8a:20:c5:44:64:b8:bb:de:32:ec: + 6b:58:db:17 -----BEGIN CERTIFICATE----- -MIIDETCCAfmgAwIBAgIBBjANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ -MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT -UUwgQUIwHhcNMTAwMjIwMDMwMzI2WhcNMzAwOTAzMDMwMzI2WjAyMQswCQYDVQQG -EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIwgZ8wDQYJ -KoZIhvcNAQEBBQADgY0AMIGJAoGBAMLnIM+JWS9ny0yf6BHyI+Xxse4/Zl/D9f0e -Me6PTCq9wEqln8hE1XePFRtNeG6yokilJDMFQAKzwYeNWTwaB6qG8AThnCBLIjLE -UZ5A5DHDV/WYvy6x/SxWv0nZm+cXzJVftQgZXp3fZSI5LEj7aZYxejVN3mC0wWAZ -X5ZWflUZAgMBAAGjgaMwgaAwCQYDVR0TBAIwADAdBgNVHQ4EFgQUjRBnkTN2nALl -eF3Yxe8llrLX+h8wdAYDVR0jBG0wa4AUsft+d7VAjWgRftkR5cPG2k2sUbChSKRG -MEQxCzAJBgNVBAYTAlNFMRAwDgYDVQQIEwdVcHBzYWxhMRAwDgYDVQQHEwdVcHBz -YWxhMREwDwYDVQQKEwhNeVNRTCBBQoIJAL5YrUwfPSWVMA0GCSqGSIb3DQEBBQUA -A4IBAQCpiBA+XSpHKcgDJ3oxWo4QA7y1TjcdEnvrX1BxcLGjjpMOdxdsR7bJpE0q -xDjwYVWyfyi6BnnuZxF91Ml/ChjIwcvQLPljD7tFyt7qu6wAAVJINisHK8hGx7Eh -gb13OedMOaq9rGDYp7/PFJhKC6FAVQaNbzWpOaBxqZe6fHM8QbrFHBFLK0MdLbp7 -XxS1PWRiFTa0Fr14yEON+Ryl0qyhWHThmd6tBBlDqL0K/RmbUERGbRhVTb+0W6ST -YsdkkWxUNNH48/8SbV+F5zWeXEKBXvvIu0RRmLLvG59aIncofdr7CMKUmg9CCJNU -EB6t8k/8YphR6Zu5OpPZ5B8dxHbQ +MIIDHjCCAgagAwIBAgIBAzANBgkqhkiG9w0BAQUFADBWMQ8wDQYDVQQDDAZjYWNl +cnQxCzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVs +c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTUwNDI1MTQ1NTE2WhcNMzUwNDIw +MTQ1NTE2WjBWMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV +BAcMCEhlbHNpbmtpMRAwDgYDVQQKDAdNYXJpYURCMQ8wDQYDVQQDDAZjbGllbnQw +gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM6gPTyku0+hT5ENBaxbihV/16oM +o6efsscmnWUosYTToO+esUUPM9+YbnH/K2acnMElEydCtiBG5+dHoYhHwp7iRSWZ +n/koGpoTZ10+s7j+QCWsJklGLANDg2fYD0GuLvTYcWA8jueR0LssyhLacRp74/qM +j8O7YlWJs7+FRQFhAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8W +HU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRac3SOFCnD ++7QZD5ePqm/h4aj3WzAfBgNVHSMEGDAWgBTHLAGVGvU+zQSmJDU1BNmnFgEqeTAN +BgkqhkiG9w0BAQUFAAOCAQEAMkJLNkSlbPtw2AgryxY0Fds5YHt+tEq8++UWBJcN +6/VoldovI1dMySkr0Rsbn730eXXfYn9jtIR6lVzE7vN3FuQLil7JZL18BFCs/5pB +a7Fqn81FEHKDEIomHX9shDRaQXlyke6HXR06Vf+RflKF/0JB63ZWI+W8vHmxqk5M +v3vfY4saPEsBcok1uw2SlxZurlDLie7GetDTMiIPGTMe7v9BpaElxUzOj5hMtSwf +7MzxIeI6/31qh/6J/SwgPvubuMD5CZnORWOCCRy7edioQCFGx64+3YmdVkZK9O19 +W6Yephsm+ewmtFE6h7ZQE4QzIhqKIMVEZLi73jLsa1jbFw== -----END CERTIFICATE----- diff --git a/mysql-test/std_data/client-key.pem b/mysql-test/std_data/client-key.pem index 2fc1754e9c5..5037c6e2728 100644 --- a/mysql-test/std_data/client-key.pem +++ b/mysql-test/std_data/client-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQDC5yDPiVkvZ8tMn+gR8iPl8bHuP2Zfw/X9HjHuj0wqvcBKpZ/I -RNV3jxUbTXhusqJIpSQzBUACs8GHjVk8GgeqhvAE4ZwgSyIyxFGeQOQxw1f1mL8u -sf0sVr9J2ZvnF8yVX7UIGV6d32UiOSxI+2mWMXo1Td5gtMFgGV+WVn5VGQIDAQAB -AoGARXcXLKDpVooJ3W+IyQyiWsw//IhANpWjUOm4JiyQmxMyO+i4ACr4Yjpu7WI5 -MEseqAGj20NdwxjKO0PXsCIe5LmrGZ+SI8+CSERFOWXWRtCWz7y7SG30i1k6suvM -mwqWom0tJLwn93uA1lm/WSwKQwUrJRahRQd3EaZqrl7DP5kCQQD/8gbuYAT5pxQe -ULLGM0RvEsXxDYbEDxNbY5wrBazfklBwpumxZpFl6jEAT++7Kh2Ns3A7kB1oUNlA -FPYr+dYPAkEAwvHEwRtoyUr8jqoqVVJWI76CDmBjEOzVeMKW97ztqbs2LxZW8dYI -iOh/myFGpdoUwgu0U8w9MmXcj3ZeZCYKVwJALyQ+AJPw9qa+fuLwOq9gsHCtwrty -EhSQxSlwrz/pWniRll439vPkXfgntF4E0t1r+hiN2Hqv3/HcQgBaYzkuIwJAG023 -bACFxaOuCeFFepvEms8E8jSHy4gQQhCnCl24v8wLw76SQN7kZSCDNtwLRBFuVNtE -z3PMonFn2eQPRmGZkwJAP1c1BHprMQx/ruafdscROILv3JrH40C1bR6KVVBKt1dK -Qpnpgi7hK5rUQjDF8k3bn9ugTt06jyeHe/QhAml0kg== +MIICXAIBAAKBgQDOoD08pLtPoU+RDQWsW4oVf9eqDKOnn7LHJp1lKLGE06DvnrFF +DzPfmG5x/ytmnJzBJRMnQrYgRufnR6GIR8Ke4kUlmZ/5KBqaE2ddPrO4/kAlrCZJ +RiwDQ4Nn2A9Bri702HFgPI7nkdC7LMoS2nEae+P6jI/Du2JVibO/hUUBYQIDAQAB +AoGAa/FgLFcul3oA9BjmdtVXfMXNp8N0l3QhVFLC9P7eRjK8p5GysA4yHkQmpp0U +UkXMykYRDHiYZqJEMhnEtEowzBmodi7go+gpwAR2eUKwESmJoBhPvqDJAbS/fL5D +H2Wk6FGsdKoPhEpigWefu6ZqlX5GCGa601eMYLMR9i+6bbUCQQDspD4j2q8oihTU +RQt/XpF1l+5ZRHjQOokwRekuHdq0powtNxZ+X3V8Qy8JbDRNCM2YtfKMX4gXAfZp +JWs7HoPvAkEA34doY3AKxZSpXD84m4dnJ0/Ubfk3+tcC1EPYyDJ1DHpfz7fy6aoX +z8TWCQXtSBGaEa9Dgbz+EFXuctLbUR8/rwJACDjIo+xEK69oe9uOQ7WgbiqCMH3N +iMaP36p+KIkHAUHMGwIP+QIODewzpSsqQgbtRcIElFX5X3tE+XBAYoRz5wJAKH3/ +CwRg7ynfBDbvqjz9EsIDWWisG2SXvpwLyThau8fvU1GfT3Tgm2Ks4zWPpl6J6mo1 +cGssGwl2CJbp4+glQQJBAJAwvKufpB+M6OjvKh89GGsCEaV1ENJ41FPcQwJ2pjed +Fcq28ZP59v7bfBH2IkNu3pfEzmvQnmRlTEtXGjNn+i8= -----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/mysql_upgrade/event.MYD b/mysql-test/std_data/mysql_upgrade/event.MYD new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/event.MYD diff --git a/mysql-test/std_data/mysql_upgrade/event.MYI b/mysql-test/std_data/mysql_upgrade/event.MYI Binary files differnew file mode 100644 index 00000000000..d5c16c3892f --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/event.MYI diff --git a/mysql-test/std_data/mysql_upgrade/event.frm b/mysql-test/std_data/mysql_upgrade/event.frm Binary files differnew file mode 100644 index 00000000000..fd4ff199b56 --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/event.frm diff --git a/mysql-test/std_data/mysql_upgrade/v1.frm b/mysql-test/std_data/mysql_upgrade/v1.frm new file mode 100644 index 00000000000..be197fd76a8 --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v1.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517af +updatable=0 +algorithm=1 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:20 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v1badcheck.frm b/mysql-test/std_data/mysql_upgrade/v1badcheck.frm new file mode 100644 index 00000000000..a1e3bfe5cbc --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v1badcheck.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=00000000000000000000000000000000 +updatable=0 +algorithm=1 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:20 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v2.frm b/mysql-test/std_data/mysql_upgrade/v2.frm new file mode 100644 index 00000000000..42cc06d9fba --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v2.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517af +updatable=1 +algorithm=2 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:29 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v3.frm b/mysql-test/std_data/mysql_upgrade/v3.frm new file mode 100644 index 00000000000..cca46ae9170 --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v3.frm @@ -0,0 +1,15 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517af +updatable=0 +algorithm=0 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2014-12-11 15:26:20 +create-version=1 +source=select a from t1 +client_cs_name=utf8 +connection_cl_name=utf8_general_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` diff --git a/mysql-test/std_data/mysql_upgrade/v4.frm b/mysql-test/std_data/mysql_upgrade/v4.frm new file mode 100644 index 00000000000..9d0cc48447d --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/v4.frm @@ -0,0 +1,16 @@ +TYPE=VIEW +query=select `test`.`t1`.`a` AS `a` from `test`.`t1` +md5=5e6eaf216e7b016fcedfd4e1113517a0 +updatable=1 +algorithm=0 +definer_user=root +definer_host=localhost +suid=2 +with_check_option=0 +timestamp=2015-02-08 19:21:14 +create-version=1 +source=select a from t1 +client_cs_name=latin1 +connection_cl_name=latin1_swedish_ci +view_body_utf8=select `test`.`t1`.`a` AS `a` from `test`.`t1` +mariadb-version=50542 diff --git a/mysql-test/std_data/old_decimal/t1dec102.MYD b/mysql-test/std_data/old_decimal/t1dec102.MYD new file mode 100644 index 00000000000..59e43854d4a --- /dev/null +++ b/mysql-test/std_data/old_decimal/t1dec102.MYD @@ -0,0 +1 @@ +ý 123.45ý 123.46ý 123.47
\ No newline at end of file diff --git a/mysql-test/std_data/old_decimal/t1dec102.MYI b/mysql-test/std_data/old_decimal/t1dec102.MYI Binary files differnew file mode 100644 index 00000000000..e0b2d4a003c --- /dev/null +++ b/mysql-test/std_data/old_decimal/t1dec102.MYI diff --git a/mysql-test/std_data/old_decimal/t1dec102.frm b/mysql-test/std_data/old_decimal/t1dec102.frm Binary files differnew file mode 100644 index 00000000000..652cfc3bbac --- /dev/null +++ b/mysql-test/std_data/old_decimal/t1dec102.frm diff --git a/mysql-test/std_data/server-cert.pem b/mysql-test/std_data/server-cert.pem index d77bae800f2..1cc1519ada9 100644 --- a/mysql-test/std_data/server-cert.pem +++ b/mysql-test/std_data/server-cert.pem @@ -1,69 +1,74 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 4 (0x4) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Validity - Not Before: Feb 20 02:55:06 2010 GMT - Not After : Sep 3 02:55:06 2030 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=localhost + Not Before: Apr 25 14:55:05 2015 GMT + Not After : Apr 20 14:55:05 2035 GMT + Subject: C=FI, ST=state or province within country, in other certificates in this file it is the same as L, L=location, usually an address but often ambiguously used, O=organization name, typically a company name, OU=organizational unit name, a division name within an organization, CN=localhost Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:e3:7d:4f:c2:23:77:a9:3a:2c:d2:69:59:a0:2f: - 4e:d1:51:4c:ae:8d:f5:17:cc:ce:58:9c:83:4f:0b: - a3:bb:29:a2:b8:1d:3e:1b:04:f9:a9:3e:e2:61:d0: - e6:7b:b9:7c:12:d8:1f:86:c9:53:b5:04:dd:df:26: - e9:c0:2b:de:4a:96:2e:f3:23:6f:79:6d:a9:d2:4e: - 17:af:2f:de:8b:68:44:ae:de:a3:e2:c4:37:1c:04: - ad:73:4b:85:f9:83:ac:fe:b7:c1:54:47:2e:96:d4: - 31:96:85:94:69:d6:5a:63:24:04:99:89:19:1d:56: - 8a:d1:77:aa:87:fb:38:cd:b7 + Public-Key: (1024 bit) + Modulus: + 00:aa:e6:54:bd:dd:52:1e:16:f7:24:52:37:58:2b: + a7:af:49:e1:cd:75:2a:18:52:e1:48:f0:59:82:c0: + 7a:d9:66:b3:97:04:b3:77:f4:39:fd:d1:c0:1a:c5: + a6:ab:44:84:d2:17:39:53:25:63:9b:c3:24:78:51: + 5c:77:6b:df:b4:82:1d:e4:43:f4:67:0a:5d:89:a2: + fe:b0:ea:64:3a:1d:9d:49:78:c8:7f:79:a5:cd:45: + 4b:0c:ad:ae:4f:e2:d4:5d:ec:e8:73:06:ed:98:92: + 85:49:b2:9c:31:3b:44:38:5f:bb:5a:f1:68:84:a9: + c3:5b:31:39:d4:47:98:38:55 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate X509v3 Subject Key Identifier: - CC:8C:71:40:D0:0F:BF:D1:99:79:3F:1B:E9:10:76:19:67:36:0F:A3 + E5:72:8F:57:72:D6:75:63:28:7F:E2:BF:00:B7:1D:B8:AA:FE:94:59 X509v3 Authority Key Identifier: - keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0 - DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB - serial:BE:58:AD:4C:1F:3D:25:95 + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 Signature Algorithm: sha1WithRSAEncryption - 6f:ad:5e:59:fa:84:3a:be:e2:72:b1:e8:66:2a:4e:f8:73:19: - 11:06:11:92:78:56:3e:d6:e8:68:29:90:8b:59:d2:fe:aa:ae: - 25:59:c7:e9:99:bb:4a:06:43:dd:40:bd:cb:f4:ae:79:95:7d: - 8e:90:ef:58:d2:a8:fc:bf:07:f3:37:b2:9b:bd:da:e6:8c:56: - dd:5e:c6:4a:70:7c:3e:3d:a1:e8:35:06:b8:a7:7b:ac:26:85: - 54:5d:09:a2:7b:77:b4:17:7f:72:31:cb:ff:cc:67:6d:e6:3e: - c6:dc:96:eb:4a:0a:ae:e9:48:ae:8a:e0:d6:73:57:6e:32:4c: - 00:dc:28:da:55:b3:9f:9f:d8:98:cc:d9:f1:b6:b3:14:67:2e: - a1:47:1e:51:11:cf:70:9f:31:8f:ba:59:29:f2:d0:88:0b:e2: - 51:6b:f8:31:ed:6d:ac:00:5e:d3:78:4c:95:97:02:cc:74:2b: - 3b:c6:28:e6:2a:c3:30:99:35:b4:4d:31:46:d4:90:f2:47:ed: - 64:85:1a:75:2a:72:0a:2f:c6:3a:2f:d2:ac:6b:31:cc:e5:a8: - 07:c2:d6:22:f3:c6:0f:bf:67:d9:d6:b2:79:cd:48:b5:c3:e0: - e3:18:7f:b5:74:c9:43:19:fb:c4:93:29:ca:cc:90:2b:1b:6f: - 45:f6:25:f9 + 88:44:46:fa:7d:16:ae:9d:16:5b:95:26:03:3c:71:f4:29:3d: + df:cb:f4:14:20:9f:87:24:b4:29:17:2d:7a:12:48:76:ac:00: + 44:26:ba:93:83:ad:58:7e:b7:77:e4:b0:32:0d:e5:dd:fb:cc: + 0e:9b:88:e0:24:82:e4:41:43:47:5a:4e:d3:b4:5b:47:4b:57: + eb:67:02:63:bb:dd:05:12:f5:95:01:0b:89:81:ca:c2:91:14: + 21:9a:9e:c9:84:91:46:35:0e:26:44:1e:91:88:74:4f:fe:d3: + 19:9e:65:fa:46:e2:46:04:ad:91:79:4c:70:1b:68:b2:49:e9: + 6c:f4:58:44:3b:43:15:85:56:64:1b:84:74:49:95:9f:cd:93: + 9d:8e:69:ab:ca:46:97:b6:74:e9:2a:83:85:62:cd:e5:be:c3: + 52:bd:cf:90:cc:60:27:76:ee:1b:3c:da:69:73:e2:11:68:14: + dc:7d:9f:b8:6f:20:a2:0c:b7:8e:33:40:89:d1:a3:89:e2:60: + 6a:ec:b5:9f:e8:c5:55:10:40:b2:95:5e:54:8a:10:8e:d5:90: + d9:98:86:d8:f9:b6:01:41:8c:d7:0d:0e:86:0e:50:6d:a2:64: + 00:2a:91:5e:35:64:15:e3:86:34:3a:39:eb:0f:4f:56:c7:15: + 4c:74:2e:91 -----BEGIN CERTIFICATE----- -MIIDJTCCAg2gAwIBAgIBBDANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ -MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT -UUwgQUIwHhcNMTAwMjIwMDI1NTA2WhcNMzAwOTAzMDI1NTA2WjBGMQswCQYDVQQG -EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxEjAQBgNV -BAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA431PwiN3 -qTos0mlZoC9O0VFMro31F8zOWJyDTwujuymiuB0+GwT5qT7iYdDme7l8EtgfhslT -tQTd3ybpwCveSpYu8yNveW2p0k4Xry/ei2hErt6j4sQ3HAStc0uF+YOs/rfBVEcu -ltQxloWUadZaYyQEmYkZHVaK0Xeqh/s4zbcCAwEAAaOBozCBoDAJBgNVHRMEAjAA -MB0GA1UdDgQWBBTMjHFA0A+/0Zl5PxvpEHYZZzYPozB0BgNVHSMEbTBrgBSx+353 -tUCNaBF+2RHlw8baTaxRsKFIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1Vw -cHNhbGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAvlit -TB89JZUwDQYJKoZIhvcNAQEFBQADggEBAG+tXln6hDq+4nKx6GYqTvhzGREGEZJ4 -Vj7W6GgpkItZ0v6qriVZx+mZu0oGQ91Avcv0rnmVfY6Q71jSqPy/B/M3spu92uaM -Vt1exkpwfD49oeg1Brine6wmhVRdCaJ7d7QXf3Ixy//MZ23mPsbclutKCq7pSK6K -4NZzV24yTADcKNpVs5+f2JjM2fG2sxRnLqFHHlERz3CfMY+6WSny0IgL4lFr+DHt -bawAXtN4TJWXAsx0KzvGKOYqwzCZNbRNMUbUkPJH7WSFGnUqcgovxjov0qxrMczl -qAfC1iLzxg+/Z9nWsnnNSLXD4OMYf7V0yUMZ+8STKcrMkCsbb0X2Jfk= +MIIEETCCAvmgAwIBAgIBATANBgkqhkiG9w0BAQUFADBWMQ8wDQYDVQQDDAZjYWNl +cnQxCzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVs +c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTUwNDI1MTQ1NTA1WhcNMzUwNDIw +MTQ1NTA1WjCCAUcxCzAJBgNVBAYTAkZJMWEwXwYDVQQIDFhzdGF0ZSBvciBwcm92 +aW5jZSB3aXRoaW4gY291bnRyeSwgaW4gb3RoZXIgY2VydGlmaWNhdGVzIGluIHRo +aXMgZmlsZSBpdCBpcyB0aGUgc2FtZSBhcyBMMUAwPgYDVQQHDDdsb2NhdGlvbiwg +dXN1YWxseSBhbiBhZGRyZXNzIGJ1dCBvZnRlbiBhbWJpZ3VvdXNseSB1c2VkMTQw +MgYDVQQKDCtvcmdhbml6YXRpb24gbmFtZSwgdHlwaWNhbGx5IGEgY29tcGFueSBu +YW1lMUkwRwYDVQQLDEBvcmdhbml6YXRpb25hbCB1bml0IG5hbWUsIGEgZGl2aXNp +b24gbmFtZSB3aXRoaW4gYW4gb3JnYW5pemF0aW9uMRIwEAYDVQQDDAlsb2NhbGhv +c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKrmVL3dUh4W9yRSN1grp69J +4c11KhhS4UjwWYLAetlms5cEs3f0Of3RwBrFpqtEhNIXOVMlY5vDJHhRXHdr37SC +HeRD9GcKXYmi/rDqZDodnUl4yH95pc1FSwytrk/i1F3s6HMG7ZiShUmynDE7RDhf +u1rxaISpw1sxOdRHmDhVAgMBAAGjezB5MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgEN +BB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBTlco9X +ctZ1Yyh/4r8Atx24qv6UWTAfBgNVHSMEGDAWgBTHLAGVGvU+zQSmJDU1BNmnFgEq +eTANBgkqhkiG9w0BAQUFAAOCAQEAiERG+n0Wrp0WW5UmAzxx9Ck938v0FCCfhyS0 +KRctehJIdqwARCa6k4OtWH63d+SwMg3l3fvMDpuI4CSC5EFDR1pO07RbR0tX62cC +Y7vdBRL1lQELiYHKwpEUIZqeyYSRRjUOJkQekYh0T/7TGZ5l+kbiRgStkXlMcBto +sknpbPRYRDtDFYVWZBuEdEmVn82TnY5pq8pGl7Z06SqDhWLN5b7DUr3PkMxgJ3bu +GzzaaXPiEWgU3H2fuG8gogy3jjNAidGjieJgauy1n+jFVRBAspVeVIoQjtWQ2ZiG +2Pm2AUGM1w0Ohg5QbaJkACqRXjVkFeOGNDo56w9PVscVTHQukQ== -----END CERTIFICATE----- diff --git a/mysql-test/std_data/server-key.pem b/mysql-test/std_data/server-key.pem index bf0ae205107..3125ae88a8a 100644 --- a/mysql-test/std_data/server-key.pem +++ b/mysql-test/std_data/server-key.pem @@ -1,15 +1,15 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDjfU/CI3epOizSaVmgL07RUUyujfUXzM5YnINPC6O7KaK4HT4b -BPmpPuJh0OZ7uXwS2B+GyVO1BN3fJunAK95Kli7zI295banSThevL96LaESu3qPi -xDccBK1zS4X5g6z+t8FURy6W1DGWhZRp1lpjJASZiRkdVorRd6qH+zjNtwIDAQAB -AoGAUb0o91y/FjMs/72S0pes/lDz+JRRSGfyjKxQEgrgndNsADOhqRu0iTdrKDJj -XnlbN3ooecnFJfnFrvTQcJhSmlS30j6VrBw6LXpCBK3dvjYgJ9LOne7WK+dF1+vS -FMQtsP04C56Sxy6HJDpMyWJ6oS3Bu169ygG2AxKo+Fk+E6ECQQD38w/MzmrARz2Z -AGeEPDUnVZPYgtmXkmks95S0/2jSoLhmgpvJimzxwpYwVG/BG8dSDVuTDu5kp05D -3bZIp3EzAkEA6uAwJsCZPtHXlWU3wYZJsA697rUNjPaCQOIaZ/lnh5RUHTmUiw1h -Oj/VORqKB0kXqcDfawwLjZEvh1Xli+H5bQJBANTmhw2TvEPnp/OFTl1UGUvyBmXl -TRMB639qAu07VfVtfYi/4ya1zn/0VmOfTOoigQ5qW9Q1AOu6YNCTQl62L9MCQQDc -YfEsW2kvNYxYJHoVfuBjbuGuOnn1e1Oqd70ZND59S6NFLMMBWlORaVWzWACNZ3rp -kAzSj6HDeqgjD2jsQONdAkEAt7S1YHUn8F760bRn4AnAto2TVOYdArtTP/wYjd4o -9rJREO/d8AYkYJ96APLvF0SZ4n3t1pLwQRsKKN8ZGTmzLA== +MIICXAIBAAKBgQCq5lS93VIeFvckUjdYK6evSeHNdSoYUuFI8FmCwHrZZrOXBLN3 +9Dn90cAaxaarRITSFzlTJWObwyR4UVx3a9+0gh3kQ/RnCl2Jov6w6mQ6HZ1JeMh/ +eaXNRUsMra5P4tRd7OhzBu2YkoVJspwxO0Q4X7ta8WiEqcNbMTnUR5g4VQIDAQAB +AoGAblQWXyBzdBN1Z5BgRF6ieYpj6OT70QoogJMR5lRmutUPma4iQo17pr3znBT/ +nU+1w3/UtTXNEXCwqbA01q/gkbP2PaW/sbHLVow1B7u/o42WW6I3Btnl3ClnCNjD +Mo7/Gj027hhp7mC61r81JeJVh8fJUgxdNqoH7AkDnA+FJAECQQDjIl3k6W2P+bHb +bp+8eyY7ITQbppZh+3hFJKRL7DZKFYL5J6gejiBURnG9DKnhoSP2nqzqdrRhWZhB +ZHr+ciEBAkEAwJ5rMpFoIwRzgPD4Q4iSqHcBbFcJE7dK1XLq6MYUVNQGfDU8pBvI +EocXphpsJ8CbR35dGDY19rmO2LjG3RBDVQJAetRN9Inrjw2YCjNzvKjYTuew1zcq +YghszO94zfoKjdu+PWEdwJBZmVmTDoo3oGXVHfxHRHA3MeISvWJKRSmRAQJAHL9H +9msXJKrEZkkQdFvMr5HbR4UR2LxxUbvt7UGqxSJDuYPkggWXbZR15hdpbuFjC1+D +m1pz4Ve+RwAExfdoZQJBANfmuWtlLU+SMpDG4zOyC7u4dz+TtnEOfDUECFNZtqvU +MWz98MIXAjiBDYU1Z0BrA7b0/FVsPR3t6JZFQWWI2y8= -----END RSA PRIVATE KEY----- diff --git a/mysql-test/std_data/server8k-cert.pem b/mysql-test/std_data/server8k-cert.pem index c4c4c3a6374..7e41195cea4 100644 --- a/mysql-test/std_data/server8k-cert.pem +++ b/mysql-test/std_data/server8k-cert.pem @@ -1,69 +1,148 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 5 (0x5) - Signature Algorithm: sha1WithRSAEncryption - Issuer: C=SE, ST=Uppsala, L=Uppsala, O=MySQL AB + Serial Number: 2 (0x2) + Signature Algorithm: sha1WithRSAEncryption + Issuer: CN=cacert, C=FI, ST=Helsinki, L=Helsinki, O=MariaDB Validity - Not Before: Feb 20 03:00:54 2010 GMT - Not After : Sep 3 03:00:54 2030 GMT - Subject: C=SE, ST=Uppsala, O=MySQL AB, CN=server + Not Before: Apr 25 14:55:16 2015 GMT + Not After : Apr 20 14:55:16 2035 GMT + Subject: C=FI, ST=Helsinki, L=Helsinki, O=MariaDB, CN=server8k Subject Public Key Info: Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:c5:da:44:95:06:77:16:21:af:a0:c4:3c:e9:f8: - 1d:2d:95:f9:63:90:8c:3f:86:ba:77:76:4a:52:4b: - 6b:af:29:f5:1c:aa:d4:3f:3e:42:9f:6d:46:ba:86: - 90:b1:2d:cc:db:c6:33:15:a3:f4:af:53:33:4f:a1: - 56:d1:aa:3b:26:10:f7:64:b5:f9:bf:1b:b1:47:8e: - cc:a6:d6:0d:aa:4a:77:e3:a3:63:9d:2a:dc:65:f4: - 7f:91:17:38:2d:d6:cd:4e:8d:53:52:97:6e:87:fc: - 64:60:a6:a1:00:ac:96:6c:e4:42:94:75:17:46:6f: - 91:b5:dd:06:47:ed:05:e3:db + Public-Key: (8192 bit) + Modulus: + 00:e6:24:79:3d:3a:58:6a:12:1c:13:6a:43:d9:c1: + 65:ec:55:c1:4f:7d:fc:f2:a6:56:a5:ab:c5:48:2c: + ce:9c:9d:47:3d:94:93:d5:3b:a3:d0:09:a8:8f:e0: + 4b:36:a0:95:ae:2d:ad:7f:a2:a3:c5:f6:87:80:4c: + 6a:26:15:47:73:20:47:e1:f8:5f:49:b7:13:20:f7: + 32:9f:db:7d:62:41:1b:60:26:7b:41:26:16:0c:92: + 22:ef:b4:2e:b3:db:90:e9:09:ca:fe:1a:1b:e4:f3: + 78:69:7d:ca:6e:c5:39:4b:46:72:09:51:08:40:78: + 8e:04:2a:23:cb:d5:50:cf:96:dd:56:43:10:1b:d2: + 71:28:8f:10:a9:e4:44:1c:39:8a:06:a7:fa:37:48: + bd:5a:dd:37:7f:7a:00:cf:84:8a:48:a3:75:a5:67: + fb:7b:47:2d:26:00:2e:65:ed:63:4e:b7:94:18:3f: + 5a:08:74:54:e5:af:dd:86:1b:34:9b:4c:de:fe:d8: + 69:3d:72:90:c7:5c:83:82:78:ea:ab:06:d4:f1:06: + 20:ad:fd:24:bb:e9:94:e0:c6:32:f5:df:af:b4:14: + 4d:9c:ce:0d:62:3a:3a:2b:11:f9:9e:d7:8e:63:2b: + 57:35:10:7e:d5:44:64:8c:61:9b:4e:f8:e8:a5:fb: + 47:bb:85:33:ea:c6:e0:3d:e2:2c:e8:41:e1:15:e2: + a7:45:23:df:d0:f9:93:01:97:89:95:77:4d:d5:d4: + c1:db:61:ca:e2:84:36:9c:01:9b:33:ec:53:83:2f: + dd:d7:d8:20:c0:6b:4a:73:92:d2:6c:22:a6:a2:68: + 46:8b:aa:3f:aa:fe:47:b7:98:70:fd:ba:59:88:af: + 9f:0d:d7:cb:a0:42:44:f9:f0:54:39:c1:cd:fb:b4: + e4:c6:d6:7e:1d:f5:ed:b9:1a:0f:d7:e6:a2:ab:a2: + 25:1f:6c:f9:ab:9c:d8:a3:b9:da:32:72:51:6d:61: + f1:3b:7d:06:2b:3d:43:d5:52:1f:cb:62:14:53:69: + 4d:91:12:22:f0:55:f9:fc:4f:de:ee:e3:fc:fd:40: + 57:50:eb:0e:7a:45:cc:52:0f:24:6f:45:02:72:6b: + 6d:90:94:1c:d4:fb:34:f6:4b:4d:25:17:6f:df:4a: + 64:f8:ad:1e:6e:df:ad:6c:b3:1d:1a:e6:0e:59:7b: + f8:a7:13:77:78:85:bf:3f:7c:12:d4:8e:34:ff:01: + 90:03:42:85:60:e4:99:d6:19:32:46:41:e8:50:ca: + 2a:03:61:cd:c5:68:f4:92:0f:6e:48:89:41:9e:53: + bc:41:62:ed:4a:92:64:b5:cb:3d:55:6c:d9:87:87: + 9a:ab:fc:22:50:66:92:2b:b9:d7:9e:3b:ed:80:e3: + fa:19:69:38:87:b6:25:3a:db:b5:d0:f2:80:4d:af: + 6d:7d:92:90:de:aa:df:be:80:26:1c:69:ee:7a:e3: + 45:c9:a4:4e:6a:e0:56:5f:1f:61:44:3f:62:34:c9: + 1e:21:5f:f6:7f:68:c0:6e:bf:d2:35:1e:53:99:e4: + e1:bd:64:a4:49:3c:c3:ce:b6:e8:a9:3d:27:54:ea: + f1:3e:a1:fc:7b:bf:8d:71:60:90:c5:66:24:85:de: + 7d:47:1f:62:83:e2:63:8e:10:5c:14:cd:d0:7e:86: + 44:4d:df:05:10:43:b8:3c:87:64:69:ec:ea:fb:49: + 9a:c6:76:c1:8f:ea:49:98:0a:d3:97:af:64:ef:da: + 5f:a9:57:03:e3:a0:15:d8:68:c5:40:d8:7b:0f:26: + 0d:5f:f0:be:5a:4c:fd:af:9e:bf:2d:31:40:71:25: + de:d0:73:19:2d:ae:a6:cb:7c:f0:b8:a4:a9:5c:50: + 80:41:4e:dc:f7:20:a4:a6:66:65:fb:92:d1:43:2d: + bf:30:b2:0d:db:9b:a3:ac:28:08:c4:81:99:0c:0d: + 45:e9:a9:e5:6c:da:bf:10:bb:a7:3e:5a:5f:b7:93: + 4a:20:15:29:69:74:78:d1:eb:53:a8:88:49:cb:de: + 0c:e2:9b:31:e2:2f:56:95:cf:55:92:a3:8e:a9:ef: + 68:cb:00:11:d4:71:06:4b:e5:89:0c:b6:e7:2b:2f: + 98:65:21:8e:2a:a3:86:73:bb:1b:76:e1:94:02:d8: + a1:51:97:15:60:a2:39:d5:fd:dc:a8:be:30:12:44: + b1:49:0b:94:82:cf:5f:93:61:1c:3c:eb:05:5b:a4: + 17:ee:30:cd:7c:db:3f:ee:79:02:da:14:20:98:fd: + 9a:0a:f1:39:c8:59:5b:4e:a3:ad:f8:04:e6:0b:b6: + 81:7e:41:00:af:f7:37:ec:6e:bc:28:a3:3d:76:b6: + fd:e9:88:c7:1e:78:79:27:62:a2:83:34:15:61:b8: + e4:c3:ac:f5:7f:3e:4e:5f:5f:31:5b:e8:91:1b:80: + 5e:cb:74:b2:e5:a3:8a:d5:5a:89:fa:63:f1:ff:67: + bd:59:d0:70:77:b7:75:b5:34:74:3d:2e:99:46:0b: + 4b:c4:64:2f:93:48:fe:47:92:6a:0b:42:5e:ef:c9: + 06:64:84:60:89:2b:84:1f:31:0d:36:15:4e:6b:cd: + 14:f7:a0:d1:b2:b8:ff:53:f5:aa:b9:ed:63:50:7a: + 6f:62:e7:c7:7f:bc:f5:e2:0c:f8:28:a4:0d:ba:75: + d0:b8:c7:9b:e3:94:62:66:1c:d8:6c:02:2e:a5:a2: + 62:50:fe:cf:31 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate X509v3 Subject Key Identifier: - 6E:60:3F:29:13:60:99:ED:0C:F7:15:B5:DB:7B:1C:FB:6F:60:19:ED + B3:A9:00:04:C7:9C:2B:CD:C0:5F:D1:28:5C:5C:C6:1F:26:F7:17:5A X509v3 Authority Key Identifier: - keyid:B1:FB:7E:77:B5:40:8D:68:11:7E:D9:11:E5:C3:C6:DA:4D:AC:51:B0 - DirName:/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB - serial:BE:58:AD:4C:1F:3D:25:95 + keyid:C7:2C:01:95:1A:F5:3E:CD:04:A6:24:35:35:04:D9:A7:16:01:2A:79 Signature Algorithm: sha1WithRSAEncryption - 63:2e:0f:07:14:06:cf:74:90:3d:37:42:f2:48:70:60:21:bc: - 34:52:31:f1:87:70:d2:b2:fb:ff:13:38:dc:f0:5e:43:d7:ee: - a7:c7:1f:ac:aa:d2:8c:4f:fa:3c:4c:73:f6:b6:c2:0c:a0:ea: - a2:c9:e2:73:61:c3:2e:78:40:0f:2a:d3:63:50:9b:b8:f9:89: - 40:ed:98:08:97:c3:07:24:17:34:b5:78:89:0a:bb:83:4c:e2: - 5c:2e:13:d6:21:30:ad:30:48:b5:70:12:ff:4a:6f:42:f0:f8: - 9f:b1:4b:bd:89:2b:f0:9d:e2:49:2b:35:69:18:1f:76:40:b4: - 76:bd:cb:dd:27:2f:c0:c1:e2:33:3e:6e:df:68:54:19:92:8a: - bb:13:9c:cf:d6:17:56:da:bf:0d:64:70:3a:45:b7:aa:5f:e3: - f5:96:ae:34:f2:17:37:27:d0:4b:e8:30:4a:c0:02:42:e2:d2: - 30:eb:eb:c7:d7:ec:d8:df:5c:43:58:e2:6f:b7:58:54:0d:c4: - 01:71:2d:59:8f:44:c7:a1:6c:0b:41:28:fa:b7:63:a7:68:d3: - 4f:c3:0f:17:9e:b2:32:50:e6:0b:87:3d:e2:39:47:c0:d8:0a: - 3b:f6:af:50:68:0f:9d:ef:6e:34:0d:3a:07:94:f8:a4:d7:24: - 86:32:d3:b4 + 01:43:2c:d5:1d:b5:36:05:31:ca:b2:f3:9e:71:ce:62:fe:b2: + e5:e3:2d:30:23:99:51:3d:50:ee:d6:ce:76:e8:43:8d:5d:9d: + 28:9b:43:90:0c:d4:24:54:3c:53:3c:18:92:ec:93:86:87:7a: + d6:7f:5d:3b:56:cd:9d:96:7a:06:c8:16:19:8b:ed:c8:21:cf: + 15:b9:fb:06:7d:cb:5c:46:9c:c5:2e:8e:de:77:21:e5:9d:35: + 95:00:c7:ad:d2:57:36:65:1a:43:6c:ee:75:ad:a2:d8:c0:60: + d5:07:d7:5c:5d:8e:ae:af:4a:e6:fa:6a:13:78:98:b8:11:c7: + dc:d2:a7:dd:29:b5:76:fa:ef:13:62:5f:9a:0d:e2:87:6a:04: + 3c:5f:72:44:d0:d0:7a:70:c6:09:2b:bf:92:91:6d:f4:2e:53: + f3:b4:c5:23:61:d6:87:c1:30:ef:fe:92:6f:97:78:f2:ea:3c: + ff:e8:54:3a:9f:49:ac:a9:2b:46:c3:76:b1:f9:eb:31:a3:4f: + 40:58:16:90:77:b6:3d:6f:85:95:12:a9:ca:70:0a:9a:cd:61: + 46:27:84:ce:9e:33:54:8f:9a:41:6d:4d:11:bd:14:7f:ff:32: + e9:06:bc:36:38:11:5c:0f:e9:a5:5a:0f:5c:7c:fa:f5:73:5b: + 4c:47:f2:f2 -----BEGIN CERTIFICATE----- -MIIDIjCCAgqgAwIBAgIBBTANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJTRTEQ -MA4GA1UECBMHVXBwc2FsYTEQMA4GA1UEBxMHVXBwc2FsYTERMA8GA1UEChMITXlT -UUwgQUIwHhcNMTAwMjIwMDMwMDU0WhcNMzAwOTAzMDMwMDU0WjBDMQswCQYDVQQG -EwJTRTEQMA4GA1UECBMHVXBwc2FsYTERMA8GA1UEChMITXlTUUwgQUIxDzANBgNV -BAMTBnNlcnZlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxdpElQZ3FiGv -oMQ86fgdLZX5Y5CMP4a6d3ZKUktrryn1HKrUPz5Cn21GuoaQsS3M28YzFaP0r1Mz -T6FW0ao7JhD3ZLX5vxuxR47MptYNqkp346NjnSrcZfR/kRc4LdbNTo1TUpduh/xk -YKahAKyWbORClHUXRm+Rtd0GR+0F49sCAwEAAaOBozCBoDAJBgNVHRMEAjAAMB0G -A1UdDgQWBBRuYD8pE2CZ7Qz3FbXbexz7b2AZ7TB0BgNVHSMEbTBrgBSx+353tUCN -aBF+2RHlw8baTaxRsKFIpEYwRDELMAkGA1UEBhMCU0UxEDAOBgNVBAgTB1VwcHNh -bGExEDAOBgNVBAcTB1VwcHNhbGExETAPBgNVBAoTCE15U1FMIEFCggkAvlitTB89 -JZUwDQYJKoZIhvcNAQEFBQADggEBAGMuDwcUBs90kD03QvJIcGAhvDRSMfGHcNKy -+/8TONzwXkPX7qfHH6yq0oxP+jxMc/a2wgyg6qLJ4nNhwy54QA8q02NQm7j5iUDt -mAiXwwckFzS1eIkKu4NM4lwuE9YhMK0wSLVwEv9Kb0Lw+J+xS72JK/Cd4kkrNWkY -H3ZAtHa9y90nL8DB4jM+bt9oVBmSirsTnM/WF1bavw1kcDpFt6pf4/WWrjTyFzcn -0EvoMErAAkLi0jDr68fX7NjfXENY4m+3WFQNxAFxLVmPRMehbAtBKPq3Y6do00/D -DxeesjJQ5guHPeI5R8DYCjv2r1BoD53vbjQNOgeU+KTXJIYy07Q= +MIIGpDCCBYygAwIBAgIBAjANBgkqhkiG9w0BAQUFADBWMQ8wDQYDVQQDDAZjYWNl +cnQxCzAJBgNVBAYTAkZJMREwDwYDVQQIDAhIZWxzaW5raTERMA8GA1UEBwwISGVs +c2lua2kxEDAOBgNVBAoMB01hcmlhREIwHhcNMTUwNDI1MTQ1NTE2WhcNMzUwNDIw +MTQ1NTE2WjBYMQswCQYDVQQGEwJGSTERMA8GA1UECAwISGVsc2lua2kxETAPBgNV +BAcMCEhlbHNpbmtpMRAwDgYDVQQKDAdNYXJpYURCMREwDwYDVQQDDAhzZXJ2ZXI4 +azCCBCIwDQYJKoZIhvcNAQEBBQADggQPADCCBAoCggQBAOYkeT06WGoSHBNqQ9nB +ZexVwU99/PKmVqWrxUgszpydRz2Uk9U7o9AJqI/gSzagla4trX+io8X2h4BMaiYV +R3MgR+H4X0m3EyD3Mp/bfWJBG2Ame0EmFgySIu+0LrPbkOkJyv4aG+TzeGl9ym7F +OUtGcglRCEB4jgQqI8vVUM+W3VZDEBvScSiPEKnkRBw5igan+jdIvVrdN396AM+E +ikijdaVn+3tHLSYALmXtY063lBg/Wgh0VOWv3YYbNJtM3v7YaT1ykMdcg4J46qsG +1PEGIK39JLvplODGMvXfr7QUTZzODWI6OisR+Z7XjmMrVzUQftVEZIxhm0746KX7 +R7uFM+rG4D3iLOhB4RXip0Uj39D5kwGXiZV3TdXUwdthyuKENpwBmzPsU4Mv3dfY +IMBrSnOS0mwipqJoRouqP6r+R7eYcP26WYivnw3Xy6BCRPnwVDnBzfu05MbWfh31 +7bkaD9fmoquiJR9s+auc2KO52jJyUW1h8Tt9Bis9Q9VSH8tiFFNpTZESIvBV+fxP +3u7j/P1AV1DrDnpFzFIPJG9FAnJrbZCUHNT7NPZLTSUXb99KZPitHm7frWyzHRrm +Dll7+KcTd3iFvz98EtSONP8BkANChWDkmdYZMkZB6FDKKgNhzcVo9JIPbkiJQZ5T +vEFi7UqSZLXLPVVs2YeHmqv8IlBmkiu515477YDj+hlpOIe2JTrbtdDygE2vbX2S +kN6q376AJhxp7nrjRcmkTmrgVl8fYUQ/YjTJHiFf9n9owG6/0jUeU5nk4b1kpEk8 +w8626Kk9J1Tq8T6h/Hu/jXFgkMVmJIXefUcfYoPiY44QXBTN0H6GRE3fBRBDuDyH +ZGns6vtJmsZ2wY/qSZgK05evZO/aX6lXA+OgFdhoxUDYew8mDV/wvlpM/a+evy0x +QHEl3tBzGS2upst88LikqVxQgEFO3PcgpKZmZfuS0UMtvzCyDdubo6woCMSBmQwN +Remp5WzavxC7pz5aX7eTSiAVKWl0eNHrU6iIScveDOKbMeIvVpXPVZKjjqnvaMsA +EdRxBkvliQy25ysvmGUhjiqjhnO7G3bhlALYoVGXFWCiOdX93Ki+MBJEsUkLlILP +X5NhHDzrBVukF+4wzXzbP+55AtoUIJj9mgrxOchZW06jrfgE5gu2gX5BAK/3N+xu +vCijPXa2/emIxx54eSdiooM0FWG45MOs9X8+Tl9fMVvokRuAXst0suWjitVaifpj +8f9nvVnQcHe3dbU0dD0umUYLS8RkL5NI/keSagtCXu/JBmSEYIkrhB8xDTYVTmvN +FPeg0bK4/1P1qrntY1B6b2Lnx3+89eIM+CikDbp10LjHm+OUYmYc2GwCLqWiYlD+ +zzECAwEAAaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBH +ZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFLOpAATHnCvNwF/RKFxcxh8m +9xdaMB8GA1UdIwQYMBaAFMcsAZUa9T7NBKYkNTUE2acWASp5MA0GCSqGSIb3DQEB +BQUAA4IBAQABQyzVHbU2BTHKsvOecc5i/rLl4y0wI5lRPVDu1s526EONXZ0om0OQ +DNQkVDxTPBiS7JOGh3rWf107Vs2dlnoGyBYZi+3IIc8VufsGfctcRpzFLo7edyHl +nTWVAMet0lc2ZRpDbO51raLYwGDVB9dcXY6ur0rm+moTeJi4Ecfc0qfdKbV2+u8T +Yl+aDeKHagQ8X3JE0NB6cMYJK7+SkW30LlPztMUjYdaHwTDv/pJvl3jy6jz/6FQ6 +n0msqStGw3ax+esxo09AWBaQd7Y9b4WVEqnKcAqazWFGJ4TOnjNUj5pBbU0RvRR/ +/zLpBrw2OBFcD+mlWg9cfPr1c1tMR/Ly -----END CERTIFICATE----- diff --git a/mysql-test/std_data/server8k-key.pem b/mysql-test/std_data/server8k-key.pem index d3c3ec5baba..72d2756477c 100644 --- a/mysql-test/std_data/server8k-key.pem +++ b/mysql-test/std_data/server8k-key.pem @@ -1,15 +1,99 @@ -----BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDF2kSVBncWIa+gxDzp+B0tlfljkIw/hrp3dkpSS2uvKfUcqtQ/ -PkKfbUa6hpCxLczbxjMVo/SvUzNPoVbRqjsmEPdktfm/G7FHjsym1g2qSnfjo2Od -Ktxl9H+RFzgt1s1OjVNSl26H/GRgpqEArJZs5EKUdRdGb5G13QZH7QXj2wIDAQAB -AoGBAJLCjh7Q9eLnx+QDzH9s+Q/IcH4nSbERmh1lFEopAc6j29qQ6PGkmDy0DUPs -70VOCOh5A4mo3aZzm9sUfVb24/nRtmyTP/AtMuIVGCsUqzI28dJRGvRlY0aSQG/C -ILqMP69kiMNGBvuyEIiJhisOmMvDFEp7HrrXHJM9qcc217DpAkEA4nzJ9yyy2e4O -r6/D711hdfcU/F+ktXw+pL77kSSdTABUap92Uv2RL36UA4q5h8RNvq/GrzMNm6Ye -u2IMvBCiTQJBAN+iRbiMJCSitTg5YVMluVbT87co7jbTqk7LN1ujyIFEklm4xlHG -DLJNgEoDR7QJtAkL++FyogC4zsQsey5voscCQQCp54trTbDuI9QIoAaQrrDKWgz4 -NpfNPeOQm2UFQT5vIWAyjGWrZGViB8bp0UvVOcJI5nxaOiZfOYOcdrWu75uRAkAn -67zMc9/j1lPJRJz2Dc7nDBD+ikTz7pcBV897AWLCiK4jbBOi91q+3YzgKXO8VNsZ -nlUJasA2psbqSBJ5OJ5zAkEA2UxoMju54hASjT54Z92IzraVw4Vo8CYwOcw5fr7z -+m5xg1mmWdLBclmZ+WjARzDuTHIW6u/WCxNGg42AykWzfw== +MIISKgIBAAKCBAEA5iR5PTpYahIcE2pD2cFl7FXBT3388qZWpavFSCzOnJ1HPZST +1Tuj0Amoj+BLNqCVri2tf6KjxfaHgExqJhVHcyBH4fhfSbcTIPcyn9t9YkEbYCZ7 +QSYWDJIi77Qus9uQ6QnK/hob5PN4aX3KbsU5S0ZyCVEIQHiOBCojy9VQz5bdVkMQ +G9JxKI8QqeREHDmKBqf6N0i9Wt03f3oAz4SKSKN1pWf7e0ctJgAuZe1jTreUGD9a +CHRU5a/dhhs0m0ze/thpPXKQx1yDgnjqqwbU8QYgrf0ku+mU4MYy9d+vtBRNnM4N +Yjo6KxH5nteOYytXNRB+1URkjGGbTvjopftHu4Uz6sbgPeIs6EHhFeKnRSPf0PmT +AZeJlXdN1dTB22HK4oQ2nAGbM+xTgy/d19ggwGtKc5LSbCKmomhGi6o/qv5Ht5hw +/bpZiK+fDdfLoEJE+fBUOcHN+7TkxtZ+HfXtuRoP1+aiq6IlH2z5q5zYo7naMnJR +bWHxO30GKz1D1VIfy2IUU2lNkRIi8FX5/E/e7uP8/UBXUOsOekXMUg8kb0UCcmtt +kJQc1Ps09ktNJRdv30pk+K0ebt+tbLMdGuYOWXv4pxN3eIW/P3wS1I40/wGQA0KF +YOSZ1hkyRkHoUMoqA2HNxWj0kg9uSIlBnlO8QWLtSpJktcs9VWzZh4eaq/wiUGaS +K7nXnjvtgOP6GWk4h7YlOtu10PKATa9tfZKQ3qrfvoAmHGnueuNFyaROauBWXx9h +RD9iNMkeIV/2f2jAbr/SNR5TmeThvWSkSTzDzrboqT0nVOrxPqH8e7+NcWCQxWYk +hd59Rx9ig+JjjhBcFM3QfoZETd8FEEO4PIdkaezq+0maxnbBj+pJmArTl69k79pf +qVcD46AV2GjFQNh7DyYNX/C+Wkz9r56/LTFAcSXe0HMZLa6my3zwuKSpXFCAQU7c +9yCkpmZl+5LRQy2/MLIN25ujrCgIxIGZDA1F6anlbNq/ELunPlpft5NKIBUpaXR4 +0etTqIhJy94M4psx4i9Wlc9VkqOOqe9oywAR1HEGS+WJDLbnKy+YZSGOKqOGc7sb +duGUAtihUZcVYKI51f3cqL4wEkSxSQuUgs9fk2EcPOsFW6QX7jDNfNs/7nkC2hQg +mP2aCvE5yFlbTqOt+ATmC7aBfkEAr/c37G68KKM9drb96YjHHnh5J2KigzQVYbjk +w6z1fz5OX18xW+iRG4Bey3Sy5aOK1VqJ+mPx/2e9WdBwd7d1tTR0PS6ZRgtLxGQv +k0j+R5JqC0Je78kGZIRgiSuEHzENNhVOa80U96DRsrj/U/Wque1jUHpvYufHf7z1 +4gz4KKQNunXQuMeb45RiZhzYbAIupaJiUP7PMQIDAQABAoIEAQDdg63OaSJAtj2f +0mCMb8ISwFfYk4Osar5rp/Gzjq0vwZKYizHfxA/gZeuA0HqUkeyAQicE+x53pNq3 +etWQ4lprTV7i+ZV99mDLEiQACdudft1Cpsdr5aTDZMWLwvpQ072fEHX6Llc6/72e +jB0UkXCcK6oHnZ87rs3C5Gyf/SpTJPrV1KbkoKGaUFnRrIyCPj/EOFp2a+UWWGba +pCuzkfcoA21xT6yW8+NY+EOwh9VWJwy8af3WtWIh0ix+sCDqegsJcHObWXJQ8ZMD +Oi9lfqXnd+ZskYOR+zn5P8w9LJiJ1CEAFLR9H15tpleFtCSw/z5pLP9ndvTwyeIb +GSmU2VAqBgP6roGYDuL6iq6Dyi0GN4luM0pz9c/PtY2Ni8MrzeziKjAF6OXiDE41 +rxTwdG7RxnNa2q7+tjt9hrCgLbYqd6W/6VKYZY1YKvIE+PhdwGtzxwbKsOf6phqt +6DZr0BKIX7VwMeXRHbhtjw6hR86diH2koLQPfH4crDIL3GQ2J13C/RxjTLAEOli2 +y4paeOYzOe6ANDXXBOhieFw5f6mqD9pTF2PWDTnTJhfMGJ6gXPapDYoycS8huNnM +DnqtMVIOf2zOI8aSkumJyXq2bEpGSNK80IJgyKfpk0b4qOdbG7tklfbhVCxTida0 +qqgmJKLGrNmJNW8KLB1U4/hcowEVFz8MF0OZAnByDHi2axwSRSGD5aG2yhCfs3Sy +C269M25v0WuTeOs02RnHUvLPIhvbOEVTu6AjvAtYIfjEq+xqrjbZqUqJeh/xo2tF +SohWe5aQs5DntsMCkZWlqlXc4CCaCqVACegh5Rn+8JbpZvpzy4HUtThfVbB45a5P +6uRAsoxiIHbPLyIaKHFqqfog98hzD4TZYKpfb4RCgqKgEAHGKh4/KPM9O4iw67Oj +EnT2WduegazemzOxQIuZ1UcNu/2d7uy8v/zPGLEUfqhFLS8PMStEuLdQQZfU2DFM +rHJZsH3UtgSreZuQnlTHYy073UhB44mhcYbwa03jMkLHb1bt9q9l8ZAZ5FjstKJD +vN5hMqT5LBQtvArCB+aIVDQxEyZiqFxBlW658uAIhCkLXNB5BVfEUEB8w5vZXOPn +UpNyM8v0dYOkiSOH6+Kk0i7eC8CSrSQAaLnuFZxepGCGMFksywMv7mDg6yX1sAkE +RMakKaAaZ55QpUv1/heaBVK0xmwpjJBefAoMCyFh/I+o7BkFdWGsGF2Tc5ZxZB3F +DF75An4WV2qFMNEIb2SGBBUHGoG75C7tRC9ll39SqX7X2pXMaHvJvEx76CmhC9ub +TzkRDV0Zi/GqiBQXz5kn4AP3GCuJUQJIvK2l0HPqbqNULrhahwQWBOpIek/SLBFV +3fRQc5ABAoICAQDzqaS5/JEKUGMzVikWYnxl6fXgMp/l3Hq2DyifRqgYVoSr/wOJ +PTOOJrtuvwHK6kbOv4YRfKwgVWlJgoAP9Tz0GGpE7toSk3biHY4tTF4KR3xIIOnI +LQLNDR0LDrJSjQhAH5z8U/E+dpOCBHLfXodZ0/ZuXx9YS/pNDQBW/+HOmDtCfqpb +kLmxjZcvZnAZyrlSjGrHJoPjiFrVA/1xvY68TNWHWu8EXphKO/aBi5/e4wWS7I8q +0lDjjPB3GIm0rhumowoGYDPtchcTIvip9aGSPsw56elV+PiwbZaPHZXwHeI0Q25j +UAdkmkwO4VaYGeR4JSUTjoOwWdXXediRq9SKRwhOoat3GJdDwYByYgZb8MKdQCZV +H9hD0rEF4JOrUnOsCteXMNEczQocfSxduLD7XLie+oXoEggNE/hD9EJ397sOvyUg +rgmJLBPCbIPdnfCwm9rdLMsWUjvd4JFq1dyQ9QM1LkdOGQdSoUixtN8X75BdkWhL +/LUqVV/L5/1DStYniO6k4ry67u4POisAZa4czPAJrBEOakVxkCIoaH+mZ/J3GxWc +DvnV6myvcNXUEENhfMt2mikP5zcPthq1O1nm7RFqiow4s/f0jc6Epr/LToXwhm8j +5ch0TkcM+ioguCyYXWEzRJUt3GBWpHoSvxqKLxaWbo1mtxHpGxHDIIFAoQKCAgEA +8cuU0H0OE3JJaG+9Hp6q5mJfdrAzeIPTCT1jxVDptZaplMVo8X0+LIKYpzWqbGWa +Z3cTmReOZBukuKPKXuZEufYqzwIh7lEv1ls2SJ8Gedf3Dq3C2fCITHzXlsg58mrf +tD6cKE85EmI/GhXtaBc51Qa60w5MyXfzK3EPi8lD1v5Il5K1MG6sv+7+P1LgAQVj +c9mPVT1WmgBFVG2/syJ9L94smwhrtM2NhxMkMtEBrOiv0Wy0bEb1wIo5ndBGBoeF +KXBfz87HDbUCSxItDFZ5mDk2ARnzl/13+wr81aKcxW2LyQ0eiiN+HczmM1xpavU6 +KI/QnIvUNqW9XRSNpz/w+DO9+gs9BPIODMww4KpLVtgFfy5KYre1/MpgZHVlHDCI +r72WaDFHdMs75JN1rPNnYx81LtKp0JnE2bIDda3qlCKTBtwaFEUg1F0v9NK9yiZF +JytwUUIfURayT34hfDAJDaSemWT3b4U2kYBr7Fp+g6R5iAosx/TnCYxtuGhdSLA7 +JkL4gy6Ll6hQkIyxRxC6R38wzwUFg4pbV6qrhjP1qyuU1BsZrBSV1RSbcHghSAZj +UmT/sCKOhnliptnnz3e6ceP8I9Y2/TOeJXPdH6zvfaTpnVLiZC48FBKnXFCM4SaS +v5qejQChBBOyd9ybO40sxC/Db8WsPa1LCMnHzm9YtJECggIBAOitGIYZ7o7A0NnW +7wlXJp9TWN2suhAQCIYN16axHBeRlsN/k2rcLH0T82v/rcCNEuye63GLcfq2VQJD +QfL7JieZoPEOfOO8OYwW2QvcnviF5uIhu9zRTplsak2CzToTPsus5IX3yqjxJk7D +3MX8SJe41tvyrcXtV6l4PtjVJFXZ/My0lA04GHq6UKKM2YNnmKyBNf3Sg6MlNEex +tbWFY+XgIQ9OAGxVwGsy82QlZpa6hzoT92rWxzNkBMRVhDorAHCRxCLufufBSNOX +U4lI6+7xVKgA/DaCt0gSffFQOTu/7aAmvCTN6SFiTjrvZ3d7UjaAkfUo5Avk3VUU +H4CLazxYNFCSBWCG9PtYrkWL4bKuJ8lt1qz26ddqPGz2VU0GQTsKZ3ESxr0P9xXZ +WiJtGWQO2KXHaVOA1HtYlHyfpVFWGSQt11BroOOCWaQRZ6KbDZo4WjlWauB3yn9H +0NUKP8OUlGmWNbUYJWv8Y6R+qYL72wnero/RU1aHjCD0+V3m+rVqBykg80Q2oNGd +pC6O6kLKWHWEAA2Z4ZJeJqAbmbnYDSs7i9koW96wKvUldKs6lH1lZA1vjMKI8oVo +SfzCHklsHHN2tgv3n1HCkHEPopqL808JsNvAsziM/0AfK1dvR/Z/RTBlz2apyL0z +9vYr0zYdXR5tl018h/fnR4Dja0nBAoICAG7z5Ui6adAgnHDQ/W5kjrWDJJ05A5Vk +oF1YD0VG+Md76Ds9TwepWfNgxh3McXSmNvENYi/Y8F0dljun5UAg2B6hSEmPh/Rs +ys/JMSKn3nfg0xyoPYZ2aoT2sJMfM//6bMawCEYy/FRkQuJ8d2FRbxdCrE4W/MNi +SHKBwgl6BKhOLQ9oob4kux6j04VJSUMOrvFFPxF1QR0PzMCOT+4qgFmL0NofRhVE +UZJPBUhQQj2O1Mb749rfwPtmMkQpg0iRvVgjmcOo9gxjKDc8kvFbaRaiAhcFSpNP +G1RWWWjK4rdxqjhKzd3DpaaVFHkzCair+NEOFUMQowOkkD17Jfk+TRwH2kA4EfsH ++8yBklg1rLagD/2pRzb/aAIk95CBkjEaUE6cZ71OB6UfcU9VHyWK18FTW7strgDr +3rmqhw3kDYWGTANU0p7EjekFDfGBFtgBMbBkrXiMKAS0roPts/3hqPXauXBYNXa2 +ITEpRdzCNdXAjogPazciOTZXey2ork2hmLLY/mJr5GBmOvnppZufoGsYgVQt0Lbo +sTuMNIMzqqKuL/AYs3IUTCDoAN/eMB911vPDJtUzNkWcw9kemtHH9gU3AceMD9Wm +bwZuoWRcndUA7LZlhz9DPAxV9vhUeiEC60oC8IhxZnGRfE6mK5FrGcS4yiyq/3uZ +3pmcxhQDYigRAoICAQCzK0SUG9tSzwpyuEb7hbS7isT0XOnVvLDEXL2jTwVqbN8a +pC9jebbzJgxk5EA+np/eZlRU7h4aZjRhtDwi4HsarXzgIni6z1vswAiOSZRCfC17 +8/tjfER9w3pJMRTJ5MFeN7JvNUhWnXY5fX6SBl/Eocwwy8S/eIWUY53aI2k8UZMR +eLUb9I6eL21qZAPp/XD8/3pF5DH0ECOS96C8mDKTGnARUyfkKrlaASSTfe5XToNb +IpDEYtLwpHN0missq+ObqPc5lwot/nBy2fdllksb3mCCK8AxuKEDsVtWbb2maoa9 +lRGxIxr++ZV8n0dAwGCV18CbhBYh/B2YnrexI2ZfYOQbzPjHiuUgSLGBJvIUX+S+ +O8ij0vQBqECfwCq63SrdW340Huob52d/cod9pNolO5edftPNJVJP+44sZtEJoDBW +WgzdpVV9fA8TYsO6B3Dci960fbpWnKZ01uLFWVTkou8IwqcaxJIyMzS3Gmqo4UEF +oxBSrg9rTAMJSnm2YWBHK1Z8DDlLzw3SkNZVKm6Ai4yEcLs1PzGZejsJvsu3zGgq +nM4liRHK2QqY1SJf6PsJGxAI62tlyTRfjxtC3Jq9oJbmJs+jl0gtNKEbkfQc83IL +8wCHOm9G7KK7XJjMCb50Dh80YIDFj5GTQLU1tKdpDBfq6YTKUHqjPA8GRnz8vA== -----END RSA PRIVATE KEY----- diff --git a/mysql-test/suite/binlog/r/binlog_commit_wait.result b/mysql-test/suite/binlog/r/binlog_commit_wait.result new file mode 100644 index 00000000000..07019c12905 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_commit_wait.result @@ -0,0 +1,155 @@ +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; +SET @old_count= @@GLOBAL.binlog_commit_wait_count; +SET GLOBAL binlog_commit_wait_count= 3; +SET @old_usec= @@GLOBAL.binlog_commit_wait_usec; +SET GLOBAL binlog_commit_wait_usec= 20000000; +SELECT variable_value INTO @group_commits FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commits'; +SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_count'; +SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; +SET @a= current_timestamp(); +BEGIN; +INSERT INTO t1 VALUES (1,0); +COMMIT; +INSERT INTO t1 VALUES (1,1); +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); +IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")) +Ok +SELECT variable_value - @group_commits FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commits'; +variable_value - @group_commits +1 +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_count'; +variable_value - @group_commit_trigger_count +0 +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +variable_value - @group_commit_trigger_timeout +0 +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; +variable_value - @group_commit_trigger_lock_wait +1 +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +SET @a= current_timestamp(); +INSERT INTO t1 VALUES (2,0); +INSERT INTO t1 VALUES (3,0); +INSERT INTO t1 VALUES (4,0); +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); +IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")) +Ok +SELECT variable_value - @group_commits FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commits'; +variable_value - @group_commits +2 +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_count'; +variable_value - @group_commit_trigger_count +1 +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +variable_value - @group_commit_trigger_timeout +0 +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; +variable_value - @group_commit_trigger_lock_wait +1 +SET @a= current_timestamp(); +INSERT INTO t1 VALUES (6,0); +BEGIN; +UPDATE t1 SET b=b+1 WHERE a=1; +UPDATE t1 SET b=b+10 WHERE a=1; +SELECT SLEEP(0.25); +SLEEP(0.25) +0 +UPDATE t1 SET b=b+1 WHERE a=3; +COMMIT; +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); +IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")) +Ok +SELECT variable_value - @group_commits FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commits'; +variable_value - @group_commits +3 +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_count'; +variable_value - @group_commit_trigger_count +1 +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +variable_value - @group_commit_trigger_timeout +0 +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; +variable_value - @group_commit_trigger_lock_wait +2 +SET @a= current_timestamp(); +INSERT INTO t1 VALUES (7,0); +INSERT INTO t1 VALUES (8,0); +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); +IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")) +Ok +SELECT variable_value - @group_commits FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commits'; +variable_value - @group_commits +4 +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_count'; +variable_value - @group_commit_trigger_count +2 +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +variable_value - @group_commit_trigger_timeout +0 +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; +variable_value - @group_commit_trigger_lock_wait +2 +SET @a= current_timestamp(); +SET GLOBAL binlog_commit_wait_usec= 5*1000*1000; +INSERT INTO t1 VALUES (9,0); +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"), +IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))); +IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"), +IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))) +Ok +SELECT variable_value - @group_commits FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commits'; +variable_value - @group_commits +5 +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_count'; +variable_value - @group_commit_trigger_count +2 +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +variable_value - @group_commit_trigger_timeout +1 +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status +WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; +variable_value - @group_commit_trigger_lock_wait +2 +SELECT * FROM t1 ORDER BY a; +a b +1 11 +2 0 +3 1 +4 0 +6 0 +7 0 +8 0 +9 0 +DROP TABLE t1; +SET GLOBAL binlog_commit_wait_count= @old_count; +SET GLOBAL binlog_commit_wait_usec= @old_usec; diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index 4f7d2dc7b94..504b3daa206 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -50,10 +50,31 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generate master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; + +# 'DROP TABLE IF EXISTS <deleted tables>' is binlogged +# when 'DROP DATABASE' fails and at least one table is deleted +# from the database. +RESET MASTER; +CREATE DATABASE testing_1; +USE testing_1; +CREATE TABLE t1(c1 INT); +CREATE TABLE t2(c1 INT); +# Create a file in the database directory +SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE'; + +# 'DROP DATABASE' will fail if there is any other file in the the +# database directory +DROP DATABASE testing_1; +ERROR HY000: Error dropping database (can't rmdir './testing_1', errno: 39 "Directory not empty") + +# Remove the fake file. +# Now we can drop the database. +DROP DATABASE testing_1; # # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT # BASED REPLICATION # +USE test; DROP DATABASE IF EXISTS db1; DROP TABLE IF EXISTS t3; CREATE DATABASE db1; @@ -70,7 +91,7 @@ t2 include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `db1`; DROP TABLE `t1` +master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1` DROP TABLE t3; DROP DATABASE db1; set binlog_format=mixed; @@ -125,10 +146,31 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generate master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; + +# 'DROP TABLE IF EXISTS <deleted tables>' is binlogged +# when 'DROP DATABASE' fails and at least one table is deleted +# from the database. +RESET MASTER; +CREATE DATABASE testing_1; +USE testing_1; +CREATE TABLE t1(c1 INT); +CREATE TABLE t2(c1 INT); +# Create a file in the database directory +SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE'; + +# 'DROP DATABASE' will fail if there is any other file in the the +# database directory +DROP DATABASE testing_1; +ERROR HY000: Error dropping database (can't rmdir './testing_1', errno: 39 "Directory not empty") + +# Remove the fake file. +# Now we can drop the database. +DROP DATABASE testing_1; # # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT # BASED REPLICATION # +USE test; DROP DATABASE IF EXISTS db1; DROP TABLE IF EXISTS t3; CREATE DATABASE db1; @@ -145,7 +187,7 @@ t2 include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `db1`; DROP TABLE `t1` +master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1` DROP TABLE t3; DROP DATABASE db1; set binlog_format=row; @@ -200,10 +242,31 @@ master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* gen master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; + +# 'DROP TABLE IF EXISTS <deleted tables>' is binlogged +# when 'DROP DATABASE' fails and at least one table is deleted +# from the database. +RESET MASTER; +CREATE DATABASE testing_1; +USE testing_1; +CREATE TABLE t1(c1 INT); +CREATE TABLE t2(c1 INT); +# Create a file in the database directory +SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE'; + +# 'DROP DATABASE' will fail if there is any other file in the the +# database directory +DROP DATABASE testing_1; +ERROR HY000: Error dropping database (can't rmdir './testing_1', errno: 39 "Directory not empty") + +# Remove the fake file. +# Now we can drop the database. +DROP DATABASE testing_1; # # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT # BASED REPLICATION # +USE test; DROP DATABASE IF EXISTS db1; DROP TABLE IF EXISTS t3; CREATE DATABASE db1; @@ -220,7 +283,7 @@ t2 include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `db1`; DROP TABLE `t1` +master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1` DROP TABLE t3; DROP DATABASE db1; show databases; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index f24cd30167c..86c4c68d02b 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -327,6 +327,18 @@ INSERT INTO t2 SET a=1; INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +INSERT INTO t1dec102 VALUES (-999.99); +INSERT INTO t1dec102 VALUES (0); +INSERT INTO t1dec102 VALUES (999.99); +SELECT * FROM t1dec102 ORDER BY a; +a +-999.99 +0.00 +123.45 +123.46 +123.47 +999.99 +DROP TABLE t1dec102; flush logs; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; @@ -4554,6 +4566,62 @@ SET TIMESTAMP=1000000000/*!*/; DROP TABLE `t1`,`t2` /* generated by server */ /*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-317 +/*!100001 SET @@session.gtid_seq_no=317*//*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-318 +/*!100001 SET @@session.gtid_seq_no=318*//*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-319 +/*!100001 SET @@session.gtid_seq_no=319*//*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1dec102` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1dec102` +### SET +### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # GTID 0-1-320 +/*!100001 SET @@session.gtid_seq_no=320*//*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +DROP TABLE `t1dec102` /* generated by server */ +/*!*/; +# at # #010909 4:46:40 server id 1 end_log_pos # Rotate to master-bin.000002 pos: 4 DELIMITER ; # End of log file diff --git a/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result new file mode 100644 index 00000000000..f09216cb539 --- /dev/null +++ b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result @@ -0,0 +1,8 @@ +create table t1 (i int); +create trigger tr after insert on t1 for each row set @b=@a; +create temporary table tmp like t1; +insert into t1 values (1); +select * from t1; +i +1 +drop table t1; diff --git a/mysql-test/suite/binlog/t/binlog_commit_wait.test b/mysql-test/suite/binlog/t/binlog_commit_wait.test new file mode 100644 index 00000000000..7d7af2a90e2 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_commit_wait.test @@ -0,0 +1,229 @@ +--source include/have_innodb.inc +--source include/have_log_bin.inc + +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; + +SET @old_count= @@GLOBAL.binlog_commit_wait_count; +SET GLOBAL binlog_commit_wait_count= 3; +SET @old_usec= @@GLOBAL.binlog_commit_wait_usec; +SET GLOBAL binlog_commit_wait_usec= 20000000; + +connect(con1,localhost,root,,test); +connect(con2,localhost,root,,test); +connect(con3,localhost,root,,test); + +# Get Initial status measurements +--connection default +SELECT variable_value INTO @group_commits FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commits'; +SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_count'; +SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; + +# Note: binlog_group_commits is counted at the start of the group and group_commit_trigger_* is +# counted near when the groups its finalised. + +# Check that if T2 goes to wait for a row lock of T1 while T1 is waiting for +# more transactions to arrive for group commit, the commit of T1 will complete +# immediately. +# We test this by setting a very high timeout (20 seconds), and testing that +# that much time does not elapse. + +--connection default +SET @a= current_timestamp(); + +--connection con1 +BEGIN; +INSERT INTO t1 VALUES (1,0); +send COMMIT; + +--connection con2 +send INSERT INTO t1 VALUES (1,1); + +--connection con1 +reap; + +--connection default +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); + +# All connections are to the same server. One transaction occurs on con1. It is +# commited before con2 is started. con2 transaction violates the unique key contraint. This +# type of group commit is binlog_group_commit_trigger_lock_wait so that further con2 +# transactions will occur afterwards as they may be as result of the ER_DUP_ENTRY on the +# application side. +# before: binlog_group_commit=0, binlog_group_commit_trigger_count=0 +# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=0 +# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_lock_wait+1 +SELECT variable_value - @group_commits FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commits'; +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_count'; +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; + +--connection con2 +--error ER_DUP_ENTRY +reap; + + +# Test that the commit triggers when sufficient commits have queued up. +--connection default +SET @a= current_timestamp(); + +--connection con1 +send INSERT INTO t1 VALUES (2,0); + +--connection con2 +send INSERT INTO t1 VALUES (3,0); + +--connection con3 +INSERT INTO t1 VALUES (4,0); + +--connection con1 +reap; +--connection con2 +reap; + +--connection default +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); + +# All connections are to the same server. 3 non-conflicting transaction occur +# on each connection. The binlog_commit_wait_count=3 at the start therefore 1 +# group is committed by virtue of reaching 3 transactions. Hence +# binlog_group_commit_trigger_count is incremented. +# before: binlog_group_commit=1, binlog_group_commit_trigger_count=0 +# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=1 +# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_count+1 +SELECT variable_value - @group_commits FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commits'; +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_count'; +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; + +# Test that commit triggers immediately if there is already a transaction +# waiting on another transaction that reaches its commit. + +--connection default +SET @a= current_timestamp(); + +--connection con1 +send INSERT INTO t1 VALUES (6,0); + +--connection con2 +BEGIN; +UPDATE t1 SET b=b+1 WHERE a=1; + +--connection con3 +send UPDATE t1 SET b=b+10 WHERE a=1; + +--connection con2 +# A small sleep to let con3 have time to wait on con2. +# The sleep might be too small on loaded host, but that is not a big problem; +# it only means we will trigger a different code path (con3 waits after con2 +# is ready to commit rather than before); and either path should work the same. +# So we will not get false positive in case of different timing; at worst false +# negative. +SELECT SLEEP(0.25); +UPDATE t1 SET b=b+1 WHERE a=3; +COMMIT; + +--connection con1 +reap; + +--connection default +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); + +# All connections are to the same server. con2 and con3 updates are aquiring +# the same row lock for a=1. Either con2 or con3 will be in a lock wait +# thefore the binlog_group_commit_trigger_lock_wait is incremented. +# before: binlog_group_commit=2, binlog_group_commit_trigger_count=1 +# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=1 +# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_lock_wait+1 +SELECT variable_value - @group_commits FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commits'; +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_count'; +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; + +--connection default +SET @a= current_timestamp(); + +# Now con3 will be waiting for a following group commit to trigger. +--connection con1 +send INSERT INTO t1 VALUES (7,0); +--connection con2 +INSERT INTO t1 VALUES (8,0); +--connection con3 +reap; + +--connection default +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")); + +# The con1 and con2 transactions above are combined with the 'send UPDATE t1 SET b=b+10 WHERE a=1;' +# on con3 from the previous block. So we have 3 so this is a count based group. +# before: binlog_group_commit=3, binlog_group_commit_trigger_count=1 +# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=2 +# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_count+1 +SELECT variable_value - @group_commits FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commits'; +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_count'; +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; + +# Test that when the binlog_commit_wait_usec is reached the tranction gets a group commit + +--connection default +SET @a= current_timestamp(); +SET GLOBAL binlog_commit_wait_usec= 5*1000*1000; + +--connection con1 +reap; +INSERT INTO t1 VALUES (9,0); + +--connection default +SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a); +SELECT IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"), + IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))); + +# con1 pushes 1 transaction. The count was for 3 to occur before a group commit. +# The timeout is 5 seconds but we allow between 4 and 20 because of the fragile nature +# of time in test. This is a timeout causing the commit so binlog_group_commit_trigger_timeout +# is incremented. +# before: binlog_group_commit=4, binlog_group_commit_trigger_count=2 +# before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=2 +# after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_timeout+1 +SELECT variable_value - @group_commits FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commits'; +SELECT variable_value - @group_commit_trigger_count FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_count'; +SELECT variable_value - @group_commit_trigger_timeout FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_timeout'; +SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.global_status + WHERE variable_name = 'binlog_group_commit_trigger_lock_wait'; + +--connection default +SELECT * FROM t1 ORDER BY a; + +--connection default +DROP TABLE t1; +SET GLOBAL binlog_commit_wait_count= @old_count; +SET GLOBAL binlog_commit_wait_usec= @old_usec; diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test index 9b41c63d195..9609a9af384 100644 --- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test +++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test @@ -438,9 +438,20 @@ INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI + +INSERT INTO t1dec102 VALUES (-999.99); +INSERT INTO t1dec102 VALUES (0); +INSERT INTO t1dec102 VALUES (999.99); +SELECT * FROM t1dec102 ORDER BY a; +DROP TABLE t1dec102; + flush logs; -let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ --exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001 diff --git a/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test b/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test new file mode 100644 index 00000000000..a1d91e2f98f --- /dev/null +++ b/mysql-test/suite/binlog/t/temptable_uservar_disconnect-7938.test @@ -0,0 +1,17 @@ +# +# MDEV-7938 MariaDB Crashes Suddenly while writing binlogs +# +--source include/have_log_bin.inc +--source include/have_binlog_format_mixed.inc + +--connect(con1,localhost,root,,) +create table t1 (i int); +create trigger tr after insert on t1 for each row set @b=@a; + +create temporary table tmp like t1; +insert into t1 values (1); +--disconnect con1 + +--connection default +select * from t1; +drop table t1; diff --git a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test index d6746d92250..88563b046df 100644 --- a/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test +++ b/mysql-test/suite/funcs_1/t/processlist_priv_no_prot.test @@ -25,10 +25,6 @@ let $fixed_bug_30395= 0; # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc --source suite/funcs_1/datadict/processlist_priv.inc diff --git a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test index b92c963c79c..a03d3774484 100644 --- a/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test +++ b/mysql-test/suite/funcs_1/t/processlist_val_no_prot.test @@ -20,10 +20,6 @@ # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc --source suite/funcs_1/datadict/processlist_val.inc diff --git a/mysql-test/suite/innodb/r/binlog_consistent.result b/mysql-test/suite/innodb/r/binlog_consistent.result index edfa5947eb8..47f9900c449 100644 --- a/mysql-test/suite/innodb/r/binlog_consistent.result +++ b/mysql-test/suite/innodb/r/binlog_consistent.result @@ -104,4 +104,13 @@ master-bin.000001 1757 Gtid 1 1795 BEGIN GTID 0-1-9 master-bin.000001 1795 Query 1 1887 use `test`; INSERT INTO t1 VALUES (3, "") master-bin.000001 1887 Xid 1 1914 COMMIT /* XID */ master-bin.000001 1914 Rotate 1 1958 master-bin.000002;pos=4 -DROP TABLE t1,t2; +*** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit *** +SET @old_size= @@GLOBAL.max_binlog_size; +SET GLOBAL max_binlog_size=4096; +CREATE TABLE t3 (a INT PRIMARY KEY, b VARBINARY(8192)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (10, ''); +INSERT INTO t3 VALUES (11, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); +test_result +OK +SET GLOBAL max_binlog_size=@old_size; +DROP TABLE t1,t2, t3; diff --git a/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result b/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result deleted file mode 100644 index ffeacae7951..00000000000 --- a/mysql-test/suite/innodb/r/innodb-alter-table-disk-full.result +++ /dev/null @@ -1,50 +0,0 @@ -create table t1(a int not null primary key, b int) engine=innodb; -create procedure innodb_insert_proc (repeat_count int) -begin -declare current_num int; -set current_num = 0; -while current_num < repeat_count do -insert into t1 values(current_num, current_num); -set current_num = current_num + 1; -end while; -end// -commit; -set autocommit=0; -call innodb_insert_proc(10000); -commit; -set autocommit=1; -set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28'; -alter table t1 add testcol int; -ERROR HY000: The table 't1' is full -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL, - `b` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28_2'; -alter table t1 add testcol int; -ERROR HY000: The table 't1' is full -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL, - `b` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -set DEBUG_DBUG=NULL; -alter table t1 add testcol2 int; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL, - `b` int(11) DEFAULT NULL, - `testcol2` int(11) DEFAULT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 -select count(1) from t1; -count(1) -10000 -drop procedure innodb_insert_proc; -drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-alter-tempfile.result b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result new file mode 100644 index 00000000000..ce13ad0978b --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-alter-tempfile.result @@ -0,0 +1,40 @@ +# +# Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS +# +# Temporary tablename will be unique. This makes sure that future +# in-place ALTERs of the same table will not be blocked due to +# temporary tablename. +# Crash the server in ha_innobase::commit_inplace_alter_table() +CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; +SET debug='d,innodb_alter_commit_crash_before_commit'; +Warnings: +Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead +# Write file to make mysql-test-run.pl expect crash +# Execute the statement that causes the crash +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +ERROR HY000: Lost connection to MySQL server during query +# Startup the server after the crash +# Read and remember the temporary table name +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +# Consecutive Alter table does not create same temporary file name +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +# Shutdown the server to allow manual recovery +# Manual recovery begin. The dictionary was not updated +# and the files were not renamed. The rebuilt table +# was left behind on purpose, to faciliate data recovery. +# Manual recovery end +# Startup the server after manual recovery +# Drop the orphaned rebuilt table. +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + `f2` int(11) NOT NULL, + PRIMARY KEY (`f2`,`f1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb-bigblob.result b/mysql-test/suite/innodb/r/innodb-bigblob.result new file mode 100644 index 00000000000..314bd3ed088 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-bigblob.result @@ -0,0 +1,7 @@ +call mtr.add_suppression("Resizing redo log from *"); +call mtr.add_suppression("Starting to delete and rewrite log files."); +call mtr.add_suppression("New log files created, LSN=*"); +create table foo (id varchar(37) not null, content longblob) engine=INNODB; +insert into foo (id, content) values('xyz', ''); +update foo set content=repeat('a', 43941888) where id='xyz'; +drop table foo; diff --git a/mysql-test/suite/innodb/r/innodb-fk.result b/mysql-test/suite/innodb/r/innodb-fk.result index cf883d83874..956dbce58ed 100644 --- a/mysql-test/suite/innodb/r/innodb-fk.result +++ b/mysql-test/suite/innodb/r/innodb-fk.result @@ -33,3 +33,112 @@ select * from fk_29; f1 29 drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +f1 int(11) DEFAULT NULL, +PRIMARY KEY (id), +CONSTRAINT fk1 FOREIGN KEY (f1) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +f2 int(11) NOT NULL, +f3 int(11) NOT NULL, +PRIMARY KEY (`id`), +CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE, +CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE +) ENGINE=InnoDB; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +show warnings; +Level Code Message +Error 1005 Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +Warning 1215 Cannot add foreign key constraint +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +f2 int(11) NOT NULL, +f3 int(11) NOT NULL, +PRIMARY KEY (`id`), +CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE +) ENGINE=InnoDB; +ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE; +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed") +show warnings; +Level Code Message +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed") +Warning 1215 Cannot add foreign key constraint +drop table t2; +drop table t1; +CREATE TABLE `#departaments` ( +`id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +PRIMARY KEY (`id_depart`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +CREATE TABLE `#departaments_tree` ( +`id_depart` INT(10) UNSIGNED NOT NULL, +`id_depart_in` INT(10) UNSIGNED NOT NULL, +PRIMARY KEY (`id_depart`,`id_depart_in`), +CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +ALTER TABLE `#departaments_tree` + ADD FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments`(`id_depart`); +SHOW CREATE TABLE `#departaments_tree`; +Table Create Table +#departaments_tree CREATE TABLE `#departaments_tree` ( + `id_depart` int(10) unsigned NOT NULL, + `id_depart_in` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_depart`,`id_depart_in`), + KEY `id_depart_in` (`id_depart_in`), + CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`), + CONSTRAINT `#departaments_tree_ibfk_2` FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments` (`id_depart`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE `#departaments_tree`; +DROP TABLE `#departaments`; +CREATE TABLE `boroda` ( +`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +`a` INT(11) UNSIGNED DEFAULT NULL, +`b` INT(11) UNSIGNED DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `a` (`a`), +CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +ALTER TABLE `boroda` + ADD FOREIGN KEY (`b`) REFERENCES `boroda`(`id`); +ALTER TABLE `boroda` DROP FOREIGN KEY `boroda_ibfk_2`; +RENAME TABLE `boroda` TO `#boroda`; +ALTER TABLE `#boroda` +ADD FOREIGN KEY (`b`) REFERENCES `#boroda`(`id`); +SHOW CREATE TABLE `#boroda`; +Table Create Table +#boroda CREATE TABLE `#boroda` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `a` int(11) unsigned DEFAULT NULL, + `b` int(11) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `a` (`a`), + KEY `b` (`b`), + CONSTRAINT `#boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `#boroda` (`id`), + CONSTRAINT `#boroda_ibfk_2` FOREIGN KEY (`b`) REFERENCES `#boroda` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE `#boroda`; +CREATE TABLE `boroda` ( +`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +`a` INT(11) UNSIGNED DEFAULT NULL, +`b` INT(11) UNSIGNED DEFAULT NULL, +PRIMARY KEY (`id`), +KEY `a` (`a`), +CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; +RENAME TABLE `boroda` TO `bor#oda`; +ALTER TABLE `bor#oda` +ADD FOREIGN KEY (`b`) REFERENCES `bor#oda`(`id`); +SHOW CREATE TABLE `bor#oda`; +Table Create Table +bor#oda CREATE TABLE `bor#oda` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `a` int(11) unsigned DEFAULT NULL, + `b` int(11) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `a` (`a`), + KEY `b` (`b`), + CONSTRAINT `bor#oda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `bor#oda` (`id`), + CONSTRAINT `bor#oda_ibfk_2` FOREIGN KEY (`b`) REFERENCES `bor#oda` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE `bor#oda`; diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7408.result b/mysql-test/suite/innodb/r/innodb-mdev-7408.result new file mode 100644 index 00000000000..8f6ad139192 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-mdev-7408.result @@ -0,0 +1,12 @@ +select @@global.innodb_ft_server_stopword_table; +@@global.innodb_ft_server_stopword_table +NULL +CREATE TABLE `stop_it-IT` ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD; +SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT'; +ERROR 42000: Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/stop_it-IT' +SET @@global.innodb_ft_server_stopword_table = 'test/stop_it@002dIT'; +drop table `stop_it-IT`; +CREATE TABLE stop_it ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD; +SET @@global.innodb_ft_server_stopword_table = 'test/stop_it'; +SET @@global.innodb_ft_server_stopword_table = NULL; +drop table stop_it; diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7513.result b/mysql-test/suite/innodb/r/innodb-mdev-7513.result new file mode 100644 index 00000000000..bb3531e3f90 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-mdev-7513.result @@ -0,0 +1,204 @@ +call mtr.add_suppression("Row size too large (> 8126)*"); +CREATE TABLE t1 ( text1 TEXT, +text2 TEXT, +text3 TEXT, +text4 TEXT, +text5 TEXT, +text6 TEXT, +text7 TEXT, +text8 TEXT, +text9 TEXT, +text10 TEXT, +text11 TEXT, +text12 TEXT, +text13 TEXT, +text14 TEXT, +text15 TEXT, +text16 TEXT, +text17 TEXT, +text18 TEXT, +text19 TEXT, +text20 TEXT, +text21 TEXT, +text22 TEXT, +text23 TEXT, +text24 TEXT, +text25 TEXT, +text26 TEXT, +text27 TEXT, +text28 TEXT, +text29 TEXT, +text30 TEXT, +text31 TEXT, +text32 TEXT, +text33 TEXT, +text34 TEXT, +text35 TEXT, +text36 TEXT, +text37 TEXT, +text38 TEXT, +text39 TEXT, +text40 TEXT, +text41 TEXT, +text42 TEXT, +text43 TEXT, +text44 TEXT, +text45 TEXT, +text46 TEXT, +text47 TEXT, +text48 TEXT, +text49 TEXT, +text50 TEXT, +text51 TEXT, +text52 TEXT, +text53 TEXT, +text54 TEXT, +text55 TEXT, +text56 TEXT, +text57 TEXT, +text58 TEXT, +text59 TEXT, +text60 TEXT, +text61 TEXT, +text62 TEXT, +text63 TEXT, +text64 TEXT, +text65 TEXT, +text66 TEXT, +text67 TEXT, +text68 TEXT, +text69 TEXT, +text70 TEXT, +text71 TEXT, +text72 TEXT, +text73 TEXT, +text74 TEXT, +text75 TEXT, +text76 TEXT, +text77 TEXT, +text78 TEXT, +text79 TEXT, +text80 TEXT, +text81 TEXT, +text82 TEXT, +text83 TEXT, +text84 TEXT, +text85 TEXT, +text86 TEXT, +text87 TEXT, +text88 TEXT, +text89 TEXT, +text90 TEXT, +text91 TEXT, +text92 TEXT, +text93 TEXT, +text94 TEXT, +text95 TEXT, +text96 TEXT, +text97 TEXT, +text98 TEXT, +text99 TEXT, +text100 TEXT, +text101 TEXT, +text102 TEXT, +text103 TEXT, +text104 TEXT, +text105 TEXT, +text106 TEXT, +text107 TEXT, +text108 TEXT, +text109 TEXT, +text110 TEXT, +text111 TEXT, +text112 TEXT, +text113 TEXT, +text114 TEXT, +text115 TEXT, +text116 TEXT, +text117 TEXT, +text118 TEXT, +text119 TEXT, +text120 TEXT, +text121 TEXT, +text122 TEXT, +text123 TEXT, +text124 TEXT, +text125 TEXT, +text126 TEXT, +text127 TEXT, +text128 TEXT, +text129 TEXT, +text130 TEXT, +text131 TEXT, +text132 TEXT, +text133 TEXT, +text134 TEXT, +text135 TEXT, +text136 TEXT, +text137 TEXT, +text138 TEXT, +text139 TEXT, +text140 TEXT, +text141 TEXT, +text142 TEXT, +text143 TEXT, +text144 TEXT, +text145 TEXT, +text146 TEXT, +text147 TEXT, +text148 TEXT, +text149 TEXT, +text150 TEXT, +text151 TEXT, +text152 TEXT, +text153 TEXT, +text154 TEXT, +text155 TEXT, +text156 TEXT, +text157 TEXT, +text158 TEXT, +text159 TEXT, +text160 TEXT, +text161 TEXT, +text162 TEXT, +text163 TEXT, +text164 TEXT, +text165 TEXT, +text166 TEXT, +text167 TEXT, +text168 TEXT, +text169 TEXT, +text170 TEXT, +text171 TEXT, +text172 TEXT, +text173 TEXT, +text174 TEXT, +text175 TEXT, +text176 TEXT, +text177 TEXT, +text178 TEXT, +text179 TEXT, +text180 TEXT, +text181 TEXT, +text182 TEXT, +text183 TEXT, +text184 TEXT, +text185 TEXT, +text186 TEXT, +text187 TEXT, +text188 TEXT, +text189 TEXT, +text190 TEXT, +text191 TEXT, +text192 TEXT, +text193 TEXT, +text194 TEXT, +text195 TEXT, +text196 TEXT, +text197 TEXT +) ENGINE = InnoDB; +INSERT INTO t1 VALUES ('abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef'); +DELETE FROM t1 WHERE text1 = 'abcdef'; +SELECT * from t1; +text1 text2 text3 text4 text5 text6 text7 text8 text9 text10 text11 text12 text13 text14 text15 text16 text17 text18 text19 text20 text21 text22 text23 text24 text25 text26 text27 text28 text29 text30 text31 text32 text33 text34 text35 text36 text37 text38 text39 text40 text41 text42 text43 text44 text45 text46 text47 text48 text49 text50 text51 text52 text53 text54 text55 text56 text57 text58 text59 text60 text61 text62 text63 text64 text65 text66 text67 text68 text69 text70 text71 text72 text73 text74 text75 text76 text77 text78 text79 text80 text81 text82 text83 text84 text85 text86 text87 text88 text89 text90 text91 text92 text93 text94 text95 text96 text97 text98 text99 text100 text101 text102 text103 text104 text105 text106 text107 text108 text109 text110 text111 text112 text113 text114 text115 text116 text117 text118 text119 text120 text121 text122 text123 text124 text125 text126 text127 text128 text129 text130 text131 text132 text133 text134 text135 text136 text137 text138 text139 text140 text141 text142 text143 text144 text145 text146 text147 text148 text149 text150 text151 text152 text153 text154 text155 text156 text157 text158 text159 text160 text161 text162 text163 text164 text165 text166 text167 text168 text169 text170 text171 text172 text173 text174 text175 text176 text177 text178 text179 text180 text181 text182 text183 text184 text185 text186 text187 text188 text189 text190 text191 text192 text193 text194 text195 text196 text197 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb-virtual-columns.result b/mysql-test/suite/innodb/r/innodb-virtual-columns.result new file mode 100644 index 00000000000..558bb23de0a --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-virtual-columns.result @@ -0,0 +1,322 @@ +CREATE TABLE IF NOT EXISTS gso_grad_supr ( +term char(4) NOT NULL DEFAULT '', +uw_id int(8) UNSIGNED NOT NULL DEFAULT 0, +plan varchar(10) NOT NULL DEFAULT '', +wdraw_rsn varchar(4) NOT NULL DEFAULT '', +admit_term char(4) NOT NULL DEFAULT '', +CONSTRAINT gso_grad_supr_pky PRIMARY KEY (uw_id, term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `gso_grad_supr` VALUES ('1031',2,'CSM','','1009'); +INSERT INTO `gso_grad_supr` VALUES ('1035',2,'CSM','ACAD','1009'); +CREATE TABLE IF NOT EXISTS grad_degree ( +student_id int(8) UNSIGNED NOT NULL, +plan varchar(10) NOT NULL, +admit_term char(4) NOT NULL, +wdraw_rsn varchar(4) NOT NULL DEFAULT '', +ofis_deg_status varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' + ELSE 'Not Completed' + END) VIRTUAL, +deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', +deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', +CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn); +CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term); +INSERT IGNORE grad_degree ( +student_id, +plan, +admit_term, +wdraw_rsn, +deg_start_term, +deg_as_of_term +) +SELECT +ggs.uw_id AS c_student_id, +ggs.plan, +ggs.admit_term, +ggs.wdraw_rsn, +IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term, +ggs.term AS c_as_of_term +FROM gso_grad_supr AS ggs +LEFT OUTER JOIN +grad_degree AS gd +ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +WHERE +ggs.term = 1031 AND +gd.student_id IS NULL +; +UPDATE grad_degree AS gd +INNER JOIN +gso_grad_supr AS ggs +ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +SET +gd.wdraw_rsn = ggs.wdraw_rsn, +gd.deg_as_of_term = 1035 +WHERE +gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND +ggs.term = 1035 +; +drop table grad_degree; +CREATE TABLE IF NOT EXISTS grad_degree ( +student_id int(8) UNSIGNED NOT NULL, +plan varchar(10) NOT NULL, +admit_term char(4) NOT NULL, +wdraw_rsn varchar(4) NOT NULL DEFAULT '', +ofis_deg_status varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' + ELSE 'Not Completed' + END) VIRTUAL, +ofis_deg_status2 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress2' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' + ELSE 'Not Completed2' + END) VIRTUAL, +ofis_deg_status3 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress3' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' + ELSE 'Not Completed3' + END) VIRTUAL, +ofis_deg_status4 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress4' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' + ELSE 'Not Completed4' + END) VIRTUAL, +ofis_deg_status5 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress5' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' + ELSE 'Not Completed5' + END) VIRTUAL, +ofis_deg_status6 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress6' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' + ELSE 'Not Completed6' + END) VIRTUAL, +ofis_deg_status7 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress7' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' + ELSE 'Not Completed7' + END) VIRTUAL, +ofis_deg_status8 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress8' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' + ELSE 'Not Completed8' + END) VIRTUAL, +deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', +deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', +CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn); +CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term); +INSERT IGNORE grad_degree ( +student_id, +plan, +admit_term, +wdraw_rsn, +deg_start_term, +deg_as_of_term +) +SELECT +ggs.uw_id AS c_student_id, +ggs.plan, +ggs.admit_term, +ggs.wdraw_rsn, +IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term, +ggs.term AS c_as_of_term +FROM gso_grad_supr AS ggs +LEFT OUTER JOIN +grad_degree AS gd +ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +WHERE +ggs.term = 1031 AND +gd.student_id IS NULL +; +UPDATE grad_degree AS gd +INNER JOIN +gso_grad_supr AS ggs +ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +SET +gd.wdraw_rsn = ggs.wdraw_rsn, +gd.deg_as_of_term = 1035 +WHERE +gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND +ggs.term = 1035 +; +ALTER TABLE grad_degree DROP INDEX grad_degree_wdraw_rsn_ndx; +ALTER TABLE grad_degree DROP COLUMN deg_start_term; +SHOW CREATE TABLE grad_degree; +Table Create Table +grad_degree CREATE TABLE `grad_degree` ( + `student_id` int(8) unsigned NOT NULL, + `plan` varchar(10) NOT NULL, + `admit_term` char(4) NOT NULL, + `wdraw_rsn` varchar(4) NOT NULL DEFAULT '', + `ofis_deg_status` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' + ELSE 'Not Completed' + END) VIRTUAL, + `ofis_deg_status2` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress2' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' + ELSE 'Not Completed2' + END) VIRTUAL, + `ofis_deg_status3` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress3' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' + ELSE 'Not Completed3' + END) VIRTUAL, + `ofis_deg_status4` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress4' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' + ELSE 'Not Completed4' + END) VIRTUAL, + `ofis_deg_status5` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress5' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' + ELSE 'Not Completed5' + END) VIRTUAL, + `ofis_deg_status6` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress6' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' + ELSE 'Not Completed6' + END) VIRTUAL, + `ofis_deg_status7` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress7' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' + ELSE 'Not Completed7' + END) VIRTUAL, + `ofis_deg_status8` varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress8' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' + ELSE 'Not Completed8' + END) VIRTUAL, + `deg_as_of_term` char(4) NOT NULL COMMENT 'In most cases also end term', + PRIMARY KEY (`student_id`,`plan`,`admit_term`), + KEY `grad_degree_as_of_term_ndx` (`deg_as_of_term`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE grad_degree; +CREATE TABLE IF NOT EXISTS grad_degree ( +student_id int(8) UNSIGNED NOT NULL, +plan varchar(10) NOT NULL, +admit_term char(4) NOT NULL, +wdraw_rsn varchar(4) NOT NULL DEFAULT '', +ofis_deg_status varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' + ELSE 'Not Completed' + END) VIRTUAL, +ofis_deg_status2 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress2' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' + ELSE 'Not Completed2' + END) VIRTUAL, +ofis_deg_status3 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress3' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' + ELSE 'Not Completed3' + END) VIRTUAL, +ofis_deg_status4 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress4' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' + ELSE 'Not Completed4' + END) VIRTUAL, +ofis_deg_status5 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress5' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' + ELSE 'Not Completed5' + END) VIRTUAL, +ofis_deg_status6 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress6' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' + ELSE 'Not Completed6' + END) VIRTUAL, +ofis_deg_status7 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress7' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' + ELSE 'Not Completed7' + END) VIRTUAL, +ofis_deg_status8 varchar(15) AS ( +CASE +WHEN wdraw_rsn = '' THEN 'In progress8' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' + ELSE 'Not Completed8' + END) VIRTUAL, +deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', +deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', +CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn); +ALTER TABLE grad_degree DROP COLUMN ofis_deg_status2, DROP COLUMN ofis_deg_status3, +DROP COLUMN ofis_deg_status4, DROP COLUMN ofis_deg_status5, DROP COLUMN ofis_deg_status6, +DROP COLUMN ofis_deg_status7, DROP COLUMN ofis_deg_status8; +CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term); +INSERT IGNORE grad_degree ( +student_id, +plan, +admit_term, +wdraw_rsn, +deg_start_term, +deg_as_of_term +) +SELECT +ggs.uw_id AS c_student_id, +ggs.plan, +ggs.admit_term, +ggs.wdraw_rsn, +IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term, +ggs.term AS c_as_of_term +FROM gso_grad_supr AS ggs +LEFT OUTER JOIN +grad_degree AS gd +ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +WHERE +ggs.term = 1031 AND +gd.student_id IS NULL +; +UPDATE grad_degree AS gd +INNER JOIN +gso_grad_supr AS ggs +ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +SET +gd.wdraw_rsn = ggs.wdraw_rsn, +gd.deg_as_of_term = 1035 +WHERE +gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND +ggs.term = 1035 +; +select * from grad_degree; +student_id plan admit_term wdraw_rsn ofis_deg_status deg_start_term deg_as_of_term +2 CSM 1009 ACAD Not Completed 1009 1035 +select * from gso_grad_supr; +term uw_id plan wdraw_rsn admit_term +1031 2 CSM 1009 +1035 2 CSM ACAD 1009 +drop table grad_degree; +drop table gso_grad_supr; diff --git a/mysql-test/suite/innodb/r/innodb-xa.result b/mysql-test/suite/innodb/r/innodb-xa.result new file mode 100644 index 00000000000..6eae842b14c --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-xa.result @@ -0,0 +1,17 @@ +xa rollback 'xid2'; +ERROR XAE04: XAER_NOTA: Unknown XID +drop table if exists t1; +Warnings: +Note 1051 Unknown table 'test.t1' +create table t1(a int)engine=innodb; +rollback; +xa start 'xid2'; +insert into `t1` values (1); +savepoint `sv1`; +xa end 'xid2'; +start transaction; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state +xa prepare 'xid2'; +release savepoint `sv1`; +xa commit 'xid2'; +drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result new file mode 100644 index 00000000000..9f6b7ca6a23 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result @@ -0,0 +1,23 @@ +call mtr.add_suppression("InnoDB: The total blob data length"); +SET GLOBAL max_allowed_packet = 100*1024*1024; +# Connection big_packets: +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); +start transaction; +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); +ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. +# Connection default: +# Quick shutdown and restart server +# Connection default: +SELECT a FROM t1; +a +1 +2 +3 +4 +5 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/innodb_bug34300.result b/mysql-test/suite/innodb/r/innodb_bug34300.result index bf07febca73..09fc0b44579 100644 --- a/mysql-test/suite/innodb/r/innodb_bug34300.result +++ b/mysql-test/suite/innodb/r/innodb_bug34300.result @@ -1,3 +1,3 @@ -ERROR 42000: Row size too large (> ####). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. +ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. f4 f8 f4 f8 diff --git a/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-test/suite/innodb/r/xa_recovery.result new file mode 100644 index 00000000000..84cb37ef7c9 --- /dev/null +++ b/mysql-test/suite/innodb/r/xa_recovery.result @@ -0,0 +1,17 @@ +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +XA START 'x'; +UPDATE t1 set a=2; +XA END 'x'; +XA PREPARE 'x'; +call mtr.add_suppression("Found 1 prepared XA transactions"); +SELECT * FROM t1 LOCK IN SHARE MODE; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t1; +a +2 +XA ROLLBACK 'x'; +SELECT * FROM t1; +a +1 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/binlog_consistent.test b/mysql-test/suite/innodb/t/binlog_consistent.test index 20023871093..a97bef4cf38 100644 --- a/mysql-test/suite/innodb/t/binlog_consistent.test +++ b/mysql-test/suite/innodb/t/binlog_consistent.test @@ -86,4 +86,36 @@ SHOW MASTER STATUS; --replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/ SHOW BINLOG EVENTS; -DROP TABLE t1,t2; + +--echo *** MDEV-7310: last_commit_pos_offset set to wrong value after binlog rotate in group commit *** + +SET @old_size= @@GLOBAL.max_binlog_size; +SET GLOBAL max_binlog_size=4096; + +CREATE TABLE t3 (a INT PRIMARY KEY, b VARBINARY(8192)) ENGINE=MyISAM; +INSERT INTO t3 VALUES (10, ''); +--let $bigdata= `SELECT REPEAT('a', 5000)` +eval INSERT INTO t3 VALUES (11, '$bigdata'); + +# The bug was that binlog_snapshot_file pointed to the new file after binlog +# rotation, but binlog_snapshot_position was the offset in the old file before +# binlog rotation. So the position was invalid. +# So here, we check that the values are consistent with SHOW MASTER STATUS, +# which uses a different code path and did not have the bug. + +--source include/wait_for_binlog_checkpoint.inc +--let $snap_file= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_file', Value, 1) +--let $snap_pos= query_get_value(SHOW STATUS LIKE 'binlog_snapshot_position', Value, 1) + +--let $master_file= query_get_value(SHOW MASTER STATUS, File, 1) +--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1) + +--disable_query_log +eval SET @errmsg= 'ERROR: ($snap_file, $snap_pos) != ($master_file, $master_pos)'; +eval SELECT IF('$snap_file' = '$master_file' AND $snap_pos = $master_pos, 'OK', @errmsg) AS test_result; +--enable_query_log + +SET GLOBAL max_binlog_size=@old_size; + + +DROP TABLE t1,t2, t3; diff --git a/mysql-test/suite/innodb/t/foreign-keys.test b/mysql-test/suite/innodb/t/foreign-keys.test index 8ee96347208..2d586e2d6be 100644 --- a/mysql-test/suite/innodb/t/foreign-keys.test +++ b/mysql-test/suite/innodb/t/foreign-keys.test @@ -1,11 +1,6 @@ --source include/have_innodb.inc --source include/have_debug.inc -if (`select plugin_auth_version <= "5.5.39-MariaDB-36.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.39-MariaDB-36.0 or earlier -} - --echo # --echo # Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE --echo # ADD FOREIGN KEY diff --git a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt deleted file mode 100644 index 9c2ee7846b6..00000000000 --- a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb-use-native-aio=0 diff --git a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test b/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test deleted file mode 100644 index adeb2ef9fd2..00000000000 --- a/mysql-test/suite/innodb/t/innodb-alter-table-disk-full.test +++ /dev/null @@ -1,50 +0,0 @@ -# MDEV-6288: Innodb causes server crash after disk full, then can't ALTER TABLE any more ---source include/have_innodb.inc ---source include/not_windows.inc ---source include/not_valgrind.inc ---source include/not_embedded.inc - -# DEBUG_SYNC must be compiled in. ---source include/have_debug_sync.inc - -create table t1(a int not null primary key, b int) engine=innodb; - -delimiter //; -create procedure innodb_insert_proc (repeat_count int) -begin - declare current_num int; - set current_num = 0; - while current_num < repeat_count do - insert into t1 values(current_num, current_num); - set current_num = current_num + 1; - end while; -end// -delimiter ;// -commit; - -set autocommit=0; -call innodb_insert_proc(10000); -commit; -set autocommit=1; - -# This caused crash earlier -set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28'; ---error 1114 -alter table t1 add testcol int; -show create table t1; - -# This caused crash earlier -set DEBUG_DBUG='+d,ib_os_aio_func_io_failure_28_2'; ---error 1114 -alter table t1 add testcol int; -show create table t1; - -set DEBUG_DBUG=NULL; -alter table t1 add testcol2 int; -show create table t1; - -select count(1) from t1; - -drop procedure innodb_insert_proc; -drop table t1; - diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test new file mode 100644 index 00000000000..ec1ea35f1cf --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test @@ -0,0 +1,75 @@ +# Not supported in embedded +--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 + +# InnoDB is required +--source include/have_innodb.inc + +--echo # +--echo # Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS +--echo # +--echo # Temporary tablename will be unique. This makes sure that future +--echo # in-place ALTERs of the same table will not be blocked due to +--echo # temporary tablename. + +let datadir= `select @@datadir`; + +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect + +--echo # Crash the server in ha_innobase::commit_inplace_alter_table() +CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; +SET debug='d,innodb_alter_commit_crash_before_commit'; + +let $orig_table_id = `SELECT table_id + FROM information_schema.innodb_sys_tables + WHERE name = 'test/t1'`; + +--echo # Write file to make mysql-test-run.pl expect crash +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Execute the statement that causes the crash +--error 2013 +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +--echo # Startup the server after the crash +--source include/start_mysqld.inc + +--echo # Read and remember the temporary table name +let $temp_table_name = `SELECT SUBSTRING(name,6) + FROM information_schema.innodb_sys_tables + WHERE name LIKE "test/#sql-ib$orig_table_id%"`; +# This second copy is an environment variable for the perl script below. +let temp_table_name = $temp_table_name; +show create table t1; +--echo # Consecutive Alter table does not create same temporary file name +ALTER TABLE t1 ADD PRIMARY KEY (f2, f1); +--echo # Shutdown the server to allow manual recovery +--source include/shutdown_mysqld.inc + +--echo # Manual recovery begin. The dictionary was not updated +--echo # and the files were not renamed. The rebuilt table +--echo # was left behind on purpose, to faciliate data recovery. + +perl; +my @frm_file = glob "$ENV{'datadir'}/test/#sql-*.frm"; +my $target_frm = "$ENV{'datadir'}/test/$ENV{'temp_table_name'}.frm"; +rename($frm_file[0], $target_frm); +EOF +--echo # Manual recovery end +--echo # Startup the server after manual recovery +--source include/start_mysqld.inc + +--echo # Drop the orphaned rebuilt table. +--disable_query_log +eval DROP TABLE `#mysql50#$temp_table_name`; +--enable_query_log +show create table t1; +drop table t1; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index fd40b50ebbc..a8dda12cadd 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -1,8 +1,3 @@ -if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier -} - --source include/have_innodb.inc # embedded server ignores 'delayed', so skip this -- source include/not_embedded.inc diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.opt b/mysql-test/suite/innodb/t/innodb-bigblob.opt new file mode 100644 index 00000000000..06cc9e2b979 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-bigblob.opt @@ -0,0 +1,2 @@ +--max-allowed-packet=128M +--innodb-log-file-size=210M diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.test b/mysql-test/suite/innodb/t/innodb-bigblob.test new file mode 100644 index 00000000000..7665c890316 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-bigblob.test @@ -0,0 +1,20 @@ +-- source include/have_innodb.inc +-- source include/big_test.inc +-- source include/not_embedded.inc + +--disable_query_log +let $status_orig=`SELECT @@innodb_status_output`; +--enable_query_log + +call mtr.add_suppression("Resizing redo log from *"); +call mtr.add_suppression("Starting to delete and rewrite log files."); +call mtr.add_suppression("New log files created, LSN=*"); + +create table foo (id varchar(37) not null, content longblob) engine=INNODB; +insert into foo (id, content) values('xyz', ''); +update foo set content=repeat('a', 43941888) where id='xyz'; +drop table foo; + +--disable_query_log +EVAL SET GLOBAL innodb_status_output = $status_orig; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb-fk.test b/mysql-test/suite/innodb/t/innodb-fk.test index 9839cd2d084..f7bcbe238dd 100644 --- a/mysql-test/suite/innodb/t/innodb-fk.test +++ b/mysql-test/suite/innodb/t/innodb-fk.test @@ -84,3 +84,106 @@ while ($i) drop table t1; +# +# MDEV-7672: Crash creating an InnoDB table with foreign keys +# + +CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + f1 int(11) DEFAULT NULL, + PRIMARY KEY (id), + CONSTRAINT fk1 FOREIGN KEY (f1) REFERENCES t1 (id) ON DELETE CASCADE +) ENGINE=InnoDB; + +--error 1005 +CREATE TABLE t2 ( + id int(11) NOT NULL AUTO_INCREMENT, + f2 int(11) NOT NULL, + f3 int(11) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE, + CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE +) ENGINE=InnoDB; + +show warnings; + +CREATE TABLE t2 ( + id int(11) NOT NULL AUTO_INCREMENT, + f2 int(11) NOT NULL, + f3 int(11) NOT NULL, + PRIMARY KEY (`id`), + CONSTRAINT fk2 FOREIGN KEY (f2) REFERENCES t1 (`id`) ON DELETE CASCADE +) ENGINE=InnoDB; + +--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/ +--error 1005 +ALTER TABLE t2 ADD CONSTRAINT fk3 FOREIGN KEY (f3) REFERENCES t3 (id) ON DELETE CASCADE; + +--replace_regex /#sql-[0-9_a-f-]*/#sql-temporary/ +show warnings; + +drop table t2; +drop table t1; + +# +# MDEV-7627: Some symbols in table name can cause to Error Code: 1050 when created FK +# + +CREATE TABLE `#departaments` ( + `id_depart` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id_depart`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +CREATE TABLE `#departaments_tree` ( + `id_depart` INT(10) UNSIGNED NOT NULL, + `id_depart_in` INT(10) UNSIGNED NOT NULL, + PRIMARY KEY (`id_depart`,`id_depart_in`), + CONSTRAINT `#departaments_tree_ibfk_1` FOREIGN KEY (`id_depart`) REFERENCES `#departaments` (`id_depart`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +ALTER TABLE `#departaments_tree` + ADD FOREIGN KEY (`id_depart_in`) REFERENCES `#departaments`(`id_depart`); + +SHOW CREATE TABLE `#departaments_tree`; + +DROP TABLE `#departaments_tree`; +DROP TABLE `#departaments`; + +CREATE TABLE `boroda` ( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `a` INT(11) UNSIGNED DEFAULT NULL, + `b` INT(11) UNSIGNED DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `a` (`a`), + CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +ALTER TABLE `boroda` + ADD FOREIGN KEY (`b`) REFERENCES `boroda`(`id`); + +ALTER TABLE `boroda` DROP FOREIGN KEY `boroda_ibfk_2`; + +RENAME TABLE `boroda` TO `#boroda`; + +ALTER TABLE `#boroda` +ADD FOREIGN KEY (`b`) REFERENCES `#boroda`(`id`); + +SHOW CREATE TABLE `#boroda`; +DROP TABLE `#boroda`; + +CREATE TABLE `boroda` ( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `a` INT(11) UNSIGNED DEFAULT NULL, + `b` INT(11) UNSIGNED DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `a` (`a`), + CONSTRAINT `boroda_ibfk_1` FOREIGN KEY (`a`) REFERENCES `boroda` (`id`) +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +RENAME TABLE `boroda` TO `bor#oda`; + +ALTER TABLE `bor#oda` +ADD FOREIGN KEY (`b`) REFERENCES `bor#oda`(`id`); + +SHOW CREATE TABLE `bor#oda`; +DROP TABLE `bor#oda`; diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7408.opt b/mysql-test/suite/innodb/t/innodb-mdev-7408.opt new file mode 100644 index 00000000000..1c256483e10 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-mdev-7408.opt @@ -0,0 +1,2 @@ +--innodb_ft_default_stopword + diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7408.test b/mysql-test/suite/innodb/t/innodb-mdev-7408.test new file mode 100644 index 00000000000..d1cd1879bb1 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-mdev-7408.test @@ -0,0 +1,16 @@ +--source include/have_innodb.inc + +select @@global.innodb_ft_server_stopword_table; +CREATE TABLE `stop_it-IT` ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD; +--error 1231 +SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT'; +--error 0,1231 +SET @@global.innodb_ft_server_stopword_table = 'test/stop_it@002dIT'; +drop table `stop_it-IT`; + +CREATE TABLE stop_it ENGINE = InnoDB SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD; +SET @@global.innodb_ft_server_stopword_table = 'test/stop_it'; + +SET @@global.innodb_ft_server_stopword_table = NULL; + +drop table stop_it; diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7513.test b/mysql-test/suite/innodb/t/innodb-mdev-7513.test new file mode 100644 index 00000000000..b929ea14781 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-mdev-7513.test @@ -0,0 +1,220 @@ +-- source include/have_innodb.inc +-- source include/not_embedded.inc + +# MDEV-7513: ib_warn_row_too_big dereferences null thd + +call mtr.add_suppression("Row size too large (> 8126)*"); + +--disable_warnings +CREATE TABLE t1 ( text1 TEXT, +text2 TEXT, +text3 TEXT, +text4 TEXT, +text5 TEXT, +text6 TEXT, +text7 TEXT, +text8 TEXT, +text9 TEXT, +text10 TEXT, +text11 TEXT, +text12 TEXT, +text13 TEXT, +text14 TEXT, +text15 TEXT, +text16 TEXT, +text17 TEXT, +text18 TEXT, +text19 TEXT, +text20 TEXT, +text21 TEXT, +text22 TEXT, +text23 TEXT, +text24 TEXT, +text25 TEXT, +text26 TEXT, +text27 TEXT, +text28 TEXT, +text29 TEXT, +text30 TEXT, +text31 TEXT, +text32 TEXT, +text33 TEXT, +text34 TEXT, +text35 TEXT, +text36 TEXT, +text37 TEXT, +text38 TEXT, +text39 TEXT, +text40 TEXT, +text41 TEXT, +text42 TEXT, +text43 TEXT, +text44 TEXT, +text45 TEXT, +text46 TEXT, +text47 TEXT, +text48 TEXT, +text49 TEXT, +text50 TEXT, +text51 TEXT, +text52 TEXT, +text53 TEXT, +text54 TEXT, +text55 TEXT, +text56 TEXT, +text57 TEXT, +text58 TEXT, +text59 TEXT, +text60 TEXT, +text61 TEXT, +text62 TEXT, +text63 TEXT, +text64 TEXT, +text65 TEXT, +text66 TEXT, +text67 TEXT, +text68 TEXT, +text69 TEXT, +text70 TEXT, +text71 TEXT, +text72 TEXT, +text73 TEXT, +text74 TEXT, +text75 TEXT, +text76 TEXT, +text77 TEXT, +text78 TEXT, +text79 TEXT, +text80 TEXT, +text81 TEXT, +text82 TEXT, +text83 TEXT, +text84 TEXT, +text85 TEXT, +text86 TEXT, +text87 TEXT, +text88 TEXT, +text89 TEXT, +text90 TEXT, +text91 TEXT, +text92 TEXT, +text93 TEXT, +text94 TEXT, +text95 TEXT, +text96 TEXT, +text97 TEXT, +text98 TEXT, +text99 TEXT, +text100 TEXT, +text101 TEXT, +text102 TEXT, +text103 TEXT, +text104 TEXT, +text105 TEXT, +text106 TEXT, +text107 TEXT, +text108 TEXT, +text109 TEXT, +text110 TEXT, +text111 TEXT, +text112 TEXT, +text113 TEXT, +text114 TEXT, +text115 TEXT, +text116 TEXT, +text117 TEXT, +text118 TEXT, +text119 TEXT, +text120 TEXT, +text121 TEXT, +text122 TEXT, +text123 TEXT, +text124 TEXT, +text125 TEXT, +text126 TEXT, +text127 TEXT, +text128 TEXT, +text129 TEXT, +text130 TEXT, +text131 TEXT, +text132 TEXT, +text133 TEXT, +text134 TEXT, +text135 TEXT, +text136 TEXT, +text137 TEXT, +text138 TEXT, +text139 TEXT, +text140 TEXT, +text141 TEXT, +text142 TEXT, +text143 TEXT, +text144 TEXT, +text145 TEXT, +text146 TEXT, +text147 TEXT, +text148 TEXT, +text149 TEXT, +text150 TEXT, +text151 TEXT, +text152 TEXT, +text153 TEXT, +text154 TEXT, +text155 TEXT, +text156 TEXT, +text157 TEXT, +text158 TEXT, +text159 TEXT, +text160 TEXT, +text161 TEXT, +text162 TEXT, +text163 TEXT, +text164 TEXT, +text165 TEXT, +text166 TEXT, +text167 TEXT, +text168 TEXT, +text169 TEXT, +text170 TEXT, +text171 TEXT, +text172 TEXT, +text173 TEXT, +text174 TEXT, +text175 TEXT, +text176 TEXT, +text177 TEXT, +text178 TEXT, +text179 TEXT, +text180 TEXT, +text181 TEXT, +text182 TEXT, +text183 TEXT, +text184 TEXT, +text185 TEXT, +text186 TEXT, +text187 TEXT, +text188 TEXT, +text189 TEXT, +text190 TEXT, +text191 TEXT, +text192 TEXT, +text193 TEXT, +text194 TEXT, +text195 TEXT, +text196 TEXT, +text197 TEXT +) ENGINE = InnoDB; + +INSERT INTO t1 VALUES ('abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef', 'abcdef'); +--enable_warnings + +DELETE FROM t1 WHERE text1 = 'abcdef'; + +--source include/restart_mysqld.inc + +--disable_warnings +SELECT * from t1; +--enable_warnings + +DROP TABLE t1; + diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index 4033f284e65..b4085228e02 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -1,5 +1,7 @@ --source include/have_innodb.inc --source include/have_partition.inc +# Test causes OS error printout +--source include/not_windows.inc --disable_query_log --disable_result_log diff --git a/mysql-test/suite/innodb/t/innodb-virtual-columns.test b/mysql-test/suite/innodb/t/innodb-virtual-columns.test new file mode 100644 index 00000000000..368c6fc8cb1 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-virtual-columns.test @@ -0,0 +1,302 @@ +--source include/have_innodb.inc + +# +# MDEV-7367: Updating a virtual column corrupts table which crashes server +# MySQL table columns contains virtual columns but InnoDB table +# definition does not. +# +CREATE TABLE IF NOT EXISTS gso_grad_supr ( + term char(4) NOT NULL DEFAULT '', + uw_id int(8) UNSIGNED NOT NULL DEFAULT 0, + plan varchar(10) NOT NULL DEFAULT '', + wdraw_rsn varchar(4) NOT NULL DEFAULT '', + admit_term char(4) NOT NULL DEFAULT '', + CONSTRAINT gso_grad_supr_pky PRIMARY KEY (uw_id, term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `gso_grad_supr` VALUES ('1031',2,'CSM','','1009'); +INSERT INTO `gso_grad_supr` VALUES ('1035',2,'CSM','ACAD','1009'); + +CREATE TABLE IF NOT EXISTS grad_degree ( + student_id int(8) UNSIGNED NOT NULL, + plan varchar(10) NOT NULL, + admit_term char(4) NOT NULL, + wdraw_rsn varchar(4) NOT NULL DEFAULT '', + ofis_deg_status varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' + ELSE 'Not Completed' + END) VIRTUAL, + deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', + deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', + CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn); +CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term); + +INSERT IGNORE grad_degree ( + student_id, + plan, + admit_term, + wdraw_rsn, + deg_start_term, + deg_as_of_term +) +SELECT + ggs.uw_id AS c_student_id, + ggs.plan, + ggs.admit_term, + ggs.wdraw_rsn, + IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term, + ggs.term AS c_as_of_term +FROM gso_grad_supr AS ggs +LEFT OUTER JOIN + grad_degree AS gd + ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +WHERE + ggs.term = 1031 AND + gd.student_id IS NULL +; + +UPDATE grad_degree AS gd +INNER JOIN + gso_grad_supr AS ggs + ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +SET + gd.wdraw_rsn = ggs.wdraw_rsn, + gd.deg_as_of_term = 1035 +WHERE + gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND + ggs.term = 1035 +; + +drop table grad_degree; + +# +# Test with more virtual columns so that MySQL table has +# more columns than InnoDB and index definition is out +# of number of actual InnoDB columns. +# +CREATE TABLE IF NOT EXISTS grad_degree ( + student_id int(8) UNSIGNED NOT NULL, + plan varchar(10) NOT NULL, + admit_term char(4) NOT NULL, + wdraw_rsn varchar(4) NOT NULL DEFAULT '', + ofis_deg_status varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' + ELSE 'Not Completed' + END) VIRTUAL, + ofis_deg_status2 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress2' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' + ELSE 'Not Completed2' + END) VIRTUAL, + ofis_deg_status3 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress3' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' + ELSE 'Not Completed3' + END) VIRTUAL, + ofis_deg_status4 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress4' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' + ELSE 'Not Completed4' + END) VIRTUAL, + ofis_deg_status5 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress5' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' + ELSE 'Not Completed5' + END) VIRTUAL, + ofis_deg_status6 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress6' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' + ELSE 'Not Completed6' + END) VIRTUAL, + ofis_deg_status7 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress7' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' + ELSE 'Not Completed7' + END) VIRTUAL, + ofis_deg_status8 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress8' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' + ELSE 'Not Completed8' + END) VIRTUAL, + deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', + deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', + CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn); +CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term); + +INSERT IGNORE grad_degree ( + student_id, + plan, + admit_term, + wdraw_rsn, + deg_start_term, + deg_as_of_term +) +SELECT + ggs.uw_id AS c_student_id, + ggs.plan, + ggs.admit_term, + ggs.wdraw_rsn, + IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term, + ggs.term AS c_as_of_term +FROM gso_grad_supr AS ggs +LEFT OUTER JOIN + grad_degree AS gd + ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +WHERE + ggs.term = 1031 AND + gd.student_id IS NULL +; + +UPDATE grad_degree AS gd +INNER JOIN + gso_grad_supr AS ggs + ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +SET + gd.wdraw_rsn = ggs.wdraw_rsn, + gd.deg_as_of_term = 1035 +WHERE + gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND + ggs.term = 1035 +; + +# +# Verify that indexes can be dropped +# +ALTER TABLE grad_degree DROP INDEX grad_degree_wdraw_rsn_ndx; + +# +# Verify that we can drop columns +# +ALTER TABLE grad_degree DROP COLUMN deg_start_term; + +SHOW CREATE TABLE grad_degree; + +DROP TABLE grad_degree; + +# +# Verify after dropping virtual columns +# +CREATE TABLE IF NOT EXISTS grad_degree ( + student_id int(8) UNSIGNED NOT NULL, + plan varchar(10) NOT NULL, + admit_term char(4) NOT NULL, + wdraw_rsn varchar(4) NOT NULL DEFAULT '', + ofis_deg_status varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed' + ELSE 'Not Completed' + END) VIRTUAL, + ofis_deg_status2 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress2' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed2' + ELSE 'Not Completed2' + END) VIRTUAL, + ofis_deg_status3 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress3' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed3' + ELSE 'Not Completed3' + END) VIRTUAL, + ofis_deg_status4 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress4' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed4' + ELSE 'Not Completed4' + END) VIRTUAL, + ofis_deg_status5 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress5' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed5' + ELSE 'Not Completed5' + END) VIRTUAL, + ofis_deg_status6 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress6' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed6' + ELSE 'Not Completed6' + END) VIRTUAL, + ofis_deg_status7 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress7' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed7' + ELSE 'Not Completed7' + END) VIRTUAL, + ofis_deg_status8 varchar(15) AS ( + CASE + WHEN wdraw_rsn = '' THEN 'In progress8' + WHEN wdraw_rsn = 'DCMP' OR wdraw_rsn = 'TRDC' THEN 'Completed8' + ELSE 'Not Completed8' + END) VIRTUAL, + deg_start_term char(4) NOT NULL DEFAULT '' COMMENT 'Educated guess at the beginning of the data', + deg_as_of_term char(4) NOT NULL COMMENT 'In most cases also end term', + CONSTRAINT grad_degree_stu_plan_admit_pky PRIMARY KEY (student_id, plan, admit_term) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE INDEX grad_degree_wdraw_rsn_ndx ON grad_degree (wdraw_rsn); + +ALTER TABLE grad_degree DROP COLUMN ofis_deg_status2, DROP COLUMN ofis_deg_status3, +DROP COLUMN ofis_deg_status4, DROP COLUMN ofis_deg_status5, DROP COLUMN ofis_deg_status6, +DROP COLUMN ofis_deg_status7, DROP COLUMN ofis_deg_status8; + +CREATE INDEX grad_degree_as_of_term_ndx ON grad_degree (deg_as_of_term); + +INSERT IGNORE grad_degree ( + student_id, + plan, + admit_term, + wdraw_rsn, + deg_start_term, + deg_as_of_term +) +SELECT + ggs.uw_id AS c_student_id, + ggs.plan, + ggs.admit_term, + ggs.wdraw_rsn, + IF( (SELECT COUNT(*) FROM grad_degree AS gd WHERE gd.student_id = ggs.uw_id AND gd.admit_term = ggs.admit_term) > 0, ggs.term, ggs.admit_term ) AS c_deg_start_term, + ggs.term AS c_as_of_term +FROM gso_grad_supr AS ggs +LEFT OUTER JOIN + grad_degree AS gd + ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +WHERE + ggs.term = 1031 AND + gd.student_id IS NULL +; + +UPDATE grad_degree AS gd +INNER JOIN + gso_grad_supr AS ggs + ON ( gd.student_id = ggs.uw_id AND gd.plan = ggs.plan AND gd.admit_term = ggs.admit_term ) +SET + gd.wdraw_rsn = ggs.wdraw_rsn, + gd.deg_as_of_term = 1035 +WHERE + gd.wdraw_rsn NOT IN ('DCMP', 'TRDC') AND + ggs.term = 1035 +; + +select * from grad_degree; +select * from gso_grad_supr; + +drop table grad_degree; +drop table gso_grad_supr; diff --git a/mysql-test/suite/innodb/t/innodb-xa.test b/mysql-test/suite/innodb/t/innodb-xa.test new file mode 100644 index 00000000000..d94cd75aa14 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-xa.test @@ -0,0 +1,17 @@ +--source include/have_innodb.inc + +--disable_abort_on_error +xa rollback 'xid2'; +drop table if exists t1; +create table t1(a int)engine=innodb; +rollback; +xa start 'xid2'; +insert into `t1` values (1); +savepoint `sv1`; +xa end 'xid2'; +start transaction; +xa prepare 'xid2'; +release savepoint `sv1`; +xa commit 'xid2'; +drop table t1; + diff --git a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test new file mode 100644 index 00000000000..16fb570737d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test @@ -0,0 +1,55 @@ +--source include/not_embedded.inc +--source include/not_crashrep.inc +--source include/have_innodb.inc + +call mtr.add_suppression("InnoDB: The total blob data length"); + +let $old_max_allowed_packet = `select @@max_allowed_packet`; +SET GLOBAL max_allowed_packet = 100*1024*1024; + +--echo # Connection big_packets: +connect(big_packets,localhost,root,,); +connection big_packets; + +CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB; + +# Insert a few rows (it doesn't really matter how many). These transactions +# are committed once they are acked, so they should not be lost. +INSERT INTO t1 (a, b) VALUES (1, '1'); +INSERT INTO t1 (a, b) VALUES (2, '2'); +INSERT INTO t1 (a, b) VALUES (3, '3'); +INSERT INTO t1 (a, b) VALUES (4, '4'); +INSERT INTO t1 (a, b) VALUES (5, '5'); + +# The BLOB insert will fail, and should disappear. However all data committed +# up to this point should not be lost. +start transaction; +--replace_regex /\(> [0-9]*\)/(> ####)/ +--error ER_TOO_BIG_ROWSIZE +INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024)); + +--echo # Connection default: +connection default; + +# We expect a restart. +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +--echo # Quick shutdown and restart server +--shutdown_server 0 + +# Wait for the server to come back up, and reconnect. +--enable_reconnect +--source include/wait_until_connected_again.inc + +--echo # Connection default: +connection default; + +# We should see (1,2,3,4,5) here. +SELECT a FROM t1; + +# Clean up. +DROP TABLE t1; + +--disable_query_log +eval set global max_allowed_packet = $old_max_allowed_packet; +--enable_query_log diff --git a/mysql-test/suite/innodb/t/innodb_bug34300.test b/mysql-test/suite/innodb/t/innodb_bug34300.test index 800f326707d..13c708b48d6 100644 --- a/mysql-test/suite/innodb/t/innodb_bug34300.test +++ b/mysql-test/suite/innodb/t/innodb_bug34300.test @@ -5,6 +5,11 @@ -- source include/have_innodb.inc +if (`select plugin_auth_version <= "5.6.22-MariaDB-72.0" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in XtraDB as of 5.6.22-MariaDB-72.0 or earlier +} + -- disable_query_log -- disable_result_log diff --git a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test index 12c560934ef..d6d77076b83 100644 --- a/mysql-test/suite/innodb/t/innodb_corrupt_bit.test +++ b/mysql-test/suite/innodb/t/innodb_corrupt_bit.test @@ -4,11 +4,6 @@ -- source include/have_innodb.inc -- source include/have_innodb_16k.inc -if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier -} - # Issues with innodb_change_buffering_debug on Windows, so the test scenario # cannot be created on windows --source include/not_windows.inc @@ -30,10 +25,10 @@ SET GLOBAL innodb_change_buffering_debug = 1; SET UNIQUE_CHECKS=0; CREATE DATABASE pad; -let $i=345; +let $i=338; while ($i) { - --eval CREATE TABLE pad.t$i (a INT PRIMARY KEY) ENGINE=InnoDB; +--eval CREATE TABLE pad.t$i(a INT PRIMARY KEY)ENGINE=InnoDB; dec $i; } diff --git a/mysql-test/suite/innodb/t/insert_debug.test b/mysql-test/suite/innodb/t/insert_debug.test index 666b634bef9..36ceba2ee8b 100644 --- a/mysql-test/suite/innodb/t/insert_debug.test +++ b/mysql-test/suite/innodb/t/insert_debug.test @@ -2,11 +2,6 @@ --source include/have_debug.inc --source include/have_partition.inc -if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier -} - --echo # --echo # Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1 --echo # CAUSES INFINITE PAGE SPLIT diff --git a/mysql-test/suite/innodb/t/sp_temp_table.test b/mysql-test/suite/innodb/t/sp_temp_table.test index 9a6be85fd7e..b2883f551b9 100644 --- a/mysql-test/suite/innodb/t/sp_temp_table.test +++ b/mysql-test/suite/innodb/t/sp_temp_table.test @@ -1,11 +1,6 @@ --source include/have_innodb.inc --source include/big_test.inc -if (`select plugin_auth_version < "5.6.22" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in InnoDB/XtraDB as of 5.6.21 or earlier -} - --echo # --echo # Bug #19306524 FAILING ASSERTION WITH TEMP TABLE FOR A PROCEDURE --echo # CALLED FROM A FUNCTION diff --git a/mysql-test/suite/innodb/t/strict_mode.test b/mysql-test/suite/innodb/t/strict_mode.test index 9b115091f84..86b56a09c0e 100644 --- a/mysql-test/suite/innodb/t/strict_mode.test +++ b/mysql-test/suite/innodb/t/strict_mode.test @@ -1,10 +1,5 @@ --source include/have_innodb.inc -if (`select plugin_auth_version <= "5.5.40-MariaDB-36.1" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.40-MariaDB-36.1 or earlier -} - --echo # --echo # Bug #17852083 PRINT A WARNING WHEN DDL HAS AN ERROR IN --echo # INNODB_STRICT_MODE = 1 diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test new file mode 100644 index 00000000000..837b33cb3c4 --- /dev/null +++ b/mysql-test/suite/innodb/t/xa_recovery.test @@ -0,0 +1,47 @@ +if (`select plugin_auth_version <= "5.6.24" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in InnoDB as of 5.6.24 or earlier +} +--source include/have_innodb.inc +# Embedded server does not support restarting. +--source include/not_embedded.inc + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +connect (con1,localhost,root); +XA START 'x'; UPDATE t1 set a=2; XA END 'x'; XA PREPARE 'x'; +connection default; + +call mtr.add_suppression("Found 1 prepared XA transactions"); + +# Kill and restart the server. +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- shutdown_server 0 +-- source include/wait_until_disconnected.inc + +-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +-- enable_reconnect +-- source include/wait_until_connected_again.inc +-- disable_reconnect + +disconnect con1; +connect (con1,localhost,root); +--send SELECT * FROM t1 LOCK IN SHARE MODE + +connection default; +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = 'Sending data' and + info = 'SELECT * FROM t1 LOCK IN SHARE MODE'; +--source include/wait_condition.inc + +--source include/restart_mysqld.inc + +disconnect con1; + +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT * FROM t1; +XA ROLLBACK 'x'; +SELECT * FROM t1; + +DROP TABLE t1; diff --git a/mysql-test/suite/manual/r/rpl_replication_delay.result b/mysql-test/suite/manual/r/rpl_replication_delay.result deleted file mode 100644 index 73dd77cc647..00000000000 --- a/mysql-test/suite/manual/r/rpl_replication_delay.result +++ /dev/null @@ -1,25 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; -# Second_behind reports 0 -Seconds_Behind_Master 0 -drop table if exists t1; -Warnings: -Note 1051 Unknown table 't1' -create table t1 (f1 int); -flush logs /* contaminate rli->last_master_timestamp */; -lock table t1 write; -insert into t1 values (1); -# bug emulated: reports slave threads starting time about 3*3 not 3 secs -Seconds_Behind_Master 9 -unlock tables; -flush logs /* this time rli->last_master_timestamp is not affected */; -lock table t1 write; -insert into t1 values (2); -# reports the correct diff with master query time about 3+3 secs -Seconds_Behind_Master 7 -unlock tables; -drop table t1; diff --git a/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt b/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt deleted file mode 100644 index 24a4c5952fe..00000000000 --- a/mysql-test/suite/manual/t/rpl_replication_delay-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-debug=d,let_first_flush_log_change_timestamp diff --git a/mysql-test/suite/manual/t/rpl_replication_delay.test b/mysql-test/suite/manual/t/rpl_replication_delay.test deleted file mode 100644 index f2b2da6f53c..00000000000 --- a/mysql-test/suite/manual/t/rpl_replication_delay.test +++ /dev/null @@ -1,63 +0,0 @@ -# -# Testing replication delay reporting (bug#29309) -# there is an unavoidable non-determinism in the test -# please compare the results with the comments -# - - -source include/master-slave.inc; - -connection slave; - ---echo # Second_behind reports 0 -let $status_items= Seconds_Behind_Master; -source include/show_slave_status.inc; -sleep 3; - -### bug emulation - -connection master; -drop table if exists t1; -create table t1 (f1 int); -sleep 3; - -#connection slave; -sync_slave_with_master; -flush logs /* contaminate rli->last_master_timestamp */; - -connection slave; -lock table t1 write; - -connection master; -insert into t1 values (1); - -sleep 3; - -connection slave; ---echo # bug emulated: reports slave threads starting time about 3*3 not 3 secs -source include/show_slave_status.inc; -unlock tables; - -connection master; -sync_slave_with_master; - -### bugfix - - -connection slave; -flush logs /* this time rli->last_master_timestamp is not affected */; -lock table t1 write; - -connection master; -insert into t1 values (2); -sleep 3; - -connection slave; ---echo # reports the correct diff with master query time about 3+3 secs -source include/show_slave_status.inc; -unlock tables; - -connection master; -drop table t1; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/maria/optimize.result b/mysql-test/suite/maria/optimize.result index 9cce55d6199..a78e8e469aa 100644 --- a/mysql-test/suite/maria/optimize.result +++ b/mysql-test/suite/maria/optimize.result @@ -6,3 +6,14 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK drop table t1; +# +# MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +# disabled keys +# +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +DROP TABLE t1; diff --git a/mysql-test/suite/maria/optimize.test b/mysql-test/suite/maria/optimize.test index 6b310b1d1a6..b1fc250cd29 100644 --- a/mysql-test/suite/maria/optimize.test +++ b/mysql-test/suite/maria/optimize.test @@ -160,3 +160,13 @@ INSERT /*! IGNORE */ INTO t1 VALUES ('urxjxqvwabikpugvexxbxdpxjkeqiuhhuadbcuhoz check table t1; OPTIMIZE TABLE t1; drop table t1; + +--echo # +--echo # MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +--echo # disabled keys +--echo # +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=Aria; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +DROP TABLE t1; diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result index 94677e84cc8..d9689f759bf 100644 --- a/mysql-test/suite/multi_source/multisource.result +++ b/mysql-test/suite/multi_source/multisource.result @@ -9,15 +9,36 @@ master_user='root'; start slave 'master1'; set default_master_connection = 'master1'; include/wait_for_slave_to_start.inc -show slave 'master1' status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos -Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No -show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos -Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No -show all slaves status; -Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos -master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 313 mysqld-relay-bin-master1.000002 601 master-bin.000001 Yes Yes 0 0 313 907 None 0 No 0 No 0 0 1 No 0 1073741824 7 0 60.000 +# +# Checking SHOW SLAVE 'master1' STATUS +# +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' +# +# Checking SHOW SLAVE STATUS +# +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' +# +# Checking SHOW ALL SLAVES STATUS +# +Connection_name = 'master1' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_SQL_Errno = '0' +Slave_heartbeat_period = '60.000' +# drop database if exists db1; create database db1; use db1; @@ -74,10 +95,26 @@ master_host='127.0.0.1', master_user='root'; start slave; include/wait_for_slave_to_start.inc -show all slaves status; -Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos - Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 313 mysqld-relay-bin.000002 601 master-bin.000001 Yes Yes 0 0 313 899 None 0 No 0 No 0 0 2 No 0 1073741824 7 0 60.000 0-1-4 -master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 988 mysqld-relay-bin-master1.000002 1276 master-bin.000001 Yes Yes 0 0 988 1582 None 0 No 0 No 0 0 1 No 0 1073741824 17 0 60.000 0-1-4 +# +# Checking SHOW ALL SLAVES STATUS +# +Connection_name = '' +Connection_name = 'master1' +Master_Port = 'MYPORT_2' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin.000002' +Relay_Log_File = 'mysqld-relay-bin-master1.000002' +Slave_IO_Running = 'Yes' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_Errno = '0' +Last_SQL_Errno = '0' +Last_SQL_Errno = '0' +Slave_heartbeat_period = '60.000' +Slave_heartbeat_period = '60.000' +# insert into t1 (f1) values ('three'); drop database if exists db2; create database db2; @@ -104,10 +141,26 @@ Log_name File_size master-bin.000002 367 insert into t1 (f1) values ('four'); create table db1.t3 (f1 int) engine=InnoDB; -show all slaves status; -Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos - Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 921 mysqld-relay-bin.000002 1209 master-bin.000001 Yes Yes 0 0 921 1507 None 0 No 0 No 0 0 2 No 0 1073741824 17 0 60.000 0-1-7 -master1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000002 740 mysqld-relay-bin-master1.000004 1028 master-bin.000002 Yes Yes 0 0 740 1378 None 0 No 0 No 0 0 1 No 0 1073741824 37 0 60.000 0-1-7 +# +# Checking SHOW ALL SLAVES STATUS +# +Connection_name = '' +Connection_name = 'master1' +Master_Port = 'MYPORT_2' +Master_Port = 'MYPORT_1' +Relay_Log_File = 'mysqld-relay-bin.000002' +Relay_Log_File = 'mysqld-relay-bin-master1.000004' +Slave_IO_Running = 'Yes' +Slave_IO_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Slave_SQL_Running = 'Yes' +Last_Errno = '0' +Last_Errno = '0' +Last_SQL_Errno = '0' +Last_SQL_Errno = '0' +Slave_heartbeat_period = '60.000' +Slave_heartbeat_period = '60.000' +# select * from db1.t1; i f1 1 one diff --git a/mysql-test/suite/multi_source/multisource.test b/mysql-test/suite/multi_source/multisource.test index 754dc9fa650..c99db802981 100644 --- a/mysql-test/suite/multi_source/multisource.test +++ b/mysql-test/suite/multi_source/multisource.test @@ -49,12 +49,28 @@ let $field= Slave_IO_State; let $condition= = 'Waiting for master to send event'; --source include/wait_show_condition.inc ---replace_result $SERVER_MYPORT_1 MYPORT_1 -show slave 'master1' status; ---replace_result $SERVER_MYPORT_1 MYPORT_1 -show slave status; ---replace_result $SERVER_MYPORT_1 MYPORT_1 -show all slaves status; +--echo # +--echo # Checking SHOW SLAVE 'master1' STATUS +--echo # +--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ +--let $slave_name= 'master1' +--source include/show_slave_status.inc +--let $slave_name= + +--echo # +--echo # Checking SHOW SLAVE STATUS +--echo # +--source include/show_slave_status.inc + +--echo # +--echo # Checking SHOW ALL SLAVES STATUS +--echo # +--let $all_slaves_status= 1 +--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period +--source include/show_slave_status.inc +--let $all_slaves_status= +--echo # # Check that replication actually works @@ -144,8 +160,15 @@ let $field= Slave_IO_State; let $condition= = 'Waiting for master to send event'; --source include/wait_show_condition.inc ---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 -show all slaves status; +--echo # +--echo # Checking SHOW ALL SLAVES STATUS +--echo # +--let $all_slaves_status= 1 +--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/ +--source include/show_slave_status.inc +--let $all_slaves_status= +--echo # # Check that replication from two servers actually works @@ -214,8 +237,15 @@ let $field= Slave_IO_State; let $condition= = 'Waiting for master to send event'; --source include/wait_show_condition.inc ---replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 -show all slaves status; +--echo # +--echo # Checking SHOW ALL SLAVES STATUS +--echo # +--let $all_slaves_status= 1 +--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period +--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/ +--source include/show_slave_status.inc +--let $all_slaves_status= +--echo # --sorted_result select * from db1.t1; diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result index 268db30bda0..77129d6bebb 100644 --- a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result +++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result @@ -58,7 +58,10 @@ t1.frm t1.par SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; -SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION, +PARTITION_DESCRIPTION, TABLE_ROWS +FROM INFORMATION_SCHEMA.PARTITIONS +WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; SET DEBUG_SYNC = 'now WAIT_FOR parked'; # When waiting for the name lock in get_all_tables in sql_show.cc # this will not be concurrent any more, thus the TIMEOUT @@ -70,9 +73,9 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO PARTITION p10 VALUES LESS THAN MAXVALUE); Warnings: Warning 1639 debug sync point wait timed out -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -def test t1 p0 NULL 1 NULL RANGE NULL a NULL 10 1 16384 16384 NULL 0 0 NULL NULL NULL NULL default NULL -def test t1 p10 NULL 2 NULL RANGE NULL a NULL MAXVALUE 3 5461 16384 NULL 0 0 NULL NULL NULL NULL default NULL +TABLE_SCHEMA TABLE_NAME PARTITION_NAME PARTITION_ORDINAL_POSITION PARTITION_DESCRIPTION TABLE_ROWS +test t1 p0 1 10 1 +test t1 p10 2 MAXVALUE 3 t1#P#p0.ibd t1#P#p10.ibd t1.frm diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test index fce26132030..df9c06011c2 100644 --- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test +++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test @@ -62,7 +62,10 @@ SHOW CREATE TABLE t1; SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open'; SET DEBUG_SYNC='partition_open_error SIGNAL alter WAIT_FOR finish'; send -SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION, + PARTITION_DESCRIPTION, TABLE_ROWS +FROM INFORMATION_SCHEMA.PARTITIONS +WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; connect (con1, localhost, root,,); SET DEBUG_SYNC = 'now WAIT_FOR parked'; diff --git a/mysql-test/suite/percona/innodb_sys_index.result b/mysql-test/suite/percona/innodb_sys_index.result index 67604236366..7573720f5ee 100644 --- a/mysql-test/suite/percona/innodb_sys_index.result +++ b/mysql-test/suite/percona/innodb_sys_index.result @@ -1,9 +1,6 @@ drop table if exists t1; Warnings: Note 1051 Unknown table 'test.t1' -select @@version_comment limit 1 ; -@@version_comment -Source distribution SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ; CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ; SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ; diff --git a/mysql-test/suite/percona/innodb_sys_index.test b/mysql-test/suite/percona/innodb_sys_index.test index 212baeda663..d8c22e7f5f9 100644 --- a/mysql-test/suite/percona/innodb_sys_index.test +++ b/mysql-test/suite/percona/innodb_sys_index.test @@ -5,7 +5,6 @@ drop table if exists t1; # # test for bug LP#875797 "Using 'innodb_sys_indexes' causes core dump" # -select @@version_comment limit 1 ; --disable_result_log SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ; CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ; diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.result b/mysql-test/suite/percona/percona_innodb_fake_changes.result index 95f0c07cd11..1b870fdbb92 100644 --- a/mysql-test/suite/percona/percona_innodb_fake_changes.result +++ b/mysql-test/suite/percona/percona_innodb_fake_changes.result @@ -45,7 +45,7 @@ BEGIN; CREATE TABLE t2 (a INT) ENGINE=InnoDB; ERROR HY000: Can't create table `test`.`t2` (errno: 131 "Command not supported by database") DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' +ERROR HY000: Storage engine InnoDB of the table `test`.`t1` doesn't have this option TRUNCATE TABLE t1; ERROR HY000: Got error 131 "Command not supported by database" during COMMIT ALTER TABLE t1 ENGINE=MyISAM; diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes.test b/mysql-test/suite/percona/percona_innodb_fake_changes.test index 5fa3ecc7b63..67f5450ba45 100644 --- a/mysql-test/suite/percona/percona_innodb_fake_changes.test +++ b/mysql-test/suite/percona/percona_innodb_fake_changes.test @@ -38,7 +38,7 @@ SET innodb_fake_changes=1; BEGIN; --error 1005 CREATE TABLE t2 (a INT) ENGINE=InnoDB; ---error 1051 +--error 1031 DROP TABLE t1; --error 1180 TRUNCATE TABLE t1; diff --git a/mysql-test/suite/perfschema/include/connection_setup.inc b/mysql-test/suite/perfschema/include/connection_setup.inc index da57b6dd388..a661d43d063 100644 --- a/mysql-test/suite/perfschema/include/connection_setup.inc +++ b/mysql-test/suite/perfschema/include/connection_setup.inc @@ -48,7 +48,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/digest_setup.inc b/mysql-test/suite/perfschema/include/digest_setup.inc index ed463f58d04..6efab880d32 100644 --- a/mysql-test/suite/perfschema/include/digest_setup.inc +++ b/mysql-test/suite/perfschema/include/digest_setup.inc @@ -1,5 +1,5 @@ # Making sure not to run when ps-protocol is set. ---source ../include/no_protocol.inc +--source include/no_protocol.inc --echo #################################### --echo # SETUP diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc index 769ba5f8607..ec35e60d463 100644 --- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc @@ -62,7 +62,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/sizing_auto.inc b/mysql-test/suite/perfschema/include/sizing_auto.inc index 4c3451ce8b5..3bb4db2276f 100644 --- a/mysql-test/suite/perfschema/include/sizing_auto.inc +++ b/mysql-test/suite/perfschema/include/sizing_auto.inc @@ -4,13 +4,21 @@ show variables like "table_open_cache"; show variables like "max_connections"; # open_files_limit depends on OS configuration (ulimit -n) #show variables like "open_files_limit"; -show variables like "%performance_schema%"; +show variables where + `Variable_name` != "performance_schema_max_statement_classes" and + `Variable_name` like "performance_schema%"; show status like "%performance_schema%"; # Each test script should provide a different test.cnf file, # with different settings. # This output will show the sizes computed automatically. # Note that this output is very dependent on the platform. +# The output of SHOW ENGINE PERFORMANCE_SCHEMA STATUS +# is very dependent on the platform, +# so it is not printed here to ensure stability of the .results files. +# To troubleshoot the performance schema memory consumption at different +# configuration settings, comment the following line. +# Debug only: -show engine performance_schema status; +# show engine performance_schema status; diff --git a/mysql-test/suite/perfschema/include/socket_event.inc b/mysql-test/suite/perfschema/include/socket_event.inc index ba81c37d5df..96c61045986 100644 --- a/mysql-test/suite/perfschema/include/socket_event.inc +++ b/mysql-test/suite/perfschema/include/socket_event.inc @@ -126,7 +126,7 @@ if($is_connect) # Connect is visible. # We hope that sleep 1 is long enough so that PERFORMANCE_SCHEMA # can remove this row before we collect the after action state. - let $wait_timeou= 5; + let $wait_timeout= 5; let $wait_condition= SELECT COUNT(*) = 0 $part; diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc index 3558e43652e..639b1df8c02 100644 --- a/mysql-test/suite/perfschema/include/stage_setup.inc +++ b/mysql-test/suite/perfschema/include/stage_setup.inc @@ -24,7 +24,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc index d15c3d48ded..41dcfd8ecb5 100644 --- a/mysql-test/suite/perfschema/include/start_server_common.inc +++ b/mysql-test/suite/perfschema/include/start_server_common.inc @@ -68,7 +68,9 @@ select * from performance_schema.users; --enable_result_log # This has a stable output, printing the result: -show variables like "performance_schema%"; +show variables where + `Variable_name` != "performance_schema_max_statement_classes" and + `Variable_name` like "performance_schema%"; # This has an unrepeatable output, it does depends too much on # - the platform hardware (sizeof structures, padding) diff --git a/mysql-test/suite/perfschema/include/table_aggregate_load.inc b/mysql-test/suite/perfschema/include/table_aggregate_load.inc index 242768ead9e..f42ebe1fc76 100644 --- a/mysql-test/suite/perfschema/include/table_aggregate_load.inc +++ b/mysql-test/suite/perfschema/include/table_aggregate_load.inc @@ -29,7 +29,9 @@ truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; # Check the configuration is ok -show variables like "performance_schema%"; +show variables where + `Variable_name` != "performance_schema_max_statement_classes" and + `Variable_name` like "performance_schema%"; show status like "performance_schema%"; echo "================== Step 1 =================="; diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc index 8efdc8d2f24..522cdb9346d 100644 --- a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc @@ -67,7 +67,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result index ab927f544cf..c8fa1cc2b24 100644 --- a/mysql-test/suite/perfschema/r/aggregate.result +++ b/mysql-test/suite/perfschema/r/aggregate.result @@ -1,4 +1,6 @@ "General cleanup" +set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval; +set @@global.aria_checkpoint_interval= 0; drop table if exists t1; update performance_schema.setup_instruments set enabled = 'NO'; update performance_schema.setup_consumers set enabled = 'NO'; @@ -116,3 +118,4 @@ update performance_schema.setup_consumers set enabled = 'YES'; update performance_schema.setup_instruments set enabled = 'YES', timed = 'YES'; drop table test.t1; +set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save; diff --git a/mysql-test/suite/perfschema/r/digest_null_literal.result b/mysql-test/suite/perfschema/r/digest_null_literal.result new file mode 100644 index 00000000000..b0cefbbbaaf --- /dev/null +++ b/mysql-test/suite/perfschema/r/digest_null_literal.result @@ -0,0 +1,27 @@ +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; +NULL +NULL +NULL +NULL +NULL NULL +NULL NULL +NULL NULL NULL 1 2 3 NULL NULL +NULL NULL NULL 1 2 3 NULL NULL +1 IS NULL +0 +2 IS NOT NULL +1 +1 IS NULL 2 IS NULL 3 IS NOT NULL 4 IS NOT NULL +0 0 1 1 +SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR +FROM performance_schema.events_statements_summary_by_digest; +SCHEMA_NAME DIGEST_TEXT COUNT_STAR +test TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 +test SELECT ? 1 +test SELECT ? FROM DUAL 1 +test SELECT ?, ... 2 +test SELECT ? IS NULL 1 +test SELECT ? IS NOT NULL 1 +test SELECT ? IS NULL , ? IS NULL , ? IS NOT NULL , ? IS NOT NULL 1 +test CREATE TABLE foo ( a INTEGER DEFAULT ? , b INTEGER NOT NULL DEFAULT ? , c INTEGER NOT NULL ) 1 +test DROP TABLE foo 1 diff --git a/mysql-test/suite/perfschema/r/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result index 9c0efb7b1ca..d910f29c91e 100644 --- a/mysql-test/suite/perfschema/r/digest_table_full.result +++ b/mysql-test/suite/perfschema/r/digest_table_full.result @@ -113,7 +113,7 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARN SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS NULL NULL NULL 55 32 1 2 -statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 +statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 SHOW VARIABLES LIKE "performance_schema_digests_size"; Variable_name Value performance_schema_digests_size 2 diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result index dafce4bf573..9081bfe5882 100644 --- a/mysql-test/suite/perfschema/r/ortho_iter.result +++ b/mysql-test/suite/perfschema/r/ortho_iter.result @@ -94,7 +94,9 @@ close pfs_cursor; signal sqlstate '01000' set message_text='Done', mysql_errno=12000; end $ -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -118,7 +120,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 @@ -127,31 +128,6 @@ performance_schema_session_connect_attrs_size 2048 performance_schema_setup_actors_size 100 performance_schema_setup_objects_size 100 performance_schema_users_size 100 -show status like "performance_schema%"; -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 call check_instrument("wait/synch/mutex/"); instr_name is_wait is_stage is_statement wait/synch/mutex/ 1 0 0 diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index 838d17e61fe..126b2a58fae 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -22,7 +22,9 @@ flush privileges; insert into test.marker set a = 1; insert into test.marker set a = 1; insert into test.marker set a = 1; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -46,7 +48,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/rpl_gtid_func.result b/mysql-test/suite/perfschema/r/rpl_gtid_func.result index 98342bc4869..bfe4e08a3c1 100644 --- a/mysql-test/suite/perfschema/r/rpl_gtid_func.result +++ b/mysql-test/suite/perfschema/r/rpl_gtid_func.result @@ -37,7 +37,7 @@ select digest, digest_text, count_star from performance_schema.events_statements_summary_by_digest where digest_text like "%in_%_digest%"; digest digest_text count_star -e315485f9cbc06befb4e59970905a034 SELECT ? AS in_master_digest 1 +f1cd3e758822a4ef0e1502ec30818476 SELECT ? AS in_master_digest 1 insert into test.marker values (2); **** On Slave **** select * from test.marker; @@ -64,7 +64,7 @@ select digest, digest_text, count_star from performance_schema.events_statements_summary_by_digest where digest_text like "%in_%_digest%"; digest digest_text count_star -bd2f53b41efcd037df41a3dd8bf3312a SELECT ? AS in_slave_digest 1 +c1cef2eb67ca48bb5d81d2e5e68aaf35 SELECT ? AS in_slave_digest 1 **** On Master **** delete from performance_schema.setup_objects where object_schema='master'; diff --git a/mysql-test/suite/perfschema/r/sizing_default.result b/mysql-test/suite/perfschema/r/sizing_default.result index ef7f7069c19..d7c4e321204 100644 --- a/mysql-test/suite/perfschema/r/sizing_default.result +++ b/mysql-test/suite/perfschema/r/sizing_default.result @@ -7,7 +7,9 @@ table_open_cache 2000 show variables like "max_connections"; Variable_name Value max_connections 151 -show variables like "%performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 9102 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 322 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 168 performance_schema_max_table_handles 4000 performance_schema_max_table_instances 12500 performance_schema_max_thread_classes 50 @@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0 Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 -show engine performance_schema status; -Type Name Status -performance_schema events_waits_current.row_size 184 -performance_schema events_waits_current.row_count 2412 -performance_schema events_waits_history.row_size 184 -performance_schema events_waits_history.row_count 4020 -performance_schema events_waits_history.memory 739680 -performance_schema events_waits_history_long.row_size 184 -performance_schema events_waits_history_long.row_count 10000 -performance_schema events_waits_history_long.memory 1840000 -performance_schema (pfs_mutex_class).row_size 256 -performance_schema (pfs_mutex_class).row_count 200 -performance_schema (pfs_mutex_class).memory 51200 -performance_schema (pfs_rwlock_class).row_size 320 -performance_schema (pfs_rwlock_class).row_count 40 -performance_schema (pfs_rwlock_class).memory 12800 -performance_schema (pfs_cond_class).row_size 256 -performance_schema (pfs_cond_class).row_count 80 -performance_schema (pfs_cond_class).memory 20480 -performance_schema (pfs_thread_class).row_size 192 -performance_schema (pfs_thread_class).row_count 50 -performance_schema (pfs_thread_class).memory 9600 -performance_schema (pfs_file_class).row_size 320 -performance_schema (pfs_file_class).row_count 50 -performance_schema (pfs_file_class).memory 16000 -performance_schema mutex_instances.row_size 128 -performance_schema mutex_instances.row_count 15906 -performance_schema mutex_instances.memory 2035968 -performance_schema rwlock_instances.row_size 192 -performance_schema rwlock_instances.row_count 9102 -performance_schema rwlock_instances.memory 1747584 -performance_schema cond_instances.row_size 128 -performance_schema cond_instances.row_count 3504 -performance_schema cond_instances.memory 448512 -performance_schema threads.row_size 2816 -performance_schema threads.row_count 402 -performance_schema threads.memory 1132032 -performance_schema file_instances.row_size 704 -performance_schema file_instances.row_count 7693 -performance_schema file_instances.memory 5415872 -performance_schema (pfs_file_handle).row_size 8 -performance_schema (pfs_file_handle).row_count 32768 -performance_schema (pfs_file_handle).memory 262144 -performance_schema events_waits_summary_by_thread_by_event_name.row_size 32 -performance_schema events_waits_summary_by_thread_by_event_name.row_count 153966 -performance_schema events_waits_summary_by_thread_by_event_name.memory 4926912 -performance_schema (pfs_table_share).row_size 22208 -performance_schema (pfs_table_share).row_count 12500 -performance_schema (pfs_table_share).memory 277600000 -performance_schema (pfs_table).row_size 9280 -performance_schema (pfs_table).row_count 4000 -performance_schema (pfs_table).memory 37120000 -performance_schema setup_actors.row_size 256 -performance_schema setup_actors.row_count 100 -performance_schema setup_actors.memory 25600 -performance_schema setup_objects.row_size 448 -performance_schema setup_objects.row_count 100 -performance_schema setup_objects.memory 44800 -performance_schema (pfs_account).row_size 256 -performance_schema (pfs_account).row_count 100 -performance_schema (pfs_account).memory 25600 -performance_schema events_waits_summary_by_account_by_event_name.row_size 32 -performance_schema events_waits_summary_by_account_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_account_by_event_name.memory 1225600 -performance_schema events_waits_summary_by_user_by_event_name.row_size 32 -performance_schema events_waits_summary_by_user_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_user_by_event_name.memory 1225600 -performance_schema events_waits_summary_by_host_by_event_name.row_size 32 -performance_schema events_waits_summary_by_host_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_host_by_event_name.memory 1225600 -performance_schema (pfs_user).row_size 128 -performance_schema (pfs_user).row_count 100 -performance_schema (pfs_user).memory 12800 -performance_schema (pfs_host).row_size 128 -performance_schema (pfs_host).row_count 100 -performance_schema (pfs_host).memory 12800 -performance_schema (pfs_stage_class).row_size 256 -performance_schema (pfs_stage_class).row_count 150 -performance_schema (pfs_stage_class).memory 38400 -performance_schema events_stages_history.row_size 88 -performance_schema events_stages_history.row_count 4020 -performance_schema events_stages_history.memory 353760 -performance_schema events_stages_history_long.row_size 88 -performance_schema events_stages_history_long.row_count 10000 -performance_schema events_stages_history_long.memory 880000 -performance_schema events_stages_summary_by_thread_by_event_name.row_size 32 -performance_schema events_stages_summary_by_thread_by_event_name.row_count 60300 -performance_schema events_stages_summary_by_thread_by_event_name.memory 1929600 -performance_schema events_stages_summary_global_by_event_name.row_size 32 -performance_schema events_stages_summary_global_by_event_name.row_count 150 -performance_schema events_stages_summary_global_by_event_name.memory 4800 -performance_schema events_stages_summary_by_account_by_event_name.row_size 32 -performance_schema events_stages_summary_by_account_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_account_by_event_name.memory 480000 -performance_schema events_stages_summary_by_user_by_event_name.row_size 32 -performance_schema events_stages_summary_by_user_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_user_by_event_name.memory 480000 -performance_schema events_stages_summary_by_host_by_event_name.row_size 32 -performance_schema events_stages_summary_by_host_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_host_by_event_name.memory 480000 -performance_schema (pfs_statement_class).row_size 192 -performance_schema (pfs_statement_class).row_count 168 -performance_schema (pfs_statement_class).memory 32256 -performance_schema events_statements_history.row_size 3024 -performance_schema events_statements_history.row_count 4020 -performance_schema events_statements_history.memory 12156480 -performance_schema events_statements_history_long.row_size 3024 -performance_schema events_statements_history_long.row_count 10000 -performance_schema events_statements_history_long.memory 30240000 -performance_schema events_statements_summary_by_thread_by_event_name.row_size 184 -performance_schema events_statements_summary_by_thread_by_event_name.row_count 67536 -performance_schema events_statements_summary_by_thread_by_event_name.memory 12426624 -performance_schema events_statements_summary_global_by_event_name.row_size 184 -performance_schema events_statements_summary_global_by_event_name.row_count 168 -performance_schema events_statements_summary_global_by_event_name.memory 30912 -performance_schema events_statements_summary_by_account_by_event_name.row_size 184 -performance_schema events_statements_summary_by_account_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_account_by_event_name.memory 3091200 -performance_schema events_statements_summary_by_user_by_event_name.row_size 184 -performance_schema events_statements_summary_by_user_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_user_by_event_name.memory 3091200 -performance_schema events_statements_summary_by_host_by_event_name.row_size 184 -performance_schema events_statements_summary_by_host_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_host_by_event_name.memory 3091200 -performance_schema events_statements_current.row_size 3024 -performance_schema events_statements_current.row_count 402 -performance_schema events_statements_current.memory 1215648 -performance_schema (pfs_socket_class).row_size 320 -performance_schema (pfs_socket_class).row_count 10 -performance_schema (pfs_socket_class).memory 3200 -performance_schema socket_instances.row_size 320 -performance_schema socket_instances.row_count 322 -performance_schema socket_instances.memory 103040 -performance_schema events_statements_summary_by_digest.row_size 1472 -performance_schema events_statements_summary_by_digest.row_count 10000 -performance_schema events_statements_summary_by_digest.memory 14720000 -performance_schema session_connect_attrs.row_size 402 -performance_schema session_connect_attrs.row_count 512 -performance_schema session_connect_attrs.memory 205824 -performance_schema (account_hash).count 2 -performance_schema (account_hash).size 100 -performance_schema (digest_hash).count 0 -performance_schema (digest_hash).size 10000 -performance_schema (filename_hash).count 0 -performance_schema (filename_hash).size 7693 -performance_schema (host_hash).count 2 -performance_schema (host_hash).size 100 -performance_schema (setup_actor_hash).count 1 -performance_schema (setup_actor_hash).size 100 -performance_schema (setup_object_hash).count 4 -performance_schema (setup_object_hash).size 100 -performance_schema (table_share_hash).count 80 -performance_schema (table_share_hash).size 12500 -performance_schema (user_hash).count 2 -performance_schema (user_hash).size 100 -performance_schema host_cache.size 336 -performance_schema performance_schema.memory 422231328 diff --git a/mysql-test/suite/perfschema/r/sizing_high.result b/mysql-test/suite/perfschema/r/sizing_high.result index 4d63c970782..c7c7b065992 100644 --- a/mysql-test/suite/perfschema/r/sizing_high.result +++ b/mysql-test/suite/perfschema/r/sizing_high.result @@ -7,7 +7,9 @@ table_open_cache 400 show variables like "max_connections"; Variable_name Value max_connections 200 -show variables like "%performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 30800 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 420 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 168 performance_schema_max_table_handles 800 performance_schema_max_table_instances 12500 performance_schema_max_thread_classes 50 @@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0 Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 -show engine performance_schema status; -Type Name Status -performance_schema events_waits_current.row_size 184 -performance_schema events_waits_current.row_count 3000 -performance_schema events_waits_history.row_size 184 -performance_schema events_waits_history.row_count 5000 -performance_schema events_waits_history.memory 920000 -performance_schema events_waits_history_long.row_size 184 -performance_schema events_waits_history_long.row_count 10000 -performance_schema events_waits_history_long.memory 1840000 -performance_schema (pfs_mutex_class).row_size 256 -performance_schema (pfs_mutex_class).row_count 200 -performance_schema (pfs_mutex_class).memory 51200 -performance_schema (pfs_rwlock_class).row_size 320 -performance_schema (pfs_rwlock_class).row_count 40 -performance_schema (pfs_rwlock_class).memory 12800 -performance_schema (pfs_cond_class).row_size 256 -performance_schema (pfs_cond_class).row_count 80 -performance_schema (pfs_cond_class).memory 20480 -performance_schema (pfs_thread_class).row_size 192 -performance_schema (pfs_thread_class).row_count 50 -performance_schema (pfs_thread_class).memory 9600 -performance_schema (pfs_file_class).row_size 320 -performance_schema (pfs_file_class).row_count 50 -performance_schema (pfs_file_class).memory 16000 -performance_schema mutex_instances.row_size 128 -performance_schema mutex_instances.row_count 52200 -performance_schema mutex_instances.memory 6681600 -performance_schema rwlock_instances.row_size 192 -performance_schema rwlock_instances.row_count 30800 -performance_schema rwlock_instances.memory 5913600 -performance_schema cond_instances.row_size 128 -performance_schema cond_instances.row_count 10900 -performance_schema cond_instances.memory 1395200 -performance_schema threads.row_size 2816 -performance_schema threads.row_count 500 -performance_schema threads.memory 1408000 -performance_schema file_instances.row_size 704 -performance_schema file_instances.row_count 23385 -performance_schema file_instances.memory 16463040 -performance_schema (pfs_file_handle).row_size 8 -performance_schema (pfs_file_handle).row_count 32768 -performance_schema (pfs_file_handle).memory 262144 -performance_schema events_waits_summary_by_thread_by_event_name.row_size 32 -performance_schema events_waits_summary_by_thread_by_event_name.row_count 191500 -performance_schema events_waits_summary_by_thread_by_event_name.memory 6128000 -performance_schema (pfs_table_share).row_size 22208 -performance_schema (pfs_table_share).row_count 12500 -performance_schema (pfs_table_share).memory 277600000 -performance_schema (pfs_table).row_size 9280 -performance_schema (pfs_table).row_count 800 -performance_schema (pfs_table).memory 7424000 -performance_schema setup_actors.row_size 256 -performance_schema setup_actors.row_count 100 -performance_schema setup_actors.memory 25600 -performance_schema setup_objects.row_size 448 -performance_schema setup_objects.row_count 100 -performance_schema setup_objects.memory 44800 -performance_schema (pfs_account).row_size 256 -performance_schema (pfs_account).row_count 100 -performance_schema (pfs_account).memory 25600 -performance_schema events_waits_summary_by_account_by_event_name.row_size 32 -performance_schema events_waits_summary_by_account_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_account_by_event_name.memory 1225600 -performance_schema events_waits_summary_by_user_by_event_name.row_size 32 -performance_schema events_waits_summary_by_user_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_user_by_event_name.memory 1225600 -performance_schema events_waits_summary_by_host_by_event_name.row_size 32 -performance_schema events_waits_summary_by_host_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_host_by_event_name.memory 1225600 -performance_schema (pfs_user).row_size 128 -performance_schema (pfs_user).row_count 100 -performance_schema (pfs_user).memory 12800 -performance_schema (pfs_host).row_size 128 -performance_schema (pfs_host).row_count 100 -performance_schema (pfs_host).memory 12800 -performance_schema (pfs_stage_class).row_size 256 -performance_schema (pfs_stage_class).row_count 150 -performance_schema (pfs_stage_class).memory 38400 -performance_schema events_stages_history.row_size 88 -performance_schema events_stages_history.row_count 5000 -performance_schema events_stages_history.memory 440000 -performance_schema events_stages_history_long.row_size 88 -performance_schema events_stages_history_long.row_count 10000 -performance_schema events_stages_history_long.memory 880000 -performance_schema events_stages_summary_by_thread_by_event_name.row_size 32 -performance_schema events_stages_summary_by_thread_by_event_name.row_count 75000 -performance_schema events_stages_summary_by_thread_by_event_name.memory 2400000 -performance_schema events_stages_summary_global_by_event_name.row_size 32 -performance_schema events_stages_summary_global_by_event_name.row_count 150 -performance_schema events_stages_summary_global_by_event_name.memory 4800 -performance_schema events_stages_summary_by_account_by_event_name.row_size 32 -performance_schema events_stages_summary_by_account_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_account_by_event_name.memory 480000 -performance_schema events_stages_summary_by_user_by_event_name.row_size 32 -performance_schema events_stages_summary_by_user_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_user_by_event_name.memory 480000 -performance_schema events_stages_summary_by_host_by_event_name.row_size 32 -performance_schema events_stages_summary_by_host_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_host_by_event_name.memory 480000 -performance_schema (pfs_statement_class).row_size 192 -performance_schema (pfs_statement_class).row_count 168 -performance_schema (pfs_statement_class).memory 32256 -performance_schema events_statements_history.row_size 3024 -performance_schema events_statements_history.row_count 5000 -performance_schema events_statements_history.memory 15120000 -performance_schema events_statements_history_long.row_size 3024 -performance_schema events_statements_history_long.row_count 10000 -performance_schema events_statements_history_long.memory 30240000 -performance_schema events_statements_summary_by_thread_by_event_name.row_size 184 -performance_schema events_statements_summary_by_thread_by_event_name.row_count 84000 -performance_schema events_statements_summary_by_thread_by_event_name.memory 15456000 -performance_schema events_statements_summary_global_by_event_name.row_size 184 -performance_schema events_statements_summary_global_by_event_name.row_count 168 -performance_schema events_statements_summary_global_by_event_name.memory 30912 -performance_schema events_statements_summary_by_account_by_event_name.row_size 184 -performance_schema events_statements_summary_by_account_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_account_by_event_name.memory 3091200 -performance_schema events_statements_summary_by_user_by_event_name.row_size 184 -performance_schema events_statements_summary_by_user_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_user_by_event_name.memory 3091200 -performance_schema events_statements_summary_by_host_by_event_name.row_size 184 -performance_schema events_statements_summary_by_host_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_host_by_event_name.memory 3091200 -performance_schema events_statements_current.row_size 3024 -performance_schema events_statements_current.row_count 500 -performance_schema events_statements_current.memory 1512000 -performance_schema (pfs_socket_class).row_size 320 -performance_schema (pfs_socket_class).row_count 10 -performance_schema (pfs_socket_class).memory 3200 -performance_schema socket_instances.row_size 320 -performance_schema socket_instances.row_count 420 -performance_schema socket_instances.memory 134400 -performance_schema events_statements_summary_by_digest.row_size 1472 -performance_schema events_statements_summary_by_digest.row_count 10000 -performance_schema events_statements_summary_by_digest.memory 14720000 -performance_schema session_connect_attrs.row_size 500 -performance_schema session_connect_attrs.row_count 512 -performance_schema session_connect_attrs.memory 256000 -performance_schema (account_hash).count 2 -performance_schema (account_hash).size 100 -performance_schema (digest_hash).count 0 -performance_schema (digest_hash).size 10000 -performance_schema (filename_hash).count 0 -performance_schema (filename_hash).size 23385 -performance_schema (host_hash).count 2 -performance_schema (host_hash).size 100 -performance_schema (setup_actor_hash).count 1 -performance_schema (setup_actor_hash).size 100 -performance_schema (setup_object_hash).count 4 -performance_schema (setup_object_hash).size 100 -performance_schema (table_share_hash).count 80 -performance_schema (table_share_hash).size 12500 -performance_schema (user_hash).count 2 -performance_schema (user_hash).size 100 -performance_schema host_cache.size 336 -performance_schema performance_schema.memory 421925632 diff --git a/mysql-test/suite/perfschema/r/sizing_low.result b/mysql-test/suite/perfschema/r/sizing_low.result index d5aab2c2df3..213cc0b5f74 100644 --- a/mysql-test/suite/perfschema/r/sizing_low.result +++ b/mysql-test/suite/perfschema/r/sizing_low.result @@ -7,7 +7,9 @@ table_open_cache 100 show variables like "max_connections"; Variable_name Value max_connections 50 -show variables like "%performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 10 @@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 1612 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 67 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 168 performance_schema_max_table_handles 112 performance_schema_max_table_instances 445 performance_schema_max_thread_classes 50 @@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0 Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 -show engine performance_schema status; -Type Name Status -performance_schema events_waits_current.row_size 184 -performance_schema events_waits_current.row_count 672 -performance_schema events_waits_history.row_size 184 -performance_schema events_waits_history.row_count 560 -performance_schema events_waits_history.memory 103040 -performance_schema events_waits_history_long.row_size 184 -performance_schema events_waits_history_long.row_count 100 -performance_schema events_waits_history_long.memory 18400 -performance_schema (pfs_mutex_class).row_size 256 -performance_schema (pfs_mutex_class).row_count 200 -performance_schema (pfs_mutex_class).memory 51200 -performance_schema (pfs_rwlock_class).row_size 320 -performance_schema (pfs_rwlock_class).row_count 40 -performance_schema (pfs_rwlock_class).memory 12800 -performance_schema (pfs_cond_class).row_size 256 -performance_schema (pfs_cond_class).row_count 80 -performance_schema (pfs_cond_class).memory 20480 -performance_schema (pfs_thread_class).row_size 192 -performance_schema (pfs_thread_class).row_count 50 -performance_schema (pfs_thread_class).memory 9600 -performance_schema (pfs_file_class).row_size 320 -performance_schema (pfs_file_class).row_count 50 -performance_schema (pfs_file_class).memory 16000 -performance_schema mutex_instances.row_size 128 -performance_schema mutex_instances.row_count 2945 -performance_schema mutex_instances.memory 376960 -performance_schema rwlock_instances.row_size 192 -performance_schema rwlock_instances.row_count 1612 -performance_schema rwlock_instances.memory 309504 -performance_schema cond_instances.row_size 128 -performance_schema cond_instances.row_count 612 -performance_schema cond_instances.memory 78336 -performance_schema threads.row_size 2816 -performance_schema threads.row_count 112 -performance_schema threads.memory 315392 -performance_schema file_instances.row_size 704 -performance_schema file_instances.row_count 1556 -performance_schema file_instances.memory 1095424 -performance_schema (pfs_file_handle).row_size 8 -performance_schema (pfs_file_handle).row_count 32768 -performance_schema (pfs_file_handle).memory 262144 -performance_schema events_waits_summary_by_thread_by_event_name.row_size 32 -performance_schema events_waits_summary_by_thread_by_event_name.row_count 42896 -performance_schema events_waits_summary_by_thread_by_event_name.memory 1372672 -performance_schema (pfs_table_share).row_size 22208 -performance_schema (pfs_table_share).row_count 445 -performance_schema (pfs_table_share).memory 9882560 -performance_schema (pfs_table).row_size 9280 -performance_schema (pfs_table).row_count 112 -performance_schema (pfs_table).memory 1039360 -performance_schema setup_actors.row_size 256 -performance_schema setup_actors.row_count 100 -performance_schema setup_actors.memory 25600 -performance_schema setup_objects.row_size 448 -performance_schema setup_objects.row_count 100 -performance_schema setup_objects.memory 44800 -performance_schema (pfs_account).row_size 256 -performance_schema (pfs_account).row_count 10 -performance_schema (pfs_account).memory 2560 -performance_schema events_waits_summary_by_account_by_event_name.row_size 32 -performance_schema events_waits_summary_by_account_by_event_name.row_count 3830 -performance_schema events_waits_summary_by_account_by_event_name.memory 122560 -performance_schema events_waits_summary_by_user_by_event_name.row_size 32 -performance_schema events_waits_summary_by_user_by_event_name.row_count 1915 -performance_schema events_waits_summary_by_user_by_event_name.memory 61280 -performance_schema events_waits_summary_by_host_by_event_name.row_size 32 -performance_schema events_waits_summary_by_host_by_event_name.row_count 7660 -performance_schema events_waits_summary_by_host_by_event_name.memory 245120 -performance_schema (pfs_user).row_size 128 -performance_schema (pfs_user).row_count 5 -performance_schema (pfs_user).memory 640 -performance_schema (pfs_host).row_size 128 -performance_schema (pfs_host).row_count 20 -performance_schema (pfs_host).memory 2560 -performance_schema (pfs_stage_class).row_size 256 -performance_schema (pfs_stage_class).row_count 150 -performance_schema (pfs_stage_class).memory 38400 -performance_schema events_stages_history.row_size 88 -performance_schema events_stages_history.row_count 560 -performance_schema events_stages_history.memory 49280 -performance_schema events_stages_history_long.row_size 88 -performance_schema events_stages_history_long.row_count 100 -performance_schema events_stages_history_long.memory 8800 -performance_schema events_stages_summary_by_thread_by_event_name.row_size 32 -performance_schema events_stages_summary_by_thread_by_event_name.row_count 16800 -performance_schema events_stages_summary_by_thread_by_event_name.memory 537600 -performance_schema events_stages_summary_global_by_event_name.row_size 32 -performance_schema events_stages_summary_global_by_event_name.row_count 150 -performance_schema events_stages_summary_global_by_event_name.memory 4800 -performance_schema events_stages_summary_by_account_by_event_name.row_size 32 -performance_schema events_stages_summary_by_account_by_event_name.row_count 1500 -performance_schema events_stages_summary_by_account_by_event_name.memory 48000 -performance_schema events_stages_summary_by_user_by_event_name.row_size 32 -performance_schema events_stages_summary_by_user_by_event_name.row_count 750 -performance_schema events_stages_summary_by_user_by_event_name.memory 24000 -performance_schema events_stages_summary_by_host_by_event_name.row_size 32 -performance_schema events_stages_summary_by_host_by_event_name.row_count 3000 -performance_schema events_stages_summary_by_host_by_event_name.memory 96000 -performance_schema (pfs_statement_class).row_size 192 -performance_schema (pfs_statement_class).row_count 168 -performance_schema (pfs_statement_class).memory 32256 -performance_schema events_statements_history.row_size 3024 -performance_schema events_statements_history.row_count 560 -performance_schema events_statements_history.memory 1693440 -performance_schema events_statements_history_long.row_size 3024 -performance_schema events_statements_history_long.row_count 100 -performance_schema events_statements_history_long.memory 302400 -performance_schema events_statements_summary_by_thread_by_event_name.row_size 184 -performance_schema events_statements_summary_by_thread_by_event_name.row_count 18816 -performance_schema events_statements_summary_by_thread_by_event_name.memory 3462144 -performance_schema events_statements_summary_global_by_event_name.row_size 184 -performance_schema events_statements_summary_global_by_event_name.row_count 168 -performance_schema events_statements_summary_global_by_event_name.memory 30912 -performance_schema events_statements_summary_by_account_by_event_name.row_size 184 -performance_schema events_statements_summary_by_account_by_event_name.row_count 1680 -performance_schema events_statements_summary_by_account_by_event_name.memory 309120 -performance_schema events_statements_summary_by_user_by_event_name.row_size 184 -performance_schema events_statements_summary_by_user_by_event_name.row_count 840 -performance_schema events_statements_summary_by_user_by_event_name.memory 154560 -performance_schema events_statements_summary_by_host_by_event_name.row_size 184 -performance_schema events_statements_summary_by_host_by_event_name.row_count 3360 -performance_schema events_statements_summary_by_host_by_event_name.memory 618240 -performance_schema events_statements_current.row_size 3024 -performance_schema events_statements_current.row_count 112 -performance_schema events_statements_current.memory 338688 -performance_schema (pfs_socket_class).row_size 320 -performance_schema (pfs_socket_class).row_count 10 -performance_schema (pfs_socket_class).memory 3200 -performance_schema socket_instances.row_size 320 -performance_schema socket_instances.row_count 67 -performance_schema socket_instances.memory 21440 -performance_schema events_statements_summary_by_digest.row_size 1472 -performance_schema events_statements_summary_by_digest.row_count 1000 -performance_schema events_statements_summary_by_digest.memory 1472000 -performance_schema session_connect_attrs.row_size 112 -performance_schema session_connect_attrs.row_count 512 -performance_schema session_connect_attrs.memory 57344 -performance_schema (account_hash).count 2 -performance_schema (account_hash).size 10 -performance_schema (digest_hash).count 0 -performance_schema (digest_hash).size 1000 -performance_schema (filename_hash).count 0 -performance_schema (filename_hash).size 1556 -performance_schema (host_hash).count 2 -performance_schema (host_hash).size 20 -performance_schema (setup_actor_hash).count 1 -performance_schema (setup_actor_hash).size 100 -performance_schema (setup_object_hash).count 4 -performance_schema (setup_object_hash).size 100 -performance_schema (table_share_hash).count 80 -performance_schema (table_share_hash).size 445 -performance_schema (user_hash).count 2 -performance_schema (user_hash).size 5 -performance_schema host_cache.size 336 -performance_schema performance_schema.memory 24771616 diff --git a/mysql-test/suite/perfschema/r/sizing_med.result b/mysql-test/suite/perfschema/r/sizing_med.result index c2e7a4df4bf..fbe703c5ff5 100644 --- a/mysql-test/suite/perfschema/r/sizing_med.result +++ b/mysql-test/suite/perfschema/r/sizing_med.result @@ -7,7 +7,9 @@ table_open_cache 401 show variables like "max_connections"; Variable_name Value max_connections 152 -show variables like "%performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -31,7 +33,6 @@ performance_schema_max_rwlock_instances 2222 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 232 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 168 performance_schema_max_table_handles 573 performance_schema_max_table_instances 556 performance_schema_max_thread_classes 50 @@ -65,160 +66,3 @@ Performance_schema_table_instances_lost 0 Performance_schema_thread_classes_lost 0 Performance_schema_thread_instances_lost 0 Performance_schema_users_lost 0 -show engine performance_schema status; -Type Name Status -performance_schema events_waits_current.row_size 184 -performance_schema events_waits_current.row_count 1734 -performance_schema events_waits_history.row_size 184 -performance_schema events_waits_history.row_count 2890 -performance_schema events_waits_history.memory 531760 -performance_schema events_waits_history_long.row_size 184 -performance_schema events_waits_history_long.row_count 1000 -performance_schema events_waits_history_long.memory 184000 -performance_schema (pfs_mutex_class).row_size 256 -performance_schema (pfs_mutex_class).row_count 200 -performance_schema (pfs_mutex_class).memory 51200 -performance_schema (pfs_rwlock_class).row_size 320 -performance_schema (pfs_rwlock_class).row_count 40 -performance_schema (pfs_rwlock_class).memory 12800 -performance_schema (pfs_cond_class).row_size 256 -performance_schema (pfs_cond_class).row_count 80 -performance_schema (pfs_cond_class).memory 20480 -performance_schema (pfs_thread_class).row_size 192 -performance_schema (pfs_thread_class).row_count 50 -performance_schema (pfs_thread_class).memory 9600 -performance_schema (pfs_file_class).row_size 320 -performance_schema (pfs_file_class).row_count 50 -performance_schema (pfs_file_class).memory 16000 -performance_schema mutex_instances.row_size 128 -performance_schema mutex_instances.row_count 4230 -performance_schema mutex_instances.memory 541440 -performance_schema rwlock_instances.row_size 192 -performance_schema rwlock_instances.row_count 2222 -performance_schema rwlock_instances.memory 426624 -performance_schema cond_instances.row_size 128 -performance_schema cond_instances.row_count 1079 -performance_schema cond_instances.memory 138112 -performance_schema threads.row_size 2816 -performance_schema threads.row_count 289 -performance_schema threads.memory 813824 -performance_schema file_instances.row_size 704 -performance_schema file_instances.row_count 1754 -performance_schema file_instances.memory 1234816 -performance_schema (pfs_file_handle).row_size 8 -performance_schema (pfs_file_handle).row_count 32768 -performance_schema (pfs_file_handle).memory 262144 -performance_schema events_waits_summary_by_thread_by_event_name.row_size 32 -performance_schema events_waits_summary_by_thread_by_event_name.row_count 110687 -performance_schema events_waits_summary_by_thread_by_event_name.memory 3541984 -performance_schema (pfs_table_share).row_size 22208 -performance_schema (pfs_table_share).row_count 556 -performance_schema (pfs_table_share).memory 12347648 -performance_schema (pfs_table).row_size 9280 -performance_schema (pfs_table).row_count 573 -performance_schema (pfs_table).memory 5317440 -performance_schema setup_actors.row_size 256 -performance_schema setup_actors.row_count 100 -performance_schema setup_actors.memory 25600 -performance_schema setup_objects.row_size 448 -performance_schema setup_objects.row_count 100 -performance_schema setup_objects.memory 44800 -performance_schema (pfs_account).row_size 256 -performance_schema (pfs_account).row_count 100 -performance_schema (pfs_account).memory 25600 -performance_schema events_waits_summary_by_account_by_event_name.row_size 32 -performance_schema events_waits_summary_by_account_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_account_by_event_name.memory 1225600 -performance_schema events_waits_summary_by_user_by_event_name.row_size 32 -performance_schema events_waits_summary_by_user_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_user_by_event_name.memory 1225600 -performance_schema events_waits_summary_by_host_by_event_name.row_size 32 -performance_schema events_waits_summary_by_host_by_event_name.row_count 38300 -performance_schema events_waits_summary_by_host_by_event_name.memory 1225600 -performance_schema (pfs_user).row_size 128 -performance_schema (pfs_user).row_count 100 -performance_schema (pfs_user).memory 12800 -performance_schema (pfs_host).row_size 128 -performance_schema (pfs_host).row_count 100 -performance_schema (pfs_host).memory 12800 -performance_schema (pfs_stage_class).row_size 256 -performance_schema (pfs_stage_class).row_count 150 -performance_schema (pfs_stage_class).memory 38400 -performance_schema events_stages_history.row_size 88 -performance_schema events_stages_history.row_count 2890 -performance_schema events_stages_history.memory 254320 -performance_schema events_stages_history_long.row_size 88 -performance_schema events_stages_history_long.row_count 1000 -performance_schema events_stages_history_long.memory 88000 -performance_schema events_stages_summary_by_thread_by_event_name.row_size 32 -performance_schema events_stages_summary_by_thread_by_event_name.row_count 43350 -performance_schema events_stages_summary_by_thread_by_event_name.memory 1387200 -performance_schema events_stages_summary_global_by_event_name.row_size 32 -performance_schema events_stages_summary_global_by_event_name.row_count 150 -performance_schema events_stages_summary_global_by_event_name.memory 4800 -performance_schema events_stages_summary_by_account_by_event_name.row_size 32 -performance_schema events_stages_summary_by_account_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_account_by_event_name.memory 480000 -performance_schema events_stages_summary_by_user_by_event_name.row_size 32 -performance_schema events_stages_summary_by_user_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_user_by_event_name.memory 480000 -performance_schema events_stages_summary_by_host_by_event_name.row_size 32 -performance_schema events_stages_summary_by_host_by_event_name.row_count 15000 -performance_schema events_stages_summary_by_host_by_event_name.memory 480000 -performance_schema (pfs_statement_class).row_size 192 -performance_schema (pfs_statement_class).row_count 168 -performance_schema (pfs_statement_class).memory 32256 -performance_schema events_statements_history.row_size 3024 -performance_schema events_statements_history.row_count 2890 -performance_schema events_statements_history.memory 8739360 -performance_schema events_statements_history_long.row_size 3024 -performance_schema events_statements_history_long.row_count 1000 -performance_schema events_statements_history_long.memory 3024000 -performance_schema events_statements_summary_by_thread_by_event_name.row_size 184 -performance_schema events_statements_summary_by_thread_by_event_name.row_count 48552 -performance_schema events_statements_summary_by_thread_by_event_name.memory 8933568 -performance_schema events_statements_summary_global_by_event_name.row_size 184 -performance_schema events_statements_summary_global_by_event_name.row_count 168 -performance_schema events_statements_summary_global_by_event_name.memory 30912 -performance_schema events_statements_summary_by_account_by_event_name.row_size 184 -performance_schema events_statements_summary_by_account_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_account_by_event_name.memory 3091200 -performance_schema events_statements_summary_by_user_by_event_name.row_size 184 -performance_schema events_statements_summary_by_user_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_user_by_event_name.memory 3091200 -performance_schema events_statements_summary_by_host_by_event_name.row_size 184 -performance_schema events_statements_summary_by_host_by_event_name.row_count 16800 -performance_schema events_statements_summary_by_host_by_event_name.memory 3091200 -performance_schema events_statements_current.row_size 3024 -performance_schema events_statements_current.row_count 289 -performance_schema events_statements_current.memory 873936 -performance_schema (pfs_socket_class).row_size 320 -performance_schema (pfs_socket_class).row_count 10 -performance_schema (pfs_socket_class).memory 3200 -performance_schema socket_instances.row_size 320 -performance_schema socket_instances.row_count 232 -performance_schema socket_instances.memory 74240 -performance_schema events_statements_summary_by_digest.row_size 1472 -performance_schema events_statements_summary_by_digest.row_count 5000 -performance_schema events_statements_summary_by_digest.memory 7360000 -performance_schema session_connect_attrs.row_size 289 -performance_schema session_connect_attrs.row_count 512 -performance_schema session_connect_attrs.memory 147968 -performance_schema (account_hash).count 2 -performance_schema (account_hash).size 100 -performance_schema (digest_hash).count 0 -performance_schema (digest_hash).size 5000 -performance_schema (filename_hash).count 0 -performance_schema (filename_hash).size 1754 -performance_schema (host_hash).count 2 -performance_schema (host_hash).size 100 -performance_schema (setup_actor_hash).count 1 -performance_schema (setup_actor_hash).size 100 -performance_schema (setup_object_hash).count 4 -performance_schema (setup_object_hash).size 100 -performance_schema (table_share_hash).count 80 -performance_schema (table_share_hash).size 556 -performance_schema (user_hash).count 2 -performance_schema (user_hash).size 100 -performance_schema host_cache.size 336 -performance_schema performance_schema.memory 70954032 diff --git a/mysql-test/suite/perfschema/r/sizing_off.result b/mysql-test/suite/perfschema/r/sizing_off.result index 0d95a8c0f1b..614ad7d2475 100644 --- a/mysql-test/suite/perfschema/r/sizing_off.result +++ b/mysql-test/suite/perfschema/r/sizing_off.result @@ -1,4 +1,6 @@ -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema OFF performance_schema_accounts_size -1 @@ -22,7 +24,6 @@ performance_schema_max_rwlock_instances -1 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances -1 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 168 performance_schema_max_table_handles -1 performance_schema_max_table_instances -1 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result index b27ecd52226..9e0b9209b89 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result index 0b8e00a5653..99b18e851a4 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result index 8e8d1498b9f..5217f16a32f 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result index d4b02dedc2c..86c25348cd5 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result index 0d7ea7d6294..d03c20a5878 100644 --- a/mysql-test/suite/perfschema/r/start_server_innodb.result +++ b/mysql-test/suite/perfschema/r/start_server_innodb.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_low_digest.result b/mysql-test/suite/perfschema/r/start_server_low_digest.result new file mode 100644 index 00000000000..aff444250e0 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_low_digest.result @@ -0,0 +1,12 @@ +USE performance_schema; +truncate table events_statements_history_long; +SELECT 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+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+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+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+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1 +74 +#################################### +# QUERYING PS STATEMENT DIGEST +#################################### +SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long; +event_name digest digest_text sql_text +statement/sql/truncate e1c917a43f978456fab15240f89372ca TRUNCATE TABLE truncate table events_statements_history_long +statement/sql/select 4cc1c447d79877c4e8df0423fd0cde9a SELECT ? + ? + SELECT 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+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+1+1+1+1+1+1+1+1 diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result index b9ec719ed58..3e0324868a7 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_account.result +++ b/mysql-test/suite/perfschema/r/start_server_no_account.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 0 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result index 4fac77bc0cc..158dfb81ebe 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result index 75cd54776eb..3673600a078 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result index 9922fcaa016..1e819d26265 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result index 6e8735f6a1f..b439af66f8d 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result index f5dae7c61d9..abb8a157ec6 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_host.result +++ b/mysql-test/suite/perfschema/r/start_server_no_host.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result index 4b3c8790b58..c5fe555b749 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result index 92ec4cf61fc..d88d808a9ab 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result index e4ac0d0fa8b..1155993e60c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result index 3bba543f3b8..4d419817b0a 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 0 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result index 2c3ef382fb9..281ca17491c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result index 0b49b4d055a..1e5578daddc 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result +++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result index 9cf73c2b78d..ef1050d9fde 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 0 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result index 6da66d6ee75..97cbc807f3c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 0 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result index 532935bb0ff..a173447632d 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 0 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result index 360571bc326..6de6cc3187e 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result index d458e3da9b1..fc0e680ebb7 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result index 78fe9223ef4..fca5ab82238 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 0 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result index 2682ea22f88..1fc13bf6ce3 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result index 9568e9ad56b..d51d3acf343 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result index c189d9a5024..784ed74e33c 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 0 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result index a440cfe3302..da73df5c419 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 0 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result index d9c945ea8cb..a84f0f3c0ef 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result index f5ce5bebb51..3be29053b33 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result index 53cb0051f97..d80a9a4a2c4 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_user.result +++ b/mysql-test/suite/perfschema/r/start_server_no_user.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result index 125274550eb..928307123d8 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result index 50212863574..d8ada5f9da5 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result +++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_nothing.result b/mysql-test/suite/perfschema/r/start_server_nothing.result index 4e6994d670e..bf84848641c 100644 --- a/mysql-test/suite/perfschema/r/start_server_nothing.result +++ b/mysql-test/suite/perfschema/r/start_server_nothing.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 0 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 0 performance_schema_max_socket_classes 0 performance_schema_max_socket_instances 0 performance_schema_max_stage_classes 0 -performance_schema_max_statement_classes 0 performance_schema_max_table_handles 0 performance_schema_max_table_instances 0 performance_schema_max_thread_classes 0 diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result index 08847829579..293607c41e9 100644 --- a/mysql-test/suite/perfschema/r/start_server_off.result +++ b/mysql-test/suite/perfschema/r/start_server_off.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema OFF performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result index 0d7ea7d6294..d03c20a5878 100644 --- a/mysql-test/suite/perfschema/r/start_server_on.result +++ b/mysql-test/suite/perfschema/r/start_server_on.result @@ -69,7 +69,9 @@ select * from performance_schema.table_io_waits_summary_by_table; select * from performance_schema.table_lock_waits_summary_by_table; select * from performance_schema.threads; select * from performance_schema.users; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -93,7 +95,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/statement_digest.result b/mysql-test/suite/perfschema/r/statement_digest.result index 41cba435cb6..e3df74a70d9 100644 --- a/mysql-test/suite/perfschema/r/statement_digest.result +++ b/mysql-test/suite/perfschema/r/statement_digest.result @@ -112,43 +112,42 @@ DROP TRIGGER trg; SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS, SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest; SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS -statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 -statements_digest 954f43425c3234acc8e194afd97e8a0a SELECT ? FROM t1 1 0 0 0 -statements_digest fc365a54bc19d746bd24c27aba46b990 SELECT ? FROM `t1` 1 0 0 0 -statements_digest 27ba28f6252e4ae0e9b14b36da536fbe SELECT ?, ... FROM t1 2 0 0 0 -statements_digest 81d03922612900032ec4b81934ab4841 SELECT ? FROM t2 1 0 0 0 -statements_digest adce8aec12b6b5046cd4bf55951014c7 SELECT ?, ... FROM t2 2 0 0 0 -statements_digest 59a1bd93c424b10802fe66bb6dcd94d2 INSERT INTO t1 VALUES (?) 1 1 0 0 -statements_digest 91b2da58b0eb49c35a38fbc49f5e491d INSERT INTO t2 VALUES (?) 1 1 0 0 -statements_digest 967114adbf91d8a4a99ec5e49e909ff4 INSERT INTO t3 VALUES (...) 4 4 0 0 -statements_digest 8f25e7a48487e0aa7377e816816bb658 INSERT INTO t4 VALUES (...) 1 1 0 0 -statements_digest 4e51253af793867fba66166de1f314f7 INSERT INTO t5 VALUES (...) 1 1 0 0 -statements_digest fa47b3109e117216cd10209690d28596 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0 -statements_digest 72409f84bc236e6fe9f2f7b4d727f2d3 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0 -statements_digest d40aaddb41ed794d65dd8273f0c75700 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0 -statements_digest 57a82b28388e52e99fc64339dd30edde INSERT INTO t1 VALUES ( NULL ) 1 1 0 0 -statements_digest 6a56b694106442474cb0e5fb7575c8b9 INSERT INTO t6 VALUES (...) 5 5 0 0 -statements_digest c9abf55e296c4317dbaf2d14ef907ad7 SELECT ? + ? 3 0 0 0 -statements_digest 156304a0851a3e3626b39fb3da841a82 SELECT ? 1 0 0 0 +statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 0 0 0 +statements_digest a871edd1a65606b404c0b6e65c1f142c SELECT ? FROM t1 1 0 0 0 +statements_digest d60830f376a7724280dfc422224bb475 SELECT ? FROM `t1` 1 0 0 0 +statements_digest 09309c60c199a727b7ebed40975e8764 SELECT ?, ... FROM t1 2 0 0 0 +statements_digest dc0dcaefa9a12455ffed04ac6f89e65d SELECT ? FROM t2 1 0 0 0 +statements_digest d274a288509eae2cd7febf2f7fe36274 SELECT ?, ... FROM t2 2 0 0 0 +statements_digest ec913f89e0d8be99014bf78e73228c48 INSERT INTO t1 VALUES (?) 2 2 0 0 +statements_digest b919ecf2d5544bcdf95e76eb22231c42 INSERT INTO t2 VALUES (?) 1 1 0 0 +statements_digest d9030eddb8dca8ee5fcaf79e6f254b41 INSERT INTO t3 VALUES (...) 4 4 0 0 +statements_digest 2ad6d8279781b0fb40bdc8647dc94216 INSERT INTO t4 VALUES (...) 1 1 0 0 +statements_digest 3248c16dc70111225fcffa99641e312b INSERT INTO t5 VALUES (...) 1 1 0 0 +statements_digest 152b6c84a0cbfadcbecde01050eddd66 INSERT INTO t1 VALUES (?) /* , ... */ 2 7 0 0 +statements_digest c4cbce33b636e448c29e041b1d5c0eb1 INSERT INTO t3 VALUES (...) /* , ... */ 1 3 0 0 +statements_digest 0bfac9fb577995b116e52ff4aaeaa5b8 INSERT INTO t5 VALUES (...) /* , ... */ 1 3 0 0 +statements_digest 819acce11785e12f2f73964115632db6 INSERT INTO t6 VALUES (...) 5 5 0 0 +statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3 0 0 0 +statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1 0 0 0 statements_digest 3b085ab0d2063dfca1a39212e3ea1831 CREATE SCHEMA statements_digest_temp 2 2 0 0 statements_digest 09f9fabef2feb9a54ba01455e5ae83b9 DROP SCHEMA statements_digest_temp 2 0 0 0 -statements_digest 7910a63ffd31cbcb742e15270c8958c8 SELECT ? FROM no_such_table 1 0 0 1 -statements_digest fa34540a438bc672478b1162505ee28c CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1 -statements_digest 2c720f176bb7c8510ff8aca8921b9945 DROP TABLE dup_table 1 0 0 0 -statements_digest 0c7d9fd8c27ab067511da41ca3bcdff3 INSERT INTO t11 VALUES (?) 1 1 1 0 -statements_digest 81681ff345065ed72bcd1e9407ab85e4 SHOW WARNINGS 1 0 0 0 -statements_digest d766f5823ae5d8e4cf4602b8e7a3fb80 PREPARE stmt FROM ? 1 0 0 0 +statements_digest ff0bb1dfc399aa3bef6a0f3fccd3ef94 SELECT ? FROM no_such_table 1 0 0 1 +statements_digest 590a245c84e63eb100e1ef463f477f1a CREATE TABLE dup_table ( c CHARACTER (?) ) 2 0 0 1 +statements_digest 74078b0776d8333e356b271551587d53 DROP TABLE dup_table 1 0 0 0 +statements_digest f23641c5ab7e1dd6e0146f66b3fff5c4 INSERT INTO t11 VALUES (?) 1 1 1 0 +statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1 0 0 0 +statements_digest 6bb42dec3094486d5a9e8b0bf460e382 PREPARE stmt FROM ? 1 0 0 0 statements_digest 3ab1e87eabd9688edf919754cce6348b EXECUTE stmt 2 0 0 0 -statements_digest 470094469d250b9f45cab45bf610efe8 DEALLOCATE PREPARE stmt 1 0 0 0 -statements_digest 1b4d25358e08b35ad54e49dfe5eaf3e4 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0 +statements_digest f9438ab7b8eec604338c28a04e5d650f DEALLOCATE PREPARE stmt 1 0 0 0 +statements_digest 072d6c57d3fe4f0c6a7dabba96f0ccf8 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 0 0 0 statements_digest 84554971243e91106214dcb8f4eaa89b CALL p1 ( ) 2 0 0 0 -statements_digest 77206e4bf30979c56752a7ed9150213a DROP PROCEDURE p1 1 0 0 0 -statements_digest 03b91dcdba6b0e29f7fb240ae4bcd97f CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0 -statements_digest 72bc532f308f2dca62f5291df8c50e6f SELECT func (...) 2 0 0 0 +statements_digest 2bd1e1e6eb445f32e1d4b290c1961e6b DROP PROCEDURE p1 1 0 0 0 +statements_digest 5799522044ce9a4fa48dce5f4a3b047a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 0 0 0 +statements_digest 59cbdd7ffc78a23bc2f650f8158067c6 SELECT func (...) 2 0 0 0 statements_digest 0b5a5297689c5036def6af8e8a8ce113 DROP FUNCTION func 1 0 0 0 -statements_digest d08331e42c67555ece50e46eef0f2b47 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 0 0 0 -statements_digest 754a49a4de995c5a729e9ab52f135f59 INSERT INTO t12 VALUES (?) 2 2 0 0 -statements_digest 68df17752bca7c2c8ee2a6a19a0674e7 DROP TRIGGER trg 1 0 0 0 +statements_digest 10c7a2262748aa15496375d99f876fb2 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @? := ? 1 0 0 0 +statements_digest bb0154f3d32233f696b95d4127d29a3b INSERT INTO t12 VALUES (?) 2 2 0 0 +statements_digest a975545baf024e8a173be77032d8fd01 DROP TRIGGER trg 1 0 0 0 #################################### # CLEANUP #################################### diff --git a/mysql-test/suite/perfschema/r/statement_digest_consumers.result b/mysql-test/suite/perfschema/r/statement_digest_consumers.result index 21e62e13b19..355905f71d8 100644 --- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result +++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result @@ -125,43 +125,42 @@ DROP TRIGGER trg; #################################### SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest; schema_name digest digest_text count_star -statements_digest 0e98ee6a98e296530ec59c12dbc08dfe TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 -statements_digest 954f43425c3234acc8e194afd97e8a0a SELECT ? FROM t1 1 -statements_digest fc365a54bc19d746bd24c27aba46b990 SELECT ? FROM `t1` 1 -statements_digest 27ba28f6252e4ae0e9b14b36da536fbe SELECT ?, ... FROM t1 2 -statements_digest 81d03922612900032ec4b81934ab4841 SELECT ? FROM t2 1 -statements_digest adce8aec12b6b5046cd4bf55951014c7 SELECT ?, ... FROM t2 2 -statements_digest 59a1bd93c424b10802fe66bb6dcd94d2 INSERT INTO t1 VALUES (?) 1 -statements_digest 91b2da58b0eb49c35a38fbc49f5e491d INSERT INTO t2 VALUES (?) 1 -statements_digest 967114adbf91d8a4a99ec5e49e909ff4 INSERT INTO t3 VALUES (...) 4 -statements_digest 8f25e7a48487e0aa7377e816816bb658 INSERT INTO t4 VALUES (...) 1 -statements_digest 4e51253af793867fba66166de1f314f7 INSERT INTO t5 VALUES (...) 1 -statements_digest fa47b3109e117216cd10209690d28596 INSERT INTO t1 VALUES (?) /* , ... */ 2 -statements_digest 72409f84bc236e6fe9f2f7b4d727f2d3 INSERT INTO t3 VALUES (...) /* , ... */ 1 -statements_digest d40aaddb41ed794d65dd8273f0c75700 INSERT INTO t5 VALUES (...) /* , ... */ 1 -statements_digest 57a82b28388e52e99fc64339dd30edde INSERT INTO t1 VALUES ( NULL ) 1 -statements_digest 6a56b694106442474cb0e5fb7575c8b9 INSERT INTO t6 VALUES (...) 5 -statements_digest c9abf55e296c4317dbaf2d14ef907ad7 SELECT ? + ? 3 -statements_digest 156304a0851a3e3626b39fb3da841a82 SELECT ? 1 +statements_digest 8de787d0e3e3a062aea121ff528fcfce TRUNCATE TABLE performance_schema . events_statements_summary_by_digest 1 +statements_digest a871edd1a65606b404c0b6e65c1f142c SELECT ? FROM t1 1 +statements_digest d60830f376a7724280dfc422224bb475 SELECT ? FROM `t1` 1 +statements_digest 09309c60c199a727b7ebed40975e8764 SELECT ?, ... FROM t1 2 +statements_digest dc0dcaefa9a12455ffed04ac6f89e65d SELECT ? FROM t2 1 +statements_digest d274a288509eae2cd7febf2f7fe36274 SELECT ?, ... FROM t2 2 +statements_digest ec913f89e0d8be99014bf78e73228c48 INSERT INTO t1 VALUES (?) 2 +statements_digest b919ecf2d5544bcdf95e76eb22231c42 INSERT INTO t2 VALUES (?) 1 +statements_digest d9030eddb8dca8ee5fcaf79e6f254b41 INSERT INTO t3 VALUES (...) 4 +statements_digest 2ad6d8279781b0fb40bdc8647dc94216 INSERT INTO t4 VALUES (...) 1 +statements_digest 3248c16dc70111225fcffa99641e312b INSERT INTO t5 VALUES (...) 1 +statements_digest 152b6c84a0cbfadcbecde01050eddd66 INSERT INTO t1 VALUES (?) /* , ... */ 2 +statements_digest c4cbce33b636e448c29e041b1d5c0eb1 INSERT INTO t3 VALUES (...) /* , ... */ 1 +statements_digest 0bfac9fb577995b116e52ff4aaeaa5b8 INSERT INTO t5 VALUES (...) /* , ... */ 1 +statements_digest 819acce11785e12f2f73964115632db6 INSERT INTO t6 VALUES (...) 5 +statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3 +statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1 statements_digest 3b085ab0d2063dfca1a39212e3ea1831 CREATE SCHEMA statements_digest_temp 2 statements_digest 09f9fabef2feb9a54ba01455e5ae83b9 DROP SCHEMA statements_digest_temp 2 -statements_digest 7910a63ffd31cbcb742e15270c8958c8 SELECT ? FROM no_such_table 1 -statements_digest fa34540a438bc672478b1162505ee28c CREATE TABLE dup_table ( c CHARACTER (?) ) 2 -statements_digest 2c720f176bb7c8510ff8aca8921b9945 DROP TABLE dup_table 1 -statements_digest 0c7d9fd8c27ab067511da41ca3bcdff3 INSERT INTO t11 VALUES (?) 1 -statements_digest 81681ff345065ed72bcd1e9407ab85e4 SHOW WARNINGS 1 -statements_digest d766f5823ae5d8e4cf4602b8e7a3fb80 PREPARE stmt FROM ? 1 +statements_digest ff0bb1dfc399aa3bef6a0f3fccd3ef94 SELECT ? FROM no_such_table 1 +statements_digest 590a245c84e63eb100e1ef463f477f1a CREATE TABLE dup_table ( c CHARACTER (?) ) 2 +statements_digest 74078b0776d8333e356b271551587d53 DROP TABLE dup_table 1 +statements_digest f23641c5ab7e1dd6e0146f66b3fff5c4 INSERT INTO t11 VALUES (?) 1 +statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1 +statements_digest 6bb42dec3094486d5a9e8b0bf460e382 PREPARE stmt FROM ? 1 statements_digest 3ab1e87eabd9688edf919754cce6348b EXECUTE stmt 2 -statements_digest 470094469d250b9f45cab45bf610efe8 DEALLOCATE PREPARE stmt 1 -statements_digest 1b4d25358e08b35ad54e49dfe5eaf3e4 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 +statements_digest f9438ab7b8eec604338c28a04e5d650f DEALLOCATE PREPARE stmt 1 +statements_digest 072d6c57d3fe4f0c6a7dabba96f0ccf8 CREATE PROCEDURE p1 ( ) BEGIN SELECT * FROM t12 ; END 1 statements_digest 84554971243e91106214dcb8f4eaa89b CALL p1 ( ) 2 -statements_digest 77206e4bf30979c56752a7ed9150213a DROP PROCEDURE p1 1 -statements_digest 03b91dcdba6b0e29f7fb240ae4bcd97f CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 -statements_digest 72bc532f308f2dca62f5291df8c50e6f SELECT func (...) 2 +statements_digest 2bd1e1e6eb445f32e1d4b290c1961e6b DROP PROCEDURE p1 1 +statements_digest 5799522044ce9a4fa48dce5f4a3b047a CREATE FUNCTION `func` ( a INTEGER , b INTEGER ) RETURNS INTEGER (?) RETURN a + b 1 +statements_digest 59cbdd7ffc78a23bc2f650f8158067c6 SELECT func (...) 2 statements_digest 0b5a5297689c5036def6af8e8a8ce113 DROP FUNCTION func 1 -statements_digest d08331e42c67555ece50e46eef0f2b47 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @ ? := ? 1 -statements_digest 754a49a4de995c5a729e9ab52f135f59 INSERT INTO t12 VALUES (?) 2 -statements_digest 68df17752bca7c2c8ee2a6a19a0674e7 DROP TRIGGER trg 1 +statements_digest 10c7a2262748aa15496375d99f876fb2 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @? := ? 1 +statements_digest bb0154f3d32233f696b95d4127d29a3b INSERT INTO t12 VALUES (?) 2 +statements_digest a975545baf024e8a173be77032d8fd01 DROP TRIGGER trg 1 SELECT digest, digest_text FROM performance_schema.events_statements_current; digest digest_text #################################### diff --git a/mysql-test/suite/perfschema/r/statement_digest_long_query.result b/mysql-test/suite/perfschema/r/statement_digest_long_query.result index bb355304537..f9943060c83 100644 --- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result +++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result @@ -8,5 +8,5 @@ SELECT 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+1+1+1+1 #################################### SELECT schema_name, digest, digest_text, count_star FROM events_statements_summary_by_digest; schema_name digest digest_text count_star -performance_schema 9d35ff74210c6b30efa4559d627ed0f7 TRUNCATE TABLE events_statements_summary_by_digest 1 -performance_schema d78a04c1c42765b8552e0483c50ae9ff SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ... 1 +performance_schema 7536ab4a65b991a0b1a8b9851e8457c3 TRUNCATE TABLE events_statements_summary_by_digest 1 +performance_schema 63f9aaeed7859671c6a42c75fcd43785 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? 1 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result index ea2980e5755..2613737a3da 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result index f51e8383019..e5aaf207820 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result index a7844b6b0e6..637d923ebdb 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result index 4d089c810a1..a41ae765a77 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result index 23bd1294445..2278744621e 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result @@ -37,7 +37,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -61,7 +63,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result index 7edfc3824bb..b3ada0d638a 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result @@ -36,7 +36,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -60,7 +62,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result index 99d2e7d4655..361a8a700d0 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result @@ -37,7 +37,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -61,7 +63,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result index f8c660bd932..97bb0e34e0d 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result @@ -36,7 +36,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -60,7 +62,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result index 73ed3550a77..f28f374c5dd 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_off.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result index 3906c6f6b84..f7760043ddd 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result index 0b579f54a66..0ee5eaddcaf 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result index e137525e5b0..025a7f27738 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result index 799555b685e..f655cd5bb93 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result index bf920a30af3..55bb5a6a71f 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result index d100f2a5e08..7f9f9e99359 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result index a5d046f154c..7aa15b6a01d 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result index 413a566fefb..0732fce5853 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result index 4a5e7aeede1..c1f6fd56a97 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result index 25ba676993a..705e6ca7021 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result index 41292e5913e..04b7c7979c4 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result index fc7c523ed8c..ef1f31b19a4 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result index 210928a0c04..a7ac4fa860f 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result index 9df65066d45..28bdcfb1d82 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result index a9109fa42d2..683dd9cc4a6 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result index 542b020f77a..d488066dd7f 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result index ece0dadebd0..d3a4416fdfd 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result index 956540b9327..c69fc8a37d3 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result index 72f0240c6be..91110a94be5 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result index a93cc1b6499..b443ac28c17 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result index 0e1b7032af6..08a107acb2a 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result index fb1fd8fb207..07272c6e204 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result index f97272634b9..77c52780ae9 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result @@ -39,7 +39,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -63,7 +65,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result index ddf8ef7bf9d..6d7192285e3 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result @@ -38,7 +38,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -62,7 +64,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result index 588a378024a..160be444e7c 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result index 76c466d48cc..e915a8dfa95 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result index 2450456355a..82c1b65acff 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result @@ -41,7 +41,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -65,7 +67,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result index 72b46a2820b..9023a4b0a69 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result @@ -40,7 +40,9 @@ truncate performance_schema.events_waits_summary_by_user_by_event_name; truncate performance_schema.events_waits_summary_by_host_by_event_name; truncate performance_schema.events_waits_summary_global_by_event_name; truncate performance_schema.events_waits_history_long; -show variables like "performance_schema%"; +show variables where +`Variable_name` != "performance_schema_max_statement_classes" and +`Variable_name` like "performance_schema%"; Variable_name Value performance_schema ON performance_schema_accounts_size 100 @@ -64,7 +66,6 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result index 4da857f83fc..6ab0b0641b0 100644 --- a/mysql-test/suite/perfschema/r/threads_mysql.result +++ b/mysql-test/suite/perfschema/r/threads_mysql.result @@ -13,7 +13,7 @@ processlist_user NULL processlist_host NULL processlist_db NULL processlist_command NULL -processlist_info INTERNAL DDL LOG RECOVER IN PROGRESS +processlist_info NULL unified_parent_thread_id NULL role NULL instrumented YES diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test index 672737ae2a7..fe30a7b8697 100644 --- a/mysql-test/suite/perfschema/t/aggregate.test +++ b/mysql-test/suite/perfschema/t/aggregate.test @@ -6,6 +6,10 @@ --echo "General cleanup" +# MDEV-7187 - test fails sporadically in buildbot +set @aria_checkpoint_interval_save= @@global.aria_checkpoint_interval; +set @@global.aria_checkpoint_interval= 0; + --disable_warnings drop table if exists t1; --enable_warnings @@ -188,3 +192,6 @@ update performance_schema.setup_instruments set enabled = 'YES', timed = 'YES'; drop table test.t1; + +set @@global.aria_checkpoint_interval= @aria_checkpoint_interval_save; + diff --git a/mysql-test/suite/perfschema/t/digest_null_literal.test b/mysql-test/suite/perfschema/t/digest_null_literal.test new file mode 100644 index 00000000000..91f1eec1f95 --- /dev/null +++ b/mysql-test/suite/perfschema/t/digest_null_literal.test @@ -0,0 +1,32 @@ +# ---------------------------------------------------- +# Tests for the performance schema statement Digests. +# ---------------------------------------------------- + +# Test case to show behavior of statements digest when +# parsing a NULL literal + +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/no_protocol.inc + +TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; + +--disable_query_log + +select NULL; +select NULL FROM DUAL; +select NULL, NULL; +select NULL, NULL, NULL, 1, 2, 3, NULL, NULL; + +select 1 IS NULL; +select 2 IS NOT NULL; +select 1 IS NULL, 2 IS NULL, 3 IS NOT NULL, 4 IS NOT NULL; + +create table foo (a int DEFAULT NULL, b int NOT NULL DEFAULT 1, c int NOT NULL); +drop table foo; + +--enable_query_log + +SELECT SCHEMA_NAME, DIGEST_TEXT, COUNT_STAR + FROM performance_schema.events_statements_summary_by_digest; + diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test index ae58f4089ed..c1af8516b79 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test index 8c408b160a6..a5ac18a8818 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test index ccd0ae383ee..ae1de4f032e 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'. diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test index 72d5d693a1b..361a3ce6bd1 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Hostname 'santa.claus.ipv6.example.com' does not resolve to '2001:db8::6:6'. diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test index c253e4b77d5..9dbd682681e 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '192.0.2.4' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test index 096b4b11eb4..4836dfc2d36 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test index 575dab9a337..b675b5089a8 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test index f6e5fa118df..9ce4fb926e6 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] Host name 'santa.claus.ipv6.example.com' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test index 0e0e900405a..9c8168e573a 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_auth_plugin.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc --source include/have_plugin_auth.inc diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test index 9d4707dc027..cd78087dad1 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test index d4adc3e0d00..0ced79544a3 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_max_con.test @@ -10,7 +10,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test index e396dbbad3c..983a6e80ff7 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test index cc7eb0b566f..3cdd87e4cf9 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test index 80f07989212..3a30030413f 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test index 0d11e433b58..054940e4a02 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_deny.test @@ -8,7 +8,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # [Warning] IP address '2001:db8::6:6' could not be resolved: diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test index 6dd33b9bb5b..811c5c51c26 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test index 2b30a4eaf41..c11922624c6 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_debug.inc ---source include/have_ipv6.inc +--source include/check_ipv6.inc --source include/have_perfschema.inc # Enforce a clean state diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test index 21e7260222a..29819770645 100644 --- a/mysql-test/suite/perfschema/t/nesting.test +++ b/mysql-test/suite/perfschema/t/nesting.test @@ -5,7 +5,7 @@ # On windows, the socket instrumentation collects an extra "opt" # event, which changes the test output. --source include/not_windows.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source ../include/wait_for_pfs_thread_count.inc --disable_query_log diff --git a/mysql-test/suite/perfschema/t/ortho_iter.test b/mysql-test/suite/perfschema/t/ortho_iter.test index a9990e17409..0a90831ae70 100644 --- a/mysql-test/suite/perfschema/t/ortho_iter.test +++ b/mysql-test/suite/perfschema/t/ortho_iter.test @@ -126,8 +126,9 @@ $ delimiter ;$ # Check the configuration is ok -show variables like "performance_schema%"; -show status like "performance_schema%"; +show variables where + `Variable_name` != "performance_schema_max_statement_classes" and + `Variable_name` like "performance_schema%"; call check_instrument("wait/synch/mutex/"); call check_instrument("wait/synch/rwlock/"); diff --git a/mysql-test/suite/perfschema/t/privilege_table_io.test b/mysql-test/suite/perfschema/t/privilege_table_io.test index dc17fbcf67e..833fe85e8bb 100644 --- a/mysql-test/suite/perfschema/t/privilege_table_io.test +++ b/mysql-test/suite/perfschema/t/privilege_table_io.test @@ -36,7 +36,9 @@ insert into test.marker set a = 1; # This will not, the ACL cache is already loaded insert into test.marker set a = 1; insert into test.marker set a = 1; -show variables like "performance_schema%"; +show variables where + `Variable_name` != "performance_schema_max_statement_classes" and + `Variable_name` like "performance_schema%"; show status like "performance_schema%"; # Stop recording events + pull results let $schema_to_dump= "test", "mysql"; diff --git a/mysql-test/suite/perfschema/t/rpl_gtid_func.test b/mysql-test/suite/perfschema/t/rpl_gtid_func.test index 27837572bff..5a3fe0b7894 100644 --- a/mysql-test/suite/perfschema/t/rpl_gtid_func.test +++ b/mysql-test/suite/perfschema/t/rpl_gtid_func.test @@ -1,7 +1,7 @@ --source include/not_embedded.inc --source include/have_innodb.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc -- source include/master-slave.inc diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test index fa429cd2aa3..1aa52efd937 100644 --- a/mysql-test/suite/perfschema/t/rpl_statements.test +++ b/mysql-test/suite/perfschema/t/rpl_statements.test @@ -4,7 +4,7 @@ --source include/not_embedded.inc --source include/have_innodb.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc --source include/have_binlog_format_mixed.inc --source include/master-slave.inc diff --git a/mysql-test/suite/perfschema/t/sizing_off.test b/mysql-test/suite/perfschema/t/sizing_off.test index 83b49572cb4..32729918bd1 100644 --- a/mysql-test/suite/perfschema/t/sizing_off.test +++ b/mysql-test/suite/perfschema/t/sizing_off.test @@ -2,5 +2,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc -show variables like "performance_schema%"; +show variables where + `Variable_name` != "performance_schema_max_statement_classes" and + `Variable_name` like "performance_schema%"; show status like "performance_schema%"; diff --git a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt index ab6ca1731f5..b12a8b3b70e 100644 --- a/mysql-test/suite/perfschema/t/socket_instances_func-master.opt +++ b/mysql-test/suite/perfschema/t/socket_instances_func-master.opt @@ -1 +1 @@ ---skip-name-resolve +--skip-name-resolve --bind-address=* diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test index 5ba3af1e408..c6860eb3213 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_event_name_func.test @@ -26,7 +26,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc # Set this to enable debugging output let $my_socket_debug_dbug= 0; diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test index ef5096d85ff..d06edb0d78f 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test @@ -36,7 +36,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc #=================================== diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test index 5d4b4209b6e..cefaf1de549 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func_win.test @@ -38,7 +38,7 @@ # happens per SQL statement within our MTR tests. And there is a significant # difference between standard statement execution and execution via # prepared statement. ---source ../include/no_protocol.inc +--source include/no_protocol.inc #=================================== diff --git a/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt b/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt new file mode 100644 index 00000000000..fc5065f9ae9 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_low_digest-master.opt @@ -0,0 +1 @@ +--max_digest_length=10 diff --git a/mysql-test/suite/perfschema/t/start_server_low_digest.test b/mysql-test/suite/perfschema/t/start_server_low_digest.test new file mode 100644 index 00000000000..6f06def169b --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_low_digest.test @@ -0,0 +1,21 @@ +# ----------------------------------------------------------------------- +# Tests for the performance schema statement Digests. +# ----------------------------------------------------------------------- + +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/no_protocol.inc + +USE performance_schema; +truncate table events_statements_history_long; + +# ----------------------------------------------------------------------- +# Test to show how the digest behaves with low value of +# - performance_schema_max_digest_length +# ----------------------------------------------------------------------- +SELECT 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+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+1+1+1+1+1+1+1+1; + +--echo #################################### +--echo # QUERYING PS STATEMENT DIGEST +--echo #################################### +SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long; diff --git a/mysql-test/suite/perfschema/t/statement_digest_long_query.test b/mysql-test/suite/perfschema/t/statement_digest_long_query.test index 3969383a6fb..b7ba18ef2cb 100644 --- a/mysql-test/suite/perfschema/t/statement_digest_long_query.test +++ b/mysql-test/suite/perfschema/t/statement_digest_long_query.test @@ -4,7 +4,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc USE performance_schema; truncate table events_statements_summary_by_digest; diff --git a/mysql-test/suite/perfschema/t/unary_digest.test b/mysql-test/suite/perfschema/t/unary_digest.test index c4583484f36..d8daea70d38 100644 --- a/mysql-test/suite/perfschema/t/unary_digest.test +++ b/mysql-test/suite/perfschema/t/unary_digest.test @@ -7,7 +7,7 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---source ../include/no_protocol.inc +--source include/no_protocol.inc TRUNCATE TABLE performance_schema.events_statements_summary_by_digest; diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index cc474ceb970..bf71e518f97 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -11,10 +11,13 @@ server_audit_incl_users server_audit_logging OFF server_audit_mode 0 server_audit_output_type file +server_audit_query_log_limit 1024 server_audit_syslog_facility LOG_USER server_audit_syslog_ident mysql-server_auditing server_audit_syslog_info server_audit_syslog_priority LOG_INFO +set global server_audit_file_path=null; +set global server_audit_incl_users=null; set global server_audit_file_path='server_audit.log'; set global server_audit_output_type=file; set global server_audit_logging=on; @@ -42,6 +45,11 @@ id 2 alter table t1 rename renamed_t1; set global server_audit_events='connect,query'; +select 1, +2, +3; +1 2 3 +1 2 3 insert into t2 values (1), (2); select * from t2; id @@ -66,6 +74,7 @@ server_audit_incl_users odin, root, dva, tri server_audit_logging ON server_audit_mode 0 server_audit_output_type file +server_audit_query_log_limit 1024 server_audit_syslog_facility LOG_USER server_audit_syslog_ident mysql-server_auditing server_audit_syslog_info @@ -85,6 +94,101 @@ create table sa_t1(id int); insert into sa_t1 values (1), (2); drop table sa_t1; drop database sa_db; +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +SET PASSWORD FOR u1=<secret>; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=<secret>' at line 1 +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events=''; +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +1 2 3 4 +1 2 3 4 +select 'A', 'B', 'C', 'D'; +A B C D +A B C D +set global server_audit_query_log_limit= 1024; +drop database sa_db; set global server_audit_file_path='.'; show status like 'server_audit_current_log'; Variable_name Value @@ -115,6 +219,7 @@ server_audit_incl_users odin, root, dva, tri server_audit_logging ON server_audit_mode 1 server_audit_output_type file +server_audit_query_log_limit 1024 server_audit_syslog_facility LOG_USER server_audit_syslog_ident mysql-server_auditing server_audit_syslog_info @@ -148,6 +253,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID @@ -184,19 +290,78 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'.\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'.\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\' \'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\' \'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'nonexisting_dir/\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_file_path=\'nonexisting_dir/\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'SHOW WARNINGS',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show status like \'server_audit_current_log\'',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show variables like \'server_audit%\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'(select 2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_query_log_limit= 1024',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SHOW WARNINGS',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show variables like \'server_audit%\'',0 TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,plugin, -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'uninstall plugin server_audit',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'uninstall plugin server_audit',0 diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result new file mode 100644 index 00000000000..bf71e518f97 --- /dev/null +++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result @@ -0,0 +1,367 @@ +install plugin server_audit soname 'server_audit'; +show variables like 'server_audit%'; +Variable_name Value +server_audit_events +server_audit_excl_users +server_audit_file_path server_audit.log +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users +server_audit_logging OFF +server_audit_mode 0 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +set global server_audit_file_path=null; +set global server_audit_incl_users=null; +set global server_audit_file_path='server_audit.log'; +set global server_audit_output_type=file; +set global server_audit_logging=on; +connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'no_such_user'@'localhost' (using password: NO) +set global server_audit_incl_users='odin, dva, tri'; +create table t1 (id int); +set global server_audit_incl_users='odin, root, dva, tri'; +create table t2 (id int); +set global server_audit_excl_users='odin, dva, tri'; +Warnings: +Warning 1 User 'odin' is in the server_audit_incl_users, so wasn't added. +Warning 1 User 'dva' is in the server_audit_incl_users, so wasn't added. +Warning 1 User 'tri' is in the server_audit_incl_users, so wasn't added. +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +set global server_audit_incl_users='odin, root, dva, tri'; +insert into t2 values (1), (2); +select * from t2; +id +1 +2 +alter table t1 rename renamed_t1; +set global server_audit_events='connect,query'; +select 1, +2, +3; +1 2 3 +1 2 3 +insert into t2 values (1), (2); +select * from t2; +id +1 +2 +1 +2 +select * from t_doesnt_exist; +ERROR 42S02: Table 'test.t_doesnt_exist' doesn't exist +syntax_error_query; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'syntax_error_query' at line 1 +drop table renamed_t1, t2; +show variables like 'server_audit%'; +Variable_name Value +server_audit_events CONNECT,QUERY +server_audit_excl_users +server_audit_file_path server_audit.log +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users odin, root, dva, tri +server_audit_logging ON +server_audit_mode 0 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +set global server_audit_mode=1; +set global server_audit_events=''; +create database sa_db; +create table t1 (id2 int); +insert into t1 values (1), (2); +select * from t1; +id2 +1 +2 +drop table t1; +use sa_db; +create table sa_t1(id int); +insert into sa_t1 values (1), (2); +drop table sa_t1; +drop database sa_db; +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +id +1 +2 +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +SET PASSWORD FOR u1=<secret>; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=<secret>' at line 1 +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +2 +2 +(select 2); +2 +2 +/*! select 2*/; +2 +2 +/*comment*/ select 2; +2 +2 +drop table t1; +set global server_audit_events=''; +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +1 2 3 4 +1 2 3 4 +select 'A', 'B', 'C', 'D'; +A B C D +A B C D +set global server_audit_query_log_limit= 1024; +drop database sa_db; +set global server_audit_file_path='.'; +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log HOME_DIR/server_audit.log +set global server_audit_file_path=''; +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log server_audit.log +set global server_audit_file_path=' '; +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log server_audit.log +set global server_audit_file_path='nonexisting_dir/'; +Warnings: +Warning 1 SERVER AUDIT plugin can't create file 'nonexisting_dir/'. +show status like 'server_audit_current_log'; +Variable_name Value +Server_audit_current_log server_audit.log +show variables like 'server_audit%'; +Variable_name Value +server_audit_events +server_audit_excl_users +server_audit_file_path +server_audit_file_rotate_now OFF +server_audit_file_rotate_size 1000000 +server_audit_file_rotations 9 +server_audit_incl_users odin, root, dva, tri +server_audit_logging ON +server_audit_mode 1 +server_audit_output_type file +server_audit_query_log_limit 1024 +server_audit_syslog_facility LOG_USER +server_audit_syslog_ident mysql-server_auditing +server_audit_syslog_info +server_audit_syslog_priority LOG_INFO +uninstall plugin server_audit; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0 +TIME,HOSTNAME,root,localhost,ID,0,CONNECT,mysql,,0 +TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,mysql,,0 +TIME,HOSTNAME,no_such_user,localhost,ID,0,FAILED_CONNECT,,,ID +TIME,HOSTNAME,no_such_user,localhost,ID,0,DISCONNECT,,,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t2 (id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_excl_users=\'odin, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'SHOW WARNINGS',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_incl_users=\'odin, root, dva, tri\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t2, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,ALTER,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, +TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'syntax_error_query',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table renamed_t1, t2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'show variables like \'server_audit%\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_mode=1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,0,CONNECT,test,,0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create table t1 (id2 int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, +TIME,HOSTNAME,root,localhost,ID,ID,DROP,test,t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,CREATE,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table sa_t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into sa_t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,table_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,column_stats, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats, +TIME,HOSTNAME,root,localhost,ID,ID,DROP,sa_db,sa_t1, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table sa_t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'create table t1(id int)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop table t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select * from t1',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'(select 2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select \'A\', ',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_query_log_limit= 1024',0 +TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'.\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\' \'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_file_path=\'nonexisting_dir/\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SHOW WARNINGS',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show status like \'server_audit_current_log\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'show variables like \'server_audit%\'',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,plugin, +TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'uninstall plugin server_audit',0 diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index 869fd944d51..52428909c3b 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -8,13 +8,17 @@ if (!$SERVER_AUDIT_SO) { install plugin server_audit soname 'server_audit'; show variables like 'server_audit%'; +set global server_audit_file_path=null; +set global server_audit_incl_users=null; set global server_audit_file_path='server_audit.log'; set global server_audit_output_type=file; set global server_audit_logging=on; +--sleep 2 connect (con1,localhost,root,,mysql); connection default; disconnect con1; --sleep 2 +--sleep 2 --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_ACCESS_DENIED_ERROR connect (con1,localhost,no_such_user,,mysql); @@ -32,6 +36,9 @@ insert into t2 values (1), (2); select * from t2; alter table t1 rename renamed_t1; set global server_audit_events='connect,query'; +select 1, + 2, + 3; insert into t2 values (1), (2); select * from t2; --error ER_NO_SUCH_TABLE @@ -46,6 +53,8 @@ create database sa_db; --sleep 2 connect (con1,localhost,root,,test); connection con1; +--sleep 2 +--sleep 2 create table t1 (id2 int); insert into t1 values (1), (2); select * from t1; @@ -57,8 +66,64 @@ drop table sa_t1; drop database sa_db; connection default; disconnect con1; - --sleep 2 +--sleep 2 +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; + +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +--error 1064 +SET PASSWORD FOR u1=<secret>; +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events=''; + +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +select 'A', 'B', 'C', 'D'; +set global server_audit_query_log_limit= 1024; +drop database sa_db; + set global server_audit_file_path='.'; --replace_regex /\.[\\\/]/HOME_DIR\// show status like 'server_audit_current_log'; diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.opt b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt new file mode 100644 index 00000000000..30953d0c574 --- /dev/null +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.opt @@ -0,0 +1,2 @@ +--thread_handling=pool-of-threads + diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test new file mode 100644 index 00000000000..626d4136c47 --- /dev/null +++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test @@ -0,0 +1,144 @@ +--source include/not_embedded.inc +--source include/have_pool_of_threads.inc + +if (!$SERVER_AUDIT_SO) { + skip No SERVER_AUDIT plugin; +} + +install plugin server_audit soname 'server_audit'; + +show variables like 'server_audit%'; +set global server_audit_file_path=null; +set global server_audit_incl_users=null; +set global server_audit_file_path='server_audit.log'; +set global server_audit_output_type=file; +set global server_audit_logging=on; +--sleep 2 +connect (con1,localhost,root,,mysql); +connection default; +disconnect con1; +--sleep 2 +--sleep 2 +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_ACCESS_DENIED_ERROR +connect (con1,localhost,no_such_user,,mysql); +connection default; +--sleep 2 +set global server_audit_incl_users='odin, dva, tri'; +create table t1 (id int); +set global server_audit_incl_users='odin, root, dva, tri'; +create table t2 (id int); +set global server_audit_excl_users='odin, dva, tri'; +insert into t1 values (1), (2); +select * from t1; +set global server_audit_incl_users='odin, root, dva, tri'; +insert into t2 values (1), (2); +select * from t2; +alter table t1 rename renamed_t1; +set global server_audit_events='connect,query'; +select 1, + 2, + 3; +insert into t2 values (1), (2); +select * from t2; +--error ER_NO_SUCH_TABLE +select * from t_doesnt_exist; +--error 1064 +syntax_error_query; +drop table renamed_t1, t2; +show variables like 'server_audit%'; +set global server_audit_mode=1; +set global server_audit_events=''; +create database sa_db; +--sleep 2 +connect (con1,localhost,root,,test); +connection con1; +--sleep 2 +--sleep 2 +create table t1 (id2 int); +insert into t1 values (1), (2); +select * from t1; +drop table t1; +use sa_db; +create table sa_t1(id int); +insert into sa_t1 values (1), (2); +drop table sa_t1; +drop database sa_db; +connection default; +disconnect con1; +--sleep 2 +--sleep 2 +create database sa_db; +use sa_db; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; + +set global server_audit_events='query_ddl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_ddl,query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +drop table t1; +set global server_audit_events='query_dml'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events='query_dcl'; +create table t1(id int); +insert into t1 values (1), (2); +select * from t1; +CREATE USER u1 IDENTIFIED BY 'pwd-123'; +GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321"; +SET PASSWORD FOR u1 = PASSWORD('pwd 098'); +--error 1064 +SET PASSWORD FOR u1=<secret>; +CREATE USER u3 IDENTIFIED BY ''; +drop user u1, u2, u3; +select 2; +(select 2); +/*! select 2*/; +/*comment*/ select 2; +drop table t1; +set global server_audit_events=''; + +set global server_audit_query_log_limit= 15; +select (1), (2), (3), (4); +select 'A', 'B', 'C', 'D'; +set global server_audit_query_log_limit= 1024; +drop database sa_db; + +set global server_audit_file_path='.'; +--replace_regex /\.[\\\/]/HOME_DIR\// +show status like 'server_audit_current_log'; +set global server_audit_file_path=''; +show status like 'server_audit_current_log'; +set global server_audit_file_path=' '; +show status like 'server_audit_current_log'; +set global server_audit_file_path='nonexisting_dir/'; +show status like 'server_audit_current_log'; +show variables like 'server_audit%'; +uninstall plugin server_audit; + +let $MYSQLD_DATADIR= `SELECT @@datadir`; +# replace the timestamp and the hostname with constant values +--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,/TIME,HOSTNAME,/ /\,[1-9][0-9]*\,/,1,/ /\,[1-9][0-9]*/,ID/ +cat_file $MYSQLD_DATADIR/server_audit.log; +remove_file $MYSQLD_DATADIR/server_audit.log; + diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result index 2974dd20e22..79c6f412111 100644 --- a/mysql-test/suite/roles/create_and_drop_role.result +++ b/mysql-test/suite/roles/create_and_drop_role.result @@ -46,3 +46,21 @@ Note 1449 The user specified as a definer ('u1'@'%') does not exist create user foo@bar; drop user foo@bar; drop role r1; +CREATE USER u1; +CREATE ROLE r1; +CREATE USER r1@localhost; +CREATE ROLE r2; +GRANT r2 to r1; +GRANT r2 to r1@localhost; +DROP ROLE r1; +SELECT * FROM mysql.roles_mapping; +Host User Role Admin_option +localhost r1 r2 N +localhost root r2 Y +SHOW GRANTS FOR r1@localhost; +Grants for r1@localhost +GRANT r2 TO 'r1'@'localhost' +GRANT USAGE ON *.* TO 'r1'@'localhost' +DROP USER u1; +DROP ROLE r2; +DROP USER r1@localhost; diff --git a/mysql-test/suite/roles/create_and_drop_role.test b/mysql-test/suite/roles/create_and_drop_role.test index 38f040789e0..0bf5b744e6b 100644 --- a/mysql-test/suite/roles/create_and_drop_role.test +++ b/mysql-test/suite/roles/create_and_drop_role.test @@ -68,3 +68,22 @@ create user foo@bar; drop user foo@bar; drop role r1; +# +# MDEV-7774 Assertion `status == 0' fails when dropping in this order: +# +CREATE USER u1; +CREATE ROLE r1; +CREATE USER r1@localhost; +CREATE ROLE r2; +GRANT r2 to r1; +GRANT r2 to r1@localhost; +# MDEV-7774: Dropping in this order caused the crash. +DROP ROLE r1; +--sorted_result +SELECT * FROM mysql.roles_mapping; +SHOW GRANTS FOR r1@localhost; # Related to MDEV-7774, also caused a crash, by + # not updating the internal acl_roles_mapping + # data structure correctly; +DROP USER u1; +DROP ROLE r2; +DROP USER r1@localhost; diff --git a/mysql-test/suite/rpl/r/rpl_drop_db_fail.result b/mysql-test/suite/rpl/r/rpl_drop_db_fail.result new file mode 100644 index 00000000000..1be90338493 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_drop_db_fail.result @@ -0,0 +1,16 @@ +include/master-slave.inc +[connection master] +CREATE DATABASE IF NOT EXISTS db1; +CREATE DATABASE IF NOT EXISTS db2; +use db1; +CREATE TABLE a(id INT); +CREATE VIEW v AS SELECT * FROM a; +CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB; +use db2; +CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB; +ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id); +DROP DATABASE db1; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +DROP DATABASE db2; +DROP DATABASE db1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result index 465cc875af0..f3b52d89eb4 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result @@ -310,7 +310,7 @@ master_gtid_wait('2-1-10') 0 master_gtid_wait('2-1-10') 0 -*** Test sql_gtid_slave_pos when used with GTID *** +*** Test gtid_slave_pos when used with GTID *** include/stop_slave.inc SET gtid_domain_id=2; SET gtid_seq_no=1000; @@ -413,5 +413,26 @@ SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex status Ok SET GLOBAL slave_ddl_exec_mode= @saved_mode; +*** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. *** +SET gtid_domain_id= @@GLOBAL.gtid_domain_id; +INSERT INTO t1 VALUES (31); +SET gtid_domain_id= @@GLOBAL.gtid_domain_id; +INSERT INTO t1 VALUES (32); +INSERT INTO t1 VALUES (33); +include/stop_slave.inc +INSERT INTO t1 VALUES (34); +include/start_slave.inc +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +a +31 +32 +33 +34 +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +a +31 +32 +33 +34 DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result index 75bd9d0cbb1..0c2249f2dce 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result @@ -267,5 +267,55 @@ a 24 26 27 +*** MDEV-6391: GTID binlog state not recovered if mariadb-bin.state is removed *** +include/stop_slave.inc +INSERT INTO t1 VALUES (30); +SET @old_server_id= @@server_id; +SET @old_domain_id= @@gtid_domain_id; +SET SESSION server_id= 10; +INSERT INTO t1 VALUES (31); +INSERT INTO t1 VALUES (32); +SET SESSION gtid_domain_id= 1; +SET SESSION server_id=11; +INSERT INTO t1 VALUES (33); +SET SESSION gtid_domain_id= 2; +INSERT INTO t1 VALUES (34); +SET SESSION server_id= 10; +INSERT INTO t1 VALUES (35); +INSERT INTO t1 VALUES (36); +SET SESSION gtid_domain_id= 0; +SET SESSION server_id= 12; +INSERT INTO t1 VALUES (37); +SET SESSION gtid_domain_id= @old_domain_id; +SET SESSION server_id= @old_server_id; +INSERT INTO t1 VALUES (38); +INSERT INTO t1 VALUES (39); +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +a +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +a +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 DROP TABLE t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result index 385a374888c..a2bf8b567e8 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result @@ -179,7 +179,7 @@ a SET sql_log_bin=0; CALL mtr.add_suppression("Slave: Could not update replication slave gtid state"); SET sql_log_bin=1; -*** MDEV-4906: When event apply fails, next SQL thread start errorneously commits the failing GTID to gtid_slave_pos *** +*** MDEV-4906: When event apply fails, next SQL thread start erroneously commits the failing GTID to gtid_slave_pos *** include/stop_slave.inc SET sql_log_bin=0; DELETE FROM t2; diff --git a/mysql-test/suite/rpl/r/rpl_gtid_misc.result b/mysql-test/suite/rpl/r/rpl_gtid_misc.result new file mode 100644 index 00000000000..cdaac1b1d34 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_gtid_misc.result @@ -0,0 +1,25 @@ +include/master-slave.inc +[connection master] +*** MDEV-6403: Temporary tables lost at STOP SLAVE in GTID mode if master has not rotated binlog since restart *** +CREATE TABLE t1 (a INT PRIMARY KEY); +include/stop_slave.inc +SET sql_log_bin= 0; +INSERT INTO t1 VALUES (1); +SET sql_log_bin= 1; +CHANGE MASTER TO master_use_gtid= current_pos; +CREATE TEMPORARY TABLE t2 LIKE t1; +INSERT INTO t2 VALUE (1); +INSERT INTO t1 SELECT * FROM t2; +DROP TEMPORARY TABLE t2; +START SLAVE; +include/wait_for_slave_sql_error.inc [errno=1062] +STOP SLAVE IO_THREAD; +SET sql_log_bin= 0; +DELETE FROM t1 WHERE a=1; +SET sql_log_bin= 1; +include/start_slave.inc +SELECT * FROM t1 ORDER BY a; +a +1 +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until.result b/mysql-test/suite/rpl/r/rpl_gtid_until.result index d86b5cac78c..c23faecc674 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_until.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_until.result @@ -44,14 +44,14 @@ a 1 2 include/stop_slave.inc -START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200"; +START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200,0-1-300"; include/wait_for_slave_to_start.inc Using_Gtid = 'Current_Pos' Until_Condition = 'Gtid' +INSERT INTO t1 VALUES (3); +DELETE FROM t1 WHERE a=3; include/stop_slave.inc -include/start_slave.inc *** Test UNTIL condition in an earlier binlog than the start GTID. *** -include/stop_slave.inc SET gtid_domain_id = 1; INSERT INTO t1 VALUES (3); SET gtid_domain_id = 2; diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result index bf4347757f7..78bda5a1c6f 100644 --- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result +++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result @@ -18,4 +18,26 @@ show slave status; select master_pos_wait('foo', 98); master_pos_wait('foo', 98) NULL +*** MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout *** +include/stop_slave.inc +reset slave all; +change master 'my_slave' to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root'; +set default_master_connection = 'my_slave'; +include/start_slave.inc +# Call without connection name -- works (expected -1) +select master_pos_wait('master-bin.000001',1000000,1); +master_pos_wait('master-bin.000001',1000000,1) +-1 +set default_master_connection = ''; +# Call for non-existing anonymous connection -- works (expected NULL) +select master_pos_wait('master-bin.000001',1000000,1); +master_pos_wait('master-bin.000001',1000000,1) +NULL +# Call with a valid connection name -- hangs before MDEV-7130 fix (expected -1) +select master_pos_wait('master-bin.000001',1000000,1,"my_slave"); +master_pos_wait('master-bin.000001',1000000,1,"my_slave") +-1 +STOP SLAVE 'my_slave'; +RESET SLAVE 'my_slave' ALL; +change master to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root'; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_old_decimal.result b/mysql-test/suite/rpl/r/rpl_old_decimal.result new file mode 100644 index 00000000000..3e2fa3bf241 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_old_decimal.result @@ -0,0 +1,9 @@ +include/master-slave.inc +[connection master] +CREATE TABLE t1dec102 (a DECIMAL(10,2)); +INSERT INTO t1dec102 VALUES(999.99); +call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677"); +include/wait_for_slave_sql_error_and_skip.inc [errno=1677] +Last_SQL_Error = 'Column 0 of table 'test.t1dec102' cannot be converted from type 'decimal(0,?)/*old*/' to type 'decimal(10,2)'' +DROP TABLE t1dec102; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result index 7ceb5ee6622..124b7c9a029 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel.result +++ b/mysql-test/suite/rpl/r/rpl_parallel.result @@ -4,8 +4,22 @@ SET GLOBAL slave_parallel_threads=10; ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first include/stop_slave.inc SET GLOBAL slave_parallel_threads=10; +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) +OK CHANGE MASTER TO master_use_gtid=slave_pos; include/start_slave.inc +SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) +OK +include/stop_slave.inc +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) +OK +include/start_slave.inc +SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) +OK *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 *** ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM; @@ -1136,11 +1150,510 @@ SET GLOBAL debug_dbug=@old_dbug; SET GLOBAL slave_parallel_threads=0; SET GLOBAL slave_parallel_threads=10; include/start_slave.inc +*** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption *** +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=1; +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000"; +INSERT INTO t2 VALUES (101); +INSERT INTO t2 VALUES (102); +INSERT INTO t2 VALUES (103); +INSERT INTO t2 VALUES (104); +INSERT INTO t2 VALUES (105); +SET gtid_seq_no=1000; +INSERT INTO t2 VALUES (106); +INSERT INTO t2 VALUES (107); +INSERT INTO t2 VALUES (108); +INSERT INTO t2 VALUES (109); +INSERT INTO t2 VALUES (110); +INSERT INTO t2 VALUES (111); +INSERT INTO t2 VALUES (112); +INSERT INTO t2 VALUES (113); +INSERT INTO t2 VALUES (114); +INSERT INTO t2 VALUES (115); +INSERT INTO t2 VALUES (116); +INSERT INTO t2 VALUES (117); +INSERT INTO t2 VALUES (118); +INSERT INTO t2 VALUES (119); +INSERT INTO t2 VALUES (120); +INSERT INTO t2 VALUES (121); +INSERT INTO t2 VALUES (122); +INSERT INTO t2 VALUES (123); +INSERT INTO t2 VALUES (124); +INSERT INTO t2 VALUES (125); +INSERT INTO t2 VALUES (126); +INSERT INTO t2 VALUES (127); +INSERT INTO t2 VALUES (128); +INSERT INTO t2 VALUES (129); +INSERT INTO t2 VALUES (130); +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t2 WHERE a >= 100 ORDER BY a; +a +101 +102 +103 +104 +105 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=10; +include/start_slave.inc +*** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging *** +*** MDEV-7882: Excessive transaction retry in parallel replication *** +CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=40; +SELECT @old_retries:=@@GLOBAL.slave_transaction_retries; +@old_retries:=@@GLOBAL.slave_transaction_retries +10 +SET GLOBAL slave_transaction_retries= 5; +INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5); +SET @old_dbug= @@SESSION.debug_dbug; +SET @commit_id= 42; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +INSERT INTO t8 VALUES (1,1); +INSERT INTO t8 VALUES (2,2); +INSERT INTO t8 VALUES (3,3); +INSERT INTO t8 VALUES (4,4); +INSERT INTO t8 VALUES (5,5); +INSERT INTO t8 VALUES (6,6); +INSERT INTO t8 VALUES (7,7); +INSERT INTO t8 VALUES (8,8); +UPDATE t7 SET b=9 WHERE a=3; +UPDATE t7 SET b=10 WHERE a=3; +UPDATE t7 SET b=11 WHERE a=3; +INSERT INTO t8 VALUES (12,12); +INSERT INTO t8 VALUES (13,13); +UPDATE t7 SET b=14 WHERE a=3; +UPDATE t7 SET b=15 WHERE a=3; +INSERT INTO t8 VALUES (16,16); +UPDATE t7 SET b=17 WHERE a=3; +INSERT INTO t8 VALUES (18,18); +INSERT INTO t8 VALUES (19,19); +UPDATE t7 SET b=20 WHERE a=3; +INSERT INTO t8 VALUES (21,21); +UPDATE t7 SET b=22 WHERE a=3; +INSERT INTO t8 VALUES (23,24); +INSERT INTO t8 VALUES (24,24); +UPDATE t7 SET b=25 WHERE a=3; +INSERT INTO t8 VALUES (26,26); +UPDATE t7 SET b=27 WHERE a=3; +BEGIN; +INSERT INTO t8 VALUES (28,28); +INSERT INTO t8 VALUES (29,28), (30,28); +INSERT INTO t8 VALUES (31,28); +INSERT INTO t8 VALUES (32,28); +INSERT INTO t8 VALUES (33,28); +INSERT INTO t8 VALUES (34,28); +INSERT INTO t8 VALUES (35,28); +INSERT INTO t8 VALUES (36,28); +INSERT INTO t8 VALUES (37,28); +INSERT INTO t8 VALUES (38,28); +INSERT INTO t8 VALUES (39,28); +INSERT INTO t8 VALUES (40,28); +INSERT INTO t8 VALUES (41,28); +INSERT INTO t8 VALUES (42,28); +COMMIT; +SET @commit_id=43; +INSERT INTO t8 VALUES (43,43); +INSERT INTO t8 VALUES (44,44); +UPDATE t7 SET b=45 WHERE a=3; +INSERT INTO t8 VALUES (46,46); +INSERT INTO t8 VALUES (47,47); +UPDATE t7 SET b=48 WHERE a=3; +INSERT INTO t8 VALUES (49,49); +INSERT INTO t8 VALUES (50,50); +SET @commit_id=44; +INSERT INTO t8 VALUES (51,51); +INSERT INTO t8 VALUES (52,52); +UPDATE t7 SET b=53 WHERE a=3; +INSERT INTO t8 VALUES (54,54); +INSERT INTO t8 VALUES (55,55); +UPDATE t7 SET b=56 WHERE a=3; +INSERT INTO t8 VALUES (57,57); +UPDATE t7 SET b=58 WHERE a=3; +INSERT INTO t8 VALUES (58,58); +INSERT INTO t8 VALUES (59,59); +INSERT INTO t8 VALUES (60,60); +INSERT INTO t8 VALUES (61,61); +UPDATE t7 SET b=62 WHERE a=3; +INSERT INTO t8 VALUES (63,63); +INSERT INTO t8 VALUES (64,64); +INSERT INTO t8 VALUES (65,65); +INSERT INTO t8 VALUES (66,66); +UPDATE t7 SET b=67 WHERE a=3; +INSERT INTO t8 VALUES (68,68); +UPDATE t7 SET b=69 WHERE a=3; +UPDATE t7 SET b=70 WHERE a=3; +UPDATE t7 SET b=71 WHERE a=3; +INSERT INTO t8 VALUES (72,72); +UPDATE t7 SET b=73 WHERE a=3; +UPDATE t7 SET b=74 WHERE a=3; +UPDATE t7 SET b=75 WHERE a=3; +UPDATE t7 SET b=76 WHERE a=3; +INSERT INTO t8 VALUES (77,77); +UPDATE t7 SET b=78 WHERE a=3; +INSERT INTO t8 VALUES (79,79); +UPDATE t7 SET b=80 WHERE a=3; +INSERT INTO t8 VALUES (81,81); +UPDATE t7 SET b=82 WHERE a=3; +INSERT INTO t8 VALUES (83,83); +UPDATE t7 SET b=84 WHERE a=3; +SET @commit_id=45; +INSERT INTO t8 VALUES (85,85); +UPDATE t7 SET b=86 WHERE a=3; +INSERT INTO t8 VALUES (87,87); +SET @commit_id=46; +INSERT INTO t8 VALUES (88,88); +INSERT INTO t8 VALUES (89,89); +INSERT INTO t8 VALUES (90,90); +SET SESSION debug_dbug=@old_dbug; +INSERT INTO t8 VALUES (91,91); +INSERT INTO t8 VALUES (92,92); +INSERT INTO t8 VALUES (93,93); +INSERT INTO t8 VALUES (94,94); +INSERT INTO t8 VALUES (95,95); +INSERT INTO t8 VALUES (96,96); +INSERT INTO t8 VALUES (97,97); +INSERT INTO t8 VALUES (98,98); +INSERT INTO t8 VALUES (99,99); +SELECT * FROM t7 ORDER BY a; +a b +1 1 +2 2 +3 86 +4 4 +5 5 +SELECT * FROM t8 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +12 12 +13 13 +16 16 +18 18 +19 19 +21 21 +23 24 +24 24 +26 26 +28 28 +29 28 +30 28 +31 28 +32 28 +33 28 +34 28 +35 28 +36 28 +37 28 +38 28 +39 28 +40 28 +41 28 +42 28 +43 43 +44 44 +46 46 +47 47 +49 49 +50 50 +51 51 +52 52 +54 54 +55 55 +57 57 +58 58 +59 59 +60 60 +61 61 +63 63 +64 64 +65 65 +66 66 +68 68 +72 72 +77 77 +79 79 +81 81 +83 83 +85 85 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t7 ORDER BY a; +a b +1 1 +2 2 +3 86 +4 4 +5 5 +SELECT * FROM t8 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +12 12 +13 13 +16 16 +18 18 +19 19 +21 21 +23 24 +24 24 +26 26 +28 28 +29 28 +30 28 +31 28 +32 28 +33 28 +34 28 +35 28 +36 28 +37 28 +38 28 +39 28 +40 28 +41 28 +42 28 +43 43 +44 44 +46 46 +47 47 +49 49 +50 50 +51 51 +52 52 +54 54 +55 55 +57 57 +58 58 +59 59 +60 60 +61 61 +63 63 +64 64 +65 65 +66 66 +68 68 +72 72 +77 77 +79 79 +81 81 +83 83 +85 85 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +include/stop_slave.inc +SET GLOBAL slave_transaction_retries= @old_retries; +SET GLOBAL slave_parallel_threads=10; +include/start_slave.inc +*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang *** +include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep'; +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10000; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +INSERT INTO t3 VALUES (120, 0); +SET @commit_id= 10001; +INSERT INTO t3 VALUES (121, 0); +SET SESSION debug_dbug=@old_dbug; +SELECT * FROM t3 WHERE a >= 120 ORDER BY a; +a b +120 0 +121 0 +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t3 WHERE a >= 120 ORDER BY a; +a b +120 0 +121 0 +include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +include/start_slave.inc +*** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. *** +include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep'; +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +SET @old_server_id= @@SESSION.server_id; +SET SESSION server_id= 100; +SET @commit_id= 10010; +ALTER TABLE t1 COMMENT "Hulubulu!"; +SET SESSION server_id= @old_server_id; +INSERT INTO t3 VALUES (130, 0); +SET @commit_id= 10011; +INSERT INTO t3 VALUES (131, 0); +SET SESSION debug_dbug=@old_dbug; +SELECT * FROM t3 WHERE a >= 130 ORDER BY a; +a b +130 0 +131 0 +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t3 WHERE a >= 130 ORDER BY a; +a b +130 0 +131 0 +include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +include/start_slave.inc +*** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) *** +INSERT INTO t3 VALUES (201,0), (202,0); +include/save_master_gtid.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_mdev8031'; +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10200; +INSERT INTO t3 VALUES (203, 1); +INSERT INTO t3 VALUES (204, 1); +INSERT INTO t3 VALUES (205, 1); +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=205; +UPDATE t3 SET b=b+1 WHERE a=205; +SET SESSION debug_dbug=@old_dbug; +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +a b +201 3 +202 4 +203 4 +204 4 +205 3 +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +a b +201 3 +202 4 +203 4 +204 4 +205 3 +include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +include/start_slave.inc +*** Check getting deadlock killed inside open_binlog() during retry. *** +include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill'; +SET @old_max= @@GLOBAL.max_relay_log_size; +SET GLOBAL max_relay_log_size= 4096; +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10210; +Omit long queries that cause relaylog rotations and transaction retries... +SET SESSION debug_dbug=@old_dbug; +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +a b +201 6 +202 8 +203 7 +204 7 +205 5 +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +a b +201 6 +202 8 +203 7 +204 7 +205 5 +include/stop_slave.inc +SET GLOBAL debug_dbug= @old_debg; +SET GLOBAL max_relay_log_size= @old_max; +include/start_slave.inc include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc SET DEBUG_SYNC= 'RESET'; DROP function foo; -DROP TABLE t1,t2,t3,t4,t5,t6; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8; SET DEBUG_SYNC= 'RESET'; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel2.result b/mysql-test/suite/rpl/r/rpl_parallel2.result index 8bf8b9caf3b..de90bcd158f 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel2.result +++ b/mysql-test/suite/rpl/r/rpl_parallel2.result @@ -12,6 +12,23 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc include/wait_for_slave_param.inc [Seconds_Behind_Master] Seconds_Behind_Master should be zero here because the slave is fully caught up and idle. Seconds_Behind_Master = '0' +*** MDEV-8294: Inconsistent behavior of slave parallel threads at runtime *** +INSERT INTO t1 VALUES (10,0); +SET sql_log_bin= 0; +DELETE FROM t1 WHERE a=10; +SET sql_log_bin= 1; +INSERT INTO t1 VALUES (10,0); +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; +a b +10 0 +include/wait_for_slave_sql_error.inc [errno=1062] +SET GLOBAL slave_parallel_threads=8; +STOP SLAVE; +SET GLOBAL sql_slave_skip_counter= 1; +include/start_slave.inc +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; +a b +10 0 include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result b/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result new file mode 100644 index 00000000000..d681fd7546d --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result @@ -0,0 +1,147 @@ +include/master-slave.inc +[connection master] +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=10; +CHANGE MASTER TO master_use_gtid=current_pos; +include/start_slave.inc +*** MDEV-6589: Incorrect relay log start position when restarting SQL thread after error in parallel replication *** +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +SELECT * FROM t1; +a +1 +SELECT * FROM t2; +a +1 +SET sql_log_bin=0; +BEGIN; +INSERT INTO t2 VALUES (5); +SET gtid_domain_id=0; +INSERT INTO t1 VALUES (2); +INSERT INTO t2 VALUES (3); +FLUSH LOGS; +INSERT INTO t1 VALUES (4); +SET gtid_domain_id=1; +INSERT INTO t2 VALUES (5); +SET gtid_domain_id=0; +INSERT INTO t1 VALUES (6); +INSERT INTO t1 VALUES (7); +SET gtid_domain_id=2; +INSERT INTO t2 VALUES (8); +INSERT INTO t1 VALUES (9); +FLUSH LOGS; +SET gtid_domain_id=3; +INSERT INTO t2 VALUES (10); +INSERT INTO t1 VALUES (11); +SET gtid_domain_id=1; +INSERT INTO t1 VALUES (12); +INSERT INTO t2 VALUES (13); +SET gtid_domain_id=0; +INSERT INTO t2 VALUES (14); +FLUSH LOGS; +SET gtid_domain_id=3; +INSERT INTO t2 VALUES (15); +SET gtid_domain_id=2; +INSERT INTO t2 VALUES (16); +SET gtid_domain_id=0; +INSERT INTO t1 VALUES (17); +SET @gtid0 = @@last_gtid; +SET gtid_domain_id=2; +INSERT INTO t1 VALUES (18); +SET @gtid2 = @@last_gtid; +SET gtid_domain_id=3; +INSERT INTO t1 VALUES (19); +SET @gtid3 = @@last_gtid; +SELECT * FROM t1 ORDER BY a; +a +1 +2 +4 +6 +7 +9 +11 +12 +17 +18 +19 +SELECT * FROM t2 ORDER BY a; +a +1 +3 +5 +8 +10 +13 +14 +15 +16 +include/save_master_gtid.inc +SELECT MASTER_GTID_WAIT('WAIT_POS'); +MASTER_GTID_WAIT('WAIT_POS') +0 +COMMIT; +SET sql_log_bin=1; +include/wait_for_slave_sql_error.inc [errno=1062] +SELECT * FROM t1 ORDER BY a; +a +1 +2 +4 +6 +7 +9 +11 +17 +18 +19 +SELECT * FROM t2 ORDER BY a; +a +1 +3 +5 +8 +10 +14 +15 +16 +SET sql_log_bin=0; +DELETE FROM t2 WHERE a=5; +SET sql_log_bin=1; +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a +1 +2 +4 +6 +7 +9 +11 +12 +17 +18 +19 +SELECT * FROM t2 ORDER BY a; +a +1 +3 +5 +8 +10 +13 +14 +15 +16 +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +include/start_slave.inc +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1,t2; +SET DEBUG_SYNC= 'RESET'; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result b/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result new file mode 100644 index 00000000000..47bf2ff887f --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result @@ -0,0 +1,52 @@ +include/rpl_init.inc [topology=1->2->3] +*** MDEV-7668: Intermediate master groups CREATE with INSERT, causing parallel replication failure *** +SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates; +SET GLOBAL binlog_direct_non_transactional_updates=OFF; +SET SESSION binlog_direct_non_transactional_updates=OFF; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +include/stop_slave.inc +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +SET GLOBAL slave_parallel_threads=10; +SET @old_commit_count=@@GLOBAL.binlog_commit_wait_count; +SET GLOBAL binlog_commit_wait_count=2; +SET @old_commit_usec=@@GLOBAL.binlog_commit_wait_usec; +SET GLOBAL binlog_commit_wait_usec=2000000; +SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates; +SET GLOBAL binlog_direct_non_transactional_updates=OFF; +SET SESSION binlog_direct_non_transactional_updates=OFF; +CHANGE MASTER TO master_use_gtid=current_pos; +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=10; +CHANGE MASTER TO master_use_gtid=current_pos; +BEGIN; +CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY; +COMMIT; +INSERT INTO t2 VALUES (1); +INSERT INTO t1 SELECT a, a*10 FROM t2; +DROP TABLE t2; +include/save_master_gtid.inc +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a b +1 10 +include/start_slave.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; +a b +1 10 +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +SET GLOBAL binlog_commit_wait_count=@old_commit_count; +SET GLOBAL binlog_commit_wait_usec=@old_commit_usec; +SET GLOBAL binlog_direct_non_transactional_updates= @old_updates; +include/start_slave.inc +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +include/start_slave.inc +SET GLOBAL binlog_direct_non_transactional_updates= @old_updates; +CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table"); +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_partition.result b/mysql-test/suite/rpl/r/rpl_parallel_partition.result new file mode 100644 index 00000000000..e0cfe9882d2 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_partition.result @@ -0,0 +1,42 @@ +include/master-slave.inc +[connection master] +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,inject_wakeup_subsequent_commits_sleep"; +SET GLOBAL slave_parallel_threads=8; +*** MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication *** +CREATE TABLE E ( +pk INTEGER AUTO_INCREMENT, +col_int_nokey INTEGER /*! NULL */, +col_int_key INTEGER /*! NULL */, +col_date_key DATE /*! NULL */, +col_date_nokey DATE /*! NULL */, +col_time_key TIME /*! NULL */, +col_time_nokey TIME /*! NULL */, +col_datetime_key DATETIME /*! NULL */, +col_datetime_nokey DATETIME /*! NULL */, +col_varchar_key VARCHAR(1) /*! NULL */, +col_varchar_nokey VARCHAR(1) /*! NULL */, +PRIMARY KEY (pk), +KEY (col_int_key), +KEY (col_date_key), +KEY (col_time_key), +KEY (col_datetime_key), +KEY (col_varchar_key, col_int_key) +) ENGINE=InnoDB; +ALTER TABLE `E` PARTITION BY KEY() PARTITIONS 5; +ALTER TABLE `E` REMOVE PARTITIONING; +CREATE TABLE t1 (a INT PRIMARY KEY); +include/start_slave.inc +include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=8; +include/start_slave.inc +include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +include/start_slave.inc +DROP TABLE `E`; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result index 61eba2cab2f..da2cf42f870 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result @@ -116,6 +116,26 @@ SHOW STATUS LIKE 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 FLUSH LOGS; +*** MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode *** +CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB; +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10000; +INSERT INTO t4 VALUES (30); +INSERT INTO t4 VALUES (31); +SET SESSION debug_dbug= @old_dbug; +INSERT INTO t1 SELECT a, "conservative" FROM t4; +DROP TEMPORARY TABLE t4; +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +a b +30 conservative +31 conservative +include/save_master_gtid.inc +include/sync_with_master_gtid.inc +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +a b +30 conservative +31 conservative include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result index 7d9f7de8fa9..9aeef98d091 100644 --- a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result +++ b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result @@ -52,6 +52,20 @@ a b # - DELETE xt1, t2 FROM <...> # - INSERT INTO t5(b) VALUES <...> (3 instances) ######################################################################## +# Ensure that a replication failure doesn't segfault - MDEV-7864 +######################################################################## +DELETE FROM t3 WHERE a=2; +INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d; +INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10; +DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a; +---- Wait until slave stops with an error ---- +include/wait_for_slave_sql_error.inc [errno=1032] +Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can't find record in 't3'" error) +Could not execute Delete_rows_v1 event on table test1.t3; Can't find record in 't3', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.000002, end_log_pos END_LOG_POS +call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032"); +SET GLOBAL sql_slave_skip_counter=1; +START SLAVE; +######################################################################## FLUSH LOGS; show binlog events in 'slave-bin.000001' from <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info @@ -131,6 +145,30 @@ slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('gås') slave-bin.000001 # Table_map 1 # table_id: # (test1.t5) slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F slave-bin.000001 # Query 1 # COMMIT +slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-25 +slave-bin.000001 # Table_map 2 # table_id: # (test1.t3) +slave-bin.000001 # Delete_rows_v1 2 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 2 # COMMIT +slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-25 +slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d +slave-bin.000001 # Table_map 1 # table_id: # (test1.t5) +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 1 # COMMIT +slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-26 +slave-bin.000001 # Annotate_rows 1 # INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10 +slave-bin.000001 # Table_map 1 # table_id: # (test1.t3) +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 1 # COMMIT +slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-27 +slave-bin.000001 # Table_map 2 # table_id: # (mtr.test_suppressions) +slave-bin.000001 # Write_rows_v1 2 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 2 # COMMIT slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 # ######################################################################## diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result index 36d906f54be..ceaf8c878c8 100644 --- a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result +++ b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result @@ -44,6 +44,20 @@ a b # EVENTS ON SLAVE # No Annotate_rows events should appear below ######################################################################## +# Ensure that a replication failure doesn't segfault - MDEV-7864 +######################################################################## +DELETE FROM t3 WHERE a=2; +INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d; +INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10; +DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a; +---- Wait until slave stops with an error ---- +include/wait_for_slave_sql_error.inc [errno=1032] +Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can't find record in 't3'" error) +Could not execute Delete_rows_v1 event on table test1.t3; Can't find record in 't3', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.000002, end_log_pos END_LOG_POS +call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032"); +SET GLOBAL sql_slave_skip_counter=1; +START SLAVE; +######################################################################## FLUSH LOGS; show binlog events in 'slave-bin.000001' from <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info @@ -113,6 +127,28 @@ slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-24 slave-bin.000001 # Table_map 1 # table_id: # (test1.t5) slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F slave-bin.000001 # Query 1 # COMMIT +slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-25 +slave-bin.000001 # Table_map 2 # table_id: # (test1.t3) +slave-bin.000001 # Delete_rows_v1 2 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 2 # COMMIT +slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-25 +slave-bin.000001 # Table_map 1 # table_id: # (test1.t5) +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 1 # COMMIT +slave-bin.000001 # Gtid 1 # BEGIN GTID 0-1-26 +slave-bin.000001 # Table_map 1 # table_id: # (test1.t3) +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # +slave-bin.000001 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 1 # COMMIT +slave-bin.000001 # Gtid 2 # BEGIN GTID 0-2-27 +slave-bin.000001 # Table_map 2 # table_id: # (mtr.test_suppressions) +slave-bin.000001 # Write_rows_v1 2 # table_id: # flags: STMT_END_F +slave-bin.000001 # Query 2 # COMMIT slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 # ######################################################################## diff --git a/mysql-test/suite/rpl/r/rpl_special_charset.result b/mysql-test/suite/rpl/r/rpl_special_charset.result new file mode 100644 index 00000000000..99b8d3a21d1 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_special_charset.result @@ -0,0 +1,8 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Cannot use utf16 as character_set_client"); +CREATE TABLE t1(i VARCHAR(20)); +INSERT INTO t1 VALUES (0xFFFF); +include/diff_tables.inc [master:t1, slave:t1] +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result index 504b0471748..08504ce175d 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_table.result +++ b/mysql-test/suite/rpl/r/rpl_temp_table.result @@ -39,7 +39,12 @@ sum(n) show status like 'Slave_open_temp_tables'; Variable_name Value Slave_open_temp_tables 0 +*** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS *** +INSERT INTO t2 VALUES (2000), (2001); +CREATE FUNCTION f() RETURNS INTEGER RETURN 1; +CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2; drop table if exists t1,t2; Warnings: Note 1051 Unknown table 'test.t1' +drop function f; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result index 550b3f596e5..0264c9421fc 100644 --- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result @@ -182,6 +182,11 @@ DROP USER test_3@localhost; ERROR HY000: Table 'user' was not locked with LOCK TABLES INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked"); UNLOCK TABLE; +CREATE DATABASE db; +CREATE TABLE db.t1 LIKE t2; +CREATE TABLE t3 LIKE t2; +DROP TABLE t3; +DROP DATABASE db; DROP USER test_3@localhost; DROP FUNCTION f2; DROP PROCEDURE p2; diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result index ac6d9155f4b..c0e35274594 100644 --- a/mysql-test/suite/rpl/r/rpl_trigger.result +++ b/mysql-test/suite/rpl/r/rpl_trigger.result @@ -986,4 +986,15 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back include/diff_tables.inc [master:t1, slave:t1] include/diff_tables.inc [master:log, slave:log] drop table t1, log; +drop trigger if exists notexistent; +Warnings: +Note 1360 Trigger does not exist +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; drop trigger if exists notexistent +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Gtid # # GTID #-#-# +slave-bin.000001 # Query # # use `test`; drop trigger if exists notexistent include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/sec_behind_master-5114.result b/mysql-test/suite/rpl/r/sec_behind_master-5114.result new file mode 100644 index 00000000000..5554b17347d --- /dev/null +++ b/mysql-test/suite/rpl/r/sec_behind_master-5114.result @@ -0,0 +1,10 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Unsafe statement written to the binary log"); +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES(SLEEP(2)); +Seconds_Behind_Master: 1 +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/semisync_future-7591.result b/mysql-test/suite/rpl/r/semisync_future-7591.result new file mode 100644 index 00000000000..732ae09daaf --- /dev/null +++ b/mysql-test/suite/rpl/r/semisync_future-7591.result @@ -0,0 +1,19 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Timeout waiting for reply of binlog*"); +create table t1 (i int); +set global rpl_semi_sync_master_enabled = ON; +include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = ON; +change master to master_log_file='master-bin.000002', master_log_pos = 320; +start slave; +include/wait_for_slave_io_error.inc [errno=1236] +insert into t1 values (1); +reset master; +include/stop_slave.inc +reset slave; +include/start_slave.inc +set global rpl_semi_sync_slave_enabled = OFF; +drop table t1; +set global rpl_semi_sync_master_enabled = OFF; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result new file mode 100644 index 00000000000..c2a0498509b --- /dev/null +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -0,0 +1,4 @@ +include/master-slave.inc +[connection master] +start slave; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_000011.test b/mysql-test/suite/rpl/t/rpl_000011.test index faad2242235..216e568fc42 100644 --- a/mysql-test/suite/rpl/t/rpl_000011.test +++ b/mysql-test/suite/rpl/t/rpl_000011.test @@ -11,6 +11,12 @@ insert into t1 values(1); sync_slave_with_master; show global status like 'com_insert'; stop slave; +# Temporary work-around for bug MDEV-8301. There is a small window during +# thread exit where the local status values of a thread are counted twice +# in the global status. Remove this wait_condition.inc once MDEV-8301 is +# fixed. +--let $wait_condition= SELECT variable_value=1 FROM information_schema.global_status WHERE variable_name="Com_insert"; +--source include/wait_condition.inc show global status like 'com_insert'; --source include/wait_for_slave_to_stop.inc start slave; diff --git a/mysql-test/suite/rpl/t/rpl_drop_db_fail.test b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test new file mode 100644 index 00000000000..f4482064d7b --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_drop_db_fail.test @@ -0,0 +1,34 @@ +############################################################################### +# Bug#20041860: SLAVE ERROR WHEN DROP DATABASE +# +# Test: +# ===== +# Create two databases such that one database has a dependency over the other +# database and try to drop the database which has a dependency. This should +# not cause slave to break. +############################################################################### +--source include/have_innodb.inc +--source include/master-slave.inc + +connection master; +CREATE DATABASE IF NOT EXISTS db1; +CREATE DATABASE IF NOT EXISTS db2; + +use db1; +CREATE TABLE a(id INT); +CREATE VIEW v AS SELECT * FROM a; +CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB; +--sync_slave_with_master + +connection master; +use db2; +CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB; +ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id); + +--error ER_ROW_IS_REFERENCED +DROP DATABASE db1; +DROP DATABASE db2; +--sync_slave_with_master +--connection master +DROP DATABASE db1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test index 19f90fce197..4c4a9063a0b 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test @@ -367,7 +367,7 @@ reap; reap; ---echo *** Test sql_gtid_slave_pos when used with GTID *** +--echo *** Test gtid_slave_pos when used with GTID *** --connection server_2 --source include/stop_slave.inc @@ -481,6 +481,55 @@ SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex SET GLOBAL slave_ddl_exec_mode= @saved_mode; + +--echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. *** + +# Create an out-of-order binlog on server 2. +# Let server 3 replicate to an out-of-order point, stop it, restart it, +# and check that it replicates correctly despite the out-of-order. + +--connection server_1 +SET gtid_domain_id= @@GLOBAL.gtid_domain_id; +INSERT INTO t1 VALUES (31); +--save_master_pos + +--connection server_2 +--sync_with_master +SET gtid_domain_id= @@GLOBAL.gtid_domain_id; +INSERT INTO t1 VALUES (32); + +--connection server_1 +INSERT INTO t1 VALUES (33); +--save_master_pos + +--connection server_2 +--sync_with_master +--save_master_pos + +--connection server_3 +--sync_with_master +--source include/stop_slave.inc + +--connection server_1 +INSERT INTO t1 VALUES (34); +--save_master_pos + +--connection server_2 +--sync_with_master +--save_master_pos + +--connection server_3 +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +--save_master_pos + +--connection server_4 +--sync_with_master +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; + + +# Clean up. --connection server_1 DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index 90b4e454a74..df3ba9a3420 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -587,6 +587,77 @@ eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCA SELECT * from t1 WHERE a > 10 ORDER BY a; +--echo *** MDEV-6391: GTID binlog state not recovered if mariadb-bin.state is removed *** + +--connection server_2 +--source include/stop_slave.inc + +# Do some misc. transactions, stop the master, drop the master-bin.state file. +# Start the master back up, check that binlog state is correct. + +--connection server_1 + +INSERT INTO t1 VALUES (30); +SET @old_server_id= @@server_id; +SET @old_domain_id= @@gtid_domain_id; + +SET SESSION server_id= 10; +INSERT INTO t1 VALUES (31); +INSERT INTO t1 VALUES (32); +SET SESSION gtid_domain_id= 1; +SET SESSION server_id=11; +INSERT INTO t1 VALUES (33); +SET SESSION gtid_domain_id= 2; +INSERT INTO t1 VALUES (34); +SET SESSION server_id= 10; +INSERT INTO t1 VALUES (35); +INSERT INTO t1 VALUES (36); +SET SESSION gtid_domain_id= 0; +SET SESSION server_id= 12; +INSERT INTO t1 VALUES (37); +SET SESSION gtid_domain_id= @old_domain_id; +SET SESSION server_id= @old_server_id; +INSERT INTO t1 VALUES (38); +INSERT INTO t1 VALUES (39); +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +--source include/save_master_gtid.inc + +--let OLD_STATE= `SELECT @@gtid_binlog_state` + +--let $datadir= `SELECT @@datadir` + +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait +EOF +shutdown_server 10; +--source include/wait_until_disconnected.inc + +--remove_file $datadir/master-bin.state + +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart +EOF +--enable_reconnect +--source include/wait_until_connected_again.inc + +--let NEW_STATE= `SELECT @@gtid_binlog_state` + +--perl +my $old= $ENV{'OLD_STATE'}; +my $new= $ENV{'NEW_STATE'}; +# Make them order-independent, for easy comparison. +$old= join(",", sort(split(",", $old))); +$new= join(",", sort(split(",", $new))); +die "ERROR: new binlog state '$new' differs from old '$old'\n" + unless $old eq $new; +EOF + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; + + --connection server_1 DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test index 31492b7c096..9739ba8bc43 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_errorhandling.test @@ -230,7 +230,7 @@ CALL mtr.add_suppression("Slave: Could not update replication slave gtid state") SET sql_log_bin=1; ---echo *** MDEV-4906: When event apply fails, next SQL thread start errorneously commits the failing GTID to gtid_slave_pos *** +--echo *** MDEV-4906: When event apply fails, next SQL thread start erroneously commits the failing GTID to gtid_slave_pos *** --connection slave --source include/stop_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_misc.test b/mysql-test/suite/rpl/t/rpl_gtid_misc.test new file mode 100644 index 00000000000..66d98ec8025 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_misc.test @@ -0,0 +1,50 @@ +--source include/master-slave.inc + +--echo *** MDEV-6403: Temporary tables lost at STOP SLAVE in GTID mode if master has not rotated binlog since restart *** + +--connection master +CREATE TABLE t1 (a INT PRIMARY KEY); +--sync_slave_with_master + +--connection slave +--source include/stop_slave.inc +# Inject a duplicate key error that will make the slave stop in the middle of +# a sequence of transactions that use a temporary table. +SET sql_log_bin= 0; +INSERT INTO t1 VALUES (1); +SET sql_log_bin= 1; +CHANGE MASTER TO master_use_gtid= current_pos; + +--connection master + +# Make some queries that use a temporary table. +CREATE TEMPORARY TABLE t2 LIKE t1; +INSERT INTO t2 VALUE (1); +INSERT INTO t1 SELECT * FROM t2; +DROP TEMPORARY TABLE t2; +--save_master_pos + +--connection slave +START SLAVE; +--let $slave_sql_errno=1062 +--source include/wait_for_slave_sql_error.inc + +# Restart the slave. +# The bug was that the IO thread would receive again the restart +# format_description event at the start of the master's binlog, and this +# event would cause the SQL thread to discard all active temporary tables. + +STOP SLAVE IO_THREAD; + +SET sql_log_bin= 0; +DELETE FROM t1 WHERE a=1; +SET sql_log_bin= 1; + +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 ORDER BY a; + +--connection master +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until.test b/mysql-test/suite/rpl/t/rpl_gtid_until.test index 4dde7da38a5..20d4510ccc8 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_until.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_until.test @@ -73,19 +73,29 @@ SELECT * FROM t1 ORDER BY a; # Test showing the UNTIL condition in SHOW SLAVE STATUS. --source include/stop_slave.inc -START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200"; +START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200,0-1-300"; --source include/wait_for_slave_to_start.inc --let $status_items= Using_Gtid,Until_Condition --source include/show_slave_status.inc # Clear the UNTIL condition. +# Note that we need to wait for a transaction to get through from the master. +# Otherwise the IO thread may still be in get_master_version_and_clock() +# (wait_for_slave_to_start.inc returns as soon as the IO thread is connected), +# and we can get test failures from warnings in the log about IO thread being +# killed in the middle of setting @@gtid_strict_mode or similar (MDEV-7940). +--connection server_1 +INSERT INTO t1 VALUES (3); +DELETE FROM t1 WHERE a=3; +--save_master_pos + +--connection server_2 +--sync_with_master --source include/stop_slave.inc ---source include/start_slave.inc --echo *** Test UNTIL condition in an earlier binlog than the start GTID. *** --connection server_2 ---source include/stop_slave.inc --connection server_1 SET gtid_domain_id = 1; diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test index 25e27f62d0a..a3f3ff56464 100644 --- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test +++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test @@ -25,5 +25,36 @@ echo "*** must be NULL ***"; select master_pos_wait('foo', 98); # End of 4.1 tests + + +--echo *** MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout *** + +--connection slave +--source include/stop_slave.inc +reset slave all; +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval change master 'my_slave' to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root'; +set default_master_connection = 'my_slave'; +--source include/start_slave.inc + +--echo # Call without connection name -- works (expected -1) +select master_pos_wait('master-bin.000001',1000000,1); + +set default_master_connection = ''; + +--echo # Call for non-existing anonymous connection -- works (expected NULL) +select master_pos_wait('master-bin.000001',1000000,1); + +--echo # Call with a valid connection name -- hangs before MDEV-7130 fix (expected -1) +select master_pos_wait('master-bin.000001',1000000,1,"my_slave"); + +STOP SLAVE 'my_slave'; +RESET SLAVE 'my_slave' ALL; + +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root'; + +# End of 10.0 tests + --let $rpl_only_running_threads= 1 --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_old_decimal.test b/mysql-test/suite/rpl/t/rpl_old_decimal.test new file mode 100644 index 00000000000..79fd2754079 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_old_decimal.test @@ -0,0 +1,25 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + + +--connection slave +CREATE TABLE t1dec102 (a DECIMAL(10,2)); + +--connection master +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI +INSERT INTO t1dec102 VALUES(999.99); + +--let $slave_sql_errno=1677 +--let $show_slave_sql_error= 1 +call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677"); +--source include/wait_for_slave_sql_error_and_skip.inc + +--connection master +DROP TABLE t1dec102; +--sync_slave_with_master + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test index d4b99d4b0f7..feac32b1454 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel.test +++ b/mysql-test/suite/rpl/t/rpl_parallel.test @@ -12,9 +12,20 @@ SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; SET GLOBAL slave_parallel_threads=10; --source include/stop_slave.inc SET GLOBAL slave_parallel_threads=10; + +# Check that we do not spawn any worker threads when no slave is running. +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; + CHANGE MASTER TO master_use_gtid=slave_pos; --source include/start_slave.inc +# Check that worker threads get spawned when slave starts. +SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +# ... and that worker threads get removed when slave stops. +--source include/stop_slave.inc +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +--source include/start_slave.inc +SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; --echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 *** @@ -1843,6 +1854,467 @@ SET GLOBAL slave_parallel_threads=10; --source include/start_slave.inc +--echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption *** + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=1; +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000"; + +--connection server_1 +INSERT INTO t2 VALUES (101); +INSERT INTO t2 VALUES (102); +INSERT INTO t2 VALUES (103); +INSERT INTO t2 VALUES (104); +INSERT INTO t2 VALUES (105); +# Inject a partial event group (missing XID at the end). The bug was that such +# partial group was not handled appropriately, leading to server deadlock. +SET gtid_seq_no=1000; +INSERT INTO t2 VALUES (106); +INSERT INTO t2 VALUES (107); +INSERT INTO t2 VALUES (108); +INSERT INTO t2 VALUES (109); +INSERT INTO t2 VALUES (110); +INSERT INTO t2 VALUES (111); +INSERT INTO t2 VALUES (112); +INSERT INTO t2 VALUES (113); +INSERT INTO t2 VALUES (114); +INSERT INTO t2 VALUES (115); +INSERT INTO t2 VALUES (116); +INSERT INTO t2 VALUES (117); +INSERT INTO t2 VALUES (118); +INSERT INTO t2 VALUES (119); +INSERT INTO t2 VALUES (120); +INSERT INTO t2 VALUES (121); +INSERT INTO t2 VALUES (122); +INSERT INTO t2 VALUES (123); +INSERT INTO t2 VALUES (124); +INSERT INTO t2 VALUES (125); +INSERT INTO t2 VALUES (126); +INSERT INTO t2 VALUES (127); +INSERT INTO t2 VALUES (128); +INSERT INTO t2 VALUES (129); +INSERT INTO t2 VALUES (130); +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +# The partial event group (a=106) should be rolled back and thus missing. +SELECT * FROM t2 WHERE a >= 100 ORDER BY a; + +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging *** +--echo *** MDEV-7882: Excessive transaction retry in parallel replication *** + +--connection server_1 +CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +--save_master_pos + +--connection server_2 +--sync_with_master +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=40; +SELECT @old_retries:=@@GLOBAL.slave_transaction_retries; +SET GLOBAL slave_transaction_retries= 5; + + +# Using dbug error injection, we artificially create event groups with a lot of +# conflicting transactions in each event group. The bugs were originally seen +# "in the wild" with transactions that did not conflict on the master, and only +# conflicted very rarely on the slave (maybe some edge case with InnoDB btree +# page splits or something like that). The event groups here loosely reflect +# the structure of the original failure's group commits. + + +--connection server_1 +INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5); +SET @old_dbug= @@SESSION.debug_dbug; +SET @commit_id= 42; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +INSERT INTO t8 VALUES (1,1); +INSERT INTO t8 VALUES (2,2); +INSERT INTO t8 VALUES (3,3); +INSERT INTO t8 VALUES (4,4); +INSERT INTO t8 VALUES (5,5); +INSERT INTO t8 VALUES (6,6); +INSERT INTO t8 VALUES (7,7); +INSERT INTO t8 VALUES (8,8); + +UPDATE t7 SET b=9 WHERE a=3; +UPDATE t7 SET b=10 WHERE a=3; +UPDATE t7 SET b=11 WHERE a=3; + +INSERT INTO t8 VALUES (12,12); +INSERT INTO t8 VALUES (13,13); + +UPDATE t7 SET b=14 WHERE a=3; +UPDATE t7 SET b=15 WHERE a=3; + +INSERT INTO t8 VALUES (16,16); + +UPDATE t7 SET b=17 WHERE a=3; + +INSERT INTO t8 VALUES (18,18); +INSERT INTO t8 VALUES (19,19); + +UPDATE t7 SET b=20 WHERE a=3; + +INSERT INTO t8 VALUES (21,21); + +UPDATE t7 SET b=22 WHERE a=3; + +INSERT INTO t8 VALUES (23,24); +INSERT INTO t8 VALUES (24,24); + +UPDATE t7 SET b=25 WHERE a=3; + +INSERT INTO t8 VALUES (26,26); + +UPDATE t7 SET b=27 WHERE a=3; + +BEGIN; +INSERT INTO t8 VALUES (28,28); +INSERT INTO t8 VALUES (29,28), (30,28); +INSERT INTO t8 VALUES (31,28); +INSERT INTO t8 VALUES (32,28); +INSERT INTO t8 VALUES (33,28); +INSERT INTO t8 VALUES (34,28); +INSERT INTO t8 VALUES (35,28); +INSERT INTO t8 VALUES (36,28); +INSERT INTO t8 VALUES (37,28); +INSERT INTO t8 VALUES (38,28); +INSERT INTO t8 VALUES (39,28); +INSERT INTO t8 VALUES (40,28); +INSERT INTO t8 VALUES (41,28); +INSERT INTO t8 VALUES (42,28); +COMMIT; + + +SET @commit_id=43; +INSERT INTO t8 VALUES (43,43); +INSERT INTO t8 VALUES (44,44); + +UPDATE t7 SET b=45 WHERE a=3; + +INSERT INTO t8 VALUES (46,46); +INSERT INTO t8 VALUES (47,47); + +UPDATE t7 SET b=48 WHERE a=3; + +INSERT INTO t8 VALUES (49,49); +INSERT INTO t8 VALUES (50,50); + + +SET @commit_id=44; +INSERT INTO t8 VALUES (51,51); +INSERT INTO t8 VALUES (52,52); + +UPDATE t7 SET b=53 WHERE a=3; + +INSERT INTO t8 VALUES (54,54); +INSERT INTO t8 VALUES (55,55); + +UPDATE t7 SET b=56 WHERE a=3; + +INSERT INTO t8 VALUES (57,57); + +UPDATE t7 SET b=58 WHERE a=3; + +INSERT INTO t8 VALUES (58,58); +INSERT INTO t8 VALUES (59,59); +INSERT INTO t8 VALUES (60,60); +INSERT INTO t8 VALUES (61,61); + +UPDATE t7 SET b=62 WHERE a=3; + +INSERT INTO t8 VALUES (63,63); +INSERT INTO t8 VALUES (64,64); +INSERT INTO t8 VALUES (65,65); +INSERT INTO t8 VALUES (66,66); + +UPDATE t7 SET b=67 WHERE a=3; + +INSERT INTO t8 VALUES (68,68); + +UPDATE t7 SET b=69 WHERE a=3; +UPDATE t7 SET b=70 WHERE a=3; +UPDATE t7 SET b=71 WHERE a=3; + +INSERT INTO t8 VALUES (72,72); + +UPDATE t7 SET b=73 WHERE a=3; +UPDATE t7 SET b=74 WHERE a=3; +UPDATE t7 SET b=75 WHERE a=3; +UPDATE t7 SET b=76 WHERE a=3; + +INSERT INTO t8 VALUES (77,77); + +UPDATE t7 SET b=78 WHERE a=3; + +INSERT INTO t8 VALUES (79,79); + +UPDATE t7 SET b=80 WHERE a=3; + +INSERT INTO t8 VALUES (81,81); + +UPDATE t7 SET b=82 WHERE a=3; + +INSERT INTO t8 VALUES (83,83); + +UPDATE t7 SET b=84 WHERE a=3; + + +SET @commit_id=45; +INSERT INTO t8 VALUES (85,85); +UPDATE t7 SET b=86 WHERE a=3; +INSERT INTO t8 VALUES (87,87); + + +SET @commit_id=46; +INSERT INTO t8 VALUES (88,88); +INSERT INTO t8 VALUES (89,89); +INSERT INTO t8 VALUES (90,90); + +SET SESSION debug_dbug=@old_dbug; + +INSERT INTO t8 VALUES (91,91); +INSERT INTO t8 VALUES (92,92); +INSERT INTO t8 VALUES (93,93); +INSERT INTO t8 VALUES (94,94); +INSERT INTO t8 VALUES (95,95); +INSERT INTO t8 VALUES (96,96); +INSERT INTO t8 VALUES (97,97); +INSERT INTO t8 VALUES (98,98); +INSERT INTO t8 VALUES (99,99); + + +SELECT * FROM t7 ORDER BY a; +SELECT * FROM t8 ORDER BY a; +--source include/save_master_gtid.inc + + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t7 ORDER BY a; +SELECT * FROM t8 ORDER BY a; + +--source include/stop_slave.inc +SET GLOBAL slave_transaction_retries= @old_retries; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang *** + +--connection server_2 +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep'; + +--connection server_1 +# Inject two group commits. The bug was that ANALYZE TABLE would call +# wakeup_subsequent_commits() too early, allowing the following transaction +# in the same group to run ahead and binlog and free the GCO. Then we get +# wrong binlog order and later access freed GCO, which causes lost wakeup +# of following GCO and thus replication hang. +# We injected a small sleep in ANALYZE to make the race easier to hit (this +# can only cause false negatives in versions with the bug, not false positives, +# so sleep is ok here. And it's in general not possible to trigger reliably +# the race with debug_sync, since the bugfix makes the race impossible). + +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +# Group commit with cid=10000, two event groups. +SET @commit_id= 10000; +ANALYZE TABLE t2; +INSERT INTO t3 VALUES (120, 0); + +# Group commit with cid=10001, one event group. +SET @commit_id= 10001; +INSERT INTO t3 VALUES (121, 0); + +SET SESSION debug_dbug=@old_dbug; + +SELECT * FROM t3 WHERE a >= 120 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a >= 120 ORDER BY a; + +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +--source include/start_slave.inc + + +--echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. *** + +--connection server_2 +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep'; + +--connection server_1 +# Inject two group commits. The bug was that record_gtid for a +# non-transactional event group would commit its own transaction, which would +# cause ha_commit_trans() to call wakeup_subsequent_commits() too early. This +# in turn lead to access to freed group_commit_orderer object, losing a wakeup +# and causing slave threads to hang. +# We inject a small sleep in the corresponding record_gtid() to make the race +# easier to hit. + +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +# Group commit with cid=10010, two event groups. +SET @old_server_id= @@SESSION.server_id; +SET SESSION server_id= 100; +SET @commit_id= 10010; +ALTER TABLE t1 COMMENT "Hulubulu!"; +SET SESSION server_id= @old_server_id; +INSERT INTO t3 VALUES (130, 0); + +# Group commit with cid=10011, one event group. +SET @commit_id= 10011; +INSERT INTO t3 VALUES (131, 0); + +SET SESSION debug_dbug=@old_dbug; + +SELECT * FROM t3 WHERE a >= 130 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a >= 130 ORDER BY a; + +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +--source include/start_slave.inc + + +--echo *** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) *** + +--connection server_1 +INSERT INTO t3 VALUES (201,0), (202,0); +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_mdev8031'; + +--connection server_1 +# We artificially create a situation that hopefully resembles the original +# bug which was only seen "in the wild", and only once. +# Setup a fake group commit with lots of conflicts that will lead to deadloc +# kill. The slave DBUG injection causes the slave to be deadlock killed at +# a particular point during the retry, and then later do a small sleep at +# another critical point where the prior transaction then has a chance to +# complete. Finally an extra KILL check catches an unhandled, lingering +# deadlock kill. So rather artificial, but at least it exercises the +# relevant code paths. +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +SET @commit_id= 10200; +INSERT INTO t3 VALUES (203, 1); +INSERT INTO t3 VALUES (204, 1); +INSERT INTO t3 VALUES (205, 1); +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=205; +UPDATE t3 SET b=b+1 WHERE a=205; +SET SESSION debug_dbug=@old_dbug; + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +--source include/start_slave.inc + + +--echo *** Check getting deadlock killed inside open_binlog() during retry. *** + +--connection server_2 +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill'; +SET @old_max= @@GLOBAL.max_relay_log_size; +SET GLOBAL max_relay_log_size= 4096; + +--connection server_1 +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +--let $large= `SELECT REPEAT("*", 8192)` +SET @commit_id= 10210; +--echo Omit long queries that cause relaylog rotations and transaction retries... +--disable_query_log +eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */; +--enable_query_log +SET SESSION debug_dbug=@old_dbug; + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_debg; +SET GLOBAL max_relay_log_size= @old_max; +--source include/start_slave.inc + + + # Clean up. --connection server_2 --source include/stop_slave.inc @@ -1852,7 +2324,7 @@ SET DEBUG_SYNC= 'RESET'; --connection server_1 DROP function foo; -DROP TABLE t1,t2,t3,t4,t5,t6; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8; SET DEBUG_SYNC= 'RESET'; --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel2.test b/mysql-test/suite/rpl/t/rpl_parallel2.test index 51c9e39a26a..47b0e87a6b6 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel2.test +++ b/mysql-test/suite/rpl/t/rpl_parallel2.test @@ -37,6 +37,48 @@ INSERT INTO t1 VALUES (1,sleep(2)); --source include/show_slave_status.inc +--echo *** MDEV-8294: Inconsistent behavior of slave parallel threads at runtime *** + +--connection server_1 +INSERT INTO t1 VALUES (10,0); +# Force a duplicate key error on the slave. +SET sql_log_bin= 0; +DELETE FROM t1 WHERE a=10; +SET sql_log_bin= 1; +INSERT INTO t1 VALUES (10,0); +--save_master_pos +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; + +--connection server_2 +--let $slave_sql_errno= 1062 +--source include/wait_for_slave_sql_error.inc + +# At this point, the worker threads should have stopped also. +--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread"; +--source include/wait_condition.inc + +# Check that the pool can still be resized, but remains inactive as no slave +# SQL thread is running. +SET GLOBAL slave_parallel_threads=8; +--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread"; +--source include/wait_condition.inc + +STOP SLAVE; +# At this point, the worker threads should have stopped. +--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread"; +--source include/wait_condition.inc + + +SET GLOBAL sql_slave_skip_counter= 1; +--source include/start_slave.inc +# At this point, the worker threads should have been spawned. +--let $wait_condition= SELECT COUNT(*)=8 FROM information_schema.processlist WHERE User = "system user" AND State = "Waiting for work from SQL thread"; +--source include/wait_condition.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; + + +# Clean up --connection server_2 --source include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; diff --git a/mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test b/mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test new file mode 100644 index 00000000000..5929fad71df --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_mdev6589.test @@ -0,0 +1,132 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/master-slave.inc + +--connection server_2 +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=10; +CHANGE MASTER TO master_use_gtid=current_pos; +--source include/start_slave.inc + + +--echo *** MDEV-6589: Incorrect relay log start position when restarting SQL thread after error in parallel replication *** + +--connection server_1 +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +--save_master_pos + +--connection server_2 +--sync_with_master +SELECT * FROM t1; +SELECT * FROM t2; + +# Block one domain, which we will later cause to give an error. And let some +# other domains proceed so we can check that after restart, the slave is able +# to correctly restart each domain in a separate position. + +--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +SET sql_log_bin=0; +BEGIN; +INSERT INTO t2 VALUES (5); + +--connection server_1 +SET gtid_domain_id=0; +INSERT INTO t1 VALUES (2); +INSERT INTO t2 VALUES (3); +FLUSH LOGS; +INSERT INTO t1 VALUES (4); + +SET gtid_domain_id=1; +# This query will be blocked on the slave, and later give a duplicate key error. +INSERT INTO t2 VALUES (5); + +SET gtid_domain_id=0; +INSERT INTO t1 VALUES (6); +INSERT INTO t1 VALUES (7); + +SET gtid_domain_id=2; +INSERT INTO t2 VALUES (8); +INSERT INTO t1 VALUES (9); +FLUSH LOGS; + +SET gtid_domain_id=3; +INSERT INTO t2 VALUES (10); +INSERT INTO t1 VALUES (11); + +# These cannot be replicated before the error, as a prior commit is blocked. +SET gtid_domain_id=1; +INSERT INTO t1 VALUES (12); +INSERT INTO t2 VALUES (13); + +SET gtid_domain_id=0; +INSERT INTO t2 VALUES (14); +FLUSH LOGS; + +SET gtid_domain_id=3; +INSERT INTO t2 VALUES (15); + +SET gtid_domain_id=2; +INSERT INTO t2 VALUES (16); + +SET gtid_domain_id=0; +INSERT INTO t1 VALUES (17); +SET @gtid0 = @@last_gtid; +SET gtid_domain_id=2; +INSERT INTO t1 VALUES (18); +SET @gtid2 = @@last_gtid; +SET gtid_domain_id=3; +INSERT INTO t1 VALUES (19); +SET @gtid3 = @@last_gtid; +--let $wait_pos= `SELECT CONCAT(@gtid0, ",", @gtid2, ",", @gtid3)` + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +--source include/save_master_gtid.inc + + +--connection server_2 +# First wait for domains 0, 2, and 3 to complete. +--replace_result $wait_pos WAIT_POS +eval SELECT MASTER_GTID_WAIT('$wait_pos'); + +# Then release the row lock, and wait for the domain 1 to fail with +# duplicate key error. +--connection con_temp1 +COMMIT; +SET sql_log_bin=1; + +--connection server_2 +--let $slave_sql_errno= 1062 +--source include/wait_for_slave_sql_error.inc + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +SET sql_log_bin=0; +DELETE FROM t2 WHERE a=5; +SET sql_log_bin=1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + + +# Clean up. +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +--source include/start_slave.inc +SET DEBUG_SYNC= 'RESET'; + +--connection server_1 +DROP TABLE t1,t2; +SET DEBUG_SYNC= 'RESET'; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.cnf b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.cnf new file mode 100644 index 00000000000..4e1d3878f03 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.cnf @@ -0,0 +1,17 @@ +!include ../my.cnf + +[mysqld.1] +log-slave-updates +loose-innodb + +[mysqld.2] +log-slave-updates +loose-innodb + +[mysqld.3] +log-slave-updates +loose-innodb + +[ENV] +SERVER_MYPORT_3= @mysqld.3.port +SERVER_MYSOCK_3= @mysqld.3.socket diff --git a/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.test b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.test new file mode 100644 index 00000000000..4125394ef80 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_multilevel2.test @@ -0,0 +1,80 @@ +--source include/have_innodb.inc +--let $rpl_topology=1->2->3 +--source include/rpl_init.inc + +--echo *** MDEV-7668: Intermediate master groups CREATE with INSERT, causing parallel replication failure *** + +--connection server_1 +SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates; +SET GLOBAL binlog_direct_non_transactional_updates=OFF; +SET SESSION binlog_direct_non_transactional_updates=OFF; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +--save_master_pos + +--connection server_2 +--sync_with_master +--save_master_pos +--source include/stop_slave.inc +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +SET GLOBAL slave_parallel_threads=10; +SET @old_commit_count=@@GLOBAL.binlog_commit_wait_count; +SET GLOBAL binlog_commit_wait_count=2; +SET @old_commit_usec=@@GLOBAL.binlog_commit_wait_usec; +SET GLOBAL binlog_commit_wait_usec=2000000; +SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates; +SET GLOBAL binlog_direct_non_transactional_updates=OFF; +SET SESSION binlog_direct_non_transactional_updates=OFF; +CHANGE MASTER TO master_use_gtid=current_pos; + +--connection server_3 +--sync_with_master +--save_master_pos +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=10; +CHANGE MASTER TO master_use_gtid=current_pos; + + +--connection server_1 + +BEGIN; +CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY; +COMMIT; +INSERT INTO t2 VALUES (1); +INSERT INTO t1 SELECT a, a*10 FROM t2; +DROP TABLE t2; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; + +--connection server_3 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 ORDER BY a; + + +# Clean up + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +SET GLOBAL binlog_commit_wait_count=@old_commit_count; +SET GLOBAL binlog_commit_wait_usec=@old_commit_usec; +SET GLOBAL binlog_direct_non_transactional_updates= @old_updates; +--source include/start_slave.inc + +--connection server_3 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +--source include/start_slave.inc + +--connection server_1 +SET GLOBAL binlog_direct_non_transactional_updates= @old_updates; +CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table"); +DROP TABLE t1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_partition.test b/mysql-test/suite/rpl/t/rpl_parallel_partition.test new file mode 100644 index 00000000000..37dce9fef80 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_partition.test @@ -0,0 +1,81 @@ +--source include/have_partition.inc +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/master-slave.inc + +--connection server_2 +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,inject_wakeup_subsequent_commits_sleep"; +SET GLOBAL slave_parallel_threads=8; + +--echo *** MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication *** +--connection server_1 +CREATE TABLE E ( + pk INTEGER AUTO_INCREMENT, + col_int_nokey INTEGER /*! NULL */, + col_int_key INTEGER /*! NULL */, + + col_date_key DATE /*! NULL */, + col_date_nokey DATE /*! NULL */, + + col_time_key TIME /*! NULL */, + col_time_nokey TIME /*! NULL */, + + col_datetime_key DATETIME /*! NULL */, + col_datetime_nokey DATETIME /*! NULL */, + + col_varchar_key VARCHAR(1) /*! NULL */, + col_varchar_nokey VARCHAR(1) /*! NULL */, + + PRIMARY KEY (pk), + KEY (col_int_key), + KEY (col_date_key), + KEY (col_time_key), + KEY (col_datetime_key), + KEY (col_varchar_key, col_int_key) + ) ENGINE=InnoDB; + +ALTER TABLE `E` PARTITION BY KEY() PARTITIONS 5; +ALTER TABLE `E` REMOVE PARTITIONING; +--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +wait +EOF +--shutdown_server 30 +--source include/wait_until_disconnected.inc +--connection default +--source include/wait_until_disconnected.inc +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +restart: +EOF +--enable_reconnect +--source include/wait_until_connected_again.inc +--connection server_1 +--enable_reconnect +--source include/wait_until_connected_again.inc +CREATE TABLE t1 (a INT PRIMARY KEY); +--save_master_pos + +--connection server_2 +--source include/start_slave.inc +--sync_with_master + +# Re-spawn worker threads to clear dbug injection. +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=8; +--source include/start_slave.inc + + +# Clean up. +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +--source include/start_slave.inc + +--connection server_1 +DROP TABLE `E`; +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_temptable.test b/mysql-test/suite/rpl/t/rpl_parallel_temptable.test index b13fa5a01b1..feae29e7a9e 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_temptable.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_temptable.test @@ -213,6 +213,29 @@ SHOW STATUS LIKE 'Slave_open_temp_tables'; FLUSH LOGS; +--echo *** MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode *** + +--connection server_1 +CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB; +SET @old_dbug= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10000; +INSERT INTO t4 VALUES (30); +INSERT INTO t4 VALUES (31); +SET SESSION debug_dbug= @old_dbug; +INSERT INTO t1 SELECT a, "conservative" FROM t4; +DROP TEMPORARY TABLE t4; +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc + +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; + + +# Clean up. + --connection server_2 --source include/stop_slave.inc SET GLOBAL slave_parallel_threads=@old_parallel_threads; diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.opt b/mysql-test/suite/rpl/t/rpl_special_charset.opt new file mode 100644 index 00000000000..b071fb20845 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_special_charset.opt @@ -0,0 +1 @@ +--character-set-server=utf16 diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test new file mode 100644 index 00000000000..8ccb1b4183f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_special_charset.test @@ -0,0 +1,26 @@ +################################################################################ +# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS +# Problem: IO thread fails to connect to master if servers are configured with +# special character sets like utf16, utf32, ucs2. +# +# Analysis: MySQL server does not support few special character sets like +# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2). +# When IO thread is trying to connect to Master, it sets server's character +# set as client's character set. When Slave server is started with these +# special character sets, IO thread (a connection to Master) fails because +# of the above said reason. +# +# Fix: If server's character set is not supported as client's character set, +# then set default's client character set(latin1) as client's character set. +############################################################################### +--source include/master-slave.inc +call mtr.add_suppression("Cannot use utf16 as character_set_client"); +CREATE TABLE t1(i VARCHAR(20)); +INSERT INTO t1 VALUES (0xFFFF); +--sync_slave_with_master +--let diff_tables=master:t1, slave:t1 +--source include/diff_tables.inc +# Cleanup +--connection master +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test index 92f8cef9c10..8b3af5d51cd 100644 --- a/mysql-test/suite/rpl/t/rpl_temp_table.test +++ b/mysql-test/suite/rpl/t/rpl_temp_table.test @@ -57,12 +57,28 @@ select count(*) from t2; select sum(n) from t2; show status like 'Slave_open_temp_tables'; +--echo *** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS *** +connect (master2,localhost,root,,); +INSERT INTO t2 VALUES (2000), (2001); +CREATE FUNCTION f() RETURNS INTEGER RETURN 1; +CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2; +--let $gtid=`SELECT @@gtid_binlog_pos` +--disconnect master2 +--connection default +# Wait for implicit DROP TEMPORARY TABLE tmp to be binlogged. +--let $wait_condition= SELECT @@gtid_binlog_pos != '$gtid' +--source include/wait_condition.inc + +--sync_slave_with_master + + # # Clean up # connect (master2,localhost,root,,); connection master2; drop table if exists t1,t2; +drop function f; sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index e9cc098857e..bc4119f332f 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -150,6 +150,16 @@ DROP USER test_3@localhost; INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked"); UNLOCK TABLE; + +# Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS +# BINLOGGED INCORRECTLY - BREAKS A SLAVE +CREATE DATABASE db; +CREATE TABLE db.t1 LIKE t2; +CREATE TABLE t3 LIKE t2; +DROP TABLE t3; +DROP DATABASE db; +# end of Bug #20439913 test + DROP USER test_3@localhost; DROP FUNCTION f2; DROP PROCEDURE p2; diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index 723fa3e44e2..e062e821a25 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -533,6 +533,19 @@ drop table t1, log; sync_slave_with_master; # +# MDEV-6769 DROP TRIGGER IF NOT EXIST binlogged on master but not on slave +# +let $slave_pos= query_get_value(SHOW MASTER STATUS, Position, 1); +connection master; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +drop trigger if exists notexistent; +source include/show_binlog_events.inc; +sync_slave_with_master; +let $binlog_start= $slave_pos; +source include/show_binlog_events.inc; +connection master; + +# # End of tests # --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/sec_behind_master-5114.test b/mysql-test/suite/rpl/t/sec_behind_master-5114.test new file mode 100644 index 00000000000..8c70da4f0a8 --- /dev/null +++ b/mysql-test/suite/rpl/t/sec_behind_master-5114.test @@ -0,0 +1,27 @@ +source include/master-slave.inc; +source include/have_binlog_format_statement.inc; + +call mtr.add_suppression("Unsafe statement written to the binary log"); + +CREATE TABLE t1 (a int); +send INSERT INTO t1 VALUES(SLEEP(2)); + +connection slave; +let $run = 10; +while ($run) +{ + dec $run; + let $sbm=query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1); + # for debugging uncomment echo and remove the if() + #echo Seconds_Behind_Master: $sbm; + if ($sbm) + { + let $run = 0; + } + sleep 0.5; +} +echo Seconds_Behind_Master: $sbm; +connection master; +reap; +drop table t1; +source include/rpl_end.inc; diff --git a/mysql-test/suite/rpl/t/semisync_future-7591.test b/mysql-test/suite/rpl/t/semisync_future-7591.test new file mode 100644 index 00000000000..772a36b5632 --- /dev/null +++ b/mysql-test/suite/rpl/t/semisync_future-7591.test @@ -0,0 +1,31 @@ +--source include/have_semisync.inc +--source include/master-slave.inc + +call mtr.add_suppression("Timeout waiting for reply of binlog*"); +create table t1 (i int); + +set global rpl_semi_sync_master_enabled = ON; + +--connection slave +--source include/stop_slave.inc +set global rpl_semi_sync_slave_enabled = ON; +change master to master_log_file='master-bin.000002', master_log_pos = 320; + +start slave; +--let $slave_io_errno=1236 +--source include/wait_for_slave_io_error.inc + +--connection master +insert into t1 values (1); +reset master; + +--connection slave +--source include/stop_slave.inc +reset slave; +--source include/start_slave.inc + +set global rpl_semi_sync_slave_enabled = OFF; +--connection master +drop table t1; +set global rpl_semi_sync_master_enabled = OFF; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test new file mode 100644 index 00000000000..38759c9b16a --- /dev/null +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -0,0 +1,19 @@ +# +# MDEV-7126 replication slave - deadlock in terminate_slave_thread with stop slave and show variables of replication filters and show global status +# +--source include/master-slave.inc + +--connection slave + +# If everything is okay, the test will end in several seconds; maybe a minute. +# If the problem shows up, it will hang until testcase timeout is exceeded. +--exec $MYSQL_SLAP --silent --socket=$SLAVE_MYSOCK -q "START SLAVE; STOP SLAVE; SHOW GLOBAL STATUS" -c 2 --number-of-queries=100 --create-schema=test + +# All done. + +--connection slave +start slave; + +--connection master +--source include/rpl_end.inc + diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test index 0c47b5fcdd5..c688ae192d0 100644 --- a/mysql-test/suite/stress/t/ddl_archive.test +++ b/mysql-test/suite/stress/t/ddl_archive.test @@ -12,11 +12,8 @@ --source include/have_archive.inc let $engine_type= ARCHIVE; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test index 9f6185c76be..3e0f8acb1d8 100644 --- a/mysql-test/suite/stress/t/ddl_csv.test +++ b/mysql-test/suite/stress/t/ddl_csv.test @@ -12,11 +12,8 @@ --source include/have_csv.inc let $engine_type= CSV; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test index 784ba8ff003..083ec43e7d7 100644 --- a/mysql-test/suite/stress/t/ddl_innodb.test +++ b/mysql-test/suite/stress/t/ddl_innodb.test @@ -12,11 +12,8 @@ --source include/have_innodb.inc let $engine_type= InnoDB; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test index 5178439bff1..bcca77a74d9 100644 --- a/mysql-test/suite/stress/t/ddl_memory.test +++ b/mysql-test/suite/stress/t/ddl_memory.test @@ -11,11 +11,8 @@ # Storage engine to be used in CREATE TABLE let $engine_type= MEMORY; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test index 8d6226e573b..a9b14690c42 100644 --- a/mysql-test/suite/stress/t/ddl_myisam.test +++ b/mysql-test/suite/stress/t/ddl_myisam.test @@ -11,11 +11,8 @@ # Storage engine to be used in CREATE TABLE let $engine_type= MyISAM; +--source include/no_protocol.inc -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} let $run= `SELECT '$BIG_TEST' = '1'`; if ($run) { diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result index 1bd4e394f6a..7f75b731255 100644 --- a/mysql-test/suite/sys_vars/r/all_vars.result +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -10,5 +10,6 @@ there should be *no* long test name listed below: select distinct variable_name as `there should be *no* variables listed below:` from t2 left join t1 on variable_name=test_name where test_name is null; there should be *no* variables listed below: +max_digest_length drop table t1; drop table t2; diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result index 2956d04c065..56aa5976f91 100644 --- a/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result +++ b/mysql-test/suite/sys_vars/r/slave_parallel_threads_basic.result @@ -1,13 +1,22 @@ SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads; -SELECT @@GLOBAL.slave_parallel_threads as 'must be zero because of default'; -must be zero because of default -0 +SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) +OK +SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf'; +must be 20 because of .cnf +20 SELECT @@SESSION.slave_parallel_threads as 'no session var'; ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable SET GLOBAL slave_parallel_threads= 0; SET GLOBAL slave_parallel_threads= DEFAULT; +SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default'; +must be 0 because of default +0 SET GLOBAL slave_parallel_threads= 10; SELECT @@GLOBAL.slave_parallel_threads; @@GLOBAL.slave_parallel_threads 10 +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) +OK SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads; diff --git a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result index a7afc334ba1..719adb67573 100644 --- a/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result +++ b/mysql-test/suite/sys_vars/r/transaction_alloc_block_size_basic.result @@ -41,23 +41,11 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '60020' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size 59392 -SET @@global.transaction_alloc_block_size = 4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' -SELECT @@global.transaction_alloc_block_size; -@@global.transaction_alloc_block_size -4294966272 '#--------------------FN_DYNVARS_005_04-------------------------#' SET @@session.transaction_alloc_block_size = 1024; SELECT @@session.transaction_alloc_block_size; @@session.transaction_alloc_block_size 1024 -SET @@session.transaction_alloc_block_size =4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' -SELECT @@session.transaction_alloc_block_size; -@@session.transaction_alloc_block_size -4294966272 SET @@session.transaction_alloc_block_size = 65535; Warnings: Warning 1292 Truncated incorrect transaction_alloc_block_size value: '65535' @@ -77,12 +65,12 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '-1024' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size 1024 -SET @@global.transaction_alloc_block_size = 123456789201; +SET @@global.transaction_alloc_block_size = 135217728; Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '123456789201' +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size -4294966272 +134217728 SET @@global.transaction_alloc_block_size = ON; ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' SET @@global.transaction_alloc_block_size = OFF; @@ -109,12 +97,12 @@ Warning 1292 Truncated incorrect transaction_alloc_block_size value: '1000' SELECT @@global.transaction_alloc_block_size; @@global.transaction_alloc_block_size 1024 -SET @@session.transaction_alloc_block_size = 12345678901; +SET @@session.transaction_alloc_block_size = 135217728; Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '12345678901' +Warning 1292 Truncated incorrect transaction_alloc_block_size value: '135217728' SELECT @@session.transaction_alloc_block_size; @@session.transaction_alloc_block_size -4294966272 +134217728 SET @@session.transaction_alloc_block_size = ON; ERROR 42000: Incorrect argument type to variable 'transaction_alloc_block_size' SET @@session.transaction_alloc_block_size = OFF; @@ -149,9 +137,7 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size'; 1 '#---------------------FN_DYNVARS_001_08----------------------#' SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; -Warnings: -Warning 1292 Truncated incorrect transaction_alloc_block_size value: '4294967295' +SET @@global.transaction_alloc_block_size = 134217728; SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; @@transaction_alloc_block_size = @@global.transaction_alloc_block_size 0 diff --git a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result index cbd25426408..be54302689d 100644 --- a/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result +++ b/mysql-test/suite/sys_vars/r/transaction_prealloc_size_basic.result @@ -109,6 +109,12 @@ SELECT @@session.transaction_prealloc_size; 1024 SET @@session.transaction_prealloc_size = "Test"; ERROR 42000: Incorrect argument type to variable 'transaction_prealloc_size' +SET @@session.transaction_prealloc_size = 135217728; +Warnings: +Warning 1292 Truncated incorrect transaction_prealloc_size value: '135217728' +SELECT @@session.transaction_prealloc_size; +@@session.transaction_prealloc_size +134217728 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -128,7 +134,7 @@ Warnings: Warning 1292 Truncated incorrect transaction_prealloc_size value: '10' SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size; @@transaction_prealloc_size = @@global.transaction_prealloc_size -1 +0 '#---------------------FN_DYNVARS_001_10----------------------#' SET @@transaction_prealloc_size = 100; Warnings: diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test index f988292b21e..11634e1e0c7 100644 --- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test @@ -2,11 +2,6 @@ # This is a debug variable for now -- source include/have_debug.inc -if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in InnoDB 5.6.10 or earlier -} - SELECT @@global.innodb_buffer_pool_evict; SET GLOBAL innodb_buffer_pool_evict = 'uncompressed'; diff --git a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test index 782fb475140..85ae2358db5 100644 --- a/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_thread_sleep_delay_basic.test @@ -1,8 +1,3 @@ -if (`select plugin_auth_version <= "5.5.37-MariaDB-34.0" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in XtraDB as of 5.5.37-MariaDB-34.0 or earlier -} - # # 2010-01-27 - Added # diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf new file mode 100644 index 00000000000..02bdb44e1de --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf @@ -0,0 +1,5 @@ +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld.1] +slave_parallel_threads=20 diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test index 8e987489d86..b567b7f8854 100644 --- a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test +++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.test @@ -2,13 +2,20 @@ SET @save_slave_parallel_threads= @@GLOBAL.slave_parallel_threads; -SELECT @@GLOBAL.slave_parallel_threads as 'must be zero because of default'; +# Check that we don't spawn worker threads at server startup, when no +# slave is configured (MDEV-5289). +SELECT IF(COUNT(*) < 20, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; + +SELECT @@GLOBAL.slave_parallel_threads as 'must be 20 because of .cnf'; --error ER_INCORRECT_GLOBAL_LOCAL_VAR SELECT @@SESSION.slave_parallel_threads as 'no session var'; SET GLOBAL slave_parallel_threads= 0; SET GLOBAL slave_parallel_threads= DEFAULT; +SELECT @@GLOBAL.slave_parallel_threads as 'must be 0 because of default'; SET GLOBAL slave_parallel_threads= 10; SELECT @@GLOBAL.slave_parallel_threads; +# Check that we don't spawn worker threads when no slave is started. +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; SET GLOBAL slave_parallel_threads = @save_slave_parallel_threads; diff --git a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test index 4a69bbcdb01..0faa95c8fe6 100644 --- a/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test +++ b/mysql-test/suite/sys_vars/t/transaction_alloc_block_size_basic.test @@ -5,7 +5,7 @@ # Access Type: Dynamic # # Data Type: numeric # # Default Value: 8192 # -# Range: 1024-4294967295 # +# Range: 1024-134217728 # # # # # # Creation Date: 2008-02-14 # @@ -80,9 +80,6 @@ SELECT @@global.transaction_alloc_block_size; SET @@global.transaction_alloc_block_size = 60020; SELECT @@global.transaction_alloc_block_size; -SET @@global.transaction_alloc_block_size = 4294967295; -SELECT @@global.transaction_alloc_block_size; - --echo '#--------------------FN_DYNVARS_005_04-------------------------#' ################################################################### # Change the value of variable to a valid value for SESSION Scope # @@ -91,9 +88,6 @@ SELECT @@global.transaction_alloc_block_size; SET @@session.transaction_alloc_block_size = 1024; SELECT @@session.transaction_alloc_block_size; -SET @@session.transaction_alloc_block_size =4294967295; -SELECT @@session.transaction_alloc_block_size; - SET @@session.transaction_alloc_block_size = 65535; SELECT @@session.transaction_alloc_block_size; @@ -110,7 +104,7 @@ SET @@global.transaction_alloc_block_size = -1024; SELECT @@global.transaction_alloc_block_size; -SET @@global.transaction_alloc_block_size = 123456789201; +SET @@global.transaction_alloc_block_size = 135217728; SELECT @@global.transaction_alloc_block_size; -- Error ER_WRONG_TYPE_FOR_VAR @@ -136,7 +130,7 @@ SET @@global.transaction_alloc_block_size ="Test"; SET @@global.transaction_alloc_block_size = 1000; SELECT @@global.transaction_alloc_block_size; -SET @@session.transaction_alloc_block_size = 12345678901; +SET @@session.transaction_alloc_block_size = 135217728; SELECT @@session.transaction_alloc_block_size; -- Error ER_WRONG_TYPE_FOR_VAR @@ -185,7 +179,7 @@ WHERE VARIABLE_NAME='transaction_alloc_block_size'; ########################################################################### SET @@transaction_alloc_block_size = 1024; -SET @@global.transaction_alloc_block_size = 4294967295; +SET @@global.transaction_alloc_block_size = 134217728; SELECT @@transaction_alloc_block_size = @@global.transaction_alloc_block_size; diff --git a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test index 5eabf457a0c..9d0c20a37b4 100644 --- a/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test +++ b/mysql-test/suite/sys_vars/t/transaction_prealloc_size_basic.test @@ -5,7 +5,7 @@ # Access Type: Dynamic # # Data Type: numeric # # Default Value: 4096 # -# Range: # +# Range: 1024-134217728 # # # # # # Creation Date: 2008-02-14 # @@ -137,6 +137,10 @@ SELECT @@session.transaction_prealloc_size; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.transaction_prealloc_size = "Test"; +SET @@session.transaction_prealloc_size = 135217728; +SELECT @@session.transaction_prealloc_size; + + --echo '#------------------FN_DYNVARS_005_06-----------------------#' #################################################################### # Check if the value in GLOBAL Table matches value in variable # diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 416c73009e6..cbb73bbb3d4 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1326,6 +1326,14 @@ SHOW CREATE TABLE t2; DROP TABLE t2; DROP TABLE t1; +CREATE TABLE t1 ( + `transaction_id` int(11) NOT NULL DEFAULT '0', + KEY `transaction_id` (`transaction_id`)); +ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id); +SHOW CREATE TABLE t1; + +DROP TABLE t1; + --echo # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't --echo # identify correct column name. --echo # diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test index be8037abe11..20dbfe9c46a 100644 --- a/mysql-test/t/alter_table_online.test +++ b/mysql-test/t/alter_table_online.test @@ -7,7 +7,7 @@ drop table if exists t1,t2,t3; --enable_warnings # -# Test of things that can be done online +# Test of things that can not be done online # create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')); @@ -24,6 +24,13 @@ alter online table t1 comment "new comment"; --error ER_ALTER_OPERATION_NOT_SUPPORTED alter online table t1 rename to t2; +# No OPs + +alter online table t1 algorithm=INPLACE, lock=NONE; +alter online table t1; +alter table t1 algorithm=INPLACE; +alter table t1 lock=NONE; + drop table t1; # diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test index 32d7d70200a..7f394e0f846 100644 --- a/mysql-test/t/blackhole.test +++ b/mysql-test/t/blackhole.test @@ -17,6 +17,16 @@ SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2); DROP TABLE t1, t2; +# +# Bug#19786309 - CRASH IN UNLOCK TABLES AFTER LOCKING AND TRUNCATING TEMPORARY TABLE. +# +create temporary table t1 (a int) engine=blackhole; +lock table t1 write; +truncate table t1; +select * from t1; +unlock tables; +drop temporary table t1; + --echo End of 5.5 tests --echo # diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index 2c6040af7a1..97376eb7412 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -60,3 +60,32 @@ SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' and SUPPORT='YES'; --echo End of 5.5 tests + +--source include/not_windows_embedded.inc +--source include/have_example_plugin.inc +# +# Check that --bootstrap can install and uninstall plugins +# +let $PLUGIN_DIR=`select @@plugin_dir`; +--write_file $MYSQLTEST_VARDIR/tmp/install_plugin.sql +install soname 'ha_example'; +uninstall plugin unusable; +EOF +--exec $MYSQLD_BOOTSTRAP_CMD --plugin-dir=$PLUGIN_DIR < $MYSQLTEST_VARDIR/tmp/install_plugin.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +--remove_file $MYSQLTEST_VARDIR/tmp/install_plugin.sql + +# +# Check that installed plugins are *not* automatically loaded in --bootstrap +# +--write_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql +use test; +create table t1(a int) engine=example; +EOF +--exec $MYSQLD_BOOTSTRAP_CMD --plugin-dir=$PLUGIN_DIR < $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +--remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql +flush tables; +show create table t1; +drop table t1; +--replace_result .dll .so +select * from mysql.plugin; +truncate table mysql.plugin; diff --git a/mysql-test/t/bug46261-master.opt b/mysql-test/t/bug46261-master.opt deleted file mode 100644 index 5699a3387b8..00000000000 --- a/mysql-test/t/bug46261-master.opt +++ /dev/null @@ -1 +0,0 @@ ---skip-grant-tables diff --git a/mysql-test/t/bug46261.test b/mysql-test/t/bug46261.test deleted file mode 100644 index 9d8eecf3d52..00000000000 --- a/mysql-test/t/bug46261.test +++ /dev/null @@ -1,16 +0,0 @@ ---source include/not_embedded.inc ---source include/have_example_plugin.inc - ---echo # ---echo # Bug#46261 Plugins can be installed with --skip-grant-tables ---echo # - ---replace_regex /\.dll/.so/ ---error ER_OPTION_PREVENTS_STATEMENT -eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO'; - ---replace_regex /\.dll/.so/ ---error ER_OPTION_PREVENTS_STATEMENT -eval UNINSTALL PLUGIN example; - ---echo End of 5.1 tests diff --git a/mysql-test/t/ctype_binary.test b/mysql-test/t/ctype_binary.test index 4a2646d1db5..3d3f90b444b 100644 --- a/mysql-test/t/ctype_binary.test +++ b/mysql-test/t/ctype_binary.test @@ -20,5 +20,10 @@ SET NAMES binary; --source include/ctype_like_cond_propagation.inc --echo # +--echo # MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14 +--echo # +SELECT _binary 0x7E, _binary X'7E', _binary B'01111110'; + +--echo # --echo # End of 10.0 tests --echo # diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test index 060c09a0459..61fc5292094 100644 --- a/mysql-test/t/ctype_create.test +++ b/mysql-test/t/ctype_create.test @@ -105,3 +105,39 @@ ALTER DATABASE DEFAULT CHARACTER SET latin2; ALTER DATABASE aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DEFAULT CHARACTER SET latin2; --error 1102 ALTER DATABASE `` DEFAULT CHARACTER SET latin2; +USE test; + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-7387 Alter table xxx CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1 should fail +--echo # +--error ER_CONFLICTING_DECLARATIONS +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET utf8; +--error ER_CONFLICTING_DECLARATIONS +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET DEFAULT; +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8, CHARACTER SET utf8; +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET DEFAULT, CHARACTER SET DEFAULT; +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARCHAR(10) CHARACTER SET utf8); +--error ER_CONFLICTING_DECLARATIONS +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET latin1; +--error ER_CONFLICTING_DECLARATIONS +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET DEFAULT; +--error ER_CONFLICTING_DECLARATIONS +ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET utf8; +--error ER_CONFLICTING_DECLARATIONS +ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET DEFAULT; +--error ER_CONFLICTING_DECLARATIONS +ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET utf8; +--error ER_CONFLICTING_DECLARATIONS +ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET latin1; +DROP TABLE t1; + +--echo # +--echo # End of 10.0 tests +--echo # diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 336d8ca761d..aeaad2cc026 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -241,5 +241,10 @@ SELECT HEX(a),a FROM t1; DROP TABLE t1; --echo # +--echo # MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14 +--echo # +SELECT _latin1 0x7E, _latin1 X'7E', _latin1 B'01111110'; + +--echo # --echo # End of 10.0 tests --echo # diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 95008d83a38..5e8195e4718 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -507,6 +507,17 @@ select * from t1 where c1 = '=> dž'; select * from t1 where concat(c1) = '=> dž'; drop table t1; + +--echo # +--echo # MDEV-7649 wrong result when comparing utf8 column with an invalid literal +--echo # + +SET NAMES utf8 COLLATE utf8_unicode_ci; +--let ENGINE=MyISAM +--source include/ctype_utf8_ilseq.inc +--let ENGINE=HEAP +--source include/ctype_utf8_ilseq.inc + --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_uca_innodb.test b/mysql-test/t/ctype_uca_innodb.test new file mode 100644 index 00000000000..cb6caff4a03 --- /dev/null +++ b/mysql-test/t/ctype_uca_innodb.test @@ -0,0 +1,25 @@ +# +# Tests for UCA collations with InnoDB +# + +let collation=utf8_unicode_ci; +--source include/have_collation.inc +--source include/have_innodb.inc + + +--echo # +--echo # Start of 5.5 tests +--echo # + + +--echo # +--echo # MDEV-7649 wrong result when comparing utf8 column with an invalid literal +--echo # + +SET NAMES utf8 COLLATE utf8_unicode_ci; +--let ENGINE=InnoDB +--source include/ctype_utf8_ilseq.inc + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 1e9047cca8e..fcd19c112e9 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1616,6 +1616,42 @@ UNION ALL SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1; --echo # +--echo # MDEV-7814 Assertion `args[0]->fixed' fails in Item_func_conv_charset::Item_func_conv_charset +--echo # +CREATE TABLE t1(a CHAR(1) CHARACTER SET latin1, b INT NOT NULL); +CREATE TABLE t2(a CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci, b INT NOT NULL); +SELECT (SELECT t2.a FROM t2 WHERE t2.a=t1.a) AS aa, b, COUNT(b) FROM t1 GROUP BY aa; +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-7649 wrong result when comparing utf8 column with an invalid literal +--echo # + +SET NAMES utf8 COLLATE utf8_general_ci; +--let ENGINE=InnoDB +--source include/ctype_utf8_ilseq.inc +--let ENGINE=MyISAM +--source include/ctype_utf8_ilseq.inc +--let ENGINE=HEAP +--source include/ctype_utf8_ilseq.inc + +--echo # +--echo # MDEV-8067 correct fix for MySQL Bug # 19699237: UNINITIALIZED VARIABLE IN ITEM_FIELD::STR_RESULT +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET latin1); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +INSERT INTO t1 VALUES ('aaa'); +INSERT INTO t2 VALUES ('aaa'); +# Running the below query crashed with two rows +--error ER_SUBQUERY_NO_1_ROW +SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2); +DROP TABLE t1, t2; + + +--echo # --echo # End of 5.5 tests --echo # @@ -1744,6 +1780,11 @@ EXECUTE stmt USING @b,@b; DEALLOCATE PREPARE stmt; DROP TABLE t1; +--echo # +--echo # MDEV-7629 Regression: Bit and hex string literals changed column names in 10.0.14 +--echo # +SELECT _utf8 0x7E, _utf8 X'7E', _utf8 B'01111110'; + let $ctype_unescape_combinations=selected; --source include/ctype_unescape.inc diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 61ae3695a1f..ddce7f55292 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -492,5 +492,17 @@ update t1 set balance=(select sum(balance) from (SELECT balance FROM t1 where ac set optimizer_switch=@save_derived_optimizer_switch_bug; drop table t1; - set optimizer_switch=@save_derived_optimizer_switch; + +--echo # +--echo # MDEV-6892: WHERE does not apply +--echo # +create table t1 (id int); +create table t2 (id int); +insert into t1 values(1),(2),(3); +insert into t2 values(4),(5),(6); +#explain extended +select x.id, message from (select id from t1) x left join +(select id, 1 as message from t2) y on x.id=y.id +where coalesce(message,0) <> 0; +drop table t1,t2; diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 65a94dcb49e..86dcee8148a 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -657,6 +657,13 @@ SELECT select column_get(column_create(1, "18446744073709552001" as char), 1 as int); --echo # +--echo # MDEV-7505 - Too large scale in DECIMAL dynamic column getter crashes +--echo # mysqld +--echo # +--error ER_TOO_BIG_SCALE +SELECT COLUMN_GET(`x`, 'y' AS DECIMAL(5,34)); + +--echo # --echo # test of symbolic names --echo # --echo # creation test (names) diff --git a/mysql-test/t/empty_server_name-8224.test b/mysql-test/t/empty_server_name-8224.test new file mode 100644 index 00000000000..528bce5dac5 --- /dev/null +++ b/mysql-test/t/empty_server_name-8224.test @@ -0,0 +1,9 @@ +# +# MDEV-8224 Server crashes in get_server_from_table_to_cache on empty name +# +--source include/not_embedded.inc +create server '' foreign data wrapper w2 options (host '127.0.0.1'); +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server 10 +--source include/wait_until_disconnected.inc +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect diff --git a/mysql-test/t/error_simulation-master.opt b/mysql-test/t/error_simulation-master.opt new file mode 100644 index 00000000000..c9f8d7bd0c0 --- /dev/null +++ b/mysql-test/t/error_simulation-master.opt @@ -0,0 +1 @@ +--tmpdir=$MYSQLTEST_VARDIR/tmp diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test index 58ead1e3ced..7c343ed6566 100644 --- a/mysql-test/t/error_simulation.test +++ b/mysql-test/t/error_simulation.test @@ -1,4 +1,5 @@ -- source include/have_debug.inc +--source include/not_embedded.inc # # Bug #28499: crash for grouping query when tmp_table_size is too small @@ -112,3 +113,38 @@ DROP TABLE t1,t2; --echo # --echo # End of 5.1 tests --echo # + + +--echo # +--echo # BUG#11747548:DETECT ORPHAN TEMP-POOL FILES, AND HANDLE GRACEFULLY. +--echo # + +--echo #Set up. +CREATE TABLE pid_table(pid_no INT); +CREATE TABLE t1 (a BLOB); +INSERT INTO t1 VALUES (1), (2); + +--echo #Create MYD and MYI files for intrinsic temp table. +--let $pid_file=`SELECT @@pid_file` +--replace_result $pid_file pid_file +--eval LOAD DATA LOCAL INFILE '$pid_file' INTO TABLE pid_table +--let $temp_file= `SELECT CONCAT('#sql_', LCASE(HEX(pid_no)), '_0') FROM pid_table` +--write_file $MYSQLTEST_VARDIR/tmp/$temp_file.MYD +EOF +--write_file $MYSQLTEST_VARDIR/tmp/$temp_file.MYI +EOF +--write_file $MYSQLTEST_VARDIR/tmp/$temp_file.MAD +EOF +--write_file $MYSQLTEST_VARDIR/tmp/$temp_file.MAI +EOF + +--echo #Reports an error since the temp file already exists. +--replace_regex /.*Can't create\/write *.*/Can't create or write to file/ +#--error 1 +SELECT a FROM t1 ORDER BY rand(1); + +--echo #With patch, the query executes successfully. +SELECT a FROM t1 ORDER BY rand(1); + +--echo #cleanup +DROP TABLE t1, pid_table; diff --git a/mysql-test/t/explain_non_select.test b/mysql-test/t/explain_non_select.test index f05373c312e..e36fd518b61 100644 --- a/mysql-test/t/explain_non_select.test +++ b/mysql-test/t/explain_non_select.test @@ -197,4 +197,14 @@ select 'OK'; drop function f1; drop table t1; +--echo # +--echo # MDEV-7038: Assertion `status_var.memory_used == 0' failed in THD::~THD() +--echo # on disconnect after executing EXPLAIN for multi-table UPDATE +--echo # +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +INSERT INTO t1 VALUES (1),(2); +EXPLAIN UPDATE v1, mysql.user SET v1.a = v1.a + 1; +DROP TABLE t1; +DROP VIEW v1; diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test index f52f0a93c82..186394df4e3 100644 --- a/mysql-test/t/file_contents.test +++ b/mysql-test/t/file_contents.test @@ -17,7 +17,7 @@ if ($dir_bin eq '/usr/') { $dir_docs =~ s|/lib|/share/doc|; if(-d "$dir_docs/packages") { # SuSE: "packages/" in the documentation path - $dir_docs = glob "$dir_docs/packages/MySQL-server*"; + $dir_docs = glob "$dir_docs/packages/*-server*"; } else { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; @@ -27,7 +27,7 @@ if ($dir_bin eq '/usr/') { $dir_docs = "$dir_bin/share/doc"; if(-d "$dir_docs/packages") { # SuSE: "packages/" in the documentation path - $dir_docs = glob "$dir_docs/packages/MySQL-server*"; + $dir_docs = glob "$dir_docs/packages/*-server*"; } else { # RedHat/Debian: version number in directory name $dir_docs = glob "$dir_docs/mariadb-server-*"; @@ -36,7 +36,7 @@ if ($dir_bin eq '/usr/') { # Slackware $dir_docs = glob "$dir_bin/doc/mariadb-[0-9]*" unless -d $dir_docs; } else { - # tar.gz package, Windows, or developer work (in BZR) + # tar.gz package, Windows, or developer work (in git) $dir_docs = $dir_bin; if(-d "$dir_docs/docs") { $dir_docs = "$dir_docs/docs"; # package @@ -49,7 +49,7 @@ $found_revision = "No line 'revision-id: .....' in $dir_docs/INFO_SRC"; open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n"; while(defined ($line = <I_SRC>)) { if ($line =~ m|^MySQL source \d+\.\d\.\d+|) {$found_version = "Found MySQL version number";} - if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";} + if ($line =~ m|^commit: \w{40}$|) {$found_revision = "Found GIT revision id";} } close I_SRC; print "INFO_SRC: $found_version / $found_revision\n"; diff --git a/mysql-test/t/filesort_bad_i_s-7585.test b/mysql-test/t/filesort_bad_i_s-7585.test new file mode 100644 index 00000000000..daf70acdd52 --- /dev/null +++ b/mysql-test/t/filesort_bad_i_s-7585.test @@ -0,0 +1,14 @@ +# +# MDEV-7585 Assertion `thd->is_error() || kill_errno || thd->killed == ABORT_QUERY' failed in ha_rows filesort +# +SET sql_mode=STRICT_TRANS_TABLES; + +CREATE TABLE t0 (i INT) ENGINE=MyISAM; +CREATE VIEW v1 AS SELECT * FROM t0; +CREATE VIEW v2 AS SELECT * FROM v1; +DROP VIEW IF EXISTS v1; + +CREATE TABLE t1 (i INT) ENGINE=MyISAM; +INSERT INTO t1 SELECT TABLE_ROWS FROM information_schema.tables ORDER BY TABLE_ROWS; +DROP VIEW v2; +DROP TABLE t1, t0; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 7643676ea61..42a30760a86 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -803,3 +803,21 @@ create table t1 (a char(1) character set utf8); insert into t1 values ('a'),('b'); select 1 from t1 where a in (select group_concat(a) from t1); drop table t1; + +# +# MDEV-7820 Server crashes in in my_strcasecmp_utf8 on subquery in ORDER BY clause of GROUP_CONCAT +# +CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t1 VALUES ('a'),('b'); + +CREATE TABLE t2 (f2 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('c'); + +CREATE TABLE t3 (f3 VARCHAR(10)) ENGINE=MyISAM; +INSERT INTO t3 VALUES ('d'),('e'); + +SELECT GROUP_CONCAT( f2 ORDER BY ( f2 IN ( SELECT f1 FROM t1 WHERE f1 <= f2 ) ) ) AS field +FROM ( SELECT * FROM t2 ) AS sq2, t3 +ORDER BY field; + +drop table t3, t2, t1; diff --git a/mysql-test/t/func_regexp_pcre.test b/mysql-test/t/func_regexp_pcre.test index 6710f5cf096..c9b4c10007d 100644 --- a/mysql-test/t/func_regexp_pcre.test +++ b/mysql-test/t/func_regexp_pcre.test @@ -402,3 +402,27 @@ SET default_regex_flags=DEFAULT; --echo # MDEV-6965 non-captured group \2 in regexp_replace --echo # SELECT REGEXP_REPLACE('1 foo and bar', '(\\d+) foo and (\\d+ )?bar', '\\1 this and \\2that'); + +--echo # +--echo # MDEV-8102 REGEXP function fails to match hex values when expression is stored as a variable +--echo # + +--echo # Testing a warning +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workaround N1: This makes the pattern to be a binary string: +SET NAMES latin1; +SET @regCheck= X'E001'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workaround N2: This also makes the pattern to be a binary string, using a different syntax: +SET NAMES latin1; +SET @regCheck= _binary '\\xE0\\x01'; +SELECT 0xE001 REGEXP @regCheck; + +--echo # Testing workarond N3: This makes derivation of the subject string stronger (IMLICIT instead of COERCIBLE) +SET NAMES latin1; +SET @regCheck= '\\xE0\\x01'; +SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck; diff --git a/mysql-test/t/func_regexp_pcre_debug.test b/mysql-test/t/func_regexp_pcre_debug.test new file mode 100644 index 00000000000..c2581fa4110 --- /dev/null +++ b/mysql-test/t/func_regexp_pcre_debug.test @@ -0,0 +1,6 @@ +--source include/have_debug.inc + +SET debug_dbug='+d,pcre_exec_error_123'; +SELECT 'a' RLIKE 'a'; +SET debug_dbug=''; +SELECT 'a' RLIKE 'a'; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 2b189765bbc..3fb87e91b17 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1649,3 +1649,44 @@ INSERT INTO t1 VALUES (17, NULL); INSERT INTO t1 VALUES (18, '2010-10-13'); SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id; DROP TABLE t1; + + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-8205 timediff returns null when comparing decimal time to time string value +--echo # + +# 1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-01 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140101010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140101010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-01 01:00:00' ) AS dec_str; + +# 1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140102010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140102010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-02 01:00:00' ) AS dec_str; + +# 1M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-02-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140202010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140202010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-02-02 01:00:00' ) AS dec_str; + +# 2M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-03-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140302010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140302010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-03-02 01:00:00' ) AS dec_str; + +--echo # +--echo # End of 10.0 tests +--echo # diff --git a/mysql-test/t/galera_sst_mode.test b/mysql-test/t/galera_sst_mode.test deleted file mode 100644 index dd8f9531c9d..00000000000 --- a/mysql-test/t/galera_sst_mode.test +++ /dev/null @@ -1,43 +0,0 @@ -# Embedded server doesn't support external clients ---source include/not_embedded.inc -# Binlog is required ---source include/have_log_bin.inc - ---echo # ---echo # Test for mysqldump's galera-sst-mode option ---echo # - ---echo # ---echo # MDEV-6490: mysqldump unknown option --galera-sst-mode ---echo # -CREATE DATABASE bug6490; -USE bug6490; -CREATE TABLE t1(c1 INT); -INSERT INTO t1 values (1); -INSERT INTO t1 values (2); - ---echo # Save the current gtid_binlog_state. ---let $before= `SELECT @@global.gtid_binlog_state` - ---echo # Take a dump of bug6490 database ---exec $MYSQL_DUMP --galera-sst-mode bug6490 > $MYSQLTEST_VARDIR/tmp/bug6490.sql -DROP TABLE t1; - ---echo # Load the dump -RESET MASTER; ---exec $MYSQL -uroot bug6490 < $MYSQLTEST_VARDIR/tmp/bug6490.sql - -SELECT * from t1; - ---echo # Compare the two gtid_binlog_state's ---let $after= `SELECT @@global.gtid_binlog_state` -if (`SELECT STRCMP($before, $after)`) -{ - --die ERROR: The two gtid_binlog_state's did not match. -} - ---echo # Cleanup ---remove_file $MYSQLTEST_VARDIR/tmp/bug6490.sql -DROP DATABASE bug6490; - ---echo # End of test diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 2625ec5d3c9..9378ea55377 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -7,6 +7,7 @@ --disable_warnings DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP VIEW IF EXISTS v1; --enable_warnings CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); @@ -1477,4 +1478,17 @@ create table t1 (pt point); insert into t1 values(Geomfromtext('POLYGON((1 1, 2 2, 2 1, 1 1))')); drop table t1; ---echo End of 5.5 tests +# +# MDEV-7516 Assertion `!cur_p->event' failed in Gcalc_scan_iterator::arrange_event(int, int) +# +SELECT st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)); + +# +# MDEV-7779 View definition changes upon creation +# +CREATE VIEW v1 AS SELECT POINT(1,1) AS p; +SHOW CREATE VIEW v1; +SELECT ASTEXT(p) FROM v1; +DROP VIEW v1; + +# --echo End of 5.5 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 4b1cb82d0f9..4b992faa306 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1515,6 +1515,17 @@ let $query= SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b; --echo DROP TABLE t1; + +# +# Bug#19880368 : GROUP_CONCAT CRASHES AFTER DUMP_LEAF_KEY +# +create table t1 (a int, b int); +insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45); +create table t2 (c int, d int); +insert into t2 values (1,11), (2,22), (4,44); +select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b); +drop table t1, t2; + --echo # --echo # LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE --echo # diff --git a/mysql-test/t/group_by_innodb.test b/mysql-test/t/group_by_innodb.test index 75ee3d0802a..e072a94fada 100644 --- a/mysql-test/t/group_by_innodb.test +++ b/mysql-test/t/group_by_innodb.test @@ -85,4 +85,44 @@ a.oid=b.oid WHERE a.oidGroup=1 GROUP BY a.oid; DROP TABLE t1, t2; +--echo # +--echo # MDEV-7193: Incorrect Query Result (MySQL Bug 68897) in MariaDB 10.0.14 +--echo # (fixed by MDEV-5719) +--echo # + +CREATE TABLE `t1` ( + `param` int(11) NOT NULL, + `idx` int(11) NOT NULL, + `text` varchar(255) default NULL, + PRIMARY KEY (`param`,`idx`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `t1` (`param`, `idx`, `text`) VALUES +(1, 0, 'select'), +(1, 1, 'Kabel mit Stecker 5-polig'), +(1, 2, 'Kabel ohne Stecker'), +(2, 0, 'number'), +(2, 1, '22'), +(2, 2, '25'); +CREATE TABLE `t2` ( + `id` int PRIMARY KEY +); + +INSERT INTO t2 VALUES (1),(2),(3),(4); +SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen +FROM t2 +LEFT JOIN t1 AS T ON(T.param=t2.id AND T.idx=0 ) +LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) +GROUP BY t2.id +ORDER BY id ASC; + +SELECT t2.id AS id, T.text AS xtext,GROUP_CONCAT(T3.text) AS optionen +FROM t2 +LEFT JOIN t1 AS T ON(T.param=t2.id AND T.idx=0 ) +LEFT JOIN t1 AS T3 ON(T3.param=t2.id AND T3.idx>0 ) +GROUP BY t2.id +ORDER BY id DESC; + +DROP TABLE t1, t2; + --echo # End of tests diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index cd6a4c9d328..0f6be0b0ec6 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -694,6 +694,41 @@ DROP TABLE t1; --echo End of 5.3 tests --echo # +--echo # Bug MDEV-7301: Unknown column quoted with backticks in HAVING clause when using function. +--echo # Bug#16221433 MYSQL REJECTS QUERY DUE TO BAD RESOLUTION OF NAMES IN HAVING; VIEW UNREADABLE +--echo # + +CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `title` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) DEFAULT CHARSET=utf8; + +INSERT INTO `t1` VALUES ('1', 'Just for fun'); +INSERT INTO `t1` VALUES ('2', 'Wait until a sunhine'); +INSERT INTO `t1` VALUES ('3', 'Take a new turn'); + +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING `column_1` LIKE '8%'; + +--echo expected 1 row(s) returned + +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(column_1) LIKE '8%'; + +--echo expected -- 1 row(s) returned + +SELECT `id`, SHA1(`title`) AS `column_1` +FROM `t1` +HAVING UPPER(`column_1`) LIKE '8%'; + +--echo expected -- 1 row(s) returned not ER_BAD_FIELD_ERROR + +drop table t1; + +--echo # --echo # Bug mdev-5160: two-way join with HAVING over the second table --echo # @@ -708,4 +743,3 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1; DROP TABLE t1,t2; --echo End of 10.0 tests - diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 9fdc29e88de..b2e18097c65 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1819,6 +1819,23 @@ drop view v1; --echo # Clean-up. drop database mysqltest; +--echo # +--echo # Test for bug #16869534 - "QUERYING SUBSET OF COLUMNS DOESN'T USE TABLE +--echo # CACHE; OPENED_TABLES INCREASES" +--echo # +--disable_result_log +SELECT * FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +SELECT VARIABLE_VALUE INTO @val1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE + VARIABLE_NAME LIKE 'Opened_tables'; +--disable_result_log +SELECT ENGINE FROM INFORMATION_SCHEMA.TABLES; +--enable_result_log +--echo # The below SELECT query should give same output as above SELECT query. +SELECT VARIABLE_VALUE INTO @val2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE + VARIABLE_NAME LIKE 'Opened_tables'; +--echo # The below select should return '1' +SELECT @val1 = @val2; --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/information_schema2.test b/mysql-test/t/information_schema2.test index c2479087f47..d577cdc1e4d 100644 --- a/mysql-test/t/information_schema2.test +++ b/mysql-test/t/information_schema2.test @@ -7,3 +7,16 @@ select variable_name from information_schema.session_status where variable_name select variable_name from information_schema.session_variables where variable_name = (select variable_name from information_schema.session_variables where variable_name = 'basedir'); +# +# information_schema tables inside subqueries, they should not be re-populated +# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s +# table. if it's re-populated, it'll do that multiple times) +# +create table t1 (a char); +insert t1 values ('a'),('t'),('z'); +flush status; +select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1; +# fix the result in ps-protocol +--replace_result 44 43 +show status like 'created_tmp_tables'; +drop table t1; diff --git a/mysql-test/t/join_cache.test b/mysql-test/t/join_cache.test index 0e4610b9f54..7d873c555f6 100644 --- a/mysql-test/t/join_cache.test +++ b/mysql-test/t/join_cache.test @@ -3848,6 +3848,18 @@ set join_buffer_space_limit=default; drop table t1; +--echo # +--echo # MDEV-6687: Assertion `0' failed in Protocol::end_statement on query +--echo # +SET join_cache_level = 3; +--echo # The following should have +--echo # - table order PROFILING,user, +--echo # - table user accessed with hash_ALL: +explain +SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user WHERE password_expired = PAGE_FAULTS_MINOR; + +set join_cache_level=default; + # The following command must be the last one the file # this must be the last command in the file set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/t/log_errchk.test b/mysql-test/t/log_errchk.test index e4bc6a841dd..2808458e9f1 100644 --- a/mysql-test/t/log_errchk.test +++ b/mysql-test/t/log_errchk.test @@ -6,7 +6,8 @@ # Bug#14757009 : WHEN THE GENERAL_LOG IS A SOCKET AND THE READER GOES AWAY, # MYSQL QUITS WORKING. # -call mtr.add_suppression("Could not use"); +# MDEV-6870 Not possible to use FIFO file as a general_log file +# --let $gen_log_file= $MYSQLTEST_VARDIR/tmp/general_log.fifo --let $slow_query_log_file= $MYSQLTEST_VARDIR/tmp/slow_log.fifo @@ -15,10 +16,9 @@ call mtr.add_suppression("Could not use"); --exec mkfifo $gen_log_file --exec mkfifo $slow_query_log_file ---echo # Case 1: Setting fife file to general_log_file and slow_query_log_file +--echo # Case 1: Setting fifo file to general_log_file and slow_query_log_file --echo # system variable. -# Only regular files can be set to general log. Setting fifo file to general log -# reports an error. +# Setting fifo file to general log reports an error because the other end is closed --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --error ER_WRONG_VALUE_FOR_VAR --eval SET GLOBAL general_log_file="$gen_log_file"; @@ -38,11 +38,12 @@ call mtr.add_suppression("Could not use"); --exec echo "restart: --general-log-file=$gen_log_file --slow-query-log-file=$slow_query_log_file" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --source include/wait_until_connected_again.inc -# With fix error should be reported in the error log file if file is not a -# regular file. +# Error 6 is reported, because the other end is closed +call mtr.add_suppression("Could not use .* for logging \\(error 6\\)"); +call mtr.add_suppression("File '.*' not found \\(Errcode: 6 "); --perl my $file= $ENV{'GREP_FILE'}; - my $pattern= "Turning logging off for the whole duration"; + my $pattern= "for logging \\(error 6\\)\\. Turning logging off for the whole duration"; open(FILE, "$file") or die("Unable to open $file: $!\n"); my $count = 0; while (<FILE>) { diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 4f8736f0c2d..c013938416e 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -849,6 +849,212 @@ update t1 join v3 using (id) set t1.a=0; drop view v1, v2, v3; drop table t2, t3, t1; +--echo # +--echo # MDEV-7613: MariaDB 5.5.40 server crash on update table left join +--echo # with a view +--echo # + +CREATE TABLE `t1` ( + `f1` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, + `f2` varchar(6) COLLATE latin1_general_ci DEFAULT NULL, + `f3` varchar(7) COLLATE latin1_general_ci DEFAULT NULL, + `f4` varchar(15) COLLATE latin1_general_ci DEFAULT NULL, + `f5` datetime DEFAULT NULL, + `f6` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, + `f7` varchar(2) COLLATE latin1_general_ci DEFAULT NULL, + `ff1` int(1) DEFAULT NULL, + `ff2` int(1) DEFAULT NULL, + `ff3` int(1) DEFAULT NULL, + `ff4` int(1) DEFAULT NULL, + `ff5` int(1) DEFAULT NULL, + `ff6` int(1) DEFAULT NULL, + `ff7` int(1) DEFAULT NULL, + `ff8` int(2) DEFAULT NULL, + `ff9` int(1) DEFAULT NULL, + `ff10` int(1) DEFAULT NULL, + `ff11` int(1) DEFAULT NULL, + `ff12` int(1) DEFAULT NULL, + `ff13` int(1) DEFAULT NULL, + `ff14` int(1) DEFAULT NULL, + `ff15` int(1) DEFAULT NULL, + `f8` varchar(70) COLLATE latin1_general_ci DEFAULT NULL, + `f9` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, + `f10` varchar(50) COLLATE latin1_general_ci NOT NULL, + `f11` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f12` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `f13` text COLLATE latin1_general_ci, + `f14` time DEFAULT NULL, + `f15` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, + `fg1` int(11) DEFAULT NULL, + `fg2` int(11) DEFAULT NULL, + `fg3` int(11) DEFAULT NULL, + `fg4` int(11) DEFAULT NULL, + `fg5` int(11) DEFAULT NULL, + `fg6` int(11) DEFAULT NULL, + `fg7` int(11) DEFAULT NULL, + `fg9` int(11) DEFAULT NULL, + `fg10` int(11) DEFAULT NULL, + `fg11` int(11) DEFAULT NULL, + `fg12` int(11) DEFAULT NULL, + `fg13` int(11) DEFAULT NULL, + `fg14` int(11) DEFAULT NULL, + `fg15` int(11) DEFAULT NULL, + `f16` double DEFAULT NULL, + `f17` double DEFAULT NULL, + `f18` int(11) DEFAULT NULL, + `f19` int(11) DEFAULT NULL, + `f20` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `f21` int(11) DEFAULT NULL, + `f22` int(11) DEFAULT NULL, + `f23` int(11) DEFAULT NULL, + `f24` double DEFAULT NULL, + `f25` int(11) DEFAULT NULL, + `f26` double DEFAULT NULL, + `f27` int(11) DEFAULT NULL, + `f28` int(11) DEFAULT NULL, + `f29` double DEFAULT NULL, + `f30` int(11) DEFAULT NULL, + `f31` double DEFAULT NULL, + `PZ` double DEFAULT NULL, + `f32` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f33` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f34` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f35` varchar(30) COLLATE latin1_general_ci DEFAULT NULL, + `f36` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, + `f37` varchar(50) COLLATE latin1_general_ci DEFAULT NULL, + `f20_2` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, + `f38` varchar(30) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Email = E-Mail / Whitemail = Brief', + `insert_ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`f10`), + KEY `f5_f12` (`f5`,`f12`), + KEY `f5_f20` (`f5`,`f20`), + KEY `f5_f33` (`f5`,`f33`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT; + +INSERT INTO `t1` VALUES ('2011/2','201105','2011/19','gstfbnfr','2011-05-06 +00:00:00','gg','Ag',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'','','','','','','21:56:28','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,0,0,'Dffgult',1,0,0,NULL,0,NULL,0,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ggggil',NULL),('2008/4','200812','2008/50','hgckbgfx','2008-12-08 +00:00:00','gg','Ag',2,NULL,2,1,1,1,1,24,1,NULL,1,1,1,2,0,'gusschlifßlich +zugg +gflffonifrfn','88.77.79.214','10001614','fg-gtgggggdgtfn','fg-gtgggggdgtfn','birgit.tfrpfllf@gggx.df','11:55:21',NULL,1,0,1,1,1,1,1,1,0,1,1,1,0,0,NULL,NULL,0,4,'ffrtrgg',1,6,10,1.66666666666667,4,1,10,14,1.4,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/51','hgckbgfx','2008-12-15 +00:00:00','gg','Ag',4,5,5,4,5,5,5,NULL,4,5,1,1,1,4,0,'gusschlifßlich zugg +gflffonifrfn','79.197.185.64','10001686','fg-gtgggggdgtfn','fg-gtgggggdgtfn','kgtjg@swfftys.df','09:28:42',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,11,4.71428571428571,16,1.2,12,49,4.08111111111111,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.',NULL,'ggggil',NULL),('2008/4','200812','2008/50','nufchti','2008-12-08 +00:00:00','gg','Ag',4,1,1,5,5,5,5,12,4,5,1,1,2,1,0,'gusschlifßlich zugg +gflffonifrfn','89.54.151.216','10001700','fg-gtgggggdgtfn','fg-gtgggggdgtfn','H_K2006@frffnft.df','16:41:45',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,10,4.28571428571429,11,2.6,12,41,1.58111111111111,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Nufchtfr, +Iris','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','junghdro','2008-12-11 +00:00:00','Do','Ag',2,2,5,5,4,4,2,72,2,5,2,2,1,1,0,'gusschlifßlich zugg +gflffonifrfn','84.61.20.216','10001849','fg-ggriff','fg-ggriff','schofnf-glftfr@grcor.df','20:18:05',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,24,1.42857142857141,12,2.4,12,16,1,1,NULL,NULL,'ffrtrgg +Bgckofficf 5','vb5','Junghfinrich, +Dorothfg','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','fbflktj','2008-12-08 +00:00:00','gg','Ag',4,2,2,5,1,1,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','217.84.62.6','10001888','fg-Kündigungfn','fg-Kündigungfn','f.frofschkf@gggx.df','21:05:59',NULL,1,1,1,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,7,16,2.28571428571429,0,NULL,7,16,2.28571428571429,0,NULL,NULL,'out',NULL,'gbfl, +Kgtjg','49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','gltggggri','2008-12-09 +00:00:00','Di','Ag',4,1,1,4,2,1,2,16,1,2,2,2,2,2,0,'gusschlifßlich zugg +gflffonifrfn','81.171.157.211','10001988','fg-gtgggggdgtfn','fg-gtgggggdgtfn','bistfr@nftcolognf.df','11:07:54',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,21,1,11,2.2,12,12,2.66666666666667,1,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL),('2008/4','200812','2008/50','ggufllfsg','2008-12-09 +00:00:00','Di','Ag',2,2,2,2,1,1,2,12,2,2,2,1,1,2,0,'ggobilfs +Intfrnft','62.154.142.186','10002097','fg-gtgggggdgtfn','fg-gtgggggdgtfn','norbfrtwfdlich@fgggil.df','09:42:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,12,1.71428571428571,8,1.6,12,20,1.66666666666667,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Mufllfr, +ggbinf','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','wggnfg','2008-12-09 +00:00:00','Di','Ag',5,5,5,5,5,5,5,12,5,5,5,5,5,5,0,'gls grsgtz für +Ffstnftz','85.180.141.246','10002127','fg-Kündigungfn','fg-Kündigungfn','rfinhgrt.gdolph@yghoo.df','17:44:11',NULL,1,1,1,1,1,1,1,1,1,1,1,1,0,0,NULL,NULL,0,5,'ffrtrgg',1,7,15,5,25,5,12,60,5,1,NULL,NULL,'ffrtrgg +Bgckofficf 1','vb1','Wggnfr, +Annftt','49','ggobilcogg','grfurt','Intfrn','ggggil',NULL),('2008/4','200812','2008/50','schubrbf','2008-12-10 +00:00:00','Mi','Ag',1,2,NULL,2,1,2,1,24,NULL,NULL,NULL,NULL,NULL,0,0,'Kgggfrg +bzw. DigiCggg +Funktion','91.40.98.242','10002160','fg-gtgggggdgtfn','fg-gtgggggdgtfn','olgf.lifb@gggx.nft','18:18:25',NULL,1,1,0,1,1,1,1,0,0,0,0,0,0,0,NULL,NULL,0,0,'ffrtrgg',1,6,11,1.81111111111111,0,NULL,6,11,1.81111111111111,0,NULL,NULL,'out',NULL,NULL,'49','ggobilcogg','k.A.','gxtfrn','ggggil',NULL); + +CREATE TABLE `t2` ( + `ft1` datetime DEFAULT NULL, + `ft2` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ft3` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ft4` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', + `ft5` varchar(255) COLLATE latin1_general_ci NOT NULL DEFAULT '', + `ft6` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft6_2` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft7` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft8` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft9` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + `ft10` varchar(255) COLLATE latin1_general_ci DEFAULT NULL, + PRIMARY KEY (`ft4`,`ft5`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + +INSERT INTO `t2` VALUES ('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 2','Default','Intern','DEFAULT',NULL,NULL,NULL),('2013-03-13 00:00:00','2013-03-13 00:00:00','9999-12-31 00:00:00','#','extern FP f32 3','Default','Intern','DEFAULT',NULL,NULL,NULL); + +CREATE TABLE `t3` ( + `fe1` int(10) NOT NULL DEFAULT '0', + `fe2` char(50) COLLATE latin1_general_ci DEFAULT 'nn', + `f34` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe3` double DEFAULT NULL, + `fe4` double DEFAULT NULL, + `fe5` char(4) COLLATE latin1_general_ci DEFAULT NULL, + `f32` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe6` int(3) DEFAULT '0', + `fe7` char(1) COLLATE latin1_general_ci DEFAULT NULL, + `ft6` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `f33` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'virtuelle f33s', + `fe8` char(4) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'aus dem ADS', + `f37` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe9` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe10` int(5) DEFAULT '0', + `fe11` int(10) DEFAULT '0', + `fe12` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe13` double DEFAULT NULL, + `fe14` char(50) COLLATE latin1_general_ci DEFAULT NULL, + `fe15` date DEFAULT NULL, + `fe16` date DEFAULT NULL, + `fe17` int(10) DEFAULT '0', + `fe18` date NOT NULL DEFAULT '0000-00-00', + `ft3` date NOT NULL DEFAULT '0000-00-00', + PRIMARY KEY (`fe1`), + KEY `fe2` (`fe2`,`fe18`,`ft3`), + KEY `f33` (`f33`), + KEY `fe8` (`fe8`) +) DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci ROW_FORMAT=COMPACT COMMENT='CustomerService und Outsourcer Userinformationen'; + +INSERT INTO `t3` VALUES (1,'aabggn','gab, glgna',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',91611,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2011-01-01','2014-08-11'),(4,'aabigr','gab, +Iggr',0,NULL,NULL,'gxtgrn D gnd g +gggsbgrg',0,NULL,'gxtgrn','dsa','dsa','gggsbgrg','0',0,0,'0',0,'agsggschigdgn','2014-08-11','2014-09-05',0,'2012-10-01','2014-08-11'),(7,'abgcrist','gbg, +ghristggna',15182,1,'ja','ggshilfg gxtgrn 1',1,NULL,'gg +galgs','ag1','ag1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'1900-01-01','2010-06-10'),(8,'abgcrist','gbg, +ghristggna',15182,1,'ja','Zgntralg gftgr galgs Bgtrgggng 1',1,NULL,'gg +galgs','sb1','sb1','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2010-07-01','2012-08-11'),(9,'abgcrist','gbg, +ghristggna',15182,1,'ja','galgs Inbggnd 2',1,NULL,'gg +galgs','si2','si2','grfgrt','0',11941,0,'0',0,'agsggschigdgn','2014-01-11',NULL,11802051,'2012-09-01','2014-01-11'),(10,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'1900-01-01','2010-11-10'),(11,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 1',1,NULL,'gg +galgs','sg1','sg1','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2010-12-01','2011-08-11'),(12,'abgcgr','gbg, +ggrnglgg',14962,1,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,NULL,11800647,'2011-09-01','2012-01-11'),(13,'abgcgr','gbg, +ggrnglgg',14962,0.75,NULL,'galgs Ogtbggnd 2',1,NULL,'gg +galgs','sg2','sg2','grfgrt','0',12401,0,'abgcrn',1,NULL,NULL,'2011-09-11',11800647,'2012-02-01','2011-08-11'),(14,'rgghrsgr','gbg, +gigrid',14781,1,'ja','Fgrdgrgngsmanaggmgnt 1',1,NULL,'gg +Zahlgng','fm1','fm1','grfgrt','0',12141,0,'0',1,NULL,NULL,NULL,11010781,'1900-01-01','2012-08-11'); + +CREATE ALGORITHM=MERGE +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v1` AS select `t1a`.`ft1` AS `ft1`,`t1a`.`ft2` AS `ft2`,`t1a`.`ft3` AS `ft3`,`t1a`.`ft4` AS `ft4`,`t1a`.`ft5` AS `ft5`,`t1a`.`ft6` AS `ft6`,`t1a`.`ft6_2` AS `ft6_2`,`t1a`.`ft7` AS `ft7`,`t1a`.`ft8` AS `ft8`,`t1a`.`ft9` AS `ft9`,`t1a`.`ft10` AS `ft10` from `t2` `t1a` where (if((`t1a`.`ft10` = 'virtuell'),0,1) = 1); + +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v2` AS select distinct `t1b`.`fe2` AS `fe2`,min(`t1b`.`fe18`) AS `fe18`,max(`t1b`.`ft3`) AS `ft3` from `t3` `t1b` where ((`t1b`.`fe2` <> '') and (curdate() >= `t1b`.`fe18`)) group by `t1b`.`fe2`; + +CREATE ALGORITHM=UNDEFINED +DEFINER=`root`@`localhost` SQL SECURITY DEFINER +VIEW `v3` AS select `t1c`.`fe2` AS `fe2`,`t1c`.`f34` AS `f34`,`t1c`.`f33` AS `f33`,`t1c`.`f32` AS `f32`,`t1c`.`f37` AS `f37`,`t1c`.`fe10` AS `fe10`,if((`tov`.`ft6` in ('klarmobil','callmobile')),`tov`.`ft9`,`tov`.`ft6`) AS `ft6_1`,`tov`.`ft6_2` AS `ft6_2`,`ua`.`fe18` AS `fe18`,`ua`.`ft3` AS `ft3` from ((`t3` `t1c` left join `v2` `ua` on((`t1c`.`fe2` = `ua`.`fe2`))) left join `v1` `tov` on((`t1c`.`fe8` = `tov`.`ft4`))) where (`t1c`.`ft3` = `ua`.`ft3`) group by `t1c`.`fe2`,`t1c`.`f34`,`t1c`.`f33`,`t1c`.`f32` order by `t1c`.`f34`; + +UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'; + +--echo #MDEV-8018: main.multi_update fails with --ps-protocol +prepare stmt1 from "UPDATE t1 t1 left join v3 t2 on t1.f4 = t2.fe2 SET t1.f20 = t2.ft6_1, t1.f32 = t2.f32, t1.f33 = t2.f33, t1.f37 = t2.f37 WHERE f5 >= '2015-02-01'"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + +drop view v3,v2,v1; +drop table t1,t2,t3; --echo end of 5.5 tests diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 6c9371eed25..9ac49a9063d 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1751,6 +1751,16 @@ CHECK TABLE t1; DROP TABLE t1; +--echo # +--echo # MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with +--echo # disabled keys +--echo # +CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4),(3),(1),(0); +ALTER TABLE t1 DISABLE KEYS; +OPTIMIZE TABLE t1; +DROP TABLE t1; + # # Check some variables # diff --git a/mysql-test/t/mysql_tzinfo_to_sql_symlink.test b/mysql-test/t/mysql_tzinfo_to_sql_symlink.test index 1ba4e91be3c..8ca82b87e30 100644 --- a/mysql-test/t/mysql_tzinfo_to_sql_symlink.test +++ b/mysql-test/t/mysql_tzinfo_to_sql_symlink.test @@ -37,3 +37,14 @@ # --exec rm -rf $MYSQLTEST_VARDIR/zoneinfo + +--echo # +--echo # MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL +--echo # +--exec mkdir $MYSQLTEST_VARDIR/zoneinfo +--copy_file std_data/zoneinfo/GMT $MYSQLTEST_VARDIR/zoneinfo/Factory + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec $MYSQL_TZINFO_TO_SQL $MYSQLTEST_VARDIR/zoneinfo 2>&1 + +--exec rm -rf $MYSQLTEST_VARDIR/zoneinfo diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test new file mode 100644 index 00000000000..7a098aa701b --- /dev/null +++ b/mysql-test/t/mysql_upgrade_view.test @@ -0,0 +1,161 @@ +-- source include/have_log_bin.inc + +set sql_log_bin=0; +--disable_warnings +drop table if exists t1,v1,v2,v3,v4,v1badcheck; +drop view if exists t1,v1,v2,v3,v4,v1badcheck; +--enable_warnings + +create table t1(a int); +create table kv(k varchar(30) NOT NULL PRIMARY KEY,v varchar(50)); +create view v1 as select 1; + +repair table t1 quick; +repair table t1 extended; +repair table t1 use_frm; +--error ER_PARSE_ERROR +repair table t1 from mysql; + +--error ER_PARSE_ERROR +repair view v1 quick; +--error ER_PARSE_ERROR +repair view v1 extended; +--error ER_PARSE_ERROR +repair view v1 use_frm; +repair view v1 from mysql; + +--error ER_PARSE_ERROR +check view v1 quick; +--error ER_PARSE_ERROR +check view v1 fast; +--error ER_PARSE_ERROR +check view v1 medium; +--error ER_PARSE_ERROR +check view v1 extended; +--error ER_PARSE_ERROR +check view v1 changed; +check view v1 for upgrade; + +drop view v1; + +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1badcheck.frm $MYSQLD_DATADIR/test/v1badcheck.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm + +flush tables; + +check view v1; +check view v1badcheck; +check view v2; +check view v3; + +check view v1 for upgrade; +check view v1badcheck for upgrade; +check view v2 for upgrade; +check view v3 for upgrade; + +--replace_result $MYSQLTEST_VARDIR var +--exec $MYSQL_UPGRADE --force 2>&1 + +# "Phase 1/4: Fixing views" expected (without from_mysql) + +show create view v1; +show create view v2; +show create view v3; + +# Now force a mariadb version to be added + +set sql_log_bin=1; +REPAIR VIEW v1,v2; +REPAIR VIEW v1badcheck; +REPAIR NO_WRITE_TO_BINLOG VIEW v3; +set sql_log_bin=0; + +--source include/show_binlog_events.inc + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v2.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v3.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1badcheck.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--disable_warnings +drop view if exists v1,v2,v3,v1badcheck; +--enable_warnings + +# Make it look like a MySQL directory now + +rename table mysql.event to mysql.ev_bk; +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYI $MYSQLD_DATADIR/mysql/event.MYI +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.MYD $MYSQLD_DATADIR/mysql/event.MYD +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/event.frm $MYSQLD_DATADIR/mysql/event.frm + +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm + +flush tables; + +create algorithm=temptable view v4 as select a from t1; +show create view v1; +show create view v2; +show create view v3; +show create view v4; + +# here we test the fixing views from mysql to occur +--replace_result $MYSQLTEST_VARDIR var +--exec $MYSQL_UPGRADE --force 2>&1 + +show create view v1; +show create view v2; +show create view v3; +show create view v4; + +--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR +eval LOAD DATA INFILE '$MYSQLD_DATADIR/test/v1.frm' REPLACE INTO TABLE kv FIELDS TERMINATED BY '='; +SELECT k,v from kv where k in ('md5','algorithm'); +SELECT k from kv where k ='mariadb-version'; +truncate table kv; + +--disable_warnings +drop view if exists v1,v2,v3; +--enable_warnings + +# back to mariadb default +drop table mysql.event; +rename table mysql.ev_bk to mysql.event; + +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v2.frm $MYSQLD_DATADIR/test/v2.frm +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v3.frm $MYSQLD_DATADIR/test/v3.frm + +# check of binlog and mixing tables (with table specific options) and views +--exec $MYSQL_CHECK --repair --write-binlog --process-tables --use-frm --process-views=UPGRADE_FROM_MYSQL test 2>&1 + +--source include/show_binlog_events.inc + +drop table if exists kv; +drop view v1,v2,v3,v4; +drop table t1; + diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index c04c8d50f3c..2580db88456 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -45,3 +45,9 @@ EOF --exec $MYSQLADMIN --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/cnf_file -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1 --remove_file $MYSQLTEST_VARDIR/tmp/cnf_file + +# +# MDEV-7883 Segmentation failure when running mysqladmin -u root -p +# +--error 1 +--exec $MYSQLADMIN -u root -p 2>&1 > /dev/null diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index d986b42fc91..6cd0265f89a 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -8,14 +8,15 @@ call mtr.add_suppression("Invalid .old.. table or database name"); # check that CSV engine was compiled in, as the result of the test # depends on the presence of the log tables (which are CSV-based). --source include/have_csv.inc +let $MYSQLD_DATADIR= `select @@datadir`; # # Clean up after previous tests # --disable_warnings -DROP TABLE IF EXISTS t1, `t``1`, `t 1`; -drop view if exists v1; +DROP TABLE IF EXISTS t1, `t``1`, `t 1`, test.`t.1`, v1; +drop view if exists t1, `t``1`, `t 1`, test.`t.1`, v1; drop database if exists client_test_db; # Repair any tables in mysql, sometimes the slow_log is marked as crashed # after server has been killed @@ -66,7 +67,6 @@ create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; -let $MYSQLD_DATADIR= `select @@datadir`; --echo removing and creating --remove_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI --write_file $MYSQLD_DATADIR/d_bug25347/t_bug25347.MYI @@ -119,7 +119,6 @@ DROP TABLE t1, t2; create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; -let $MYSQLD_DATADIR= `select @@datadir`; --copy_file $MYSQLD_DATADIR/test/v1.frm $MYSQLD_DATADIR/test/v-1.frm show tables; --exec $MYSQL_CHECK --check-upgrade --databases test @@ -164,24 +163,23 @@ CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; CREATE TABLE t1 (a INT) engine=myisam; # Create 5.0 like triggers -let $MYSQLTEST_VARDIR= `select @@datadir`; ---write_file $MYSQLTEST_VARDIR/a@b/c@d.TRG +--write_file $MYSQLD_DATADIR/a@b/c@d.TRG TYPE=TRIGGERS triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON `c@d` FOR EACH ROW SET NEW.a = 10 * NEW.a' sql_modes=0 definers='root@localhost' EOF ---write_file $MYSQLTEST_VARDIR/a@b/tr1.TRN +--write_file $MYSQLD_DATADIR/a@b/tr1.TRN TYPE=TRIGGERNAME trigger_table=c@d EOF ---write_file $MYSQLTEST_VARDIR/a@b/t1.TRG +--write_file $MYSQLD_DATADIR/a@b/t1.TRG TYPE=TRIGGERS triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr2 BEFORE INSERT ON `a@b`.t1 FOR EACH ROW SET NEW.a = 100 * NEW.a' sql_modes=0 definers='root@localhost' EOF ---write_file $MYSQLTEST_VARDIR/a@b/tr2.TRN +--write_file $MYSQLD_DATADIR/a@b/tr2.TRN TYPE=TRIGGERNAME trigger_table=t1 EOF @@ -255,7 +253,6 @@ INSERT INTO bug47205 VALUES ("foobar"); FLUSH TABLE bug47205; --echo # Replace the FRM with a 5.0 FRM that will require upgrade -let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/bug47205.frm --copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm @@ -279,7 +276,6 @@ CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) FLUSH TABLE bug47205; --echo # Replace the FRM with a 5.0 FRM that will require upgrade -let $MYSQLD_DATADIR= `select @@datadir`; --remove_file $MYSQLD_DATADIR/test/bug47205.frm --copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm @@ -312,3 +308,44 @@ CHECK TABLE bug47205 FOR UPGRADE; CHECK TABLE bug47205 FOR UPGRADE; DROP TABLE bug47205; + +--echo # +--echo #MDEV-6128:[PATCH] mysqlcheck wrongly escapes '.' in table names +--echo # +CREATE TABLE test.`t.1` (id int); + +--echo mysqlcheck test t.1 +--exec $MYSQL_CHECK test t.1 + +drop table test.`t.1`; + +# +# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such +# +create view v1 as select 1; +--echo mysqlcheck --process-views test +--exec $MYSQL_CHECK --process-views test +--echo mysqlcheck --process-views --extended test +--exec $MYSQL_CHECK --process-views --extended test +--echo mysqlcheck --process-views --fast test +--exec $MYSQL_CHECK --process-views --fast test +--echo mysqlcheck --process-views --quick test +--exec $MYSQL_CHECK --process-views --quick test +--echo mysqlcheck --process-views --check-only-changed test +--exec $MYSQL_CHECK --process-views --check-only-changed test +--echo mysqlcheck --process-views --medium-check test +--exec $MYSQL_CHECK --process-views --medium-check test +--echo mysqlcheck --process-views --check-upgrade test +--exec $MYSQL_CHECK --process-views --check-upgrade test +drop view v1; + + +# +# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views +# +create table t1(a int); +--copy_file $MYSQL_TEST_DIR/std_data/mysql_upgrade/v1.frm $MYSQLD_DATADIR/test/v1.frm +--echo mysqlcheck --process-views --check-upgrade --auto-repair test +--exec $MYSQL_CHECK --process-views --check-upgrade --auto-repair test +drop view v1; +drop table t1; diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index bee0e2cc720..e36f106a5be 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -15,15 +15,15 @@ insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB"; -grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client" ISSUER "/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB"; grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx"; flush privileges; connect (con1,localhost,ssl_user1,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA); --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --error ER_ACCESS_DENIED_ERROR -connect (con2,localhost,ssl_user2,,,,,SSL-CIPHER=RC4-SHA); +connect (con2,localhost,ssl_user2,,,,,SSL-CIPHER=AES256-SHA); connect (con2,localhost,ssl_user2,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA); connect (con3,localhost,ssl_user3,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA); connect (con4,localhost,ssl_user4,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA); @@ -222,8 +222,6 @@ DROP TABLE t1; # Common ciphers to openssl and yassl --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=DHE-RSA-AES256-SHA --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA ---exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA ---exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=RC4-SHA --disable_query_log --disable_result_log diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index a74e95ab65b..2d90764da0d 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -1,3 +1,7 @@ +if (`select plugin_auth_version < "5.6.25" from information_schema.plugins where plugin_name='innodb'`) +{ + --skip Not fixed in InnoDB as of 5.6.24 or earlier +} --source include/not_embedded.inc --source include/have_partition.inc --source include/have_innodb.inc @@ -403,7 +407,7 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status like 't1'; drop table t1; @@ -415,12 +419,12 @@ engine = innodb partition by key (a); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (0), (1), (2), (3); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; drop table t1; @@ -429,17 +433,17 @@ engine = innodb partition by key (a); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); # Data_free for InnoDB tablespace varies depending on which # tests have been run before this one ---replace_column 10 # +--replace_column 10 # 12 # show table status; drop table t1; @@ -675,6 +679,18 @@ ALTER TABLE t1 ADD UNIQUE KEY (b); SHOW CREATE TABLE t1; SELECT * FROM t1; DROP TABLE t1; +--echo # +--echo # Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE +--echo # WRONG FOR PARTITIONED TABLES +--echo # + +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; + +SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE +CREATE_TIME IS NOT NULL AND TABLE_NAME='t1'; + +DROP TABLE t1; --echo # --echo # BUG#12912171 - ASSERTION FAILED: QUICK->HEAD->READ_SET == diff --git a/mysql-test/t/partition_innodb_plugin.test b/mysql-test/t/partition_innodb_plugin.test index 8044ae9ec5c..fd6e60c27fb 100644 --- a/mysql-test/t/partition_innodb_plugin.test +++ b/mysql-test/t/partition_innodb_plugin.test @@ -149,11 +149,11 @@ UPDATE `t``\""e` SET a = 4 WHERE a = 22; # NOTE: replace_regex is very slow on match copy/past '(.*)' regex's # on big texts, removing a lot of text before + after makes it much faster. #/.*in (.*) trx.*/\1/ ---replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in // +--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in // /trx table locks [0-9]* // /total table locks [0-9]* // SHOW ENGINE InnoDB STATUS; set @old_sql_mode = @@sql_mode; set sql_mode = 'ANSI_QUOTES'; ---replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in // +--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in // /trx table locks [0-9]* // /total table locks [0-9]* // SHOW ENGINE InnoDB STATUS; set @@sql_mode = @old_sql_mode; --echo # con1 diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test index a33b9e19fbf..bce0c6f009c 100644 --- a/mysql-test/t/partition_myisam.test +++ b/mysql-test/t/partition_myisam.test @@ -123,7 +123,7 @@ CHECK TABLE t1; SELECT * FROM t1; --echo # Note that it is currently impossible to drop a partitioned table --echo # without the .par file ---error ER_BAD_TABLE_ERROR +--error ER_GET_ERRNO DROP TABLE t1; --remove_file $MYSQLD_DATADIR/test/t1.frm --remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI diff --git a/mysql-test/t/partition_not_blackhole.test b/mysql-test/t/partition_not_blackhole.test index 7352aeaa230..3731d659ad0 100644 --- a/mysql-test/t/partition_not_blackhole.test +++ b/mysql-test/t/partition_not_blackhole.test @@ -19,7 +19,7 @@ SHOW TABLES; --replace_result $MYSQLD_DATADIR ./ --error ER_NOT_FORM_FILE SHOW CREATE TABLE t1; ---error ER_BAD_TABLE_ERROR +--error ER_GET_ERRNO DROP TABLE t1; --list_files $MYSQLD_DATADIR/test t1* --remove_file $MYSQLD_DATADIR/test/t1.frm diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 0655aff9fc9..13e2c71fbc4 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -252,3 +252,16 @@ select plugin_name from information_schema.plugins where plugin_library like 'ha uninstall soname 'ha_example'; select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; + +--echo # +--echo # MDEV-5309 - RENAME TABLE does not check for existence of the table's +--echo # engine +--echo # +INSTALL PLUGIN example SONAME 'ha_example'; +CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +SELECT * FROM t1; +FLUSH TABLES; +UNINSTALL PLUGIN example; +--error ER_NO_SUCH_TABLE +RENAME TABLE t1 TO t2; +DROP TABLE t1; diff --git a/mysql-test/t/query_cache_ps_no_prot.test b/mysql-test/t/query_cache_ps_no_prot.test index 16533c7194e..4b2bb842e34 100644 --- a/mysql-test/t/query_cache_ps_no_prot.test +++ b/mysql-test/t/query_cache_ps_no_prot.test @@ -16,12 +16,7 @@ let collation=utf8_unicode_ci; --source include/have_collation.inc # The file with expected results fits only to a run without -# ps-protocol/sp-protocol/cursor-protocol/view-protocol. -if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL - + $VIEW_PROTOCOL > 0`) -{ - --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled -} +--source include/no_protocol.inc # The main testing script --source include/query_cache_sql_prepare.inc diff --git a/mysql-test/t/range_innodb.test b/mysql-test/t/range_innodb.test new file mode 100644 index 00000000000..f76794814ef --- /dev/null +++ b/mysql-test/t/range_innodb.test @@ -0,0 +1,47 @@ +--echo # +--echo # Range optimizer (and related) tests that need InnoDB. +--echo # + +--source include/have_innodb.inc + +--disable_warnings +drop table if exists t0, t1, t2; +--enable_warnings + +--echo # +--echo # MDEV-6735: Range checked for each record used with key +--echo # + +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 + D.a * 1000 +from t0 A, t0 B, t0 C, t0 D; + +create table t2 ( + a int, + b int, + filler1 char(100), + filler2 char(100), + filler3 char(100), + filler4 char(100), + key(a), + key(b) +) engine=innodb; + +insert into t2 +select + a,a, + repeat('0123456789', 10), + repeat('0123456789', 10), + repeat('0123456789', 10), + repeat('0123456789', 10) +from t1; + +analyze table t2; +--echo # The following must not use "Range checked for each record": +explain select * from t0 left join t2 on t2.a <t0.a and t2.b between 50 and 250; + +drop table t0,t1,t2; + diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index 5b78a352863..a6df0dc5979 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -210,3 +210,12 @@ repair table t1 use_frm; select count(*) from t1; check table t1; drop table t1; + +# +# MDEV-8115 mysql_upgrade crashes the server with REPAIR VIEW +# +create table t1 (a blob); +create view v1 as select * from t1; +repair view v1; +drop view v1; +drop table t1; diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index 77ee5f49bef..c46ff69295f 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -942,5 +942,34 @@ set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivit drop table t0,t1,t2; +--echo # +--echo # Bug mdev-7316: a conjunct in WHERE with selectivity == 0 +--echo # + +CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB; +INSERT INTO t1 VALUES + ('USAChinese',10), ('USAEnglish',20), ('USAFrench',30); + +CREATE TABLE t2 (i int) ENGINE=INNODB; +INSERT INTO t2 VALUES + (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4); + +ANALYZE TABLE t1, t2; + +set use_stat_tables='preferably'; +set optimizer_use_condition_selectivity=3; + +EXPLAIN EXTENDED +SELECT * FROM t1, t2 + WHERE a <> 'USARussian' AND b IS NULL; + +SELECT * FROM t1, t2 + WHERE a <> 'USARussian' AND b IS NULL; + +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; + +DROP TABLE t1,t2; + + set use_stat_tables=@save_use_stat_tables; diff --git a/mysql-test/t/selectivity_innodb.test b/mysql-test/t/selectivity_innodb.test index 5674cb5c006..d6a77eac600 100644 --- a/mysql-test/t/selectivity_innodb.test +++ b/mysql-test/t/selectivity_innodb.test @@ -80,6 +80,36 @@ select * from t1 where col2 != true; drop table t1; --echo # +--echo # MDEV-7413: optimizer_use_condition_selectivity > 2 crashes 10.0.15+maria-1~wheezy +--echo # + +CREATE TABLE t1 ( + parent_id int, + child_group_id int, + child_user_id int, + KEY (parent_id,child_group_id,child_user_id) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( + id int, + lower_group_name varchar(255), + directory_id int(20), + UNIQUE KEY (directory_id) +) ENGINE=InnoDB; + +CREATE TABLE t3 (id int) ENGINE=InnoDB; + +insert into t1 values (1,1,1),(2,2,2); +insert into t2 values (10,'foo',10),(20,'bar',20); +insert into t3 values (101),(102); +set use_stat_tables = PREFERABLY, optimizer_use_condition_selectivity = 3; + +select * from t1, t2, t3 +where t1.child_user_id=t3.id and t1.child_group_id is null and t2.lower_group_name='foo' and t1.parent_id=t2.id and t2.directory_id=10; + +drop table t1,t2,t3; + +--echo # --echo # End of 10.0 tests --echo # diff --git a/mysql-test/t/show_grants_with_plugin-7985.test b/mysql-test/t/show_grants_with_plugin-7985.test new file mode 100644 index 00000000000..339c75c7c49 --- /dev/null +++ b/mysql-test/t/show_grants_with_plugin-7985.test @@ -0,0 +1,161 @@ +--source include/not_embedded.inc +--enable_connect_log +call mtr.add_suppression("password and an authentication plugin"); + +--echo # +--echo # Create a user with mysql_native_password plugin. +--echo # The user has no password or auth_string set. +--echo # + +create user u1; +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; + +--echo # +--echo # The user's grants should show no password at all. +--echo # +show grants for u1; +--echo # +--echo # Test to see if connecting with no password is succesful. +--echo # +--connect (con1, localhost, u1,,) +show grants; +--disconnect con1 + +--connection default +--echo # +--echo # Test after flushing privileges. +--echo # +flush privileges; +--connect (con1, localhost, u1,,) +show grants; +--disconnect con1 + +--connection default +--echo # +--echo # Now add a mysql_native password string in authentication_string. +--echo # +# Password string is SOMETHING +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password +USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626'; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +--echo # +--echo # Test to see if connecting with password is succesful. +--echo # +--connect (con1, localhost, u1,'SOMETHING',) +show grants; +--disconnect con1 + +--connection default +--echo # +--echo # Test after flushing privileges. +--echo # +flush privileges; +--connect (con1, localhost, u1,'SOMETHING',) +show grants; +--disconnect con1 +--connection default + +--echo # +--echo # Now we also set a password for the user. +--echo # +set password for u1 = PASSWORD('SOMETHINGELSE'); +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; + +--echo # +--echo # Here we should use the password field, as that primes over +--echo # the authentication_string field. +--echo # +show grants for u1; + +--echo # +--echo # Logging in with the user's password should work. +--echo # +--connect (con1, localhost, u1,'SOMETHINGELSE',) +show grants; +--disconnect con1 +--connection default +--echo # +--echo # Reload privileges and test logging in again. +--echo # +flush privileges; +show grants for u1; +--echo # +--echo # Here we connect via the user's password again. +--echo # +--connect (con1, localhost, u1,'SOMETHINGELSE',) +show grants; +--disconnect con1 +--connection default + +--echo # +--echo # Now we remove the authentication plugin password, flush privileges and +--echo # try again. +--echo # +update mysql.user set authentication_string = '' where user='u1'; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +flush privileges; +show grants for u1; +--echo # +--echo # Here we connect via the user's password. +--echo # +--connect (con1, localhost, u1,'SOMETHINGELSE',) +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; +--disconnect con1 +--connection default + +--echo # +--echo # Try and set a wrong auth_string password, with mysql_native_password. +--echo # Make sure it fails. +--echo # +--error ER_PASSWD_LENGTH +GRANT USAGE ON *.* TO u1 IDENTIFIED VIA mysql_native_password USING 'asd'; +--echo # +--echo # Now set a correct password. +--echo # +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password +USING '*7AFEFD08B6B720E781FB000CAA418F54FA662626'; +show grants for u1; + +--echo # +--echo # Test if the user can now use that password instead. +--echo # +--connect (con1, localhost, u1,'SOMETHING',) +show grants; +--disconnect con1 + +--echo # +--echo # Test if the user can now use that password instead, after flushing privileges; +--echo # +--connection default +flush privileges; + +--connect (con1, localhost, u1,'SOMETHING',) +show grants; +--disconnect con1 +--connection default + +--echo # +--echo # Clear all passwords from the user. +--echo # +GRANT SELECT ON mysql.* to u1 IDENTIFIED VIA mysql_native_password; +select user, host, password, plugin, authentication_string from mysql.user where user = 'u1'; + +--echo # +--echo # Test no password connect. +--echo # +--connect (con1, localhost, u1,,) +show grants; +--disconnect con1 +--connection default + +--echo # +--echo # Test no password connect, after flushing privileges. +--echo # +flush privileges; +--connect (con1, localhost, u1,,) +show grants; +--disconnect con1 +--connection default + +drop user u1; diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index e109f88e3f9..880bbce3d9d 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -278,3 +278,11 @@ DROP DATABASE db1; --echo # Restore mysql.proc DROP TABLE mysql.proc; RENAME TABLE proc_backup TO mysql.proc; + +# +# BUG#19875331 - HANDLE_FATAL_SIGNAL 11 IN STRMAKE +# +create database mysqltest1; +create procedure mysqltest1.foo() select "foo"; +update mysql.proc set name='' where db='mysqltest1'; +drop database mysqltest1; diff --git a/mysql-test/t/sp-innodb.test b/mysql-test/t/sp-innodb.test index 228ab42544d..23715166a02 100644 --- a/mysql-test/t/sp-innodb.test +++ b/mysql-test/t/sp-innodb.test @@ -43,3 +43,120 @@ CALL p1(); drop procedure p1; drop table t1,t2; + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--echo +--echo # +--echo # BUG 16041903: CONTINUE HANDLER NOT INVOKED +--echo # IN A STORED FUNCTION AFTER A LOCK WAIT TIMEOUT +--echo # + +--echo +--echo # Save and set lock wait timeout +SET @lock_wait_timeout_saved= @@lock_wait_timeout; +SET @innodb_lock_wait_timeout_saved= @@innodb_lock_wait_timeout; +SET @@lock_wait_timeout= 1; +SET @@innodb_lock_wait_timeout= 1; + +--echo +--echo # Create a function with exit handler: +DELIMITER //; +CREATE FUNCTION f1() RETURNS VARCHAR(20) +BEGIN + DECLARE EXIT HANDLER FOR SQLSTATE '42S02' RETURN 'No such table'; + INSERT INTO no_such_table VALUES (1); +END// + +--echo +--echo # Create a function calling f1(): +CREATE FUNCTION f2() RETURNS VARCHAR(20) +BEGIN + RETURN f1(); +END// + +--echo +--echo # Create a function provoking deadlock: +CREATE FUNCTION f3() RETURNS VARCHAR(20) +BEGIN + UPDATE t1 SET i= 1 WHERE i= 1; + RETURN 'Will never get here'; +END// + +--echo +--echo # Create a function calling f3, to create +--echo # a deadlock indirectly: +CREATE FUNCTION f4() RETURNS VARCHAR(20) +BEGIN + RETURN f3(); +END// +DELIMITER ;// + +--echo +--echo # Open another connection, create and initialize a table +--echo # to be used for provoking deadlock, put a lock on the table: +connect (con1,localhost,root,,); +CREATE TABLE t1 (i INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; + +--echo +--echo # On the default connection, do an update to provoke a +--echo # deadlock, then call the function with handler. This case +--echo # fails without the patch (with error ER_NO_SUCH_TABLE): +--connection default +SET AUTOCOMMIT= 0; +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET i=1 WHERE i=1; +SELECT f1() AS 'f1():'; + +--echo +--echo # Provoke another deadlock, then call the function with +--echo # handler indirectly. This case fails without the patch +--echo # (with error ER_NO_SUCH_TABLE): +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET i= 1 WHERE i= 1; +SELECT f2() AS 'f2():'; + +--echo +--echo # Provoke yet another deadlock, but now from within a function, +--echo # then call the function with handler. This succeeds even +--echo # without the patch because is_fatal_sub_stmt_error is reset +--echo # in restore_sub_stmt after the failing function has been +--echo # executed. The test case is included anyway for better coverage: +--error ER_LOCK_WAIT_TIMEOUT +SELECT f3() AS 'f3():'; +SELECT f1() AS 'f1():'; + +--echo # Provoke yet another deadlock, but now from within a function, +--echo # calling another function, then call the function with handler. +--echo # This succeeds even without the patch because +--echo # is_fatal_sub_stmt_error is reset in restore_sub_stmt after +--echo # the failing function has been executed. The test case is +--echo # included anyway for better coverage: +--error ER_LOCK_WAIT_TIMEOUT +SELECT f4() AS 'f4():'; +SELECT f1() AS 'f1():'; + +--echo +--echo # Disconnect, drop functions and table: +--disconnect con1 +DROP FUNCTION f4; +DROP FUNCTION f3; +DROP FUNCTION f2; +DROP FUNCTION f1; +DROP TABLE t1; + +--echo +--echo # Reset lock wait timeouts +SET @@lock_wait_timeout= @lock_wait_timeout_saved; +SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; + +--echo # +--echo # BUG 16041903: End of test case +--echo # + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index 42a3dd193c4..2a24ab3d005 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -462,6 +462,26 @@ DROP EVENT teste_bug11763507; --echo # ------------------------------------------------------------------ # +# A case of SHOW GRANTS +# (creating a new procedure changes the password) +# +grant create routine on test.* to foo1@localhost identified by 'foo'; +update mysql.user set password = replace(password, '*', '-') where user='foo1'; +--connect (foo,localhost,foo1,foo) +show grants; +--connection default +flush privileges; +--connection foo +show grants; +create procedure spfoo() select 1; +show grants; + +--connection default +--disconnect foo +drop procedure spfoo; +drop user foo1@localhost; + +# # Restore global concurrent_insert value. Keep in the end of the test file. # diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test index 988a9d6c056..0d14ad82692 100644 --- a/mysql-test/t/ssl.test +++ b/mysql-test/t/ssl.test @@ -25,11 +25,14 @@ SHOW STATUS LIKE 'Ssl_server_not_after'; --replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA SHOW STATUS LIKE 'Ssl_cipher'; +# +# MDEV-7697 Client reports ERROR 2006 (MySQL server has gone away) or ERROR 2013 (Lost connection to MySQL server during query) while executing AES* functions under SSL +# +select aes_decrypt('MySQL','adf'); +select 'still connected?'; + connection default; disconnect ssl_con; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc - -## This test file is for testing encrypted communication only, not other -## encryption routines that the SSL library happens to provide! diff --git a/mysql-test/t/ssl_7937.combinations b/mysql-test/t/ssl_7937.combinations new file mode 100644 index 00000000000..46a45686a9b --- /dev/null +++ b/mysql-test/t/ssl_7937.combinations @@ -0,0 +1,5 @@ +[ssl] +--loose-enable-ssl + +[nossl] +--loose-disable-ssl diff --git a/mysql-test/t/ssl_7937.test b/mysql-test/t/ssl_7937.test new file mode 100644 index 00000000000..d593b9d936d --- /dev/null +++ b/mysql-test/t/ssl_7937.test @@ -0,0 +1,35 @@ +# +# MDEV-7937: Enforce SSL when --ssl client option is used +# + +source include/have_ssl_crypto_functs.inc; + +# create a procedure instead of SHOW STATUS LIKE 'ssl_cipher' +# because the cipher depends on openssl (or yassl) version, +# and it's actual value doesn't matter here anyway +create procedure have_ssl() + select if(variable_value > '','yes','no') as 'have_ssl' + from information_schema.session_status + where variable_name='ssl_cipher'; + +--disable_abort_on_error +--echo mysql --ssl-ca=cacert.pem -e "call test.have_ssl()" +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem -e "call test.have_ssl()" 2>&1 +--echo mysql --ssl -e "call test.have_ssl()" +--exec $MYSQL --ssl -e "call test.have_ssl()" 2>&1 +--echo mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" +--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1 + +--echo mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()" +# this is the test where certificate verification fails. +# but yassl doesn't support certificate verification, so +# we fake the test result for yassl +let yassl=`select variable_value='Unknown' from information_schema.session_status where variable_name='Ssl_session_cache_mode'`; +if (!$yassl) { + --exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1 +} +if ($yassl) { + --echo ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate +} + +drop procedure have_ssl; diff --git a/mysql-test/t/ssl_timeout.test b/mysql-test/t/ssl_timeout.test new file mode 100644 index 00000000000..0d96b3f6601 --- /dev/null +++ b/mysql-test/t/ssl_timeout.test @@ -0,0 +1,21 @@ +--source include/have_ssl_communication.inc + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +--echo # connect with read timeout so SLEEP() should timeout +connect (ssl_con,localhost,root,,,,,SSL read_timeout=5); + +--echo # Check ssl turned on +--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA +SHOW STATUS LIKE 'Ssl_cipher'; + +# --error CR_SERVER_LOST +--error 2013 +SELECT SLEEP(600); + +connection default; +disconnect ssl_con; + +# Wait till all disconnects are completed +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index 2c60e5645c3..c989cb22558 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2693,5 +2693,16 @@ SET join_cache_level=@tmp_mdev5059; set optimizer_switch=@tmp_os_mdev5059; DROP TABLE t1,t2,t3,t4; +--echo # +--echo # MDEV-7911: crash in Item_cond::eval_not_null_tables +--echo # + +create table t1(a int); +insert into t1 values(1),(2),(3),(null); +--error ER_CANT_AGGREGATE_2COLLATIONS +explain +select 1 from t1 where _cp932 "1" in (select '1' from t1); +drop table t1; + # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index a82baf095c1..0bf9c6d9d10 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -1320,5 +1320,76 @@ SELECT * FROM t1 WHERE id in (select distinct id_agente from t2); DROP TABLE t1, t2; +--echo # +--echo # MDEV-7474: Semi-Join's DuplicateWeedout strategy skipped for some values of optimizer_search_depth +--echo # + +CREATE TABLE t1 ( + t1id BIGINT(20) NOT NULL, + code VARCHAR(20), + PRIMARY KEY (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; + +CREATE TABLE t2 ( + t2id BIGINT(20) NOT NULL, + t1idref BIGINT(20) NOT NULL, + code VARCHAR(20), + PRIMARY KEY (t2id), + INDEX FK_T2_T1Id (t1idref), + CONSTRAINT FK_T2_T1Id FOREIGN KEY (t1idref) REFERENCES t1 (t1id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; + +CREATE TABLE t3 ( + t3idref BIGINT(20) NOT NULL, + t2idref BIGINT(20) NOT NULL, + sequencenumber INT(10) NOT NULL, + PRIMARY KEY (t3idref, t2idref), + INDEX FK_T3_T2Id (t2idref), + CONSTRAINT FK_T3_T2Id FOREIGN KEY (t2idref) REFERENCES t2 (t2id) +) COLLATE='utf8mb4_bin' ENGINE=InnoDB; + +# Load up dummy data (needed to reproduce issue) +INSERT INTO t1 (t1id) VALUES (100001),(100017),(100018),(100026),(100027),(100028),(100029),(100030), +(100031),(100032),(100033),(100034),(100035),(100036),(100037),(100038),(100040),(100041),(100042), +(100043),(100044),(100045),(100046),(100047); + +INSERT IGNORE INTO t2 (t2id, t1idref) SELECT t1id, t1id FROM t1; + +# Now the test Data +INSERT IGNORE INTO t1 VALUES (200001, 'a'); +INSERT IGNORE INTO t2 (t2id, t1idref) VALUES (200011, 200001),(200012, 200001),(200013, 200001); +INSERT IGNORE INTO t3 VALUES (1, 200011, 1), (1, 200012, 2), (1, 200013, 3); + +set @tmp7474= @@optimizer_search_depth; +SET SESSION optimizer_search_depth = 1; + +let $query= +SELECT SQL_NO_CACHE +T2_0_.t1idref, +T2_0_.t2id +FROM + t2 T2_0_ +WHERE + T2_0_.t1idref IN ( + SELECT + T1_1_.t1id + FROM + t3 T3_0_ + INNER JOIN + t2 T2_1_ + ON T3_0_.t2idref=T2_1_.t2id + INNER JOIN + t1 T1_1_ + ON T2_1_.t1idref=T1_1_.t1id + WHERE + T3_0_.t3idref= 1 +); + +eval $query; +eval explain $query; + +drop table t3,t2,t1; +set optimizer_search_depth=@tmp7474; + --echo # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/mysql-test/t/subselect_sj_mat.test b/mysql-test/t/subselect_sj_mat.test index 912e9d5befd..c34c805f90c 100644 --- a/mysql-test/t/subselect_sj_mat.test +++ b/mysql-test/t/subselect_sj_mat.test @@ -1843,3 +1843,45 @@ drop database mysqltest4; --echo # End of 5.5 tests +--echo # +--echo # MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT +--echo # +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t1 (a int, b int, c int); +insert into t1 +select A.a+B.a*10+C.a*100, A.a+B.a*10+C.a*100, A.a+B.a*10+C.a*100 +from t0 A, t0 B, t0 C; + +create table t2 (a int, b int, c int); +insert into t2 select A.a, A.a, A.a from t1 A; +insert into t2 select * from t2; +insert into t2 select * from t2; + +create table t3 as select * from t2 limit 1; + +--echo # The testcase only makes sense if the following uses Materialization: +explain +select * from t1 where (a,b) in (select max(a),b from t2 group by b); + +flush status; +replace into t3 +select * from t1 where (a,b) in (select max(a),b from t2 group by b); +--echo # Sequential reads: +--echo # 1K is read from t1 +--echo # 4K is read from t2 +--echo # 1K groups is read from the tmp. table +--echo # +--echo # Lookups: +--echo # 4K lookups in group by table +--echo # 1K lookups in temp.table +--echo # +--echo # Writes: +--echo # 2x 1K writes to temporary tables (grouping table and subquery materialization table +--echo # +--echo # The point is that neither counter should be in the millions (this +--echo # will happen if Materialization is not used +show status where Variable_name like 'Handler_read%' or Variable_name like 'Handler_%write%'; + +drop table t0,t1,t2,t3; diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test index 0d42dca57b7..24f48206013 100644 --- a/mysql-test/t/table_elim.test +++ b/mysql-test/t/table_elim.test @@ -610,3 +610,34 @@ SELECT t1.alpha3 FROM t1 LEFT JOIN ( t2 LEFT JOIN t3 ON t2.t3_code = t3.code ) DROP TABLE t1, t2, t3; SET optimizer_switch=@save_optimizer_switch; + +--echo # +--echo # MDEV-7893: table_elimination works wrong with on computed expression and compound unique key +--echo # (just a testcase) +CREATE TABLE t1 ( + PostID int(10) unsigned NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO t1 (PostID) VALUES (1), (2); + +CREATE TABLE t2 ( + VoteID int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + EntityID int(10) unsigned NOT NULL, + UserID int(10) unsigned NOT NULL, + UNIQUE KEY EntityID (EntityID,UserID) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30); + +SELECT t1.*, T.Voted as Voted +FROM +t1 LEFT JOIN ( + SELECT 1 AS Voted, EntityID + FROM t2 + WHERE t2.UserID = '20' ) AS T + ON T.EntityID = t1.PostID +WHERE t1.PostID='1' +LIMIT 1; + +DROP TABLE t1,t2; + diff --git a/mysql-test/t/table_keyinfo-6838.test b/mysql-test/t/table_keyinfo-6838.test new file mode 100644 index 00000000000..5f4c9f44f86 --- /dev/null +++ b/mysql-test/t/table_keyinfo-6838.test @@ -0,0 +1,18 @@ +# Test case for MDEV-6838. +# Due to incorrect key_length computation, this usecase failed with the error +# Using too big key for internal temp table. + +CREATE TABLE t1 (i INT, state VARCHAR(997)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (2,'Louisiana'),(9,'Maine'); + +CREATE TABLE t2 (state VARCHAR(997), j INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES ('Louisiana',9),('Alaska',5); +INSERT INTO t2 SELECT t2.* FROM t2 JOIN t2 AS t3 JOIN t2 AS t4 JOIN t2 AS t5 JOIN t2 AS t6; + +SET @@max_heap_table_size= 16384; +set @@optimizer_switch='derived_merge=OFF'; +set @@optimizer_switch='extended_keys=ON'; + +SELECT * FROM t1 AS t1_1 LEFT JOIN ( t1 AS t1_2 INNER JOIN (SELECT * FROM t2) v2 ON t1_2.i = j ) ON t1_1.state = v2.state LIMIT 1; + +DROP TABLE t1, t2; diff --git a/mysql-test/t/tmp_table_count-7586.test b/mysql-test/t/tmp_table_count-7586.test new file mode 100644 index 00000000000..e7bac127815 --- /dev/null +++ b/mysql-test/t/tmp_table_count-7586.test @@ -0,0 +1,56 @@ +# MDEV-7586 regression test. +# Test if created_tmp_tables status variable is correctly incremented. +--source include/have_perfschema.inc +--source include/not_embedded.inc + +create table t2 (a int); +insert into t2 values (1),(2),(3); +create view v2 as select a from t2; + +flush status; +select * from v2; +show status like '%Created_tmp%'; + +explain select * from v2; + +select * from (select * from t2) T1; +show status like '%Created_tmp%'; + +explain select * from (select * from t2) T1; + + +drop view v2; +drop table t2; + + +--disable_ps_protocol + +CREATE TABLE t1(a int); +INSERT INTO t1 values(1),(2); +CREATE TABLE t2(a int); +INSERT INTO t2 values(1),(2); + +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1); +truncate table performance_schema.events_statements_history_long; +flush status; +CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1); +--echo # Performance schema should be the same as "Created_tmp_tables" variable below +select sum(created_tmp_tables) from performance_schema.events_statements_history_long; +show status like '%Created_tmp%'; +drop table t3; + +EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a); +truncate table performance_schema.events_statements_history_long; +flush status; +CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a); +--echo # Performance schema should be the same as "Created_tmp_tables" variable below +select sum(created_tmp_tables) from performance_schema.events_statements_history_long; +show status like '%Created_tmp%'; + +drop table t1,t2,t3; + +truncate table performance_schema.events_statements_history_long; +flush status; +--echo # Performance schema should be the same as "Created_tmp_tables" variable below +select sum(created_tmp_tables) from performance_schema.events_statements_history_long; +show status like '%Created_tmp%'; diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test index 82bee7aa224..c17202055e1 100644 --- a/mysql-test/t/trigger-trans.test +++ b/mysql-test/t/trigger-trans.test @@ -2,6 +2,9 @@ # (or just InnoDB storage engine) --source include/have_innodb.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + --disable_warnings drop table if exists t1; --enable_warnings @@ -182,3 +185,54 @@ insert into t1 values ( 654, 'a'), ( 654, 'b'), ( 654, 'c'), select * from t2 order by b; drop trigger t1_after_insert; drop table t1,t2; + +--echo # +--echo #Bug#19683834 SOME INNODB ERRORS CAUSES STORED FUNCTION +--echo # AND TRIGGER HANDLERS TO BE IGNORED + +--echo #Code fixed in Bug#16041903 +--enable_connect_log + +CREATE TABLE t1 (id int unsigned PRIMARY KEY, val int DEFAULT 0) +ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (1), (2); + +CREATE TABLE t2 (id int PRIMARY KEY); +CREATE TABLE t3 LIKE t2; + +# Trigger with continue handler for ER_DUP_ENTRY(1062) +DELIMITER //; +CREATE TRIGGER bef_insert BEFORE INSERT ON t2 FOR EACH ROW +BEGIN + DECLARE CONTINUE HANDLER FOR 1062 BEGIN END; + INSERT INTO t3 (id) VALUES (NEW.id); + INSERT INTO t3 (id) VALUES (NEW.id); +END// +DELIMITER ;// + +# Transaction 1: Grab locks on t1 +START TRANSACTION; +UPDATE t1 SET val = val + 1; + +# Transaction 2: +--connect (con2,localhost,root,,test,,) +SET SESSION innodb_lock_wait_timeout = 2; +# Trigger lock timeout (1205) +--error ER_LOCK_WAIT_TIMEOUT +UPDATE t1 SET val = val + 1; + +# This insert should go through, as the continue handler should +# handle ER_DUP_ENTRY, even after ER_LOCK_WAIT_TIMEOUT (Bug#16041903) +INSERT INTO t2 (id) VALUES (1); + +# Cleanup +disconnect con2; +--source include/wait_until_disconnected.inc +connection default; + +DROP TABLE t3, t2, t1; + +--disable_connect_log + +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/truncate-stale-6500.test b/mysql-test/t/truncate-stale-6500.test new file mode 100644 index 00000000000..47dffb1966d --- /dev/null +++ b/mysql-test/t/truncate-stale-6500.test @@ -0,0 +1,32 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +SET GLOBAL query_cache_size=1024*1024*8; +CREATE TABLE `test` ( + `uniqueId` INT NOT NULL, + `partitionId` INT NOT NULL, + PRIMARY KEY (`uniqueId`,`partitionId`) +) ENGINE=InnoDB PARTITION BY LIST (partitionId) ( + PARTITION p01 VALUES IN (1), + PARTITION p02 VALUES IN (2) +); + + +INSERT INTO `test`(`uniqueId`,`partitionId`) VALUES(407237055, 2); + +SELECT * FROM `test`; + +--echo #Confirms 1 row in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; +ALTER TABLE `test` TRUNCATE PARTITION `p02`; + +--echo #Confirms no more rows in partition 'p02' +SELECT TABLE_NAME, PARTITION_NAME, TABLE_ROWS FROM information_schema.PARTITIONS where TABLE_NAME = 'test'; + +--echo #Before the patch, this returned the previously existing values. +SELECT * FROM `test`; +SELECT SQL_CACHE * FROM `test`; +SELECT SQL_NO_CACHE * FROM `test`; + +DROP TABLE test; +SET GLOBAL query_cache_size=DEFAULT; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 1d4ef345747..659e75270ca 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -583,3 +583,27 @@ JOIN WHERE CONCAT(t1.col1, CAST(subq.col0 AS DECIMAL)); DROP TABLE t1, t2; + + +--echo # +--echo # Start of 5.5 tests +--echo # + +--echo # +--echo # MDEV-8267 Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL +--echo # + +let $MYSQLD_DATADIR= `select @@datadir`; + +--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm +--copy_file std_data/old_decimal/t1dec102.MYD $MYSQLD_DATADIR/test/t1dec102.MYD +--copy_file std_data/old_decimal/t1dec102.MYI $MYSQLD_DATADIR/test/t1dec102.MYI + +SHOW CREATE TABLE t1dec102; +SHOW COLUMNS FROM t1dec102; +SELECT COLUMN_NAME, DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1dec102'; +DROP TABLE t1dec102; + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 77ce8c595ca..195252a2df9 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -492,4 +492,31 @@ drop function f1; set timestamp=0; SET time_zone=DEFAULT; +--echo # +--echo # MDEV-7778 impossible create copy of table, if table contain default value for timestamp field +--echo # + +SET sql_mode="NO_ZERO_DATE"; +CREATE TABLE t1 ( + ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP +); +CREATE TABLE t2 AS SELECT * from t1 LIMIT 0; +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; +DROP TABLE t1,t2; +SET sql_mode=DEFAULT; + +--echo # +--echo # MDEV-8082 ON UPDATE is not preserved by CREATE TABLE .. SELECT +--echo # +CREATE TABLE t1 ( + vc VARCHAR(10) NOT NULL DEFAULT 'test', + ts timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP +); +CREATE TABLE t2 AS SELECT * FROM t1 LIMIT 0; +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; +DROP TABLE t1,t2; + + --echo End of 10.0 tests diff --git a/mysql-test/t/uniques_crash-7912.test b/mysql-test/t/uniques_crash-7912.test new file mode 100644 index 00000000000..8dc82f8f540 --- /dev/null +++ b/mysql-test/t/uniques_crash-7912.test @@ -0,0 +1,26 @@ +# +# MDEV-7912 +# +# multitable delete with wrongly set sort_buffer_size crashes in merge_buffers + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/windows.inc + +call mtr.add_suppression("Out of memory"); + +set sql_mode=""; +--disable_warnings +drop table if exists t1,t2; +create table `t1` (`a` datetime not null) engine=InnoDB; +create table `t2` (`a` int not null) engine=innodb; +replace into t1 values (),(); +insert into t2 values(0); +set session sort_buffer_size = 1024*1024*1024*1024; +#Either fail with EE_OUTOFMEMORY, or succeed +--error 0 , 5 +delete d2 from t2 as d1, t1 as d2 where d1.a <=> d2.a; +--enable_warnings + +drop table t2; +drop table t1; diff --git a/mysql-test/t/update_innodb.test b/mysql-test/t/update_innodb.test new file mode 100644 index 00000000000..67c356c4e2e --- /dev/null +++ b/mysql-test/t/update_innodb.test @@ -0,0 +1,39 @@ +--source include/have_innodb.inc + +CREATE TABLE `t1` ( + `c1` int(11) NOT NULL, + `c2` datetime DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t2` ( + `c0` varchar(10) NOT NULL, + `c1` int(11) NOT NULL, + `c2` int(11) NOT NULL, + PRIMARY KEY (`c0`,`c1`), + KEY `c1` (`c1`), + KEY `c2` (`c2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t3` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `c1` datetime NOT NULL, + `c2` bigint(20) NOT NULL, + `c3` int(4) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `c2` (`c2`), + KEY `c3` (`c3`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +CREATE TABLE `t4` ( + `c1` int(11) NOT NULL, + `c2` bigint(20) DEFAULT NULL, + `c3` int(11) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + CREATE ALGORITHM=UNDEFINED VIEW `v1` AS select `t4`.`c1` AS `c1`,`t4`.`c2` AS `c2`,`t4`.`c3` AS `c3` from `t4`; + +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; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index ae78d5504cf..e95194e3f2c 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -5345,6 +5345,41 @@ create view v1 as select 1; drop view v1; +--echo # +--echo # MDEV-7260: Crash in get_best_combination when executing multi-table +--echo # UPDATE with nested views +--echo # + +CREATE TABLE `t1` (`id` bigint(20)); + +INSERT INTO `t1` VALUES (1),(2); + +CREATE TABLE `t2` (`id` bigint(20)); + +CREATE TABLE `t3` (`id` bigint(20), `flag` tinyint(4)); + +create view v1 as select id from t1; + +create view v2 as select t2.* from (t2 left join v1 using (id)); + +update t3 left join v2 using (id) set flag=flag+1; + +drop view v2, v1; +drop table t1, t2, t3; + +--echo # +--echo # MDEV-7207 - ALTER VIEW does not change ALGORITM +--echo # +create table t1 (a int, b int); +create algorithm=temptable view v2 (c) as select b+1 from t1; +show create view v2; +alter algorithm=undefined view v2 (c) as select b+1 from t1; +show create view v2; +alter algorithm=merge view v2 (c) as select b+1 from t1; +show create view v2; +drop view v2; +drop table t1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.5 tests. --echo # ----------------------------------------------------------------- diff --git a/mysql-test/t/view_alias.test b/mysql-test/t/view_alias.test index b155ba6c2a9..09d707296bb 100644 --- a/mysql-test/t/view_alias.test +++ b/mysql-test/t/view_alias.test @@ -90,3 +90,12 @@ eval CREATE VIEW v1 AS $query; DROP VIEW v1; DROP TABLE t1, t2; + +# +# MDEV-7482 VIEW containing INTERVAL(...) +# +create view v1 as select interval(55,10) as my_col; +show create view v1; +select * from v1; +drop view v1; + |