Skip to content

Commit b57c6cb

Browse files
committed
Merge branch '10.2-release' into 10.2
2 parents 37759b2 + 985f63c commit b57c6cb

15 files changed

+771
-182
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ INCLUDE(mysql_version)
144144
INCLUDE(cpack_source_ignore_files)
145145
INCLUDE(install_layout)
146146
INCLUDE(wsrep)
147-
INCLUDE(cpack_rpm)
148-
INCLUDE(cpack_deb)
149147

150148
# Add macros
151149
INCLUDE(character_sets)
@@ -390,6 +388,9 @@ IF(WITH_UNIT_TESTS)
390388
ENDIF()
391389
ENDIF()
392390

391+
INCLUDE(cpack_rpm)
392+
INCLUDE(cpack_deb)
393+
393394
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
394395

395396
INCLUDE(submodules)

cmake/cpack_rpm.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
227227
ALTERNATIVE_NAME("test" "mariadb-test")
228228
ELSEIF(RPM MATCHES "(rhel|centos)8")
229229
SET(PYTHON_SHEBANG "/usr/bin/python3")
230+
ELSEIF(RPM MATCHES "sles")
231+
ALTERNATIVE_NAME("server" "mariadb")
232+
SETA(CPACK_RPM_server_PACKAGE_PROVIDES
233+
"mysql = %{version}-%{release}"
234+
"mariadb_${MAJOR_VERSION}${MINOR_VERSION} = %{version}-%{release}"
235+
"mariadb-${MAJOR_VERSION}${MINOR_VERSION} = %{version}-%{release}"
236+
"mariadb-server = %{version}-%{release}"
237+
)
230238
ENDIF()
231239

232240
# If we want to build build MariaDB-shared-compat,

libmariadb

mysql-test/r/mysqltest_tracking_info.result

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set @save_session_track_system_variables=@@session_track_system_variables;
12
SELECT @@session.character_set_connection;
23
@@session.character_set_connection
34
latin1
@@ -28,4 +29,19 @@ SET NAMES 'utf8';
2829

2930
# tracking info off once
3031
SET NAMES 'big5';
31-
SET @@session.session_track_system_variables= default;
32+
SET @@session.session_track_system_variables= @save_session_track_system_variables;
33+
#
34+
# MDEV-22504: session tracking return incorrectly long traking data
35+
#
36+
set @save_optimizer_switch=@@optimizer_switch;
37+
SET @@session.session_track_system_variables='optimizer_switch';
38+
set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
39+
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
40+
-- optimizer_switch
41+
-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off
42+
43+
Warnings:
44+
Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
45+
set @@optimizer_switch=@save_optimizer_switch;
46+
SET @@session.session_track_system_variables= @save_session_track_system_variables;
47+
# End of 10.2 tests

mysql-test/r/processlist_notembedded.result

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
#
44
connect con1,localhost,root,,;
55
connection con1;
6-
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
6+
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go';
77
connection default;
88
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
9-
FOUND 1 /sleep \(30\)/ in MDEV-20466.text
9+
FOUND 1 /sleep/ in MDEV-20466.text
10+
SET DEBUG_SYNC= 'now SIGNAL go';
1011
disconnect con1;
1112
SET DEBUG_SYNC = 'RESET';
1213
End of 5.5 tests

mysql-test/suite/innodb/r/foreign_key.result

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ ERROR 70100: Query execution was interrupted
209209
connection con1;
210210
ROLLBACK;
211211
connection default;
212+
disconnect con1;
212213
DROP TABLE t3,t1;
213214
#
214215
# MDEV-18222 InnoDB: Failing assertion: heap->magic_n == MEM_BLOCK_MAGIC_N
@@ -291,6 +292,121 @@ ALTER TABLE t1 DROP f3;
291292
ALTER TABLE t1 CHANGE f f3 INT;
292293
DROP TABLE t1;
293294
SET FOREIGN_KEY_CHECKS=1;
295+
#
296+
# Bug #19471516 SERVER CRASHES WHEN EXECUTING ALTER TABLE
297+
# ADD FOREIGN KEY
298+
#
299+
CREATE TABLE `department` (`department_id` INT, `department_people_fk` INT,
300+
PRIMARY KEY (`department_id`)) engine=innodb;
301+
CREATE TABLE `title` (`title_id` INT, `title_manager_fk` INT,
302+
`title_reporter_fk` INT, PRIMARY KEY (`title_id`)) engine=innodb;
303+
CREATE TABLE `people` (`people_id` INT, PRIMARY KEY (`people_id`)) engine=innodb;
304+
ALTER TABLE `department` ADD FOREIGN KEY (`department_people_fk`) REFERENCES
305+
`people` (`people_id`);
306+
ALTER TABLE `title` ADD FOREIGN KEY (`title_manager_fk`) REFERENCES `people`
307+
(`people_id`);
308+
ALTER TABLE `title` ADD FOREIGN KEY (`title_reporter_fk`) REFERENCES `people`
309+
(`people_id`);
310+
drop table title, department, people;
311+
create table t1 (a int primary key, b int) engine=innodb;
312+
create table t2 (c int primary key, d int,
313+
foreign key (d) references t1 (a) on update cascade) engine=innodb;
314+
insert t1 values (1,1),(2,2),(3,3);
315+
insert t2 values (4,1),(5,2),(6,3);
316+
flush table t2 with read lock;
317+
connect con1,localhost,root;
318+
delete from t1 where a=2;
319+
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE)
320+
update t1 set a=10 where a=1;
321+
connection default;
322+
unlock tables;
323+
connection con1;
324+
connection default;
325+
lock table t2 write;
326+
connection con1;
327+
delete from t1 where a=2;
328+
connection default;
329+
unlock tables;
330+
connection con1;
331+
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`d`) REFERENCES `t1` (`a`) ON UPDATE CASCADE)
332+
connection default;
333+
unlock tables;
334+
disconnect con1;
335+
create user foo;
336+
grant select,update on test.t1 to foo;
337+
connect foo,localhost,foo;
338+
update t1 set a=30 where a=3;
339+
disconnect foo;
340+
connection default;
341+
select * from t2;
342+
c d
343+
5 2
344+
4 10
345+
6 30
346+
drop table t2, t1;
347+
drop user foo;
348+
#
349+
# MDEV-17595 - Server crashes in copy_data_between_tables or
350+
# Assertion `thd->transaction.stmt.is_empty() ||
351+
# (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)'
352+
# fails in close_tables_for_reopen upon concurrent
353+
# ALTER TABLE and FLUSH
354+
#
355+
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=InnoDB;
356+
INSERT INTO t1 VALUES(1),(2);
357+
CREATE TABLE t2 (b INT, KEY(b)) ENGINE=InnoDB;
358+
INSERT INTO t2 VALUES(2);
359+
ALTER TABLE t2 ADD FOREIGN KEY(b) REFERENCES t1(a), LOCK=EXCLUSIVE;
360+
DROP TABLE t2, t1;
361+
create table t1 (pk int primary key, data int) engine=innodb;
362+
insert t1 values (1,1),(2,2),(3,3);
363+
create table t2 (t1_pk int, foreign key (t1_pk) references t1 (pk)) engine=innodb;
364+
insert t2 values (1),(2);
365+
insert t2 values (10);
366+
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_pk`) REFERENCES `t1` (`pk`))
367+
flush tables;
368+
flush status;
369+
update t1 set data=10 where pk+1>10;
370+
show status like '%opened_tab%';
371+
Variable_name Value
372+
Opened_table_definitions 1
373+
Opened_tables 1
374+
flush tables;
375+
flush status;
376+
update t2 set t1_pk=11 where t1_pk+1>10;
377+
show status like '%opened_tab%';
378+
Variable_name Value
379+
Opened_table_definitions 1
380+
Opened_tables 1
381+
flush tables;
382+
flush status;
383+
lock tables t1 write;
384+
show status like '%opened_tab%';
385+
Variable_name Value
386+
Opened_table_definitions 2
387+
Opened_tables 2
388+
insert t1 values (4,4);
389+
show status like '%opened_tab%';
390+
Variable_name Value
391+
Opened_table_definitions 2
392+
Opened_tables 2
393+
unlock tables;
394+
create function foo() returns int
395+
begin
396+
insert t1 values (5,5);
397+
return 5;
398+
end|
399+
flush tables;
400+
flush status;
401+
select foo();
402+
foo()
403+
5
404+
show status like '%opened_tab%';
405+
Variable_name Value
406+
Opened_table_definitions 2
407+
Opened_tables 2
408+
drop function foo;
409+
drop table t2, t1;
294410
# Start of 10.2 tests
295411
#
296412
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
@@ -328,6 +444,7 @@ INSERT INTO matchmaking_group_users VALUES (10,1),(11,2);
328444
INSERT INTO matchmaking_group_maps VALUES (10,55),(11,66);
329445
BEGIN;
330446
UPDATE users SET name = 'qux' WHERE id = 1;
447+
connect con1,localhost,root;
331448
connection con1;
332449
SET innodb_lock_wait_timeout= 1;
333450
DELETE FROM matchmaking_groups WHERE id = 10;
@@ -538,4 +655,63 @@ Table Op Msg_type Msg_text
538655
test.t1 check status OK
539656
DROP TABLE t1;
540657
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
658+
#
659+
# MDEV-17187 table doesn't exist in engine after ALTER other tables
660+
# with CONSTRAINTs
661+
#
662+
set foreign_key_checks=on;
663+
create table t1 (id int not null primary key) engine=innodb;
664+
create table t2 (id int not null primary key, fid int not null,
665+
CONSTRAINT fk_fid FOREIGN KEY (fid) REFERENCES t1 (id))engine=innodb;
666+
insert into t1 values (1), (2), (3);
667+
insert into t2 values (1, 1), (2, 1), (3, 2);
668+
set foreign_key_checks=off;
669+
alter table t2 drop index fk_fid;
670+
set foreign_key_checks=on;
671+
delete from t1 where id=2;
672+
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_fid` FOREIGN KEY (`fid`) REFERENCES `t1` (`id`))
673+
insert into t2 values(4, 99);
674+
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_fid` FOREIGN KEY (`fid`) REFERENCES `t1` (`id`))
675+
select * from t1;
676+
id
677+
1
678+
2
679+
3
680+
select * from t2;
681+
id fid
682+
1 1
683+
2 1
684+
3 2
685+
set foreign_key_checks=off;
686+
delete from t1 where id=2;
687+
insert into t2 values(4, 99);
688+
set foreign_key_checks=on;
689+
select * from t1;
690+
id
691+
1
692+
3
693+
select * from t2;
694+
id fid
695+
1 1
696+
2 1
697+
3 2
698+
4 99
699+
show create table t1;
700+
Table Create Table
701+
t1 CREATE TABLE `t1` (
702+
`id` int(11) NOT NULL,
703+
PRIMARY KEY (`id`)
704+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
705+
show create table t2;
706+
Table Create Table
707+
t2 CREATE TABLE `t2` (
708+
`id` int(11) NOT NULL,
709+
`fid` int(11) NOT NULL,
710+
PRIMARY KEY (`id`),
711+
CONSTRAINT `fk_fid` FOREIGN KEY (`fid`) REFERENCES `t1` (`id`)
712+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
713+
drop table t1,t2;
714+
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
715+
drop table t1,t2;
716+
ERROR 42S02: Unknown table 'test.t2'
541717
# End of 10.2 tests
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
create table t1 (f1 int primary key) engine=innodb;
2+
create table t2 (f2 int primary key) engine=innodb;
3+
create table t3 (f3 int primary key, foreign key (f3) references t2(f2)) engine=innodb;
4+
insert into t1 values (1),(2),(3),(4),(5);
5+
insert into t2 values (1),(2),(3),(4),(5);
6+
insert into t3 values (1),(2),(3),(4),(5);
7+
connect con1,localhost,root;
8+
set debug_sync='alter_table_before_rename_result_table signal g1 wait_for g2';
9+
alter table t2 add constraint foreign key (f2) references t1(f1) on delete cascade on update cascade;
10+
connection default;
11+
set debug_sync='before_execute_sql_command wait_for g1';
12+
update t1 set f1 = f1 + 100000 limit 2;
13+
connect con2,localhost,root;
14+
kill query UPDATE;
15+
disconnect con2;
16+
connection default;
17+
ERROR 70100: Query execution was interrupted
18+
set debug_sync='now signal g2';
19+
connection con1;
20+
show create table t2;
21+
Table Create Table
22+
t2 CREATE TABLE `t2` (
23+
`f2` int(11) NOT NULL,
24+
PRIMARY KEY (`f2`),
25+
CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`) ON DELETE CASCADE ON UPDATE CASCADE
26+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
27+
disconnect con1;
28+
connection default;
29+
select * from t2 where f2 not in (select f1 from t1);
30+
f2
31+
select * from t3 where f3 not in (select f2 from t2);
32+
f3
33+
drop table t3;
34+
drop table t2;
35+
drop table t1;
36+
set debug_sync='reset';
37+
#
38+
# MDEV-16060 - InnoDB: Failing assertion: ut_strcmp(index->name, key->name)
39+
#
40+
CREATE TABLE t1 (`pk` INT PRIMARY KEY) ENGINE=InnoDB;
41+
CREATE TABLE t2 LIKE t1;
42+
FLUSH TABLES;
43+
SET debug_sync='alter_table_intermediate_table_created SIGNAL ready WAIT_FOR go';
44+
ALTER TABLE t1 ADD FOREIGN KEY(pk) REFERENCES t2(pk) ON UPDATE CASCADE;
45+
connect con1, localhost, root;
46+
SET debug_sync='now WAIT_FOR ready';
47+
SET lock_wait_timeout=1;
48+
UPDATE t2 SET pk=10 WHERE pk=1;
49+
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
50+
PREPARE stmt FROM 'UPDATE t2 SET pk=10 WHERE pk=1';
51+
DEALLOCATE PREPARE stmt;
52+
FLUSH TABLE t2;
53+
SET debug_sync='now SIGNAL go';
54+
connection default;
55+
disconnect con1;
56+
connection default;
57+
SET debug_sync='reset';
58+
SHOW OPEN TABLES FROM test;
59+
Database Table In_use Name_locked
60+
DROP TABLE t1, t2;

0 commit comments

Comments
 (0)