mirror of
https://github.com/MariaDB/server.git
synced 2025-11-27 05:41:41 +03:00
Merge 10.2 into 10.3
This commit is contained in:
@@ -4236,6 +4236,14 @@ i LAST_VALUE(COUNT(i)) OVER (PARTITION BY i ORDER BY j)
|
||||
4 2
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-15208: server crashed, when using ORDER BY with window function and UNION
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(1),(1),(1),(1),(2),(2),(2),(2),(2),(2);
|
||||
SELECT 1 UNION SELECT a FROM t1 ORDER BY (row_number() over ());
|
||||
ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to a UNION
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
--echo Performing --wsrep-recover ...
|
||||
if ($wsrep_recover_additional)
|
||||
{
|
||||
--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.log --innodb --wsrep-recover $wsrep_recover_additional > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1
|
||||
}
|
||||
if (!$wsrep_recover_additional)
|
||||
{
|
||||
--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.log --innodb --wsrep-recover > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1
|
||||
}
|
||||
|
||||
--perl
|
||||
use strict;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
reset master;
|
||||
connection node_2;
|
||||
reset master;
|
||||
@@ -40,6 +42,12 @@ hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
connection node_2;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
Cleaning var directory ...
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
connection node_2;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
@@ -66,6 +74,7 @@ hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
hostname1-bin.000001 # Rotate # # hostname1-bin.000002;pos=4
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
#cleanup
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
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;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
INSERT INTO t2 VALUES (1);
|
||||
connection node_2;
|
||||
SELECT COUNT(*) = 1 FROM t1;
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SELECT COUNT(*) = 2 FROM t2;
|
||||
COUNT(*) = 2
|
||||
1
|
||||
connection node_1;
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
|
||||
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
|
||||
hostname1-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
|
||||
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
|
||||
hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
|
||||
hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
connection node_2;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
Cleaning var directory ...
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
connection node_2;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
include/show_binlog_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
|
||||
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
|
||||
hostname1-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
|
||||
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
|
||||
hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
|
||||
hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
|
||||
hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
hostname1-bin.000001 # Xid # # COMMIT /* XID */
|
||||
hostname1-bin.000001 # Gtid # # GTID #-#-#
|
||||
hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
hostname1-bin.000001 # Rotate # # hostname1-bin.000002;pos=4
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
#cleanup
|
||||
connection node_1;
|
||||
RESET MASTER;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- galera_sst_rsync.result
|
||||
+++ galera_sst_rsync,debug.reject
|
||||
@@ -284,3 +284,111 @@
|
||||
+++ galera_sst_rsync.reject
|
||||
@@ -286,3 +286,111 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- suite/galera/r/galera_sst_rsync2.result 2018-09-12 13:09:35.352229478 +0200
|
||||
+++ suite/galera/r/galera_sst_rsync2,debug.reject 2018-09-12 17:00:51.601974979 +0200
|
||||
--- suite/galera/r/galera_sst_rsync2.result
|
||||
+++ suite/galera/r/galera_sst_rsync2.reject
|
||||
@@ -286,3 +286,111 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
connection node_3;
|
||||
connection node_4;
|
||||
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
EXPECT_4
|
||||
4
|
||||
@@ -6,10 +12,8 @@ CREATE TABLE t1 (f1 INTEGER);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2;
|
||||
INSERT INTO t1 VALUES (2);
|
||||
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
|
||||
connection node_3;
|
||||
INSERT INTO t1 VALUES (3);
|
||||
connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
|
||||
connection node_4;
|
||||
INSERT INTO t1 VALUES (4);
|
||||
connection node_3;
|
||||
@@ -81,3 +85,6 @@ CALL mtr.add_suppression("There are no nodes in the same segment that will ever
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
connection node_4;
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
connection node_1;
|
||||
disconnect node_3;
|
||||
disconnect node_4;
|
||||
|
||||
@@ -9,3 +9,6 @@ log-slave-updates
|
||||
log-bin = hostname2-bin
|
||||
log-bin-index = hostname2.bdx
|
||||
log-slave-updates
|
||||
|
||||
[sst]
|
||||
sst_max_binlogs=
|
||||
|
||||
@@ -1 +1 @@
|
||||
--source galera_log_bin.inc
|
||||
--source galera_log_bin_sst.inc
|
||||
|
||||
19
mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.cnf
Normal file
19
mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.cnf
Normal file
@@ -0,0 +1,19 @@
|
||||
!include ../galera_2nodes.cnf
|
||||
|
||||
[mysqld]
|
||||
wsrep_sst_method=mariabackup
|
||||
wsrep_sst_auth="root:"
|
||||
|
||||
[mysqld.1]
|
||||
log-bin=@ENV.MYSQLTEST_VARDIR/mysqld.1/data/hostname1-bin
|
||||
log-bin-index = hostname1.bdx
|
||||
log-slave-updates
|
||||
|
||||
[mysqld.2]
|
||||
log-bin=@ENV.MYSQLTEST_VARDIR/mysqld.2/data/hostname2-bin
|
||||
log-bin-index = hostname2.bdx
|
||||
log-slave-updates
|
||||
|
||||
[sst]
|
||||
transferfmt=@ENV.MTR_GALERA_TFMT
|
||||
sst_max_binlogs=
|
||||
@@ -0,0 +1,2 @@
|
||||
--source include/have_mariabackup.inc
|
||||
--source galera_log_bin_sst.inc
|
||||
84
mysql-test/suite/galera/t/galera_log_bin_sst.inc
Normal file
84
mysql-test/suite/galera/t/galera_log_bin_sst.inc
Normal file
@@ -0,0 +1,84 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/force_restart.inc
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--source include/auto_increment_offset_save.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,
|
||||
# rather than Galera's own implementation
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
INSERT INTO t2 VALUES (1);
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) = 1 FROM t1;
|
||||
SELECT COUNT(*) = 2 FROM t2;
|
||||
|
||||
--connection node_1
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
--let $MASTER_MYPORT=$NODE_MYPORT_1
|
||||
--source include/show_binlog_events.inc
|
||||
|
||||
--connection node_2
|
||||
|
||||
#--connection node_2
|
||||
#--source suite/galera/include/galera_stop_replication.inc
|
||||
|
||||
--echo Shutting down server ...
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
|
||||
--source include/wait_condition.inc
|
||||
|
||||
#
|
||||
# Force SST
|
||||
#
|
||||
--echo Cleaning var directory ...
|
||||
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
|
||||
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr
|
||||
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema
|
||||
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test
|
||||
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql
|
||||
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data
|
||||
|
||||
--connection node_2
|
||||
|
||||
--echo Starting server ...
|
||||
let $restart_noprint=2;
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
--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;
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
@@ -10,4 +10,5 @@
|
||||
|
||||
--source suite/galera/include/galera_st_kill_slave.inc
|
||||
--source suite/galera/include/galera_st_kill_slave_ddl.inc
|
||||
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
@@ -12,4 +12,3 @@ log_bin
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
|
||||
log_basename=server2
|
||||
log_bin
|
||||
|
||||
|
||||
@@ -12,6 +12,16 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/force_restart.inc
|
||||
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
|
||||
# Save original auto_increment_offset values.
|
||||
--let $node_1=node_1
|
||||
--let $node_2=node_2
|
||||
--let $node_3=node_3
|
||||
--let $node_4=node_4
|
||||
--source include/auto_increment_offset_save.inc
|
||||
|
||||
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
--source include/wait_condition.inc
|
||||
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
@@ -23,11 +33,9 @@ INSERT INTO t1 VALUES (1);
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
||||
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
|
||||
--connection node_3
|
||||
INSERT INTO t1 VALUES (3);
|
||||
|
||||
--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
|
||||
--connection node_4
|
||||
INSERT INTO t1 VALUES (4);
|
||||
|
||||
@@ -156,3 +164,10 @@ CALL mtr.add_suppression("Action message in non-primary configuration from membe
|
||||
|
||||
--connection node_4
|
||||
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
|
||||
|
||||
# Restore original auto_increment_offset values.
|
||||
--source include/auto_increment_offset_restore.inc
|
||||
|
||||
--connection node_1
|
||||
--disconnect node_3
|
||||
--disconnect node_4
|
||||
|
||||
@@ -113,7 +113,7 @@ SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
select * from t2;
|
||||
f1 f2
|
||||
1 2
|
||||
SET GLOBAL innodb_lock_wait_timeout=1;
|
||||
SET SESSION innodb_lock_wait_timeout=1;
|
||||
insert into t2 values(1,2);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
insert into t2 values(9,10);
|
||||
|
||||
@@ -163,7 +163,7 @@ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select * from t2;
|
||||
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
||||
select * from t2;
|
||||
SET GLOBAL innodb_lock_wait_timeout=1;
|
||||
SET SESSION innodb_lock_wait_timeout=1;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
insert into t2 values(1,2);
|
||||
insert into t2 values(9,10);
|
||||
|
||||
Reference in New Issue
Block a user