Skip to content

Commit 49bcc82

Browse files
committed
Merge branch '10.1' into 10.2
2 parents 7ed0156 + b885426 commit 49bcc82

20 files changed

+528
-95
lines changed

mysql-test/r/type_time_6065.result

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,3 +2308,47 @@ col_int_nokey
23082308
1
23092309
DROP TABLE t1,t2,t3;
23102310
SET TIMESTAMP=0;
2311+
#
2312+
# MDEV-15262 Wrong results for SELECT..WHERE non_indexed_datetime_column=indexed_time_column
2313+
#
2314+
SET TIMESTAMP=UNIX_TIMESTAMP('2012-01-31 10:14:35');
2315+
CREATE TABLE t1 (col_time_key TIME, KEY(col_time_key));
2316+
CREATE TABLE t2 (col_datetime_key DATETIME);
2317+
INSERT INTO t1 VALUES ('-760:00:00'),('760:00:00');
2318+
INSERT INTO t1 VALUES ('-770:00:00'),('770:00:00');
2319+
INSERT INTO t2 SELECT * FROM t1;
2320+
SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key;
2321+
col_datetime_key col_time_key
2322+
2011-12-30 08:00:00 -760:00:00
2323+
2012-03-02 16:00:00 760:00:00
2324+
2011-12-29 22:00:00 -770:00:00
2325+
2012-03-03 02:00:00 770:00:00
2326+
SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key;
2327+
col_datetime_key col_time_key
2328+
2011-12-29 22:00:00 -770:00:00
2329+
2011-12-30 08:00:00 -760:00:00
2330+
2012-03-02 16:00:00 760:00:00
2331+
2012-03-03 02:00:00 770:00:00
2332+
INSERT INTO t1 VALUES ('-838:59:59'),('838:59:59');
2333+
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-838:59:59' HOUR_SECOND));
2334+
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '838:59:59' HOUR_SECOND));
2335+
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-839:00:00' HOUR_SECOND));
2336+
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '839:00:00' HOUR_SECOND));
2337+
SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key;
2338+
col_datetime_key col_time_key
2339+
2011-12-30 08:00:00 -760:00:00
2340+
2012-03-02 16:00:00 760:00:00
2341+
2011-12-29 22:00:00 -770:00:00
2342+
2012-03-03 02:00:00 770:00:00
2343+
2011-12-27 01:00:01 -838:59:59
2344+
2012-03-05 22:59:59 838:59:59
2345+
SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key;
2346+
col_datetime_key col_time_key
2347+
2011-12-29 22:00:00 -770:00:00
2348+
2011-12-30 08:00:00 -760:00:00
2349+
2012-03-02 16:00:00 760:00:00
2350+
2012-03-03 02:00:00 770:00:00
2351+
2011-12-27 01:00:01 -838:59:59
2352+
2012-03-05 22:59:59 838:59:59
2353+
DROP TABLE t1, t2;
2354+
SET TIMESTAMP=DEFAULT;

mysql-test/suite/encryption/r/innodb-bad-key-change.result

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,7 @@ foobar 2
2626
# Restart server with keysbad3.txt
2727
SELECT * FROM t1;
2828
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
29-
SHOW WARNINGS;
30-
Level Code Message
31-
Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
32-
Warning 192 Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
33-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
3429
DROP TABLE t1;
35-
SHOW WARNINGS;
36-
Level Code Message
3730
# Start server with keys3.txt
3831
SET GLOBAL innodb_default_encryption_key_id=5;
3932
CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES;
@@ -42,73 +35,32 @@ INSERT INTO t2 VALUES ('foobar',1,2);
4235
# Restart server with keys2.txt
4336
SELECT * FROM t2;
4437
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
45-
SHOW WARNINGS;
46-
Level Code Message
47-
Warning 192 Table test/t2 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
48-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
49-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
5038
SELECT * FROM t2 where id = 1;
5139
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
52-
SHOW WARNINGS;
53-
Level Code Message
54-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
55-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
5640
SELECT * FROM t2 where b = 1;
5741
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
58-
SHOW WARNINGS;
59-
Level Code Message
60-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
61-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
6242
INSERT INTO t2 VALUES ('tmp',3,3);
6343
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
64-
SHOW WARNINGS;
65-
Level Code Message
66-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
67-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
6844
DELETE FROM t2 where b = 3;
6945
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
70-
SHOW WARNINGS;
71-
Level Code Message
72-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
73-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
7446
DELETE FROM t2 where id = 3;
7547
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
76-
SHOW WARNINGS;
77-
Level Code Message
78-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
79-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
8048
UPDATE t2 set b = b +1;
8149
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
82-
SHOW WARNINGS;
83-
Level Code Message
84-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
85-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
8650
OPTIMIZE TABLE t2;
8751
Table Op Msg_type Msg_text
8852
test.t2 optimize Warning Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
8953
test.t2 optimize Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
9054
test.t2 optimize error Corrupt
91-
SHOW WARNINGS;
92-
Level Code Message
9355
ALTER TABLE t2 ADD COLUMN d INT;
9456
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
95-
SHOW WARNINGS;
96-
Level Code Message
97-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
98-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
9957
ANALYZE TABLE t2;
10058
Table Op Msg_type Msg_text
10159
test.t2 analyze Warning Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
10260
test.t2 analyze Error Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
10361
test.t2 analyze error Corrupt
104-
SHOW WARNINGS;
105-
Level Code Message
10662
TRUNCATE TABLE t2;
10763
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
108-
SHOW WARNINGS;
109-
Level Code Message
110-
Warning 192 Table t2 in file ./test/t2.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
111-
Error 1296 Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
11264
DROP TABLE t2;
11365

11466
# Start server with keys2.txt

mysql-test/suite/encryption/r/tempfiles.result

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
select @@encrypt_tmp_files;
2+
@@encrypt_tmp_files
3+
1
14
CREATE TABLE t1(a INT);
25
INSERT INTO t1 VALUES(1),(2);
36
DELETE FROM t1 WHERE a=1;
@@ -25,6 +28,7 @@ h 10
2528
i 10
2629
j 10
2730
drop table t1;
31+
reset master;
2832
set global binlog_cache_size=8192;
2933
connect con1, localhost, root;
3034
create table t1 (a text) engine=innodb;
@@ -34,18 +38,71 @@ commit;
3438
start transaction;
3539
insert t1 select repeat(seq, 1000) from seq_1_to_8;
3640
commit;
37-
drop table t1;
3841
disconnect con1;
3942
connect con2, localhost, root;
40-
create table t1 (a text) engine=innodb;
43+
create table t2 (a text) engine=innodb;
4144
start transaction;
42-
insert t1 select repeat(seq, 1000) from seq_1_to_15;
45+
insert t2 select repeat(seq, 1000) from seq_1_to_15;
4346
savepoint foo;
44-
insert t1 select repeat(seq, 1000) from seq_16_to_30;
47+
insert t2 select repeat(seq, 1000) from seq_16_to_30;
4548
rollback to savepoint foo;
46-
insert t1 select repeat(seq, 1000) from seq_31_to_40;
49+
insert t2 select repeat(seq, 1000) from seq_31_to_40;
4750
commit;
48-
drop table t1;
4951
disconnect con2;
5052
connection default;
53+
flush binary logs;
54+
drop table t1, t2;
5155
set global binlog_cache_size=default;
56+
select left(a, 10) from t1;
57+
left(a, 10)
58+
1111111111
59+
2222222222
60+
3333333333
61+
4444444444
62+
5555555555
63+
6666666666
64+
7777777777
65+
8888888888
66+
9999999999
67+
1010101010
68+
1111111111
69+
1212121212
70+
1313131313
71+
1414141414
72+
1515151515
73+
1111111111
74+
2222222222
75+
3333333333
76+
4444444444
77+
5555555555
78+
6666666666
79+
7777777777
80+
8888888888
81+
select left(a, 10) from t2;
82+
left(a, 10)
83+
1111111111
84+
2222222222
85+
3333333333
86+
4444444444
87+
5555555555
88+
6666666666
89+
7777777777
90+
8888888888
91+
9999999999
92+
1010101010
93+
1111111111
94+
1212121212
95+
1313131313
96+
1414141414
97+
1515151515
98+
3131313131
99+
3232323232
100+
3333333333
101+
3434343434
102+
3535353535
103+
3636363636
104+
3737373737
105+
3838383838
106+
3939393939
107+
4040404040
108+
drop table t1, t2;

mysql-test/suite/encryption/t/innodb-bad-key-change.test

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,18 @@ SELECT * FROM t1;
3636
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
3737
-- source include/restart_mysqld.inc
3838

39+
--disable_warnings
3940
--error ER_GET_ERRMSG
4041
SELECT * FROM t1;
41-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
42-
SHOW WARNINGS;
42+
--enable_warnings
4343

4444
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
4545
-- source include/restart_mysqld.inc
46-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
46+
47+
--disable_warnings
48+
--replace_regex /tablespace [0-9]*/tablespace /
4749
DROP TABLE t1;
48-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
49-
SHOW WARNINGS;
50+
--enable_warnings
5051

5152
#
5253
# MDEV-8591: Database page corruption on disk or a failed space, Assertion failure in file buf0buf.cc
@@ -66,50 +67,41 @@ INSERT INTO t2 VALUES ('foobar',1,2);
6667
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
6768
-- source include/restart_mysqld.inc
6869

70+
--disable_warnings
6971
--error ER_GET_ERRMSG
7072
SELECT * FROM t2;
71-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
72-
SHOW WARNINGS;
73+
7374
--error ER_GET_ERRMSG
7475
SELECT * FROM t2 where id = 1;
75-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
76-
SHOW WARNINGS;
76+
7777
--error ER_GET_ERRMSG
7878
SELECT * FROM t2 where b = 1;
79-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
80-
SHOW WARNINGS;
79+
80+
--replace_regex /tablespace [0-9]*/tablespace /
8181
--error ER_GET_ERRMSG
8282
INSERT INTO t2 VALUES ('tmp',3,3);
83-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
84-
SHOW WARNINGS;
83+
8584
--error ER_GET_ERRMSG
8685
DELETE FROM t2 where b = 3;
87-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
88-
SHOW WARNINGS;
86+
8987
--error ER_GET_ERRMSG
9088
DELETE FROM t2 where id = 3;
91-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
92-
SHOW WARNINGS;
89+
9390
--error ER_GET_ERRMSG
9491
UPDATE t2 set b = b +1;
95-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
96-
SHOW WARNINGS;
92+
9793
OPTIMIZE TABLE t2;
98-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
99-
SHOW WARNINGS;
94+
10095
--error ER_GET_ERRMSG
10196
ALTER TABLE t2 ADD COLUMN d INT;
102-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
103-
SHOW WARNINGS;
97+
10498
ANALYZE TABLE t2;
105-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
106-
SHOW WARNINGS;
99+
107100
--error ER_GET_ERRMSG
108101
TRUNCATE TABLE t2;
109-
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
110-
SHOW WARNINGS;
111102

112103
DROP TABLE t2;
104+
--enable_warnings
113105

114106
--echo
115107
--echo # Start server with keys2.txt
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[none]
2+
binlog-checksum=NONE
3+
4+
[crc32]
5+
binlog-checksum=CRC32
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--encrypt-tmp-files

mysql-test/suite/encryption/t/tempfiles.test

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ source include/have_binlog_format_row.inc;
99

1010
source include/have_innodb.inc;
1111

12+
select @@encrypt_tmp_files;
13+
1214
#
1315
# MyISAM messing around with IO_CACHE::file
1416
#
@@ -29,6 +31,7 @@ update t1 set c=v, t=v;
2931
select sql_big_result t,count(t) from t1 group by t limit 10;
3032
drop table t1;
3133

34+
reset master;
3235
set global binlog_cache_size=8192;
3336

3437
connect con1, localhost, root;
@@ -46,7 +49,6 @@ commit;
4649
start transaction;
4750
insert t1 select repeat(seq, 1000) from seq_1_to_8;
4851
commit;
49-
drop table t1;
5052

5153
disconnect con1;
5254
connect con2, localhost, root;
@@ -56,17 +58,27 @@ connect con2, localhost, root;
5658
# Start a transaction, write until the cache goes to disk,
5759
# create a savepoint, write more blocks to disk, rollback to savepoint.
5860
#
59-
create table t1 (a text) engine=innodb;
61+
create table t2 (a text) engine=innodb;
6062
start transaction;
61-
insert t1 select repeat(seq, 1000) from seq_1_to_15;
63+
insert t2 select repeat(seq, 1000) from seq_1_to_15;
6264
savepoint foo;
63-
insert t1 select repeat(seq, 1000) from seq_16_to_30;
65+
insert t2 select repeat(seq, 1000) from seq_16_to_30;
6466
rollback to savepoint foo;
65-
insert t1 select repeat(seq, 1000) from seq_31_to_40;
67+
insert t2 select repeat(seq, 1000) from seq_31_to_40;
6668
commit;
67-
drop table t1;
6869

6970
disconnect con2;
7071
connection default;
7172

73+
flush binary logs;
74+
75+
drop table t1, t2;
76+
7277
set global binlog_cache_size=default;
78+
79+
let $MYSQLD_DATADIR= `select @@datadir`;
80+
exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL;
81+
82+
select left(a, 10) from t1;
83+
select left(a, 10) from t2;
84+
drop table t1, t2;

0 commit comments

Comments
 (0)