diff options
Diffstat (limited to 'mysql-test')
147 files changed, 5949 insertions, 580 deletions
diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly index 33d13d8edfd..426bcfa53c4 100644 --- a/mysql-test/collections/default.weekly +++ b/mysql-test/collections/default.weekly @@ -1,2 +1,2 @@ -perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st -perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 large_tests.alter_table main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_ndb parts.partition_alter1_2_innodb parts.partition_alter1_2_ndb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb rpl_ndb.rpl_truncate_7ndb_2 +perl mysql-test-run.pl --timer --force --parallel=auto --comment=1st --experimental=collections/default.experimental 1st +perl mysql-test-run.pl --timer --force --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_ndb parts.partition_alter1_2_innodb parts.partition_alter1_2_ndb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb rpl_ndb.rpl_truncate_7ndb_2 diff --git a/mysql-test/collections/test-bt b/mysql-test/collections/test-bt index 3127e2aecb9..58f0c2c3cde 100644 --- a/mysql-test/collections/test-bt +++ b/mysql-test/collections/test-bt @@ -1,10 +1,10 @@ -perl mysql-test-run.pl --force --timer --comment=normal --skip-ndbcluster --report-features --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=ps --skip-ndbcluster --ps-protocol --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=funcs1+ps --suite=funcs_1 --ps-protocol --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=funcs2 --suite=funcs_2 --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=partitions --suite=parts --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=stress --suite=stress --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=jp --suite=jp --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=embedded --embedded-server --skip-rpl --skip-ndbcluster --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=nist --suite=nist --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=nist+ps --suite=nist --ps-protocol --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=normal --skip-ndbcluster --report-features --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=ps --skip-ndbcluster --ps-protocol --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=funcs1+ps --suite=funcs_1 --ps-protocol --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=funcs2 --suite=funcs_2 --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=partitions --suite=parts --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=stress --suite=stress --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=jp --suite=jp --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=embedded --embedded-server --skip-rpl --skip-ndbcluster --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=nist --suite=nist --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=nist+ps --suite=nist --ps-protocol --experimental=collections/default.experimental diff --git a/mysql-test/collections/test-bt-debug b/mysql-test/collections/test-bt-debug index aec3d9fbef5..5fc1e15e0d2 100644 --- a/mysql-test/collections/test-bt-debug +++ b/mysql-test/collections/test-bt-debug @@ -1 +1 @@ -perl mysql-test-run.pl --force --timer --comment=debug --skip-ndbcluster --skip-rpl --report-features --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=debug --skip-ndbcluster --skip-rpl --report-features --experimental=collections/default.experimental diff --git a/mysql-test/collections/test-bt-fast b/mysql-test/collections/test-bt-fast index c3ded443518..7978c8082f0 100644 --- a/mysql-test/collections/test-bt-fast +++ b/mysql-test/collections/test-bt-fast @@ -1,2 +1,2 @@ -perl mysql-test-run.pl --force --timer --comment=ps --skip-ndbcluster --ps-protocol --report-features --experimental=collections/default.experimental -perl mysql-test-run.pl --force --timer --comment=stress --suite=stress --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=ps --skip-ndbcluster --ps-protocol --report-features --experimental=collections/default.experimental +perl mysql-test-run.pl --force --timer --parallel=auto --comment=stress --suite=stress --experimental=collections/default.experimental diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 900e46ff90a..54aa08ff3ab 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -304,5 +304,58 @@ BINLOG ' SHOW BINLOG EVENTS; DROP TABLE t1; + +--echo +--echo # BUG#54903 BINLOG statement toggles session variables +--echo # ---------------------------------------------------------------------- +--echo # This test verify that BINLOG statement doesn't change current session's +--echo # variables foreign_key_checks and unique_checks. +--echo +CREATE TABLE t1 (c1 INT KEY); + +SET @@SESSION.foreign_key_checks= ON; +SET @@SESSION.unique_checks= ON; + +--echo # INSERT INTO t1 VALUES (1) +--echo # foreign_key_checks=0 and unique_checks=0 +BINLOG ' +dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== +'; + +SELECT * FROM t1; +--echo # Their values should be ON +SHOW SESSION VARIABLES LIKE "%_checks"; + +--echo +SET @@SESSION.foreign_key_checks= OFF; +SET @@SESSION.unique_checks= OFF; + +--echo # INSERT INTO t1 VALUES(2) +--echo # foreign_key_checks=1 and unique_checks=1 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; + +SELECT * FROM t1; +--echo # Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; + +--echo # INSERT INTO t1 VALUES(2) +--echo # foreign_key_checks=1 and unique_checks=1 +--echo # It should not change current session's variables, even error happens +--error 1062 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; + +SELECT * FROM t1; +--echo # Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; + +DROP TABLE t1; + disconnect fresh; diff --git a/mysql-test/extra/binlog_tests/binlog_cache_stat.test b/mysql-test/extra/binlog_tests/binlog_cache_stat.test new file mode 100644 index 00000000000..a602b098201 --- /dev/null +++ b/mysql-test/extra/binlog_tests/binlog_cache_stat.test @@ -0,0 +1,251 @@ +# Embedded server doesn't support binlog +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +# Creating tables +--disable_warnings +drop table if exists t1, t2; +--enable_warnings + +create table t1 (a int) engine=innodb; +create table t2 (a int) engine=myisam; + +# +# This test checks binlog_cache_use and binlog_cache_disk_use when +# transactions are committed and after when they are aborted. +# + +# +# Checking commit. +# +--echo **** Preparing the enviroment to check commit and its effect on status variables. +--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +let $exp_cache= 0; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 0; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 0; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Transactional changes which are long enough so they will be flushed to disk... +--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +let $1=2000; +disable_query_log; +begin; +while ($1) +{ + eval insert into t1 values( $1 ); + dec $1; +} +commit; +enable_query_log; +let $exp_cache= 1; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 0; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Transactional changes which should not be flushed to disk and so should not +--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +commit; +let $exp_cache= 2; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 0; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Non-Transactional changes which should not be flushed to disk and so should not +--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +commit; +let $exp_cache= 2; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 1; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Mixed changes which should not be flushed to disk and so should not +--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +commit; +let $exp_cache= 3; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 2; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +# +# Checking abort. +# +--echo **** Preparing the enviroment to check abort and its effect on the status variables. +--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +let $exp_cache= 0; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 0; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 0; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Transactional changes which are long enough so they will be flushed to disk... +--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +let $1=2000; +disable_query_log; +begin; +while ($1) +{ + eval insert into t1 values( $1 ); + dec $1; +} +rollback; +enable_query_log; +let $exp_cache= 1; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 0; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Transactional changes which should not be flushed to disk and so should not +--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +rollback; +let $exp_cache= 2; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 0; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Non-Transactional changes which should not be flushed to disk and so should not +--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +rollback; +let $exp_cache= 2; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 1; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} + +--echo **** Mixed changes which should not be flushed to disk and so should not +--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +--echo **** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +rollback; +let $exp_cache= 3; +let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1); +let $exp_disk= 1; +let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1); +let $exp_stmt_cache= 2; +let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1); +let $exp_stmt_disk= 0; +let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1); +if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`) +{ + -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk" + -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk" + -- die +} +drop table t1, t2; diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test index 2526b2dd149..7b31a3ebf17 100644 --- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test +++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test @@ -34,11 +34,11 @@ create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; let $table=t1; let $count=0; -insert delayed into t1 values (207); +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); inc $count; --source include/wait_until_rows_count.inc -insert delayed into t1 values (null); +insert /*! delayed */ into t1 values (null); inc $count; --source include/wait_until_rows_count.inc diff --git a/mysql-test/extra/binlog_tests/innodb_stat.test b/mysql-test/extra/binlog_tests/innodb_stat.test deleted file mode 100644 index b31e99dfe71..00000000000 --- a/mysql-test/extra/binlog_tests/innodb_stat.test +++ /dev/null @@ -1,41 +0,0 @@ -# Embedded server doesn't support binlog --- source include/not_embedded.inc --- source include/have_innodb.inc - -# -# Let us test binlog_cache_use and binlog_cache_disk_use status vars. -# Actually this test has nothing to do with innodb per se, it just requires -# transactional table. -# -flush status; -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; ---disable_warnings -drop table if exists t1; ---enable_warnings - -create table t1 (a int) engine=innodb; - -# Now we are going to create transaction which is long enough so its -# transaction binlog will be flushed to disk... -let $1=2000; -disable_query_log; -begin; -while ($1) -{ - eval insert into t1 values( $1 ); - dec $1; -} -commit; -enable_query_log; -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; - -# Transaction which should not be flushed to disk and so should not -# increase binlog_cache_disk_use. -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; -drop table t1; diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test index 3d97ad10d17..385a82baa77 100644 --- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test +++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test @@ -25,11 +25,13 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1); let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1); +let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1); +let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1); SET GLOBAL max_binlog_cache_size = 4096; -# Becuase of bug#55377, we have to set binlog_cache_size until the bug is -# fixed. SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; disconnect master; connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); @@ -47,14 +49,14 @@ connection master; --echo *** Single statement on transactional table *** --disable_query_log ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE eval INSERT INTO t1 (a, data) VALUES (1, CONCAT($data, $data, $data, $data, $data)); --enable_query_log --echo *** Single statement on non-transactional table *** --disable_query_log ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE eval INSERT INTO t2 (a, data) VALUES (2, CONCAT($data, $data, $data, $data, $data, $data)); --enable_query_log @@ -74,7 +76,7 @@ eval INSERT INTO t2 (a, data) VALUES (5, $data); --echo *** Single statement on both transactional and non-transactional tables. *** --disable_query_log ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data), t1.data = CONCAT($data, $data, $data, $data); --enable_query_log @@ -103,11 +105,11 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (1, $data); --eval INSERT INTO t1 (a, data) VALUES (2, $data); --eval INSERT INTO t1 (a, data) VALUES (3, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (4, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (5, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); --eval INSERT INTO t1 (a, data) VALUES (7, 's'); --eval INSERT INTO t2 (a, data) VALUES (8, 's'); @@ -130,9 +132,9 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (14, $data); --eval INSERT INTO t1 (a, data) VALUES (15, $data); --eval INSERT INTO t1 (a, data) VALUES (16, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (17, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (18, $data); --eval INSERT INTO t1 (a, data) VALUES (19, 's'); --eval INSERT INTO t2 (a, data) VALUES (20, 's'); @@ -148,7 +150,7 @@ if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) if (`SELECT @@binlog_format = 'ROW'`) { --disable_query_log - --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE + --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE CREATE TABLE t4 SELECT * FROM t1; --enable_query_log } @@ -162,9 +164,9 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (22, $data); --eval INSERT INTO t1 (a, data) VALUES (23, $data); --eval INSERT INTO t1 (a, data) VALUES (24, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (25, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (26, $data); --eval INSERT INTO t1 (a, data) VALUES (27, 's'); --eval INSERT INTO t2 (a, data) VALUES (28, 's'); @@ -192,11 +194,11 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (1, $data); --eval INSERT INTO t1 (a, data) VALUES (2, $data); --eval INSERT INTO t1 (a, data) VALUES (3, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (4, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (5, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); --eval INSERT INTO t1 (a, data) VALUES (7, 's'); --eval INSERT INTO t2 (a, data) VALUES (8, 's'); @@ -221,11 +223,11 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (1, $data); --eval INSERT INTO t1 (a, data) VALUES (2, $data); --eval INSERT INTO t1 (a, data) VALUES (3, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (4, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (5, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); --eval INSERT INTO t1 (a, data) VALUES (7, 's'); --eval INSERT INTO t2 (a, data) VALUES (8, 's'); @@ -268,7 +270,7 @@ TRUNCATE TABLE t1; BEGIN; --disable_query_log ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE eval CALL p1($data); --enable_query_log COMMIT; @@ -277,7 +279,7 @@ TRUNCATE TABLE t1; BEGIN; --disable_query_log ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE eval CALL p1($data); --enable_query_log ROLLBACK; @@ -299,12 +301,12 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (1, $data); --eval INSERT INTO t1 (a, data) VALUES (2, $data); --eval INSERT INTO t1 (a, data) VALUES (3, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (4, $data); SAVEPOINT sv; ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (5, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); --eval INSERT INTO t1 (a, data) VALUES (7, 's'); --eval INSERT INTO t2 (a, data) VALUES (8, 's'); @@ -331,11 +333,11 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (2, $data); --eval INSERT INTO t2 (a, data) VALUES (3, $data); --eval INSERT INTO t1 (a, data) VALUES (4, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (5, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (7, $data); --eval UPDATE t2 SET data= CONCAT($data, $data); --eval INSERT INTO t1 (a, data) VALUES (8, 's'); @@ -351,7 +353,7 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (16, $data); --eval INSERT INTO t2 (a, data) VALUES (17, $data); --eval INSERT INTO t1 (a, data) VALUES (18, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (19, $data); --enable_query_log COMMIT; @@ -367,10 +369,13 @@ let $diff_statement= SELECT * FROM t1; --echo # [ On Slave ] SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; source include/stop_slave.inc; source include/start_slave.inc; CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); +CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); connection master; @@ -385,6 +390,10 @@ connection master; --eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size --replace_result $old_binlog_cache_size ORIGINAL_VALUE --eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size +--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE +--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size +--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE +--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size disconnect master; connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); @@ -415,6 +424,10 @@ source include/show_binlog_events.inc; --eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size --replace_result $old_binlog_cache_size ORIGINAL_VALUE --eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size +--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE +--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size +--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE +--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size source include/stop_slave.inc; source include/start_slave.inc; diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test index 40e155bc314..c7e3d1abc03 100644 --- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test +++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test @@ -53,9 +53,7 @@ source include/wait_for_slave_to_start.inc; connection master; # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Send shutdown to the connected server and give # it 10 seconds to die before zapping it @@ -85,9 +83,7 @@ source include/wait_for_slave_io_error.inc; eval set @@global.debug = "-d,$dbug_sync_point"; # Write file to make mysql-test-run.pl start up the server again ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect connection master; # Turn on reconnect diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index bbd4969ef40..172483e1466 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -36,8 +36,8 @@ let $ddl_cases= 41; while ($ddl_cases >= 1) { --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- - let $in_temporary= "no"; - let $ok= "yes"; + let $in_temporary= no; + let $ok= yes; # # In SBR and MIXED modes, the commit event is usually the third event in the # binary log: @@ -91,7 +91,7 @@ while ($ddl_cases >= 1) { # This seems to be related to epochs. # We need to check this against an updated version or avoid it. - let $ok= "no"; + let $ok= no; let $commit_event_row_number= 6; } } @@ -356,7 +356,7 @@ while ($ddl_cases >= 1) if ($ddl_cases == 11) { let $cmd= CREATE TEMPORARY TABLE tt_xx (a int); - let $in_temporary= "yes"; + let $in_temporary= yes; # In SBR and MIXED modes, the DDL statement is written to the binary log but # does not commit the current transaction. # @@ -478,7 +478,7 @@ while ($ddl_cases >= 1) if ($ddl_cases == 8) { let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx; - let $in_temporary= "yes"; + let $in_temporary= yes; # # In SBR and MIXED modes, the DDL statement is written to the binary log # but does not commit the current transaction: @@ -618,14 +618,14 @@ while ($ddl_cases >= 1) # commit. The flag in_temporary is used to avoid aborting the test in such # cases. Thus we force the commit. # - if ($in_temporary == "yes") + if ($in_temporary == yes) { --eval COMMIT } let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number); if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`) { - if ($ok == "yes") + if ($ok == yes) { --echo it *does not* commit the current transaction. --echo $cmd diff --git a/mysql-test/include/ctype_8bit.inc b/mysql-test/include/ctype_8bit.inc new file mode 100644 index 00000000000..7259db54d05 --- /dev/null +++ b/mysql-test/include/ctype_8bit.inc @@ -0,0 +1,46 @@ +# +# Test Unicode conversion, upper, lower +# +SELECT @@collation_connection; +CREATE TABLE t1 AS SELECT ' ' AS a LIMIT 0; +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); +SELECT + HEX(a) AS chr, + HEX(LOWER(a)) AS upper, + HEX(LOWER(a)) AS lower, + HEX(@utf8:=CONVERT(a USING utf8)) AS utf8, + HEX(@roundtrip:=CAST(@utf8 AS CHAR)) AS roundtrip, + if(a=BINARY @roundtrip,'','Round trip unsafe') AS issafe +FROM t1 ORDER BY chr; +DROP TABLE t1; diff --git a/mysql-test/include/ctype_czech.inc b/mysql-test/include/ctype_czech.inc new file mode 100644 index 00000000000..bc83d462a22 --- /dev/null +++ b/mysql-test/include/ctype_czech.inc @@ -0,0 +1,12 @@ +SELECT @@collation_connection; +--echo # +--echo # Bug#57737 Character sets: search fails with like, contraction, index +--echo # +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +DROP TABLE t1; diff --git a/mysql-test/include/ctype_like_ignorable.inc b/mysql-test/include/ctype_like_ignorable.inc new file mode 100644 index 00000000000..9f2fa7ae741 --- /dev/null +++ b/mysql-test/include/ctype_like_ignorable.inc @@ -0,0 +1,11 @@ +SELECT @@collation_connection; +--echo # +--echo # Bug#57737 Character sets: search fails with like, contraction, index +--echo # Part#2 - ignorable characters +--echo # +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +DROP TABLE t1; diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc index 0f363ff1ee3..d92115f0a61 100644 --- a/mysql-test/include/restart_mysqld.inc +++ b/mysql-test/include/restart_mysqld.inc @@ -1,18 +1,14 @@ # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Send shutdown to the connected server and give # it 10 seconds to die before zapping it shutdown_server 10; # Write file to make mysql-test-run.pl start up the server again ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Turn on reconnect --enable_reconnect diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index a7d7a8aefa4..1ab64fa3579 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -150,7 +150,7 @@ sub collect_test_cases ($$$$) { { last unless $opt_reorder; # test->{name} is always in suite.name format - if ( $test->{name} =~ /.*\.$tname/ ) + if ( $test->{name} =~ /^$sname.*\.$tname$/ ) { $found= 1; last; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 89e2ed5d441..21ff416221f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -191,6 +191,8 @@ my $opt_cursor_protocol; my $opt_view_protocol; our $opt_debug; +my $debug_d= "d"; +my $opt_debug_common; our @opt_cases; # The test cases names in argv our $opt_embedded_server; @@ -607,7 +609,10 @@ sub run_test_server ($$$) { if ( !$opt_force ) { # Test has failed, force is off push(@$completed, $result); - return $completed; + return $completed unless $result->{'dont_kill_server'}; + # Prevent kill of server, to get valgrind report + print $sock "BYE\n"; + next; } elsif ($opt_max_test_fail > 0 and $num_failed_test >= $opt_max_test_fail) { @@ -854,15 +859,16 @@ sub run_worker ($) { mtr_report("Server said BYE"); stop_all_servers($opt_shutdown_timeout); mark_time_used('restart'); + my $valgrind_reports= 0; if ($opt_valgrind_mysqld) { - valgrind_exit_reports(); + $valgrind_reports= valgrind_exit_reports(); } if ( $opt_gprof ) { gprof_collect (find_mysqld($basedir), keys %gprof_dirs); } mark_time_used('init'); print_times_used($server, $thread_num); - exit(0); + exit($valgrind_reports); } else { mtr_error("Could not understand server, '$line'"); @@ -907,7 +913,7 @@ sub command_line_setup { my $opt_list_options; # Read the command line options - # Note: Keep list, and the order, in sync with usage at end of this file + # Note: Keep list in sync with usage at end of this file Getopt::Long::Configure("pass_through"); my %options=( # Control what engine/variation to run @@ -943,6 +949,7 @@ sub command_line_setup { 'combination=s' => \@opt_combinations, 'skip-combinations' => \&collect_option, 'experimental=s' => \@opt_experimentals, + # skip-im is deprecated and silently ignored 'skip-im' => \&ignore_option, # Specify ports @@ -962,6 +969,7 @@ sub command_line_setup { # Debugging 'debug' => \$opt_debug, + 'debug-common' => \$opt_debug_common, 'gdb' => \$opt_gdb, 'client-gdb' => \$opt_client_gdb, 'manual-gdb' => \$opt_manual_gdb, @@ -1038,7 +1046,8 @@ sub command_line_setup { 'report-times' => \$opt_report_times, 'help|h' => \$opt_usage, - 'list-options' => \$opt_list_options, + # list-options is internal, not listed in help + 'list-options' => \$opt_list_options, 'skip-test-list=s' => \@opt_skip_test_list ); @@ -1551,6 +1560,18 @@ sub command_line_setup { join(" ", @valgrind_args), "\""); } + if ($opt_debug_common) + { + $opt_debug= 1; + $debug_d= "d,query,info,error,enter,exit"; + } + + if ($opt_debug && $opt_debug ne "1") + { + $debug_d= "d,$opt_debug"; + $debug_d= "d,query,info,error,enter,exit" if $opt_debug eq "std"; + } + mtr_report("Checking supported features..."); check_ndbcluster_support(\%mysqld_variables); @@ -1848,7 +1869,7 @@ sub client_debug_arg($$) { if ( $opt_debug ) { mtr_add_arg($args, - "--debug=d:t:A,%s/log/%s.trace", + "--debug=$debug_d:t:A,%s/log/%s.trace", $path_vardir_trace, $client_name) } } @@ -3019,13 +3040,19 @@ sub mysql_install_db { if ( $opt_debug ) { - mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap.trace", + mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/bootstrap.trace", $path_vardir_trace); } mtr_add_arg($args, "--lc-messages-dir=%s", $install_lang); mtr_add_arg($args, "--character-sets-dir=%s", $install_chsdir); + # On some old linux kernels, aio on tmpfs is not supported + # Remove this if/when Bug #58421 fixes this in the server + if ($^O eq "linux" && $opt_mem) { + mtr_add_arg($args, "--loose-skip-innodb-use-native-aio"); + } + # InnoDB arguments that affect file location and sizes may # need to be given to the bootstrap process as well as the # server process. @@ -4386,7 +4413,12 @@ sub after_failure ($) { sub report_failure_and_restart ($) { my $tinfo= shift; - stop_all_servers(); + if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) { + # In these cases we may want valgrind report from normal termination + $tinfo->{'dont_kill_server'}= 1; + } + # Shotdown properly if not to be killed (for valgrind) + stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0); $tinfo->{'result'}= 'MTR_RES_FAILED'; @@ -4512,6 +4544,13 @@ sub mysqld_arguments ($$$) { } } + # On some old linux kernels, aio on tmpfs is not supported + # Remove this if/when Bug #58421 fixes this in the server + if ($^O eq "linux" && $opt_mem) + { + mtr_add_arg($args, "--loose-skip-innodb-use-native-aio"); + } + if ( $mysql_version_id >= 50106 && !$opt_user_args) { # Turn on logging to file @@ -4604,7 +4643,7 @@ sub mysqld_start ($$) { if ( $opt_debug ) { - mtr_add_arg($args, "--debug=d:t:i:A,%s/log/%s.trace", + mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/%s.trace", $path_vardir_trace, $mysqld->name()); } @@ -5526,6 +5565,8 @@ sub valgrind_arguments { # sub valgrind_exit_reports() { + my $found_err= 0; + foreach my $log_file (keys %mysqld_logs) { my @culprits= (); @@ -5561,7 +5602,7 @@ sub valgrind_exit_reports() { next; } # This line marks the start of a valgrind report - $found_report= 1 if $line =~ /ERROR SUMMARY:/; + $found_report= 1 if $line =~ /^==\d+== .* SUMMARY:/; if ($found_report) { $line=~ s/^==\d+== //; @@ -5578,8 +5619,11 @@ sub valgrind_exit_reports() { mtr_print ("Valgrind report from $log_file after tests:\n", @culprits); mtr_print_line(); print ("$valgrind_rep\n"); + $found_err= 1; } } + + return $found_err; } # @@ -5613,7 +5657,7 @@ Options to control what engine/variation to run defaults-file=<config template> Use fixed config template for all tests - defaults_extra_file=<config template> Extra config template to add to + defaults-extra-file=<config template> Extra config template to add to all generated configs combination=<opt> Use at least twice to run tests with specified options to mysqld @@ -5701,6 +5745,8 @@ Options for debugging the product client-gdb Start mysqltest client in gdb ddd Start mysqld in ddd debug Dump trace output for all servers and client programs + debug-common Same as debug, but sets 'd' debug flags to + "query,info,error,enter,exit" debugger=NAME Start mysqld in the selected debugger gdb Start the mysqld(s) in gdb manual-debug Let user manually start mysqld in debugger, before @@ -5709,7 +5755,7 @@ Options for debugging the product test(s) manual-ddd Let user manually start mysqld in ddd, before running test(s) - strace-client=[path] Create strace output for mysqltest client, optionally + strace-client[=path] Create strace output for mysqltest client, optionally specifying name and path to the trace program to use. Example: $0 --strace-client=ktrace max-save-core Limit the number of core files saved (to avoid filling @@ -5742,7 +5788,7 @@ Options for valgrind Misc options user=USER User for connecting to mysqld(default: $opt_user) comment=STR Write STR to the output - notimer Don't show test case execution time + timer Show test case execution time. verbose More verbose output(use multiple times for even more) verbose-restart Write when and why servers are restarted start Only initialize and start the servers, using the @@ -5782,6 +5828,7 @@ Misc options actions. Disable facility with NUM=0. gcov Collect coverage information after the test. The result is a gcov file per source and header file. + gprof Collect profiling information using gprof. experimental=<file> Refer to list of tests considered experimental; failures will be marked exp-fail instead of fail. report-features First run a "test" that reports mysql features @@ -5794,6 +5841,11 @@ Misc options engine to InnoDB. report-times Report how much time has been spent on different phases of test execution. + +Some options that control enabling a feature for normal test runs, +can be turned off by prepending 'no' to the option, e.g. --notimer. +This applies to reorder, timer, check-testcases and warnings. + HERE exit(1); diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 028c8b32f87..231b7acb5b4 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12801,3 +12801,9 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 DROP TABLE t1; +# +# BUG#58205 - Valgrind failure in fn_format when called from +# archive_discover +# +CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE; +DROP TABLE `a/../`; diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index dbeedb481cd..5adbefe104c 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -476,3 +476,24 @@ SELECT a FROM t2; a 2 DROP TABLE t1, t2; +# +# Bug#39828 autoinc wraps around when offset and increment > 1 +# +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) engine=MyISAM; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES (18446744073709551601); +SET @@SESSION.AUTO_INCREMENT_INCREMENT=10; +SELECT @@SESSION.AUTO_INCREMENT_OFFSET; +@@SESSION.AUTO_INCREMENT_OFFSET +1 +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +ERROR 22003: Out of range value for column 't1' at row 167 +SELECT * FROM t1; +c1 +1 +18446744073709551601 +18446744073709551611 +SET @@SESSION.AUTO_INCREMENT_INCREMENT=default; +SET @@SESSION.AUTO_INCREMENT_OFFSET=default; +DROP TABLE t1; +End of 5.1 tests diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index d5ee7214cde..b65230e94b4 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -82,6 +82,314 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 DROP TABLE t1; # +# Start of 5.1 tests +# +SELECT @@collation_connection; +@@collation_connection +cp1251_general_ci +CREATE TABLE t1 AS SELECT ' ' AS a LIMIT 0; +INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07); +INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F); +INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17); +INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F); +INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27); +INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37); +INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47); +INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57); +INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67); +INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77); +INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87); +INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F); +INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97); +INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F); +INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7); +INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF); +INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7); +INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF); +INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7); +INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF); +INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7); +INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF); +INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7); +INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF); +INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7); +INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF); +SELECT +HEX(a) AS chr, +HEX(LOWER(a)) AS upper, +HEX(LOWER(a)) AS lower, +HEX(@utf8:=CONVERT(a USING utf8)) AS utf8, +HEX(@roundtrip:=CAST(@utf8 AS CHAR)) AS roundtrip, +if(a=BINARY @roundtrip,'','Round trip unsafe') AS issafe +FROM t1 ORDER BY chr; +chr upper lower utf8 roundtrip issafe +00 00 00 00 00 +01 01 01 01 01 +02 02 02 02 02 +03 03 03 03 03 +04 04 04 04 04 +05 05 05 05 05 +06 06 06 06 06 +07 07 07 07 07 +08 08 08 08 08 +09 09 09 09 09 +0A 0A 0A 0A 0A +0B 0B 0B 0B 0B +0C 0C 0C 0C 0C +0D 0D 0D 0D 0D +0E 0E 0E 0E 0E +0F 0F 0F 0F 0F +10 10 10 10 10 +11 11 11 11 11 +12 12 12 12 12 +13 13 13 13 13 +14 14 14 14 14 +15 15 15 15 15 +16 16 16 16 16 +17 17 17 17 17 +18 18 18 18 18 +19 19 19 19 19 +1A 1A 1A 1A 1A +1B 1B 1B 1B 1B +1C 1C 1C 1C 1C +1D 1D 1D 1D 1D +1E 1E 1E 1E 1E +1F 1F 1F 1F 1F +20 20 20 20 20 +21 21 21 21 21 +22 22 22 22 22 +23 23 23 23 23 +24 24 24 24 24 +25 25 25 25 25 +26 26 26 26 26 +27 27 27 27 27 +28 28 28 28 28 +29 29 29 29 29 +2A 2A 2A 2A 2A +2B 2B 2B 2B 2B +2C 2C 2C 2C 2C +2D 2D 2D 2D 2D +2E 2E 2E 2E 2E +2F 2F 2F 2F 2F +30 30 30 30 30 +31 31 31 31 31 +32 32 32 32 32 +33 33 33 33 33 +34 34 34 34 34 +35 35 35 35 35 +36 36 36 36 36 +37 37 37 37 37 +38 38 38 38 38 +39 39 39 39 39 +3A 3A 3A 3A 3A +3B 3B 3B 3B 3B +3C 3C 3C 3C 3C +3D 3D 3D 3D 3D +3E 3E 3E 3E 3E +3F 3F 3F 3F 3F +40 40 40 40 40 +41 61 61 41 41 +42 62 62 42 42 +43 63 63 43 43 +44 64 64 44 44 +45 65 65 45 45 +46 66 66 46 46 +47 67 67 47 47 +48 68 68 48 48 +49 69 69 49 49 +4A 6A 6A 4A 4A +4B 6B 6B 4B 4B +4C 6C 6C 4C 4C +4D 6D 6D 4D 4D +4E 6E 6E 4E 4E +4F 6F 6F 4F 4F +50 70 70 50 50 +51 71 71 51 51 +52 72 72 52 52 +53 73 73 53 53 +54 74 74 54 54 +55 75 75 55 55 +56 76 76 56 56 +57 77 77 57 57 +58 78 78 58 58 +59 79 79 59 59 +5A 7A 7A 5A 5A +5B 5B 5B 5B 5B +5C 5C 5C 5C 5C +5D 5D 5D 5D 5D +5E 5E 5E 5E 5E +5F 5F 5F 5F 5F +60 60 60 60 60 +61 61 61 61 61 +62 62 62 62 62 +63 63 63 63 63 +64 64 64 64 64 +65 65 65 65 65 +66 66 66 66 66 +67 67 67 67 67 +68 68 68 68 68 +69 69 69 69 69 +6A 6A 6A 6A 6A +6B 6B 6B 6B 6B +6C 6C 6C 6C 6C +6D 6D 6D 6D 6D +6E 6E 6E 6E 6E +6F 6F 6F 6F 6F +70 70 70 70 70 +71 71 71 71 71 +72 72 72 72 72 +73 73 73 73 73 +74 74 74 74 74 +75 75 75 75 75 +76 76 76 76 76 +77 77 77 77 77 +78 78 78 78 78 +79 79 79 79 79 +7A 7A 7A 7A 7A +7B 7B 7B 7B 7B +7C 7C 7C 7C 7C +7D 7D 7D 7D 7D +7E 7E 7E 7E 7E +7F 7F 7F 7F 7F +80 90 90 D082 80 +81 83 83 D083 81 +82 82 82 E2809A 82 +83 83 83 D193 83 +84 84 84 E2809E 84 +85 85 85 E280A6 85 +86 86 86 E280A0 86 +87 87 87 E280A1 87 +88 88 88 E282AC 88 +89 89 89 E280B0 89 +8A 9A 9A D089 8A +8B 8B 8B E280B9 8B +8C 9C 9C D08A 8C +8D 9D 9D D08C 8D +8E 9E 9E D08B 8E +8F 9F 9F D08F 8F +90 90 90 D192 90 +91 91 91 E28098 91 +92 92 92 E28099 92 +93 93 93 E2809C 93 +94 94 94 E2809D 94 +95 95 95 E280A2 95 +96 96 96 E28093 96 +97 97 97 E28094 97 +98 98 98 3F 3F Round trip unsafe +99 99 99 E284A2 99 +9A 9A 9A D199 9A +9B 9B 9B E280BA 9B +9C 9C 9C D19A 9C +9D 9D 9D D19C 9D +9E 9E 9E D19B 9E +9F 9F 9F D19F 9F +A0 A0 A0 C2A0 A0 +A1 A2 A2 D08E A1 +A2 A2 A2 D19E A2 +A3 BC BC D088 A3 +A4 A4 A4 C2A4 A4 +A5 B4 B4 D290 A5 +A6 A6 A6 C2A6 A6 +A7 A7 A7 C2A7 A7 +A8 B8 B8 D081 A8 +A9 A9 A9 C2A9 A9 +AA BA BA D084 AA +AB AB AB C2AB AB +AC AC AC C2AC AC +AD AD AD C2AD AD +AE AE AE C2AE AE +AF BF BF D087 AF +B0 B0 B0 C2B0 B0 +B1 B1 B1 C2B1 B1 +B2 B3 B3 D086 B2 +B3 B3 B3 D196 B3 +B4 B4 B4 D291 B4 +B5 B5 B5 C2B5 B5 +B6 B6 B6 C2B6 B6 +B7 B7 B7 C2B7 B7 +B8 B8 B8 D191 B8 +B9 B9 B9 E28496 B9 +BA BA BA D194 BA +BB BB BB C2BB BB +BC BC BC D198 BC +BD BE BE D085 BD +BE BE BE D195 BE +BF BF BF D197 BF +C0 E0 E0 D090 C0 +C1 E1 E1 D091 C1 +C2 E2 E2 D092 C2 +C3 E3 E3 D093 C3 +C4 E4 E4 D094 C4 +C5 E5 E5 D095 C5 +C6 E6 E6 D096 C6 +C7 E7 E7 D097 C7 +C8 E8 E8 D098 C8 +C9 E9 E9 D099 C9 +CA EA EA D09A CA +CB EB EB D09B CB +CC EC EC D09C CC +CD ED ED D09D CD +CE EE EE D09E CE +CF EF EF D09F CF +D0 F0 F0 D0A0 D0 +D1 F1 F1 D0A1 D1 +D2 F2 F2 D0A2 D2 +D3 F3 F3 D0A3 D3 +D4 F4 F4 D0A4 D4 +D5 F5 F5 D0A5 D5 +D6 F6 F6 D0A6 D6 +D7 F7 F7 D0A7 D7 +D8 F8 F8 D0A8 D8 +D9 F9 F9 D0A9 D9 +DA FA FA D0AA DA +DB FB FB D0AB DB +DC FC FC D0AC DC +DD FD FD D0AD DD +DE FE FE D0AE DE +DF FF FF D0AF DF +E0 E0 E0 D0B0 E0 +E1 E1 E1 D0B1 E1 +E2 E2 E2 D0B2 E2 +E3 E3 E3 D0B3 E3 +E4 E4 E4 D0B4 E4 +E5 E5 E5 D0B5 E5 +E6 E6 E6 D0B6 E6 +E7 E7 E7 D0B7 E7 +E8 E8 E8 D0B8 E8 +E9 E9 E9 D0B9 E9 +EA EA EA D0BA EA +EB EB EB D0BB EB +EC EC EC D0BC EC +ED ED ED D0BD ED +EE EE EE D0BE EE +EF EF EF D0BF EF +F0 F0 F0 D180 F0 +F1 F1 F1 D181 F1 +F2 F2 F2 D182 F2 +F3 F3 F3 D183 F3 +F4 F4 F4 D184 F4 +F5 F5 F5 D185 F5 +F6 F6 F6 D186 F6 +F7 F7 F7 D187 F7 +F8 F8 F8 D188 F8 +F9 F9 F9 D189 F9 +FA FA FA D18A FA +FB FB FB D18B FB +FC FC FC D18C FC +FD FD FD D18D FD +FE FE FE D18E FE +FF FF FF D18F FF +DROP TABLE t1; +# +# End of 5.1 tests +# +# # Start of 5.5 tests # # diff --git a/mysql-test/r/ctype_like_range.result b/mysql-test/r/ctype_like_range.result new file mode 100644 index 00000000000..a06c6ad9ed8 --- /dev/null +++ b/mysql-test/r/ctype_like_range.result @@ -0,0 +1,2310 @@ +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARBINARY(32)); +INSERT INTO t1 (a) VALUES (''),('_'),('%'),('\_'),('\%'),('\\'); +INSERT INTO t1 (a) VALUES ('a'),('c'); +INSERT INTO t1 (a) VALUES ('a_'),('c_'); +INSERT INTO t1 (a) VALUES ('a%'),('c%'); +INSERT INTO t1 (a) VALUES ('aa'),('cc'),('ch'); +INSERT INTO t1 (a) VALUES ('aa_'),('cc_'),('ch_'); +INSERT INTO t1 (a) VALUES ('aa%'),('cc%'),('ch%'); +INSERT INTO t1 (a) VALUES ('aaa'),('ccc'),('cch'); +INSERT INTO t1 (a) VALUES ('aaa_'),('ccc_'),('cch_'); +INSERT INTO t1 (a) VALUES ('aaa%'),('ccc%'),('cch%'); +INSERT INTO t1 (a) VALUES ('aaaaaaaaaaaaaaaaaaaa'); +CREATE VIEW v1 AS +SELECT id, 'a' AS name, a AS val FROM t1 +UNION +SELECT id, 'mn', HEX(LIKE_RANGE_MIN(a, 16)) AS min FROM t1 +UNION +SELECT id, 'mx', HEX(LIKE_RANGE_MAX(a, 16)) AS max FROM t1 +UNION +SELECT id, 'sp', REPEAT('-', 32) AS sep FROM t1 +ORDER BY id, name; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00 +2 mx FF +2 sp -------------------------------- +3 a % +3 mn +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 6100 +9 mx 61FF +9 sp -------------------------------- +10 a c_ +10 mn 6300 +10 mx 63FF +10 sp -------------------------------- +11 a a% +11 mn 61 +11 mx 61FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 63 +12 mx 63FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 616100 +16 mx 6161FF +16 sp -------------------------------- +17 a cc_ +17 mn 636300 +17 mx 6363FF +17 sp -------------------------------- +18 a ch_ +18 mn 636800 +18 mx 6368FF +18 sp -------------------------------- +19 a aa% +19 mn 6161 +19 mx 6161FFFFFFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 6363 +20 mx 6363FFFFFFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 6368 +21 mx 6368FFFFFFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61616100 +25 mx 616161FF +25 sp -------------------------------- +26 a ccc_ +26 mn 63636300 +26 mx 636363FF +26 sp -------------------------------- +27 a cch_ +27 mn 63636800 +27 mx 636368FF +27 sp -------------------------------- +28 a aaa% +28 mn 616161 +28 mx 616161FFFFFFFFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 636363 +29 mx 636363FFFFFFFFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 636368 +30 mx 636368FFFFFFFFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 61616161616161616161616161616161 +31 mx 61616161616161616161616161616161 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00 +2 mx FF +2 sp -------------------------------- +3 a % +3 mn 00000000000000000000000000000000 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 6100 +9 mx 61FF +9 sp -------------------------------- +10 a c_ +10 mn 6300 +10 mx 63FF +10 sp -------------------------------- +11 a a% +11 mn 61000000000000000000000000000000 +11 mx 61FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 63000000000000000000000000000000 +12 mx 63FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 616100 +16 mx 6161FF +16 sp -------------------------------- +17 a cc_ +17 mn 636300 +17 mx 6363FF +17 sp -------------------------------- +18 a ch_ +18 mn 636800 +18 mx 6368FF +18 sp -------------------------------- +19 a aa% +19 mn 61610000000000000000000000000000 +19 mx 6161FFFFFFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 63630000000000000000000000000000 +20 mx 6363FFFFFFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 63680000000000000000000000000000 +21 mx 6368FFFFFFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61616100 +25 mx 616161FF +25 sp -------------------------------- +26 a ccc_ +26 mn 63636300 +26 mx 636363FF +26 sp -------------------------------- +27 a cch_ +27 mn 63636800 +27 mx 636368FF +27 sp -------------------------------- +28 a aaa% +28 mn 61616100000000000000000000000000 +28 mx 616161FFFFFFFFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 63636300000000000000000000000000 +29 mx 636363FFFFFFFFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 63636800000000000000000000000000 +30 mx 636368FFFFFFFFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 61616161616161616161616161616161 +31 mx 61616161616161616161616161616161 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00000000000000000000000000000000 +2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +2 sp -------------------------------- +3 a % +3 mn 00000000000000000000000000000000 +3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 61000000000000000000000000000000 +9 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +9 sp -------------------------------- +10 a c_ +10 mn 63000000000000000000000000000000 +10 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +10 sp -------------------------------- +11 a a% +11 mn 61000000000000000000000000000000 +11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +11 sp -------------------------------- +12 a c% +12 mn 63000000000000000000000000000000 +12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 61610000000000000000000000000000 +16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +16 sp -------------------------------- +17 a cc_ +17 mn 63630000000000000000000000000000 +17 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +17 sp -------------------------------- +18 a ch_ +18 mn 63680000000000000000000000000000 +18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +18 sp -------------------------------- +19 a aa% +19 mn 61610000000000000000000000000000 +19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +19 sp -------------------------------- +20 a cc% +20 mn 63630000000000000000000000000000 +20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +20 sp -------------------------------- +21 a ch% +21 mn 63680000000000000000000000000000 +21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61616100000000000000000000000000 +25 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +25 sp -------------------------------- +26 a ccc_ +26 mn 63636300000000000000000000000000 +26 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +26 sp -------------------------------- +27 a cch_ +27 mn 63636800000000000000000000000000 +27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +27 sp -------------------------------- +28 a aaa% +28 mn 61616100000000000000000000000000 +28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +28 sp -------------------------------- +29 a ccc% +29 mn 63636300000000000000000000000000 +29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +29 sp -------------------------------- +30 a cch% +30 mn 63636800000000000000000000000000 +30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 6161616161 +31 mx 6161616161 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 09090909090909090909090909090909 +2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +2 sp -------------------------------- +3 a % +3 mn 09090909090909090909090909090909 +3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 61090909090909090909090909090909 +9 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +9 sp -------------------------------- +10 a c_ +10 mn 63090909090909090909090909090909 +10 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +10 sp -------------------------------- +11 a a% +11 mn 61090909090909090909090909090909 +11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +11 sp -------------------------------- +12 a c% +12 mn 63090909090909090909090909090909 +12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 61610909090909090909090909090909 +16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +16 sp -------------------------------- +17 a cc_ +17 mn 63630909090909090909090909090909 +17 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +17 sp -------------------------------- +18 a ch_ +18 mn 63680909090909090909090909090909 +18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +18 sp -------------------------------- +19 a aa% +19 mn 61610909090909090909090909090909 +19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +19 sp -------------------------------- +20 a cc% +20 mn 63630909090909090909090909090909 +20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +20 sp -------------------------------- +21 a ch% +21 mn 63680909090909090909090909090909 +21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61616109090909090909090909090909 +25 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +25 sp -------------------------------- +26 a ccc_ +26 mn 63636309090909090909090909090909 +26 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +26 sp -------------------------------- +27 a cch_ +27 mn 63636809090909090909090909090909 +27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +27 sp -------------------------------- +28 a aaa% +28 mn 61616109090909090909090909090909 +28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +28 sp -------------------------------- +29 a ccc% +29 mn 63636309090909090909090909090909 +29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +29 sp -------------------------------- +30 a cch% +30 mn 63636809090909090909090909090909 +30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 6161616161 +31 mx 6161616161 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_czech_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 09090909090909090909090909090909 +2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +2 sp -------------------------------- +3 a % +3 mn 09090909090909090909090909090909 +3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 61090909090909090909090909090909 +9 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +9 sp -------------------------------- +10 a c_ +10 mn 09090909090909090909090909090909 +10 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +10 sp -------------------------------- +11 a a% +11 mn 61090909090909090909090909090909 +11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +11 sp -------------------------------- +12 a c% +12 mn 09090909090909090909090909090909 +12 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 61610909090909090909090909090909 +16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +16 sp -------------------------------- +17 a cc_ +17 mn 63090909090909090909090909090909 +17 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +17 sp -------------------------------- +18 a ch_ +18 mn 63680909090909090909090909090909 +18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +18 sp -------------------------------- +19 a aa% +19 mn 61610909090909090909090909090909 +19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +19 sp -------------------------------- +20 a cc% +20 mn 63090909090909090909090909090909 +20 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +20 sp -------------------------------- +21 a ch% +21 mn 63680909090909090909090909090909 +21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61616109090909090909090909090909 +25 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +25 sp -------------------------------- +26 a ccc_ +26 mn 63630909090909090909090909090909 +26 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +26 sp -------------------------------- +27 a cch_ +27 mn 63636809090909090909090909090909 +27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +27 sp -------------------------------- +28 a aaa% +28 mn 61616109090909090909090909090909 +28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20 +28 sp -------------------------------- +29 a ccc% +29 mn 63630909090909090909090909090909 +29 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +29 sp -------------------------------- +30 a cch% +30 mn 63636809090909090909090909090909 +30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 6161616161 +31 mx 6161616161 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 09090909090909090909090909090909 +2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +2 sp -------------------------------- +3 a % +3 mn 09090909090909090909090909090909 +3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +3 sp -------------------------------- +4 a \_ +4 mn 5F +4 mx 5F +4 sp -------------------------------- +5 a \% +5 mn 25 +5 mx 25 +5 sp -------------------------------- +6 a \ +6 mn 5C +6 mx 5C +6 sp -------------------------------- +7 a a +7 mn 61 +7 mx 61 +7 sp -------------------------------- +8 a c +8 mn 63 +8 mx 63 +8 sp -------------------------------- +9 a a_ +9 mn 09090909090909090909090909090909 +9 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +9 sp -------------------------------- +10 a c_ +10 mn 63090909090909090909090909090909 +10 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +10 sp -------------------------------- +11 a a% +11 mn 09090909090909090909090909090909 +11 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20 +11 sp -------------------------------- +12 a c% +12 mn 63090909090909090909090909090909 +12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF +12 sp -------------------------------- +13 a aa +13 mn 6161 +13 mx 6161 +13 sp -------------------------------- +14 a cc +14 mn 6363 +14 mx 6363 +14 sp -------------------------------- +15 a ch +15 mn 6368 +15 mx 6368 +15 sp -------------------------------- +16 a aa_ +16 mn 61610909090909090909090909090909 +16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +16 sp -------------------------------- +17 a cc_ +17 mn 63630909090909090909090909090909 +17 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +17 sp -------------------------------- +18 a ch_ +18 mn 63680909090909090909090909090909 +18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +18 sp -------------------------------- +19 a aa% +19 mn 61610909090909090909090909090909 +19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +19 sp -------------------------------- +20 a cc% +20 mn 63630909090909090909090909090909 +20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020 +20 sp -------------------------------- +21 a ch% +21 mn 63680909090909090909090909090909 +21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020 +21 sp -------------------------------- +22 a aaa +22 mn 616161 +22 mx 616161 +22 sp -------------------------------- +23 a ccc +23 mn 636363 +23 mx 636363 +23 sp -------------------------------- +24 a cch +24 mn 636368 +24 mx 636368 +24 sp -------------------------------- +25 a aaa_ +25 mn 61610909090909090909090909090909 +25 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +25 sp -------------------------------- +26 a ccc_ +26 mn 63636309090909090909090909090909 +26 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +26 sp -------------------------------- +27 a cch_ +27 mn 63636809090909090909090909090909 +27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +27 sp -------------------------------- +28 a aaa% +28 mn 61610909090909090909090909090909 +28 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020 +28 sp -------------------------------- +29 a ccc% +29 mn 63636309090909090909090909090909 +29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20 +29 sp -------------------------------- +30 a cch% +30 mn 63636809090909090909090909090909 +30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20 +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 61616161090909090909090909090909 +31 mx 61616161EFBFBFEFBFBFEFBFBFEFBFBF +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0000 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00000000000000000000000000000000 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610000 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630000 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00610000000000000000000000000000 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630000000000000000000000000000 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610000 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630000 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680000 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000000000000000000000000 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000000000000000000000000 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000000000000000000000000 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610000 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630000 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680000 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100000000000000000000 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300000000000000000000 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800000000000000000000 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00610061006100610061006100610061 +31 mx 00610061006100610061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610009 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630009 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00610009000900090009000900090009 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630009000900090009000900090009 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630009 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000900090009000900090009 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610009 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630009 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100090009000900090009 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300090009000900090009 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00610061006100610061006100610061 +31 mx 00610061006100610061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_czech_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610009 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00090009000900090009000900090009 +10 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +10 sp -------------------------------- +11 a a% +11 mn 00610009000900090009000900090009 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00090009000900090009000900090009 +12 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 00630009000900090009000900090009 +17 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630009000900090009000900090009 +20 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610009 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 00630063000900090009000900090009 +26 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100090009000900090009 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063000900090009000900090009 +29 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00610061006100610061006100610061 +31 mx 00610061006100610061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00090009000900090009000900090009 +9 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630009 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00090009000900090009000900090009 +11 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630009000900090009000900090009 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630009 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000900090009000900090009 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 00610061000900090009000900090009 +25 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630009 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061000900090009000900090009 +28 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300090009000900090009 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00610061006100610061006100610061 +31 mx 00610061006100610061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0000 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00000000000000000000000000000000 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610000 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630000 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00610000000000000000000000000000 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630000000000000000000000000000 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610000 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630000 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680000 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000000000000000000000000 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000000000000000000000000 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000000000000000000000000 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610000 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630000 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680000 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100000000000000000000 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300000000000000000000 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800000000000000000000 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 0061006100610061 +31 mx 0061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610009 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630009 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00610009000900090009000900090009 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630009000900090009000900090009 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630009 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000900090009000900090009 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610009 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630009 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100090009000900090009 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300090009000900090009 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 0061006100610061 +31 mx 0061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_czech_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00610009 +9 mx 0061FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00090009000900090009000900090009 +10 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +10 sp -------------------------------- +11 a a% +11 mn 00610009000900090009000900090009 +11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00090009000900090009000900090009 +12 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 00630009000900090009000900090009 +17 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630009000900090009000900090009 +20 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 0061006100610009 +25 mx 006100610061FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 00630063000900090009000900090009 +26 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061006100090009000900090009 +28 mx 006100610061FFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063000900090009000900090009 +29 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 0061006100610061 +31 mx 0061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 0009 +2 mx FFFF +2 sp -------------------------------- +3 a % +3 mn 00090009000900090009000900090009 +3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +3 sp -------------------------------- +4 a \_ +4 mn 005F +4 mx 005F +4 sp -------------------------------- +5 a \% +5 mn 0025 +5 mx 0025 +5 sp -------------------------------- +6 a \ +6 mn 005C +6 mx 005C +6 sp -------------------------------- +7 a a +7 mn 0061 +7 mx 0061 +7 sp -------------------------------- +8 a c +8 mn 0063 +8 mx 0063 +8 sp -------------------------------- +9 a a_ +9 mn 00090009000900090009000900090009 +9 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +9 sp -------------------------------- +10 a c_ +10 mn 00630009 +10 mx 0063FFFF +10 sp -------------------------------- +11 a a% +11 mn 00090009000900090009000900090009 +11 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +11 sp -------------------------------- +12 a c% +12 mn 00630009000900090009000900090009 +12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF +12 sp -------------------------------- +13 a aa +13 mn 00610061 +13 mx 00610061 +13 sp -------------------------------- +14 a cc +14 mn 00630063 +14 mx 00630063 +14 sp -------------------------------- +15 a ch +15 mn 00630068 +15 mx 00630068 +15 sp -------------------------------- +16 a aa_ +16 mn 006100610009 +16 mx 00610061FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 006300630009 +17 mx 00630063FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 006300680009 +18 mx 00630068FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00610061000900090009000900090009 +19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +19 sp -------------------------------- +20 a cc% +20 mn 00630063000900090009000900090009 +20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF +20 sp -------------------------------- +21 a ch% +21 mn 00630068000900090009000900090009 +21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF +21 sp -------------------------------- +22 a aaa +22 mn 006100610061 +22 mx 006100610061 +22 sp -------------------------------- +23 a ccc +23 mn 006300630063 +23 mx 006300630063 +23 sp -------------------------------- +24 a cch +24 mn 006300630068 +24 mx 006300630068 +24 sp -------------------------------- +25 a aaa_ +25 mn 00610061000900090009000900090009 +25 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 0063006300630009 +26 mx 006300630063FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 0063006300680009 +27 mx 006300630068FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00610061000900090009000900090009 +28 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00630063006300090009000900090009 +29 mx 006300630063FFFFFFFFFFFFFFFFFFFF +29 sp -------------------------------- +30 a cch% +30 mn 00630063006800090009000900090009 +30 mx 006300630068FFFFFFFFFFFFFFFFFFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 0061006100610061 +31 mx 0061006100610061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00000000 +2 mx 0000FFFF +2 sp -------------------------------- +3 a % +3 mn 00000000000000000000000000000000 +3 mx 0000FFFF0000FFFF0000FFFF0000FFFF +3 sp -------------------------------- +4 a \_ +4 mn 0000005F +4 mx 0000005F +4 sp -------------------------------- +5 a \% +5 mn 00000025 +5 mx 00000025 +5 sp -------------------------------- +6 a \ +6 mn 0000005C +6 mx 0000005C +6 sp -------------------------------- +7 a a +7 mn 00000061 +7 mx 00000061 +7 sp -------------------------------- +8 a c +8 mn 00000063 +8 mx 00000063 +8 sp -------------------------------- +9 a a_ +9 mn 0000006100000000 +9 mx 000000610000FFFF +9 sp -------------------------------- +10 a c_ +10 mn 0000006300000000 +10 mx 000000630000FFFF +10 sp -------------------------------- +11 a a% +11 mn 00000061000000000000000000000000 +11 mx 000000610000FFFF0000FFFF0000FFFF +11 sp -------------------------------- +12 a c% +12 mn 00000063000000000000000000000000 +12 mx 000000630000FFFF0000FFFF0000FFFF +12 sp -------------------------------- +13 a aa +13 mn 0000006100000061 +13 mx 0000006100000061 +13 sp -------------------------------- +14 a cc +14 mn 0000006300000063 +14 mx 0000006300000063 +14 sp -------------------------------- +15 a ch +15 mn 0000006300000068 +15 mx 0000006300000068 +15 sp -------------------------------- +16 a aa_ +16 mn 000000610000006100000000 +16 mx 00000061000000610000FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 000000630000006300000000 +17 mx 00000063000000630000FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 000000630000006800000000 +18 mx 00000063000000680000FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00000061000000610000000000000000 +19 mx 00000061000000610000FFFF0000FFFF +19 sp -------------------------------- +20 a cc% +20 mn 00000063000000630000000000000000 +20 mx 00000063000000630000FFFF0000FFFF +20 sp -------------------------------- +21 a ch% +21 mn 00000063000000680000000000000000 +21 mx 00000063000000680000FFFF0000FFFF +21 sp -------------------------------- +22 a aaa +22 mn 000000610000006100000061 +22 mx 000000610000006100000061 +22 sp -------------------------------- +23 a ccc +23 mn 000000630000006300000063 +23 mx 000000630000006300000063 +23 sp -------------------------------- +24 a cch +24 mn 000000630000006300000068 +24 mx 000000630000006300000068 +24 sp -------------------------------- +25 a aaa_ +25 mn 00000061000000610000006100000000 +25 mx 0000006100000061000000610000FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 00000063000000630000006300000000 +26 mx 0000006300000063000000630000FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 00000063000000630000006800000000 +27 mx 0000006300000063000000680000FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00000061000000610000006100000000 +28 mx 0000006100000061000000610000FFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00000063000000630000006300000000 +29 mx 0000006300000063000000630000FFFF +29 sp -------------------------------- +30 a cch% +30 mn 00000063000000630000006800000000 +30 mx 0000006300000063000000680000FFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00000061000000610000006100000061 +31 mx 00000061000000610000006100000061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00000009 +2 mx 0000FFFF +2 sp -------------------------------- +3 a % +3 mn 00000009000000090000000900000009 +3 mx 0000FFFF0000FFFF0000FFFF0000FFFF +3 sp -------------------------------- +4 a \_ +4 mn 0000005F +4 mx 0000005F +4 sp -------------------------------- +5 a \% +5 mn 00000025 +5 mx 00000025 +5 sp -------------------------------- +6 a \ +6 mn 0000005C +6 mx 0000005C +6 sp -------------------------------- +7 a a +7 mn 00000061 +7 mx 00000061 +7 sp -------------------------------- +8 a c +8 mn 00000063 +8 mx 00000063 +8 sp -------------------------------- +9 a a_ +9 mn 0000006100000009 +9 mx 000000610000FFFF +9 sp -------------------------------- +10 a c_ +10 mn 0000006300000009 +10 mx 000000630000FFFF +10 sp -------------------------------- +11 a a% +11 mn 00000061000000090000000900000009 +11 mx 000000610000FFFF0000FFFF0000FFFF +11 sp -------------------------------- +12 a c% +12 mn 00000063000000090000000900000009 +12 mx 000000630000FFFF0000FFFF0000FFFF +12 sp -------------------------------- +13 a aa +13 mn 0000006100000061 +13 mx 0000006100000061 +13 sp -------------------------------- +14 a cc +14 mn 0000006300000063 +14 mx 0000006300000063 +14 sp -------------------------------- +15 a ch +15 mn 0000006300000068 +15 mx 0000006300000068 +15 sp -------------------------------- +16 a aa_ +16 mn 000000610000006100000009 +16 mx 00000061000000610000FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 000000630000006300000009 +17 mx 00000063000000630000FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 000000630000006800000009 +18 mx 00000063000000680000FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00000061000000610000000900000009 +19 mx 00000061000000610000FFFF0000FFFF +19 sp -------------------------------- +20 a cc% +20 mn 00000063000000630000000900000009 +20 mx 00000063000000630000FFFF0000FFFF +20 sp -------------------------------- +21 a ch% +21 mn 00000063000000680000000900000009 +21 mx 00000063000000680000FFFF0000FFFF +21 sp -------------------------------- +22 a aaa +22 mn 000000610000006100000061 +22 mx 000000610000006100000061 +22 sp -------------------------------- +23 a ccc +23 mn 000000630000006300000063 +23 mx 000000630000006300000063 +23 sp -------------------------------- +24 a cch +24 mn 000000630000006300000068 +24 mx 000000630000006300000068 +24 sp -------------------------------- +25 a aaa_ +25 mn 00000061000000610000006100000009 +25 mx 0000006100000061000000610000FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 00000063000000630000006300000009 +26 mx 0000006300000063000000630000FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 00000063000000630000006800000009 +27 mx 0000006300000063000000680000FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00000061000000610000006100000009 +28 mx 0000006100000061000000610000FFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00000063000000630000006300000009 +29 mx 0000006300000063000000630000FFFF +29 sp -------------------------------- +30 a cch% +30 mn 00000063000000630000006800000009 +30 mx 0000006300000063000000680000FFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00000061000000610000006100000061 +31 mx 00000061000000610000006100000061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_czech_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00000009 +2 mx 0000FFFF +2 sp -------------------------------- +3 a % +3 mn 00000009000000090000000900000009 +3 mx 0000FFFF0000FFFF0000FFFF0000FFFF +3 sp -------------------------------- +4 a \_ +4 mn 0000005F +4 mx 0000005F +4 sp -------------------------------- +5 a \% +5 mn 00000025 +5 mx 00000025 +5 sp -------------------------------- +6 a \ +6 mn 0000005C +6 mx 0000005C +6 sp -------------------------------- +7 a a +7 mn 00000061 +7 mx 00000061 +7 sp -------------------------------- +8 a c +8 mn 00000063 +8 mx 00000063 +8 sp -------------------------------- +9 a a_ +9 mn 0000006100000009 +9 mx 000000610000FFFF +9 sp -------------------------------- +10 a c_ +10 mn 00000009000000090000000900000009 +10 mx 0000FFFF0000FFFF0000FFFF0000FFFF +10 sp -------------------------------- +11 a a% +11 mn 00000061000000090000000900000009 +11 mx 000000610000FFFF0000FFFF0000FFFF +11 sp -------------------------------- +12 a c% +12 mn 00000009000000090000000900000009 +12 mx 0000FFFF0000FFFF0000FFFF0000FFFF +12 sp -------------------------------- +13 a aa +13 mn 0000006100000061 +13 mx 0000006100000061 +13 sp -------------------------------- +14 a cc +14 mn 0000006300000063 +14 mx 0000006300000063 +14 sp -------------------------------- +15 a ch +15 mn 0000006300000068 +15 mx 0000006300000068 +15 sp -------------------------------- +16 a aa_ +16 mn 000000610000006100000009 +16 mx 00000061000000610000FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 00000063000000090000000900000009 +17 mx 000000630000FFFF0000FFFF0000FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 000000630000006800000009 +18 mx 00000063000000680000FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00000061000000610000000900000009 +19 mx 00000061000000610000FFFF0000FFFF +19 sp -------------------------------- +20 a cc% +20 mn 00000063000000090000000900000009 +20 mx 000000630000FFFF0000FFFF0000FFFF +20 sp -------------------------------- +21 a ch% +21 mn 00000063000000680000000900000009 +21 mx 00000063000000680000FFFF0000FFFF +21 sp -------------------------------- +22 a aaa +22 mn 000000610000006100000061 +22 mx 000000610000006100000061 +22 sp -------------------------------- +23 a ccc +23 mn 000000630000006300000063 +23 mx 000000630000006300000063 +23 sp -------------------------------- +24 a cch +24 mn 000000630000006300000068 +24 mx 000000630000006300000068 +24 sp -------------------------------- +25 a aaa_ +25 mn 00000061000000610000006100000009 +25 mx 0000006100000061000000610000FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 00000063000000630000000900000009 +26 mx 00000063000000630000FFFF0000FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 00000063000000630000006800000009 +27 mx 0000006300000063000000680000FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00000061000000610000006100000009 +28 mx 0000006100000061000000610000FFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00000063000000630000000900000009 +29 mx 00000063000000630000FFFF0000FFFF +29 sp -------------------------------- +30 a cch% +30 mn 00000063000000630000006800000009 +30 mx 0000006300000063000000680000FFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00000061000000610000006100000061 +31 mx 00000061000000610000006100000061 +31 sp -------------------------------- +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci; +SELECT * FROM v1; +id name val +1 a +1 mn +1 mx +1 sp -------------------------------- +2 a _ +2 mn 00000009 +2 mx 0000FFFF +2 sp -------------------------------- +3 a % +3 mn 00000009000000090000000900000009 +3 mx 0000FFFF0000FFFF0000FFFF0000FFFF +3 sp -------------------------------- +4 a \_ +4 mn 0000005F +4 mx 0000005F +4 sp -------------------------------- +5 a \% +5 mn 00000025 +5 mx 00000025 +5 sp -------------------------------- +6 a \ +6 mn 0000005C +6 mx 0000005C +6 sp -------------------------------- +7 a a +7 mn 00000061 +7 mx 00000061 +7 sp -------------------------------- +8 a c +8 mn 00000063 +8 mx 00000063 +8 sp -------------------------------- +9 a a_ +9 mn 00000009000000090000000900000009 +9 mx 0000FFFF0000FFFF0000FFFF0000FFFF +9 sp -------------------------------- +10 a c_ +10 mn 0000006300000009 +10 mx 000000630000FFFF +10 sp -------------------------------- +11 a a% +11 mn 00000009000000090000000900000009 +11 mx 0000FFFF0000FFFF0000FFFF0000FFFF +11 sp -------------------------------- +12 a c% +12 mn 00000063000000090000000900000009 +12 mx 000000630000FFFF0000FFFF0000FFFF +12 sp -------------------------------- +13 a aa +13 mn 0000006100000061 +13 mx 0000006100000061 +13 sp -------------------------------- +14 a cc +14 mn 0000006300000063 +14 mx 0000006300000063 +14 sp -------------------------------- +15 a ch +15 mn 0000006300000068 +15 mx 0000006300000068 +15 sp -------------------------------- +16 a aa_ +16 mn 000000610000006100000009 +16 mx 00000061000000610000FFFF +16 sp -------------------------------- +17 a cc_ +17 mn 000000630000006300000009 +17 mx 00000063000000630000FFFF +17 sp -------------------------------- +18 a ch_ +18 mn 000000630000006800000009 +18 mx 00000063000000680000FFFF +18 sp -------------------------------- +19 a aa% +19 mn 00000061000000610000000900000009 +19 mx 00000061000000610000FFFF0000FFFF +19 sp -------------------------------- +20 a cc% +20 mn 00000063000000630000000900000009 +20 mx 00000063000000630000FFFF0000FFFF +20 sp -------------------------------- +21 a ch% +21 mn 00000063000000680000000900000009 +21 mx 00000063000000680000FFFF0000FFFF +21 sp -------------------------------- +22 a aaa +22 mn 000000610000006100000061 +22 mx 000000610000006100000061 +22 sp -------------------------------- +23 a ccc +23 mn 000000630000006300000063 +23 mx 000000630000006300000063 +23 sp -------------------------------- +24 a cch +24 mn 000000630000006300000068 +24 mx 000000630000006300000068 +24 sp -------------------------------- +25 a aaa_ +25 mn 00000061000000610000000900000009 +25 mx 00000061000000610000FFFF0000FFFF +25 sp -------------------------------- +26 a ccc_ +26 mn 00000063000000630000006300000009 +26 mx 0000006300000063000000630000FFFF +26 sp -------------------------------- +27 a cch_ +27 mn 00000063000000630000006800000009 +27 mx 0000006300000063000000680000FFFF +27 sp -------------------------------- +28 a aaa% +28 mn 00000061000000610000000900000009 +28 mx 00000061000000610000FFFF0000FFFF +28 sp -------------------------------- +29 a ccc% +29 mn 00000063000000630000006300000009 +29 mx 0000006300000063000000630000FFFF +29 sp -------------------------------- +30 a cch% +30 mn 00000063000000630000006800000009 +30 mx 0000006300000063000000680000FFFF +30 sp -------------------------------- +31 a aaaaaaaaaaaaaaaaaaaa +31 mn 00000061000000610000006100000061 +31 mx 00000061000000610000006100000061 +31 sp -------------------------------- +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index 4730b4df668..0b061f507a7 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -1684,6 +1684,9 @@ ARMENIAN CAPIT ECH 2 ARMENIAN CAPIT ZA 2 DROP TABLE t1; # +# Start of 5.5 tests +# +# # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32 # Testing that only utf8mb4 is superset for utf8 # No other Unicode character set pairs have superset/subset relations @@ -1739,3 +1742,22 @@ ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8mb4_ SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1; ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat' DROP TABLE t1; +# +# Bug#58321 No warning when characters outside BMP0 is converted to UCS2 +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET ucs2); +INSERT INTO t1 VALUES (0x10082), (0x12345); +INSERT INTO t2 SELECT * FROM t1; +Warnings: +Warning 1366 Incorrect string value: '\x00\x01\x00\x82' for column 'a' at row 1 +Warning 1366 Incorrect string value: '\x00\x01\x23\x45' for column 'a' at row 2 +SELECT HEX(a) FROM t2; +HEX(a) +003F +003F +DROP TABLE t1; +DROP TABLE t2; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 04727f84ff2..7b9023578b3 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2888,3 +2888,101 @@ a hex(b) c DROP TABLE t1; set names utf8; End for 5.0 tests +# +# Start of 5.5 tests +# +SET collation_connection=utf8_czech_ci; +SELECT @@collation_connection; +@@collation_connection +utf8_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +utf8_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +61000000000009 +61 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +61000000000009 +61 +DROP TABLE t1; +SET collation_connection=ucs2_czech_ci; +SELECT @@collation_connection; +@@collation_connection +ucs2_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +ucs2_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +DROP TABLE t1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result index d83ef2af09e..18adaf2f79c 100644 --- a/mysql-test/r/ctype_utf16_uca.result +++ b/mysql-test/r/ctype_utf16_uca.result @@ -2368,6 +2368,52 @@ NULL NULL NULL drop table t1; +SET collation_connection=utf16_czech_ci; +SELECT @@collation_connection; +@@collation_connection +utf16_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +utf16_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +DROP TABLE t1; # # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result index 5006009fc9c..fd5a4199217 100644 --- a/mysql-test/r/ctype_utf32_uca.result +++ b/mysql-test/r/ctype_utf32_uca.result @@ -2368,6 +2368,52 @@ NULL NULL NULL drop table t1; +SET collation_connection=utf32_czech_ci; +SELECT @@collation_connection; +@@collation_connection +utf32_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +utf32_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +00000061000000000000000000000000000000000000000000000009 +00000061 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +00000061000000000000000000000000000000000000000000000009 +00000061 +DROP TABLE t1; # # End of 5.5 tests # diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 53cd89c13c1..a86eabc3192 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -400,4 +400,30 @@ SELECT 0 FROM (SELECT 0) t61; 0 0 +# +# A nested materialized derived table is used before being populated. +# (addon for bug#19077) +# +CREATE TABLE t1 (i INT, j BIGINT); +INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); +SELECT * FROM (SELECT MIN(i) FROM t1 +WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3; +MIN(i) +1 +DROP TABLE t1; # End of 5.0 tests +# +# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table, +# temptable views +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT, KEY (b)); +INSERT INTO t1 VALUES (1),(1); +INSERT INTO t2 VALUES (1),(1); +CREATE algorithm=temptable VIEW v1 AS +SELECT 1 FROM t1 LEFT JOIN t1 t3 ON 1 > (SELECT 1 FROM t1); +CREATE algorithm=temptable VIEW v2 AS SELECT 1 FROM t2; +EXPLAIN SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2); +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1, t2; +DROP VIEW v1, v2; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 7788a32ac90..8c66156152e 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -663,6 +663,9 @@ ON (MATCH(t1.f1) against ("")) WHERE t1.f1 GROUP BY t1.f1)) xor f1; 1 1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'test' +Warning 1292 Truncated incorrect INTEGER value: 'test' PREPARE stmt FROM 'SELECT 1 FROM t1 WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a @@ -671,9 +674,15 @@ PREPARE stmt FROM EXECUTE stmt; 1 1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'test' +Warning 1292 Truncated incorrect INTEGER value: 'test' EXECUTE stmt; 1 1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'test' +Warning 1292 Truncated incorrect INTEGER value: 'test' DEALLOCATE PREPARE stmt; PREPARE stmt FROM 'SELECT 1 FROM t1 WHERE 1 > diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 69be0107b8f..01b93df6894 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1046,6 +1046,18 @@ INSERT INTO t1 values (0),(0); SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d)); ERROR 22007: Illegal non geometric '(select 1 from (select (1 = group_concat(`test`.`t1`.`f1` separator ',')) AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `t`.`f1`) `d`)' value found during parsing DROP TABLE t1; +# +# Bug#58396 group_concat and explain extended are still crashy +# +CREATE TABLE t1(a INT); +EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1') +FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1); +ERROR HY000: Only constant XPATH queries are supported +SHOW WARNINGS; +Level Code Message +Error 1105 Only constant XPATH queries are supported +Note 1003 select updatexml('1',`test`.`t1`.`a`,'1') AS `UPDATEXML('1', a, '1')` from `test`.`t1` order by (select group_concat(1 separator ',') from `test`.`t1`) +DROP TABLE t1; End of 5.1 tests DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a VARCHAR(6), b INT); diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 5f874f4665d..bc295ec7b44 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1746,3 +1746,18 @@ MAX(c1) MIN(c1) -00:00:01 -00:00:01 DROP TABLE t1; # End of the bug#56120 +# +# Bug#57932 "query with AVG(DISTINCT) returns NULL if last +# aggregated value was NULL" +# +CREATE TABLE t1 (col_int_nokey int(11)); +INSERT INTO t1 VALUES (7),(8),(NULL); +SELECT AVG(DISTINCT col_int_nokey) FROM t1; +AVG(DISTINCT col_int_nokey) +7.5000 +SELECT AVG(DISTINCT outr.col_int_nokey) FROM t1 AS outr LEFT JOIN t1 AS outr2 ON +outr.col_int_nokey = outr2.col_int_nokey; +AVG(DISTINCT outr.col_int_nokey) +7.5000 +DROP TABLE t1; +# End of the bug#57932 diff --git a/mysql-test/r/func_group_innodb.result b/mysql-test/r/func_group_innodb.result index 908e85c1652..8412317c91d 100644 --- a/mysql-test/r/func_group_innodb.result +++ b/mysql-test/r/func_group_innodb.result @@ -145,3 +145,50 @@ select count(*), min(7), max(7) from t2m, t1i; count(*) min(7) max(7) 0 NULL NULL drop table t1m, t1i, t2m, t2i; +# +# Bug #57954: BIT_AND function returns incorrect results when +# semijoin=on +CREATE TABLE c ( +pk INT, +col_varchar_key VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +) ENGINE=InnoDB; +INSERT INTO c VALUES (11,NULL); +INSERT INTO c VALUES (16,'c'); +CREATE TABLE bb ( +pk INT, +col_varchar_key VARCHAR(1), +PRIMARY KEY (pk), +KEY col_varchar_key (col_varchar_key) +) ENGINE=InnoDB; +INSERT INTO bb VALUES (10,NULL); +SELECT straight_join BIT_AND(c.pk) +FROM +bb, c +WHERE c.col_varchar_key='ABC' +ORDER BY c.pk; +BIT_AND(c.pk) +18446744073709551615 +DROP TABLE c,bb; +# +# Bug #58050: BIT_OR and BIT_XOR return incorrect results when +# semijoin=on +# +CREATE TABLE t1 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1, 1, 1); +CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1, 1, NULL); +SELECT t1.* FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; +pk b c +SELECT BIT_OR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; +BIT_OR(t1.b) +0 +SELECT BIT_AND(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; +BIT_AND(t1.b) +18446744073709551615 +SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; +BIT_XOR(t1.b) +0 +DROP TABLE t1, t2; +End of 5.5 tests diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 068ab343c89..c9552d9e39f 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -351,6 +351,12 @@ GREATEST(a, (SELECT b FROM t1 LIMIT 1)) 3 1 DROP TABLE t1; +SELECT INET_NTOA(0); +INET_NTOA(0) +0.0.0.0 +SELECT '1' IN ('1', INET_NTOA(0)); +'1' IN ('1', INET_NTOA(0)) +1 # # Bug #52165: Assertion failed: file .\dtoa.c, line 465 # diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index f01d46a9f41..41fe9c096b0 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2603,6 +2603,18 @@ ORDER BY QUOTE(t1.a); 1 1 DROP TABLE t1; +# +# Bug#57913 large negative number to string conversion functions crash +# Bug#57810 case/when/then : Assertion failed: length || !scale +# +SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1)); +'1' IN ('1', SUBSTRING(-9223372036854775809, 1)) +1 +SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); +CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)) +1 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '' End of 5.1 tests Start of 5.4 tests SELECT format(12345678901234567890.123, 3); diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index 99e1f54e762..1a8ef2deefd 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -430,6 +430,8 @@ SELECT table_name, table_comment FROM information_schema.tables WHERE table_schema= 'test' AND table_name= 't1'; table_name table_comment t1 Lock wait timeout exceeded; try restarting transaction +Warnings: +Warning 1205 Lock wait timeout exceeded; try restarting transaction # Connection default UNLOCK TABLES; # Connection con3 diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index 594cf433692..b2e71faf741 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -2322,6 +2322,8 @@ select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t2'; table_name table_type auto_increment table_comment t2 BASE TABLE NULL Table 'test'.'t2' was skipped since its definition is being modified by concurrent DDL statement +Warnings: +Warning 1684 Table 'test'.'t2' was skipped since its definition is being modified by concurrent DDL statement # Switching to connection 'default'. unlock tables; # Switching to connection 'con46044'. diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index ace834a26c2..f668761cb16 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2084,6 +2084,8 @@ SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' and TABLE_NAME='tm1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT def test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +Warnings: +Warning 1168 Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE tm1; CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 07a92e2abf0..e36bef1f338 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -669,4 +669,15 @@ Error 1242 Subquery returns more than 1 row Error 1242 Subquery returns more than 1 row DROP TABLE t1, t2, t3; SET SESSION sql_safe_updates = DEFAULT; +# +# Bug#52157 various crashes and assertions with multi-table update, stored function +# +CREATE FUNCTION f1 () RETURNS BLOB RETURN 1; +CREATE TABLE t1 (f1 DATE); +INSERT INTO t1 VALUES('2001-01-01'); +UPDATE (SELECT 1 FROM t1 WHERE f1 = (SELECT f1() FROM t1)) x, t1 SET f1 = 1; +Warnings: +Warning 1292 Truncated incorrect datetime value: '1' +DROP FUNCTION f1; +DROP TABLE t1; end of tests diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 3c53faff526..9923ba03b3d 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -433,4 +433,73 @@ Bug #47147: mysql client option --skip-column-names does not apply to vertical o *************************** 1. row *************************** 1 +# +# Bug #54899: --one-database option cannot handle DROP/CREATE DATABASE +# commands. +# +CREATE DATABASE connected_db; +USE connected_db; +SHOW TABLES; +Tables_in_connected_db +table_in_connected_db +DROP DATABASE connected_db; + +# +# Testing --one-database option +# +CREATE DATABASE connected_db; +SHOW TABLES IN connected_db; +Tables_in_connected_db +t1 +SHOW TABLES IN test; +Tables_in_test +t1 +USE test; +DROP TABLE t1; +DROP DATABASE connected_db; + +SHOW TABLES IN test; +Tables_in_test +SHOW TABLES IN test1; +Tables_in_test1 +DROP DATABASE test1; + +# +# Checking --one-database option followed by the execution of +# connect command. +# +CREATE DATABASE connected_db; +SHOW TABLES IN connected_db; +Tables_in_connected_db +t1 +t2 +SHOW TABLES IN test; +Tables_in_test +t1 +t2 +DROP TABLE test.t1; +DROP TABLE test.t2; +DROP DATABASE connected_db; + +# +# Checking --one-database option with no database specified +# at command-line. +# +SHOW TABLES IN test; +Tables_in_test + +# +# Checking --one-database option with non_existent_db +# specified with USE command +# +CREATE DATABASE connected_db; +SHOW TABLES IN connected_db; +Tables_in_connected_db +table_in_connected_db + +SHOW TABLES IN connected_db; +Tables_in_connected_db +table_in_connected_db +DROP DATABASE connected_db; + End of tests diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index fc269e1dd82..60ba06c8f7e 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -32,10 +32,10 @@ The following options may be given as the first argument: file (Solves most 'table full' errors) --bind-address=name IP address to bind to. --binlog-cache-size=# - The size of the cache to hold the SQL statements for the - binary log during a transaction. If you often use big, - multi-statement transactions you can increase this to get - more performance + The size of the transactional cache for updates to + transactional engines for the binary log. If you often + use transactions containing many statements, you can + increase this to get more performance --binlog-direct-non-transactional-updates Causes updates to non-transactional engines using statement format to be written directly to binary log. @@ -66,6 +66,11 @@ The following options may be given as the first argument: The maximum size of a row-based binary log event in bytes. Rows will be grouped into events smaller than this size if possible. The value has to be a multiple of 256. + --binlog-stmt-cache-size=# + The size of the statement cache for updates to + non-transactional engines for the binary log. If you + often use statements updating a great number of rows, you + can increase this to get more performance --bootstrap Used by mysql installation scripts. --bulk-insert-buffer-size=# Size of tree cache used in bulk insert optimisation. Note @@ -278,14 +283,15 @@ The following options may be given as the first argument: --max-allowed-packet=# Max packet length to send to or receive from the server --max-binlog-cache-size=# - Can be used to restrict the total size used to cache a - multi-transaction query + Sets the total size of the transactional cache --max-binlog-dump-events=# Option used by mysql-test for debugging and testing of replication. --max-binlog-size=# Binary log will be rotated automatically when the size exceeds this value. Will also apply to relay logs if max_relay_log_size is 0 + --max-binlog-stmt-cache-size=# + Sets the total size of the statement cache --max-connect-errors=# If there is more than this number of interrupted connections from a host this host will be blocked from @@ -734,6 +740,7 @@ binlog-cache-size 32768 binlog-direct-non-transactional-updates FALSE binlog-format STATEMENT binlog-row-event-max-size 1024 +binlog-stmt-cache-size 32768 bulk-insert-buffer-size 8388608 character-set-client-handshake TRUE character-set-filesystem binary @@ -813,6 +820,7 @@ max-allowed-packet 1048576 max-binlog-cache-size 18446744073709547520 max-binlog-dump-events 0 max-binlog-size 1073741824 +max-binlog-stmt-cache-size 18446744073709547520 max-connect-errors 10 max-connections 151 max-delayed-threads 20 diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index c5d7bb458c3..dfb53937245 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -32,10 +32,10 @@ The following options may be given as the first argument: file (Solves most 'table full' errors) --bind-address=name IP address to bind to. --binlog-cache-size=# - The size of the cache to hold the SQL statements for the - binary log during a transaction. If you often use big, - multi-statement transactions you can increase this to get - more performance + The size of the transactional cache for updates to + transactional engines for the binary log. If you often + use transactions containing many statements, you can + increase this to get more performance --binlog-direct-non-transactional-updates Causes updates to non-transactional engines using statement format to be written directly to binary log. @@ -66,6 +66,11 @@ The following options may be given as the first argument: The maximum size of a row-based binary log event in bytes. Rows will be grouped into events smaller than this size if possible. The value has to be a multiple of 256. + --binlog-stmt-cache-size=# + The size of the statement cache for updates to + non-transactional engines for the binary log. If you + often use statements updating a great number of rows, you + can increase this to get more performance --bootstrap Used by mysql installation scripts. --bulk-insert-buffer-size=# Size of tree cache used in bulk insert optimisation. Note @@ -277,14 +282,15 @@ The following options may be given as the first argument: --max-allowed-packet=# Max packet length to send to or receive from the server --max-binlog-cache-size=# - Can be used to restrict the total size used to cache a - multi-transaction query + Sets the total size of the transactional cache --max-binlog-dump-events=# Option used by mysql-test for debugging and testing of replication. --max-binlog-size=# Binary log will be rotated automatically when the size exceeds this value. Will also apply to relay logs if max_relay_log_size is 0 + --max-binlog-stmt-cache-size=# + Sets the total size of the statement cache --max-connect-errors=# If there is more than this number of interrupted connections from a host this host will be blocked from @@ -738,6 +744,7 @@ binlog-cache-size 32768 binlog-direct-non-transactional-updates FALSE binlog-format STATEMENT binlog-row-event-max-size 1024 +binlog-stmt-cache-size 32768 bulk-insert-buffer-size 8388608 character-set-client-handshake TRUE character-set-filesystem binary @@ -816,6 +823,7 @@ max-allowed-packet 1048576 max-binlog-cache-size 18446744073709547520 max-binlog-dump-events 0 max-binlog-size 1073741824 +max-binlog-stmt-cache-size 18446744073709547520 max-connect-errors 10 max-connections 151 max-delayed-threads 20 diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index e24a6f07171..c3b6d22ef38 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -423,7 +423,10 @@ while with string, only once hello == hello hello == hello hello != goodbye +'quoted' == ''quoted'' two words +'two words' +"two words" two words are two words right answer anything goes @@ -431,6 +434,8 @@ anything goes mysqltest: At line 2: Only == and != are supported for string values mysqltest: At line 2: Found junk '~= 6' after $variable in condition mysqltest: At line 2: Expression in if/while must beging with $, ` or a number +mysqltest: At line 1: Missing right operand in comparison +mysqltest: At line 1: Missing right operand in comparison counter is 2 counter is 3 counter is 4 @@ -620,7 +625,7 @@ if things work as expected Some data for cat_file command of mysqltest -mysqltest: At line 1: command "cat_file" failed with error 1 +mysqltest: At line 1: command "cat_file" failed with error 1. (my_errno) mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists' mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file' diff --git a/mysql-test/r/partition_binlog.result b/mysql-test/r/partition_binlog.result new file mode 100644 index 00000000000..c8fa02c4b99 --- /dev/null +++ b/mysql-test/r/partition_binlog.result @@ -0,0 +1,49 @@ +DROP TABLE IF EXISTS t1; +# +# Bug#58147: ALTER TABLE w/ TRUNCATE PARTITION fails +# but the statement is written to binlog +# +CREATE TABLE t1(id INT) +PARTITION BY RANGE (id) +(PARTITION p0 VALUES LESS THAN (100), +PARTITION pmax VALUES LESS THAN (MAXVALUE)); +INSERT INTO t1 VALUES (1), (10), (100), (1000); +ALTER TABLE t1 TRUNCATE PARTITION p1; +ERROR HY000: Incorrect partition name +ALTER TABLE t1 DROP PARTITION p1; +ERROR HY000: Error in list of partitions to DROP +# No error returned, output in table format instead: +ALTER TABLE t1 ANALYZE PARTITION p1; +Table Op Msg_type Msg_text +test.t1 analyze error Error in list of partitions to test.t1 +ALTER TABLE t1 CHECK PARTITION p1; +Table Op Msg_type Msg_text +test.t1 check error Error in list of partitions to test.t1 +ALTER TABLE t1 OPTIMIZE PARTITION p1; +Table Op Msg_type Msg_text +test.t1 optimize error Error in list of partitions to test.t1 +ALTER TABLE t1 REPAIR PARTITION p1; +Table Op Msg_type Msg_text +test.t1 repair error Error in list of partitions to test.t1 +ALTER TABLE t1 ANALYZE PARTITION p0; +Table Op Msg_type Msg_text +test.t1 analyze status OK +ALTER TABLE t1 CHECK PARTITION p0; +Table Op Msg_type Msg_text +test.t1 check status OK +ALTER TABLE t1 OPTIMIZE PARTITION p0; +Table Op Msg_type Msg_text +test.t1 optimize status OK +ALTER TABLE t1 REPAIR PARTITION p0; +Table Op Msg_type Msg_text +test.t1 repair status OK +ALTER TABLE t1 TRUNCATE PARTITION p0; +ALTER TABLE t1 DROP PARTITION p0; +show binlog events in 'master-bin.000001' from <binlog_start>; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 ANALYZE PARTITION p0 +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 OPTIMIZE PARTITION p0 +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 REPAIR PARTITION p0 +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 TRUNCATE PARTITION p0 +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 DROP PARTITION p0 +DROP TABLE t1; diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 8a649f63598..b155b296ac1 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -318,4 +318,14 @@ Proxied_host Proxied_user With_grant 1 FLUSH PRIVILEGES; +# +# Bug#58139 : default-auth option not recognized in MySQL standardi +# command line clients +# +# Executing 'mysql' +1 +1 +# Executing 'mysqladmin' +mysqld is alive +# Executing 'mysqldump' End of 5.5 tests diff --git a/mysql-test/r/plugin_not_embedded.result b/mysql-test/r/plugin_not_embedded.result index 82cfe7b23b8..27553366660 100644 --- a/mysql-test/r/plugin_not_embedded.result +++ b/mysql-test/r/plugin_not_embedded.result @@ -8,3 +8,5 @@ ERROR 42000: DELETE command denied to user 'bug51770'@'localhost' for table 'plu GRANT DELETE ON mysql.plugin TO bug51770@localhost; UNINSTALL PLUGIN example; DROP USER bug51770@localhost; +INSTALL PLUGIN example SONAME '../ha_example.so'; +ERROR HY000: No paths allowed for shared library diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 5e41e6b29c6..d42cb680112 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -663,6 +663,8 @@ flush tables; 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 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm' +Warnings: +Warning 1033 Incorrect information in file: './test/t1.frm' show create table t1; ERROR HY000: Incorrect information in file: './test/t1.frm' drop table if exists t1; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index be81afe1a43..ee180169916 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1511,6 +1511,39 @@ SELECT @@skip_name_resolve; SHOW VARIABLES LIKE 'skip_name_resolve'; Variable_name Value skip_name_resolve OFF +# +# Bug #43233 : Some server variables are clipped during "update," +# not "check" stage +# +SET @kbs=@@global.key_buffer_size; +SET @kcbs=@@global.key_cache_block_size; +throw errors in STRICT mode +SET SQL_MODE=STRICT_ALL_TABLES; +SET @@global.max_binlog_cache_size=-1; +ERROR 42000: Variable 'max_binlog_cache_size' can't be set to the value of '-1' +SET @@global.max_join_size=0; +ERROR 42000: Variable 'max_join_size' can't be set to the value of '0' +SET @@global.key_buffer_size=0; +ERROR HY000: Cannot drop default keycache +SET @@global.key_cache_block_size=0; +ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0' +throw warnings in default mode +SET SQL_MODE=DEFAULT; +SET @@global.max_binlog_cache_size=-1; +Warnings: +Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1' +SET @@global.max_join_size=0; +Warnings: +Warning 1292 Truncated incorrect max_join_size value: '0' +SET @@global.key_buffer_size=0; +ERROR HY000: Cannot drop default keycache +SET @@global.key_cache_block_size=0; +Warnings: +Warning 1292 Truncated incorrect key_cache_block_size value: '0' +SET @@global.max_binlog_cache_size=DEFAULT; +SET @@global.max_join_size=DEFAULT; +SET @@global.key_buffer_size=@kbs; +SET @@global.key_cache_block_size=@kcbs; End of 5.1 tests # diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 777ac9c258f..fdeed10701d 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -840,6 +840,8 @@ 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 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +Warnings: +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them drop view v1; drop table t1; create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1; @@ -3997,6 +3999,19 @@ CREATE VIEW v1 AS SELECT 1 from t1 WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); DROP VIEW v1; DROP TABLE t1; +# +# Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846 +# +CREATE TABLE t1(a int); +CREATE VIEW v1 AS SELECT 1 FROM t1 GROUP BY +SUBSTRING(1 FROM (SELECT 3 FROM t1 WHERE a >= ANY(SELECT 1))); +DROP VIEW v1; +DROP TABLE t1; +# +# Bug#57352 valgrind warnings when creating view +# +CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; +DROP VIEW v1; # ----------------------------------------------------------------- # -- End of 5.1 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result index dc170361026..cdb72aad902 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_innodb.result @@ -123,7 +123,7 @@ Binlog_cache_disk_use 0 create table t1 (a int) engine=innodb; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 2 +Binlog_cache_use 1 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 @@ -132,7 +132,7 @@ delete from t1; commit; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 4 +Binlog_cache_use 2 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 diff --git a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result deleted file mode 100644 index 637be940383..00000000000 --- a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result +++ /dev/null @@ -1,25 +0,0 @@ -flush status; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 0 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 0 -drop table if exists t1; -create table t1 (a int) engine=innodb; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 2 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 4 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result b/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result new file mode 100644 index 00000000000..09cdab8414a --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result @@ -0,0 +1,66 @@ +drop table if exists t1, t2; +create table t1 (a int) engine=innodb; +create table t2 (a int) engine=myisam; +**** Preparing the enviroment to check commit and its effect on status variables. +**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +**** Transactional changes which are long enough so they will be flushed to disk... +**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +**** Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +commit; +**** Non-Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +commit; +**** Mixed changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +commit; +**** Preparing the enviroment to check abort and its effect on the status variables. +**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +**** Transactional changes which are long enough so they will be flushed to disk... +**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +**** Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +rollback; +**** Non-Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +**** Mixed changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +drop table t1, t2; diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index e45f4a76643..abb02164d91 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1218,8 +1218,8 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -insert delayed into t1 values (207); -insert delayed into t1 values (null); +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); +insert /*! delayed */ into t1 values (null); insert delayed into t1 values (300); FLUSH TABLES; show binlog events from <binlog_start>; @@ -1330,3 +1330,62 @@ Log_name Pos Event_type Server_id End_log_pos Info # # Write_rows 1 # table_id: # flags: STMT_END_F # # Query 1 # COMMIT DROP TABLE t1; + +# BUG#54903 BINLOG statement toggles session variables +# ---------------------------------------------------------------------- +# This test verify that BINLOG statement doesn't change current session's +# variables foreign_key_checks and unique_checks. + +CREATE TABLE t1 (c1 INT KEY); +SET @@SESSION.foreign_key_checks= ON; +SET @@SESSION.unique_checks= ON; +# INSERT INTO t1 VALUES (1) +# foreign_key_checks=0 and unique_checks=0 +BINLOG ' +dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== +'; +SELECT * FROM t1; +c1 +1 +# Their values should be ON +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks ON +unique_checks ON + +SET @@SESSION.foreign_key_checks= OFF; +SET @@SESSION.unique_checks= OFF; +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +# It should not change current session's variables, even error happens +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_row_cache_stat.result b/mysql-test/suite/binlog/r/binlog_row_cache_stat.result new file mode 100644 index 00000000000..09cdab8414a --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_row_cache_stat.result @@ -0,0 +1,66 @@ +drop table if exists t1, t2; +create table t1 (a int) engine=innodb; +create table t2 (a int) engine=myisam; +**** Preparing the enviroment to check commit and its effect on status variables. +**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +**** Transactional changes which are long enough so they will be flushed to disk... +**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +**** Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +commit; +**** Non-Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +commit; +**** Mixed changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +commit; +**** Preparing the enviroment to check abort and its effect on the status variables. +**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +**** Transactional changes which are long enough so they will be flushed to disk... +**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +**** Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +rollback; +**** Non-Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +**** Mixed changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +drop table t1, t2; diff --git a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result deleted file mode 100644 index 637be940383..00000000000 --- a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result +++ /dev/null @@ -1,25 +0,0 @@ -flush status; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 0 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 0 -drop table if exists t1; -create table t1 (a int) engine=innodb; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 2 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 4 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 2219961aca0..cdcc96b94b0 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -1,6 +1,6 @@ create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -insert delayed into t1 values (207); -insert delayed into t1 values (null); +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); +insert /*! delayed */ into t1 values (null); insert delayed into t1 values (300); FLUSH TABLES; show binlog events from <binlog_start>; @@ -10,14 +10,14 @@ master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207) +master-bin.000001 # Query # # use `test`; insert /* before delayed */ /* after delayed */ into t1 values (207) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=208 -master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null) +master-bin.000001 # Query # # use `test`; insert /*! */ into t1 values (null) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) +master-bin.000001 # Query # # use `test`; insert into t1 values (300) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; FLUSH TABLES RESET MASTER; diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index 187a778d9cc..5960952e22e 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -717,8 +717,8 @@ master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhos master-bin.000001 # Query # # COMMIT drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -insert delayed into t1 values (207); -insert delayed into t1 values (null); +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); +insert /*! delayed */ into t1 values (null); insert delayed into t1 values (300); FLUSH TABLES; show binlog events from <binlog_start>; @@ -820,3 +820,62 @@ Log_name Pos Event_type Server_id End_log_pos Info # # Write_rows 1 # table_id: # flags: STMT_END_F # # Query 1 # COMMIT DROP TABLE t1; + +# BUG#54903 BINLOG statement toggles session variables +# ---------------------------------------------------------------------- +# This test verify that BINLOG statement doesn't change current session's +# variables foreign_key_checks and unique_checks. + +CREATE TABLE t1 (c1 INT KEY); +SET @@SESSION.foreign_key_checks= ON; +SET @@SESSION.unique_checks= ON; +# INSERT INTO t1 VALUES (1) +# foreign_key_checks=0 and unique_checks=0 +BINLOG ' +dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== +'; +SELECT * FROM t1; +c1 +1 +# Their values should be ON +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks ON +unique_checks ON + +SET @@SESSION.foreign_key_checks= OFF; +SET @@SESSION.unique_checks= OFF; +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +# INSERT INTO t1 VALUES(2) +# foreign_key_checks=1 and unique_checks=1 +# It should not change current session's variables, even error happens +BINLOG ' +dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= +dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== +'; +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +SELECT * FROM t1; +c1 +1 +2 +# Their values should be OFF +SHOW SESSION VARIABLES LIKE "%_checks"; +Variable_name Value +foreign_key_checks OFF +unique_checks OFF +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result b/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result new file mode 100644 index 00000000000..09cdab8414a --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result @@ -0,0 +1,66 @@ +drop table if exists t1, t2; +create table t1 (a int) engine=innodb; +create table t2 (a int) engine=myisam; +**** Preparing the enviroment to check commit and its effect on status variables. +**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +**** Transactional changes which are long enough so they will be flushed to disk... +**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +**** Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +commit; +**** Non-Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +commit; +**** Mixed changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +commit; +**** Preparing the enviroment to check abort and its effect on the status variables. +**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +flush status; +**** Transactional changes which are long enough so they will be flushed to disk... +**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +**** Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +rollback; +**** Non-Transactional changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0. +begin; +insert into t2 values( 1 ); +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +**** Mixed changes which should not be flushed to disk and so should not +**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use. +**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1. +**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0. +begin; +insert into t1 values( 1 ); +insert into t2 values( 1 ); +rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +drop table t1, t2; diff --git a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result deleted file mode 100644 index 637be940383..00000000000 --- a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result +++ /dev/null @@ -1,25 +0,0 @@ -flush status; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 0 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 0 -drop table if exists t1; -create table t1 (a int) engine=innodb; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 2 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -begin; -delete from t1; -commit; -show status like "binlog_cache_use"; -Variable_name Value -Binlog_cache_use 4 -show status like "binlog_cache_disk_use"; -Variable_name Value -Binlog_cache_disk_use 1 -drop table t1; diff --git a/mysql-test/suite/binlog/t/binlog_max_extension.test b/mysql-test/suite/binlog/t/binlog_max_extension.test index 9f52d195e21..4525ce41aed 100644 --- a/mysql-test/suite/binlog/t/binlog_max_extension.test +++ b/mysql-test/suite/binlog/t/binlog_max_extension.test @@ -38,9 +38,7 @@ RESET MASTER; ########## # 1. Stop master server --- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -- shutdown_server 10 -- source include/wait_until_disconnected.inc @@ -52,9 +50,7 @@ master-bin.2147483646 EOF # 3. Restart the server --- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -- enable_reconnect -- source include/wait_until_connected_again.inc @@ -70,9 +66,7 @@ FLUSH LOGS; ############## # 1. Stop the server --- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -- shutdown_server 10 -- source include/wait_until_disconnected.inc @@ -85,8 +79,6 @@ EOF -- remove_file $MYSQLD_DATADIR/master-bin.2147483647 # 3. Restart the server --- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -- enable_reconnect -- source include/wait_until_connected_again.inc diff --git a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test index 0be097c78ed..3e63fb3bc9c 100644 --- a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test +++ b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test @@ -2,4 +2,4 @@ # For both statement and row based bin logs 9/19/2005 [jbm] -- source include/have_binlog_format_mixed.inc --- source extra/binlog_tests/innodb_stat.test +-- source extra/binlog_tests/binlog_cache_stat.test diff --git a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test index e4e6762226b..03f9c53f0cc 100644 --- a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test +++ b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test @@ -2,4 +2,4 @@ # For both statement and row based bin logs 9/19/2005 [jbm] -- source include/have_binlog_format_row.inc --- source extra/binlog_tests/innodb_stat.test +-- source extra/binlog_tests/binlog_cache_stat.test diff --git a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test index c6017246e6d..0f5aa9f6013 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test +++ b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test @@ -2,4 +2,4 @@ # For both statement and row based bin logs 9/19/2005 [jbm] -- source include/have_binlog_format_statement.inc --- source extra/binlog_tests/innodb_stat.test +-- source extra/binlog_tests/binlog_cache_stat.test diff --git a/mysql-test/suite/federated/federated_bug_35333.result b/mysql-test/suite/federated/federated_bug_35333.result new file mode 100644 index 00000000000..ca7aa960b73 --- /dev/null +++ b/mysql-test/suite/federated/federated_bug_35333.result @@ -0,0 +1,67 @@ +# +# Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata" +# +# Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail +# when encountering a federated table that cannot connect to its remote table. +# +# The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear +# the remote connection error and push a warning instead. This allows the SELECT operation +# to complete while still indicating a problem. This fix applies to any non-fatal system +# error that occurs during a query against I_S.TABLES.de +CREATE DATABASE federated; +CREATE DATABASE federated; +CREATE DATABASE IF NOT EXISTS realdb; +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +# +# Create the base table to be referenced +# +CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM; +# +# Create a federated table with a bogus port number +# +CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED +CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0'; +# +# Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query +# +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated'; +TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT +federated t0 BASE TABLE FEDERATED NULL 0 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) +realdb t0 BASE TABLE MyISAM Dynamic 0 0 +Warnings: +Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) +SHOW WARNINGS; +Level Code Message +Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) +# +# Create a MyISAM table then corrupt the file +# +USE realdb; +CREATE TABLE t1 (c1 int) ENGINE=MYISAM; +# +# Corrupt the MyISAM table by deleting the base file +# +# +# Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query +# +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT +realdb t1 BASE TABLE NULL NULL NULL NULL Can't find file: 't1' (errno: 2) +Warnings: +Warning 1017 Can't find file: 't1' (errno: 2) +SHOW WARNINGS; +Level Code Message +Warning 1017 Can't find file: 't1' (errno: 2) +# +# Cleanup +# +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +DROP DATABASE realdb; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE federated; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE federated; diff --git a/mysql-test/suite/federated/federated_bug_35333.test b/mysql-test/suite/federated/federated_bug_35333.test new file mode 100644 index 00000000000..58c217d24f2 --- /dev/null +++ b/mysql-test/suite/federated/federated_bug_35333.test @@ -0,0 +1,74 @@ +--echo # +--echo # Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata" +--echo # +--echo # Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail +--echo # when encountering a federated table that cannot connect to its remote table. +--echo # +--echo # The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear +--echo # the remote connection error and push a warning instead. This allows the SELECT operation +--echo # to complete while still indicating a problem. This fix applies to any non-fatal system +--echo # error that occurs during a query against I_S.TABLES.de + +--source federated.inc + +--disable_warnings +CREATE DATABASE IF NOT EXISTS realdb; +# Federated database exists +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +--enable_warnings + +--echo # +--echo # Create the base table to be referenced +--echo # +CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM; + +--echo # +--echo # Create a federated table with a bogus port number +--echo # +CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED + CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0'; + +#--warning ER_CONNECT_TO_FOREIGN_DATA_SOURCE + +--echo # +--echo # Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query +--echo # +# Remove O/S-specific socket error +--replace_regex /\(.*\)/(socket errno)/ +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT + FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated'; + +# Remove O/S-specific socket error +--replace_regex /\(.*\)/(socket errno)/ +SHOW WARNINGS; + +--echo # +--echo # Create a MyISAM table then corrupt the file +--echo # +USE realdb; +CREATE TABLE t1 (c1 int) ENGINE=MYISAM; +--echo # +--echo # Corrupt the MyISAM table by deleting the base file +--echo # +let $MYSQLD_DATADIR= `SELECT @@datadir`; +--remove_file $MYSQLD_DATADIR/realdb/t1.MYD +--remove_file $MYSQLD_DATADIR/realdb/t1.MYI + +--echo # +--echo # Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query +--echo # +SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT + FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; + +SHOW WARNINGS; +--echo # +--echo # Cleanup +--echo # +--disable_warnings +DROP TABLE IF EXISTS realdb.t0; +DROP TABLE IF EXISTS federated.t0; +DROP DATABASE realdb; +--enable_warnings + +--source federated_cleanup.inc diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result index 350c7ebd541..0c8d16f27fb 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc.result @@ -471,17 +471,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 2 auto_increment_offset 10 -INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); +ERROR HY000: Failed to read auto-increment value from storage engine SELECT * FROM t1; c1 1 18446744073709551603 -18446744073709551604 -18446744073709551606 -18446744073709551608 -18446744073709551610 -18446744073709551612 -18446744073709551614 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -504,13 +499,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 5 auto_increment_offset 7 -INSERT INTO t1 VALUES (NULL),(NULL); +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); +ERROR HY000: Failed to read auto-increment value from storage engine SELECT * FROM t1; c1 1 18446744073709551603 -18446744073709551607 -18446744073709551612 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; @@ -572,12 +566,12 @@ SHOW VARIABLES LIKE "%auto_inc%"; Variable_name Value auto_increment_increment 65535 auto_increment_offset 65535 -INSERT INTO t1 VALUES (NULL); +INSERT INTO t1 VALUES (NULL),(NULL); +ERROR 22003: Out of range value for column 't1' at row 167 SELECT * FROM t1; c1 1 18446744073709551610 -18446744073709551615 DROP TABLE t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; SET @@INSERT_ID=1; diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result deleted file mode 100644 index b279069d834..00000000000 --- a/mysql-test/suite/innodb/r/innodb_bug56947.result +++ /dev/null @@ -1,8 +0,0 @@ -SET @old_innodb_file_per_table=@@innodb_file_per_table; -SET GLOBAL innodb_file_per_table=0; -create table bug56947(a int not null) engine = innodb; -CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB; -alter table bug56947 add unique index (a); -ERROR HY000: Table 'test.bug56947#1' already exists -drop table `bug56947#1`; -drop table bug56947; diff --git a/mysql-test/suite/innodb/r/innodb_multi_update.result b/mysql-test/suite/innodb/r/innodb_multi_update.result index 7af9b030d1f..558fc3938a8 100644 --- a/mysql-test/suite/innodb/r/innodb_multi_update.result +++ b/mysql-test/suite/innodb/r/innodb_multi_update.result @@ -74,3 +74,11 @@ a b 4 14 5 15 drop table bug38999_1,bug38999_2; +# +# Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb +# +CREATE TABLE t1(f1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test index da0783bdc7c..ab8a7d69ab2 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc.test @@ -293,21 +293,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't, it seems to be -# a MySQL server bug. It wraps around to 0 for the last value. -# See MySQL Bug# 39828 -# -# Instead of wrapping around, it asserts when MySQL is compiled --with-debug -# (see sql/handler.cc:handler::update_auto_increment()). Don't test for -# overflow until Bug #39828 is fixed. -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); -#else -INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); -#endif +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; @@ -325,20 +312,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't. It fails with -# a duplicate entry message because of a MySQL server bug, it wraps -# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace -# the ER_DUP_ENTRY, 1062 below with the appropriate error message -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -# Still need to fix this error code, error should mention overflow -#-- error ER_DUP_ENTRY,1062 -#INSERT INTO t1 VALUES (NULL),(NULL), (NULL); -#else -INSERT INTO t1 VALUES (NULL),(NULL); -#endif +--error ER_AUTOINC_READ_FAILED +INSERT INTO t1 VALUES (NULL),(NULL), (NULL); SELECT * FROM t1; DROP TABLE t1; @@ -376,20 +351,8 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 SELECT * FROM t1; SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; SHOW VARIABLES LIKE "%auto_inc%"; -# This should fail because of overflow but it doesn't. It wraps around -# and the autoinc values look bogus too. -# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error -# code expected test. -# -- error ER_AUTOINC_READ_FAILED,1467 -# -# Since this asserts when compiled --with-debug, we can't properly test this -# until Bug #39828 is fixed. For now, this test is meaningless. -#if Bug #39828 is fixed -#-- error ER_AUTOINC_READ_FAILED,1467 -#INSERT INTO t1 VALUES (NULL),(NULL); -#else -INSERT INTO t1 VALUES (NULL); -#endif +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO t1 VALUES (NULL),(NULL); SELECT * FROM t1; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_bug56947.test b/mysql-test/suite/innodb/t/innodb_bug56947.test deleted file mode 100644 index e11f39b97a8..00000000000 --- a/mysql-test/suite/innodb/t/innodb_bug56947.test +++ /dev/null @@ -1,16 +0,0 @@ -# -# Bug #56947 valgrind reports a memory leak in innodb-plugin.innodb-index -# --- source include/have_innodb.inc - -SET @old_innodb_file_per_table=@@innodb_file_per_table; -# avoid a message about filed *.ibd file creation in the error log -SET GLOBAL innodb_file_per_table=0; -create table bug56947(a int not null) engine = innodb; -CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB; ---error 156 -alter table bug56947 add unique index (a); -drop table `bug56947#1`; -drop table bug56947; ---disable_query_log -SET GLOBAL innodb_file_per_table=@old_innodb_file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test index 7ab17ccf70a..778f4e980ca 100644 --- a/mysql-test/suite/innodb/t/innodb_multi_update.test +++ b/mysql-test/suite/innodb/t/innodb_multi_update.test @@ -27,3 +27,12 @@ select * from bug38999_1; select * from bug38999_2; drop table bug38999_1,bug38999_2; + +--echo # +--echo # Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb +--echo # +CREATE TABLE t1(f1 INT) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +--error ER_OPERAND_COLUMNS +UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1; +DROP TABLE t1; diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc index 25a9774d2a1..45d77225a23 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc @@ -39,29 +39,6 @@ let $val3 = 17 ; let $val4 = 15 ; --source suite/parts/inc/partition_supported_sql_funcs.inc - -let $sqlfunc = ceiling(col1); -let $valsqlfunc = ceiling(15); -let $coltype = float(7,4); -let $infile = part_supported_sql_funcs_int_float.inc; -let $val1 = 5.1230; -let $val2 = 13.345; -let $val3 = 17.987; -let $val4 = 15.654 ; -# DISABLED due to bug 30577 -#--source suite/parts/inc/partition_supported_sql_funcs.inc - -let $sqlfunc = floor(col1); -let $valsqlfunc = floor(15.123); -let $coltype = float(7,4); -let $infile = part_supported_sql_funcs_int_float.inc; -let $val1 = 5.1230; -let $val2 = 13.345; -let $val3 = 17.987; -let $val4 = 15.654 ; -# DISABLED due to bug 30577 -#--source suite/parts/inc/partition_supported_sql_funcs.inc - let $sqlfunc = mod(col1,10); let $valsqlfunc = mod(15,10); let $coltype = int; diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc index 17cef08e275..7d3fe058de9 100644 --- a/mysql-test/suite/parts/inc/partition_decimal.inc +++ b/mysql-test/suite/parts/inc/partition_decimal.inc @@ -37,10 +37,8 @@ drop table t2; # Bug 30577: FLOOR() and CEILING() not usable as partition functions # Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. +# CEILING() do not, unless they have an INT or DECIMAL argument. ---disable_parsing eval create table t3 (a decimal(18,9) not null, primary key(a)) engine=$engine partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( @@ -65,7 +63,7 @@ select count(*) from t3; drop table t3; eval create table t4 (a decimal(18,9) not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 2 ( +partition by list (ceiling(a)) subpartition by key (a) subpartitions 2 ( partition pa2 values in (1,2), partition pa4 values in (3,4), partition pa6 values in (5,6), @@ -85,6 +83,3 @@ dec $count; --enable_query_log select count(*) from t4; drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_double.inc b/mysql-test/suite/parts/inc/partition_double.inc index befbe860b86..cfae95022ce 100644 --- a/mysql-test/suite/parts/inc/partition_double.inc +++ b/mysql-test/suite/parts/inc/partition_double.inc @@ -34,54 +34,3 @@ dec $count; --enable_query_log select count(*) from t2; drop table t2; - - -# Bug 30577: FLOOR() and CEILING() not usable as partition functions -# Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. - ---disable_parsing - -eval create table t3 (a double not null, primary key(a)) engine=$engine -partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t3 values ($count); -eval insert into t3 values ($count+0.33); -eval insert into t3 values ($count+0.75); -dec $count; -} -select count(*) from t3; -select * from t3; -drop table t3; - -eval create table t4 (a double not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t4 values ($count); -eval insert into t4 values ($count+0.33); -eval insert into t4 values ($count+0.75); -dec $count; -} -select count(*) from t4; -select * from t4; -drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/inc/partition_float.inc b/mysql-test/suite/parts/inc/partition_float.inc index 34f14137d4d..7fa6b3043be 100644 --- a/mysql-test/suite/parts/inc/partition_float.inc +++ b/mysql-test/suite/parts/inc/partition_float.inc @@ -38,53 +38,3 @@ dec $count; --enable_query_log select count(*) from t2; drop table t2; - -# Bug 30577: FLOOR() and CEILING() not usable as partition functions -# Partition functions are required to return INT_RESULT; FLOOR() and -# CEILING() do not, unless they have an INT argument. Disable this -# portion of the test until bug 30577 is fixed. - ---disable_parsing - -eval create table t3 (a float not null, primary key(a)) engine=$engine -partition by range (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values less than (3), -partition pa3 values less than (6), -partition pa10 values less than (10) -); -show create table t3; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t3 values ($count); -eval insert into t3 values ($count+0.33); -eval insert into t3 values ($count+0.75); -dec $count; -} -select count(*) from t3; -select * from t3; -drop table t3; - -eval create table t4 (a float not null, primary key(a)) engine=$engine -partition by list (floor(a)) subpartition by key (a) subpartitions 3 ( -partition pa1 values in (1,2,3), -partition pa3 values in (4,5,6), -partition pa10 values in (7,8,9,10) -); -show create table t4; -let $count=9; ---echo $count*3 inserts; -while ($count) -{ -eval insert into t4 values ($count); -eval insert into t4 values ($count+0.33); -eval insert into t4 values ($count+0.75); -dec $count; -} -select count(*) from t4; -select * from t4; -drop table t4; - -# Disabled due to Bug 30577 ---enable_parsing diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result index 70debf3c595..c69c880cc6f 100644 --- a/mysql-test/suite/parts/r/partition_decimal_innodb.result +++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result @@ -86,3 +86,111 @@ select count(*) from t2; count(*) 3072 drop table t2; +create table t3 (a decimal(18,9) not null, primary key(a)) engine='InnoDB' +partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values less than (2), +partition pa4 values less than (4), +partition pa6 values less than (6), +partition pa8 values less than (8), +partition pa10 values less than (10) +); +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (floor(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES LESS THAN (2) ENGINE = InnoDB, + PARTITION pa4 VALUES LESS THAN (4) ENGINE = InnoDB, + PARTITION pa6 VALUES LESS THAN (6) ENGINE = InnoDB, + PARTITION pa8 VALUES LESS THAN (8) ENGINE = InnoDB, + PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */ +9*3 inserts; +insert into t3 values (9); +insert into t3 values (9+0.333333333); +insert into t3 values (9+0.755555555); +insert into t3 values (8); +insert into t3 values (8+0.333333333); +insert into t3 values (8+0.755555555); +insert into t3 values (7); +insert into t3 values (7+0.333333333); +insert into t3 values (7+0.755555555); +insert into t3 values (6); +insert into t3 values (6+0.333333333); +insert into t3 values (6+0.755555555); +insert into t3 values (5); +insert into t3 values (5+0.333333333); +insert into t3 values (5+0.755555555); +insert into t3 values (4); +insert into t3 values (4+0.333333333); +insert into t3 values (4+0.755555555); +insert into t3 values (3); +insert into t3 values (3+0.333333333); +insert into t3 values (3+0.755555555); +insert into t3 values (2); +insert into t3 values (2+0.333333333); +insert into t3 values (2+0.755555555); +insert into t3 values (1); +insert into t3 values (1+0.333333333); +insert into t3 values (1+0.755555555); +select count(*) from t3; +count(*) +27 +drop table t3; +create table t4 (a decimal(18,9) not null, primary key(a)) engine='InnoDB' +partition by list (ceiling(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values in (1,2), +partition pa4 values in (3,4), +partition pa6 values in (5,6), +partition pa8 values in (7,8), +partition pa10 values in (9,10) +); +show create table t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (ceiling(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES IN (1,2) ENGINE = InnoDB, + PARTITION pa4 VALUES IN (3,4) ENGINE = InnoDB, + PARTITION pa6 VALUES IN (5,6) ENGINE = InnoDB, + PARTITION pa8 VALUES IN (7,8) ENGINE = InnoDB, + PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) */ +9*3 inserts; +insert into t4 values (9); +insert into t4 values (9+0.333333333); +insert into t4 values (9+0.755555555); +insert into t4 values (8); +insert into t4 values (8+0.333333333); +insert into t4 values (8+0.755555555); +insert into t4 values (7); +insert into t4 values (7+0.333333333); +insert into t4 values (7+0.755555555); +insert into t4 values (6); +insert into t4 values (6+0.333333333); +insert into t4 values (6+0.755555555); +insert into t4 values (5); +insert into t4 values (5+0.333333333); +insert into t4 values (5+0.755555555); +insert into t4 values (4); +insert into t4 values (4+0.333333333); +insert into t4 values (4+0.755555555); +insert into t4 values (3); +insert into t4 values (3+0.333333333); +insert into t4 values (3+0.755555555); +insert into t4 values (2); +insert into t4 values (2+0.333333333); +insert into t4 values (2+0.755555555); +insert into t4 values (1); +insert into t4 values (1+0.333333333); +insert into t4 values (1+0.755555555); +select count(*) from t4; +count(*) +27 +drop table t4; diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result index f9f7a1e4fe2..cdafb721ea4 100644 --- a/mysql-test/suite/parts/r/partition_decimal_myisam.result +++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result @@ -86,3 +86,111 @@ select count(*) from t2; count(*) 196605 drop table t2; +create table t3 (a decimal(18,9) not null, primary key(a)) engine='MYISAM' +partition by range (floor(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values less than (2), +partition pa4 values less than (4), +partition pa6 values less than (6), +partition pa8 values less than (8), +partition pa10 values less than (10) +); +show create table t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (floor(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES LESS THAN (2) ENGINE = MyISAM, + PARTITION pa4 VALUES LESS THAN (4) ENGINE = MyISAM, + PARTITION pa6 VALUES LESS THAN (6) ENGINE = MyISAM, + PARTITION pa8 VALUES LESS THAN (8) ENGINE = MyISAM, + PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */ +9*3 inserts; +insert into t3 values (9); +insert into t3 values (9+0.333333333); +insert into t3 values (9+0.755555555); +insert into t3 values (8); +insert into t3 values (8+0.333333333); +insert into t3 values (8+0.755555555); +insert into t3 values (7); +insert into t3 values (7+0.333333333); +insert into t3 values (7+0.755555555); +insert into t3 values (6); +insert into t3 values (6+0.333333333); +insert into t3 values (6+0.755555555); +insert into t3 values (5); +insert into t3 values (5+0.333333333); +insert into t3 values (5+0.755555555); +insert into t3 values (4); +insert into t3 values (4+0.333333333); +insert into t3 values (4+0.755555555); +insert into t3 values (3); +insert into t3 values (3+0.333333333); +insert into t3 values (3+0.755555555); +insert into t3 values (2); +insert into t3 values (2+0.333333333); +insert into t3 values (2+0.755555555); +insert into t3 values (1); +insert into t3 values (1+0.333333333); +insert into t3 values (1+0.755555555); +select count(*) from t3; +count(*) +27 +drop table t3; +create table t4 (a decimal(18,9) not null, primary key(a)) engine='MYISAM' +partition by list (ceiling(a)) subpartition by key (a) subpartitions 2 ( +partition pa2 values in (1,2), +partition pa4 values in (3,4), +partition pa6 values in (5,6), +partition pa8 values in (7,8), +partition pa10 values in (9,10) +); +show create table t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` decimal(18,9) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (ceiling(a)) +SUBPARTITION BY KEY (a) +SUBPARTITIONS 2 +(PARTITION pa2 VALUES IN (1,2) ENGINE = MyISAM, + PARTITION pa4 VALUES IN (3,4) ENGINE = MyISAM, + PARTITION pa6 VALUES IN (5,6) ENGINE = MyISAM, + PARTITION pa8 VALUES IN (7,8) ENGINE = MyISAM, + PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) */ +9*3 inserts; +insert into t4 values (9); +insert into t4 values (9+0.333333333); +insert into t4 values (9+0.755555555); +insert into t4 values (8); +insert into t4 values (8+0.333333333); +insert into t4 values (8+0.755555555); +insert into t4 values (7); +insert into t4 values (7+0.333333333); +insert into t4 values (7+0.755555555); +insert into t4 values (6); +insert into t4 values (6+0.333333333); +insert into t4 values (6+0.755555555); +insert into t4 values (5); +insert into t4 values (5+0.333333333); +insert into t4 values (5+0.755555555); +insert into t4 values (4); +insert into t4 values (4+0.333333333); +insert into t4 values (4+0.755555555); +insert into t4 values (3); +insert into t4 values (3+0.333333333); +insert into t4 values (3+0.755555555); +insert into t4 values (2); +insert into t4 values (2+0.333333333); +insert into t4 values (2+0.755555555); +insert into t4 values (1); +insert into t4 values (1+0.333333333); +insert into t4 values (1+0.755555555); +select count(*) from t4; +count(*) +27 +drop table t4; diff --git a/mysql-test/suite/perfschema/include/privilege.inc b/mysql-test/suite/perfschema/include/privilege.inc index 3973c41b51b..f29ef65f519 100644 --- a/mysql-test/suite/perfschema/include/privilege.inc +++ b/mysql-test/suite/perfschema/include/privilege.inc @@ -100,16 +100,16 @@ create trigger performance_schema.bi_file_instances before insert on performance_schema.file_instances for each row begin end; ---error ER_WRONG_PERFSCHEMA_USAGE +--error ER_CANT_CREATE_TABLE create table test.t1(a int) engine=PERFORMANCE_SCHEMA; ---error ER_WRONG_PERFSCHEMA_USAGE +--error ER_CANT_CREATE_TABLE create table test.t1 like performance_schema.setup_instruments; ---error ER_WRONG_PERFSCHEMA_USAGE +--error ER_CANT_CREATE_TABLE create table test.t1 like performance_schema.events_waits_current; ---error ER_WRONG_PERFSCHEMA_USAGE +--error ER_CANT_CREATE_TABLE create table test.t1 like performance_schema.file_instances; --error ER_TABLEACCESS_DENIED_ERROR diff --git a/mysql-test/suite/perfschema/r/dml_cond_instances.result b/mysql-test/suite/perfschema/r/dml_cond_instances.result index 922effc59ae..285c32090af 100644 --- a/mysql-test/suite/perfschema/r/dml_cond_instances.result +++ b/mysql-test/suite/perfschema/r/dml_cond_instances.result @@ -1,9 +1,6 @@ select * from performance_schema.cond_instances limit 1; -NAME OBJECT_INSTANCE_BEGIN -# # select * from performance_schema.cond_instances where name='FOO'; -NAME OBJECT_INSTANCE_BEGIN insert into performance_schema.cond_instances set name='FOO', object_instance_begin=12; ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'cond_instances' diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_current.result b/mysql-test/suite/perfschema/r/dml_events_waits_current.result index 9b0bcf7f876..122cfcce4a1 100644 --- a/mysql-test/suite/perfschema/r/dml_events_waits_current.result +++ b/mysql-test/suite/perfschema/r/dml_events_waits_current.result @@ -1,10 +1,7 @@ select * from performance_schema.events_waits_current where event_name like 'Wait/Synch/%' limit 1; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS -# # # # # # # # NULL NULL NULL # NULL # NULL 0 select * from performance_schema.events_waits_current where event_name='FOO'; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS insert into performance_schema.events_waits_current set thread_id='1', event_id=1, event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history.result b/mysql-test/suite/perfschema/r/dml_events_waits_history.result index 5fc95584c7f..199ccc1cfa5 100644 --- a/mysql-test/suite/perfschema/r/dml_events_waits_history.result +++ b/mysql-test/suite/perfschema/r/dml_events_waits_history.result @@ -1,18 +1,11 @@ select * from performance_schema.events_waits_history where event_name like 'Wait/Synch/%' limit 1; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS -# # # # # # # # NULL NULL NULL # NULL # NULL 0 select * from performance_schema.events_waits_history where event_name='FOO'; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS select * from performance_schema.events_waits_history where event_name like 'Wait/Synch/%' order by timer_wait limit 1; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS -# # # # # # # # NULL NULL NULL # NULL # NULL 0 select * from performance_schema.events_waits_history where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS -# # # # # # # # NULL NULL NULL # NULL # NULL 0 insert into performance_schema.events_waits_history set thread_id='1', event_id=1, event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result index 2ce949b2228..773dcd3b1dc 100644 --- a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result +++ b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result @@ -1,18 +1,11 @@ select * from performance_schema.events_waits_history_long where event_name like 'Wait/Synch/%' limit 1; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS -# # # # # # # # NULL NULL NULL # NULL # NULL 0 select * from performance_schema.events_waits_history_long where event_name='FOO'; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS select * from performance_schema.events_waits_history_long where event_name like 'Wait/Synch/%' order by timer_wait limit 1; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS -# # # # # # # # NULL NULL NULL # NULL # NULL 0 select * from performance_schema.events_waits_history_long where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; -THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS -# # # # # # # # NULL NULL NULL # NULL # NULL 0 insert into performance_schema.events_waits_history_long set thread_id='1', event_id=1, event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result index 0a745a2c38a..6ba37025d3b 100644 --- a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result +++ b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result @@ -1,26 +1,15 @@ select * from performance_schema.events_waits_summary_by_instance where event_name like 'Wait/Synch/%' limit 1; -EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT -# # # # # # # select * from performance_schema.events_waits_summary_by_instance where event_name='FOO'; -EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT select * from performance_schema.events_waits_summary_by_instance order by count_star limit 1; -EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT -# # # # # # # select * from performance_schema.events_waits_summary_by_instance order by count_star desc limit 1; -EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT -# # # # # # # select * from performance_schema.events_waits_summary_by_instance where min_timer_wait > 0 order by count_star limit 1; -EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT -# # # # # # # select * from performance_schema.events_waits_summary_by_instance where min_timer_wait > 0 order by count_star desc limit 1; -EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT -# # # # # # # insert into performance_schema.events_waits_summary_by_instance set event_name='FOO', object_instance_begin=0, count_star=1, sum_timer_wait=2, min_timer_wait=3, diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result index c64bcdd40f6..a98acb5f536 100644 --- a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result +++ b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result @@ -1,10 +1,7 @@ select * from performance_schema.events_waits_summary_by_thread_by_event_name where event_name like 'Wait/Synch/%' limit 1; -THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT -# # # # # # # select * from performance_schema.events_waits_summary_by_thread_by_event_name where event_name='FOO'; -THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT insert into performance_schema.events_waits_summary_by_thread_by_event_name set event_name='FOO', thread_id=1, count_star=1, sum_timer_wait=2, min_timer_wait=3, diff --git a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result index c59451922c5..159adbd8022 100644 --- a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result +++ b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result @@ -1,10 +1,7 @@ select * from performance_schema.events_waits_summary_global_by_event_name where event_name like 'Wait/Synch/%' limit 1; -EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT -# # # # # # select * from performance_schema.events_waits_summary_global_by_event_name where event_name='FOO'; -EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT insert into performance_schema.events_waits_summary_global_by_event_name set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3, avg_timer_wait=4, max_timer_wait=5; diff --git a/mysql-test/suite/perfschema/r/dml_file_instances.result b/mysql-test/suite/perfschema/r/dml_file_instances.result index 5a51a4ca018..4a8a7ac4d47 100644 --- a/mysql-test/suite/perfschema/r/dml_file_instances.result +++ b/mysql-test/suite/perfschema/r/dml_file_instances.result @@ -1,9 +1,6 @@ select * from performance_schema.file_instances limit 1; -FILE_NAME EVENT_NAME OPEN_COUNT -# # # select * from performance_schema.file_instances where file_name='FOO'; -FILE_NAME EVENT_NAME OPEN_COUNT insert into performance_schema.file_instances set file_name='FOO', event_name='BAR', open_count=12; ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'file_instances' diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result b/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result index 97a196dbf19..a8a9fe852bb 100644 --- a/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result +++ b/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result @@ -1,10 +1,7 @@ select * from performance_schema.file_summary_by_event_name where event_name like 'Wait/io/%' limit 1; -EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -# # # # # select * from performance_schema.file_summary_by_event_name where event_name='FOO'; -EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE insert into performance_schema.file_summary_by_event_name set event_name='FOO', count_read=1, count_write=2, sum_number_of_bytes_read=4, sum_number_of_bytes_write=5; diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result b/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result index d85e23cb6f4..456d6e31173 100644 --- a/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result +++ b/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result @@ -1,10 +1,7 @@ select * from performance_schema.file_summary_by_instance where event_name like 'Wait/io/%' limit 1; -FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE -# # # # # # select * from performance_schema.file_summary_by_instance where event_name='FOO'; -FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE insert into performance_schema.file_summary_by_instance set event_name='FOO', count_read=1, count_write=2, sum_number_of_bytes_read=4, sum_number_of_bytes_write=5; diff --git a/mysql-test/suite/perfschema/r/dml_mutex_instances.result b/mysql-test/suite/perfschema/r/dml_mutex_instances.result index 1ea7311b149..665517c7227 100644 --- a/mysql-test/suite/perfschema/r/dml_mutex_instances.result +++ b/mysql-test/suite/perfschema/r/dml_mutex_instances.result @@ -1,9 +1,6 @@ select * from performance_schema.mutex_instances limit 1; -NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID -# # # select * from performance_schema.mutex_instances where name='FOO'; -NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID insert into performance_schema.mutex_instances set name='FOO', object_instance_begin=12; ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'mutex_instances' diff --git a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result index 964fa0fa46f..b072eea3955 100644 --- a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result +++ b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result @@ -1,9 +1,6 @@ select * from performance_schema.rwlock_instances limit 1; -NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT -# # # # select * from performance_schema.rwlock_instances where name='FOO'; -NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT insert into performance_schema.rwlock_instances set name='FOO', object_instance_begin=12; ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'rwlock_instances' diff --git a/mysql-test/suite/perfschema/r/dml_threads.result b/mysql-test/suite/perfschema/r/dml_threads.result index 8c61521d091..b78d1934d1f 100644 --- a/mysql-test/suite/perfschema/r/dml_threads.result +++ b/mysql-test/suite/perfschema/r/dml_threads.result @@ -1,10 +1,7 @@ select * from performance_schema.threads where name like 'Thread/%' limit 1; -THREAD_ID PROCESSLIST_ID NAME -# # # select * from performance_schema.threads where name='FOO'; -THREAD_ID PROCESSLIST_ID NAME insert into performance_schema.threads set name='FOO', thread_id=1, processlist_id=2; ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'threads' diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result index 4e9b08e00ef..2f66f80ed75 100644 --- a/mysql-test/suite/perfschema/r/misc.result +++ b/mysql-test/suite/perfschema/r/misc.result @@ -6,9 +6,9 @@ AND EVENT_NAME IN WHERE NAME LIKE "wait/synch/%") LIMIT 1; create table test.t1(a int) engine=performance_schema; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table performance_schema.t1(a int); ERROR 42000: CREATE command denied to user 'root'@'localhost' for table 't1' drop table if exists test.ghost; diff --git a/mysql-test/suite/perfschema/r/myisam_file_io.result b/mysql-test/suite/perfschema/r/myisam_file_io.result index 287abd43d74..5cdcf6ac789 100644 --- a/mysql-test/suite/perfschema/r/myisam_file_io.result +++ b/mysql-test/suite/perfschema/r/myisam_file_io.result @@ -16,6 +16,7 @@ operation, number_of_bytes, substring(object_name, locate("no_index_tab", object_name)) as short_name from performance_schema.events_waits_history_long where operation not like "tell" + and event_name like "wait/io/file/myisam/%" order by thread_id, event_id; event_name short_source operation number_of_bytes short_name wait/io/file/myisam/kfile mi_create.c: create NULL no_index_tab.MYI diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result index 61f5adac354..d1831c9c4be 100644 --- a/mysql-test/suite/perfschema/r/privilege.result +++ b/mysql-test/suite/perfschema/r/privilege.result @@ -152,13 +152,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.file_instances; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_instruments' @@ -250,13 +250,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.file_instances; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'setup_instruments' @@ -348,13 +348,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.file_instances; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'setup_instruments' @@ -446,13 +446,13 @@ before insert on performance_schema.file_instances for each row begin end; ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' create table test.t1(a int) engine=PERFORMANCE_SCHEMA; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.setup_instruments; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.events_waits_current; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) create table test.t1 like performance_schema.file_instances; -ERROR HY000: Invalid performance_schema usage. +ERROR HY000: Can't create table 'test.t1' (errno: 131) insert into performance_schema.setup_instruments set name="foo"; ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'setup_instruments' diff --git a/mysql-test/suite/perfschema/r/thread_cache.result b/mysql-test/suite/perfschema/r/thread_cache.result index de4d19f9c64..f64cadc2705 100644 --- a/mysql-test/suite/perfschema/r/thread_cache.result +++ b/mysql-test/suite/perfschema/r/thread_cache.result @@ -1,3 +1,4 @@ +flush status; SET @saved_thread_cache_size = @@global.thread_cache_size; set global thread_cache_size = 0; show variables like "thread_cache_size"; @@ -32,3 +33,7 @@ select @thread_id_increment; @thread_id_increment 1 set global thread_cache_size = @saved_thread_cache_size; +show status like "performance_schema_thread%"; +Variable_name Value +Performance_schema_thread_classes_lost 0 +Performance_schema_thread_instances_lost 0 diff --git a/mysql-test/suite/perfschema/t/dml_cond_instances.test b/mysql-test/suite/perfschema/t/dml_cond_instances.test index 528dae80dfa..e2773d15252 100644 --- a/mysql-test/suite/perfschema/t/dml_cond_instances.test +++ b/mysql-test/suite/perfschema/t/dml_cond_instances.test @@ -18,11 +18,12 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # +--disable_result_log select * from performance_schema.cond_instances limit 1; select * from performance_schema.cond_instances where name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.cond_instances diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_current.test b/mysql-test/suite/perfschema/t/dml_events_waits_current.test index f82fac63df9..43a70618b4d 100644 --- a/mysql-test/suite/perfschema/t/dml_events_waits_current.test +++ b/mysql-test/suite/perfschema/t/dml_events_waits_current.test @@ -18,12 +18,13 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +--disable_result_log select * from performance_schema.events_waits_current where event_name like 'Wait/Synch/%' limit 1; select * from performance_schema.events_waits_current where event_name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.events_waits_current diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history.test b/mysql-test/suite/perfschema/t/dml_events_waits_history.test index 865d261d7f9..51937a75f49 100644 --- a/mysql-test/suite/perfschema/t/dml_events_waits_history.test +++ b/mysql-test/suite/perfschema/t/dml_events_waits_history.test @@ -18,20 +18,19 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +--disable_result_log select * from performance_schema.events_waits_history where event_name like 'Wait/Synch/%' limit 1; select * from performance_schema.events_waits_history where event_name='FOO'; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # select * from performance_schema.events_waits_history where event_name like 'Wait/Synch/%' order by timer_wait limit 1; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # select * from performance_schema.events_waits_history where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.events_waits_history diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test index 606e33b3e80..a7fc1937529 100644 --- a/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test +++ b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test @@ -18,20 +18,19 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +--disable_result_log select * from performance_schema.events_waits_history_long where event_name like 'Wait/Synch/%' limit 1; select * from performance_schema.events_waits_history_long where event_name='FOO'; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # select * from performance_schema.events_waits_history_long where event_name like 'Wait/Synch/%' order by timer_wait limit 1; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # select * from performance_schema.events_waits_history_long where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.events_waits_history_long diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_instance.test b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test index 2e4ab9bcc74..2f25f842dcc 100644 --- a/mysql-test/suite/perfschema/t/dml_ews_by_instance.test +++ b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test @@ -18,28 +18,25 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +--disable_result_log select * from performance_schema.events_waits_summary_by_instance where event_name like 'Wait/Synch/%' limit 1; select * from performance_schema.events_waits_summary_by_instance where event_name='FOO'; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # select * from performance_schema.events_waits_summary_by_instance order by count_star limit 1; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # select * from performance_schema.events_waits_summary_by_instance order by count_star desc limit 1; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # select * from performance_schema.events_waits_summary_by_instance where min_timer_wait > 0 order by count_star limit 1; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # select * from performance_schema.events_waits_summary_by_instance where min_timer_wait > 0 order by count_star desc limit 1; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.events_waits_summary_by_instance diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test index bdbee9a90c1..a1b41fdab42 100644 --- a/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test +++ b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test @@ -18,12 +18,13 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +--disable_result_log select * from performance_schema.events_waits_summary_by_thread_by_event_name where event_name like 'Wait/Synch/%' limit 1; select * from performance_schema.events_waits_summary_by_thread_by_event_name where event_name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.events_waits_summary_by_thread_by_event_name diff --git a/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test index 4f1b50bb7c0..bf311c7b470 100644 --- a/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test +++ b/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test @@ -18,12 +18,13 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # +--disable_result_log select * from performance_schema.events_waits_summary_global_by_event_name where event_name like 'Wait/Synch/%' limit 1; select * from performance_schema.events_waits_summary_global_by_event_name where event_name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.events_waits_summary_global_by_event_name diff --git a/mysql-test/suite/perfschema/t/dml_file_instances.test b/mysql-test/suite/perfschema/t/dml_file_instances.test index f3a13eaee32..d7a1002b040 100644 --- a/mysql-test/suite/perfschema/t/dml_file_instances.test +++ b/mysql-test/suite/perfschema/t/dml_file_instances.test @@ -18,11 +18,12 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # +--disable_result_log select * from performance_schema.file_instances limit 1; select * from performance_schema.file_instances where file_name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.file_instances diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test b/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test index f5e1f90e9c9..8060c4a4cbe 100644 --- a/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test +++ b/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test @@ -18,12 +18,13 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # +--disable_result_log select * from performance_schema.file_summary_by_event_name where event_name like 'Wait/io/%' limit 1; select * from performance_schema.file_summary_by_event_name where event_name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.file_summary_by_event_name diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test b/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test index 2ac32b97f56..c24f57390a4 100644 --- a/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test +++ b/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test @@ -18,12 +18,13 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # +--disable_result_log select * from performance_schema.file_summary_by_instance where event_name like 'Wait/io/%' limit 1; select * from performance_schema.file_summary_by_instance where event_name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.file_summary_by_instance diff --git a/mysql-test/suite/perfschema/t/dml_mutex_instances.test b/mysql-test/suite/perfschema/t/dml_mutex_instances.test index c0bbd5276a0..1a48bd9d8ea 100644 --- a/mysql-test/suite/perfschema/t/dml_mutex_instances.test +++ b/mysql-test/suite/perfschema/t/dml_mutex_instances.test @@ -18,11 +18,12 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # +--disable_result_log select * from performance_schema.mutex_instances limit 1; select * from performance_schema.mutex_instances where name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.mutex_instances diff --git a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test index c0fd89a8e75..b588502c996 100644 --- a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test +++ b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test @@ -18,11 +18,12 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # 4 # +--disable_result_log select * from performance_schema.rwlock_instances limit 1; select * from performance_schema.rwlock_instances where name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.rwlock_instances diff --git a/mysql-test/suite/perfschema/t/dml_threads.test b/mysql-test/suite/perfschema/t/dml_threads.test index e7188497061..6cb372e2c96 100644 --- a/mysql-test/suite/perfschema/t/dml_threads.test +++ b/mysql-test/suite/perfschema/t/dml_threads.test @@ -18,12 +18,13 @@ --source include/not_embedded.inc --source include/have_perfschema.inc ---replace_column 1 # 2 # 3 # +--disable_result_log select * from performance_schema.threads where name like 'Thread/%' limit 1; select * from performance_schema.threads where name='FOO'; +--enable_result_log --error ER_TABLEACCESS_DENIED_ERROR insert into performance_schema.threads diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test index 72e891ca805..dee18f0fa21 100644 --- a/mysql-test/suite/perfschema/t/misc.test +++ b/mysql-test/suite/perfschema/t/misc.test @@ -38,14 +38,14 @@ LIMIT 1; # Bug#45088 Should not be able to create tables of engine PERFORMANCE_SCHEMA # ---error ER_WRONG_PERFSCHEMA_USAGE +--error ER_CANT_CREATE_TABLE create table test.t1(a int) engine=performance_schema; # # Bug#44897 Performance Schema: can create a ghost table in another database # ---error ER_WRONG_PERFSCHEMA_USAGE +--error ER_CANT_CREATE_TABLE create table test.t1 like performance_schema.events_waits_current; # diff --git a/mysql-test/suite/perfschema/t/myisam_file_io.test b/mysql-test/suite/perfschema/t/myisam_file_io.test index c2502b5895a..de9f6f48480 100644 --- a/mysql-test/suite/perfschema/t/myisam_file_io.test +++ b/mysql-test/suite/perfschema/t/myisam_file_io.test @@ -46,6 +46,13 @@ insert into no_index_tab set a = 'foo', b = 1; # Verification # Note that mi_create.c contains mysql_file_tell() calls in debug only, # so the result are filtered to remove 'tell'. +# Note that even after setting other instruments to enabled='NO' +# and truncating the events_waits_history_long table, +# some events -- that were already started but not completed -- +# for other instruments could still be added in the history. +# To protect against that, an extra where clause +# "and event_name like "wait/io/file/myisam/%" +# is added to the select to filter out the result. select event_name, left(source, locate(":", source)) as short_source, @@ -53,6 +60,7 @@ select event_name, substring(object_name, locate("no_index_tab", object_name)) as short_name from performance_schema.events_waits_history_long where operation not like "tell" + and event_name like "wait/io/file/myisam/%" order by thread_id, event_id; # In case of failures, this will tell if file io are lost. diff --git a/mysql-test/suite/perfschema/t/thread_cache.test b/mysql-test/suite/perfschema/t/thread_cache.test index 488b359cd34..e839552ed19 100644 --- a/mysql-test/suite/perfschema/t/thread_cache.test +++ b/mysql-test/suite/perfschema/t/thread_cache.test @@ -20,6 +20,8 @@ # Setup +flush status; + SET @saved_thread_cache_size = @@global.thread_cache_size; set global thread_cache_size = 0; @@ -40,7 +42,7 @@ let $con2_ID=`select connection_id()`; let $con2_THREAD_ID=`select thread_id from performance_schema.threads where PROCESSLIST_ID = connection_id()`; -connection default; +--connection default --disable_query_log eval select ($con2_ID - $con1_ID) into @id_increment; @@ -52,7 +54,15 @@ select @id_increment; # Expect 1, THREAD_ID is incremented for each new connection select @thread_id_increment; -disconnect con2; +--disconnect con2 + +--connection default + +# Wait for the disconnect con2 to complete +let $wait_condition= + select count(*) = 2 from performance_schema.threads + where name like "thread/sql/one_connection"; +--source include/wait_condition.inc connect (con3, localhost, root, , ); @@ -61,10 +71,16 @@ let $con3_ID=`select connection_id()`; let $con3_THREAD_ID=`select thread_id from performance_schema.threads where PROCESSLIST_ID = connection_id()`; -disconnect con3; -disconnect con1; +--disconnect con3 +--disconnect con1 + +--connection default -connection default; +# Wait for the disconnect con1 and con3 to complete +let $wait_condition= + select count(*) = 1 from performance_schema.threads + where name like "thread/sql/one_connection"; +--source include/wait_condition.inc --disable_query_log eval select ($con3_ID - $con2_ID) into @id_increment; @@ -92,7 +108,7 @@ let $con2_ID=`select connection_id()`; let $con2_THREAD_ID=`select thread_id from performance_schema.threads where PROCESSLIST_ID = connection_id()`; -connection default; +--connection default --disable_query_log eval select ($con2_ID - $con1_ID) into @id_increment; @@ -102,7 +118,15 @@ eval select ($con2_THREAD_ID - $con1_THREAD_ID) into @thread_id_increment; select @id_increment; select @thread_id_increment; -disconnect con2; +--disconnect con2 + +--connection default + +# Wait for the disconnect con2 to complete +let $wait_condition= + select count(*) = 2 from performance_schema.threads + where name like "thread/sql/one_connection"; +--source include/wait_condition.inc connect (con3, localhost, root, , ); @@ -111,10 +135,16 @@ let $con3_ID=`select connection_id()`; let $con3_THREAD_ID=`select thread_id from performance_schema.threads where PROCESSLIST_ID = connection_id()`; -disconnect con3; -disconnect con1; +--disconnect con3 +--disconnect con1 -connection default; +--connection default + +# Wait for the disconnect con1 and con3 to complete +let $wait_condition= + select count(*) = 1 from performance_schema.threads + where name like "thread/sql/one_connection"; +--source include/wait_condition.inc --disable_query_log eval select ($con3_ID - $con2_ID) into @id_increment; @@ -132,3 +162,5 @@ select @thread_id_increment; set global thread_cache_size = @saved_thread_cache_size; +show status like "performance_schema_thread%"; + diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index 479caed8e6b..c7f2ffab47a 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -7,6 +7,8 @@ start slave; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; @@ -129,13 +131,18 @@ source include/diff_master_slave.inc; # [ On Slave ] SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; include/stop_slave.inc include/start_slave.inc CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); +CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); TRUNCATE t1; SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; BEGIN; Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times COMMIT; @@ -146,6 +153,8 @@ show binlog events in 'slave-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; include/stop_slave.inc include/start_slave.inc SELECT count(*) FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result index 9c1dfebebaf..f04c229a9b6 100644 --- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result @@ -7,6 +7,8 @@ start slave; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; @@ -130,13 +132,18 @@ source include/diff_master_slave.inc; # [ On Slave ] SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; include/stop_slave.inc include/start_slave.inc CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); +CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); TRUNCATE t1; SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; BEGIN; Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times COMMIT; @@ -147,6 +154,8 @@ show binlog events in 'slave-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; include/stop_slave.inc include/start_slave.inc SELECT count(*) FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result index e69952787fb..4bbbc0e99c6 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result +++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result @@ -11,6 +11,6 @@ set sql_log_bin=1; insert into t1 values(1),(2); ERROR 23000: Duplicate entry '2' for key 'a' drop table t1; -Error: "Query caused different errors on master and slave. Error on master: 'Duplicate entry '%-.192s' for key %d' (1062), Error on slave: 'no error' (0). Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) +Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) Errno: "0" (expected 0) drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index 479caed8e6b..c7f2ffab47a 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -7,6 +7,8 @@ start slave; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; @@ -129,13 +131,18 @@ source include/diff_master_slave.inc; # [ On Slave ] SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; +SET GLOBAL max_binlog_stmt_cache_size = 4096; +SET GLOBAL binlog_stmt_cache_size = 4096; include/stop_slave.inc include/start_slave.inc CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*"); +CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*"); CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*"); TRUNCATE t1; SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; BEGIN; Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times COMMIT; @@ -146,6 +153,8 @@ show binlog events in 'slave-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; +SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; +SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; include/stop_slave.inc include/start_slave.inc SELECT count(*) FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result index 6b0c1c38c16..14ba6080ec0 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result @@ -51,8 +51,8 @@ CREATE TABLE t1(a int, UNIQUE(a)); INSERT DELAYED IGNORE INTO t1 VALUES(1); INSERT DELAYED IGNORE INTO t1 VALUES(1); flush table t1; -use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +use `test`; INSERT IGNORE INTO t1 VALUES(1) +use `test`; INSERT IGNORE INTO t1 VALUES(1) select * from t1; a 1 @@ -60,10 +60,10 @@ On slave show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,6; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 # Query # # BEGIN -slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +slave-bin.000002 # Query # # use `test`; INSERT IGNORE INTO t1 VALUES(1) slave-bin.000002 # Query # # COMMIT slave-bin.000002 # Query # # BEGIN -slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +slave-bin.000002 # Query # # use `test`; INSERT IGNORE INTO t1 VALUES(1) slave-bin.000002 # Query # # COMMIT select * from t1; a diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index 1f8ce4c1d78..afa304531b8 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -153,15 +153,11 @@ SET @@global.slave_net_timeout=50; --enable_warnings --replace_result $MASTER_MYPORT MASTER_PORT eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30; ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --echo Reload slave --shutdown_server 10 --source include/wait_until_disconnected.inc ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect -restart -EOF +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect --enable_reconnect --source include/wait_until_connected_again.inc SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period'; @@ -456,15 +452,11 @@ let $status_var_comparsion= >; --source include/wait_for_status_var.inc --echo Heartbeat event received --connection master ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --echo Reload master --shutdown_server 10 --source include/wait_until_disconnected.inc ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --enable_reconnect --source include/wait_until_connected_again.inc --connection slave diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index 753f68e67d4..6575816662a 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -315,9 +315,7 @@ FLUSH LOGS; # Stop master server --echo --> Stop master server ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --shutdown_server 10 --source include/wait_until_disconnected.inc # Replace binlog @@ -325,9 +323,7 @@ remove_file $MYSQLD_DATADIR/master-bin.000001; copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001; --echo --> Start master server ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect -restart -EOF +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --enable_reconnect --source include/wait_until_connected_again.inc let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1); diff --git a/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc new file mode 100644 index 00000000000..f5df54b7acd --- /dev/null +++ b/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc @@ -0,0 +1,154 @@ +################ mysql-test\t\binlog_stmt_cache_size_basic.test ################ +# # +# Variable Name: binlog_stmt_cache_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: Numeric # +# Default Value: 32768 # +# Range: 4096 - 4294967295 # +# # +# # +# Creation Date: 2010-10-12 # +# Author: Alfranio Correia # +# # +# Description: Test Cases of Dynamic System Variable "binlog_stmt_cache_size" # +# that checks behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity . # +# # +# Reference: http://dev.mysql.com/doc/refman/5.5/en/ # +# server-system-variables.html#option_mysqld_binlog_stmt_cache_size # +# # +################################################################################ + +################################################################# +# START OF binlog_stmt_cache_size TESTS # +################################################################# + +######################################################################### +# Saving initial value of binlog_stmt_cache_size in a temporary variable # +######################################################################### + +SET @start_value = @@global.binlog_stmt_cache_size; +SELECT @start_value; + +--echo '#--------------------FN_DYNVARS_006_01------------------------#' +######################################################################### +# Display the DEFAULT value of binlog_stmt_cache_size # +######################################################################### + +SET @@global.binlog_stmt_cache_size = 100; +SET @@global.binlog_stmt_cache_size = DEFAULT; +SELECT @@global.binlog_stmt_cache_size; + + +--echo '#---------------------FN_DYNVARS_006_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.binlog_stmt_cache_size = @start_value; +SELECT @@global.binlog_stmt_cache_size = 32768; + + +--echo '#--------------------FN_DYNVARS_006_03------------------------#' +######################################################################### +# Change the value of binlog_stmt_cache_size to a valid value # +######################################################################### + +SET @@global.binlog_stmt_cache_size = 4096; +SELECT @@global.binlog_stmt_cache_size; +SET @@global.binlog_stmt_cache_size = 4294967295; +SELECT @@global.binlog_stmt_cache_size; +SET @@global.binlog_stmt_cache_size = 10000; +SELECT @@global.binlog_stmt_cache_size; +SET @@global.binlog_stmt_cache_size = 21221204; +SELECT @@global.binlog_stmt_cache_size; +echo 'Bug: Invalid values are coming in variable on assigning valid values'; + + +--echo '#--------------------FN_DYNVARS_006_04-------------------------#' +############################################################################ +# Change the value of binlog_stmt_cache_size to invalid value # +############################################################################ + +SET @@global.binlog_stmt_cache_size = 1024; +SELECT @@global.binlog_stmt_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.binlog_stmt_cache_size = 10000.01; +SET @@global.binlog_stmt_cache_size = -1024; +SELECT @@global.binlog_stmt_cache_size; +SET @@global.binlog_stmt_cache_size = 42949672950; +SELECT @@global.binlog_stmt_cache_size; +echo 'Bug: Errors are not coming on assigning invalid values to variable'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.binlog_stmt_cache_size = ON; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.binlog_stmt_cache_size = 'test'; + + +--echo '#-------------------FN_DYNVARS_006_05----------------------------#' +############################################################################ +# Test if accessing session binlog_stmt_cache_size gives error # +############################################################################ + +--Error ER_GLOBAL_VARIABLE +SET @@session.binlog_stmt_cache_size = 0; + + +--echo '#----------------------FN_DYNVARS_006_06------------------------#' +############################################################################## +# Check if the value in GLOBAL Tables matches values in variable # +############################################################################## + +SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size'; + +--echo '#---------------------FN_DYNVARS_006_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.binlog_stmt_cache_size = TRUE; +SELECT @@global.binlog_stmt_cache_size; +SET @@global.binlog_stmt_cache_size = FALSE; +SELECT @@global.binlog_stmt_cache_size; +echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable'; + +--echo '#---------------------FN_DYNVARS_006_08----------------------#' +############################################################################### +# Check if accessing variable without SCOPE points to same global variable # +############################################################################### + +SET @@global.binlog_stmt_cache_size = 1; +SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size; + +--echo '#---------------------FN_DYNVARS_006_09----------------------#' +########################################################################### +# Check if binlog_stmt_cache_size can be accessed with and without @@ sign# +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET binlog_stmt_cache_size = 1; +--Error ER_PARSE_ERROR +SET global.binlog_stmt_cache_size = 1; +--Error ER_UNKNOWN_TABLE +SELECT global.binlog_stmt_cache_size; +--Error ER_BAD_FIELD_ERROR +SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size; + + +############################## +# Restore initial value # +############################## + +SET @@global.binlog_stmt_cache_size = @start_value; +SELECT @@global.binlog_stmt_cache_size; + + +########################################################### +# END OF binlog_stmt_cache_size TESTS # +########################################################### diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result new file mode 100644 index 00000000000..604f671d5a4 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result @@ -0,0 +1,108 @@ +SET @start_value = @@global.binlog_stmt_cache_size; +SELECT @start_value; +@start_value +32768 +'#--------------------FN_DYNVARS_006_01------------------------#' +SET @@global.binlog_stmt_cache_size = 100; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '100' +SET @@global.binlog_stmt_cache_size = DEFAULT; +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +32768 +'#---------------------FN_DYNVARS_006_02-------------------------#' +SET @@global.binlog_stmt_cache_size = @start_value; +SELECT @@global.binlog_stmt_cache_size = 32768; +@@global.binlog_stmt_cache_size = 32768 +1 +'#--------------------FN_DYNVARS_006_03------------------------#' +SET @@global.binlog_stmt_cache_size = 4096; +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = 4294967295; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '4294967295' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4294963200 +SET @@global.binlog_stmt_cache_size = 10000; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '10000' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +8192 +SET @@global.binlog_stmt_cache_size = 21221204; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '21221204' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +21217280 +'Bug: Invalid values are coming in variable on assigning valid values' +'#--------------------FN_DYNVARS_006_04-------------------------#' +SET @@global.binlog_stmt_cache_size = 1024; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1024' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size' +SET @@global.binlog_stmt_cache_size = -1024; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '-1024' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4294963200 +'Bug: Errors are not coming on assigning invalid values to variable' +SET @@global.binlog_stmt_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size' +SET @@global.binlog_stmt_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size' +'#-------------------FN_DYNVARS_006_05----------------------------#' +SET @@session.binlog_stmt_cache_size = 0; +ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +'#----------------------FN_DYNVARS_006_06------------------------#' +SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size'; +@@global.binlog_stmt_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_006_07----------------------#' +SET @@global.binlog_stmt_cache_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '0' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +'Bug: Errors are not coming on assigning TRUE/FALSE to variable' +'#---------------------FN_DYNVARS_006_08----------------------#' +SET @@global.binlog_stmt_cache_size = 1; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1' +SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size; +@@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size +1 +'#---------------------FN_DYNVARS_006_09----------------------#' +SET binlog_stmt_cache_size = 1; +ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SET global.binlog_stmt_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_stmt_cache_size = 1' at line 1 +SELECT global.binlog_stmt_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size; +ERROR 42S22: Unknown column 'binlog_stmt_cache_size' in 'field list' +SET @@global.binlog_stmt_cache_size = @start_value; +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +32768 diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result new file mode 100644 index 00000000000..7cb553e48ee --- /dev/null +++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result @@ -0,0 +1,108 @@ +SET @start_value = @@global.binlog_stmt_cache_size; +SELECT @start_value; +@start_value +32768 +'#--------------------FN_DYNVARS_006_01------------------------#' +SET @@global.binlog_stmt_cache_size = 100; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '100' +SET @@global.binlog_stmt_cache_size = DEFAULT; +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +32768 +'#---------------------FN_DYNVARS_006_02-------------------------#' +SET @@global.binlog_stmt_cache_size = @start_value; +SELECT @@global.binlog_stmt_cache_size = 32768; +@@global.binlog_stmt_cache_size = 32768 +1 +'#--------------------FN_DYNVARS_006_03------------------------#' +SET @@global.binlog_stmt_cache_size = 4096; +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = 4294967295; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '4294967295' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4294963200 +SET @@global.binlog_stmt_cache_size = 10000; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '10000' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +8192 +SET @@global.binlog_stmt_cache_size = 21221204; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '21221204' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +21217280 +'Bug: Invalid values are coming in variable on assigning valid values' +'#--------------------FN_DYNVARS_006_04-------------------------#' +SET @@global.binlog_stmt_cache_size = 1024; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1024' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size' +SET @@global.binlog_stmt_cache_size = -1024; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '-1024' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = 42949672950; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +42949668864 +'Bug: Errors are not coming on assigning invalid values to variable' +SET @@global.binlog_stmt_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size' +SET @@global.binlog_stmt_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size' +'#-------------------FN_DYNVARS_006_05----------------------------#' +SET @@session.binlog_stmt_cache_size = 0; +ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +'#----------------------FN_DYNVARS_006_06------------------------#' +SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size'; +@@global.binlog_stmt_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_006_07----------------------#' +SET @@global.binlog_stmt_cache_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +SET @@global.binlog_stmt_cache_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '0' +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +4096 +'Bug: Errors are not coming on assigning TRUE/FALSE to variable' +'#---------------------FN_DYNVARS_006_08----------------------#' +SET @@global.binlog_stmt_cache_size = 1; +Warnings: +Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1' +SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size; +@@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size +1 +'#---------------------FN_DYNVARS_006_09----------------------#' +SET binlog_stmt_cache_size = 1; +ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SET global.binlog_stmt_cache_size = 1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'binlog_stmt_cache_size = 1' at line 1 +SELECT global.binlog_stmt_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size; +ERROR 42S22: Unknown column 'binlog_stmt_cache_size' in 'field list' +SET @@global.binlog_stmt_cache_size = @start_value; +SELECT @@global.binlog_stmt_cache_size; +@@global.binlog_stmt_cache_size +32768 diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result new file mode 100644 index 00000000000..f2229a0090b --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result @@ -0,0 +1,152 @@ +SET @start_value = @@global.max_binlog_stmt_cache_size; +SELECT @start_value; +@start_value +18446744073709547520 +'#--------------------FN_DYNVARS_072_01------------------------#' +SET @@global.max_binlog_stmt_cache_size = 5000; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000' +SET @@global.max_binlog_stmt_cache_size = DEFAULT; +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +18446744073709547520 +'#---------------------FN_DYNVARS_072_02-------------------------#' +SET @@global.max_binlog_stmt_cache_size = @start_value; +SELECT @@global.max_binlog_stmt_cache_size = 4294967295; +@@global.max_binlog_stmt_cache_size = 4294967295 +0 +'#--------------------FN_DYNVARS_072_03------------------------#' +SET @@global.max_binlog_stmt_cache_size = 4096; +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = 4294967295; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4294967295' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4294963200 +SET @@global.max_binlog_stmt_cache_size = 4294967294; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4294967294' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4294963200 +SET @@global.max_binlog_stmt_cache_size = 4097; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4097' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = 65535; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '65535' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +61440 +'#--------------------FN_DYNVARS_072_04-------------------------#' +SET @@global.max_binlog_stmt_cache_size = -1; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = 100000000000; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '100000000000' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +99999997952 +SET @@global.max_binlog_stmt_cache_size = 10000.01; +ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +99999997952 +SET @@global.max_binlog_stmt_cache_size = -1024; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1024' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = 1024; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '1024' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = 4294967296; +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4294967296 +SET @@global.max_binlog_stmt_cache_size = 4095; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4095' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = ON; +ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = 'test'; +ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +'#-------------------FN_DYNVARS_072_05----------------------------#' +SET @@session.max_binlog_stmt_cache_size = 4096; +ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@session.max_binlog_stmt_cache_size; +ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable +'#----------------------FN_DYNVARS_072_06------------------------#' +SELECT @@global.max_binlog_stmt_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_binlog_stmt_cache_size'; +@@global.max_binlog_stmt_cache_size = VARIABLE_VALUE +1 +SELECT @@max_binlog_stmt_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_binlog_stmt_cache_size'; +@@max_binlog_stmt_cache_size = VARIABLE_VALUE +1 +'#---------------------FN_DYNVARS_072_07----------------------#' +SET @@global.max_binlog_stmt_cache_size = TRUE; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '1' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +SET @@global.max_binlog_stmt_cache_size = FALSE; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '0' +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +4096 +'#---------------------FN_DYNVARS_072_08----------------------#' +SET @@global.max_binlog_stmt_cache_size = 5000; +Warnings: +Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000' +SELECT @@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size; +@@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size +1 +'#---------------------FN_DYNVARS_072_09----------------------#' +SET max_binlog_stmt_cache_size = 6000; +ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL +SELECT @@max_binlog_stmt_cache_size; +@@max_binlog_stmt_cache_size +4096 +SET local.max_binlog_stmt_cache_size = 7000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_stmt_cache_size = 7000' at line 1 +SELECT local.max_binlog_stmt_cache_size; +ERROR 42S02: Unknown table 'local' in field list +SET global.max_binlog_stmt_cache_size = 8000; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_stmt_cache_size = 8000' at line 1 +SELECT global.max_binlog_stmt_cache_size; +ERROR 42S02: Unknown table 'global' in field list +SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size; +ERROR 42S22: Unknown column 'max_binlog_stmt_cache_size' in 'field list' +SET @@global.max_binlog_stmt_cache_size = @start_value; +SELECT @@global.max_binlog_stmt_cache_size; +@@global.max_binlog_stmt_cache_size +18446744073709547520 diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test new file mode 100644 index 00000000000..fe8f89ccc16 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test @@ -0,0 +1,7 @@ +################################################################################ +# Wrapper for 32 bit machines # +################################################################################ + +--source include/have_32bit.inc +--source suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test new file mode 100644 index 00000000000..c4a2c95d42b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test @@ -0,0 +1,7 @@ +################################################################################ +# Wrapper for 64 bit machines # +################################################################################ + +--source include/have_64bit.inc +--source suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc + diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt deleted file mode 100644 index 6e00d7157d6..00000000000 --- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---log-bin ---innodb diff --git a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test new file mode 100644 index 00000000000..07a030c35a7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test @@ -0,0 +1,184 @@ +############ mysql-test\t\max_binlog_stmt_cache_size_basic.test ############### +# # +# Variable Name: max_binlog_stmt_cache_size # +# Scope: GLOBAL # +# Access Type: Dynamic # +# Data Type: numeric # +# Default Value:4294967295 # +# Range: 4096-4294967295 # +# # +# # +# # +# # +# # +# Creation Date: 2010-11-05 # +# Author: Alfranio # +# # +# Description: Test Cases of Dynamic System Variable # +# max_binlog_stmt_cache_size that checks # +# the behavior of this variable in the following ways # +# * Default Value # +# * Valid & Invalid values # +# * Scope & Access method # +# * Data Integrity # +# # +# Reference: http://dev.mysql.com/doc/refman/5.5/en/ # +# server-system-variables.html # +# # +############################################################################### + +--source include/load_sysvars.inc + +########################################################################## +# START OF max_binlog_stmt_cache_size TESTS # +########################################################################## + + +############################################################################## +# Saving initial value of max_binlog_stmt_cache_size in a temporary variable # +############################################################################## + +SET @start_value = @@global.max_binlog_stmt_cache_size; +SELECT @start_value; + + +--echo '#--------------------FN_DYNVARS_072_01------------------------#' +######################################################################## +# Display the DEFAULT value of max_binlog_stmt_cache_size # +######################################################################## + +SET @@global.max_binlog_stmt_cache_size = 5000; +SET @@global.max_binlog_stmt_cache_size = DEFAULT; +SELECT @@global.max_binlog_stmt_cache_size; + + +--echo '#---------------------FN_DYNVARS_072_02-------------------------#' +############################################### +# Verify default value of variable # +############################################### + +SET @@global.max_binlog_stmt_cache_size = @start_value; +SELECT @@global.max_binlog_stmt_cache_size = 4294967295; + +--echo '#--------------------FN_DYNVARS_072_03------------------------#' +######################################################################## +# Change the value of max_binlog_stmt_cache_size to a valid value # +######################################################################## + +SET @@global.max_binlog_stmt_cache_size = 4096; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 4294967295; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 4294967294; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 4097; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 65535; +SELECT @@global.max_binlog_stmt_cache_size; + + +--echo '#--------------------FN_DYNVARS_072_04-------------------------#' +########################################################################### +# Change the value of max_binlog_stmt_cache_size to invalid value # +########################################################################### + +SET @@global.max_binlog_stmt_cache_size = -1; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 100000000000; +SELECT @@global.max_binlog_stmt_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_binlog_stmt_cache_size = 10000.01; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = -1024; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 1024; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 4294967296; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = 4095; +SELECT @@global.max_binlog_stmt_cache_size; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_binlog_stmt_cache_size = ON; +SELECT @@global.max_binlog_stmt_cache_size; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.max_binlog_stmt_cache_size = 'test'; +SELECT @@global.max_binlog_stmt_cache_size; + + +--echo '#-------------------FN_DYNVARS_072_05----------------------------#' +########################################################################### +# Test if accessing session max_binlog_stmt_cache_size gives error # +########################################################################### + +--Error ER_GLOBAL_VARIABLE +SET @@session.max_binlog_stmt_cache_size = 4096; +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT @@session.max_binlog_stmt_cache_size; + + +--echo '#----------------------FN_DYNVARS_072_06------------------------#' +############################################################################## +# Check if the value in GLOBAL & SESSION Tables matches values in variable # +############################################################################## + +SELECT @@global.max_binlog_stmt_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_binlog_stmt_cache_size'; + +SELECT @@max_binlog_stmt_cache_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.SESSION_VARIABLES +WHERE VARIABLE_NAME='max_binlog_stmt_cache_size'; + + +--echo '#---------------------FN_DYNVARS_072_07----------------------#' +################################################################### +# Check if TRUE and FALSE values can be used on variable # +################################################################### + +SET @@global.max_binlog_stmt_cache_size = TRUE; +SELECT @@global.max_binlog_stmt_cache_size; +SET @@global.max_binlog_stmt_cache_size = FALSE; +SELECT @@global.max_binlog_stmt_cache_size; + + +--echo '#---------------------FN_DYNVARS_072_08----------------------#' +######################################################################################################## +# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable # +######################################################################################################## + +SET @@global.max_binlog_stmt_cache_size = 5000; +SELECT @@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size; + + +--echo '#---------------------FN_DYNVARS_072_09----------------------#' +################################################################################ +# Check if max_binlog_stmt_cache_size can be accessed with and without @@ sign # +################################################################################ + +--Error ER_GLOBAL_VARIABLE +SET max_binlog_stmt_cache_size = 6000; +SELECT @@max_binlog_stmt_cache_size; +--Error ER_PARSE_ERROR +SET local.max_binlog_stmt_cache_size = 7000; +--Error ER_UNKNOWN_TABLE +SELECT local.max_binlog_stmt_cache_size; +--Error ER_PARSE_ERROR +SET global.max_binlog_stmt_cache_size = 8000; +--Error ER_UNKNOWN_TABLE +SELECT global.max_binlog_stmt_cache_size; +--Error ER_BAD_FIELD_ERROR +SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size; + + +############################## +# Restore initial value # +############################## + +SET @@global.max_binlog_stmt_cache_size = @start_value; +SELECT @@global.max_binlog_stmt_cache_size; + + +######################################################################## +# END OF max_binlog_stmt_cache_size TESTS # +######################################################################## diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index c3a080612a9..ce5047124a2 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1722,3 +1722,11 @@ INSERT INTO t1 VALUES (2); SELECT * FROM t1 ORDER BY a; SHOW CREATE TABLE t1; DROP TABLE t1; + +--echo # +--echo # BUG#58205 - Valgrind failure in fn_format when called from +--echo # archive_discover +--echo # +CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE; +remove_file $MYSQLD_DATADIR/test/a@002f@002e@002e@002f.frm; +DROP TABLE `a/../`; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 42751b8ce06..9da8c759d45 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -342,3 +342,24 @@ SELECT a FROM t2; DROP TABLE t1, t2; +--echo # +--echo # Bug#39828 autoinc wraps around when offset and increment > 1 +--echo # + +CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) engine=MyISAM; +INSERT INTO t1 VALUES(1); +INSERT INTO t1 VALUES (18446744073709551601); + +SET @@SESSION.AUTO_INCREMENT_INCREMENT=10; + +SELECT @@SESSION.AUTO_INCREMENT_OFFSET; +--error ER_WARN_DATA_OUT_OF_RANGE +INSERT INTO t1 VALUES (NULL), (NULL), (NULL); +SELECT * FROM t1; + +SET @@SESSION.AUTO_INCREMENT_INCREMENT=default; +SET @@SESSION.AUTO_INCREMENT_OFFSET=default; + +DROP TABLE t1; + +--echo End of 5.1 tests diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 4dfb0be3892..3203a1032b4 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -60,6 +60,16 @@ DROP TABLE t1; # End of 4.1 tests --echo # +--echo # Start of 5.1 tests +--echo # + +--source include/ctype_8bit.inc + +--echo # +--echo # End of 5.1 tests +--echo # + +--echo # --echo # Start of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_like_range.test b/mysql-test/t/ctype_like_range.test new file mode 100644 index 00000000000..34a7637222b --- /dev/null +++ b/mysql-test/t/ctype_like_range.test @@ -0,0 +1,87 @@ +--source include/have_debug.inc +--source include/have_ucs2.inc +--source include/have_utf16.inc +--source include/have_utf32.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +--enable_warnings + +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARBINARY(32)); +INSERT INTO t1 (a) VALUES (''),('_'),('%'),('\_'),('\%'),('\\'); +INSERT INTO t1 (a) VALUES ('a'),('c'); +INSERT INTO t1 (a) VALUES ('a_'),('c_'); +INSERT INTO t1 (a) VALUES ('a%'),('c%'); +INSERT INTO t1 (a) VALUES ('aa'),('cc'),('ch'); +INSERT INTO t1 (a) VALUES ('aa_'),('cc_'),('ch_'); +INSERT INTO t1 (a) VALUES ('aa%'),('cc%'),('ch%'); +INSERT INTO t1 (a) VALUES ('aaa'),('ccc'),('cch'); +INSERT INTO t1 (a) VALUES ('aaa_'),('ccc_'),('cch_'); +INSERT INTO t1 (a) VALUES ('aaa%'),('ccc%'),('cch%'); +INSERT INTO t1 (a) VALUES ('aaaaaaaaaaaaaaaaaaaa'); + +CREATE VIEW v1 AS + SELECT id, 'a' AS name, a AS val FROM t1 +UNION + SELECT id, 'mn', HEX(LIKE_RANGE_MIN(a, 16)) AS min FROM t1 +UNION + SELECT id, 'mx', HEX(LIKE_RANGE_MAX(a, 16)) AS max FROM t1 +UNION + SELECT id, 'sp', REPEAT('-', 32) AS sep FROM t1 +ORDER BY id, name; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_czech_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_czech_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_czech_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_czech_ci; +SELECT * FROM v1; + +ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci; +SELECT * FROM v1; + +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 67726c53585..5aa1f6e7c7d 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -217,6 +217,10 @@ DROP TABLE t1; --echo # +--echo # Start of 5.5 tests +--echo # + +--echo # --echo # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32 --echo # Testing that only utf8mb4 is superset for utf8 --echo # No other Unicode character set pairs have superset/subset relations @@ -284,3 +288,19 @@ SELECT CHARSET(CONCAT(utf32, utf8mb4)) FROM t1; SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1; DROP TABLE t1; + +--echo # +--echo # Bug#58321 No warning when characters outside BMP0 is converted to UCS2 +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32); +CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET ucs2); +INSERT INTO t1 VALUES (0x10082), (0x12345); +INSERT INTO t2 SELECT * FROM t1; +SELECT HEX(a) FROM t2; +DROP TABLE t1; +DROP TABLE t2; + + +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 11a489ba24d..723962bbb3f 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -545,3 +545,19 @@ set collation_connection=ucs2_unicode_ci; set names utf8; -- echo End for 5.0 tests + +--echo # +--echo # Start of 5.5 tests +--echo # +# +# Test my_like_range and contractions +# +SET collation_connection=utf8_czech_ci; +--source include/ctype_czech.inc +--source include/ctype_like_ignorable.inc +SET collation_connection=ucs2_czech_ci; +--source include/ctype_czech.inc +--source include/ctype_like_ignorable.inc +--echo # +--echo # End of 5.5 tests +--echo # diff --git a/mysql-test/t/ctype_utf16_uca.test b/mysql-test/t/ctype_utf16_uca.test index 5314777c6f4..a6295c82dec 100644 --- a/mysql-test/t/ctype_utf16_uca.test +++ b/mysql-test/t/ctype_utf16_uca.test @@ -284,6 +284,13 @@ DROP TABLE IF EXISTS t1; set collation_connection=utf16_unicode_ci; --source include/ctype_regex.inc +# +# Test my_like_range and contractions +# +SET collation_connection=utf16_czech_ci; +--source include/ctype_czech.inc +--source include/ctype_like_ignorable.inc + --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test index 9386cc9e65e..a62ffbf95c7 100644 --- a/mysql-test/t/ctype_utf32_uca.test +++ b/mysql-test/t/ctype_utf32_uca.test @@ -286,6 +286,14 @@ set collation_connection=utf32_unicode_ci; --source include/ctype_regex.inc +# +# Test my_like_range and contractions +# +SET collation_connection=utf32_czech_ci; +--source include/ctype_czech.inc +--source include/ctype_like_ignorable.inc + + --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 27e85ee237b..9711482c639 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -301,4 +301,37 @@ SELECT 0 FROM (SELECT 0) t56, (SELECT 0) t57, (SELECT 0) t58, (SELECT 0) t59, (SELECT 0) t60, (SELECT 0) t61; # 61 == MAX_TABLES +--echo # +--echo # A nested materialized derived table is used before being populated. +--echo # (addon for bug#19077) +--echo # + +CREATE TABLE t1 (i INT, j BIGINT); +INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); +SELECT * FROM (SELECT MIN(i) FROM t1 +WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3; +DROP TABLE t1; + --echo # End of 5.0 tests + + +--echo # +--echo # Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table, +--echo # temptable views +--echo # + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT, KEY (b)); +INSERT INTO t1 VALUES (1),(1); +INSERT INTO t2 VALUES (1),(1); + +CREATE algorithm=temptable VIEW v1 AS + SELECT 1 FROM t1 LEFT JOIN t1 t3 ON 1 > (SELECT 1 FROM t1); +CREATE algorithm=temptable VIEW v2 AS SELECT 1 FROM t2; + +# This caused the assert to be triggered. +--error ER_SUBQUERY_NO_1_ROW +EXPLAIN SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2); + +DROP TABLE t1, t2; +DROP VIEW v1, v2; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 13b3697cbf6..e4a1206fa9c 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -750,6 +750,17 @@ SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t G --enable_ps_protocol DROP TABLE t1; +--echo # +--echo # Bug#58396 group_concat and explain extended are still crashy +--echo # + +CREATE TABLE t1(a INT); +--error ER_UNKNOWN_ERROR +EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1') +FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1); +SHOW WARNINGS; +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 6d128be7f34..9a9c5442d87 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1118,3 +1118,14 @@ SELECT MAX(c1),MIN(c1) FROM t1; DROP TABLE t1; --echo # End of the bug#56120 +--echo # +--echo # Bug#57932 "query with AVG(DISTINCT) returns NULL if last +--echo # aggregated value was NULL" +--echo # +CREATE TABLE t1 (col_int_nokey int(11)); +INSERT INTO t1 VALUES (7),(8),(NULL); +SELECT AVG(DISTINCT col_int_nokey) FROM t1; +SELECT AVG(DISTINCT outr.col_int_nokey) FROM t1 AS outr LEFT JOIN t1 AS outr2 ON +outr.col_int_nokey = outr2.col_int_nokey; +DROP TABLE t1; +--echo # End of the bug#57932 diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test index 1bdfd8f54bb..bbc576b0fc7 100644 --- a/mysql-test/t/func_group_innodb.test +++ b/mysql-test/t/func_group_innodb.test @@ -83,3 +83,53 @@ explain select count(*), min(7), max(7) from t2m, t1i; select count(*), min(7), max(7) from t2m, t1i; drop table t1m, t1i, t2m, t2i; + + +--echo # +--echo # Bug #57954: BIT_AND function returns incorrect results when +--echo # semijoin=on + +CREATE TABLE c ( + pk INT, + col_varchar_key VARCHAR(1), + PRIMARY KEY (pk), + KEY col_varchar_key (col_varchar_key) +) ENGINE=InnoDB; +INSERT INTO c VALUES (11,NULL); +INSERT INTO c VALUES (16,'c'); +CREATE TABLE bb ( + pk INT, + col_varchar_key VARCHAR(1), + PRIMARY KEY (pk), + KEY col_varchar_key (col_varchar_key) +) ENGINE=InnoDB; +INSERT INTO bb VALUES (10,NULL); + +SELECT straight_join BIT_AND(c.pk) +FROM + bb, c + WHERE c.col_varchar_key='ABC' +ORDER BY c.pk; + +DROP TABLE c,bb; + +--echo # +--echo # Bug #58050: BIT_OR and BIT_XOR return incorrect results when +--echo # semijoin=on +--echo # + +CREATE TABLE t1 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1, 1, 1); + +CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1, 1, NULL); + +SELECT t1.* FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; +SELECT BIT_OR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; +SELECT BIT_AND(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; +SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1; + +DROP TABLE t1, t2; + + +--echo End of 5.5 tests diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 1a5c5373841..9257314013d 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -480,6 +480,13 @@ SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1; DROP TABLE t1; +# +# Bug #57283: inet_ntoa() crashes +# +SELECT INET_NTOA(0); +SELECT '1' IN ('1', INET_NTOA(0)); + + --echo # --echo # Bug #52165: Assertion failed: file .\dtoa.c, line 465 --echo # diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 7b7bffd0bbc..aff99d7e303 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1363,6 +1363,13 @@ SELECT 1 FROM t1, t1 t2 ORDER BY QUOTE(t1.a); DROP TABLE t1; +--echo # +--echo # Bug#57913 large negative number to string conversion functions crash +--echo # Bug#57810 case/when/then : Assertion failed: length || !scale +--echo # +SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1)); +SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); + --echo End of 5.1 tests --echo Start of 5.4 tests diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 8ed0ed45b82..0e2abe578ce 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -672,4 +672,15 @@ SET t3.a = 0; DROP TABLE t1, t2, t3; SET SESSION sql_safe_updates = DEFAULT; +--echo # +--echo # Bug#52157 various crashes and assertions with multi-table update, stored function +--echo # + +CREATE FUNCTION f1 () RETURNS BLOB RETURN 1; +CREATE TABLE t1 (f1 DATE); +INSERT INTO t1 VALUES('2001-01-01'); +UPDATE (SELECT 1 FROM t1 WHERE f1 = (SELECT f1() FROM t1)) x, t1 SET f1 = 1; +DROP FUNCTION f1; +DROP TABLE t1; + --echo end of tests diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index 3a2084aef08..7b5b2a0ded0 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -426,4 +426,147 @@ drop table t1; --exec $MYSQL --skip-column-names --vertical test -e "select 1 as a" --echo + +--echo # +--echo # Bug #54899: --one-database option cannot handle DROP/CREATE DATABASE +--echo # commands. +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/bug54899.sql +DROP DATABASE connected_db; +CREATE DATABASE connected_db; +USE connected_db; +CREATE TABLE `table_in_connected_db`(a INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/bug54899.sql +USE connected_db; +SHOW TABLES; +DROP DATABASE connected_db; +--remove_file $MYSQLTEST_VARDIR/tmp/bug54899.sql + +--echo + +--echo # +--echo # Testing --one-database option +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +CREATE TABLE t1 (i INT); +CREATE TABLE test.t1 (i INT); +USE test; +# Following statements should be filtered. +CREATE TABLE connected_db.t2 (i INT); +CREATE TABLE t2 (i INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN connected_db; +SHOW TABLES IN test; +USE test; +DROP TABLE t1; +DROP DATABASE connected_db; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +CREATE DATABASE test1; +USE test1; +USE test1; +# Following statements should be filtered. +CREATE TABLE connected_db.t1 (i INT); +EOF + +--exec $MYSQL --one-database test < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN test; +SHOW TABLES IN test1; +DROP DATABASE test1; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo + +--echo # +--echo # Checking --one-database option followed by the execution of +--echo # connect command. +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +CREATE TABLE t1 (i INT); +CREATE TABLE test.t1 (i INT); +CONNECT test; +CREATE TABLE connected_db.t2 (i INT); +CREATE TABLE t2 (i INT); +USE connected_db; +# Following statements should be filtered. +CREATE TABLE connected_db.t3 (i INT); +CREATE TABLE t3 (i INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN connected_db; +SHOW TABLES IN test; +DROP TABLE test.t1; +DROP TABLE test.t2; +DROP DATABASE connected_db; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo + +--echo # +--echo # Checking --one-database option with no database specified +--echo # at command-line. +--echo # +--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql +# All following statements should be filtered. +CREATE TABLE t1 (i INT); +CREATE TABLE test.t1 (i INT); +USE test; +CREATE TABLE test.t2 (i INT); +CREATE TABLE t2 (i INT); +EOF + +--exec $MYSQL --one-database < $MYSQLTEST_VARDIR/tmp/one_db.sql +SHOW TABLES IN test; +--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql + +--echo + +--echo # +--echo # Checking --one-database option with non_existent_db +--echo # specified with USE command +--echo # + +# CASE 1 : When 'connected_db' database exists and passed at commandline. +--write_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql +CREATE TABLE `table_in_connected_db`(i INT); +USE non_existent_db; +# Following statement should be filtered out. +CREATE TABLE `table_in_non_existent_db`(i INT); +EOF + +# CASE 2 : When 'connected_db' database exists but dropped and recreated in +# load file. +--write_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql +DROP DATABASE connected_db; +CREATE DATABASE connected_db; +USE non_existent_db; +# Following statements should be filtered out. +CREATE TABLE `table_in_non_existent_db`(i INT); +USE connected_db; +# Following statements should not be filtered out. +CREATE TABLE `table_in_connected_db`(i INT); +EOF + +CREATE DATABASE connected_db; +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db_1.sql +SHOW TABLES IN connected_db; +--echo +--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db_2.sql +SHOW TABLES IN connected_db; +DROP DATABASE connected_db; + +--remove_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql +--remove_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql + +--echo --echo End of tests diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 427cfa598ae..7108b9f9878 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1276,12 +1276,24 @@ if ($ifvar != goodbye) { echo hello != goodbye; } - +let $ifvar= 'quoted'; +if ($ifvar == ''quoted'') +{ + echo 'quoted' == ''quoted''; +} let $ifvar= two words; if ($ifvar == two words) { echo two words; } +if ($ifvar == 'two words') +{ + echo 'two words'; +} +if ($ifvar == "two words") +{ + echo "two words"; +} if ($ifvar == `SELECT 'two words'`) { echo two words are two words; @@ -1342,6 +1354,11 @@ EOF --exec $MYSQL_TEST < $MYSQL_TMP_DIR/mysqltest.sql 2>&1 remove_file $MYSQL_TMP_DIR/mysqltest.sql; +--error 1 +--exec echo "if (\$var ==) {" | $MYSQL_TEST 2>&1 +--error 1 +--exec echo "if (\$var > ) {" | $MYSQL_TEST 2>&1 + # ---------------------------------------------------------------------------- # Test while with compare conditions # ---------------------------------------------------------------------------- @@ -2113,6 +2130,7 @@ EOF cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp; +--replace_regex /my_errno=[0-9]*/(my_errno)/ --error 1 --exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1 diff --git a/mysql-test/t/partition_binlog.test b/mysql-test/t/partition_binlog.test new file mode 100644 index 00000000000..c1f618b794f --- /dev/null +++ b/mysql-test/t/partition_binlog.test @@ -0,0 +1,42 @@ +--source include/have_log_bin.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +--echo # +--echo # Bug#58147: ALTER TABLE w/ TRUNCATE PARTITION fails +--echo # but the statement is written to binlog +--echo # + +CREATE TABLE t1(id INT) +PARTITION BY RANGE (id) +(PARTITION p0 VALUES LESS THAN (100), + PARTITION pmax VALUES LESS THAN (MAXVALUE)); + +INSERT INTO t1 VALUES (1), (10), (100), (1000); + +--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1) +--let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1) + +--error ER_WRONG_PARTITION_NAME +ALTER TABLE t1 TRUNCATE PARTITION p1; +--error ER_DROP_PARTITION_NON_EXISTENT +ALTER TABLE t1 DROP PARTITION p1; + +--echo # No error returned, output in table format instead: +ALTER TABLE t1 ANALYZE PARTITION p1; +ALTER TABLE t1 CHECK PARTITION p1; +ALTER TABLE t1 OPTIMIZE PARTITION p1; +ALTER TABLE t1 REPAIR PARTITION p1; + +ALTER TABLE t1 ANALYZE PARTITION p0; +ALTER TABLE t1 CHECK PARTITION p0; +ALTER TABLE t1 OPTIMIZE PARTITION p0; +ALTER TABLE t1 REPAIR PARTITION p0; +ALTER TABLE t1 TRUNCATE PARTITION p0; +ALTER TABLE t1 DROP PARTITION p0; + +--source include/show_binlog_events.inc + +DROP TABLE t1; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 86bbe359873..cd371a8f79a 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -33,6 +33,7 @@ SELECT count(*) FROM t1 p where c3 in DROP TABLE t1; + --echo # --echo # Bug#54747: Deadlock between REORGANIZE PARTITION and --echo # SELECT is not detected @@ -134,6 +135,7 @@ SELECT * FROM t1; COMMIT; DROP TABLE t1; + --echo # --echo # Bug#51830: Incorrect partition pruning on range partition (regression) --echo # @@ -588,6 +590,7 @@ CREATE TABLE t1 (i1 int NOT NULL primary key, f1 int) ENGINE = InnoDB INSERT INTO t1 VALUES (1,1), (2,2); SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 ); + DROP TABLE t1; --enable_parsing diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test index 3b1dd93c4d1..49fbfa6995b 100644 --- a/mysql-test/t/plugin_auth.test +++ b/mysql-test/t/plugin_auth.test @@ -394,4 +394,18 @@ FLUSH PRIVILEGES; FLUSH PRIVILEGES; +--echo # +--echo # Bug#58139 : default-auth option not recognized in MySQL standardi +--echo # command line clients +--echo # + +--echo # Executing 'mysql' +--exec $MYSQL -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT -e "SELECT 1" + +--echo # Executing 'mysqladmin' +--exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT ping + +--echo # Executing 'mysqldump' +--exec $MYSQL_DUMP -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --compact --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT test + --echo End of 5.5 tests diff --git a/mysql-test/t/plugin_not_embedded.test b/mysql-test/t/plugin_not_embedded.test index 15aff548c29..40024efcaad 100644 --- a/mysql-test/t/plugin_not_embedded.test +++ b/mysql-test/t/plugin_not_embedded.test @@ -18,3 +18,15 @@ UNINSTALL PLUGIN example; disconnect con1; connection default; DROP USER bug51770@localhost; + +# +# BUG#58246: INSTALL PLUGIN not secure & crashable +# +# The bug consisted of not recognizing / on Windows, so checking / on +# all platforms should cover this case. + +let $path = `select CONCAT_WS('/', '..', $HA_EXAMPLE_SO)`; +--replace_regex /\.dll/.so/ +--error ER_UDF_NO_PATHS +eval INSTALL PLUGIN example SONAME '$path'; + diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 75099523062..d31939ed3dd 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1243,6 +1243,50 @@ SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size; SELECT @@skip_name_resolve; SHOW VARIABLES LIKE 'skip_name_resolve'; +--echo # +--echo # Bug #43233 : Some server variables are clipped during "update," +--echo # not "check" stage +--echo # + +SET @kbs=@@global.key_buffer_size; +SET @kcbs=@@global.key_cache_block_size; + +--echo throw errors in STRICT mode +SET SQL_MODE=STRICT_ALL_TABLES; + +# sys_var_ulonglong_ptr: sys_max_binlog_cache_size +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.max_binlog_cache_size=-1; + +# sys_var_thd_ha_rows: "max_join_size" et al. +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.max_join_size=0; + +# sys_var_key_buffer_size: "key_buffer_size" +--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE +SET @@global.key_buffer_size=0; + +# sys_var_key_cache_long: "key_cache_block_size" et al. +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.key_cache_block_size=0; + +--echo throw warnings in default mode +SET SQL_MODE=DEFAULT; + +SET @@global.max_binlog_cache_size=-1; +SET @@global.max_join_size=0; +# this is an exception. since this is a new error/warning, let's stay +# compatible with the upcoming 5.6. +--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE +SET @@global.key_buffer_size=0; +SET @@global.key_cache_block_size=0; + +# cleanup +SET @@global.max_binlog_cache_size=DEFAULT; +SET @@global.max_join_size=DEFAULT; +SET @@global.key_buffer_size=@kbs; +SET @@global.key_cache_block_size=@kcbs; + --echo End of 5.1 tests ########################################################################### diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 236f2e84770..c82443e792f 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3963,6 +3963,22 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); DROP VIEW v1; DROP TABLE t1; +--echo # +--echo # Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846 +--echo # + +CREATE TABLE t1(a int); +CREATE VIEW v1 AS SELECT 1 FROM t1 GROUP BY +SUBSTRING(1 FROM (SELECT 3 FROM t1 WHERE a >= ANY(SELECT 1))); +DROP VIEW v1; +DROP TABLE t1; + +--echo # +--echo # Bug#57352 valgrind warnings when creating view +--echo # +CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f; +DROP VIEW v1; + --echo # ----------------------------------------------------------------- --echo # -- End of 5.1 tests. --echo # ----------------------------------------------------------------- diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 0d63c2cb3ff..bb3a95208bb 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -770,13 +770,52 @@ fun:lf_hash_insert } +# +# Note that initialize_bucket() is reccursive, +# can't provide more stack context. +# { missing shutdown_performance_schema 3 Memcheck:Leak fun:malloc fun:my_malloc fun:initialize_bucket +} + +{ + missing shutdown_performance_schema 4 + Memcheck:Leak + fun:malloc + fun:my_malloc + fun:_lf_dynarray_lvalue + fun:_lf_pinbox_get_pins + fun:lf_pinbox_get_pins +} + +{ + missing shutdown_performance_schema 5 + Memcheck:Leak + fun:malloc + fun:my_malloc + fun:_lf_dynarray_lvalue + fun:lf_hash_insert +} + +{ + missing shutdown_performance_schema 6 + Memcheck:Leak + fun:malloc + fun:my_malloc + fun:_lf_dynarray_lvalue + fun:lf_hash_delete +} + +{ + missing shutdown_performance_schema 7 + Memcheck:Leak + fun:malloc + fun:my_malloc + fun:_lf_dynarray_lvalue fun:lf_hash_search - fun:_Z19find_or_create_fileP10PFS_threadP14PFS_file_classPKcj } |