diff options
author | Eugene Kosov <claprix@yandex.ru> | 2019-07-09 13:22:22 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2019-07-09 13:22:22 +0300 |
commit | 26c389b7b770a3699ec1fc81df7f379f6084c9e6 (patch) | |
tree | 7f915e858b211834deeb52928dfdf5ab12b24bfe | |
parent | b9557418ccd9f484806515fba030757274e691f2 (diff) | |
parent | fd08f953222b854428dc259631e8fc707fe34619 (diff) | |
download | mariadb-git-26c389b7b770a3699ec1fc81df7f379f6084c9e6.tar.gz |
Merge 10.1 into 10.2
49 files changed, 616 insertions, 170 deletions
diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index 4efee737c8e..8a5695a246c 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -26,13 +26,9 @@ MACRO(CHECK_SYSTEMD) pkg_search_module(LIBSYSTEMD libsystemd libsystemd-daemon) ENDIF() IF(HAVE_DLOPEN) - SET(LIBSYSTEMD ${LIBSYSTEMD_LIBRARIES}) - #SET(CMAKE_REQUIRED_FLAGS ${LIBSYSTEMD_CFLAGS}) - SET(MYSQLD_LINK_FLAGS "${MYSQLD_LINK_FLAGS} ${LIBSYSTEMD_LDFLAGS}") + SET(LIBSYSTEMD ${LIBSYSTEMD_LDFLAGS} ${LIBSYSTEMD_LIBRARIES}) ELSE() - SET(LIBSYSTEMD ${LIBSYSTEMD_STATIC_LIBRARIES}) - #SET(CMAKE_REQUIRED_FLAGS ${LIBSYSTEMD_STATIC_CFLAGS}) - SET(MYSQLD_LINK_FLAGS "${MYSQLD_LINK_FLAGS} ${LIBSYSTEMD_STATIC_LDFLAGS}") + SET(LIBSYSTEMD ${LIBSYSTEMD_STATIC_LDFLAGS} ${LIBSYSTEMD_STATIC_LIBRARIES}) ENDIF() ELSE() SET(LIBSYSTEMD systemd) diff --git a/extra/yassl/taocrypt/src/des.cpp b/extra/yassl/taocrypt/src/des.cpp index 5b6fd9aa05b..f921cfcc977 100644 --- a/extra/yassl/taocrypt/src/des.cpp +++ b/extra/yassl/taocrypt/src/des.cpp @@ -224,7 +224,7 @@ void BasicDES::SetKey(const byte* key, word32 /*length*/, CipherDir dir) byte *const pc1m = buffer; /* place to modify pc1 into */ byte *const pcr = pc1m + 56; /* place to rotate pc1 into */ byte *const ks = pcr + 56; - register int i,j,l; + int i,j,l; int m; for (j = 0; j < 56; j++) { /* convert pc1 to bits of key */ diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index ecc0830c3df..c88b1170a80 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -338,6 +338,13 @@ sub new { # Skip comment next; } + # Correctly process Replication Filter when they are defined + # with connection name. + elsif ( $line =~ /^([\w]+.[\w]+)\s*=\s*(.*)\s*/){ + my $option= $1; + my $value= $2; + $self->insert($group_name, $option, $value); + } else { croak "Unexpected line '$line' found in '$path'"; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 68bd03ef5ca..d88d99ce2f9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1891,7 +1891,10 @@ sub collect_mysqld_features { if (/Copyright/ .. /^-{30,}/) { # here we want to detect all not mandatory plugins # they are listed in the --help output as - # --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load). + # --archive[=name] + # Enable or disable ARCHIVE plugin. Possible values are ON, OFF, + # FORCE (don't start if the plugin fails to load), + # FORCE_PLUS_PERMANENT (like FORCE, but the plugin can not be uninstalled). push @optional_plugins, $1 if /^ --([-a-z0-9]+)\[=name\] +Enable or disable \w+ plugin. One of: ON, OFF, FORCE/; next; diff --git a/mysql-test/r/repair_symlink-5543.result b/mysql-test/r/repair_symlink-5543.result index c77e7162a51..2024c9f5684 100644 --- a/mysql-test/r/repair_symlink-5543.result +++ b/mysql-test/r/repair_symlink-5543.result @@ -1,7 +1,7 @@ create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR'; insert t1 values (1); -# Some systems fail with errcode 40, when doing openat, while others -# don't have openat and fail with errcode 20. +# Some systems fail with errcode 40, or 90 (MIPS) when doing openat, +# while others don't have openat and fail with errcode 20. repair table t1; Table Op Msg_type Msg_text test.t1 repair error 20 for record at pos 0 diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index d13af4437f3..310413f4924 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -8327,6 +8327,20 @@ UNION SELECT * FROM INFORMATION_SCHEMA.TABLES JOIN INFORMATION_SCHEMA.PARAMETERS; DROP FUNCTION f; DROP VIEW v; +# +# MDEV-17963: Assertion `field_pos < field_count' failed in Protocol_text::store, +# Assertion `field_handlers == 0 || field_pos < field_count' +# +CREATE TABLE t1 (ct time); +INSERT INTO t1 VALUES ('16:11:28'); +CREATE FUNCTION f1 () RETURNS varchar(100) +BEGIN +DECLARE xxx varchar(100); +ANALYZE SELECT sum(ct) FROM t1 INTO xxx ; +RETURN xxx; +END| +ERROR 0A000: Not allowed to return a result set from a function +drop table t1; #End of 10.1 tests # # MDEV-11081: CURSOR for query with GROUP BY diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 0d75e56b4ac..ef312aad92e 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1146,6 +1146,16 @@ a 00:01:00 DROP TABLE t1; # +# MDEV-17857 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed upon SELECT with GROUP BY +# +CREATE TABLE t1 (i INT, d DATETIME); +INSERT INTO t1 VALUES (3,NULL),(3,'1976-12-14 13:21:07'),(NULL,'1981-09-24 01:04:47'); +SELECT ExtractValue('foo','bar'), i, MIN(d) FROM t1 GROUP BY i; +ExtractValue('foo','bar') i MIN(d) + NULL 1981-09-24 01:04:47 + 3 1976-12-14 13:21:07 +DROP TABLE t1; +# # End of 10.1 tests # # diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid.result b/mysql-test/suite/galera/r/galera_as_slave_gtid.result index 0ef9d208bf4..12fc6b5ba4d 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_gtid.result +++ b/mysql-test/suite/galera/r/galera_as_slave_gtid.result @@ -22,3 +22,7 @@ connection node_3; connection node_2; STOP SLAVE; RESET SLAVE ALL; +#cleanup +reset master; +reset master; +reset master; diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result index a6f0ef12be1..2fb59fc200f 100644 --- a/mysql-test/suite/galera/r/galera_log_bin.result +++ b/mysql-test/suite/galera/r/galera_log_bin.result @@ -1,3 +1,7 @@ +connection node_1; +reset master; +connection node_2; +reset master; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); CREATE TABLE t2 (id INT) ENGINE=InnoDB; @@ -12,58 +16,60 @@ COUNT(*) = 2 1 connection node_1; ALTER TABLE t1 ADD COLUMN f2 INTEGER; -FLUSH LOGS; -SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,21; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -mysqld-bin.000002 # Gtid # # GTID 0-1-1 -mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB -mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2 -mysqld-bin.000002 # Annotate_rows # # INSERT INTO t1 VALUES (1) -mysqld-bin.000002 # Table_map # # table_id: # (test.t1) -mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000002 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000002 # Gtid # # GTID 0-1-3 -mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB -mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4 -mysqld-bin.000002 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000002 # Table_map # # table_id: # (test.t2) -mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000002 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5 -mysqld-bin.000002 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000002 # Table_map # # table_id: # (test.t2) -mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000002 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000002 # Gtid # # GTID 0-1-6 -mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER connection node_2; SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; COUNT(*) = 2 1 -SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,21; +include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -mysqld-bin.000003 # Gtid # # GTID 0-1-1 -mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB -mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2 -mysqld-bin.000003 # Annotate_rows # # INSERT INTO t1 VALUES (1) -mysqld-bin.000003 # Table_map # # table_id: # (test.t1) -mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000003 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000003 # Gtid # # GTID 0-1-3 -mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB -mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4 -mysqld-bin.000003 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000003 # Table_map # # table_id: # (test.t2) -mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000003 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5 -mysqld-bin.000003 # Annotate_rows # # INSERT INTO t2 VALUES (1) -mysqld-bin.000003 # Table_map # # table_id: # (test.t2) -mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F -mysqld-bin.000003 # Xid # # COMMIT /* xid=# */ -mysqld-bin.000003 # Gtid # # GTID 0-1-6 -mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t1) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# +mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) +mysqld-bin.000001 # Table_map # # table_id: # (test.t2) +mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Xid # # COMMIT /* XID */ +mysqld-bin.000001 # Gtid # # GTID #-#-# +mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER DROP TABLE t1; DROP TABLE t2; +#cleanup connection node_1; RESET MASTER; +connection node_2; +reset master; diff --git a/mysql-test/suite/galera/r/galera_log_output_csv.result b/mysql-test/suite/galera/r/galera_log_output_csv.result index 5cb61b36332..ea218abbb59 100644 --- a/mysql-test/suite/galera/r/galera_log_output_csv.result +++ b/mysql-test/suite/galera/r/galera_log_output_csv.result @@ -18,3 +18,5 @@ COUNT(*) = 1 1 connection node_1; DROP TABLE t1; +truncate table mysql.slow_log; +truncate table mysql.general_log; diff --git a/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result index 1a8733e2e1a..afe72a10877 100644 --- a/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result +++ b/mysql-test/suite/galera/r/galera_var_gtid_domain_id.result @@ -78,6 +78,11 @@ wsrep_gtid_mode 1 # On node_1 connection node_1; DROP TABLE t1, t2; +#cleanup +connection node_1; +reset master; +connection node_2; +reset master; disconnect node_2; disconnect node_1; # End of test diff --git a/mysql-test/suite/galera/r/mdev_10518.result b/mysql-test/suite/galera/r/mdev_10518.result index 4ccd5fd1d23..aedf7cc4038 100644 --- a/mysql-test/suite/galera/r/mdev_10518.result +++ b/mysql-test/suite/galera/r/mdev_10518.result @@ -78,6 +78,11 @@ wsrep_gtid_mode 1 # On node_1 connection node_1; DROP TABLE t1, t2; +#cleanup +connection node_1; +reset master; +connection node_2; +reset master; disconnect node_2; disconnect node_1; # End of test diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.test b/mysql-test/suite/galera/t/galera_as_slave_gtid.test index c2331a2ae05..a3c43540916 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_gtid.test +++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.test @@ -65,3 +65,13 @@ DROP TABLE t1; STOP SLAVE; RESET SLAVE ALL; + +--echo #cleanup +--connection node_1 +reset master; + +--connection node_2 +reset master; + +--connection node_3 +reset master; diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test index 2f0faa761c5..c3d94d15194 100644 --- a/mysql-test/suite/galera/t/galera_log_bin.test +++ b/mysql-test/suite/galera/t/galera_log_bin.test @@ -1,6 +1,11 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--connection node_1 +reset master; +--connection node_2 +reset master; + # # Test Galera with --log-bin --log-slave-updates . # This way the actual MySQL binary log is used, @@ -20,20 +25,19 @@ SELECT COUNT(*) = 2 FROM t2; --connection node_1 ALTER TABLE t1 ADD COLUMN f2 INTEGER; - -FLUSH LOGS; ---replace_column 2 # 4 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,21; +--let $MASTER_MYPORT=$NODE_MYPORT_1 +--source include/show_binlog_events.inc --connection node_2 SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; ---replace_column 2 # 4 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,21; +--let $MASTER_MYPORT=$NODE_MYPORT_2 +--source include/show_binlog_events.inc DROP TABLE t1; DROP TABLE t2; +--echo #cleanup --connection node_1 RESET MASTER; +--connection node_2 +reset master; diff --git a/mysql-test/suite/galera/t/galera_log_output_csv.test b/mysql-test/suite/galera/t/galera_log_output_csv.test index 94ae3dd6168..eeccc953187 100644 --- a/mysql-test/suite/galera/t/galera_log_output_csv.test +++ b/mysql-test/suite/galera/t/galera_log_output_csv.test @@ -22,3 +22,5 @@ SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1'; --connection node_1 DROP TABLE t1; +truncate table mysql.slow_log; +truncate table mysql.general_log; diff --git a/mysql-test/suite/galera/t/galera_sync_wait_show.test b/mysql-test/suite/galera/t/galera_sync_wait_show.test index edad2840da2..1d240cc40d4 100644 --- a/mysql-test/suite/galera/t/galera_sync_wait_show.test +++ b/mysql-test/suite/galera/t/galera_sync_wait_show.test @@ -64,7 +64,9 @@ DROP TABLE t1; --connection node_1 +--disable_warnings CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1; +--enable_warnings --connection node_2 SHOW CREATE EVENT event1; diff --git a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test index c4127b4f655..015f25abf2f 100644 --- a/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test +++ b/mysql-test/suite/galera/t/galera_var_gtid_domain_id.test @@ -48,6 +48,13 @@ source include/print_gtid.inc; # Cleanup DROP TABLE t1, t2; +--echo #cleanup +--connection node_1 +reset master; + +--connection node_2 +reset master; + --source include/galera_end.inc --echo # End of test diff --git a/mysql-test/suite/galera/t/mdev_10518.test b/mysql-test/suite/galera/t/mdev_10518.test index c4127b4f655..015f25abf2f 100644 --- a/mysql-test/suite/galera/t/mdev_10518.test +++ b/mysql-test/suite/galera/t/mdev_10518.test @@ -48,6 +48,13 @@ source include/print_gtid.inc; # Cleanup DROP TABLE t1, t2; +--echo #cleanup +--connection node_1 +reset master; + +--connection node_2 +reset master; + --source include/galera_end.inc --echo # End of test diff --git a/mysql-test/suite/multi_source/mdev-8874.cnf b/mysql-test/suite/multi_source/mdev-8874.cnf new file mode 100644 index 00000000000..dc89db72772 --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-8874.cnf @@ -0,0 +1,25 @@ +!include my.cnf + +[mysqld.1] +log-bin +log-slave-updates + +[mysqld.2] +log-bin +log-slave-updates + +[mysqld.3] +log-bin +log-slave-updates + +[mysqld.4] +server-id=4 +log-bin=server4-bin +log-slave-updates +m1.replicate_ignore_table='a.t1' +m2.replicate_ignore_table='b.t1' +replicate_ignore_table='c.t1' + +[ENV] +SERVER_MYPORT_4= @mysqld.4.port +SERVER_MYSOCK_4= @mysqld.4.socket diff --git a/mysql-test/suite/multi_source/mdev-8874.result b/mysql-test/suite/multi_source/mdev-8874.result new file mode 100644 index 00000000000..25185eed02a --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-8874.result @@ -0,0 +1,114 @@ +create database a; +use a; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +create database b; +use b; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +create database c; +use c; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root'; +change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root'; +change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root'; +start all slaves; +set default_master_connection = 'm1'; +include/wait_for_slave_to_start.inc +set default_master_connection = 'm2'; +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +include/wait_for_slave_to_start.inc +select @@global.'m1'.replicate_ignore_table; +@@global.'m1'.replicate_ignore_table +a.t1 +select @@global.'m2'.replicate_ignore_table; +@@global.'m2'.replicate_ignore_table +b.t1 +select @@global.replicate_ignore_table; +@@global.replicate_ignore_table +c.t1 +use a; +#No t1 table +show tables; +Tables_in_a +t2 +use b; +#No t1 table +show tables; +Tables_in_b +t2 +use c; +#No t1 table +show tables; +Tables_in_c +t2 +#TEST +STOP ALL SLAVES; +Warnings: +Note 1938 SLAVE 'm2' stopped +Note 1938 SLAVE '' stopped +Note 1938 SLAVE 'm1' stopped +RESET SLAVE 'm1' ALL ; +RESET SLAVE 'm2' ALL ; +RESET SLAVE ALL ; +drop database a; +drop database b; +drop database c; +change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root'; +change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root'; +change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root'; +start all slaves; +Warnings: +Note 1937 SLAVE 'm2' started +Note 1937 SLAVE '' started +Note 1937 SLAVE 'm1' started +set default_master_connection = 'm1'; +include/wait_for_slave_to_start.inc +set default_master_connection = 'm2'; +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +include/wait_for_slave_to_start.inc +#Replication Filter should be intact (t1 still not replicated) +select @@global.'m1'.replicate_ignore_table; +@@global.'m1'.replicate_ignore_table +a.t1 +select @@global.'m2'.replicate_ignore_table; +@@global.'m2'.replicate_ignore_table +b.t1 +select @@global.replicate_ignore_table; +@@global.replicate_ignore_table +c.t1 +use a; +#No t1 table +show tables; +Tables_in_a +t2 +use b; +#No t1 table +show tables; +Tables_in_b +t2 +use c; +#No t1 table +show tables; +Tables_in_c +t2 +#CleanUp +drop database a; +drop database b; +drop database c; +stop all slaves; +SET default_master_connection = "m1"; +include/wait_for_slave_to_stop.inc +SET default_master_connection = "m2"; +include/wait_for_slave_to_stop.inc +SET default_master_connection = ""; +include/wait_for_slave_to_stop.inc diff --git a/mysql-test/suite/multi_source/mdev-8874.test b/mysql-test/suite/multi_source/mdev-8874.test new file mode 100644 index 00000000000..d03c255b911 --- /dev/null +++ b/mysql-test/suite/multi_source/mdev-8874.test @@ -0,0 +1,141 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc +--source include/have_debug.inc +# MDEV-8874 +# In Named Master slave connection if we do reset slave 'connection_name' ALL and then +# if we reconnect slave, replication filters are ignored. +# This patch fixes this issue. +--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2) +--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3) +--connect (server_4,127.0.0.1,root,,,$SERVER_MYPORT_4) + +--connection server_1 +create database a; +use a; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +--save_master_pos + +--connection server_2 +create database b; +use b; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +--save_master_pos + +--connection server_3 +create database c; +use c; +create table t1(a int); +insert into t1 values(1); +create table t2(a int); +insert into t2 values(1); +--save_master_pos + +--connection server_4 +--disable_warnings +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_3 MYPORT_3 +eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root'; +start all slaves; +set default_master_connection = 'm1'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = 'm2'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = ''; +--source include/wait_for_slave_to_start.inc +select @@global.'m1'.replicate_ignore_table; +select @@global.'m2'.replicate_ignore_table; +select @@global.replicate_ignore_table; + +--enable_warnings +--sync_with_master 0,'m1' +--sync_with_master 0,'m2' +--sync_with_master 0,'' +use a; +--echo #No t1 table +show tables; +use b; +--echo #No t1 table +show tables; +use c; +--echo #No t1 table +show tables; +--echo #TEST +STOP ALL SLAVES; +RESET SLAVE 'm1' ALL ; +RESET SLAVE 'm2' ALL ; +RESET SLAVE ALL ; +drop database a; +drop database b; +drop database c; +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_3 MYPORT_3 +eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root'; +start all slaves; +set default_master_connection = 'm1'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = 'm2'; +--source include/wait_for_slave_to_start.inc +set default_master_connection = ''; +--source include/wait_for_slave_to_start.inc +--sync_with_master 0,'m1' +--sync_with_master 0,'m2' +--sync_with_master 0,'' + +--echo #Replication Filter should be intact (t1 still not replicated) +select @@global.'m1'.replicate_ignore_table; +select @@global.'m2'.replicate_ignore_table; +select @@global.replicate_ignore_table; +use a; +--echo #No t1 table +show tables; +use b; +--echo #No t1 table +show tables; +use c; +--echo #No t1 table +show tables; + + +#--echo #restart the server +#--source include/restart_mysqld.inc + + +--echo #CleanUp +--connection server_1 +drop database a; +--save_master_pos + +--connection server_2 +drop database b; +--save_master_pos + +--connection server_3 +drop database c; +--save_master_pos + +--connection server_4 +--sync_with_master 0,'m1' +--sync_with_master 0,'m2' +--sync_with_master 0,'' +--disable_warnings +stop all slaves; +--enable_warnings +SET default_master_connection = "m1"; +--source include/wait_for_slave_to_stop.inc +SET default_master_connection = "m2"; +--source include/wait_for_slave_to_stop.inc +SET default_master_connection = ""; +--source include/wait_for_slave_to_stop.inc diff --git a/mysql-test/suite/rpl/r/kill_race_condition.result b/mysql-test/suite/rpl/r/kill_race_condition.result index 87ee3214b8e..1181eb0b0b1 100644 --- a/mysql-test/suite/rpl/r/kill_race_condition.result +++ b/mysql-test/suite/rpl/r/kill_race_condition.result @@ -1,18 +1,23 @@ include/master-slave.inc [connection master] +connection master; +create table t1 (a int); +connection slave; connection slave; set global debug_dbug='d,rows_log_event_before_open_table'; -set debug_sync='now WAIT_FOR before_open_table'; connection master; -create table t1 (a int); insert t1 values (1),(2),(3); connection slave; +set debug_sync='now WAIT_FOR before_open_table'; kill slave_sql_thread; set debug_sync='now SIGNAL go_ahead_sql'; +include/wait_for_slave_sql_error.inc [errno=1927] +Last_SQL_Error = Error executing row event: 'Connection was killed' set global debug_dbug=''; set debug_sync='RESET'; connection master; drop table t1; connection slave; -start slave; +include/start_slave.inc +Last_SQL_Error = include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result b/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result index 68ad4877927..5ba751155e6 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result @@ -27,10 +27,6 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na plugin_name plugin_status rpl_semi_sync_slave DELETED connection master; -show global status like "Slave%_connect%"; -Variable_name Value -Slave_connections 2 -Slaves_connected 1 UNINSTALL PLUGIN rpl_semi_sync_master; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown diff --git a/mysql-test/suite/rpl/t/kill_race_condition.test b/mysql-test/suite/rpl/t/kill_race_condition.test index 4268c12cdbf..0f3b44864fe 100644 --- a/mysql-test/suite/rpl/t/kill_race_condition.test +++ b/mysql-test/suite/rpl/t/kill_race_condition.test @@ -2,27 +2,34 @@ source include/have_debug_sync.inc; source include/have_binlog_format_row.inc; source include/master-slave.inc; +connection master; +create table t1 (a int); +--sync_slave_with_master + connection slave; set global debug_dbug='d,rows_log_event_before_open_table'; -send set debug_sync='now WAIT_FOR before_open_table'; connection master; -create table t1 (a int); insert t1 values (1),(2),(3); connection slave; -reap; +set debug_sync='now WAIT_FOR before_open_table'; let $a=`select id from information_schema.processlist where state='debug sync point: now'`; replace_result $a slave_sql_thread; eval kill $a; set debug_sync='now SIGNAL go_ahead_sql'; +--let $slave_sql_errno= 1927 +--source include/wait_for_slave_sql_error.inc +let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo Last_SQL_Error = $error set global debug_dbug=''; set debug_sync='RESET'; - connection master; drop table t1; connection slave; -start slave; +--source include/start_slave.inc +let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); +--echo Last_SQL_Error = $error source include/rpl_end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test b/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test index 360706922ea..58d79cf7ff0 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test @@ -63,8 +63,13 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na --connection master # The following is to catch errors if the next uninstall plugin would succeed -show global status like "Slave%_connect%"; - +let $slaves_connected_value= query_get_value(SHOW GLOBAL STATUS LIKE 'Slaves_connected', Value, 1); +if (`SELECT $slaves_connected_value <> 1`) +{ + SHOW GLOBAL STATUS LIKE 'Slave_connections'; + SHOW GLOBAL STATUS LIKE 'Slaves_connected'; + --die *** Unexpected number of connected slaves *** +} UNINSTALL PLUGIN rpl_semi_sync_master; select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%'; diff --git a/mysql-test/t/repair_symlink-5543.test b/mysql-test/t/repair_symlink-5543.test index 4c120334d05..ac7bb497f24 100644 --- a/mysql-test/t/repair_symlink-5543.test +++ b/mysql-test/t/repair_symlink-5543.test @@ -9,9 +9,9 @@ eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR'; insert t1 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD ---echo # Some systems fail with errcode 40, when doing openat, while others ---echo # don't have openat and fail with errcode 20. ---replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /40/20/ /".*"/"<errmsg>"/ +--echo # Some systems fail with errcode 40, or 90 (MIPS) when doing openat, +--echo # while others don't have openat and fail with errcode 20. +--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /[49]0/20/ /".*"/"<errmsg>"/ repair table t1; drop table t1; @@ -19,7 +19,7 @@ drop table t1; eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR'; insert t2 values (1); --system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD ---replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /40/20/ /".*"/"<errmsg>"/ +--replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /[49]0/20/ /".*"/"<errmsg>"/ repair table t2; drop table t2; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 2df53a2f0aa..2d91cecd98b 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -9833,6 +9833,26 @@ SELECT * FROM INFORMATION_SCHEMA.TABLES JOIN INFORMATION_SCHEMA.PARAMETERS; DROP FUNCTION f; DROP VIEW v; +--echo # +--echo # MDEV-17963: Assertion `field_pos < field_count' failed in Protocol_text::store, +--echo # Assertion `field_handlers == 0 || field_pos < field_count' +--echo # + +CREATE TABLE t1 (ct time); +INSERT INTO t1 VALUES ('16:11:28'); + +DELIMITER |; +--error ER_SP_NO_RETSET +CREATE FUNCTION f1 () RETURNS varchar(100) +BEGIN +DECLARE xxx varchar(100); +ANALYZE SELECT sum(ct) FROM t1 INTO xxx ; +RETURN xxx; +END| + +DELIMITER ;| +drop table t1; + --echo #End of 10.1 tests --echo # diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 0e2682a053c..b975608076f 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -700,6 +700,16 @@ SELECT 1 FROM t1 WHERE 20160101 > SOME (SELECT CAST(a AS DATETIME) FROM t1); SELECT * FROM t1 WHERE 20160101 > CAST(a AS DATETIME); DROP TABLE t1; + +--echo # +--echo # MDEV-17857 Assertion `tmp != ((long long) 0x8000000000000000LL)' failed in TIME_from_longlong_datetime_packed upon SELECT with GROUP BY +--echo # + +CREATE TABLE t1 (i INT, d DATETIME); +INSERT INTO t1 VALUES (3,NULL),(3,'1976-12-14 13:21:07'),(NULL,'1981-09-24 01:04:47'); +SELECT ExtractValue('foo','bar'), i, MIN(d) FROM t1 GROUP BY i; +DROP TABLE t1; + --echo # --echo # End of 10.1 tests --echo # diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index f5277b71167..e21a0aedb85 100644 --- a/plugin/server_audit/server_audit.c +++ b/plugin/server_audit/server_audit.c @@ -27,8 +27,13 @@ #include <assert.h> #ifndef _WIN32 +#define DO_SYSLOG #include <syslog.h> +static const char out_type_desc[]= "Desired output type. Possible values - 'syslog', 'file'" + " or 'null' as no output."; #else +static const char out_type_desc[]= "Desired output type. Possible values - 'file'" + " or 'null' as no output."; #define syslog(PRIORITY, FORMAT, INFO, MESSAGE_LEN, MESSAGE) do {}while(0) static void closelog() {} #define openlog(IDENT, LOG_NOWAIT, LOG_USER) do {}while(0) @@ -88,6 +93,7 @@ static void closelog() {} #include <typelib.h> #include <mysql/plugin.h> #include <mysql/plugin_audit.h> +#include "../../mysys/mysys_priv.h" #ifndef RTLD_DEFAULT #define RTLD_DEFAULT NULL #endif @@ -385,18 +391,28 @@ static MYSQL_SYSVAR_SET(events, events, PLUGIN_VAR_RQCMDARG, "Specifies the set of events to monitor. Can be CONNECT, QUERY, TABLE," " QUERY_DDL, QUERY_DML, QUERY_DML_NO_SELECT, QUERY_DCL.", NULL, NULL, 0, &events_typelib); +#ifdef DO_SYSLOG #define OUTPUT_SYSLOG 0 #define OUTPUT_FILE 1 +#else +#define OUTPUT_SYSLOG 0xFFFF +#define OUTPUT_FILE 0 +#endif /*DO_SYSLOG*/ + #define OUTPUT_NO 0xFFFF -static const char *output_type_names[]= { "syslog", "file", 0 }; +static const char *output_type_names[]= { +#ifdef DO_SYSLOG + "syslog", +#endif + "file", 0 }; static TYPELIB output_typelib= { array_elements(output_type_names) - 1, "output_typelib", output_type_names, NULL }; static MYSQL_SYSVAR_ENUM(output_type, output_type, PLUGIN_VAR_RQCMDARG, - "Desired output type. Possible values - 'syslog', 'file'" - " or 'null' as no output.", 0, update_output_type, OUTPUT_FILE, + out_type_desc, + 0, update_output_type, OUTPUT_FILE, &output_typelib); static MYSQL_SYSVAR_STR(file_path, file_path, PLUGIN_VAR_RQCMDARG, "Path to the log file.", NULL, update_file_path, default_file_name); @@ -1135,6 +1151,7 @@ static void setup_connection_connect(struct connection_info *cn, #define SAFE_STRLEN(s) (s ? strlen(s) : 0) +#define SAFE_STRLEN_UI(s) ((unsigned int) (s ? strlen(s) : 0)) static char empty_str[1]= { 0 }; @@ -1294,7 +1311,7 @@ exit: static size_t log_header(char *message, size_t message_len, time_t *ts, - const char *serverhost, unsigned int serverhost_len, + const char *serverhost, size_t serverhost_len, const char *username, unsigned int username_len, const char *host, unsigned int host_len, const char *userip, unsigned int userip_len, @@ -1312,7 +1329,7 @@ static size_t log_header(char *message, size_t message_len, if (output_type == OUTPUT_SYSLOG) return my_snprintf(message, message_len, "%.*s,%.*s,%.*s,%d,%lld,%s", - serverhost_len, serverhost, + (unsigned int) serverhost_len, serverhost, username_len, username, host_len, host, connection_id, query_id, operation); @@ -1791,9 +1808,9 @@ static int log_table(const struct connection_info *cn, (void) time(&ctime); csize= log_header(message, sizeof(message)-1, &ctime, servhost, servhost_len, - event->user, (unsigned int)SAFE_STRLEN(event->user), - event->host, (unsigned int)SAFE_STRLEN(event->host), - event->ip, (unsigned int)SAFE_STRLEN(event->ip), + event->user, SAFE_STRLEN_UI(event->user), + event->host, SAFE_STRLEN_UI(event->host), + event->ip, SAFE_STRLEN_UI(event->ip), event->thread_id, cn->query_id, type); csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, ",%.*s,%.*s,",event->database_length, event->database, @@ -1813,9 +1830,9 @@ static int log_rename(const struct connection_info *cn, (void) time(&ctime); csize= log_header(message, sizeof(message)-1, &ctime, servhost, servhost_len, - event->user, (unsigned int)SAFE_STRLEN(event->user), - event->host, (unsigned int)SAFE_STRLEN(event->host), - event->ip, (unsigned int)SAFE_STRLEN(event->ip), + event->user, SAFE_STRLEN_UI(event->user), + event->host, SAFE_STRLEN_UI(event->host), + event->ip, SAFE_STRLEN_UI(event->ip), event->thread_id, cn->query_id, "RENAME"); csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, ",%.*s,%.*s|%.*s.%.*s,",event->database_length, event->database, diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index c0be1ea6e60..d4f13eadf4b 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -740,9 +740,9 @@ fi safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} # Make sure that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port` -if [ ! -d $mysql_unix_port_dir ] +if [ ! -d $mysql_unix_port_dir -a $dry_run -eq 0 ] then - if ! `mkdir -p $mysql_unix_port_dir` + if ! mkdir -p $mysql_unix_port_dir then log_error "Fatal error Can't create database directory '$mysql_unix_port'" exit 1 diff --git a/sql/item_sum.cc b/sql/item_sum.cc index ee53b242c83..5bed0d32009 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2703,11 +2703,14 @@ Item_sum_hybrid::min_max_update_str_field() if (!args[0]->null_value) { - result_field->val_str(&cmp->value2); - - if (result_field->is_null() || - (cmp_sign * sortcmp(res_str,&cmp->value2,collation.collation)) < 0) + if (result_field->is_null()) result_field->store(res_str->ptr(),res_str->length(),res_str->charset()); + else + { + result_field->val_str(&cmp->value2); + if ((cmp_sign * sortcmp(res_str,&cmp->value2,collation.collation)) < 0) + result_field->store(res_str->ptr(),res_str->length(),res_str->charset()); + } result_field->set_notnull(); } } diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index e8b76880df4..82a462d742b 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -115,15 +115,6 @@ void Master_info::wait_until_free() Master_info::~Master_info() { wait_until_free(); -#ifdef WITH_WSREP - /* - Do not free "wsrep" rpl_filter. It will eventually be freed by - free_all_rpl_filters() when server terminates. - */ - if (strncmp(connection_name.str, STRING_WITH_LEN("wsrep"))) -#endif - rpl_filters.delete_element(connection_name.str, connection_name.length, - (void (*)(const char*, uchar*)) free_rpl_filter); my_free(connection_name.str); delete_dynamic(&ignore_server_ids); mysql_mutex_destroy(&run_lock); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 027892b8441..0179214e508 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -191,7 +191,7 @@ sp_get_flags_for_command(LEX *lex) switch (lex->sql_command) { case SQLCOM_SELECT: - if (lex->result) + if (lex->result && !lex->analyze_stmt) { flags= 0; /* This is a SELECT with INTO clause */ break; diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 29cc4d17c87..19c0f508939 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -77,7 +77,7 @@ uint plugin_maturity_map[]= { 0, 1, 2, 3, 4, 5, 6 }; /* - When you ad a new plugin type, add both a string and make sure that the + When you add a new plugin type, add both a string and make sure that the init and deinit array are correctly updated. */ const LEX_STRING plugin_type_names[MYSQL_MAX_PLUGIN_TYPE_NUM]= @@ -3664,7 +3664,7 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, const LEX_STRING plugin_dash = { C_STRING_WITH_LEN("plugin-") }; uint plugin_name_len= strlen(plugin_name); uint optnamelen; - const int max_comment_len= 180; + const int max_comment_len= 255; char *comment= (char *) alloc_root(mem_root, max_comment_len + 1); char *optname; @@ -3698,8 +3698,9 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp, options[0].typelib= options[1].typelib= &global_plugin_typelib; strxnmov(comment, max_comment_len, "Enable or disable ", plugin_name, - " plugin. One of: ON, OFF, FORCE (don't start " - "if the plugin fails to load).", NullS); + " plugin. One of: ON, OFF, FORCE (don't start if the plugin" + " fails to load), FORCE_PLUS_PERMANENT (like FORCE, but the" + " plugin can not be uninstalled).", NullS); options[0].comment= comment; /* Allocate temporary space for the value of the tristate. diff --git a/storage/connect/array.cpp b/storage/connect/array.cpp index cd1785b48ac..483139bc955 100644 --- a/storage/connect/array.cpp +++ b/storage/connect/array.cpp @@ -457,7 +457,7 @@ char *ARRAY::GetStringValue(int n) /***********************************************************************/ bool ARRAY::Find(PVAL valp) { - register int n; + int n; PVAL vp; if (Type != valp->GetType()) { @@ -1065,7 +1065,7 @@ MULAR::MULAR(PGLOBAL g, int n) : CSORT(false) /***********************************************************************/ int MULAR::Qcompare(int *i1, int *i2) { - register int i, n = 0; + int i, n = 0; for (i = 0; i < Narray; i++) if ((n = Pars[i]->Qcompare(i1, i2))) diff --git a/storage/connect/csort.cpp b/storage/connect/csort.cpp index 670131b8fd2..1e4ba674e23 100644 --- a/storage/connect/csort.cpp +++ b/storage/connect/csort.cpp @@ -178,9 +178,9 @@ void CSORT::DebugSort(int ph, int n, int *base, int *mid, int *tmp) /***********************************************************************/ int CSORT::Qsortx(void) { - register int c; - register int lo, hi, min; - register int i, j, rc = 0; + int c; + int lo, hi, min; + int i, j, rc = 0; // To do: rc should be checked for being used uninitialized int *top; #ifdef DEBTRACE @@ -344,7 +344,7 @@ int CSORT::Qsortx(void) /***********************************************************************/ void CSORT::Qstx(int *base, int *max) { - register int *i, *j, *jj, *mid, *him, c; + int *i, *j, *jj, *mid, *him, c; int *tmp; int lo, hi, rc; size_t zlo, zhi, cnm; @@ -543,9 +543,9 @@ void CSORT::Qstx(int *base, int *max) /***********************************************************************/ int CSORT::Qsortc(void) { - register int c; - register int lo, hi, min; - register int i, j, k, m, rc = 0; + int c; + int lo, hi, min; + int i, j, k, m, rc = 0; // To do: rc should be checked for being used uninitialized int *max; #ifdef DEBTRACE @@ -720,7 +720,7 @@ int CSORT::Qsortc(void) /***********************************************************************/ void CSORT::Qstc(int *base, int *max) { - register int *i, *j, *jj, *lt, *eq, *gt, *mid; + int *i, *j, *jj, *lt, *eq, *gt, *mid; int c = 0, lo, hi, rc; size_t zlo, zhi, cnm; @@ -907,9 +907,9 @@ void CSORT::Qstc(int *base, int *max) /***********************************************************************/ void CSORT::Istc(int *base, int *hi, int *max) { - register int c = 0; - register int *lo; - register int *i, *j; + int c = 0; + int *lo; + int *i, *j; /*********************************************************************/ /* First put smallest element, which must be in the first THRESH, */ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 6c834b6d38e..1b3e59214a0 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -3071,7 +3071,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond) strncat(s, res->ptr(), res->length()); if (res->length() < 19) - strcat(s, "1970-01-01 00:00:00" + res->length()); + strcat(s, &"1970-01-01 00:00:00"[res->length()]); strcat(s, "'}"); break; @@ -3101,7 +3101,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond) strncat(s, res->ptr(), res->length()); if (res->length() < 19) - strcat(s, "1970-01-01 00:00:00" + res->length()); + strcat(s, &"1970-01-01 00:00:00"[res->length()]); strcat(s, "'}"); break; diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index 6687513fa6c..d08c6d1b7a5 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -2279,7 +2279,7 @@ int ODBConn::GetCatInfo(CATPARM *cap) int i, irc; bool b; PCSZ fnc = "Unknown"; - UWORD n; + UWORD n = 0; SWORD ncol, len, tp; SQLULEN crow = 0; PQRYRES qrp = cap->Qrp; diff --git a/storage/connect/valblk.cpp b/storage/connect/valblk.cpp index 73ca135691c..5179fa654cf 100644 --- a/storage/connect/valblk.cpp +++ b/storage/connect/valblk.cpp @@ -511,7 +511,7 @@ void TYPBLK<TYPE>::SetValues(PVBLK pv, int k, int n) CheckType(pv) TYPE *lp = ((TYPBLK*)pv)->Typp; - for (register int i = k; i < n; i++) // TODO + for (int i = k; i < n; i++) // TODO Typp[i] = lp[i]; } // end of SetValues @@ -805,7 +805,7 @@ void CHRBLK::SetValue(const char *sp, uint len, int n) if (Blanks) { // Suppress eventual ending zero and right fill with blanks - for (register int i = len; i < Long; i++) + for (int i = len; i < Long; i++) p[i] = ' '; } else if ((signed)len < Long) diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index efefc17b5f5..db4d6cbb00d 100644 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -272,8 +272,8 @@ void XINDEX::Close(void) /***********************************************************************/ int XINDEX::Qcompare(int *i1, int *i2) { - register int k; - register PXCOL kcp; + int k; + PXCOL kcp; for (kcp = To_KeyCol, k = 0; kcp; kcp = kcp->Next) if ((k = kcp->Compare(*i1, *i2))) @@ -745,7 +745,7 @@ int XINDEX::ColMaxSame(PXCOL kp) /***********************************************************************/ bool XINDEX::Reorder(PGLOBAL g __attribute__((unused))) { - register int i, j, k, n; + int i, j, k, n; bool sorted = true; PXCOL kcp; #if 0 @@ -1870,8 +1870,8 @@ int XINDEX::Fetch(PGLOBAL g) /***********************************************************************/ int XINDEX::FastFind(void) { - register int curk, sup, inf, i= 0, k, n = 2; - register PXCOL kp, kcp; + int curk, sup, inf, i= 0, k, n = 2; + PXCOL kp, kcp; //assert((int)nv == Nval); @@ -2209,8 +2209,8 @@ int XINDXS::Fetch(PGLOBAL g) /***********************************************************************/ int XINDXS::FastFind(void) { - register int sup, inf, i= 0, n = 2; - register PXCOL kcp = To_KeyCol; + int sup, inf, i= 0, n = 2; + PXCOL kcp = To_KeyCol; if (Nblk && Op == OP_EQ) { // Look in block values to find in which block to search @@ -3235,7 +3235,7 @@ void KXYCOL::FillValue(PVAL valp) int KXYCOL::Compare(int i1, int i2) { // Do the actual comparison between values. - register int k = Kblp->CompVal(i1, i2); + int k = Kblp->CompVal(i1, i2); if (trace(4)) htrc("Compare done result=%d\n", k); @@ -3250,7 +3250,7 @@ int KXYCOL::CompVal(int i) { // Do the actual comparison between numerical values. if (trace(4)) { - register int k = (int)Kblp->CompVal(Valp, (int)i); + int k = (int)Kblp->CompVal(Valp, (int)i); htrc("Compare done result=%d\n", k); return k; diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index b081f15b279..ce394390679 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -1418,7 +1418,7 @@ row_ins_foreign_check_on_constraint( cascade->state = UPD_NODE_UPDATE_CLUSTERED; #ifdef WITH_WSREP - err = wsrep_append_foreign_key(trx, foreign, clust_rec, clust_index, + err = wsrep_append_foreign_key(trx, foreign, cascade->pcur->old_rec, clust_index, FALSE, WSREP_KEY_EXCLUSIVE); if (err != DB_SUCCESS) { fprintf(stderr, @@ -1785,6 +1785,11 @@ row_ins_check_foreign_constraint( check_index, check_ref, key_type); + + if (err != DB_SUCCESS) { + fprintf(stderr, + "WSREP: foreign key append failed: %d\n", err); + } #endif /* WITH_WSREP */ goto end_scan; } else if (foreign->type != 0) { diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 13323dcae55..acf108f8886 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -7549,7 +7549,7 @@ void _ma_print_block_info(MARIA_SHARE *share, uchar *buff) { LSN lsn= lsn_korr(buff); - printf("LSN:" LSN_FMT " type: %u dir_entries: %u dir_free: %u empty_space: %u\n", + printf("LSN: " LSN_FMT " type: %u dir_entries: %u dir_free: %u empty_space: %u\n", LSN_IN_PARTS(lsn), (uint)buff[PAGE_TYPE_OFFSET], (uint)buff[DIR_COUNT_OFFSET], diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c index 726f87c0ab7..c2f3fe6dbd0 100644 --- a/storage/maria/ma_checkpoint.c +++ b/storage/maria/ma_checkpoint.c @@ -170,7 +170,7 @@ static int really_execute_checkpoint(void) "Horizon" is a lower bound of the LSN of the next log record. */ checkpoint_start_log_horizon= translog_get_horizon(); - DBUG_PRINT("info",("checkpoint_start_log_horizon " LSN_FMT, + DBUG_PRINT("info",("checkpoint_start_log_horizon " LSN_FMT "", LSN_IN_PARTS(checkpoint_start_log_horizon))); lsn_store(checkpoint_start_log_horizon_char, checkpoint_start_log_horizon); diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index ec3cf26661f..1d5bfba182d 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -3856,7 +3856,14 @@ my_bool translog_init_with_table(const char *directory, my_bool pageok; DBUG_PRINT("info", ("The log is really present")); - DBUG_ASSERT(sure_page <= last_page); + if (sure_page > last_page) + { + my_printf_error(HA_ERR_GENERIC, "Aria engine: log data error\n" + "last_log_page: " LSN_FMT " is less than\n" + "checkpoint page: " LSN_FMT, MYF(0), + LSN_IN_PARTS(last_page), LSN_IN_PARTS(sure_page)); + goto err; + } /* TODO: check page size */ @@ -4004,7 +4011,7 @@ my_bool translog_init_with_table(const char *directory, if (!logs_found) { TRANSLOG_FILE *file= (TRANSLOG_FILE*)my_malloc(sizeof(TRANSLOG_FILE), - MYF(0)); + MYF(MY_WME)); DBUG_PRINT("info", ("The log is not found => we will create new log")); if (file == NULL) goto err; @@ -5326,7 +5333,7 @@ static uchar *translog_put_LSN_diff(LSN base_lsn, LSN lsn, uchar *dst) { uint64 diff; DBUG_ENTER("translog_put_LSN_diff"); - DBUG_PRINT("enter", ("Base: " LSN_FMT " val: " LSN_FMT " dst:%p", + DBUG_PRINT("enter", ("Base: " LSN_FMT " val: " LSN_FMT " dst: %p", LSN_IN_PARTS(base_lsn), LSN_IN_PARTS(lsn), dst)); DBUG_ASSERT(base_lsn > lsn); @@ -5372,7 +5379,7 @@ static uchar *translog_put_LSN_diff(LSN base_lsn, LSN lsn, uchar *dst) dst[1]= 1; lsn_store(dst + 2, lsn); } - DBUG_PRINT("info", ("new dst:%p", dst)); + DBUG_PRINT("info", ("new dst: %p", dst)); DBUG_RETURN(dst); } @@ -7990,7 +7997,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn, { struct st_translog_buffer *buffer= log_descriptor.buffers + i; translog_buffer_lock(buffer); - DBUG_PRINT("info", ("Check buffer:%p #: %u " + DBUG_PRINT("info", ("Check buffer: %p #: %u " "prev last LSN: " LSN_FMT " " "last LSN: " LSN_FMT " status: %s", buffer, diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 52b94162a6b..87bded7ed50 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -1372,7 +1372,7 @@ uint _ma_state_info_write(MARIA_SHARE *share, uint pWrite) is too new). Recovery does it by itself. */ share->state.is_of_horizon= translog_get_horizon(); - DBUG_PRINT("info", ("is_of_horizon set to LSN " LSN_FMT, + DBUG_PRINT("info", ("is_of_horizon set to LSN " LSN_FMT "", LSN_IN_PARTS(share->state.is_of_horizon))); } res= _ma_state_info_write_sub(share->kfile.file, &share->state, pWrite); diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c index 249121340fd..c8031030361 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -531,8 +531,6 @@ end: if (error && !abort_message_printed) { - if (!trace_file) - fputc('\n', stderr); my_message(HA_ERR_INITIALIZATION, "Aria recovery failed. Please run aria_chk -r on all Aria " "tables and delete all aria_log.######## files", MYF(0)); @@ -667,13 +665,16 @@ prototype_redo_exec_hook(INCOMPLETE_LOG) { MARIA_HA *info; + /* We try to get table first, so that we get the table in in the trace log */ + info= get_MARIA_HA_from_REDO_record(rec); + if (skip_DDLs) { tprint(tracef, "we skip DDLs\n"); return 0; } - if ((info= get_MARIA_HA_from_REDO_record(rec)) == NULL) + if (!info) { /* no such table, don't need to warn */ return 0; @@ -1144,6 +1145,9 @@ prototype_redo_exec_hook(REDO_REPAIR_TABLE) my_bool quick_repair; DBUG_ENTER("exec_REDO_LOGREC_REDO_REPAIR_TABLE"); + /* We try to get table first, so that we get the table in in the trace log */ + info= get_MARIA_HA_from_REDO_record(rec); + if (skip_DDLs) { /* @@ -1153,8 +1157,13 @@ prototype_redo_exec_hook(REDO_REPAIR_TABLE) tprint(tracef, "we skip DDLs\n"); DBUG_RETURN(0); } - if ((info= get_MARIA_HA_from_REDO_record(rec)) == NULL) - DBUG_RETURN(0); + + if (!info) + { + /* no such table, don't need to warn */ + return 0; + } + if (maria_is_crashed(info)) { tprint(tracef, "we skip repairing crashed table\n"); @@ -1448,17 +1457,21 @@ static int new_table(uint16 sid, const char *name, LSN lsn_of_file_id) } if (share->state.state.data_file_length != dfile_len) { - tprint(tracef, ", has wrong state.data_file_length (fixing it)"); + tprint(tracef, ", has wrong state.data_file_length " + "(fixing it from %llu to %llu)", + (ulonglong) share->state.state.data_file_length, (ulonglong) dfile_len); share->state.state.data_file_length= dfile_len; } if (share->state.state.key_file_length != kfile_len) { - tprint(tracef, ", has wrong state.key_file_length (fixing it)"); + tprint(tracef, ", has wrong state.key_file_length " + "(fixing it from %llu to %llu)", + (ulonglong) share->state.state.key_file_length, (ulonglong) kfile_len); share->state.state.key_file_length= kfile_len; } if ((dfile_len % share->block_size) || (kfile_len % share->block_size)) { - tprint(tracef, ", has too short last page\n"); + tprint(tracef, ", has too short last page"); /* Recovery will fix this, no error */ ALERT_USER(); } @@ -2769,7 +2782,7 @@ static int run_redo_phase(LSN lsn, LSN lsn_end, enum maria_apply_log_way apply) { fprintf(stderr, " 100%%"); fflush(stderr); - procent_printed= 1; + procent_printed= 1; /* Will be follwed by time */ } DBUG_RETURN(0); @@ -2919,7 +2932,6 @@ static int run_undo_phase(uint uncommitted) recovery_message_printed= REC_MSG_UNDO; } tprint(tracef, "%u transactions will be rolled back\n", uncommitted); - procent_printed= 1; for( ; ; ) { char llbuf[22]; @@ -2972,7 +2984,6 @@ static int run_undo_phase(uint uncommitted) /* In the future, we want to have this phase *online* */ } } - procent_printed= 0; DBUG_RETURN(0); } @@ -3472,6 +3483,11 @@ static int close_all_tables(void) } } end: + if (recovery_message_printed == REC_MSG_FLUSH) + { + fputc('\n', stderr); + fflush(stderr); + } mysql_mutex_unlock(&THR_LOCK_maria); DBUG_RETURN(error); } diff --git a/storage/maria/ma_recovery_util.c b/storage/maria/ma_recovery_util.c index 54d7420c96e..3b617f625f0 100644 --- a/storage/maria/ma_recovery_util.c +++ b/storage/maria/ma_recovery_util.c @@ -70,14 +70,7 @@ void tprint(FILE *trace_file __attribute__ ((unused)), #endif va_start(args, format); if (trace_file != NULL) - { - if (procent_printed) - { - procent_printed= 0; - fputc('\n', trace_file); - } vfprintf(trace_file, format, args); - } va_end(args); } @@ -93,9 +86,10 @@ void eprint(FILE *trace_file __attribute__ ((unused)), if (procent_printed) { - /* In silent mode, print on another line than the 0% 10% 20% line */ procent_printed= 0; - fputc('\n', trace_file); + /* In silent mode, print on another line than the 0% 10% 20% line */ + fputc('\n', stderr); + fflush(stderr); } vfprintf(trace_file , format, args); fputc('\n', trace_file); diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 7aedf05b4fc..7c591cf691d 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -6308,7 +6308,7 @@ int spider_panic( int spider_db_init( void *p ) { - int error_num, roop_count; + int error_num = 0, roop_count; uint dbton_id = 0; handlerton *spider_hton = (handlerton *)p; DBUG_ENTER("spider_db_init"); diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc index 0eefdb17f39..50da7fb40ad 100644 --- a/storage/xtradb/row/row0ins.cc +++ b/storage/xtradb/row/row0ins.cc @@ -1299,7 +1299,7 @@ row_ins_foreign_check_on_constraint( err = wsrep_append_foreign_key( thr_get_trx(thr), foreign, - clust_rec, + cascade->pcur->old_rec, clust_index, FALSE, WSREP_KEY_EXCLUSIVE); if (err != DB_SUCCESS) { @@ -1676,6 +1676,11 @@ run_again: check_index, check_ref, key_type); + + if (err != DB_SUCCESS) { + fprintf(stderr, + "WSREP: foreign key append failed: %d\n", err); + } #endif /* WITH_WSREP */ goto end_scan; } else if (foreign->type != 0) { |