Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Barkov committed Feb 12, 2018
2 parents 5559905 + 7a106d1 commit da99e08
Show file tree
Hide file tree
Showing 38 changed files with 1,520 additions and 205 deletions.
7 changes: 5 additions & 2 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ fi

# Convert gcc version to numberical value. Format is Mmmpp where M is Major
# version, mm is minor version and p is patch.
GCCVERSION=$(gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$/&00/')
# -dumpfullversion & -dumpversion to make it uniform across old and new (>=7)
GCCVERSION=$(gcc -dumpfullversion -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' \
-e 's/\.\([0-9]\)/0\1/g' \
-e 's/^[0-9]\{3,4\}$/&00/')
# Don't build rocksdb package if gcc version is less than 4.8 or we are running on
# x86 32 bit.
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]]
then
sed '/Package: mariadb-plugin-rocksdb/,+9d' -i debian/control
sed '/Package: mariadb-plugin-rocksdb/,+10d' -i debian/control
fi
if [[ $GCCVERSION -lt 40800 ]]
then
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ Architecture: any
Depends: mariadb-server-10.2 (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
Recommends: python-mysqldb
Description: RocksDB storage engine for MariaDB
The RocksDB storage engine is a high performance storage engine, aimed
at maximising storage efficiency while maintaining InnoDB-like performance.
Expand Down
1 change: 1 addition & 0 deletions debian/mariadb-plugin-rocksdb.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
etc/mysql/conf.d/rocksdb.cnf etc/mysql/mariadb.conf.d
usr/lib/mysql/plugin/ha_rocksdb.so
usr/bin/mysql_ldb
usr/bin/myrocks_hotbackup
usr/bin/sst_dump
33 changes: 33 additions & 0 deletions mysql-test/r/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -2276,5 +2276,38 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
#
# MDEV-13508 Check that rename of columns changes defaults, virtual
# columns and constraints
#
create table t1 (a int, b int, check(a>b));
alter table t1 change column a b int, change column b a int;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`a` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (`b` > `a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int primary key, b int, c int default (a+b) check (a+b>0),
d int as (a+b),
key (b),
constraint test check (a+b > 1));
alter table t1 change b new_b int not null, add column b char(1), add constraint new check (length(b) > 0);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`new_b` int(11) NOT NULL,
`c` int(11) DEFAULT (`a` + `new_b`) CHECK (`a` + `new_b` > 0),
`d` int(11) GENERATED ALWAYS AS (`a` + `new_b`) VIRTUAL,
`b` char(1) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b` (`new_b`),
CONSTRAINT `test` CHECK (`a` + `new_b` > 1),
CONSTRAINT `new` CHECK (octet_length(`b`) > 0)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
#
# End of 10.2 tests
#
44 changes: 44 additions & 0 deletions mysql-test/r/type_time_6065.result
Original file line number Diff line number Diff line change
Expand Up @@ -2308,3 +2308,47 @@ col_int_nokey
1
DROP TABLE t1,t2,t3;
SET TIMESTAMP=0;
#
# MDEV-15262 Wrong results for SELECT..WHERE non_indexed_datetime_column=indexed_time_column
#
SET TIMESTAMP=UNIX_TIMESTAMP('2012-01-31 10:14:35');
CREATE TABLE t1 (col_time_key TIME, KEY(col_time_key));
CREATE TABLE t2 (col_datetime_key DATETIME);
INSERT INTO t1 VALUES ('-760:00:00'),('760:00:00');
INSERT INTO t1 VALUES ('-770:00:00'),('770:00:00');
INSERT INTO t2 SELECT * FROM t1;
SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key;
col_datetime_key col_time_key
2011-12-30 08:00:00 -760:00:00
2012-03-02 16:00:00 760:00:00
2011-12-29 22:00:00 -770:00:00
2012-03-03 02:00:00 770:00:00
SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key;
col_datetime_key col_time_key
2011-12-29 22:00:00 -770:00:00
2011-12-30 08:00:00 -760:00:00
2012-03-02 16:00:00 760:00:00
2012-03-03 02:00:00 770:00:00
INSERT INTO t1 VALUES ('-838:59:59'),('838:59:59');
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-838:59:59' HOUR_SECOND));
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '838:59:59' HOUR_SECOND));
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '-839:00:00' HOUR_SECOND));
INSERT INTO t2 VALUES (DATE_ADD(CURRENT_DATE, INTERVAL '839:00:00' HOUR_SECOND));
SELECT * FROM t2 STRAIGHT_JOIN t1 IGNORE INDEX(col_time_key) WHERE col_time_key = col_datetime_key;
col_datetime_key col_time_key
2011-12-30 08:00:00 -760:00:00
2012-03-02 16:00:00 760:00:00
2011-12-29 22:00:00 -770:00:00
2012-03-03 02:00:00 770:00:00
2011-12-27 01:00:01 -838:59:59
2012-03-05 22:59:59 838:59:59
SELECT * FROM t2 STRAIGHT_JOIN t1 FORCE INDEX (col_time_key) WHERE col_time_key = col_datetime_key;
col_datetime_key col_time_key
2011-12-29 22:00:00 -770:00:00
2011-12-30 08:00:00 -760:00:00
2012-03-02 16:00:00 760:00:00
2012-03-03 02:00:00 770:00:00
2011-12-27 01:00:01 -838:59:59
2012-03-05 22:59:59 838:59:59
DROP TABLE t1, t2;
SET TIMESTAMP=DEFAULT;
48 changes: 0 additions & 48 deletions mysql-test/suite/encryption/r/innodb-bad-key-change.result
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ foobar 2
# Restart server with keysbad3.txt
SELECT * FROM t1;
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
SHOW WARNINGS;
Level Code Message
Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
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.
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
DROP TABLE t1;
SHOW WARNINGS;
Level Code Message
# Start server with keys3.txt
SET GLOBAL innodb_default_encryption_key_id=5;
CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES;
Expand All @@ -42,73 +35,32 @@ INSERT INTO t2 VALUES ('foobar',1,2);
# Restart server with keys2.txt
SELECT * FROM t2;
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
SHOW WARNINGS;
Level Code Message
Warning 192 Table test/t2 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
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.
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
SELECT * FROM t2 where id = 1;
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
SHOW WARNINGS;
Level Code Message
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.
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
SELECT * FROM t2 where b = 1;
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
SHOW WARNINGS;
Level Code Message
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.
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
INSERT INTO t2 VALUES ('tmp',3,3);
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
SHOW WARNINGS;
Level Code Message
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.
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
DELETE FROM t2 where b = 3;
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
SHOW WARNINGS;
Level Code Message
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.
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
DELETE FROM t2 where id = 3;
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
SHOW WARNINGS;
Level Code Message
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.
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
UPDATE t2 set b = b +1;
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
SHOW WARNINGS;
Level Code Message
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.
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
OPTIMIZE TABLE t2;
Table Op Msg_type Msg_text
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.
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
test.t2 optimize error Corrupt
SHOW WARNINGS;
Level Code Message
ALTER TABLE t2 ADD COLUMN d INT;
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
SHOW WARNINGS;
Level Code Message
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.
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
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
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.
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
test.t2 analyze error Corrupt
SHOW WARNINGS;
Level Code Message
TRUNCATE TABLE t2;
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
SHOW WARNINGS;
Level Code Message
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.
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
DROP TABLE t2;

# Start server with keys2.txt
69 changes: 63 additions & 6 deletions mysql-test/suite/encryption/r/tempfiles.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
select @@encrypt_tmp_files;
@@encrypt_tmp_files
1
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1),(2);
DELETE FROM t1 WHERE a=1;
Expand Down Expand Up @@ -25,6 +28,7 @@ h 10
i 10
j 10
drop table t1;
reset master;
set global binlog_cache_size=8192;
connect con1, localhost, root;
create table t1 (a text) engine=innodb;
Expand All @@ -34,18 +38,71 @@ commit;
start transaction;
insert t1 select repeat(seq, 1000) from seq_1_to_8;
commit;
drop table t1;
disconnect con1;
connect con2, localhost, root;
create table t1 (a text) engine=innodb;
create table t2 (a text) engine=innodb;
start transaction;
insert t1 select repeat(seq, 1000) from seq_1_to_15;
insert t2 select repeat(seq, 1000) from seq_1_to_15;
savepoint foo;
insert t1 select repeat(seq, 1000) from seq_16_to_30;
insert t2 select repeat(seq, 1000) from seq_16_to_30;
rollback to savepoint foo;
insert t1 select repeat(seq, 1000) from seq_31_to_40;
insert t2 select repeat(seq, 1000) from seq_31_to_40;
commit;
drop table t1;
disconnect con2;
connection default;
flush binary logs;
drop table t1, t2;
set global binlog_cache_size=default;
select left(a, 10) from t1;
left(a, 10)
1111111111
2222222222
3333333333
4444444444
5555555555
6666666666
7777777777
8888888888
9999999999
1010101010
1111111111
1212121212
1313131313
1414141414
1515151515
1111111111
2222222222
3333333333
4444444444
5555555555
6666666666
7777777777
8888888888
select left(a, 10) from t2;
left(a, 10)
1111111111
2222222222
3333333333
4444444444
5555555555
6666666666
7777777777
8888888888
9999999999
1010101010
1111111111
1212121212
1313131313
1414141414
1515151515
3131313131
3232323232
3333333333
3434343434
3535353535
3636363636
3737373737
3838383838
3939393939
4040404040
drop table t1, t2;
46 changes: 19 additions & 27 deletions mysql-test/suite/encryption/t/innodb-bad-key-change.test
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ SELECT * FROM t1;
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
-- source include/restart_mysqld.inc

--disable_warnings
--error ER_GET_ERRMSG
SELECT * FROM t1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;
--enable_warnings

-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
-- source include/restart_mysqld.inc
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /

--disable_warnings
--replace_regex /tablespace [0-9]*/tablespace /
DROP TABLE t1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;
--enable_warnings

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

--disable_warnings
--error ER_GET_ERRMSG
SELECT * FROM t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--error ER_GET_ERRMSG
SELECT * FROM t2 where id = 1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--error ER_GET_ERRMSG
SELECT * FROM t2 where b = 1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--replace_regex /tablespace [0-9]*/tablespace /
--error ER_GET_ERRMSG
INSERT INTO t2 VALUES ('tmp',3,3);
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--error ER_GET_ERRMSG
DELETE FROM t2 where b = 3;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--error ER_GET_ERRMSG
DELETE FROM t2 where id = 3;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--error ER_GET_ERRMSG
UPDATE t2 set b = b +1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

OPTIMIZE TABLE t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--error ER_GET_ERRMSG
ALTER TABLE t2 ADD COLUMN d INT;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

ANALYZE TABLE t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

--error ER_GET_ERRMSG
TRUNCATE TABLE t2;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;

DROP TABLE t2;
--enable_warnings

--echo
--echo # Start server with keys2.txt
Expand Down
5 changes: 5 additions & 0 deletions mysql-test/suite/encryption/t/tempfiles.combinations
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[none]
binlog-checksum=NONE

[crc32]
binlog-checksum=CRC32
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/tempfiles.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--encrypt-tmp-files
Loading

0 comments on commit da99e08

Please sign in to comment.