summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-04-04 09:28:19 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-04-04 09:28:19 +0300
commitf5b5039d0e122ac34a42bb76641e54061da2afd8 (patch)
treea31d3897d33c6a1493fbf2792d4120cc9d68f606
parent803273269b2c95639fc7d99ec4c821a729e03c83 (diff)
parentb30fb701cc040cd9243a3634240672b27f78d142 (diff)
downloadmariadb-git-f5b5039d0e122ac34a42bb76641e54061da2afd8.tar.gz
Merge 10.2 into HEAD
-rw-r--r--cmake/cpack_rpm.cmake2
-rw-r--r--mysql-test/include/check-testcase.test2
-rw-r--r--mysql-test/include/index_merge1.inc4
-rw-r--r--mysql-test/include/index_merge2.inc8
-rw-r--r--mysql-test/include/index_merge_2sweeps.inc2
-rw-r--r--mysql-test/include/index_merge_ror.inc8
-rw-r--r--mysql-test/include/index_merge_ror_cpk.inc4
-rw-r--r--mysql-test/r/index_merge_innodb.result5
-rw-r--r--mysql-test/r/index_merge_myisam.result3
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result31
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result37
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result12
-rw-r--r--mysql-test/suite/encryption/r/innodb-compressed-blob.result5
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-disable.result5
-rw-r--r--mysql-test/suite/encryption/r/innodb-force-corrupt.result5
-rw-r--r--mysql-test/suite/encryption/r/innodb-missing-key.result7
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test22
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test28
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test1
-rw-r--r--mysql-test/suite/encryption/t/innodb-compressed-blob.test5
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-disable.test5
-rw-r--r--mysql-test/suite/encryption/t/innodb-force-corrupt.test5
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.test7
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_basic.result10
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_basic.test8
-rw-r--r--mysql-test/suite/innodb/r/alter_kill.result28
-rw-r--r--mysql-test/suite/innodb/t/alter_kill.test70
-rw-r--r--mysql-test/suite/roles/flush_roles-17898.result27
-rw-r--r--mysql-test/suite/roles/flush_roles-17898.test25
-rw-r--r--mysql-test/t/index_merge_innodb.test2
-rw-r--r--plugin/auth_gssapi/cmake/FindGSSAPI.cmake2
-rw-r--r--sql/item_func.h1
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_load.cc1
-rw-r--r--storage/federated/ha_federated.h1
-rw-r--r--storage/federatedx/ha_federatedx.h1
-rw-r--r--storage/innobase/btr/btr0btr.cc9
-rw-r--r--storage/innobase/btr/btr0cur.cc12
-rw-r--r--storage/innobase/buf/buf0buddy.cc3
-rw-r--r--storage/innobase/buf/buf0buf.cc4
-rw-r--r--storage/innobase/data/data0data.cc4
-rw-r--r--storage/innobase/dict/dict0dict.cc31
-rw-r--r--storage/innobase/dict/dict0load.cc102
-rw-r--r--storage/innobase/dict/dict0mem.cc4
-rw-r--r--storage/innobase/handler/ha_innodb.cc8
-rw-r--r--storage/innobase/handler/handler0alter.cc25
-rw-r--r--storage/innobase/include/data0data.ic29
-rw-r--r--storage/innobase/include/data0type.h4
-rw-r--r--storage/innobase/include/dict0crea.ic14
-rw-r--r--storage/innobase/include/dict0dict.h8
-rw-r--r--storage/innobase/include/dict0dict.ic57
-rw-r--r--storage/innobase/include/dict0load.h9
-rw-r--r--storage/innobase/include/dict0mem.h20
-rw-r--r--storage/innobase/include/rem0rec.ic22
-rw-r--r--storage/innobase/include/row0mysql.h13
-rw-r--r--storage/innobase/rem/rem0rec.cc20
-rw-r--r--storage/innobase/row/row0ftsort.cc3
-rw-r--r--storage/innobase/row/row0ins.cc8
-rw-r--r--storage/innobase/row/row0merge.cc2
-rw-r--r--storage/innobase/row/row0mysql.cc26
-rw-r--r--storage/innobase/row/row0purge.cc2
-rw-r--r--storage/innobase/row/row0row.cc5
-rw-r--r--storage/innobase/row/row0sel.cc2
-rw-r--r--storage/innobase/row/row0upd.cc5
-rw-r--r--storage/innobase/srv/srv0start.cc15
-rw-r--r--storage/innobase/trx/trx0rec.cc6
-rw-r--r--storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt4
-rw-r--r--storage/xtradb/buf/buf0buddy.cc2
-rw-r--r--storage/xtradb/data/data0data.cc3
-rw-r--r--storage/xtradb/dict/dict0dict.cc23
-rw-r--r--storage/xtradb/dict/dict0mem.cc1
-rw-r--r--storage/xtradb/handler/handler0alter.cc12
-rw-r--r--storage/xtradb/include/data0data.ic28
-rw-r--r--storage/xtradb/include/dict0dict.ic40
-rw-r--r--storage/xtradb/include/rem0rec.ic24
-rw-r--r--storage/xtradb/rem/rem0rec.cc18
-rw-r--r--storage/xtradb/row/row0ftsort.cc3
-rw-r--r--storage/xtradb/row/row0ins.cc7
-rw-r--r--storage/xtradb/row/row0merge.cc2
-rw-r--r--storage/xtradb/row/row0mysql.cc1
-rw-r--r--storage/xtradb/row/row0purge.cc4
-rw-r--r--storage/xtradb/row/row0row.cc5
-rw-r--r--storage/xtradb/row/row0upd.cc5
-rw-r--r--storage/xtradb/trx/trx0rec.cc6
85 files changed, 403 insertions, 649 deletions
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 7aefdce9bf0..4edcf8eee5d 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -85,6 +85,8 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define restart_flag %{restart_flag_dir}/need-restart
%{?filter_setup:
+%filter_provides_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$
+%filter_requires_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$
%filter_from_provides /perl(\\\\(mtr\\\\|My::\\\\)/d
%filter_from_requires /\\\\(lib\\\\(ft\\\\|lzma\\\\|tokuportability\\\\)\\\\)\\\\|\\\\(perl(\\\\(.*mtr\\\\|My::\\\\|.*HandlerSocket\\\\|Mysql\\\\)\\\\)/d
%filter_setup
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 4ca53989d06..a21acee624b 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -83,7 +83,7 @@ call mtr.check_testcase();
let $datadir=`select @@datadir`;
list_files $datadir mysql_upgrade_info;
list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*;
---replace_regex /#sql-ib[0-9a-f]+-[0-9a-f]+\.ibd\n//
+--replace_regex /#sql-ib[0-9a-f-]+\.ibd\n//
cat_file $datadir.tempfiles.txt;
remove_file $datadir.tempfiles.txt;
list_files $datadir/mysql #sql*;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index b63b2db78da..0fb94b96ab4 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -37,12 +37,14 @@ insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);
let $1=7;
set @d=8;
+begin;
while ($1)
{
eval insert into t0 select key1+@d from t0;
eval set @d=@d*2;
dec $1;
}
+commit;
--enable_query_log
alter table t0 add key2 int not null, add index i2(key2);
@@ -362,6 +364,7 @@ INSERT INTO t1 VALUES ('foo','bar', 'ZZ'),('fuz','baz', 'ZZ');
--disable_query_log
let $1=9;
+begin;
while ($1)
{
eval INSERT INTO t1 SELECT * from t1 WHERE cola = 'foo';
@@ -374,6 +377,7 @@ while ($1)
eval INSERT INTO t1 SELECT * from t1 WHERE cola <> 'foo';
dec $1;
}
+commit;
--enable_query_log
diff --git a/mysql-test/include/index_merge2.inc b/mysql-test/include/index_merge2.inc
index 03afa49d323..ae9adac882f 100644
--- a/mysql-test/include/index_merge2.inc
+++ b/mysql-test/include/index_merge2.inc
@@ -34,11 +34,13 @@ create table t1
--disable_query_log
let $1=200;
+begin;
while ($1)
{
eval insert into t1 values (200-$1, $1);
dec $1;
}
+commit;
--enable_query_log
# No primary key
@@ -80,11 +82,13 @@ create table t1 (
show warnings;
--disable_query_log
let $1=30;
+begin;
while ($1)
{
eval insert into t1 (key1, key2, filler) values ($1/4, $1/8, 'filler-data');
dec $1;
}
+commit;
--enable_query_log
explain select pk from t1 where key1 = 1 and key2 = 1;
select pk from t1 where key2 = 1 and key1 = 1;
@@ -331,16 +335,20 @@ insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
let $1=7;
set @d=8;
+begin;
while ($1)
{
eval insert into t1 (key1) select key1+@d from t1;
eval set @d=@d*2;
dec $1;
}
+commit;
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
+
+insert into t1 select 10000+key1, 10000+key2,10000+key3 from t1;
analyze table t1;
# to test the bug, the following must use "sort_union":
diff --git a/mysql-test/include/index_merge_2sweeps.inc b/mysql-test/include/index_merge_2sweeps.inc
index 3ae7e5b3c09..ef356e12969 100644
--- a/mysql-test/include/index_merge_2sweeps.inc
+++ b/mysql-test/include/index_merge_2sweeps.inc
@@ -32,12 +32,14 @@ create table t1 (
--disable_query_log
+begin;
let $1=1000;
while ($1)
{
eval insert into t1 values($1, $1, $1, 'filler-data','filler-data-2');
dec $1;
}
+commit;
--enable_query_log
select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
diff --git a/mysql-test/include/index_merge_ror.inc b/mysql-test/include/index_merge_ror.inc
index fdb966e6885..3ec6e342994 100644
--- a/mysql-test/include/index_merge_ror.inc
+++ b/mysql-test/include/index_merge_ror.inc
@@ -67,18 +67,21 @@ create table t1
create table t0 as select * from t1;
--disable_query_log
--echo # Printing of many insert into t0 values (....) disabled.
+begin;
let $cnt=1000;
while ($cnt)
{
eval insert into t0 values (1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 'data1', 'data2', 'data3', 'data4', 'data5', 'data6');
dec $cnt;
}
+commit;
--enable_query_log
alter table t1 disable keys;
--disable_query_log
--echo # Printing of many insert into t1 select .... from t0 disabled.
let $1=4;
+begin;
while ($1)
{
let $2=4;
@@ -94,6 +97,7 @@ while ($1)
}
dec $1;
}
+commit;
--echo # Printing of many insert into t1 (...) values (....) disabled.
# Row retrieval tests
@@ -101,6 +105,7 @@ while ($1)
# insert enough rows for index intersection to be used for (key1,key2)
insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, 100, 100,'key1-key2-key3-key4');
let $cnt=400;
+begin;
while ($cnt)
{
eval insert into t1 (key1, key2, key3, key4, filler1) values (100, -1, 100, -1,'key1-key3');
@@ -112,6 +117,7 @@ while ($cnt)
eval insert into t1 (key1, key2, key3, key4, filler1) values (-1, 100, -1, 100,'key2-key4');
dec $cnt;
}
+commit;
--enable_query_log
alter table t1 enable keys;
select count(*) from t1;
@@ -249,6 +255,7 @@ create table t2 (
--disable_query_log
let $1=8;
+begin;
while ($1)
{
eval insert into t2 values (repeat(char($1+64), 8),repeat(char($1+64), 8),'filler1', 'filler2');
@@ -256,6 +263,7 @@ while ($1)
}
insert into t2 select * from t2;
insert into t2 select * from t2;
+commit;
--enable_query_log
# The table row buffer is reused. Fill it with rows that don't match.
diff --git a/mysql-test/include/index_merge_ror_cpk.inc b/mysql-test/include/index_merge_ror_cpk.inc
index df42745b4fc..0a307aa4fdb 100644
--- a/mysql-test/include/index_merge_ror_cpk.inc
+++ b/mysql-test/include/index_merge_ror_cpk.inc
@@ -56,14 +56,14 @@ create table t1
);
--disable_query_log
-set autocommit=0;
+begin;
let $1=10000;
while ($1)
{
eval insert into t1 values ($1 div 10,$1 mod 100, $1/100,$1/100, $1/100,$1/100,$1/100,$1/100,$1/100, $1 mod 100, $1/1000,'filler-data-$1','filler2');
dec $1;
}
-set autocommit=1;
+commit;
--enable_query_log
# Verify that range scan on CPK is ROR
diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result
index 6a3ea839535..f27bb263c6f 100644
--- a/mysql-test/r/index_merge_innodb.result
+++ b/mysql-test/r/index_merge_innodb.result
@@ -294,6 +294,7 @@ key3 int not null default 0
);
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
set @d=8;
+begin;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
@@ -308,9 +309,11 @@ insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
+commit;
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
+insert into t1 select 10000+key1, 10000+key2,10000+key3 from t1;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
@@ -672,6 +675,7 @@ a int,
b int,
INDEX idx(a))
ENGINE=INNODB;
+begin;
INSERT INTO t1(a,b) VALUES
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
@@ -691,6 +695,7 @@ INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1 VALUES (1000000, 0, 0);
+commit;
SET SESSION sort_buffer_size = 1024*36;
set @tmp_optimizer_switch=@@optimizer_switch;
set optimizer_switch='derived_merge=off,derived_with_keys=off';
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 725a888c914..37f5e15a5f7 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -1132,6 +1132,7 @@ key3 int not null default 0
);
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
set @d=8;
+begin;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
@@ -1146,9 +1147,11 @@ insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
insert into t1 (key1) select key1+@d from t1;
set @d=@d*2;
+commit;
alter table t1 add index i2(key2);
alter table t1 add index i3(key3);
update t1 set key2=key1,key3=key1;
+insert into t1 select 10000+key1, 10000+key2,10000+key3 from t1;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
index 51dcc5166ec..7d6d2000cb7 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -3,6 +3,7 @@ call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
# Start server with keys2.txt
SET GLOBAL innodb_file_per_table = ON;
@@ -27,7 +28,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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
DROP TABLE t1;
# Start server with keys3.txt
SET GLOBAL innodb_default_encryption_key_id=5;
@@ -36,33 +37,31 @@ 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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+test.t2 optimize Error Table 'test.t2' doesn't exist in engine
+test.t2 optimize status Operation failed
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
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
+test.t2 analyze Error Table 'test.t2' doesn't exist in engine
+test.t2 analyze status Operation failed
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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
DROP TABLE t2;
# Start server with keys2.txt
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
index bd765671a0f..e181a4ee5e1 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -2,48 +2,42 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
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
+Error 1932 Table 'test.t1' doesn't exist in engine
ALTER TABLE t1 ENGINE=InnoDB;
-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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
SHOW WARNINGS;
Level Code Message
-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
+Error 1932 Table 'test.t1' doesn't exist in engine
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 optimize Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
-test.t1 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.t1 optimize error Corrupt
+test.t1 optimize Error Table 'test.t1' doesn't exist in engine
+test.t1 optimize status Operation failed
SHOW WARNINGS;
Level Code Message
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
-test.t1 check 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.t1 check error Corrupt
+test.t1 check Error Table 'test.t1' doesn't exist in engine
+test.t1 check status Operation failed
SHOW WARNINGS;
Level Code Message
FLUSH TABLES t1 FOR EXPORT;
backup: t1
UNLOCK TABLES;
ALTER TABLE t1 DISCARD TABLESPACE;
-Warnings:
-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 1812 Tablespace is missing for table 'test/t1'
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-Warnings:
-Warning 1814 Tablespace has been discarded for table `t1`
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -52,6 +46,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`pk`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=4
RENAME TABLE t1 TO t1new;
-ALTER TABLE t1new RENAME TO t2new;
-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
-DROP TABLE t1new;
+ERROR HY000: Error on rename of './test/t1' to './test/t1new' (errno: 155 "The table does not exist in the storage engine")
+ALTER TABLE t1 RENAME TO t1new;
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
index 001720be9c6..a535e591773 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -1,23 +1,21 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 optimize Warning Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table.
-test.t1 optimize Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
-test.t1 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.t1 optimize error Corrupt
+test.t1 optimize Error Table 'test.t1' doesn't exist in engine
+test.t1 optimize status Operation failed
SHOW WARNINGS;
Level Code Message
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Warning Table t1 in file ./test/t1.ibd is encrypted but encryption service or used key_id is not available. Can't continue reading table.
-test.t1 check 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.t1 check error Corrupt
+test.t1 check Error Table 'test.t1' doesn't exist in engine
+test.t1 check status Operation failed
SHOW WARNINGS;
Level Code Message
DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
index f163f6141dd..ef49c9a6541 100644
--- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result
+++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
@@ -1,6 +1,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
# Restart mysqld --file-key-management-filename=keys2.txt
SET GLOBAL innodb_file_per_table = ON;
set GLOBAL innodb_default_encryption_key_id=4;
@@ -14,9 +15,9 @@ insert into t2 values (1, repeat('secret',6000));
insert into t3 values (1, repeat('secret',6000));
# Restart mysqld --file-key-management-filename=keys3.txt
select count(*) from t1 FORCE INDEX (b) where b like 'secret%';
-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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
select count(*) from t2 FORCE INDEX (b) where b like 'secret%';
-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
+ERROR 42S02: Table 'test.t2' doesn't exist in engine
select count(*) from t3 FORCE INDEX (b) where b like 'secret%';
count(*)
1
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
index 3b3d6712817..e6ec74e22d4 100644
--- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result
+++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
@@ -1,6 +1,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` is corrupted");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
create table t5 (
`intcol1` int(32) DEFAULT NULL,
@@ -20,8 +21,8 @@ CREATE TABLE `t1` (
insert into t1 values (1,2,'maria','db','encryption');
alter table t1 encrypted='yes' `encryption_key_id`=1;
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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
select * from t5;
-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
+ERROR 42S02: Table 'test.t5' doesn't exist in engine
drop table t1;
drop table t5;
diff --git a/mysql-test/suite/encryption/r/innodb-force-corrupt.result b/mysql-test/suite/encryption/r/innodb-force-corrupt.result
index 6216142d112..b525eba38a3 100644
--- a/mysql-test/suite/encryption/r/innodb-force-corrupt.result
+++ b/mysql-test/suite/encryption/r/innodb-force-corrupt.result
@@ -1,4 +1,5 @@
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=\\d+, page number=[36]\\] in file .*test.t[123]\\.ibd looks corrupted; key_version=3221342974");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[13]` is corrupted");
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
# Create and populate tables to be corrupted
@@ -14,10 +15,10 @@ COMMIT;
# Backup tables before corrupting
# Corrupt tables
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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
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
SELECT * FROM t3;
-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
+ERROR 42S02: Table 'test.t3' doesn't exist in engine
# Restore the original tables
DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result
index 631eeea9ee8..302bd28ee02 100644
--- a/mysql-test/suite/encryption/r/innodb-missing-key.result
+++ b/mysql-test/suite/encryption/r/innodb-missing-key.result
@@ -1,6 +1,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
# Start server with keys2.txt
CREATE TABLE t1(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=19;
CREATE TABLE t2(a int not null primary key auto_increment, b varchar(128)) engine=innodb ENCRYPTED=YES ENCRYPTION_KEY_ID=1;
@@ -34,11 +35,11 @@ SELECT COUNT(1) FROM t2;
COUNT(1)
2048
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
-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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
SELECT COUNT(1) FROM t1 where b = 'ab';
-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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
SELECT COUNT(1) 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
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
# Start server with keys2.txt
SELECT COUNT(1) FROM t1;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
index a7df715445a..a8222e6411e 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -13,6 +13,7 @@ call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[12]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
--echo # Start server with keys2.txt
@@ -39,7 +40,7 @@ SELECT * FROM t1;
-- source include/restart_mysqld.inc
--disable_warnings
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t1;
--enable_warnings
@@ -70,36 +71,35 @@ INSERT INTO t2 VALUES ('foobar',1,2);
-- source include/restart_mysqld.inc
--disable_warnings
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2 where id = 1;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t2 where b = 1;
---replace_regex /tablespace [0-9]*/tablespace /
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
INSERT INTO t2 VALUES ('tmp',3,3);
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
DELETE FROM t2 where b = 3;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
DELETE FROM t2 where id = 3;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
UPDATE t2 set b = b +1;
OPTIMIZE TABLE t2;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t2 ADD COLUMN d INT;
ANALYZE TABLE t2;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
TRUNCATE TABLE t2;
DROP TABLE t2;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
index 1b742882765..07400872f4a 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -13,6 +13,7 @@ call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc
@@ -26,11 +27,11 @@ INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
--source include/restart_mysqld.inc
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t1;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t1 ENGINE=InnoDB;
--replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
SHOW WARNINGS;
@@ -57,8 +58,7 @@ UNLOCK TABLES;
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
--source include/restart_mysqld.inc
-# Discard should pass even with incorrect keys
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
+--error ER_NO_SUCH_TABLE_IN_ENGINE
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
@@ -71,19 +71,23 @@ EOF
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc
+ALTER TABLE t1 DISCARD TABLESPACE;
+
+perl;
+do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
ALTER TABLE t1 IMPORT TABLESPACE;
SHOW CREATE TABLE t1;
--let $restart_parameters= --innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
--source include/restart_mysqld.inc
-# Rename table should pass even with incorrect keys
+--error ER_ERROR_ON_RENAME
RENAME TABLE t1 TO t1new;
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
-
-# Alter table rename is not allowed with incorrect keys
---error ER_GET_ERRMSG
-ALTER TABLE t1new RENAME TO t2new;
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+ALTER TABLE t1 RENAME TO t1new;
# Drop should pass even with incorrect keys
---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 /
-DROP TABLE t1new;
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
index 982c57d90f0..404e5b50426 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -11,6 +11,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc
diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
index 695864db123..261fdd73aa1 100644
--- a/mysql-test/suite/encryption/t/innodb-compressed-blob.test
+++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
@@ -7,6 +7,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
--echo # Restart mysqld --file-key-management-filename=keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
@@ -27,9 +28,9 @@ insert into t3 values (1, repeat('secret',6000));
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
-- source include/restart_mysqld.inc
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
select count(*) from t1 FORCE INDEX (b) where b like 'secret%';
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
select count(*) from t2 FORCE INDEX (b) where b like 'secret%';
select count(*) from t3 FORCE INDEX (b) where b like 'secret%';
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
index 8d870376d99..26ceea9e986 100644
--- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
@@ -10,6 +10,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` is corrupted");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
@@ -41,9 +42,9 @@ alter table t1 encrypted='yes' `encryption_key_id`=1;
--let $restart_parameters=--innodb-encrypt-tables=OFF
--source include/restart_mysqld.inc
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
select * from t1;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
select * from t5;
--let $restart_parameters=--innodb-encrypt-tables=ON --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.test b/mysql-test/suite/encryption/t/innodb-force-corrupt.test
index a573be56d62..4bed3e75997 100644
--- a/mysql-test/suite/encryption/t/innodb-force-corrupt.test
+++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.test
@@ -8,6 +8,7 @@
-- source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=\\d+, page number=[36]\\] in file .*test.t[123]\\.ibd looks corrupted; key_version=3221342974");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t[13]` is corrupted");
SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
@@ -65,11 +66,11 @@ EOF
--source include/start_mysqld.inc
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t1;
--error ER_GET_ERRMSG
SELECT * FROM t2;
---error ER_GET_ERRMSG
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT * FROM t3;
--source include/shutdown_mysqld.inc
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test
index c101ff97358..f86640b617c 100644
--- a/mysql-test/suite/encryption/t/innodb-missing-key.test
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.test
@@ -10,6 +10,7 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
+call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted");
--echo # Start server with keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
@@ -44,11 +45,11 @@ CREATE TABLE t4(a int not null primary key auto_increment, b varchar(128)) engin
SELECT SLEEP(5);
SELECT COUNT(1) FROM t3;
SELECT COUNT(1) FROM t2;
---error 1296
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(1) FROM t2,t1 where t2.a = t1.a;
---error 1296
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(1) FROM t1 where b = 'ab';
---error 1296
+--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(1) FROM t1;
--echo
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
index 4c7a95b6498..8ac46c34265 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_basic.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
@@ -1485,3 +1485,13 @@ SELECT * FROM t1;
a b
f1
DROP TABLE t1;
+CREATE TABLE t1 (a INT GENERATED ALWAYS AS(1) VIRTUAL) ENGINE=InnoDB;
+ALTER TABLE t1 ADD b INT GENERATED ALWAYS AS (2) VIRTUAL;
+ALTER TABLE t1 ADD c INT;
+SELECT * FROM t1;
+a b c
+INSERT INTO t1 SET c=3;
+SELECT * FROM t1;
+a b c
+1 2 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
index 674698e77c4..27172dce020 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_basic.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
@@ -1429,3 +1429,11 @@ INSERT INTO t1(a) VALUES ('');
ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(85);
SELECT * FROM t1;
DROP TABLE t1;
+
+CREATE TABLE t1 (a INT GENERATED ALWAYS AS(1) VIRTUAL) ENGINE=InnoDB;
+ALTER TABLE t1 ADD b INT GENERATED ALWAYS AS (2) VIRTUAL;
+ALTER TABLE t1 ADD c INT;
+SELECT * FROM t1;
+INSERT INTO t1 SET c=3;
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/alter_kill.result b/mysql-test/suite/innodb/r/alter_kill.result
index 9b24fddf9ef..f0f5b1c003f 100644
--- a/mysql-test/suite/innodb/r/alter_kill.result
+++ b/mysql-test/suite/innodb/r/alter_kill.result
@@ -10,39 +10,19 @@ connection default;
# Cleanly shutdown mysqld
disconnect con1;
# Corrupt FIL_PAGE_OFFSET in bug16720368.ibd,
-# and update the checksum to the "don't care" value.
+# and recompute innodb_checksum_algorithm=crc32
# Restart mysqld
-# This will succeed after a clean shutdown, due to
-# fil_open_single_table_tablespace(check_space_id=FALSE).
-SELECT COUNT(*) FROM bug16720368;
-COUNT(*)
-8
-INSERT INTO bug16720368_1 VALUES(1);
-# The table is unaccessible, because after a crash we will
-# validate the tablespace header.
SELECT COUNT(*) FROM bug16720368;
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
-INSERT INTO bug16720368 VALUES(0,1);
+INSERT INTO bug16720368 VALUES(1);
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
-# The table is readable thanks to innodb-force-recovery.
-SELECT COUNT(*) FROM bug16720368;
-COUNT(*)
-8
-INSERT INTO bug16720368 VALUES(0,1);
-# Shut down the server cleanly to hide the corruption.
-# The table is accessible, because after a clean shutdown we will
-# NOT validate the tablespace header.
-# We can modify the existing pages, but we cannot allocate or free
-# any pages, because that would hit the corruption on page 0.
-SELECT COUNT(*) FROM bug16720368;
-COUNT(*)
-9
+INSERT INTO bug16720368_1 VALUES(1);
# Shut down the server to uncorrupt the data.
# Restart the server after uncorrupting the file.
INSERT INTO bug16720368 VALUES(9,1);
SELECT COUNT(*) FROM bug16720368;
COUNT(*)
-10
+9
DROP TABLE bug16720368, bug16720368_1;
#
# Bug#16735660 ASSERT TABLE2 == NULL, ROLLBACK OF RESURRECTED TXNS,
diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test
index e0d785e412a..aec1c5f92b2 100644
--- a/mysql-test/suite/innodb/t/alter_kill.test
+++ b/mysql-test/suite/innodb/t/alter_kill.test
@@ -18,6 +18,7 @@ call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and
call mtr.add_suppression("InnoDB: Plugin initialization aborted*");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
+call mtr.add_suppression("InnoDB: Table `test`\\.`bug16720368` is corrupted");
-- enable_query_log
-- echo #
@@ -40,67 +41,62 @@ connection default;
disconnect con1;
-- echo # Corrupt FIL_PAGE_OFFSET in bug16720368.ibd,
--- echo # and update the checksum to the "don't care" value.
+-- echo # and recompute innodb_checksum_algorithm=crc32
perl;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
my $file = "$ENV{MYSQLD_DATADIR}/test/bug16720368.ibd";
open(FILE, "+<$file") || die "Unable to open $file";
-print FILE pack("H*","deadbeefc001cafe") || die "Unable to write $file";
-seek(FILE, $ENV{PAGE_SIZE}-8, 0) || die "Unable to seek $file";
-print FILE pack("H*","deadbeef") || die "Unable to write $file";
+binmode FILE;
+my $ps= $ENV{PAGE_SIZE};
+my $page;
+sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
+die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+substr($page,4,4)=pack("N",0xc001cafe);
+my $polynomial = 0x82f63b78; # CRC-32C
+my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
+substr($page,0,4)=$ck;
+substr($page,$ps-8,4)=$ck;
+sysseek(FILE, 3*$ps, 0) || die "Unable to rewind $file\n";
+syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file";
EOF
-- echo # Restart mysqld
-- source include/start_mysqld.inc
--- echo # This will succeed after a clean shutdown, due to
--- echo # fil_open_single_table_tablespace(check_space_id=FALSE).
-SELECT COUNT(*) FROM bug16720368;
-
-INSERT INTO bug16720368_1 VALUES(1);
-
---let $shutdown_timeout= 0
---source include/restart_mysqld.inc
-
--- echo # The table is unaccessible, because after a crash we will
--- echo # validate the tablespace header.
--error ER_NO_SUCH_TABLE_IN_ENGINE
SELECT COUNT(*) FROM bug16720368;
--error ER_NO_SUCH_TABLE_IN_ENGINE
-INSERT INTO bug16720368 VALUES(0,1);
-
-let $restart_parameters = --innodb-force-recovery=3;
---let $shutdown_timeout= 0
---source include/restart_mysqld.inc
-
--- echo # The table is readable thanks to innodb-force-recovery.
-SELECT COUNT(*) FROM bug16720368;
-INSERT INTO bug16720368 VALUES(0,1);
-
--- echo # Shut down the server cleanly to hide the corruption.
-let $shutdown_timeout=;
-let $restart_parameters =;
--- source include/restart_mysqld.inc
-
--- echo # The table is accessible, because after a clean shutdown we will
--- echo # NOT validate the tablespace header.
--- echo # We can modify the existing pages, but we cannot allocate or free
--- echo # any pages, because that would hit the corruption on page 0.
-SELECT COUNT(*) FROM bug16720368;
+INSERT INTO bug16720368 VALUES(1);
+INSERT INTO bug16720368_1 VALUES(1);
-- echo # Shut down the server to uncorrupt the data.
-- source include/shutdown_mysqld.inc
# Uncorrupt the FIL_PAGE_OFFSET.
perl;
+do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
my $file = "$ENV{MYSQLD_DATADIR}/test/bug16720368.ibd";
open(FILE, "+<$file") || die "Unable to open $file";
-# Uncorrupt FIL_PAGE_OFFSET.
-print FILE pack("H*","deadbeef00000000") || die "Unable to write $file";
+binmode FILE;
+my $ps= $ENV{PAGE_SIZE};
+my $page;
+sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
+die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+substr($page,4,4)=pack("N",3);
+my $polynomial = 0x82f63b78; # CRC-32C
+my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
+ mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
+substr($page,0,4)=$ck;
+substr($page,$ps-8,4)=$ck;
+sysseek(FILE, 3*$ps, 0) || die "Unable to rewind $file\n";
+syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file";
EOF
-- echo # Restart the server after uncorrupting the file.
+
-- source include/start_mysqld.inc
INSERT INTO bug16720368 VALUES(9,1);
diff --git a/mysql-test/suite/roles/flush_roles-17898.result b/mysql-test/suite/roles/flush_roles-17898.result
index dbe6ea24afd..ae8fb0a27d2 100644
--- a/mysql-test/suite/roles/flush_roles-17898.result
+++ b/mysql-test/suite/roles/flush_roles-17898.result
@@ -11,3 +11,30 @@ flush privileges;
drop role dwr_foo;
drop role dwr_bar;
drop role dwr_qux_dev;
+use test;
+create table db_copy as select * from mysql.db;
+delete from mysql.db;
+flush privileges;
+create user u1@localhost;
+create role r1;
+create role r2;
+grant r1 to u1@localhost;
+grant select on test.* to r2;
+grant select on m_.* to r2;
+grant r2 to r1;
+show grants for u1@localhost;
+Grants for u1@localhost
+GRANT r1 TO 'u1'@'localhost'
+GRANT USAGE ON *.* TO 'u1'@'localhost'
+show grants for r1;
+Grants for r1
+GRANT r2 TO 'r1'
+GRANT USAGE ON *.* TO 'r1'
+GRANT USAGE ON *.* TO 'r2'
+GRANT SELECT ON `test`.* TO 'r2'
+GRANT SELECT ON `m_`.* TO 'r2'
+drop user u1@localhost;
+drop role r1, r2;
+insert mysql.db select * from db_copy;
+flush privileges;
+drop table db_copy;
diff --git a/mysql-test/suite/roles/flush_roles-17898.test b/mysql-test/suite/roles/flush_roles-17898.test
index 6a3b8d6f345..22568196c30 100644
--- a/mysql-test/suite/roles/flush_roles-17898.test
+++ b/mysql-test/suite/roles/flush_roles-17898.test
@@ -1,3 +1,4 @@
+source include/not_embedded.inc;
#
# MDEV-17898 FLUSH PRIVILEGES crashes server with segfault
#
@@ -9,3 +10,27 @@ flush privileges;
drop role dwr_foo;
drop role dwr_bar;
drop role dwr_qux_dev;
+use test;
+
+#
+# MDEV-18298 Crashes server with segfault during role grants
+#
+create table db_copy as select * from mysql.db;
+delete from mysql.db;
+flush privileges;
+
+create user u1@localhost;
+create role r1;
+create role r2;
+grant r1 to u1@localhost;
+grant select on test.* to r2;
+grant select on m_.* to r2;
+grant r2 to r1;
+show grants for u1@localhost;
+show grants for r1;
+drop user u1@localhost;
+drop role r1, r2;
+
+insert mysql.db select * from db_copy;
+flush privileges;
+drop table db_copy;
diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test
index 53ce3114b49..f959db3039a 100644
--- a/mysql-test/t/index_merge_innodb.test
+++ b/mysql-test/t/index_merge_innodb.test
@@ -46,6 +46,7 @@ CREATE TABLE t1 (
INDEX idx(a))
ENGINE=INNODB;
+begin;
INSERT INTO t1(a,b) VALUES
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
@@ -65,6 +66,7 @@ INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1 VALUES (1000000, 0, 0);
+commit;
SET SESSION sort_buffer_size = 1024*36;
set @tmp_optimizer_switch=@@optimizer_switch;
diff --git a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake
index cc8e62d1ca7..67309eed1ee 100644
--- a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake
+++ b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake
@@ -40,7 +40,7 @@ if(GSSAPI_LIBS AND GSSAPI_FLAVOR)
else(GSSAPI_LIBS AND GSSAPI_FLAVOR)
find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS
- /opt/local/bin
+ /opt/local/bin /usr/lib/mit/bin
ONLY_CMAKE_FIND_ROOT_PATH # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex
)
mark_as_advanced(KRB5_CONFIG)
diff --git a/sql/item_func.h b/sql/item_func.h
index 487993b581f..41eb019bd6b 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1921,7 +1921,6 @@ class Item_func_set_user_var :public Item_func_user_var
user variable it the first connection context).
*/
my_thread_id entry_thread_id;
- char buffer[MAX_FIELD_WIDTH];
String value;
my_decimal decimal_buff;
bool null_item;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ae6030115fa..871744c6b36 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -5947,7 +5947,7 @@ static bool merge_role_db_privileges(ACL_ROLE *grantee, const char *dbname,
ulong access= 0, update_flags= 0;
for (int *p= dbs.front(); p <= dbs.back(); p++)
{
- if (first<0 || (!dbname && strcmp(acl_dbs.at(*p).db, acl_dbs.at(*p-1).db)))
+ if (first<0 || (!dbname && strcmp(acl_dbs.at(p[0]).db, acl_dbs.at(p[-1]).db)))
{ // new db name series
update_flags|= update_role_db(merged, first, access, grantee->user.str);
merged= -1;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index cb182f55bf1..2c5c01161b6 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -4905,7 +4905,6 @@ class select_insert :public select_result_interceptor {
class select_create: public select_insert {
- ORDER *group;
TABLE_LIST *create_table;
Table_specification_st *create_info;
TABLE_LIST *select_tables;
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 9006bf2b1d4..49558f8b694 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -167,7 +167,6 @@ class READ_INFO: public Load_data_param
int enclosed_char,escape_char;
int *stack,*stack_pos;
bool found_end_of_line,start_of_line,eof;
- NET *io_net;
int level; /* for load xml */
bool getbyte(char *to)
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index a23375cbe58..78f959634da 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -89,7 +89,6 @@ class ha_federated: public handler
*/
DYNAMIC_ARRAY results;
bool position_called, table_will_be_deleted;
- uint fetch_num; // stores the fetch num
MYSQL_ROW_OFFSET current_position; // Current position used by ::position()
int remote_error_number;
char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE];
diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h
index f3af7258623..56c34d9ef37 100644
--- a/storage/federatedx/ha_federatedx.h
+++ b/storage/federatedx/ha_federatedx.h
@@ -270,7 +270,6 @@ class ha_federatedx: public handler
*/
DYNAMIC_ARRAY results;
bool position_called;
- uint fetch_num; // stores the fetch num
int remote_error_number;
char remote_error_buf[FEDERATEDX_QUERY_BUFFER_SIZE];
bool ignore_duplicates, replace_duplicates;
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index a40e39624e2..afd8f678235 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -236,7 +236,7 @@ btr_root_block_get(
"Table %s in tablespace %lu is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name, space);
+ index->table->name.m_name, space);
}
return NULL;
@@ -4908,13 +4908,6 @@ btr_validate_level(
block = btr_root_block_get(index, RW_SX_LATCH, &mtr);
page = buf_block_get_frame(block);
-#ifdef UNIV_DEBUG
- if (dict_index_is_spatial(index)) {
- fprintf(stderr, "Root page no: %lu\n",
- (ulong) page_get_page_no(page));
- }
-#endif
-
fil_space_t* space = fil_space_get(index->space);
const page_size_t table_page_size(
dict_table_page_size(index->table));
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index f849ebb0546..36165a5b247 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -1254,7 +1254,7 @@ retry_page_get:
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name);
+ index->table->name.m_name);
index->table->file_unreadable = true;
}
@@ -1367,7 +1367,7 @@ retry_page_get:
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name);
+ index->table->name.m_name);
index->table->file_unreadable = true;
}
@@ -1396,7 +1396,7 @@ retry_page_get:
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name);
+ index->table->name.m_name);
index->table->file_unreadable = true;
}
@@ -2294,7 +2294,7 @@ btr_cur_open_at_index_side_func(
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name);
+ index->table->name.m_name);
index->table->file_unreadable = true;
}
@@ -2654,7 +2654,7 @@ btr_cur_open_at_rnd_pos_func(
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name);
+ index->table->name.m_name);
index->table->file_unreadable = true;
}
@@ -5585,7 +5585,7 @@ btr_estimate_n_rows_in_range_on_level(
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name);
+ index->table->name.m_name);
index->table->file_unreadable = true;
}
diff --git a/storage/innobase/buf/buf0buddy.cc b/storage/innobase/buf/buf0buddy.cc
index 976d9eefab2..777188d045d 100644
--- a/storage/innobase/buf/buf0buddy.cc
+++ b/storage/innobase/buf/buf0buddy.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -497,7 +497,6 @@ buf_buddy_alloc_low(
{
buf_block_t* block;
- ut_ad(lru);
ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_ad(i >= buf_buddy_get_slot(UNIV_ZIP_SIZE_MIN));
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 7600a07c24b..e621d415577 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -4622,7 +4622,9 @@ evict_from_pool:
buf_pool_mutex_exit(buf_pool);
rw_lock_x_unlock(&fix_block->lock);
- *err = DB_PAGE_CORRUPTED;
+ if (err) {
+ *err = DB_PAGE_CORRUPTED;
+ }
return NULL;
}
}
diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc
index cd5a8024db1..6b63960e00f 100644
--- a/storage/innobase/data/data0data.cc
+++ b/storage/innobase/data/data0data.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -83,8 +83,6 @@ dtuple_set_n_fields(
dtuple_t* tuple, /*!< in: tuple */
ulint n_fields) /*!< in: number of fields */
{
- ut_ad(tuple);
-
tuple->n_fields = n_fields;
tuple->n_fields_cmp = n_fields;
}
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc
index 6e936b52174..e5f1e0dab1d 100644
--- a/storage/innobase/dict/dict0dict.cc
+++ b/storage/innobase/dict/dict0dict.cc
@@ -949,7 +949,6 @@ dict_index_get_nth_field_pos(
ulint n_fields;
ulint pos;
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
field2 = dict_index_get_nth_field(index2, n);
@@ -1058,8 +1057,6 @@ dict_table_col_in_clustered_key(
ulint pos;
ulint n_fields;
- ut_ad(table);
-
col = dict_table_get_nth_col(table, n);
index = dict_table_get_first_index(table);
@@ -1229,9 +1226,7 @@ dict_table_add_system_columns(
dict_table_t* table, /*!< in/out: table */
mem_heap_t* heap) /*!< in: temporary heap */
{
- ut_ad(table);
- ut_ad(table->n_def ==
- (table->n_cols - dict_table_get_n_sys_cols(table)));
+ ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!table->cached);
@@ -1999,7 +1994,6 @@ dict_table_change_id_in_cache(
dict_table_t* table, /*!< in/out: table object already in cache */
table_id_t new_id) /*!< in: new id to set */
{
- ut_ad(table);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
@@ -2026,7 +2020,6 @@ dict_table_remove_from_cache_low(
dict_foreign_t* foreign;
dict_index_t* index;
- ut_ad(table);
ut_ad(dict_lru_validate());
ut_a(table->get_ref_count() == 0);
ut_a(table->n_rec_locks == 0);
@@ -2405,7 +2398,6 @@ dict_index_add_to_cache_w_vcol(
ulint n_ord;
ulint i;
- ut_ad(index);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(index->n_def == index->n_fields);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
@@ -3052,9 +3044,7 @@ dict_index_build_internal_clust(
/* Add to new_index non-system columns of table not yet included
there */
- ulint n_sys_cols = dict_table_get_n_sys_cols(table);
- for (i = 0; i + n_sys_cols < (ulint) table->n_cols; i++) {
-
+ for (i = 0; i + DATA_N_SYS_COLS < ulint(table->n_cols); i++) {
dict_col_t* col = dict_table_get_nth_col(table, i);
ut_ad(col->mtype != DATA_SYS);
@@ -5290,7 +5280,6 @@ dict_foreign_parse_drop_constraints(
const char* id;
CHARSET_INFO* cs;
- ut_a(trx);
ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd);
@@ -5456,9 +5445,8 @@ dict_index_check_search_tuple(
const dict_index_t* index, /*!< in: index tree */
const dtuple_t* tuple) /*!< in: tuple used in a search */
{
- ut_a(index);
- ut_a(dtuple_get_n_fields_cmp(tuple)
- <= dict_index_get_n_unique_in_tree(index));
+ ut_ad(dtuple_get_n_fields_cmp(tuple)
+ <= dict_index_get_n_unique_in_tree(index));
return(TRUE);
}
#endif /* UNIV_DEBUG */
@@ -6432,15 +6420,14 @@ dict_table_schema_check(
return(DB_TABLE_NOT_FOUND);
}
- ulint n_sys_cols = dict_table_get_n_sys_cols(table);
- if ((ulint) table->n_def - n_sys_cols != req_schema->n_cols) {
+ if (ulint(table->n_def) - DATA_N_SYS_COLS != req_schema->n_cols) {
/* the table has a different number of columns than required */
snprintf(errstr, errstr_sz,
"%s has " ULINTPF " columns but should have "
ULINTPF ".",
ut_format_name(req_schema->table_name, buf,
sizeof buf),
- table->n_def - n_sys_cols,
+ ulint(table->n_def) - DATA_N_SYS_COLS,
req_schema->n_cols);
return(DB_ERROR);
@@ -7011,8 +6998,6 @@ dict_index_zip_success(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7033,8 +7018,6 @@ dict_index_zip_failure(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7060,8 +7043,6 @@ dict_index_zip_pad_optimal_page_size(
ulint min_sz;
ulint sz;
- ut_ad(index);
-
if (!zip_failure_threshold_pct) {
/* Disabled by user. */
return(UNIV_PAGE_SIZE);
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc
index 2fe34886df2..304a536505c 100644
--- a/storage/innobase/dict/dict0load.cc
+++ b/storage/innobase/dict/dict0load.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2018, MariaDB Corporation.
+Copyright (c) 2016, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -81,7 +81,7 @@ file_unreadable flag in the table object we return */
static
dict_table_t*
dict_load_table_one(
- table_name_t& name,
+ const table_name_t& name,
bool cached,
dict_err_ignore_t ignore_err,
dict_names_t& fk_tables);
@@ -93,9 +93,8 @@ Do not load any columns or indexes.
@param[out,own] table table, or NULL
@return error message
@retval NULL on success */
-static
-const char*
-dict_load_table_low(table_name_t& name, const rec_t* rec, dict_table_t** table)
+static const char* dict_load_table_low(const table_name_t& name,
+ const rec_t* rec, dict_table_t** table)
MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Load an index definition from a SYS_INDEXES record to dict_index_t.
@@ -392,7 +391,6 @@ dict_process_sys_tables_rec_and_mtr_commit(
ulint len;
const char* field;
const char* err_msg = NULL;
- table_name_t table_name;
field = (const char*) rec_get_nth_field_old(
rec, DICT_FLD__SYS_TABLES__NAME, &len);
@@ -402,7 +400,7 @@ dict_process_sys_tables_rec_and_mtr_commit(
ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
/* Get the table name */
- table_name.m_name = mem_heap_strdupl(heap, field, len);
+ table_name_t table_name(mem_heap_strdupl(heap, field, len));
/* If DICT_TABLE_LOAD_FROM_CACHE is set, first check
whether there is cached dict_table_t struct */
@@ -1362,14 +1360,9 @@ dict_sys_tables_rec_read(
/** Load and check each non-predefined tablespace mentioned in SYS_TABLES.
Search SYS_TABLES and check each tablespace mentioned that has not
already been added to the fil_system. If it is valid, add it to the
-file_system list. Perform extra validation on the table if recovery from
-the REDO log occurred.
-@param[in] validate Whether to do validation on the table.
+file_system list.
@return the highest space ID found. */
-UNIV_INLINE
-ulint
-dict_check_sys_tables(
- bool validate)
+static ulint dict_check_sys_tables()
{
ulint max_space_id = 0;
btr_pcur_t pcur;
@@ -1392,12 +1385,15 @@ dict_check_sys_tables(
sys_datafiles = dict_table_get_low("SYS_DATAFILES");
ut_a(sys_datafiles != NULL);
+ const bool validate = recv_needed_recovery
+ && !srv_safe_truncate
+ && !srv_force_recovery;
+
for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
rec != NULL;
rec = dict_getnext_system(&pcur, &mtr)) {
const byte* field;
ulint len;
- table_name_t table_name;
table_id_t table_id;
ulint space_id;
ulint n_cols;
@@ -1413,7 +1409,8 @@ dict_check_sys_tables(
/* Copy the table name from rec */
field = rec_get_nth_field_old(
rec, DICT_FLD__SYS_TABLES__NAME, &len);
- table_name.m_name = mem_strdupl((char*) field, len);
+
+ table_name_t table_name(mem_strdupl((char*) field, len));
DBUG_PRINT("dict_check_sys_tables",
("name: %p, '%s'", table_name.m_name,
table_name.m_name));
@@ -1422,15 +1419,23 @@ dict_check_sys_tables(
&table_id, &space_id,
&n_cols, &flags, &flags2)
|| space_id == TRX_SYS_SPACE) {
+next:
ut_free(table_name.m_name);
continue;
}
+ if (srv_safe_truncate
+ && strstr(table_name.m_name, "/" TEMP_FILE_PREFIX "-")) {
+ /* This table will be dropped by
+ row_mysql_drop_garbage_tables().
+ We do not care if the file exists. */
+ goto next;
+ }
+
if (flags2 & DICT_TF2_DISCARDED) {
ib::info() << "Ignoring tablespace for " << table_name
<< " because the DISCARD flag is set .";
- ut_free(table_name.m_name);
- continue;
+ goto next;
}
/* For tables or partitions using .ibd files, the flag
@@ -1505,11 +1510,8 @@ space_id information in the data dictionary to what we find in the
tablespace file. In addition, more validation will be done if recovery
was needed and force_recovery is not set.
-We also scan the biggest space id, and store it to fil_system.
-@param[in] validate true if recovery was needed */
-void
-dict_check_tablespaces_and_store_max_id(
- bool validate)
+We also scan the biggest space id, and store it to fil_system. */
+void dict_check_tablespaces_and_store_max_id()
{
mtr_t mtr;
@@ -1530,7 +1532,7 @@ dict_check_tablespaces_and_store_max_id(
/* Open all tablespaces referenced in SYS_TABLES.
This will update SYS_TABLESPACES and SYS_DATAFILES if it
finds any file-per-table tablespaces not already there. */
- max_space_id = dict_check_sys_tables(validate);
+ max_space_id = dict_check_sys_tables();
fil_set_max_space_id_if_bigger(max_space_id);
mutex_exit(&dict_sys->mutex);
@@ -2660,9 +2662,8 @@ Do not load any columns or indexes.
@param[out,own] table table, or NULL
@return error message
@retval NULL on success */
-static
-const char*
-dict_load_table_low(table_name_t& name, const rec_t* rec, dict_table_t** table)
+static const char* dict_load_table_low(const table_name_t& name,
+ const rec_t* rec, dict_table_t** table)
{
table_id_t table_id;
ulint space_id;
@@ -2792,32 +2793,22 @@ dict_load_table(
dict_names_t fk_list;
dict_table_t* result;
dict_names_t::iterator i;
- table_name_t table_name;
DBUG_ENTER("dict_load_table");
DBUG_PRINT("dict_load_table", ("loading table: '%s'", name));
ut_ad(mutex_own(&dict_sys->mutex));
- table_name.m_name = const_cast<char*>(name);
-
result = dict_table_check_if_in_cache_low(name);
if (!result) {
- result = dict_load_table_one(table_name, cached, ignore_err,
- fk_list);
+ result = dict_load_table_one(const_cast<char*>(name),
+ cached, ignore_err, fk_list);
while (!fk_list.empty()) {
- table_name_t fk_table_name;
- dict_table_t* fk_table;
-
- fk_table_name.m_name =
- const_cast<char*>(fk_list.front());
- fk_table = dict_table_check_if_in_cache_low(
- fk_table_name.m_name);
- if (!fk_table) {
- dict_load_table_one(fk_table_name, cached,
- ignore_err, fk_list);
- }
+ if (!dict_table_check_if_in_cache_low(fk_list.front()))
+ dict_load_table_one(
+ const_cast<char*>(fk_list.front()),
+ cached, ignore_err, fk_list);
fk_list.pop_front();
}
}
@@ -2917,7 +2908,7 @@ file_unreadable flag in the table object we return */
static
dict_table_t*
dict_load_table_one(
- table_name_t& name,
+ const table_name_t& name,
bool cached,
dict_err_ignore_t ignore_err,
dict_names_t& fk_tables)
@@ -3076,8 +3067,31 @@ err_exit:
if (table->space
&& !fil_space_get_size(table->space)) {
+corrupted:
table->corrupted = true;
table->file_unreadable = true;
+ } else {
+ const page_id_t page_id(
+ table->space,
+ dict_table_get_first_index(table)
+ ->page);
+ mtr.start();
+ buf_block_t* block = buf_page_get(
+ page_id,
+ dict_table_page_size(table),
+ RW_S_LATCH, &mtr);
+ const bool corrupted = !block
+ || page_get_space_id(block->frame)
+ != page_id.space()
+ || page_get_page_no(block->frame)
+ != page_id.page_no()
+ || mach_read_from_2(FIL_PAGE_TYPE
+ + block->frame)
+ != FIL_PAGE_INDEX;
+ mtr.commit();
+ if (corrupted) {
+ goto corrupted;
+ }
}
}
} else {
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index 7fc8ab79395..0725eb40212 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -136,8 +136,7 @@ dict_mem_table_create(
table->name.m_name = mem_strdup(name);
table->is_system_db = dict_mem_table_is_system(table->name.m_name);
table->space = (unsigned int) space;
- table->n_t_cols = (unsigned int) (n_cols +
- dict_table_get_n_sys_cols(table));
+ table->n_t_cols = unsigned(n_cols + DATA_N_SYS_COLS);
table->n_v_cols = (unsigned int) (n_v_cols);
table->n_cols = table->n_t_cols - table->n_v_cols;
@@ -283,7 +282,6 @@ dict_mem_table_add_col(
dict_col_t* col;
ulint i;
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b448f71d6d0..adcb845c031 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -13208,10 +13208,8 @@ inline int ha_innobase::delete_table(const char* name, enum_sql_command sqlcom)
err = row_drop_database_for_mysql(norm_name, trx,
&num_partitions);
norm_name[len] = 0;
- if (num_partitions == 0
- && !row_is_mysql_tmp_table_name(norm_name)) {
- table_name_t tbl_name;
- tbl_name.m_name = norm_name;
+ table_name_t tbl_name(norm_name);
+ if (num_partitions == 0 && !tbl_name.is_temporary()) {
ib::error() << "Table " << tbl_name <<
" does not exist in the InnoDB"
" internal data dictionary though MariaDB is"
@@ -14703,7 +14701,7 @@ ha_innobase::optimize(
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
err,
"InnoDB: Cannot defragment table %s: returned error code %d\n",
- m_prebuilt->table->name, err);
+ m_prebuilt->table->name.m_name, err);
if(err == ER_SP_ALREADY_EXISTS) {
try_alter = false;
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index bfbe70a0fda..a3b03a45eb3 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -2097,8 +2097,8 @@ name_ok:
index
@param[in] altered_table MySQL table that is being altered
@param[in] key_part MySQL key definition
-@param[out] index_field index field defition for key_part */
-static MY_ATTRIBUTE((nonnull(2,3)))
+@param[out] index_field index field definition for key_part */
+static MY_ATTRIBUTE((nonnull))
void
innobase_create_index_field_def(
bool new_clustered,
@@ -2113,10 +2113,6 @@ innobase_create_index_field_def(
DBUG_ENTER("innobase_create_index_field_def");
- ut_ad(key_part);
- ut_ad(index_field);
- ut_ad(altered_table);
-
field = new_clustered
? altered_table->field[key_part->fieldnr]
: key_part->field;
@@ -2178,8 +2174,6 @@ innobase_create_index_def(
DBUG_ENTER("innobase_create_index_def");
DBUG_ASSERT(!key_clustered || new_clustered);
- ut_ad(altered_table);
-
index->fields = static_cast<index_field_t*>(
mem_heap_alloc(heap, n_fields * sizeof *index->fields));
@@ -3022,7 +3016,6 @@ innobase_build_col_map(
& Alter_inplace_info::ADD_COLUMN));
DBUG_ASSERT(!add_cols || dtuple_get_n_fields(add_cols)
== dict_table_get_n_cols(new_table));
- DBUG_ASSERT(table->s->stored_fields > 0);
const uint old_n_v_cols = uint(table->s->fields
- table->s->stored_fields);
@@ -3946,7 +3939,7 @@ innobase_add_virtual_try(
n_v_col += ctx->num_to_add_vcol;
- n_col -= dict_table_get_n_sys_cols(user_table);
+ n_col -= DATA_N_SYS_COLS;
n_v_col -= ctx->num_to_drop_vcol;
@@ -4180,7 +4173,7 @@ innobase_drop_virtual_try(
n_v_col -= ctx->num_to_drop_vcol;
- n_col -= dict_table_get_n_sys_cols(user_table);
+ n_col -= DATA_N_SYS_COLS;
ulint new_n = dict_table_encode_n_col(n_col, n_v_col)
+ ((user_table->flags & DICT_TF_COMPACT) << 31);
@@ -6906,7 +6899,6 @@ innobase_rename_columns_try(
uint i = 0;
ulint num_v = 0;
- DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME);
@@ -7302,7 +7294,6 @@ innobase_update_foreign_try(
ulint i;
DBUG_ENTER("innobase_update_foreign_try");
- DBUG_ASSERT(ctx);
foreign_id = dict_table_get_highest_foreign_id(ctx->new_table);
@@ -7458,13 +7449,11 @@ innobase_update_foreign_cache(
fk_tables.front(), true, DICT_ERR_IGNORE_NONE);
if (table == NULL) {
- table_name_t table_name;
- table_name.m_name = const_cast<char*>(
- fk_tables.front());
-
err = DB_TABLE_NOT_FOUND;
ib::error()
- << "Failed to load table '" << table_name
+ << "Failed to load table '"
+ << table_name_t(const_cast<char*>
+ (fk_tables.front()))
<< "' which has a foreign key constraint with"
<< " table '" << user_table->name << "'.";
break;
diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.ic
index 81788885aa5..f8689db54ec 100644
--- a/storage/innobase/include/data0data.ic
+++ b/storage/innobase/include/data0data.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -43,8 +43,6 @@ dfield_get_type(
/*============*/
const dfield_t* field) /*!< in: SQL data field */
{
- ut_ad(field);
-
return((dtype_t*) &(field->type));
}
#endif /* UNIV_DEBUG */
@@ -74,7 +72,6 @@ dfield_get_data(
/*============*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -91,7 +88,6 @@ dfield_get_len(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -107,7 +103,6 @@ dfield_set_len(
dfield_t* field, /*!< in: field */
ulint len) /*!< in: length or UNIV_SQL_NULL */
{
- ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@@ -125,8 +120,6 @@ dfield_is_null(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
-
return(field->len == UNIV_SQL_NULL);
}
@@ -139,9 +132,7 @@ dfield_is_ext(
/*==========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad(!field->ext || field->len >= BTR_EXTERN_FIELD_REF_SIZE);
-
return(field->ext);
}
@@ -153,8 +144,6 @@ dfield_set_ext(
/*===========*/
dfield_t* field) /*!< in/out: field */
{
- ut_ad(field);
-
field->ext = 1;
}
@@ -196,8 +185,6 @@ dfield_set_data(
const void* data, /*!< in: data */
ulint len) /*!< in: length or UNIV_SQL_NULL */
{
- ut_ad(field);
-
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@@ -215,8 +202,6 @@ dfield_write_mbr(
dfield_t* field, /*!< in: field */
const double* mbr) /*!< in: data */
{
- ut_ad(field);
-
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@@ -340,8 +325,6 @@ dtuple_get_info_bits(
/*=================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->info_bits);
}
@@ -354,8 +337,6 @@ dtuple_set_info_bits(
dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */
{
- ut_ad(tuple);
-
tuple->info_bits = info_bits;
}
@@ -368,8 +349,6 @@ dtuple_get_n_fields_cmp(
/*====================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields_cmp);
}
@@ -383,9 +362,7 @@ dtuple_set_n_fields_cmp(
ulint n_fields_cmp) /*!< in: number of fields used in
comparisons in rem0cmp.* */
{
- ut_ad(tuple);
ut_ad(n_fields_cmp <= tuple->n_fields);
-
tuple->n_fields_cmp = n_fields_cmp;
}
@@ -398,8 +375,6 @@ dtuple_get_n_fields(
/*================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields);
}
@@ -649,7 +624,6 @@ dtuple_get_data_size(
ulint i;
ulint sum = 0;
- ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
@@ -683,7 +657,6 @@ dtuple_get_n_ext(
ulint n_fields = tuple->n_fields;
ulint i;
- ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h
index c4521d0723b..9c31bc38981 100644
--- a/storage/innobase/include/data0type.h
+++ b/storage/innobase/include/data0type.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -183,8 +183,6 @@ be less than 256 */
for shorter VARCHARs MySQL uses only 1 byte */
#define DATA_VIRTUAL 8192U /* Virtual column */
-/** Get the number of system columns in a table. */
-#define dict_table_get_n_sys_cols(table) DATA_N_SYS_COLS
/** Check whether locking is disabled (never). */
#define dict_table_is_locking_disabled(table) false
diff --git a/storage/innobase/include/dict0crea.ic b/storage/innobase/include/dict0crea.ic
index 00e4e54115a..a9c4fa7b010 100644
--- a/storage/innobase/include/dict0crea.ic
+++ b/storage/innobase/include/dict0crea.ic
@@ -28,18 +28,6 @@ Created 1/8/1996 Heikki Tuuri
#include "mem0mem.h"
-/*********************************************************************//**
-Checks if a table name contains the string "/#sql" which denotes temporary
-tables in MySQL.
-@return true if temporary table */
-bool
-row_is_mysql_tmp_table_name(
-/*========================*/
- const char* name) MY_ATTRIBUTE((warn_unused_result));
- /*!< in: table name in the form
- 'database/tablename' */
-
-
/********************************************************************//**
Generate a foreign key constraint name when it was not named by the user.
A generated constraint has a name of the format dbname/tablename_ibfk_NUMBER,
@@ -63,7 +51,7 @@ dict_create_add_foreign_id(
mem_heap_alloc(foreign->heap,
namelen + 20));
- if (row_is_mysql_tmp_table_name(name)) {
+ if (dict_table_t::is_temporary_name(name)) {
/* no overflow if number < 1e13 */
sprintf(id, "%s_ibfk_%lu", name,
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index d843374b866..72dc5d26db7 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -879,13 +879,11 @@ dict_table_get_sys_col(
ulint sys) /*!< in: DATA_ROW_ID, ... */
MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
-#define dict_table_get_nth_col(table, pos) \
-((table)->cols + (pos))
+#define dict_table_get_nth_col(table, pos) (&(table)->cols[pos])
#define dict_table_get_sys_col(table, sys) \
-((table)->cols + (table)->n_cols + (sys) \
- - (dict_table_get_n_sys_cols(table)))
+ &(table)->cols[(table)->n_cols + (sys) - DATA_N_SYS_COLS]
/* Get nth virtual columns */
-#define dict_table_get_nth_v_col(table, pos) ((table)->v_cols + (pos))
+#define dict_table_get_nth_v_col(table, pos) (&(table)->v_cols[pos])
#endif /* UNIV_DEBUG */
/********************************************************************//**
Gets the given system column number of a table.
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index a10bf769773..6178b40927c 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2018, MariaDB Corporation.
+Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -78,9 +78,6 @@ dict_col_type_assert_equal(
const dict_col_t* col, /*!< in: column */
const dtype_t* type) /*!< in: data type */
{
- ut_ad(col);
- ut_ad(type);
-
ut_ad(col->mtype == type->mtype);
ut_ad(col->prtype == type->prtype);
//ut_ad(col->len == type->len);
@@ -150,8 +147,6 @@ dict_col_get_no(
/*============*/
const dict_col_t* col) /*!< in: column */
{
- ut_ad(col);
-
return(col->ind);
}
@@ -166,8 +161,6 @@ dict_col_get_clust_pos(
{
ulint i;
- ut_ad(col);
- ut_ad(clust_index);
ut_ad(dict_index_is_clust(clust_index));
for (i = 0; i < clust_index->n_def; i++) {
@@ -193,8 +186,6 @@ dict_col_get_index_pos(
{
ulint i;
- ut_ad(col);
-
for (i = 0; i < index->n_def; i++) {
const dict_field_t* field = &index->fields[i];
@@ -216,7 +207,6 @@ dict_table_get_first_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
{
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_FIRST(((dict_table_t*) table)->indexes));
@@ -231,9 +221,7 @@ dict_table_get_last_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
{
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
-
return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table))
->indexes));
}
@@ -247,9 +235,7 @@ dict_table_get_next_index(
/*======================*/
const dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index));
}
#endif /* UNIV_DEBUG */
@@ -264,7 +250,6 @@ dict_index_is_clust(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_CLUSTERED);
}
@@ -290,7 +275,6 @@ dict_index_is_unique(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_UNIQUE);
}
@@ -303,9 +287,7 @@ dict_index_is_spatial(
/*==================*/
const dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_SPATIAL);
}
@@ -318,9 +300,7 @@ dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_IBUF);
}
@@ -334,7 +314,6 @@ dict_index_is_sec_or_ibuf(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return((index->type & (DICT_CLUSTERED | DICT_IBUF)) != DICT_CLUSTERED);
}
@@ -350,8 +329,7 @@ dict_table_get_n_user_cols(
const dict_table_t* table) /*!< in: table */
{
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
-
- return(table->n_cols - dict_table_get_n_sys_cols(table));
+ return(table->n_cols - DATA_N_SYS_COLS);
}
/********************************************************************//**
@@ -365,7 +343,6 @@ dict_table_get_n_cols(
const dict_table_t* table) /*!< in: table */
{
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
-
return(table->n_cols);
}
@@ -463,7 +440,6 @@ dict_table_get_nth_col(
const dict_table_t* table, /*!< in: table */
ulint pos) /*!< in: position of column */
{
- ut_ad(table);
ut_ad(pos < table->n_def);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
@@ -499,13 +475,11 @@ dict_table_get_sys_col(
{
dict_col_t* col;
- ut_ad(table);
- ut_ad(sys < dict_table_get_n_sys_cols(table));
+ ut_ad(sys < DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
col = dict_table_get_nth_col(table, table->n_cols
- - dict_table_get_n_sys_cols(table)
- + sys);
+ + (sys - DATA_N_SYS_COLS));
ut_ad(col->mtype == DATA_SYS);
ut_ad(col->prtype == (sys | DATA_NOT_NULL));
@@ -523,11 +497,9 @@ dict_table_get_sys_col_no(
const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */
{
- ut_ad(table);
- ut_ad(sys < dict_table_get_n_sys_cols(table));
+ ut_ad(sys < DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
-
- return(table->n_cols - dict_table_get_n_sys_cols(table) + sys);
+ return table->n_cols + (sys - DATA_N_SYS_COLS);
}
/********************************************************************//**
@@ -557,8 +529,6 @@ dict_table_has_fts_index(
/* out: TRUE if table has an FTS index */
dict_table_t* table) /* in: table */
{
- ut_ad(table);
-
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS));
}
@@ -894,7 +864,6 @@ dict_table_x_lock_indexes(
{
dict_index_t* index;
- ut_a(table);
ut_ad(mutex_own(&dict_sys->mutex));
/* Loop through each index of the table and lock them */
@@ -936,7 +905,6 @@ dict_table_x_unlock_indexes(
{
dict_index_t* index;
- ut_a(table);
ut_ad(mutex_own(&dict_sys->mutex));
for (index = dict_table_get_first_index(table);
@@ -958,9 +926,7 @@ dict_index_get_n_fields(
representation of index (in
the dictionary cache) */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->n_fields);
}
@@ -977,10 +943,8 @@ dict_index_get_n_unique(
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached);
-
return(index->n_uniq);
}
@@ -996,7 +960,6 @@ dict_index_get_n_unique_in_tree(
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached);
@@ -1060,7 +1023,6 @@ dict_index_get_nth_field(
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of field */
{
- ut_ad(index);
ut_ad(pos < index->n_def);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
@@ -1078,7 +1040,6 @@ dict_index_get_sys_col_pos(
const dict_index_t* index, /*!< in: index */
ulint type) /*!< in: DATA_ROW_ID, ... */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_ibuf(index));
@@ -1102,8 +1063,6 @@ dict_field_get_col(
/*===============*/
const dict_field_t* field) /*!< in: index field */
{
- ut_ad(field);
-
return(field->col);
}
@@ -1208,7 +1167,6 @@ dict_index_get_page(
/*================*/
const dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->page);
@@ -1223,7 +1181,6 @@ dict_index_get_lock(
/*================*/
dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(&(index->lock));
@@ -1449,9 +1406,7 @@ dict_table_is_corrupted(
/*====================*/
const dict_table_t* table) /*!< in: table */
{
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
-
return(table->corrupted);
}
diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h
index b35add02d9d..b58f0e72038 100644
--- a/storage/innobase/include/dict0load.h
+++ b/storage/innobase/include/dict0load.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -76,11 +76,8 @@ space_id information in the data dictionary to what we find in the
tablespace file. In addition, more validation will be done if recovery
was needed and force_recovery is not set.
-We also scan the biggest space id, and store it to fil_system.
-@param[in] validate true if recovery was needed */
-void
-dict_check_tablespaces_and_store_max_id(
- bool validate);
+We also scan the biggest space id, and store it to fil_system. */
+void dict_check_tablespaces_and_store_max_id();
/********************************************************************//**
Finds the first table name in the given database.
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index f59ff6fcd7f..7bbbf8372e4 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -559,6 +559,11 @@ struct table_name_t
/** The name in internal representation */
char* m_name;
+ /** Default constructor */
+ table_name_t() {}
+ /** Constructor */
+ table_name_t(char* name) : m_name(name) {}
+
/** @return the end of the schema name */
const char* dbend() const
{
@@ -581,6 +586,9 @@ struct table_name_t
@return the partition name
@retval NULL if the table is not partitioned */
const char* part() const { return strstr(basename(), part_suffix); }
+
+ /** @return whether this is a temporary or intermediate table name */
+ inline bool is_temporary() const;
};
/** Data structure for a column in a table */
@@ -1401,6 +1409,13 @@ struct dict_table_t {
return(UNIV_LIKELY(!file_unreadable));
}
+ /** Check if a table name contains the string "/#sql"
+ which denotes temporary or intermediate tables in MariaDB. */
+ static bool is_temporary_name(const char* name)
+ {
+ return strstr(name, "/" TEMP_FILE_PREFIX) != NULL;
+ }
+
/** Id of the table. */
table_id_t id;
/** Hash chain node. */
@@ -1770,6 +1785,11 @@ public:
dict_vcol_templ_t* vc_templ;
};
+inline bool table_name_t::is_temporary() const
+{
+ return dict_table_t::is_temporary_name(m_name);
+}
+
inline bool dict_index_t::is_readable() const
{
return(UNIV_LIKELY(!table->file_unreadable));
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index cb1f0d9836f..06bf20d18df 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -372,15 +372,9 @@ rec_set_next_offs_old(
rec_t* rec, /*!< in: old-style physical record */
ulint next) /*!< in: offset of the next record */
{
- ut_ad(rec);
- ut_ad(UNIV_PAGE_SIZE > next);
-#if REC_NEXT_MASK != 0xFFFFUL
-# error "REC_NEXT_MASK != 0xFFFFUL"
-#endif
-#if REC_NEXT_SHIFT
-# error "REC_NEXT_SHIFT != 0"
-#endif
-
+ ut_ad(srv_page_size > next);
+ compile_time_assert(REC_NEXT_MASK == 0xFFFFUL);
+ compile_time_assert(REC_NEXT_SHIFT == 0);
mach_write_to_2(rec - REC_NEXT, next);
}
@@ -396,8 +390,7 @@ rec_set_next_offs_new(
{
ulint field_value;
- ut_ad(rec);
- ut_ad(UNIV_PAGE_SIZE > next);
+ ut_ad(srv_page_size > next);
if (!next) {
field_value = 0;
@@ -959,7 +952,6 @@ rec_offs_set_n_alloc(
must be allocated */
ulint n_alloc) /*!< in: number of elements */
{
- ut_ad(offsets);
ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets);
offsets[0] = n_alloc;
@@ -1077,7 +1069,6 @@ rec_get_nth_field_offs(
ulint offs;
ulint length;
ut_ad(n < rec_offs_n_fields(offsets));
- ut_ad(len);
if (n == 0) {
offs = 0;
@@ -1425,7 +1416,6 @@ rec_set_nth_field(
byte* data2;
ulint len2;
- ut_ad(rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (len == UNIV_SQL_NULL) {
@@ -1628,8 +1618,6 @@ rec_get_converted_size(
ulint data_size;
ulint extra_size;
- ut_ad(index);
- ut_ad(dtuple);
ut_ad(dtuple_check_typed(dtuple));
ut_ad(dict_index_is_ibuf(index)
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index 9c799c57d37..5dd34f5679b 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -276,17 +276,6 @@ row_unlock_for_mysql(
ibool has_latches_on_recs);
/*********************************************************************//**
-Checks if a table name contains the string "/#sql" which denotes temporary
-tables in MySQL.
-@return true if temporary table */
-bool
-row_is_mysql_tmp_table_name(
-/*========================*/
- const char* name) MY_ATTRIBUTE((warn_unused_result));
- /*!< in: table name in the form
- 'database/tablename' */
-
-/*********************************************************************//**
Creates an query graph node of 'update' type to be used in the MySQL
interface.
@return own: update node */
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index 35b0235b8ec..ed80696a742 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -542,10 +542,6 @@ rec_get_offsets_func(
ulint n;
ulint size;
- ut_ad(rec);
- ut_ad(index);
- ut_ad(heap);
-
if (dict_table_is_comp(index->table)) {
switch (UNIV_EXPECT(rec_get_status(rec),
REC_STATUS_ORDINARY)) {
@@ -650,9 +646,6 @@ rec_get_offsets_reverse(
ulint null_mask;
ulint n_node_ptr_field;
- ut_ad(extra);
- ut_ad(index);
- ut_ad(offsets);
ut_ad(dict_table_is_comp(index->table));
if (UNIV_UNLIKELY(node_ptr)) {
@@ -760,8 +753,6 @@ rec_get_nth_field_offs_old(
ulint os;
ulint next_os;
- ut_ad(len);
- ut_a(rec);
ut_a(n < rec_get_n_fields_old(rec));
if (rec_get_1byte_offs_flag(rec)) {
@@ -1715,7 +1706,6 @@ rec_validate(
ulint len_sum = 0;
ulint i;
- ut_a(rec);
n_fields = rec_offs_n_fields(offsets);
if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) {
@@ -1766,8 +1756,6 @@ rec_print_old(
ulint n;
ulint i;
- ut_ad(rec);
-
n = rec_get_n_fields_old(rec);
fprintf(file, "PHYSICAL RECORD: n_fields " ULINTPF ";"
@@ -1935,8 +1923,6 @@ rec_print_mbr_rec(
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
- ut_ad(rec);
- ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (!rec_offs_comp(offsets)) {
@@ -2004,8 +1990,6 @@ rec_print_new(
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
- ut_ad(rec);
- ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets));
#ifdef UNIV_DEBUG
@@ -2039,8 +2023,6 @@ rec_print(
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
{
- ut_ad(index);
-
if (!dict_table_is_comp(index->table)) {
rec_print_old(file, rec);
return;
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc
index 2e321411a9a..959c2e3465a 100644
--- a/storage/innobase/row/row0ftsort.cc
+++ b/storage/innobase/row/row0ftsort.cc
@@ -1577,9 +1577,6 @@ row_fts_merge_insert(
trx_t* trx;
byte sys_buf[DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN];
- ut_ad(index);
- ut_ad(table);
-
/* We use the insert query graph as the dummy graph
needed in the row module call */
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index da800da1dc3..03665ccdc3c 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -491,8 +491,6 @@ row_ins_cascade_calc_update_vec(
doc_id_t new_doc_id = FTS_NULL_DOC_ID;
ulint prefix_col;
- ut_a(node);
- ut_a(foreign);
ut_a(cascade);
ut_a(table);
ut_a(index);
@@ -1092,10 +1090,6 @@ row_ins_foreign_check_on_constraint(
doc_id_t doc_id = FTS_NULL_DOC_ID;
DBUG_ENTER("row_ins_foreign_check_on_constraint");
- ut_a(thr);
- ut_a(foreign);
- ut_a(pcur);
- ut_a(mtr);
trx = thr_get_trx(thr);
@@ -2938,7 +2932,7 @@ row_ins_sec_index_entry_low(
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- index->table->name);
+ index->table->name.m_name);
index->table->file_unreadable = true;
}
goto func_exit;
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index a12a2a73ace..bd3acf5f063 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -4086,7 +4086,6 @@ row_merge_rename_index_to_add(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
@@ -4140,7 +4139,6 @@ row_merge_rename_index_to_drop(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index dcfc16ca42f..29fc79a7d3e 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -1307,7 +1307,7 @@ row_mysql_get_table_status(
"Table %s in tablespace %lu encrypted."
"However key management plugin or used key_id is not found or"
" used encryption algorithm or method does not match.",
- table->name, table->space);
+ table->name.m_name, table->space);
}
err = DB_DECRYPTION_FAILED;
@@ -1315,7 +1315,7 @@ row_mysql_get_table_status(
if (push_warning) {
ib_push_warning(trx, DB_CORRUPTION,
"Table %s in tablespace %lu corrupted.",
- table->name, table->space);
+ table->name.m_name, table->space);
}
err = DB_CORRUPTION;
@@ -3094,7 +3094,6 @@ row_mysql_lock_table(
dberr_t err;
sel_node_t* node;
- ut_ad(trx);
ut_ad(mode == LOCK_X || mode == LOCK_S);
heap = mem_heap_create(512);
@@ -3967,7 +3966,7 @@ loop:
}
- if (!row_is_mysql_tmp_table_name(table->name.m_name)) {
+ if (!table->name.is_temporary()) {
/* There could be orphan temp tables left from
interrupted alter table. Leave them, and handle
the rest.*/
@@ -4061,21 +4060,6 @@ loop:
DBUG_RETURN(err);
}
-/*********************************************************************//**
-Checks if a table name contains the string "/#sql" which denotes temporary
-tables in MySQL.
-@return true if temporary table */
-MY_ATTRIBUTE((warn_unused_result))
-bool
-row_is_mysql_tmp_table_name(
-/*========================*/
- const char* name) /*!< in: table name in the form
- 'database/tablename' */
-{
- return(strstr(name, "/" TEMP_FILE_PREFIX) != NULL);
- /* return(strstr(name, "/@0023sql") != NULL); */
-}
-
/****************************************************************//**
Delete a single constraint.
@return error code or DB_SUCCESS */
@@ -4175,8 +4159,8 @@ row_rename_table_for_mysql(
trx->op_info = "renaming table";
- old_is_tmp = row_is_mysql_tmp_table_name(old_name);
- new_is_tmp = row_is_mysql_tmp_table_name(new_name);
+ old_is_tmp = dict_table_t::is_temporary_name(old_name);
+ new_is_tmp = dict_table_t::is_temporary_name(new_name);
dict_locked = trx->dict_operation_lock_mode == RW_X_LATCH;
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index d0ed2f62167..f5078c5dffb 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -1197,8 +1197,6 @@ row_purge_step(
{
purge_node_t* node;
- ut_ad(thr);
-
node = static_cast<purge_node_t*>(thr->run_node);
node->start();
diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc
index a01238fd21a..687eab903f8 100644
--- a/storage/innobase/row/row0row.cc
+++ b/storage/innobase/row/row0row.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -894,9 +894,6 @@ row_build_row_ref_in_tuple(
ulint offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
- ut_a(ref);
- ut_a(index);
- ut_a(rec);
ut_ad(!dict_index_is_clust(index));
ut_a(index->table);
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index 4a82a345a1d..6f9e903623c 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -4738,7 +4738,7 @@ wait_table_again:
"Table %s is encrypted but encryption service or"
" used key_id is not available. "
" Can't continue reading table.",
- prebuilt->table->name);
+ prebuilt->table->name.m_name);
index->table->file_unreadable = true;
}
rec = NULL;
diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc
index dc356f076ea..7e4b512ca27 100644
--- a/storage/innobase/row/row0upd.cc
+++ b/storage/innobase/row/row0upd.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2018, MariaDB Corporation.
+Copyright (c) 2015, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2681,7 +2681,6 @@ row_upd_clust_rec_by_insert(
rec_t* rec;
ulint* offsets = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
trx = thr_get_trx(thr);
@@ -2831,7 +2830,6 @@ row_upd_clust_rec(
dberr_t err;
const dtuple_t* rebuilt_old_pk = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
ut_ad(!thr_get_trx(thr)->in_rollback);
ut_ad(!node->table->skip_alter_undo);
@@ -2967,7 +2965,6 @@ row_upd_del_mark_clust_rec(
rec_t* rec;
trx_t* trx = thr_get_trx(thr);
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
ut_ad(node->is_delete);
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index ae4c596a4bf..03e9691da63 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -2487,19 +2487,8 @@ files_checked:
every table in the InnoDB data dictionary that has
an .ibd file.
- We also determine the maximum tablespace id used.
-
- The 'validate' flag indicates that when a tablespace
- is opened, we also read the header page and validate
- the contents to the data dictionary. This is time
- consuming, especially for databases with lots of ibd
- files. So only do it after a crash and not forcing
- recovery. Open rw transactions at this point is not
- a good reason to validate. */
- bool validate = recv_needed_recovery
- && srv_force_recovery == 0;
-
- dict_check_tablespaces_and_store_max_id(validate);
+ We also determine the maximum tablespace id used. */
+ dict_check_tablespaces_and_store_max_id();
}
/* Fix-up truncate of table if server crashed while truncate
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index e700d5e0f58..5c8b2f9441f 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1681,10 +1681,6 @@ trx_undo_rec_get_partial_row(
bool first_v_col = true;
bool is_undo_log = true;
- ut_ad(index);
- ut_ad(ptr);
- ut_ad(row);
- ut_ad(heap);
ut_ad(dict_index_is_clust(index));
*row = dtuple_create_with_vcol(
diff --git a/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt b/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt
index 6f9146ce5b2..b4db82ffff5 100644
--- a/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt
+++ b/storage/tokudb/PerconaFT/ftcxx/tests/CMakeLists.txt
@@ -2,9 +2,9 @@ include_directories(..)
include_directories(../../src)
include_directories(../../src/tests)
-find_library(JEMALLOC_STATIC_LIBRARY libjemalloc.a)
-
if (BUILD_TESTING)
+ find_library(JEMALLOC_STATIC_LIBRARY libjemalloc.a)
+
## reference implementation with simple size-doubling buffer without
## jemalloc size tricks
add_library(doubling_buffer_ftcxx STATIC
diff --git a/storage/xtradb/buf/buf0buddy.cc b/storage/xtradb/buf/buf0buddy.cc
index ee687efc9ec..e058c69d4b3 100644
--- a/storage/xtradb/buf/buf0buddy.cc
+++ b/storage/xtradb/buf/buf0buddy.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/storage/xtradb/data/data0data.cc b/storage/xtradb/data/data0data.cc
index 593af089b00..cda27de1736 100644
--- a/storage/xtradb/data/data0data.cc
+++ b/storage/xtradb/data/data0data.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -106,8 +107,6 @@ dtuple_set_n_fields(
dtuple_t* tuple, /*!< in: tuple */
ulint n_fields) /*!< in: number of fields */
{
- ut_ad(tuple);
-
tuple->n_fields = n_fields;
tuple->n_fields_cmp = n_fields;
}
diff --git a/storage/xtradb/dict/dict0dict.cc b/storage/xtradb/dict/dict0dict.cc
index 4c5117f987e..b587aec5370 100644
--- a/storage/xtradb/dict/dict0dict.cc
+++ b/storage/xtradb/dict/dict0dict.cc
@@ -946,7 +946,6 @@ dict_index_get_nth_field_pos(
ulint n_fields;
ulint pos;
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
field2 = dict_index_get_nth_field(index2, n);
@@ -1044,8 +1043,6 @@ dict_table_col_in_clustered_key(
ulint pos;
ulint n_fields;
- ut_ad(table);
-
col = dict_table_get_nth_col(table, n);
index = dict_table_get_first_index(table);
@@ -1220,7 +1217,6 @@ dict_table_add_system_columns(
dict_table_t* table, /*!< in/out: table */
mem_heap_t* heap) /*!< in: temporary heap */
{
- ut_ad(table);
ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!table->cached);
@@ -2030,8 +2026,7 @@ dict_table_change_id_in_cache(
dict_table_t* table, /*!< in/out: table object already in cache */
table_id_t new_id) /*!< in: new id to set */
{
- ut_ad(table);
- ut_ad(mutex_own(&(dict_sys->mutex)));
+ ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* Remove the table from the hash table of id's */
@@ -2057,7 +2052,6 @@ dict_table_remove_from_cache_low(
dict_foreign_t* foreign;
dict_index_t* index;
- ut_ad(table);
ut_ad(dict_lru_validate());
ut_a(table->n_ref_count == 0);
ut_a(table->n_rec_locks == 0);
@@ -2506,8 +2500,7 @@ dict_index_add_to_cache(
ulint n_ord;
ulint i;
- ut_ad(index);
- ut_ad(mutex_own(&(dict_sys->mutex)));
+ ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(index->n_def == index->n_fields);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_online_ddl(index));
@@ -5290,7 +5283,6 @@ dict_foreign_parse_drop_constraints(
const char* id;
struct charset_info_st* cs;
- ut_a(trx);
ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd);
@@ -5463,9 +5455,8 @@ dict_index_check_search_tuple(
const dict_index_t* index, /*!< in: index tree */
const dtuple_t* tuple) /*!< in: tuple used in a search */
{
- ut_a(index);
- ut_a(dtuple_get_n_fields_cmp(tuple)
- <= dict_index_get_n_unique_in_tree(index));
+ ut_ad(dtuple_get_n_fields_cmp(tuple)
+ <= dict_index_get_n_unique_in_tree(index));
return(TRUE);
}
#endif /* UNIV_DEBUG */
@@ -7122,8 +7113,6 @@ dict_index_zip_success(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7145,8 +7134,6 @@ dict_index_zip_failure(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
{
- ut_ad(index);
-
ulint zip_threshold = zip_failure_threshold_pct;
if (!zip_threshold) {
/* Disabled by user. */
@@ -7174,8 +7161,6 @@ dict_index_zip_pad_optimal_page_size(
ulint min_sz;
ulint sz;
- ut_ad(index);
-
if (!zip_failure_threshold_pct) {
/* Disabled by user. */
return(UNIV_PAGE_SIZE);
diff --git a/storage/xtradb/dict/dict0mem.cc b/storage/xtradb/dict/dict0mem.cc
index 4ce0981d972..7c8a09bd00a 100644
--- a/storage/xtradb/dict/dict0mem.cc
+++ b/storage/xtradb/dict/dict0mem.cc
@@ -276,7 +276,6 @@ dict_mem_table_add_col(
dict_col_t* col;
ulint i;
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!heap == !name);
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index bdc7c72cf8b..638288cdb3c 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -1516,8 +1516,8 @@ name_ok:
index
@param[in] altered_table MySQL table that is being altered
@param[in] key_part MySQL key definition
-@param[out] index_field index field defition for key_part */
-static MY_ATTRIBUTE((nonnull(2,3)))
+@param[out] index_field index field definition for key_part */
+static MY_ATTRIBUTE((nonnull))
void
innobase_create_index_field_def(
bool new_clustered,
@@ -1532,10 +1532,6 @@ innobase_create_index_field_def(
DBUG_ENTER("innobase_create_index_field_def");
- ut_ad(key_part);
- ut_ad(index_field);
- ut_ad(altered_table);
-
/* Virtual columns are not stored in InnoDB data dictionary, thus
if there is virtual columns we need to skip them to find the
correct field. */
@@ -1599,8 +1595,6 @@ innobase_create_index_def(
DBUG_ENTER("innobase_create_index_def");
DBUG_ASSERT(!key_clustered || new_clustered);
- ut_ad(altered_table);
-
index->fields = static_cast<index_field_t*>(
mem_heap_alloc(heap, n_fields * sizeof *index->fields));
index->ind_type = 0;
@@ -4845,7 +4839,6 @@ innobase_rename_columns_try(
ha_alter_info->alter_info->create_list);
uint i = 0;
- DBUG_ASSERT(ctx);
DBUG_ASSERT(ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NAME);
@@ -5029,7 +5022,6 @@ innobase_update_foreign_try(
ulint i;
DBUG_ENTER("innobase_update_foreign_try");
- DBUG_ASSERT(ctx);
foreign_id = dict_table_get_highest_foreign_id(ctx->new_table);
diff --git a/storage/xtradb/include/data0data.ic b/storage/xtradb/include/data0data.ic
index 11499ab928c..deac969a03d 100644
--- a/storage/xtradb/include/data0data.ic
+++ b/storage/xtradb/include/data0data.ic
@@ -1,6 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -41,8 +42,6 @@ dfield_get_type(
/*============*/
const dfield_t* field) /*!< in: SQL data field */
{
- ut_ad(field);
-
return((dtype_t*) &(field->type));
}
#endif /* UNIV_DEBUG */
@@ -72,7 +71,6 @@ dfield_get_data(
/*============*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -89,7 +87,6 @@ dfield_get_len(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
ut_ad((field->len == UNIV_SQL_NULL)
|| (field->data != &data_error));
@@ -105,7 +102,6 @@ dfield_set_len(
dfield_t* field, /*!< in: field */
ulint len) /*!< in: length or UNIV_SQL_NULL */
{
- ut_ad(field);
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(field->data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@@ -123,8 +119,6 @@ dfield_is_null(
/*===========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
-
return(field->len == UNIV_SQL_NULL);
}
@@ -137,8 +131,6 @@ dfield_is_ext(
/*==========*/
const dfield_t* field) /*!< in: field */
{
- ut_ad(field);
-
return(field->ext);
}
@@ -150,8 +142,6 @@ dfield_set_ext(
/*===========*/
dfield_t* field) /*!< in/out: field */
{
- ut_ad(field);
-
field->ext = 1;
}
@@ -165,8 +155,6 @@ dfield_set_data(
const void* data, /*!< in: data */
ulint len) /*!< in: length or UNIV_SQL_NULL */
{
- ut_ad(field);
-
#ifdef UNIV_VALGRIND_DEBUG
if (len != UNIV_SQL_NULL) UNIV_MEM_ASSERT_RW(data, len);
#endif /* UNIV_VALGRIND_DEBUG */
@@ -286,8 +274,6 @@ dtuple_get_info_bits(
/*=================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->info_bits);
}
@@ -300,8 +286,6 @@ dtuple_set_info_bits(
dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */
{
- ut_ad(tuple);
-
tuple->info_bits = info_bits;
}
@@ -314,8 +298,6 @@ dtuple_get_n_fields_cmp(
/*====================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields_cmp);
}
@@ -329,9 +311,7 @@ dtuple_set_n_fields_cmp(
ulint n_fields_cmp) /*!< in: number of fields used in
comparisons in rem0cmp.* */
{
- ut_ad(tuple);
ut_ad(n_fields_cmp <= tuple->n_fields);
-
tuple->n_fields_cmp = n_fields_cmp;
}
@@ -344,8 +324,6 @@ dtuple_get_n_fields(
/*================*/
const dtuple_t* tuple) /*!< in: tuple */
{
- ut_ad(tuple);
-
return(tuple->n_fields);
}
@@ -483,7 +461,6 @@ dtuple_get_data_size(
ulint i;
ulint sum = 0;
- ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
@@ -517,7 +494,6 @@ dtuple_get_n_ext(
ulint n_fields = tuple->n_fields;
ulint i;
- ut_ad(tuple);
ut_ad(dtuple_check_typed(tuple));
ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
diff --git a/storage/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic
index 8c50b961c58..ef9adc092f0 100644
--- a/storage/xtradb/include/dict0dict.ic
+++ b/storage/xtradb/include/dict0dict.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2018, MariaDB Corporation.
+Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -85,9 +85,6 @@ dict_col_type_assert_equal(
const dict_col_t* col, /*!< in: column */
const dtype_t* type) /*!< in: data type */
{
- ut_ad(col);
- ut_ad(type);
-
ut_ad(col->mtype == type->mtype);
ut_ad(col->prtype == type->prtype);
//ut_ad(col->len == type->len);
@@ -161,8 +158,6 @@ dict_col_get_no(
/*============*/
const dict_col_t* col) /*!< in: column */
{
- ut_ad(col);
-
return(col->ind);
}
@@ -177,8 +172,6 @@ dict_col_get_clust_pos(
{
ulint i;
- ut_ad(col);
- ut_ad(clust_index);
ut_ad(dict_index_is_clust(clust_index));
for (i = 0; i < clust_index->n_def; i++) {
@@ -203,7 +196,6 @@ dict_table_get_first_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
{
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(UT_LIST_GET_FIRST(((dict_table_t*) table)->indexes));
@@ -218,9 +210,7 @@ dict_table_get_last_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
{
- ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
-
return(UT_LIST_GET_LAST((const_cast<dict_table_t*>(table))
->indexes));
}
@@ -234,9 +224,7 @@ dict_table_get_next_index(
/*======================*/
const dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(UT_LIST_GET_NEXT(indexes, (dict_index_t*) index));
}
#endif /* UNIV_DEBUG */
@@ -252,7 +240,6 @@ dict_index_is_clust(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_CLUSTERED);
}
/********************************************************************//**
@@ -265,7 +252,6 @@ dict_index_is_unique(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_UNIQUE);
}
@@ -279,7 +265,6 @@ dict_index_is_ibuf(
const dict_index_t* index) /*!< in: index */
{
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_IBUF);
}
@@ -292,9 +277,7 @@ dict_index_is_univ(
/*===============*/
const dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->type & DICT_UNIVERSAL);
}
@@ -423,7 +406,6 @@ dict_table_get_nth_col(
const dict_table_t* table, /*!< in: table */
ulint pos) /*!< in: position of column */
{
- ut_ad(table);
ut_ad(pos < table->n_def);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
@@ -465,7 +447,6 @@ dict_table_get_sys_col_no(
const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */
{
- ut_ad(table);
ut_ad(sys < DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
@@ -499,8 +480,6 @@ dict_table_has_fts_index(
/* out: TRUE if table has an FTS index */
dict_table_t* table) /* in: table */
{
- ut_ad(table);
-
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS));
}
@@ -1049,8 +1028,7 @@ dict_table_x_lock_indexes(
{
dict_index_t* index;
- ut_a(table);
- ut_ad(mutex_own(&(dict_sys->mutex)));
+ ut_ad(mutex_own(&dict_sys->mutex));
/* Loop through each index of the table and lock them */
for (index = dict_table_get_first_index(table);
@@ -1091,8 +1069,7 @@ dict_table_x_unlock_indexes(
{
dict_index_t* index;
- ut_a(table);
- ut_ad(mutex_own(&(dict_sys->mutex)));
+ ut_ad(mutex_own(&dict_sys->mutex));
for (index = dict_table_get_first_index(table);
index != NULL;
@@ -1114,9 +1091,7 @@ dict_index_get_n_fields(
representation of index (in
the dictionary cache) */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
-
return(index->n_fields);
}
@@ -1133,10 +1108,8 @@ dict_index_get_n_unique(
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached);
-
return(index->n_uniq);
}
@@ -1152,7 +1125,6 @@ dict_index_get_n_unique_in_tree(
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(index->cached);
@@ -1191,7 +1163,6 @@ dict_index_get_nth_field(
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of field */
{
- ut_ad(index);
ut_ad(pos < index->n_def);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
@@ -1209,7 +1180,6 @@ dict_index_get_sys_col_pos(
const dict_index_t* index, /*!< in: index */
ulint type) /*!< in: DATA_ROW_ID, ... */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
ut_ad(!dict_index_is_univ(index));
@@ -1234,8 +1204,6 @@ dict_field_get_col(
/*===============*/
const dict_field_t* field) /*!< in: index field */
{
- ut_ad(field);
-
return(field->col);
}
@@ -1341,7 +1309,6 @@ dict_index_get_page(
/*================*/
const dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(index->page);
@@ -1356,7 +1323,6 @@ dict_index_get_lock(
/*================*/
dict_index_t* index) /*!< in: index */
{
- ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
return(&(index->lock));
diff --git a/storage/xtradb/include/rem0rec.ic b/storage/xtradb/include/rem0rec.ic
index 89f6902059d..122ea733065 100644
--- a/storage/xtradb/include/rem0rec.ic
+++ b/storage/xtradb/include/rem0rec.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
-Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -373,15 +373,9 @@ rec_set_next_offs_old(
rec_t* rec, /*!< in: old-style physical record */
ulint next) /*!< in: offset of the next record */
{
- ut_ad(rec);
- ut_ad(UNIV_PAGE_SIZE > next);
-#if REC_NEXT_MASK != 0xFFFFUL
-# error "REC_NEXT_MASK != 0xFFFFUL"
-#endif
-#if REC_NEXT_SHIFT
-# error "REC_NEXT_SHIFT != 0"
-#endif
-
+ ut_ad(srv_page_size > next);
+ compile_time_assert(REC_NEXT_MASK == 0xFFFFUL);
+ compile_time_assert(REC_NEXT_SHIFT == 0);
mach_write_to_2(rec - REC_NEXT, next);
}
@@ -397,8 +391,7 @@ rec_set_next_offs_new(
{
ulint field_value;
- ut_ad(rec);
- ut_ad(UNIV_PAGE_SIZE > next);
+ ut_ad(srv_page_size > next);
if (!next) {
field_value = 0;
@@ -921,7 +914,6 @@ rec_offs_set_n_alloc(
must be allocated */
ulint n_alloc) /*!< in: number of elements */
{
- ut_ad(offsets);
ut_ad(n_alloc > REC_OFFS_HEADER_SIZE);
UNIV_MEM_ALLOC(offsets, n_alloc * sizeof *offsets);
offsets[0] = n_alloc;
@@ -1039,7 +1031,6 @@ rec_get_nth_field_offs(
ulint offs;
ulint length;
ut_ad(n < rec_offs_n_fields(offsets));
- ut_ad(len);
if (n == 0) {
offs = 0;
@@ -1387,7 +1378,6 @@ rec_set_nth_field(
byte* data2;
ulint len2;
- ut_ad(rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (len == UNIV_SQL_NULL) {
@@ -1589,8 +1579,6 @@ rec_get_converted_size(
ulint data_size;
ulint extra_size;
- ut_ad(index);
- ut_ad(dtuple);
ut_ad(dtuple_check_typed(dtuple));
ut_ad(dict_index_is_univ(index)
diff --git a/storage/xtradb/rem/rem0rec.cc b/storage/xtradb/rem/rem0rec.cc
index 2314f110312..ff680b3cfb6 100644
--- a/storage/xtradb/rem/rem0rec.cc
+++ b/storage/xtradb/rem/rem0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -556,10 +556,6 @@ rec_get_offsets_func(
ulint n;
ulint size;
- ut_ad(rec);
- ut_ad(index);
- ut_ad(heap);
-
if (dict_table_is_comp(index->table)) {
switch (UNIV_EXPECT(rec_get_status(rec),
REC_STATUS_ORDINARY)) {
@@ -637,9 +633,6 @@ rec_get_offsets_reverse(
ulint null_mask;
ulint n_node_ptr_field;
- ut_ad(extra);
- ut_ad(index);
- ut_ad(offsets);
ut_ad(dict_table_is_comp(index->table));
if (UNIV_UNLIKELY(node_ptr)) {
@@ -748,8 +741,6 @@ rec_get_nth_field_offs_old(
ulint os;
ulint next_os;
- ut_ad(len);
- ut_a(rec);
ut_a(n < rec_get_n_fields_old(rec));
if (rec_get_1byte_offs_flag(rec)) {
@@ -1717,7 +1708,6 @@ rec_validate(
ulint sum = 0;
ulint i;
- ut_a(rec);
n_fields = rec_offs_n_fields(offsets);
if ((n_fields == 0) || (n_fields > REC_MAX_N_FIELDS)) {
@@ -1781,8 +1771,6 @@ rec_print_old(
ulint n;
ulint i;
- ut_ad(rec);
-
n = rec_get_n_fields_old(rec);
fprintf(file, "PHYSICAL RECORD: n_fields %lu;"
@@ -1876,8 +1864,6 @@ rec_print_new(
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
- ut_ad(rec);
- ut_ad(offsets);
ut_ad(rec_offs_validate(rec, NULL, offsets));
if (!rec_offs_comp(offsets)) {
@@ -1904,8 +1890,6 @@ rec_print(
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
{
- ut_ad(index);
-
if (!dict_table_is_comp(index->table)) {
rec_print_old(file, rec);
return;
diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc
index fb30f867f87..d3c8b9a80bd 100644
--- a/storage/xtradb/row/row0ftsort.cc
+++ b/storage/xtradb/row/row0ftsort.cc
@@ -1418,9 +1418,6 @@ row_fts_merge_insert(
ulint count_diag = 0;
ulint space;
- ut_ad(index);
- ut_ad(table);
-
/* We use the insert query graph as the dummy graph
needed in the row module call */
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc
index 476c18680f3..cb22f5030d5 100644
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@ -495,8 +495,6 @@ row_ins_cascade_calc_update_vec(
ulint doc_id_pos = 0;
doc_id_t new_doc_id = FTS_NULL_DOC_ID;
- ut_a(node);
- ut_a(foreign);
ut_a(cascade);
ut_a(table);
ut_a(index);
@@ -991,11 +989,6 @@ row_ins_foreign_check_on_constraint(
doc_id_t doc_id = FTS_NULL_DOC_ID;
ibool fts_col_affacted = FALSE;
- ut_a(thr);
- ut_a(foreign);
- ut_a(pcur);
- ut_a(mtr);
-
trx = thr_get_trx(thr);
/* Since we are going to delete or update a row, we have to invalidate
diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc
index 0ec11a31500..0acfc662cab 100644
--- a/storage/xtradb/row/row0merge.cc
+++ b/storage/xtradb/row/row0merge.cc
@@ -3471,7 +3471,6 @@ row_merge_rename_index_to_add(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
@@ -3528,7 +3527,6 @@ row_merge_rename_index_to_drop(
"WHERE TABLE_ID = :tableid AND ID = :indexid;\n"
"END;\n";
- ut_ad(trx);
ut_a(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(trx_get_dict_operation(trx) == TRX_DICT_OP_INDEX);
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index 5e7ff6e910b..a21e32cb91e 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -3239,7 +3239,6 @@ row_mysql_lock_table(
dberr_t err;
sel_node_t* node;
- ut_ad(trx);
ut_ad(mode == LOCK_X || mode == LOCK_S);
heap = mem_heap_create(512);
diff --git a/storage/xtradb/row/row0purge.cc b/storage/xtradb/row/row0purge.cc
index 0cd0941987d..414eeb9db3a 100644
--- a/storage/xtradb/row/row0purge.cc
+++ b/storage/xtradb/row/row0purge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -968,8 +968,6 @@ row_purge_step(
{
purge_node_t* node;
- ut_ad(thr);
-
node = static_cast<purge_node_t*>(thr->run_node);
node->table = NULL;
diff --git a/storage/xtradb/row/row0row.cc b/storage/xtradb/row/row0row.cc
index 9bf9e7182ca..884bf52af34 100644
--- a/storage/xtradb/row/row0row.cc
+++ b/storage/xtradb/row/row0row.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -639,9 +639,6 @@ row_build_row_ref_in_tuple(
ulint offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
- ut_a(ref);
- ut_a(index);
- ut_a(rec);
ut_ad(!dict_index_is_clust(index));
if (UNIV_UNLIKELY(!index->table)) {
diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc
index 93ccc07c9af..3df207716c3 100644
--- a/storage/xtradb/row/row0upd.cc
+++ b/storage/xtradb/row/row0upd.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2018, MariaDB Corporation.
+Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -2208,7 +2208,6 @@ row_upd_clust_rec_by_insert(
rec_t* rec;
ulint* offsets = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
trx = thr_get_trx(thr);
@@ -2357,7 +2356,6 @@ row_upd_clust_rec(
dberr_t err;
const dtuple_t* rebuilt_old_pk = NULL;
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
pcur = node->pcur;
@@ -2525,7 +2523,6 @@ row_upd_del_mark_clust_rec(
trx_t* trx = thr_get_trx(thr) ;
#endif /* WITH_WSREP */
- ut_ad(node);
ut_ad(dict_index_is_clust(index));
ut_ad(node->is_delete);
diff --git a/storage/xtradb/trx/trx0rec.cc b/storage/xtradb/trx/trx0rec.cc
index dc9b0829925..351f65bb943 100644
--- a/storage/xtradb/trx/trx0rec.cc
+++ b/storage/xtradb/trx/trx0rec.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1087,10 +1087,6 @@ trx_undo_rec_get_partial_row(
const byte* end_ptr;
ulint row_len;
- ut_ad(index);
- ut_ad(ptr);
- ut_ad(row);
- ut_ad(heap);
ut_ad(dict_index_is_clust(index));
row_len = dict_table_get_n_cols(index->table);