Commit da9201dd authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.2 into 10.3

parents aabd1c8f 879c9ddc
......@@ -196,11 +196,18 @@ IF(MSVC)
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
FOREACH(type EXE SHARED MODULE)
FOREACH(cfg RELEASE DEBUG RELWITHDEBINFO)
SET(CMAKE_${type}_LINKER_FLAGS_${cfg} "${CMAKE_${type}_LINKER_FLAGS_${cfg}} /WX")
ENDFOREACH()
ENDFOREACH()
ENDIF()
IF(MSVC_VERSION LESS 1910)
# Noisy warning C4800: 'type': forcing value to bool 'true' or 'false' (performance warning),
# removed in VS2017
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /d2OptimizeHugeFunctions")
ENDIF()
ENDIF()
......
......@@ -1557,6 +1557,15 @@ numgtfmt
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-20517 Assertion `!is_expensive()' failed in Item::value_depends_on_sql_mode_const_item
#
SELECT ( 1 LIKE GET_LOCK( 'foo', 0 ) ) - 2;
( 1 LIKE GET_LOCK( 'foo', 0 ) ) - 2
-1
SELECT RELEASE_LOCK('foo');
RELEASE_LOCK('foo')
1
#
# End of 10.2 tests
#
#
......
......@@ -1192,6 +1192,12 @@ SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLA
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # MDEV-20517 Assertion `!is_expensive()' failed in Item::value_depends_on_sql_mode_const_item
--echo #
SELECT ( 1 LIKE GET_LOCK( 'foo', 0 ) ) - 2;
SELECT RELEASE_LOCK('foo');
--echo #
--echo # End of 10.2 tests
......
......@@ -18,7 +18,6 @@ galera_as_master_gtid : Requires MySQL GTID
galera_as_master_gtid_change_master : Requires MySQL GTID
galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB
galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event()
galera_autoinc_sst_mariabackup : MDEV-19926 Galera SST tests fail
galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
galera_binlog_stmt_autoinc: MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc
galera_flush : MariaDB does not have global.thread_statistics
......@@ -32,7 +31,6 @@ galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure
galera_var_node_address : MDEV-17151 Galera test failure
galera_var_notify_cmd : MDEV-13549 Galera test failures
galera_var_slave_threads : MDEV-19746 Galera test failures because of wsrep_slave_threads identification
galera_sst_mariabackup_encrypt_with_key : MDEV-19926 Galera SST tests fail
galera_var_node_address : MDEV-20485 Galera test failure on galera.galera_var_node_address
galera_wan : MDEV-17259 Test failure on galera.galera_wan
partition : MDEV-19958 Galera test failure on galera.partition
......
connection node_1;
connection node_2;
connection node_1;
CREATE TABLE event_table(a int) engine=innodb;
CREATE EVENT event_2 ON SCHEDULE EVERY 1 SECOND
ENDS NOW() + INTERVAL 6 SECOND
ON COMPLETION NOT PRESERVE
DO
INSERT INTO event_table VALUES (1);
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
# node_1 event should be there
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test event_2 root@localhost SQL INSERT INTO event_table VALUES (1) RECURRING NULL 1 SECOND ENABLED NOT PRESERVE
connection node_2;
# node_2 event should be there
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test event_2 root@localhost SQL INSERT INTO event_table VALUES (1) RECURRING NULL 1 SECOND SLAVESIDE_DISABLED NOT PRESERVE
connection node_1;
SET GLOBAL event_scheduler=ON;
SHOW VARIABLES LIKE 'event_scheduler';
Variable_name Value
event_scheduler ON
# node_1 event should be removed
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
connection node_2;
# node_2 event should be removed
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
connection node_1;
SET GLOBAL event_scheduler=OFF;
DROP TABLE event_table;
connection node_1;
CREATE DATABASE IF NOT EXISTS events_test;
use events_test;
CREATE USER ev_test@localhost;
GRANT ALL ON events_test.* to ev_test@localhost;
connect ev_con1,localhost,ev_test,,events_test;
CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test one_event ev_test@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
"The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
connection node_2;
use events_test;
"The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND SLAVESIDE_DISABLED NOT PRESERVE
connection node_1;
disconnect ev_con1;
use test;
DROP EVENT events_test.one_event;
DROP USER ev_test@localhost;
DROP DATABASE events_test;
connection node_1;
use test;
CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
# node_1 Event should be enabled
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
connection node_2;
use test;
# node_2 Event should be SERVERSIDE_DISABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND SLAVESIDE_DISABLED NOT PRESERVE
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=InnoDB;
INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
SELECT * FROM t1;
f1 f2
1 a
2 a
3 a
Shutting down server ...
connection node_1;
UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
SELECT * FROM t1;
f1 f2
1 a
2 b
3 c
connection node_2;
# Force SST from node_1 to node_2
Starting server ...
SELECT * FROM t1;
f1 f2
1 a
2 b
3 c
# node_2 Event should be SERVERSIDE_DISABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND SLAVESIDE_DISABLED NOT PRESERVE
connection node_1;
SELECT * FROM t1;
f1 f2
1 a
2 b
3 c
# node_1 Event should be ENABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
DROP TABLE t1;
DROP EVENT one_event;
call mtr.add_suppression("WSREP: Stray state UUID msg: .* current group state WAIT_STATE_UUID .*");
call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .* is not in state transfer (.*). Message ignored.");
call mtr.add_suppression("WSREP: Sending JOIN failed: -[0-9]+ (Transport endpoint is not connected). Will retry in new primary component.");
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 4
1
call mtr.add_suppression("WSREP: Stray state UUID msg: .*");
call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .*");
call mtr.add_suppression("WSREP: Sending JOIN failed: .*");
flush tables;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE
4
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=INNODB;
connection node_2;
set global wsrep_sync_wait=15;
INSERT INTO t1 VALUES (1);
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
set global wsrep_sync_wait=15;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
connection node_1;
DROP TABLE t1;
......@@ -8,6 +8,7 @@
#
--source include/galera_cluster.inc
--source include/big_test.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
......
--source include/galera_cluster.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
#
# Test case 1: "ONE TIME" events should be dropped on slave nodes after expiring on master (event creator node)
#
--connection node_1
CREATE TABLE event_table(a int) engine=innodb;
CREATE EVENT event_2 ON SCHEDULE EVERY 1 SECOND
ENDS NOW() + INTERVAL 6 SECOND
ON COMPLETION NOT PRESERVE
DO
INSERT INTO event_table VALUES (1);
--echo # node_1 event should be there
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
--connection node_2
--echo # node_2 event should be there
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
--connection node_1
SET GLOBAL event_scheduler=ON;
SHOW VARIABLES LIKE 'event_scheduler';
# Let event_2 reach the end of its execution interval
let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_2';
--source include/wait_condition.inc
--echo # node_1 event should be removed
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
--connection node_2
--echo # node_2 event should be removed
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='event_2';
--connection node_1
SET GLOBAL event_scheduler=OFF;
DROP TABLE event_table;
#
# Test case 2: After doing ALTER EVENT, slave nodes should have same definer as master
#
--connection node_1
CREATE DATABASE IF NOT EXISTS events_test;
use events_test;
CREATE USER ev_test@localhost;
GRANT ALL ON events_test.* to ev_test@localhost;
connect (ev_con1,localhost,ev_test,,events_test);
CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123;
--replace_column 8 # 9 #
SHOW EVENTS;
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
--echo "The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
--connection node_2
use events_test;
--echo "The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
--connection node_1
--disconnect ev_con1
use test;
DROP EVENT events_test.one_event;
DROP USER ev_test@localhost;
DROP DATABASE events_test;
#
# Test case 3: After SST from master node (the one where event is ENABLED) , slave event status should be 'SLAVESIDE_DISABLED'
#
--connection node_1
use test;
CREATE EVENT one_event ON SCHEDULE EVERY 10 SECOND DO SELECT 123;
--echo # node_1 Event should be enabled
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
--connection node_2
use test;
--echo # node_2 Event should be SERVERSIDE_DISABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)) engine=InnoDB;
INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
SELECT * FROM t1;
# Initiate normal shutdown on the node 2 and wait until shutdown has been completed:
--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
UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
SELECT * FROM t1;
--connection node_2
# Remove the "grastate.dat" file (to initiate new SST) and restart node 2
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--echo # Force SST from node_1 to node_2
--let $start_mysqld_params=
--echo Starting server ...
--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
# Sanity check (node 2 is running now and can perform SQL operators):
SELECT * FROM t1;
--echo # node_2 Event should be SERVERSIDE_DISABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
--connection node_1
SELECT * FROM t1;
--echo # node_1 Event should be ENABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
DROP TABLE t1;
DROP EVENT one_event;
--source include/auto_increment_offset_restore.inc
......@@ -6,27 +6,27 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
call mtr.add_suppression("WSREP: Stray state UUID msg: .* current group state WAIT_STATE_UUID .*");
call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .* is not in state transfer (.*). Message ignored.");
call mtr.add_suppression("WSREP: Sending JOIN failed: -[0-9]+ (Transport endpoint is not connected). Will retry in new primary component.");
call mtr.add_suppression("WSREP: Stray state UUID msg: .*");
call mtr.add_suppression("WSREP: Protocol violation. JOIN message sender .*");
call mtr.add_suppression("WSREP: Sending JOIN failed: .*");
flush tables;
SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--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 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
CREATE TABLE t1 (f1 INTEGER) ENGINE=INNODB;
--connection node_2
let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
--source include/wait_condition.inc
set global wsrep_sync_wait=15;
INSERT INTO t1 VALUES (1);
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'test/t1';
--source include/wait_condition.inc
let $wait_condition= SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1;
set global wsrep_sync_wait=15;
SELECT COUNT(*) FROM t1;
--connection node_1
DROP TABLE t1;
......@@ -112,7 +112,7 @@ count(*)
drop table t1;
drop procedure populate_t1;
create temporary table t1 (t1_i int, t1_f float) engine = innodb;
insert into t1 values (1, 1.1), (2, 2.2), (3, 2.2), (4, 4.4);
insert into t1 values (1, 1.1), (2, 2.5), (3, 2.5), (4, 4.4);
explain select * from t1 where t1_i = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
......@@ -124,22 +124,22 @@ select * from t1 where t1_i = 1;
t1_i t1_f
1 1.1
alter table t1 add unique index sec_index(t1_f);
ERROR 23000: Duplicate entry '2.2' for key 'sec_index'
ERROR 23000: Duplicate entry '2.5' for key 'sec_index'
alter table t1 add index sec_index(t1_f);
explain select * from t1 where t1_f > 2.2;
explain select * from t1 where t1_f >= 2.5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL sec_index NULL NULL NULL 4 Using where
select * from t1 where t1_f > 2.2;
select * from t1 where t1_f >= 2.5;
t1_i t1_f
2 2.2
3 2.2
2 2.5
3 2.5
4 4.4
alter table t1 add column (t1_c char(10));
select * from t1;
t1_i t1_f t1_c
1 1.1 NULL
2 2.2 NULL
3 2.2 NULL
2 2.5 NULL
3 2.5 NULL
4 4.4 NULL
insert into t1 values (5, 5.5, 'krunal');
alter table t1 drop column t1_f;
......@@ -150,7 +150,7 @@ t1 CREATE TEMPORARY TABLE `t1` (
`t1_c` char(10) DEFAULT NULL,
UNIQUE KEY `pri_index` (`t1_i`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1 where t1_f > 2.2;
select * from t1 where t1_f >= 2.5;
ERROR 42S22: Unknown column 't1_f' in 'where clause'
alter table t1 add index sec_index2(t1_c), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
......
......@@ -100,7 +100,7 @@ drop procedure populate_t1;
# 3. Alter of temp-table.
#
create temporary table t1 (t1_i int, t1_f float) engine = innodb;
insert into t1 values (1, 1.1), (2, 2.2), (3, 2.2), (4, 4.4);
insert into t1 values (1, 1.1), (2, 2.5), (3, 2.5), (4, 4.4);
#
explain select * from t1 where t1_i = 1;
alter table t1 add unique index pri_index(t1_i);
......@@ -110,8 +110,8 @@ select * from t1 where t1_i = 1;
--error ER_DUP_ENTRY
alter table t1 add unique index sec_index(t1_f);
alter table t1 add index sec_index(t1_f);
explain select * from t1 where t1_f > 2.2;
select * from t1 where t1_f > 2.2;
explain select * from t1 where t1_f >= 2.5;
select * from t1 where t1_f >= 2.5;
#
alter table t1 add column (t1_c char(10));
select * from t1;
......@@ -120,7 +120,7 @@ insert into t1 values (5, 5.5, 'krunal');
alter table t1 drop column t1_f;
show create table t1;
--error ER_BAD_FIELD_ERROR
select * from t1 where t1_f > 2.2;
select * from t1 where t1_f >= 2.5;
#
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t1 add index sec_index2(t1_c), algorithm=inplace;
......
......@@ -55,6 +55,12 @@ Warnings:
Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2'
set global innodb_change_buffering_debug=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug'
set global innodb_change_buffering_debug=2;
Warnings:
Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '2'
select @@global.innodb_change_buffering_debug;
@@global.innodb_change_buffering_debug
1
SET @@global.innodb_change_buffering_debug = @start_global_value;
SELECT @@global.innodb_change_buffering_debug;
@@global.innodb_change_buffering_debug
......
......@@ -326,9 +326,9 @@ SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Debug flags for InnoDB change buffering (0=none, 2=crash at merge)
VARIABLE_COMMENT Debug flags for InnoDB change buffering (0=none, 1=try to buffer)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
NUMERIC_MAX_VALUE 1
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
......
......@@ -48,9 +48,8 @@ set global innodb_change_buffering_debug='foo';
set global innodb_change_buffering_debug=-2;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffering_debug=1e1;
# The value 2 is supposed to kill the server if there are unmerged changes.
# Do not try to set the value to 2 or anything that can be clamped to 2.
#set global innodb_change_buffering_debug=2;
set global innodb_change_buffering_debug=2;
select @@global.innodb_change_buffering_debug;
#
# Cleanup
......
......@@ -198,9 +198,9 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
# without necessity.E.g source modifications, that do not
# change list of exported symbols, will not result in a relink for plugins.
SET(MYSQLD_DEF ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.def)
SET(MYSQLD_EXP ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.exp)
SET(MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.lib)
SET(MYSQLD_DEF ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib${CMAKE_CFG_INTDIR}.def)
SET(MYSQLD_EXP ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib${CMAKE_CFG_INTDIR}.exp)
SET(MYSQLD_LIB ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib${CMAKE_CFG_INTDIR}.lib)
SET(MYSQLD_CORELIBS sql mysys dbug strings)
FOREACH (CORELIB ${MYSQLD_CORELIBS})
SET (LIB_LOCATIONS ${LIB_LOCATIONS} $<TARGET_FILE:${CORELIB}>)
......@@ -213,12 +213,12 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
# Create a cmake script to generate import and export libs
# from a .def file
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "
IF ((mysqld_lib.def IS_NEWER_THAN mysqld_lib.lib) OR
(mysqld_lib.def IS_NEWER_THAN mysqld_lib.exp))
FILE(REMOVE mysqld_lib.lib mysqld_lib.exp)
IF ((mysqld_lib\${CFG}.def IS_NEWER_THAN mysqld_lib\${CFG}.lib) OR
(mysqld_lib\${CFG}.def IS_NEWER_THAN mysqld_lib\${CFG}.exp))
FILE(REMOVE mysqld_lib\${CFG}.lib mysqld_lib\${CFG}.exp)
SET(ENV{VS_UNICODE_OUTPUT})
EXECUTE_PROCESS (
COMMAND \"${CMAKE_LINKER}\" /lib /NAME:mysqld.exe \"/DEF:${MYSQLD_DEF}\" /MACHINE:${_PLATFORM}
COMMAND \"${CMAKE_LINKER}\" /lib /NAME:mysqld.exe \"/DEF:${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib\${CFG}.def\" /MACHINE:${_PLATFORM}
RESULT_VARIABLE ret)
IF(NOT ret EQUAL 0)
MESSAGE(FATAL_ERROR \"process failed ret=\${ret}\")
......@@ -228,41 +228,22 @@ IF(MSVC AND NOT WITHOUT_DYNAMIC_PLUGINS)
CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/cmake/configurable_file_content.in
make_mysqld_lib.cmake)
make_mysqld_lib.cmake
@ONLY)
IF(CMAKE_VERSION VERSION_GREATER "3.2.0")
SET(MYSQLD_LIB_BYPRODUCTS BYPRODUCTS ${MYSQLD_DEF} ${MYSQLD_LIB} ${MYSQLD_EXP})
ENDIF()
# Create a cmake script to generate import and export libs
# from a .def file
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "
IF ((mysqld_lib.def IS_NEWER_THAN mysqld_lib.lib) OR
(mysqld_lib.def IS_NEWER_THAN mysqld_lib.exp))
FILE(REMOVE mysqld_lib.lib mysqld_lib.exp)
SET(ENV{VS_UNICODE_OUTPUT})
EXECUTE_PROCESS (
COMMAND \"${CMAKE_LINKER}\" /lib /NAME:mysqld.exe \"/DEF:${MYSQLD_DEF}\" /MACHINE:${_PLATFORM}
RESULT_VARIABLE ret)
IF(NOT ret EQUAL 0)
MESSAGE(FATAL_ERROR \"process failed ret=\${ret}\")
ENDIF()
ENDIF()
")
CONFIGURE_FILE(
${PROJECT_SOURCE_DIR}/cmake/configurable_file_content.in
make_mysqld_lib.cmake)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mysqld_lib.stamp
${MYSQLD_LIB_BYPRODUCTS}
COMMENT "Generating mysqld_lib.def, mysqld_lib.lib, mysqld_lib.exp"
COMMENT "Generating ${MYSQLD_DEF}, ${MYSQLD_LIB}, ${MYSQLD_EXP}"
COMMAND cscript //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
${_PLATFORM} /forLib ${LIB_LOCATIONS} > mysqld_lib.def.tmp
COMMAND ${CMAKE_COMMAND} -E copy_if_different mysqld_lib.def.tmp mysqld_lib.def
COMMAND ${CMAKE_COMMAND} -E remove mysqld_lib.def.tmp
COMMAND ${CMAKE_COMMAND} -P make_mysqld_lib.cmake
${_PLATFORM} /forLib ${LIB_LOCATIONS} > ${MYSQLD_DEF}.tmp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MYSQLD_DEF}.tmp ${MYSQLD_DEF}
COMMAND ${CMAKE_COMMAND} -E remove ${MYSQLD_DEF}.tmp
COMMAND ${CMAKE_COMMAND} "-DCFG=${CMAKE_CFG_INTDIR}" -P make_mysqld_lib.cmake
COMMAND ${CMAKE_COMMAND} -E touch mysqld_lib.stamp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${MYSQLD_CORELIBS}
......
......@@ -1199,6 +1199,46 @@ Events::load_events_from_db(THD *thd)
delete et;
goto end;
}
#ifdef WITH_WSREP
/**
IF SST is done from a galera node that is also acting as MASTER
newly synced node in galera eco-system will also copy-over the event state
enabling duplicate event in galera eco-system.
DISABLE such events if the current node is not event orginator.
(Also, make sure you skip disabling it if is already disabled to avoid
creation of redundant action)
NOTE:
This complete system relies on server-id. Ideally server-id should be
same for all nodes of galera eco-system but they aren't same.
Infact, based on galera use-case it seems like it recommends to have each
node with different server-id.
*/
if (et->originator != thd->variables.server_id)
{
if (et->status == Event_parse_data::SLAVESIDE_DISABLED)
continue;
store_record(table, record[1]);
table->field[ET_FIELD_STATUS]->
store((longlong) Event_parse_data::SLAVESIDE_DISABLED,
TRUE);
/* All the dmls to mysql.events tables are stmt bin-logged. */
bool save_binlog_row_based;
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
thd->set_current_stmt_binlog_format_stmt();
(void) table->file->ha_update_row(table->record[1], table->record[0]);
if (save_binlog_row_based)
thd->set_current_stmt_binlog_format_row();
delete et;
continue;
}
#endif /* WITH_WSREP */
/**
Since the Event_queue_element object could be deleted inside
Event_queue::create_event we should save the value of dropped flag
......
......@@ -1338,17 +1338,22 @@ bool Item_func_minus::fix_length_and_dec()
if (Item_func_minus::type_handler()->Item_func_minus_fix_length_and_dec(this))
DBUG_RETURN(TRUE);
DBUG_PRINT("info", ("Type: %s", type_handler()->name().ptr()));
m_sql_mode_dependency= Item_func::value_depends_on_sql_mode();
if (unsigned_flag)
{
m_sql_mode_dependency|= Sql_mode_dependency(0,MODE_NO_UNSIGNED_SUBTRACTION);
if (current_thd->variables.sql_mode & MODE_NO_UNSIGNED_SUBTRACTION)
unsigned_flag= false;
}
if ((m_depends_on_sql_mode_no_unsigned_subtraction= unsigned_flag) &&
(current_thd->variables.sql_mode & MODE_NO_UNSIGNED_SUBTRACTION))
unsigned_flag= false;
DBUG_RETURN(FALSE);
}
Sql_mode_dependency Item_func_minus::value_depends_on_sql_mode() const
{
Sql_mode_dependency dep= Item_func_additive_op::value_depends_on_sql_mode();
if (m_depends_on_sql_mode_no_unsigned_subtraction)
dep|= Sql_mode_dependency(0, MODE_NO_UNSIGNED_SUBTRACTION);
return dep;
}
double Item_func_minus::real_op()
{
double value= args[0]->val_real() - args[1]->val_real();
......
......@@ -1095,16 +1095,15 @@ class Item_func_plus :public Item_func_additive_op
class Item_func_minus :public Item_func_additive_op
{
Sql_mode_dependency m_sql_mode_dependency;
bool m_depends_on_sql_mode_no_unsigned_subtraction;
public:
Item_func_minus(THD *thd, Item *a, Item *b):
Item_func_additive_op(thd, a, b) {}
Item_func_additive_op(thd, a, b),
m_depends_on_sql_mode_no_unsigned_subtraction(false)
{ }
const char *func_name() const { return "-"; }
enum precedence precedence() const { return ADD_PRECEDENCE; }
Sql_mode_dependency value_depends_on_sql_mode() const
{
return m_sql_mode_dependency;
}
Sql_mode_dependency value_depends_on_sql_mode() const;
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
......
......@@ -305,6 +305,7 @@ TP_connection_win::~TP_connection_win()
if (timer)
{
SetThreadpoolTimer(timer, 0, 0, 0);
WaitForThreadpoolTimerCallbacks(timer, TRUE);
CloseThreadpoolTimer(timer);
}
......
......@@ -73,10 +73,6 @@ ELSE(NOT UNIX)
tabwmi.cpp tabwmi.h tabmac.cpp tabmac.h macutil.cpp macutil.h)
# Add exception handling to the CONNECT project)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
SET(IPHLPAPI_LIBRARY iphlpapi.lib)
IF(MSVC AND (CMAKE_CXX_COMPILER_ID MATCHES Clang))
# Connect does not work with clang-cl
......@@ -322,20 +318,20 @@ ENDIF(CONNECT_WITH_MONGO)
OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON)
IF(CONNECT_WITH_REST)
MESSAGE(STATUS "=====> REST support is ON")
FIND_PACKAGE(cpprestsdk)
FIND_PACKAGE(cpprestsdk QUIET)
IF (cpprestsdk_FOUND)
MESSAGE(STATUS "=====> cpprestsdk found")
IF(UNIX)
# INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
# If needed edit next line to set the path to libcpprest.so
SET(REST_LIBRARY -lcpprest)
MESSAGE (STATUS ${REST_LIBRARY})
# MESSAGE (STATUS ${REST_LIBRARY})
ENDIF(UNIX)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)
add_definitions(-DREST_SUPPORT)
IF(REST_LIBRARY)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)
add_definitions(-DREST_SUPPORT)
ENDIF()
ELSE(NOT cpprestsdk_FOUND)
MESSAGE(STATUS "=====> cpprestsdk package not found")
# MESSAGE(STATUS "=====> cpprestsdk package not found")
ENDIF (cpprestsdk_FOUND)
ENDIF(CONNECT_WITH_REST)
......
......@@ -19751,8 +19751,8 @@ static MYSQL_SYSVAR_ENUM(stats_method, srv_innodb_stats_method,
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
PLUGIN_VAR_RQCMDARG,
"Debug flags for InnoDB change buffering (0=none, 2=crash at merge)",
NULL, NULL, 0, 0, 2, 0);
"Debug flags for InnoDB change buffering (0=none, 1=try to buffer)",
NULL, NULL, 0, 0, 1, 0);
static MYSQL_SYSVAR_BOOL(disable_background_merge,
srv_ibuf_disable_background_merge,
......
......@@ -4224,23 +4224,6 @@ ibuf_delete_rec(
ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no);
ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space);
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
if (ibuf_debug == 2) {
/* Inject a fault (crash). We do this before trying
optimistic delete, because a pessimistic delete in the
change buffer would require a larger test case. */
/* Flag the buffered record as processed, to avoid
an assertion failure after crash recovery. */
btr_cur_set_deleted_flag_for_ibuf(
btr_pcur_get_rec(pcur), NULL, TRUE, mtr);
ibuf_mtr_commit(mtr);
log_write_up_to(LSN_MAX, true);
DBUG_SUICIDE();
}
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
success = btr_cur_optimistic_delete(btr_pcur_get_btr_cur(pcur),
0, mtr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment