Skip to content

Commit bb38f9e

Browse files
committed
Merge branch 'mysql-5.6-cluster-7.4' into mysql-5.7-cluster-7.5
2 parents 89f285c + 951862c commit bb38f9e

File tree

120 files changed

+7407
-1351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+7407
-1351
lines changed

mysql-test/lib/My/Memcache.pm

+2
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ sub delete {
513513
my $response = $self->ascii_command("delete $key\r\n");
514514
return 1 if($response =~ "^DELETED");
515515
return 0 if($response =~ "^NOT_FOUND");
516+
return 0 if($response =~ "^SERVER_ERROR");
516517
return $self->protocol_error("delete() got response: $response");
517518
}
518519

@@ -537,6 +538,7 @@ sub store {
537538
return 0 if($response =~ "^NOT_STORED");
538539
return 0 if($response =~ "^EXISTS");
539540
return 0 if($response =~ "^NOT_FOUND");
541+
return 0 if($response =~ "^SERVER_ERROR");
540542
return $self->protocol_error("store() got response: $response");
541543
}
542544

mysql-test/suite/ndb/r/ndb_discover_db.result

+11
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,16 @@ mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
3131
mysqld-bin.000001 # Write_rows # # table_id: #
3232
mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
3333
mysqld-bin.000001 # Query # # COMMIT
34+
Deleting table t1 metadata files and discover_db directory from fs.
35+
Deleting table t1 metadata files and discover_db directory from fs.
36+
flush tables;
37+
Attempt to access table should get error
38+
select * from discover_db.t1;
39+
ERROR 42S02: Table 'discover_db.t1' doesn't exist
40+
Attempt to access table after database created should be ok
41+
create database discover_db;
42+
select * from discover_db.t1;
43+
a b
44+
1 1
3445
drop database discover_db;
3546
drop database discover_db_2;

mysql-test/suite/ndb/r/ndb_err4012.result

+11
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,14 @@ ERROR HY000: Got error 4012 'Request ndbd time-out, maybe due to high load or co
3030
SET SESSION debug=@save_debug;
3131
drop table t4;
3232
# bulk update ignore is not possible because 'ignore' disables bulk updates
33+
# mysqld gets timeout error 4008 on CREATE TABLE
34+
set @save_debug = @@session.debug;
35+
SET SESSION debug="+d,ndb_timeout_gettabinforeq";
36+
create table t4(id int primary key, val int)engine=ndb;
37+
ERROR HY000: Got error 1625 'Unknown error code' from NDBCLUSTER
38+
show warnings;
39+
Level Code Message
40+
Warning 1296 Got error 4008 'Receive from NDB failed' from NDB
41+
Warning 1625 Bad schema for mysql.ndb_replication table. Message: Unable to retrieve mysql.ndb_replication, logging and conflict r
42+
Error 1296 Got error 1625 'Unknown error code' from NDBCLUSTER
43+
SET SESSION debug=@save_debug;

mysql-test/suite/ndb/r/ndb_fk_no_fk.result

+56-3
Original file line numberDiff line numberDiff line change
@@ -774,14 +774,23 @@ drop table t3, t1;
774774
create table t1 (
775775
pk1 int not null primary key,
776776
b int,
777-
foreign key (b) references t2(pk2)
777+
foreign key fk1 (b) references t2(pk2)
778778
) engine=ndb;
779779
set foreign_key_checks=1;
780780
truncate table t1;
781781
set foreign_key_checks=0;
782782
set @@ndb_show_foreign_key_mock_tables= 1;
783783
truncate table t1;
784784
set @@ndb_show_foreign_key_mock_tables= 0;
785+
show create table t1;
786+
Table Create Table
787+
t1 CREATE TABLE `t1` (
788+
`pk1` int(11) NOT NULL,
789+
`b` int(11) DEFAULT NULL,
790+
PRIMARY KEY (`pk1`),
791+
KEY `fk1` (`b`),
792+
CONSTRAINT `fk1` FOREIGN KEY (`b`) REFERENCES `t2` (`pk2`) ON DELETE NO ACTION ON UPDATE NO ACTION
793+
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
785794
drop table t1;
786795
#
787796
# Truncating referenced table -> not allowed
@@ -837,7 +846,41 @@ c int
837846
create table t1 (
838847
pk1 int not null primary key,
839848
b int,
840-
foreign key (b) references t2(pk2)
849+
foreign key fk1 (b) references t2(pk2)
850+
) engine=ndb;
851+
set @@ndb_show_foreign_key_mock_tables= 1;
852+
set foreign_key_checks=1;
853+
truncate table t1;
854+
set foreign_key_checks=0;
855+
truncate table t1;
856+
set @@ndb_show_foreign_key_mock_tables= 0;
857+
show create table t1;
858+
Table Create Table
859+
t1 CREATE TABLE `t1` (
860+
`pk1` int(11) NOT NULL,
861+
`b` int(11) DEFAULT NULL,
862+
PRIMARY KEY (`pk1`),
863+
KEY `fk1` (`b`),
864+
CONSTRAINT `fk1` FOREIGN KEY (`b`) REFERENCES `t2` (`pk2`) ON DELETE NO ACTION ON UPDATE NO ACTION
865+
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
866+
drop table t1, t2;
867+
#
868+
# Truncate with multiple foreign keys
869+
#
870+
create table t2 (
871+
pk2 int not null primary key,
872+
c int
873+
) engine=ndb;
874+
create table t1 (
875+
pk1 int not null primary key,
876+
b int,
877+
c int,
878+
d int,
879+
e int,
880+
foreign key fk1 (b) references t2(pk2),
881+
foreign key fk2 (c) references t3(pk3),
882+
foreign key fk3 (d) references t3(pk4),
883+
foreign key fk4 (e) references t4(pk5)
841884
) engine=ndb;
842885
set @@ndb_show_foreign_key_mock_tables= 1;
843886
set foreign_key_checks=1;
@@ -850,8 +893,18 @@ Table Create Table
850893
t1 CREATE TABLE `t1` (
851894
`pk1` int(11) NOT NULL,
852895
`b` int(11) DEFAULT NULL,
896+
`c` int(11) DEFAULT NULL,
897+
`d` int(11) DEFAULT NULL,
898+
`e` int(11) DEFAULT NULL,
853899
PRIMARY KEY (`pk1`),
854-
KEY `b` (`b`)
900+
KEY `fk1` (`b`),
901+
KEY `fk2` (`c`),
902+
KEY `fk3` (`d`),
903+
KEY `fk4` (`e`),
904+
CONSTRAINT `fk1` FOREIGN KEY (`b`) REFERENCES `t2` (`pk2`) ON DELETE NO ACTION ON UPDATE NO ACTION,
905+
CONSTRAINT `fk2` FOREIGN KEY (`c`) REFERENCES `t3` (`pk3`) ON DELETE NO ACTION ON UPDATE NO ACTION,
906+
CONSTRAINT `fk3` FOREIGN KEY (`d`) REFERENCES `t3` (`pk4`) ON DELETE NO ACTION ON UPDATE NO ACTION,
907+
CONSTRAINT `fk4` FOREIGN KEY (`e`) REFERENCES `t4` (`pk5`) ON DELETE NO ACTION ON UPDATE NO ACTION
855908
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
856909
drop table t1, t2;
857910
#
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Restart mysqld with all data nodes started
2+
# Check that there are still 4 connections from second mysqld
3+
Node 2 is being restarted
4+
5+
Node 4 is being restarted
6+
7+
# Check that there are only _2_ connections from second mysqld
8+
# Restart one mysqld with 2 data nodes down and check how long it took
9+
# Check that there are 2 connections from second mysqld
10+
# Start all data nodes again.
11+
Database node 2 is being started.
12+
13+
Database node 4 is being started.
14+
15+
# Check that there are again 4 connections from second mysqld

mysql-test/suite/ndb/t/ndb_backup_rate.cnf

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ MinDiskWriteSpeed=2M
1010
MaxDiskWriteSpeed=2M
1111
MaxDiskWriteSpeedOtherNodeRestart=2M
1212
DefaultOperationRedoProblemAction=abort
13+
NoOfFragmentLogFiles=3

mysql-test/suite/ndb/t/ndb_backup_rate.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ insert into t1 select * from t1_8192;
5353
--disable_query_log
5454
--disable_result_log
5555
let $mysql_errno= 0;
56-
let $counter= 50;
56+
let $counter= 100;
5757
while (!$mysql_errno)
5858
{
5959
--error 0,1297

mysql-test/suite/ndb/t/ndb_discover_db.test

+32
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,38 @@ reset master;
8383
insert into discover_db_2.t1 values (1,1);
8484
--source include/show_binlog_events.inc
8585

86+
#
87+
# Bug#16890703 MYSQLD STUCK IN OPN TABLES ON SELECT FROM
88+
# RESTORED TABLE WHERE DB IS NOT THERE
89+
#
90+
-- connection server2
91+
let $MYSQLD_DATADIR= `select @@datadir`;
92+
--echo Deleting table t1 metadata files and discover_db directory from fs.
93+
#--echo rm -fr $MYSQLD_DATADIR/discover_db/*
94+
--remove_file $MYSQLD_DATADIR/discover_db/db.opt
95+
--remove_file $MYSQLD_DATADIR/discover_db/t1.ndb
96+
--remove_file $MYSQLD_DATADIR/discover_db/t1.frm
97+
#--echo rmdir $MYSQLD_DATADIR/discover_db
98+
rmdir $MYSQLD_DATADIR/discover_db;
99+
-- connection server1
100+
let $MYSQLD_DATADIR= `select @@datadir`;
101+
--echo Deleting table t1 metadata files and discover_db directory from fs.
102+
#--echo rm -fr $MYSQLD_DATADIR/discover_db/*
103+
--remove_file $MYSQLD_DATADIR/discover_db/db.opt
104+
--remove_file $MYSQLD_DATADIR/discover_db/t1.ndb
105+
--remove_file $MYSQLD_DATADIR/discover_db/t1.frm
106+
#--echo rmdir $MYSQLD_DATADIR/discover_db
107+
rmdir $MYSQLD_DATADIR/discover_db;
108+
109+
flush tables;
110+
--echo Attempt to access table should get error
111+
--error ER_NO_SUCH_TABLE
112+
select * from discover_db.t1;
113+
114+
--echo Attempt to access table after database created should be ok
115+
create database discover_db;
116+
select * from discover_db.t1;
117+
86118
#
87119
# Cleanup
88120
#

mysql-test/suite/ndb/t/ndb_err4012.test

+10
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,13 @@ SET SESSION debug=@save_debug;
4646
drop table t4;
4747

4848
--echo # bulk update ignore is not possible because 'ignore' disables bulk updates
49+
50+
--echo # mysqld gets timeout error 4008 on CREATE TABLE
51+
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 6216" >> $NDB_TOOLS_OUTPUT
52+
set @save_debug = @@session.debug;
53+
SET SESSION debug="+d,ndb_timeout_gettabinforeq";
54+
--error 1296
55+
create table t4(id int primary key, val int)engine=ndb;
56+
show warnings;
57+
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 0" >> $NDB_TOOLS_OUTPUT
58+
SET SESSION debug=@save_debug;

mysql-test/suite/ndb/t/ndb_fk_no_fk.test

+35-2
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ drop table t3, t1;
727727
create table t1 (
728728
pk1 int not null primary key,
729729
b int,
730-
foreign key (b) references t2(pk2)
730+
foreign key fk1 (b) references t2(pk2)
731731
) engine=ndb;
732732

733733
set foreign_key_checks=1;
@@ -738,6 +738,8 @@ set @@ndb_show_foreign_key_mock_tables= 1;
738738
truncate table t1;
739739
set @@ndb_show_foreign_key_mock_tables= 0;
740740

741+
show create table t1;
742+
741743
drop table t1;
742744

743745

@@ -805,7 +807,38 @@ create table t2 (
805807
create table t1 (
806808
pk1 int not null primary key,
807809
b int,
808-
foreign key (b) references t2(pk2)
810+
foreign key fk1 (b) references t2(pk2)
811+
) engine=ndb;
812+
813+
set @@ndb_show_foreign_key_mock_tables= 1;
814+
set foreign_key_checks=1;
815+
truncate table t1;
816+
set foreign_key_checks=0;
817+
818+
truncate table t1;
819+
set @@ndb_show_foreign_key_mock_tables= 0;
820+
821+
show create table t1;
822+
823+
drop table t1, t2;
824+
825+
--echo #
826+
--echo # Truncate with multiple foreign keys
827+
--echo #
828+
create table t2 (
829+
pk2 int not null primary key,
830+
c int
831+
) engine=ndb;
832+
create table t1 (
833+
pk1 int not null primary key,
834+
b int,
835+
c int,
836+
d int,
837+
e int,
838+
foreign key fk1 (b) references t2(pk2),
839+
foreign key fk2 (c) references t3(pk3),
840+
foreign key fk3 (d) references t3(pk4),
841+
foreign key fk4 (e) references t4(pk5)
809842
) engine=ndb;
810843

811844
set @@ndb_show_foreign_key_mock_tables= 1;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
!include ../my.cnf
2+
3+
[cluster_config.1]
4+
NoOfReplicas= 2
5+
ndbd=,,,
6+
ndb_mgmd=
7+
mysqld=,
8+
ndbapi=,,,,,,,,,,,
9+
10+
[mysqld]
11+
ndb-cluster-connection-pool=1
12+
13+
[cluster_config.ndbd.3.1]
14+
Nodegroup=65536
15+
16+
[cluster_config.ndbd.4.1]
17+
Nodegroup=65536
18+
19+
[cluster_config.mysqld.1.1]
20+
NodeId=6
21+
22+
[cluster_config.mysqld.2.1]
23+
NodeId=7
24+
25+
[mysqld.1.1]
26+
ndb-nodeid=6
27+
28+
[mysqld.2.1]
29+
ndb-nodeid=7
30+
31+
[ENV]
32+
NDB_CONNECTSTRING= @mysql_cluster.1.ndb_connectstring
33+
MASTER_MYPORT= @mysqld.1.1.port
34+
MASTER_MYPORT1= @mysqld.2.1.port

0 commit comments

Comments
 (0)