Skip to content
Permalink
Browse files
Merge 10.4 into 10.5
  • Loading branch information
dr-m committed Jan 3, 2020
2 parents 9949ab9 + 9d036f8 commit ca8c3be
Show file tree
Hide file tree
Showing 18 changed files with 250 additions and 49 deletions.
@@ -692,7 +692,7 @@ SET GLOBAL READ_ONLY = 1;

connect u1_con,localhost,mysqltest_u1,,events_test;

CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement

ALTER EVENT e1 COMMENT 'comment';
@@ -703,7 +703,7 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can

connect root_con,localhost,root,,events_test;

CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;
Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.

@@ -1029,7 +1029,7 @@ SET GLOBAL READ_ONLY = 1;
--echo

--error ER_OPTION_PREVENTS_STATEMENT
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;

--echo

@@ -1049,7 +1049,7 @@ DROP EVENT e1;

--echo

CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
CREATE EVENT e1 ON SCHEDULE AT '2038-01-01 00:00:00' DO SET @a = 1;

--echo

@@ -1494,6 +1494,19 @@ x
x
DEALLOCATE PREPARE stmt;
#
# MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) ||
# (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))'
# or alike failed upon SELECT with mix of functions from simple view
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1;
ISNULL( BENCHMARK(1, MIN(a)))
0
DROP VIEW v1;
DROP TABLE t1;
#
# Start of 10.2 tests
#
#
@@ -1139,6 +1139,21 @@ PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

--echo #
--echo # MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) ||
--echo # (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))'
--echo # or alike failed upon SELECT with mix of functions from simple view
--echo #

CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS SELECT * FROM t1;

SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1;

DROP VIEW v1;
DROP TABLE t1;


--echo #
--echo # Start of 10.2 tests
@@ -2844,6 +2844,22 @@ SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
0
drop table t1;
#
# MDEV-20922: Adding an order by changes the query results
#
CREATE TABLE t1(a int, b int);
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200);
create view v1 as select a, b+1 as x from t1;
SELECT x, COUNT(DISTINCT a) AS y FROM v1 GROUP BY x ORDER BY y;
x y
101 2
201 2
SELECT b+1 AS x, COUNT(DISTINCT a) AS y FROM t1 GROUP BY x ORDER BY y;
x y
101 2
201 2
drop view v1;
drop table t1;
#
# MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
#
create table t1 (a int,b int) ;
@@ -1954,6 +1954,20 @@ INSERT INTO t1 VALUES (0,'foo'),(1,'bar');
SELECT 1 IN ( SELECT COUNT( DISTINCT f2 ) FROM t1 WHERE f1 <= 4 );
drop table t1;

--echo #
--echo # MDEV-20922: Adding an order by changes the query results
--echo #

CREATE TABLE t1(a int, b int);
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200);

create view v1 as select a, b+1 as x from t1;

SELECT x, COUNT(DISTINCT a) AS y FROM v1 GROUP BY x ORDER BY y;
SELECT b+1 AS x, COUNT(DISTINCT a) AS y FROM t1 GROUP BY x ORDER BY y;

drop view v1;
drop table t1;
--echo #
--echo # MDEV-10694 - SIGFPE and/or huge memory allocation in maria_create with distinct/group by/ rollup
--echo #
@@ -5573,12 +5573,12 @@ sub server_need_restart {
{
delete $server->{'restart_opts'};
my $use_dynamic_option_switch= 0;
delete $server->{'restart_opts'};
my $restart_opts = delete $server->{'restart_opts'} || [];
if (!$use_dynamic_option_switch)
{
mtr_verbose_restart($server, "running with different options '" .
join(" ", @{$extra_opts}) . "' != '" .
join(" ", @{$started_opts}) . "'" );
join(" ", @{$started_opts}, @{$restart_opts}) . "'" );
return 1;
}

@@ -13,6 +13,7 @@
GCF-1081 : MDEV-18283 Galera test failure on galera.GCF-1081
MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill
MW-329 : MDEV-19962 Galera test failure on MW-329
MW-336 : MDEV-21409: Galera test failure on MW-336
MW-360 : needs rewrite to be MariaDB gtid compatible
MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388
galera_account_management : MariaDB 10.0 does not support ALTER USER
@@ -45,3 +46,4 @@ galera_wan : MDEV-17259 Test failure on galera.galera_wan
mysql-wsrep#198 : MDEV-18935 Galera test mysql-wsrep#198 sporaric assertion transaction.cpp:362: int wsrep::transaction::before_commit(): Assertion `state() == s_executing || state() == s_committing || state() == s_must_abort || state() == s_replaying' failed.
partition : MDEV-19958 Galera test failure on galera.partition
query_cache: MDEV-15805 Test failure on galera.query_cache

@@ -0,0 +1,39 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT);
INSERT INTO t1 VALUES (1, 0), (5, 0);
connection node_1_ctrl;
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_slave_threads = 2;
connection node_1;
SET SESSION wsrep_retry_autocommit = 0;
START TRANSACTION;
UPDATE t1 SET f2 = 1;
SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";
connection node_1_ctrl;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
INSERT INTO t1 VALUES (2, 2);
connection node_1_ctrl;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_slave_enter_sync';
connection node_2;
UPDATE t1 SET f2 = 2 WHERE f1 = 5;
connection node_1_ctrl;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
connection node_1;
COMMIT;
connection node_1_ctrl;
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET SESSION debug_sync = "now WAIT_FOR reached";
SET GLOBAL wsrep_provider_options = 'signal=local_monitor_slave_enter_sync';
SET GLOBAL wsrep_provider_options = 'dbug=';
SET SESSION debug_sync = "now SIGNAL continue";
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET debug_sync = "RESET";
DROP TABLE t1;
SET GLOBAL wsrep_slave_threads = 1;
@@ -0,0 +1,77 @@
#
# MDEV-20793 Assertion after certification failure during replay.
#
# The test outline:
# In order to produce certification failure three transactions
# are needed. One transaction is executing on node_1 and two others
# on node_2. The first transaction from node_2 BF aborts the transaction
# on node_1, but does not cause certification conflict. The second
# transaction from node_2 will cause conflict and the transaction on
# node_1 fails in certification during replay.
#

--source include/galera_cluster.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc

CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT);
INSERT INTO t1 VALUES (1, 0), (5, 0);

--let galera_connection_name = node_1_ctrl
--let galera_server_number = 1
--source include/galera_connect.inc
--connection node_1_ctrl
SET SESSION wsrep_sync_wait = 0;
SET GLOBAL wsrep_slave_threads = 2;

--connection node_1
# Start transaction which takes gap lock 1 - 5
SET SESSION wsrep_retry_autocommit = 0;
START TRANSACTION;
UPDATE t1 SET f2 = 1;
SET SESSION debug_sync = "wsrep_before_replay SIGNAL reached WAIT_FOR continue";

--connection node_1_ctrl
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc

--connection node_2
# Insert into gap from other node. This generates BF abort but does not
# conflict with update.
INSERT INTO t1 VALUES (2, 2);

--connection node_1_ctrl
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc
--let $galera_sync_point = local_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc

# Make an update which will conflict with update on node_1
--connection node_2
UPDATE t1 SET f2 = 2 WHERE f1 = 5;

--connection node_1_ctrl
--let $galera_sync_point = apply_monitor_slave_enter_sync local_monitor_slave_enter_sync
--source include/galera_wait_sync_point.inc

--connection node_1
--send COMMIT

--connection node_1_ctrl
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_signal_sync_point.inc
SET SESSION debug_sync = "now WAIT_FOR reached";

--let $galera_sync_point = local_monitor_slave_enter_sync
--source include/galera_signal_sync_point.inc
--source include/galera_clear_sync_point.inc
SET SESSION debug_sync = "now SIGNAL continue";

--connection node_1
--error ER_LOCK_DEADLOCK
--reap

SET debug_sync = "RESET";

DROP TABLE t1;
SET GLOBAL wsrep_slave_threads = 1;
@@ -37,17 +37,24 @@ SET GLOBAL wsrep_slave_threads = 4;

--connection node_1
--reap
--let $wait_condition = select count(*)=30000 from t1;
--source include/wait_condition.inc

SELECT COUNT(*) FROM t1;
SELECT COUNT(DISTINCT f1) FROM t1;

--connection node_1a
--reap
--let $wait_condition = select count(*)=30000 from t1;
--source include/wait_condition.inc
SELECT COUNT(*) FROM t1;
SELECT COUNT(DISTINCT f1) FROM t1;

--connection node_2
--reap
--disconnect node_1a
--let $wait_condition = select count(*)=30000 from t1;
--source include/wait_condition.inc
SELECT COUNT(*) FROM t1;
SELECT COUNT(DISTINCT f1) FROM t1;

@@ -9157,6 +9157,46 @@ bool Item_args::excl_dep_on_grouping_fields(st_select_lex *sel)
}


double Item_direct_view_ref::val_result()
{
double tmp=(*ref)->val_result();
null_value=(*ref)->null_value;
return tmp;
}


longlong Item_direct_view_ref::val_int_result()
{
longlong tmp=(*ref)->val_int_result();
null_value=(*ref)->null_value;
return tmp;
}


String *Item_direct_view_ref::str_result(String* tmp)
{
tmp=(*ref)->str_result(tmp);
null_value=(*ref)->null_value;
return tmp;
}


my_decimal *Item_direct_view_ref::val_decimal_result(my_decimal *val)
{
my_decimal *tmp= (*ref)->val_decimal_result(val);
null_value=(*ref)->null_value;
return tmp;
}


bool Item_direct_view_ref::val_bool_result()
{
bool tmp= (*ref)->val_bool_result();
null_value=(*ref)->null_value;
return tmp;
}


bool Item_default_value::eq(const Item *item, bool binary_cmp) const
{
return item->type() == DEFAULT_VALUE_ITEM &&
@@ -5764,6 +5764,15 @@ class Item_direct_view_ref :public Item_direct_ref
item_equal= NULL;
Item_direct_ref::cleanup();
}
/*
TODO move these val_*_result function to Item_dierct_ref (maybe)
*/
double val_result();
longlong val_int_result();
String *str_result(String* tmp);
my_decimal *val_decimal_result(my_decimal *val);
bool val_bool_result();

Item *get_copy(THD *thd)
{ return get_item_copy<Item_direct_view_ref>(thd, this); }
Item *field_transformer_for_having_pushdown(THD *thd, uchar *arg)
@@ -5108,7 +5108,7 @@ void SELECT_LEX::update_used_tables()
}

Item *item;
List_iterator_fast<Item> it(join->fields_list);
List_iterator_fast<Item> it(join->all_fields);
select_list_tables= 0;
while ((item= it++))
{
@@ -616,9 +616,7 @@ Wsrep_replayer_service::~Wsrep_replayer_service()
THD* replayer_thd= m_thd;
THD* orig_thd= m_orig_thd;

/* Store replay result/state to original thread wsrep client
state and switch execution context back to original. */
orig_thd->wsrep_cs().after_replay(replayer_thd->wsrep_trx());
/* Switch execution context back to original. */
wsrep_after_apply(replayer_thd);
wsrep_after_command_ignore_result(replayer_thd);
wsrep_close(replayer_thd);

0 comments on commit ca8c3be

Please sign in to comment.