Merge 10.2 into bb-10.2-ext

This commit is contained in:
Marko Mäkelä 2018-01-11 18:00:31 +02:00
commit cca611d1c0
77 changed files with 1145 additions and 429 deletions

View File

@ -14,7 +14,7 @@
# License along with this library; if not, write to the Free # License along with this library; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
# MA 02110-1301, USA # MA 02110-1301, USA
set -x -v
cflags="$c_warnings $extra_flags $EXTRA_FLAGS $EXTRA_CFLAGS" cflags="$c_warnings $extra_flags $EXTRA_FLAGS $EXTRA_CFLAGS"
cxxflags="$cxx_warnings $base_cxxflags $extra_flags $EXTRA_FLAGS $EXTRA_CXXFLAGS" cxxflags="$cxx_warnings $base_cxxflags $extra_flags $EXTRA_FLAGS $EXTRA_CXXFLAGS"
extra_configs="$extra_configs $local_infile_configs $EXTRA_CONFIGS" extra_configs="$extra_configs $local_infile_configs $EXTRA_CONFIGS"
@ -32,15 +32,19 @@ then
configure="$configure --verbose" configure="$configure --verbose"
fi fi
commands=""
# git clean -fdX removes all ignored (build) files # git clean -fdX removes all ignored (build) files
commands="\ if test -d .git
then
commands="\
git clean -fdX git clean -fdX
cd ./libmariadb cd ./libmariadb
git submodule update git submodule update
cd ../storage/rocksdb/rocksdb cd ../storage/rocksdb/rocksdb
git submodule update git submodule update
cd ../../.. cd ../../.."
fi
commands="$commands
path=`dirname $0` path=`dirname $0`
. \"$path/autorun.sh\"" . \"$path/autorun.sh\""

View File

@ -0,0 +1,24 @@
#! /bin/sh
# Copyright (c) 2018, 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 Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
export LDFLAGS="-ldl"
. "$path/FINISH.sh"

View File

@ -142,6 +142,11 @@ IF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267 ") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267 ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090 /wd4267")
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
ENDIF()
ENDIF() ENDIF()
# Always link with socket library # Always link with socket library

@ -1 +1 @@
Subproject commit fe129ed39f33ba2b430aac91473baee84de88b12 Subproject commit f3944bbd36af729b2f13313587018679c57de67d

View File

@ -26,7 +26,20 @@
#include <signal.h> #include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <psapi.h> #include <psapi.h>
#ifdef _MSC_VER
/* Silence warning in OS header dbghelp.h */
#pragma warning(push)
#pragma warning(disable : 4091)
#endif
#include <dbghelp.h> #include <dbghelp.h>
#ifdef _MSC_VER
/* Silence warning in OS header dbghelp.h */
#pragma warning(pop)
#endif
#include <tlhelp32.h> #include <tlhelp32.h>
#include <vector> #include <vector>

View File

@ -1265,3 +1265,33 @@ a
4 4
deallocate prepare stmt; deallocate prepare stmt;
drop table t1; drop table t1;
#
# MDEV-14852: CTE using temporary table in query
# with two references to the CTE
#
create temporary table t1 (i int);
insert into t1 values (5),(4),(1),(2),(3);
with
c1 as (select i from t1),
c2 as (select i from c1 where c1.i=2)
select i from c1 where i > 3 union select i from c2;
i
5
4
2
drop table t1;
create table t1 (term char(10));
create temporary table t2 (term char(10));
insert into t1 values ('TERM01'),('TERM02'),('TERM03');
insert into t2 values ('TERM02'),('TERM03'),('TERM04');
with c1 as (select * from t1), c2 as (select * from t2)
(select * from c1 left outer join c2 on c1.term = c2.term)
union all
(select * from c1 right outer join c2 on c1.term = c2.term
where c1.term is null);
term term
TERM02 TERM02
TERM03 TERM03
TERM01 NULL
NULL TERM04
drop table t1,t2;

View File

@ -2951,6 +2951,112 @@ limit 1
ERROR HY000: Unacceptable mutual recursion with anchored table 'cte_1' ERROR HY000: Unacceptable mutual recursion with anchored table 'cte_1'
drop table t1; drop table t1;
# #
# mdev-14777: crash caused by the same as in mdev-14755
#
CREATE TABLE t1 (i1 int NOT NULL, i2 int);
CREATE TABLE t2 (d1 int NOT NULL PRIMARY KEY);
CREATE TABLE t3 (i int );
insert into t1 select seq,seq from seq_1_to_100000;
insert into t2 select seq from seq_1000_to_100000;
insert into t3 select seq from seq_1_to_1000;
SELECT *
FROM
(
SELECT *
FROM
(
WITH RECURSIVE rt AS
(
SELECT i2 P, i1 C FROM t1 WHERE i1 IN (SELECT d1 FROM t2)
UNION
SELECT t1.i2 P, rt.C C FROM t1, rt
)
SELECT C,P
FROM ( SELECT P,C FROM rt WHERE NOT EXISTS (SELECT 1 FROM t1) ) Y
) X
WHERE 1 = 1
) K, t3;
C P i
drop table t1,t2,t3;
#
# mdev-14879: subquery with recursive reference in WHERE of CTE
#
create table flights
(departure varchar(32),
arrival varchar(32),
carrier varchar(20),
flight_number char(7));
insert into flights values
('Seattle', 'Frankfurt', 'Lufthansa', 'LH 491'),
('Seattle', 'Chicago', 'American', 'AA 2573'),
('Seattle', 'Los Angeles', 'Alaska Air', 'AS 410'),
('Chicago', 'New York', 'American', 'AA 375'),
('Chicago', 'Montreal', 'Air Canada', 'AC 3053'),
('Los Angeles', 'New York', 'Delta', 'DL 1197'),
('Moscow', 'Tokyo', 'Aeroflot', 'SU 264'),
('New York', 'Paris', 'Air France', 'AF 23'),
('Frankfurt', 'Moscow', 'Lufthansa', 'LH 1444'),
('Tokyo', 'Seattle', 'ANA', 'NH 178'),
('Los Angeles', 'Tokyo', 'ANA', 'NH 175'),
('Moscow', 'Los Angeles', 'Aeroflot', 'SU 106'),
('Montreal', 'Paris', 'Air Canada', 'AC 870'),
('Cairo', 'Paris', 'Air France', 'AF 503'),
('New York', 'Seattle', 'American', 'AA 45'),
('Paris', 'Chicago', 'Air France', 'AF 6734');
with recursive destinations (city) as
( select a.arrival from flights a where a.departure='Cairo'
union
select b.arrival from destinations r, flights b where r.city=b.departure)
select * from destinations;
city
Paris
Chicago
New York
Montreal
Seattle
Frankfurt
Los Angeles
Moscow
Tokyo
set standard_compliant_cte=0;
with recursive destinations (city, legs) as
(
select a.arrival, 1 from flights a where a.departure='Cairo'
union
select b.arrival, r.legs + 1 from destinations r, flights b
where r.city=b.departure and b.arrival not in (select city from destinations)
)
select * from destinations;
city legs
Paris 1
Chicago 2
New York 3
Montreal 3
Seattle 4
Frankfurt 5
Los Angeles 5
Moscow 6
Tokyo 6
explain extended with recursive destinations (city, legs) as
(
select a.arrival, 1 from flights a where a.departure='Cairo'
union
select b.arrival, r.legs + 1 from destinations r, flights b
where r.city=b.departure and b.arrival not in (select city from destinations)
)
select * from destinations;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 16 100.00
2 DERIVED a ALL NULL NULL NULL NULL 16 100.00 Using where
3 RECURSIVE UNION b ALL NULL NULL NULL NULL 16 100.00 Using where
3 RECURSIVE UNION <derived2> ref key0 key0 35 test.b.departure 2 100.00
4 DEPENDENT SUBQUERY <derived2> ALL NULL NULL NULL NULL 16 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 with recursive destinations as (/* select#2 */ select `test`.`a`.`arrival` AS `city`,1 AS `legs` from `test`.`flights` `a` where `test`.`a`.`departure` = 'Cairo' union /* select#3 */ select `test`.`b`.`arrival` AS `arrival`,`r`.`legs` + 1 AS `r.legs + 1` from `destinations` `r` join `test`.`flights` `b` where `r`.`city` = `test`.`b`.`departure` and !<in_optimizer>(`test`.`b`.`arrival`,<exists>(/* select#4 */ select `destinations`.`city` from `destinations` where trigcond(`test`.`b`.`arrival` = `destinations`.`city` or `destinations`.`city` is null) having trigcond(`destinations`.`city` is null))))/* select#1 */ select `destinations`.`city` AS `city`,`destinations`.`legs` AS `legs` from `destinations`
set standard_compliant_cte=default;
drop table flights;
#
# MDEV-14217 [db crash] Recursive CTE when SELECT includes new field # MDEV-14217 [db crash] Recursive CTE when SELECT includes new field
# #
CREATE TEMPORARY TABLE a_tbl ( CREATE TEMPORARY TABLE a_tbl (

View File

@ -8824,6 +8824,70 @@ EXPLAIN
} }
drop table t1; drop table t1;
# #
# MDEV-13454: consequence of mdev-14368 fixed for 5.5
#
SET sql_mode = 'ONLY_FULL_GROUP_BY';
create table t1 (id int, id2 int);
insert into t1 values (1,1),(2,3),(3,4),(7,2);
create table t2(id2 int);
insert t2 values (1),(2),(3);
SELECT * FROM t1
LEFT OUTER JOIN
(SELECT id2, COUNT(*) as ct FROM t2 GROUP BY id2) vc USING (id2)
WHERE (vc.ct>0);
id2 id ct
1 1 1
3 2 1
2 7 1
EXPLAIN FORMAT=JSON SELECT * FROM t1
LEFT OUTER JOIN
(SELECT id2, COUNT(*) as ct FROM t2 GROUP BY id2) vc USING (id2)
WHERE (vc.ct>0);
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "vc.ct > 0",
"materialized": {
"query_block": {
"select_id": 2,
"having_condition": "ct > 0",
"filesort": {
"sort_key": "t2.id2",
"temporary_table": {
"table": {
"table_name": "t2",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
},
"block-nl-join": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 4,
"filtered": 100
},
"buffer_type": "flat",
"buffer_size": "256Kb",
"join_type": "BNL",
"attached_condition": "t1.id2 = vc.id2"
}
}
}
DROP TABLE t1,t2;
SET sql_mode = DEFAULT;
#
# MDEV-10855: Pushdown into derived with window functions # MDEV-10855: Pushdown into derived with window functions
# #
set @save_optimizer_switch= @@optimizer_switch; set @save_optimizer_switch= @@optimizer_switch;

View File

@ -7214,6 +7214,32 @@ NULL
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
# #
drop table t1, t2; drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
# End of 10.0 tests # End of 10.0 tests
# #
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View File

@ -7214,6 +7214,32 @@ NULL
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
# #
drop table t1, t2; drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
# End of 10.0 tests # End of 10.0 tests
# #
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View File

@ -7207,6 +7207,32 @@ NULL
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
# #
drop table t1, t2; drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
# End of 10.0 tests # End of 10.0 tests
# #
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View File

@ -7205,6 +7205,32 @@ NULL
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
# #
drop table t1, t2; drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
# End of 10.0 tests # End of 10.0 tests
# #
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View File

@ -7220,6 +7220,32 @@ NULL
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
# #
drop table t1, t2; drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
# End of 10.0 tests # End of 10.0 tests
# #
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View File

@ -7205,6 +7205,32 @@ NULL
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2; # SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
# #
drop table t1, t2; drop table t1, t2;
#
# MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
# (5.5 test)
#
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
a
5
5
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
End of 5.5 tests
# End of 10.0 tests # End of 10.0 tests
# #
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops # MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View File

@ -17,6 +17,13 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
# empty redo log from before MariaDB 10.2.2
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum # redo log from "after" MariaDB 10.2.2, but with invalid header checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
@ -28,7 +35,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html/ in mysqld.1.err FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\./ in mysqld.1.err
# valid header, but old-format checkpoint blocks # valid header, but old-format checkpoint blocks
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
@ -86,12 +93,26 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
# missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT # 10.2 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
NOT FOUND /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42$/ in mysqld.1.err FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
# 10.3 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
FOUND 1 /Downgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1/ in mysqld.1.err
# Empty 10.3 redo log
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 1 /InnoDB: Downgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log # Minimal MariaDB 10.1.21 encrypted redo log
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');

View File

@ -8,21 +8,15 @@ PRIMARY KEY(id)
INSERT INTO t1 VALUES(1), (2), (3); INSERT INTO t1 VALUES(1), (2), (3);
BEGIN; BEGIN;
SELECT * FROM t1 WHERE id = 1 FOR UPDATE; SELECT * FROM t1 WHERE id = 1 FOR UPDATE;
id
1
connect con1,localhost,root,,; connect con1,localhost,root,,;
BEGIN; BEGIN;
SELECT * FROM t1 WHERE id = 2 FOR UPDATE; SELECT * FROM t1 WHERE id = 2 FOR UPDATE;
id
2
SELECT * FROM t1 WHERE id = 1 FOR UPDATE; SELECT * FROM t1 WHERE id = 1 FOR UPDATE;
connection default; connection default;
SELECT * FROM t1 WHERE id = 2 FOR UPDATE; SELECT * FROM t1 WHERE id = 2 FOR UPDATE;
connection con1; connection con1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ROLLBACK; ROLLBACK;
connection default; connection default;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ROLLBACK; ROLLBACK;
DROP TABLE t1; DROP TABLE t1;
disconnect con1; disconnect con1;

View File

@ -124,4 +124,4 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP PROCEDURE setcrash; DROP PROCEDURE setcrash;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/

View File

@ -124,4 +124,4 @@ DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP PROCEDURE setcrash; DROP PROCEDURE setcrash;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/

View File

@ -1,7 +1,7 @@
call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page."); call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
SET GLOBAL innodb_large_prefix = OFF; SET GLOBAL innodb_large_prefix = OFF;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# Test 1) Show the page size from Information Schema # Test 1) Show the page size from Information Schema
SELECT variable_value FROM information_schema.global_status SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_page_size'; WHERE LOWER(variable_name) = 'innodb_page_size';
@ -971,4 +971,4 @@ COL197 TEXT)
row_format=compact,ENGINE=INNODB; row_format=compact,ENGINE=INNODB;
ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/

View File

@ -470,8 +470,6 @@ ddl_online_create_index 0
ddl_pending_alter_table 0 ddl_pending_alter_table 0
ddl_sort_file_alter_table 0 ddl_sort_file_alter_table 0
ddl_log_file_alter_table 2 ddl_log_file_alter_table 2
connection con1;
disconnect con1;
connection default; connection default;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
@ -498,6 +496,25 @@ ERROR 42000: Duplicate key name 'c2h'
SET DEBUG_SYNC = 'RESET'; SET DEBUG_SYNC = 'RESET';
SET GLOBAL innodb_monitor_disable = module_ddl; SET GLOBAL innodb_monitor_disable = module_ddl;
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-13205 assertion !dict_index_is_online_ddl(index) upon ALTER TABLE
#
CREATE TABLE t1 (c VARCHAR(64)) ENGINE=InnoDB;
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL t1u_created WAIT_FOR dup_done';
ALTER TABLE t1 ADD UNIQUE(c);
connection con1;
SET DEBUG_SYNC = 'now WAIT_FOR t1u_created';
BEGIN;
INSERT INTO t1 VALUES('bar'),('bar');
SET DEBUG_SYNC = 'now SIGNAL dup_done';
connection default;
ERROR 23000: Duplicate entry 'bar' for key 'c'
SET DEBUG_SYNC = 'RESET';
disconnect con1;
CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 150 "Foreign key constraint is incorrectly formed")
DROP TABLE t2,t1;
SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig; SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
SET GLOBAL innodb_monitor_enable = default; SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default; SET GLOBAL innodb_monitor_disable = default;

View File

@ -0,0 +1,9 @@
call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.");
SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
BEGIN;
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
COMMIT;
SET SESSION debug_dbug="";
DROP TABLE t1;
FOUND 1 /InnoDB: Difficult to find free blocks / in mysqld.1.err

View File

@ -2360,13 +2360,13 @@ drop table t1;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
SET GLOBAL innodb_large_prefix=OFF; SET GLOBAL innodb_large_prefix=OFF;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create table t1 (v varchar(65530), key(v)); create table t1 (v varchar(65530), key(v));
Warnings: Warnings:
Warning 1071 Specified key was too long; max key length is 767 bytes Warning 1071 Specified key was too long; max key length is 767 bytes
SET GLOBAL innodb_large_prefix=default; SET GLOBAL innodb_large_prefix=default;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
drop table t1; drop table t1;
create table t1 (v varchar(65536)); create table t1 (v varchar(65536));
Warnings: Warnings:
@ -2534,7 +2534,7 @@ drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
SET GLOBAL innodb_large_prefix=OFF; SET GLOBAL innodb_large_prefix=OFF;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create table t1 (col1 varchar(768), index(col1)) create table t1 (col1 varchar(768), index(col1))
character set = latin1 engine = innodb; character set = latin1 engine = innodb;
Warnings: Warnings:
@ -2553,7 +2553,7 @@ Warnings:
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
SET GLOBAL innodb_large_prefix=default; SET GLOBAL innodb_large_prefix=default;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -2563,7 +2563,7 @@ t1 CREATE TABLE `t1` (
drop table t1, t2, t3, t4; drop table t1, t2, t3, t4;
set global innodb_large_prefix=OFF; set global innodb_large_prefix=OFF;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create table t1 (col1 varchar(768) primary key) create table t1 (col1 varchar(768) primary key)
character set = latin1 engine = innodb; character set = latin1 engine = innodb;
ERROR 42000: Specified key was too long; max key length is 767 bytes ERROR 42000: Specified key was too long; max key length is 767 bytes
@ -2579,7 +2579,7 @@ ERROR 42000: Specified key was too long; max key length is 767 bytes
SET sql_mode = default; SET sql_mode = default;
set global innodb_large_prefix=default; set global innodb_large_prefix=default;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE t1 CREATE TABLE t1
( (
id INT PRIMARY KEY id INT PRIMARY KEY

View File

@ -4,19 +4,19 @@ select @old_innodb_file_format_max;
Barracuda Barracuda
set global innodb_file_format_max = Barracuda; set global innodb_file_format_max = Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format_max; select @@innodb_file_format_max;
@@innodb_file_format_max @@innodb_file_format_max
Barracuda Barracuda
set global innodb_file_format_max = DEFAULT; set global innodb_file_format_max = DEFAULT;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format_max; select @@innodb_file_format_max;
@@innodb_file_format_max @@innodb_file_format_max
Antelope Antelope
set global innodb_file_format_max = @old_innodb_file_format_max; set global innodb_file_format_max = @old_innodb_file_format_max;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format_max; select @@innodb_file_format_max;
@@innodb_file_format_max @@innodb_file_format_max
Barracuda Barracuda
@ -29,4 +29,4 @@ ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'ON'
set global innodb_file_format_max = off; set global innodb_file_format_max = off;
ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'off' ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'off'
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/

View File

@ -9,10 +9,10 @@ select @@innodb_file_format_max;
Barracuda Barracuda
set global innodb_file_format=antelope; set global innodb_file_format=antelope;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format=barracuda; set global innodb_file_format=barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format=cheetah; set global innodb_file_format=cheetah;
ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'cheetah' ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'cheetah'
select @@innodb_file_format; select @@innodb_file_format;
@ -20,7 +20,7 @@ select @@innodb_file_format;
Barracuda Barracuda
set global innodb_file_format=default; set global innodb_file_format=default;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format; select @@innodb_file_format;
@@innodb_file_format @@innodb_file_format
Barracuda Barracuda
@ -33,10 +33,10 @@ select @@innodb_file_format;
Barracuda Barracuda
set global innodb_file_format_max=antelope; set global innodb_file_format_max=antelope;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format_max=barracuda; set global innodb_file_format_max=barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format_max=cheetah; set global innodb_file_format_max=cheetah;
ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah' ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'cheetah'
select @@innodb_file_format_max; select @@innodb_file_format_max;
@ -44,7 +44,7 @@ select @@innodb_file_format_max;
Barracuda Barracuda
set global innodb_file_format_max=default; set global innodb_file_format_max=default;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format_max; select @@innodb_file_format_max;
@@innodb_file_format_max @@innodb_file_format_max
Antelope Antelope
@ -57,10 +57,10 @@ select @@innodb_file_format_max;
Antelope Antelope
set global innodb_file_format_max=antelope; set global innodb_file_format_max=antelope;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format_check=off; set global innodb_file_format_check=off;
ERROR HY000: Variable 'innodb_file_format_check' is a read only variable ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/

View File

@ -1,6 +1,6 @@
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE worklog5743 ( CREATE TABLE worklog5743 (
col_1_text TEXT(4000) , col_2_text TEXT(4000) , col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
PRIMARY KEY (col_1_text(3072)) PRIMARY KEY (col_1_text(3072))
@ -89,4 +89,4 @@ col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
DROP TABLE worklog5743; DROP TABLE worklog5743;
SET GLOBAL innodb_large_prefix=1; SET GLOBAL innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/

View File

@ -17,6 +17,13 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and it appears corrupted/ in mysqld.1.err
# empty redo log from before MariaDB 10.2.2
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 1 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# redo log from "after" MariaDB 10.2.2, but with invalid header checksum # redo log from "after" MariaDB 10.2.2, but with invalid header checksum
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
@ -28,7 +35,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html/ in mysqld.1.err FOUND 1 /InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\./ in mysqld.1.err
# valid header, but old-format checkpoint blocks # valid header, but old-format checkpoint blocks
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
@ -86,12 +93,26 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err FOUND 1 /InnoDB: MLOG_FILE_NAME incorrect:bigot/ in mysqld.1.err
FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err FOUND 1 /len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;/ in mysqld.1.err
# missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT # 10.2 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED'); AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
NOT FOUND /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42$/ in mysqld.1.err FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
# 10.3 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42/ in mysqld.1.err
FOUND 1 /Downgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1/ in mysqld.1.err
# Empty 10.3 redo log
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 1 /InnoDB: Downgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log # Minimal MariaDB 10.1.21 encrypted redo log
SELECT * FROM INFORMATION_SCHEMA.ENGINES SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb' WHERE engine = 'innodb'

View File

@ -18,6 +18,8 @@ CREATE TABLE t1(
INSERT INTO t1 VALUES(1), (2), (3); INSERT INTO t1 VALUES(1), (2), (3);
# We are not interested query results, only errors
--disable_result_log
BEGIN; BEGIN;
SELECT * FROM t1 WHERE id = 1 FOR UPDATE; SELECT * FROM t1 WHERE id = 1 FOR UPDATE;
@ -39,12 +41,22 @@ reap;
ROLLBACK; ROLLBACK;
#
# Note here that con1 is the older transaction as it
# query started wait first. Thus, con1 gets lock
# wait timeout first. There is possibility that
# default connection gets lock timeout also or
# as con1 is rolled back it gets the locks it waited
# and does the update.
#
connection default; connection default;
--error ER_LOCK_WAIT_TIMEOUT --error 0,ER_LOCK_WAIT_TIMEOUT
reap; reap;
ROLLBACK; ROLLBACK;
--enable_result_log
DROP TABLE t1; DROP TABLE t1;
disconnect con1; disconnect con1;

View File

@ -457,8 +457,6 @@ connection default;
reap; reap;
--enable_parsing --enable_parsing
#remove below con1 disconnect if above test case is enabled #remove below con1 disconnect if above test case is enabled
connection con1;
disconnect con1;
connection default; connection default;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
@ -474,6 +472,31 @@ SET GLOBAL innodb_monitor_disable = module_ddl;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-13205 assertion !dict_index_is_online_ddl(index) upon ALTER TABLE
--echo #
CREATE TABLE t1 (c VARCHAR(64)) ENGINE=InnoDB;
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL t1u_created WAIT_FOR dup_done';
send ALTER TABLE t1 ADD UNIQUE(c);
connection con1;
SET DEBUG_SYNC = 'now WAIT_FOR t1u_created';
BEGIN;
INSERT INTO t1 VALUES('bar'),('bar');
SET DEBUG_SYNC = 'now SIGNAL dup_done';
connection default;
--error ER_DUP_ENTRY
reap;
SET DEBUG_SYNC = 'RESET';
disconnect con1;
CREATE TABLE t2 (c VARCHAR(64)) ENGINE=InnoDB;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
--error ER_CANT_CREATE_TABLE
ALTER TABLE t2 ADD FOREIGN KEY (c) REFERENCES t1 (c);
DROP TABLE t2,t1;
# Check that all connections opened by test cases in this file are really # Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence. # gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc

View File

@ -0,0 +1,24 @@
--source include/have_innodb.inc
--source include/have_debug.inc
call mtr.add_suppression("\\[Warning\\] InnoDB: Difficult to find free blocks in the buffer pool.");
SET SESSION debug_dbug="+d,ib_lru_force_no_free_page";
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB;
BEGIN;
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
COMMIT;
SET SESSION debug_dbug="";
DROP TABLE t1;
#
# There should be only one message
#
let SEARCH_RANGE= -50000;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
--let SEARCH_PATTERN=InnoDB: Difficult to find free blocks
--source include/search_pattern_in_file.inc

View File

@ -2,3 +2,5 @@
--default-storage-engine=MyISAM --default-storage-engine=MyISAM
--innodb-strict-mode=0 --innodb-strict-mode=0
--innodb-file-per-table=0 --innodb-file-per-table=0
--loose-innodb-track-changed-pages
--loose-innodb-log-archive

View File

@ -8,12 +8,10 @@
-- source include/not_encrypted.inc -- source include/not_encrypted.inc
--disable_query_log --disable_query_log
call mtr.add_suppression("InnoDB: Table `test`.`t1` is corrupted. Please drop the table and recreate."); call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted\\. Please drop the table and recreate\\.");
call mtr.add_suppression("InnoDB: Cannot open table test/t1 from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue."); call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \[page id: space=[0-9]+, page number=[0-9]+\]. You may have to recover from a backup."); call mtr.add_suppression("InnoDB: We detected index corruption in an InnoDB type table");
call mtr.add_suppression("InnoDB: We detected index corruption in an InnoDB type table.*"); call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
call mtr.add_suppression("mysqld: Index for table 't1' is corrupt; try to repair it");
call mtr.add_suppression("mysqld.exe: Index for table 't1' is corrupt; try to repair it");
--enable_query_log --enable_query_log
--echo # Create and populate the table to be corrupted --echo # Create and populate the table to be corrupted

View File

@ -2,7 +2,7 @@
--source include/have_innodb_16k.inc --source include/have_innodb_16k.inc
--disable_query_log --disable_query_log
call mtr.add_suppression("InnoDB: Upgrade after a crash is not supported"); call mtr.add_suppression("InnoDB: (Up|Down)grade after a crash is not supported");
call mtr.add_suppression("InnoDB: Plugin initialization aborted"); call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error"); 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("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
@ -16,6 +16,7 @@ call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\\r?$"); call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\\r?$");
call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed"); call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed");
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed"); call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfiles to start up the database\\? Log sequence number in the ib_logfiles is 1213964,");
--enable_query_log --enable_query_log
let bugdir= $MYSQLTEST_VARDIR/tmp/log_corruption; let bugdir= $MYSQLTEST_VARDIR/tmp/log_corruption;
@ -140,6 +141,24 @@ eval $check_no_innodb;
let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\\.2\\.2, and it appears corrupted; let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\\.2\\.2, and it appears corrupted;
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
--echo # empty redo log from before MariaDB 10.2.2
perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
binmode OUT;
die unless seek(OUT, 0x800, 0);
print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 0, 0xb2a);
close OUT or die;
EOF
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=1m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
--source include/search_pattern_in_file.inc
--let $restart_parameters= $dirs
--echo # redo log from "after" MariaDB 10.2.2, but with invalid header checksum --echo # redo log from "after" MariaDB 10.2.2, but with invalid header checksum
perl; perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0"; die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
@ -165,7 +184,7 @@ EOF
--source include/start_mysqld.inc --source include/start_mysqld.inc
eval $check_no_innodb; eval $check_no_innodb;
--source include/shutdown_mysqld.inc --source include/shutdown_mysqld.inc
let SEARCH_PATTERN=InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading-downgrading.html; let SEARCH_PATTERN=InnoDB: Unsupported redo log format. The redo log was created with malicious intentions, or perhaps\.;
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
--echo # valid header, but old-format checkpoint blocks --echo # valid header, but old-format checkpoint blocks
@ -321,7 +340,7 @@ let SEARCH_PATTERN=InnoDB: MLOG_FILE_NAME incorrect:bigot;
--let SEARCH_PATTERN= len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ; --let SEARCH_PATTERN= len 22; hex 38000000000012860cb7809781e800066269676f7400; asc 8 bigot ;
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
--echo # missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT --echo # 10.2 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
perl; perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0"; die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
binmode OUT; binmode OUT;
@ -349,7 +368,42 @@ EOF
--source include/start_mysqld.inc --source include/start_mysqld.inc
eval $check_no_innodb; eval $check_no_innodb;
--source include/shutdown_mysqld.inc --source include/shutdown_mysqld.inc
--let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\$ --let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42
--source include/search_pattern_in_file.inc
--echo # 10.3 missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT
perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
binmode OUT;
print OUT pack("Nx[5]nx[5]", 103, 0x1286), "MariaDB 10.3.1";
print OUT pack("x[478]N", 0x85021a0f);
close OUT or die;
EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
--let SEARCH_PATTERN= InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= Downgrade after a crash is not supported\. The redo log was created with MariaDB 10\.3\.1
--source include/search_pattern_in_file.inc
--echo # Empty 10.3 redo log
perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
binmode OUT;
die unless seek(OUT, 0x800, 0);
print OUT pack("NnnNx[496]N", 0x80000944, 12, 12, 1, 0x46c8a2a2);
close OUT or die;
EOF
--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=1m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
--let SEARCH_PATTERN= InnoDB: Downgrading redo log:
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
--echo # Minimal MariaDB 10.1.21 encrypted redo log --echo # Minimal MariaDB 10.1.21 encrypted redo log

View File

@ -284,7 +284,7 @@ Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_file_format = `Antelope`; SET GLOBAL innodb_file_format = `Antelope`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8; CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
Got one of the listed errors Got one of the listed errors
SHOW WARNINGS; SHOW WARNINGS;
@ -301,7 +301,7 @@ Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# Test 7) This series of tests were moved from innodb-index to here # Test 7) This series of tests were moved from innodb-index to here
# because the second alter table t1 assumes a 16k page size. # because the second alter table t1 assumes a 16k page size.
# Moving the test allows the rest of innodb-index to be run on all # Moving the test allows the rest of innodb-index to be run on all

View File

@ -247,7 +247,7 @@ Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_file_format = `Antelope`; SET GLOBAL innodb_file_format = `Antelope`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8; CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options") ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS; SHOW WARNINGS;
@ -266,7 +266,7 @@ Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# Test 7) Not included here; 16k only # Test 7) Not included here; 16k only
# Test 8) Test creating a table that could lead to undo log overflow. # Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,

View File

@ -259,7 +259,7 @@ Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON; SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_file_format = `Antelope`; SET GLOBAL innodb_file_format = `Antelope`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8; CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options") ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS; SHOW WARNINGS;
@ -277,7 +277,7 @@ Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_format = `Barracuda`; SET GLOBAL innodb_file_format = `Barracuda`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# Test 7) Not included here; 16k only # Test 7) Not included here; 16k only
# Test 8) Test creating a table that could lead to undo log overflow. # Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,

View File

@ -1,7 +1,7 @@
SET default_storage_engine=InnoDB; SET default_storage_engine=InnoDB;
SET GLOBAL innodb_file_format=`Barracuda`; SET GLOBAL innodb_file_format=`Barracuda`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_per_table=ON;
SET SESSION innodb_strict_mode = ON; SET SESSION innodb_strict_mode = ON;
# Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0 # Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
@ -264,7 +264,7 @@ Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
# and that they can be set to default values during strict mode. # and that they can be set to default values during strict mode.
SET GLOBAL innodb_file_format=Antelope; SET GLOBAL innodb_file_format=Antelope;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4; CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
Got one of the listed errors Got one of the listed errors
SHOW WARNINGS; SHOW WARNINGS;
@ -318,12 +318,12 @@ Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SET GLOBAL innodb_file_format=Barracuda; SET GLOBAL innodb_file_format=Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SET GLOBAL innodb_file_format=Antelope; SET GLOBAL innodb_file_format=Antelope;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f1 INT; ALTER TABLE t1 ADD COLUMN f1 INT;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT'
SHOW WARNINGS; SHOW WARNINGS;
@ -344,7 +344,7 @@ SHOW WARNINGS;
Level Code Message Level Code Message
SET GLOBAL innodb_file_format=Barracuda; SET GLOBAL innodb_file_format=Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
# Test 8) StrictMode=ON, Make sure ROW_FORMAT=COMPRESSED # Test 8) StrictMode=ON, Make sure ROW_FORMAT=COMPRESSED
# and a valid non-zero KEY_BLOCK_SIZE are rejected with # and a valid non-zero KEY_BLOCK_SIZE are rejected with
# innodb_file_per_table=OFF and that they can be set to default # innodb_file_per_table=OFF and that they can be set to default
@ -754,7 +754,7 @@ TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=1 t1 Compressed row_format=COMPRESSED key_block_size=1
SET GLOBAL innodb_file_format=Antelope; SET GLOBAL innodb_file_format=Antelope;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f1 INT; ALTER TABLE t1 ADD COLUMN f1 INT;
Warnings: Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
@ -772,7 +772,7 @@ TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=COMPRESSED key_block_size=1 t1 Dynamic row_format=COMPRESSED key_block_size=1
SET GLOBAL innodb_file_format=Barracuda; SET GLOBAL innodb_file_format=Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f2 INT; ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
@ -788,7 +788,7 @@ TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_format=Antelope; SET GLOBAL innodb_file_format=Antelope;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f1 INT; ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
@ -797,7 +797,7 @@ TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_format=Barracuda; SET GLOBAL innodb_file_format=Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
ALTER TABLE t1 ADD COLUMN f2 INT; ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
@ -852,4 +852,4 @@ t1 Dynamic row_format=DYNAMIC
# Cleanup # Cleanup
DROP TABLE t1; DROP TABLE t1;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/

View File

@ -96,7 +96,7 @@ create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16; create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16;
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_1(a2(4000)); create index idx1 on worklog5743_1(a2(4000));
Got one of the listed errors Got one of the listed errors
show warnings; show warnings;
@ -105,7 +105,7 @@ Note 1071 Specified key was too long; max key length is 767 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_1(a2(4000)); create index idx2 on worklog5743_1(a2(4000));
Got one of the listed errors Got one of the listed errors
show warnings; show warnings;
@ -130,7 +130,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET sql_mode= ''; SET sql_mode= '';
create index idx1 on worklog5743_2(a2(4000)); create index idx1 on worklog5743_2(a2(4000));
Warnings: Warnings:
@ -140,7 +140,7 @@ Level Code Message
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_2(a2(4000)); create index idx2 on worklog5743_2(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings; show warnings;
@ -165,7 +165,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_4(a2(4000)); create index idx1 on worklog5743_4(a2(4000));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
@ -174,7 +174,7 @@ Level Code Message
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_4(a2(4000)); create index idx2 on worklog5743_4(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings; show warnings;
@ -199,7 +199,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_8(a2(1000)); create index idx1 on worklog5743_8(a2(1000));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
@ -208,7 +208,7 @@ Level Code Message
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_8(a2(3073)); create index idx2 on worklog5743_8(a2(3073));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 3072 bytes Note 1071 Specified key was too long; max key length is 3072 bytes
@ -239,7 +239,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_16(a2(1000)); create index idx1 on worklog5743_16(a2(1000));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
@ -248,7 +248,7 @@ Level Code Message
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_16(a2(3073)); create index idx2 on worklog5743_16(a2(3073));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 3072 bytes Note 1071 Specified key was too long; max key length is 3072 bytes
@ -285,7 +285,7 @@ insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000)); insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000));
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
insert into worklog5743_1 values(2, repeat("b", 10000)); insert into worklog5743_1 values(2, repeat("b", 10000));
insert into worklog5743_2 values(2, repeat("b", 10000)); insert into worklog5743_2 values(2, repeat("b", 10000));
insert into worklog5743_4 values(2, repeat("b", 10000)); insert into worklog5743_4 values(2, repeat("b", 10000));
@ -293,7 +293,7 @@ insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000)); insert into worklog5743_16 values(2, repeat("b", 10000), repeat("b", 10000));
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select a1, left(a2, 20) from worklog5743_1; select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20) a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa 9 aaaaaaaaaaaaaaaaaaaa

View File

@ -99,7 +99,7 @@ create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2;
create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_1(a2(4000)); create index idx1 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings; show warnings;
@ -124,7 +124,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET sql_mode= ''; SET sql_mode= '';
create index idx1 on worklog5743_2(a2(4000)); create index idx1 on worklog5743_2(a2(4000));
Warnings: Warnings:
@ -161,7 +161,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_4(a2(4000)); create index idx1 on worklog5743_4(a2(4000));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
@ -201,13 +201,13 @@ insert into worklog5743_2 values(9, repeat("a", 10000));
insert into worklog5743_4 values(9, repeat("a", 10000)); insert into worklog5743_4 values(9, repeat("a", 10000));
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
insert into worklog5743_1 values(2, repeat("b", 10000)); insert into worklog5743_1 values(2, repeat("b", 10000));
insert into worklog5743_2 values(2, repeat("b", 10000)); insert into worklog5743_2 values(2, repeat("b", 10000));
insert into worklog5743_4 values(2, repeat("b", 10000)); insert into worklog5743_4 values(2, repeat("b", 10000));
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select a1, left(a2, 20) from worklog5743_1; select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20) a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa 9 aaaaaaaaaaaaaaaaaaaa

View File

@ -100,7 +100,7 @@ create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4;
create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8; create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8;
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_1(a2(4000)); create index idx1 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings; show warnings;
@ -109,7 +109,7 @@ Note 1071 Specified key was too long; max key length is 767 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_1(a2(4000)); create index idx2 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings; show warnings;
@ -134,7 +134,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET sql_mode= ''; SET sql_mode= '';
create index idx1 on worklog5743_2(a2(4000)); create index idx1 on worklog5743_2(a2(4000));
Warnings: Warnings:
@ -144,7 +144,7 @@ Level Code Message
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_2(a2(4000)); create index idx2 on worklog5743_2(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings; show warnings;
@ -169,7 +169,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_4(a2(4000)); create index idx1 on worklog5743_4(a2(4000));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
@ -178,7 +178,7 @@ Level Code Message
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx3 on worklog5743_4(a2(1537)); create index idx3 on worklog5743_4(a2(1537));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 1536 bytes Note 1071 Specified key was too long; max key length is 1536 bytes
@ -201,7 +201,7 @@ show warnings;
Level Code Message Level Code Message
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx1 on worklog5743_8(a2(1000)); create index idx1 on worklog5743_8(a2(1000));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
@ -210,7 +210,7 @@ Level Code Message
Note 1071 Specified key was too long; max key length is 767 bytes Note 1071 Specified key was too long; max key length is 767 bytes
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create index idx2 on worklog5743_8(a2(3073)); create index idx2 on worklog5743_8(a2(3073));
Warnings: Warnings:
Note 1071 Specified key was too long; max key length is 1536 bytes Note 1071 Specified key was too long; max key length is 1536 bytes
@ -238,14 +238,14 @@ insert into worklog5743_4 values(9, repeat("a", 10000));
insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000)); insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000));
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
insert into worklog5743_1 values(2, repeat("b", 10000)); insert into worklog5743_1 values(2, repeat("b", 10000));
insert into worklog5743_2 values(2, repeat("b", 10000)); insert into worklog5743_2 values(2, repeat("b", 10000));
insert into worklog5743_4 values(2, repeat("b", 10000)); insert into worklog5743_4 values(2, repeat("b", 10000));
insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000)); insert into worklog5743_8 values(2, repeat("b", 10000), repeat("b", 10000));
set global innodb_large_prefix=1; set global innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select a1, left(a2, 20) from worklog5743_1; select a1, left(a2, 20) from worklog5743_1;
a1 left(a2, 20) a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa 9 aaaaaaaaaaaaaaaaaaaa

View File

@ -9,7 +9,7 @@ set session innodb_strict_mode=0;
set global innodb_file_per_table=off; set global innodb_file_per_table=off;
set global innodb_file_format=`0`; set global innodb_file_format=`0`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SET @@global.innodb_stats_on_metadata=ON; SET @@global.innodb_stats_on_metadata=ON;
create table t0(a int primary key) engine=innodb row_format=compressed; create table t0(a int primary key) engine=innodb row_format=compressed;
Warnings: Warnings:
@ -45,7 +45,7 @@ Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1. Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
set global innodb_file_format=`1`; set global innodb_file_format=`1`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create table t7(a int primary key) engine=innodb create table t7(a int primary key) engine=innodb
key_block_size=1 row_format=redundant; key_block_size=1 row_format=redundant;
Warnings: Warnings:
@ -161,13 +161,13 @@ update t1 set c3 = repeat('E', 20000) where c1 = 1;
drop table t1; drop table t1;
set global innodb_file_format=`0`; set global innodb_file_format=`0`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format; select @@innodb_file_format;
@@innodb_file_format @@innodb_file_format
Antelope Antelope
set global innodb_file_format=`1`; set global innodb_file_format=`1`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format; select @@innodb_file_format;
@@innodb_file_format @@innodb_file_format
Barracuda Barracuda
@ -177,10 +177,10 @@ set global innodb_file_format=`-1`;
ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '-1' ERROR 42000: Variable 'innodb_file_format' can't be set to the value of '-1'
set global innodb_file_format=`Antelope`; set global innodb_file_format=`Antelope`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format=`Barracuda`; set global innodb_file_format=`Barracuda`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format=`Cheetah`; set global innodb_file_format=`Cheetah`;
ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Cheetah' ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Cheetah'
set global innodb_file_format=`abc`; set global innodb_file_format=`abc`;
@ -192,7 +192,7 @@ ERROR 42000: Variable 'innodb_file_format' can't be set to the value of ''
set global innodb_file_per_table = on; set global innodb_file_per_table = on;
set global innodb_file_format = `1`; set global innodb_file_format = `1`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set innodb_strict_mode = off; set innodb_strict_mode = off;
create table t1 (id int primary key) engine = innodb key_block_size = 0; create table t1 (id int primary key) engine = innodb key_block_size = 0;
drop table t1; drop table t1;
@ -328,7 +328,7 @@ drop table t7, t8, t9;
set global innodb_file_per_table = on; set global innodb_file_per_table = on;
set global innodb_file_format = `0`; set global innodb_file_format = `0`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create table t1 (id int primary key) engine = innodb key_block_size = 1; create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options") ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options")
show warnings; show warnings;
@ -374,14 +374,14 @@ drop table t8, t9;
set global innodb_file_per_table=1; set global innodb_file_per_table=1;
set global innodb_file_format=Barracuda; set global innodb_file_format=Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_per_table=on; set global innodb_file_per_table=on;
set global innodb_file_format=`Barracuda`; set global innodb_file_format=`Barracuda`;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_format_max=`Antelope`; set global innodb_file_format_max=`Antelope`;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
create table normal_table ( create table normal_table (
c1 int c1 int
) engine = innodb; ) engine = innodb;
@ -396,7 +396,7 @@ select @@innodb_file_format_max;
Barracuda Barracuda
set global innodb_file_format_max=`Antelope`; set global innodb_file_format_max=`Antelope`;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@innodb_file_format_max; select @@innodb_file_format_max;
@@innodb_file_format_max @@innodb_file_format_max
Antelope Antelope

View File

@ -111,7 +111,7 @@ drop procedure populate;
drop procedure populate_small; drop procedure populate_small;
set global innodb_file_format = Barracuda; set global innodb_file_format = Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_per_table = 1; set global innodb_file_per_table = 1;
set innodb_strict_mode=OFF; set innodb_strict_mode=OFF;
create procedure populate() create procedure populate()
@ -224,7 +224,7 @@ drop procedure populate;
drop procedure populate_small; drop procedure populate_small;
set global innodb_file_format = Barracuda; set global innodb_file_format = Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_per_table = 1; set global innodb_file_per_table = 1;
set innodb_strict_mode=OFF; set innodb_strict_mode=OFF;
create procedure populate() create procedure populate()
@ -341,5 +341,5 @@ drop procedure populate;
drop procedure populate_small; drop procedure populate_small;
set global innodb_file_format = Barracuda; set global innodb_file_format = Barracuda;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
set global innodb_file_per_table = 1; set global innodb_file_per_table = 1;

View File

@ -0,0 +1,6 @@
--innodb-encrypt-log=ON
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--loose-file-key-management
--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/filekeys-data.key
--loose-file-key-management-filename=$MTR_SUITE_DIR/filekeys-data.enc
--loose-file-key-management-encryption-algorithm=aes_cbc

View File

@ -1,10 +1,11 @@
# #
# MDEV-13416 mariabackup fails with EFAULT "Bad Address" # MDEV-13416 mariabackup fails with EFAULT "Bad Address"
# #
FOUND 1 /InnoDB: 5\.7\.\d+ started; log sequence number 17592186044428/ in mysqld.1.err FOUND 1 /InnoDB: New log files created, LSN=175964\d{8}/ in mysqld.1.err
CREATE TABLE t(i INT) ENGINE INNODB; CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1); INSERT INTO t VALUES(1);
# xtrabackup backup # xtrabackup backup
SET GLOBAL innodb_flush_log_at_trx_commit=1;
INSERT INTO t VALUES(2); INSERT INTO t VALUES(2);
# xtrabackup prepare # xtrabackup prepare
# shutdown server # shutdown server

View File

@ -1,4 +1,5 @@
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_file_key_management.inc
--echo # --echo #
--echo # MDEV-13416 mariabackup fails with EFAULT "Bad Address" --echo # MDEV-13416 mariabackup fails with EFAULT "Bad Address"
@ -16,7 +17,7 @@ binmode FILE;
my $ps= $ENV{INNODB_PAGE_SIZE}; my $ps= $ENV{INNODB_PAGE_SIZE};
my $page; my $page;
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps; die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
substr($page,26,8) = pack("NN", 4096, 0); substr($page,26,8) = pack("NN", 4096, ~1024);
substr($page,0,4)=pack("N",0xdeadbeef); substr($page,0,4)=pack("N",0xdeadbeef);
substr($page,$ps-8,4)=pack("N",0xdeadbeef); substr($page,$ps-8,4)=pack("N",0xdeadbeef);
sysseek(FILE, 0, 0) || die "Unable to rewind $file\n"; sysseek(FILE, 0, 0) || die "Unable to rewind $file\n";
@ -27,8 +28,9 @@ EOF
--remove_files_wildcard $MYSQLD_DATADIR ib_logfile* --remove_files_wildcard $MYSQLD_DATADIR ib_logfile*
--source include/start_mysqld.inc --source include/start_mysqld.inc
let SEARCH_RANGE= -50000;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
--let SEARCH_PATTERN= InnoDB: 5\.7\.\d+ started; log sequence number 17592186044428 --let SEARCH_PATTERN= InnoDB: New log files created, LSN=175964\d{8}
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
CREATE TABLE t(i INT) ENGINE INNODB; CREATE TABLE t(i INT) ENGINE INNODB;
@ -39,6 +41,7 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--disable_result_log --disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
--enable_result_log --enable_result_log
SET GLOBAL innodb_flush_log_at_trx_commit=1;
INSERT INTO t VALUES(2); INSERT INTO t VALUES(2);
echo # xtrabackup prepare; echo # xtrabackup prepare;
--disable_result_log --disable_result_log

View File

@ -25,7 +25,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_FILE_FORMAT Barracuda INNODB_FILE_FORMAT Barracuda
set global innodb_file_format='Antelope'; set global innodb_file_format='Antelope';
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@global.innodb_file_format; select @@global.innodb_file_format;
@@global.innodb_file_format @@global.innodb_file_format
Antelope Antelope
@ -37,7 +37,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_FILE_FORMAT Antelope INNODB_FILE_FORMAT Antelope
set @@global.innodb_file_format='Barracuda'; set @@global.innodb_file_format='Barracuda';
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@global.innodb_file_format; select @@global.innodb_file_format;
@@global.innodb_file_format @@global.innodb_file_format
Barracuda Barracuda
@ -59,7 +59,7 @@ set global innodb_file_format='Salmon';
ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Salmon' ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Salmon'
SET @@global.innodb_file_format = @start_global_value; SET @@global.innodb_file_format = @start_global_value;
Warnings: Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SELECT @@global.innodb_file_format; SELECT @@global.innodb_file_format;
@@global.innodb_file_format @@global.innodb_file_format
Barracuda Barracuda

View File

@ -27,7 +27,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_FILE_FORMAT_MAX Barracuda INNODB_FILE_FORMAT_MAX Barracuda
SET global innodb_file_format_max='Antelope'; SET global innodb_file_format_max='Antelope';
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SELECT @@global.innodb_file_format_max; SELECT @@global.innodb_file_format_max;
@@global.innodb_file_format_max @@global.innodb_file_format_max
Antelope Antelope
@ -41,7 +41,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_FILE_FORMAT_MAX Antelope INNODB_FILE_FORMAT_MAX Antelope
SET @@global.innodb_file_format_max='Barracuda'; SET @@global.innodb_file_format_max='Barracuda';
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SELECT @@global.innodb_file_format_max; SELECT @@global.innodb_file_format_max;
@@global.innodb_file_format_max @@global.innodb_file_format_max
Barracuda Barracuda
@ -65,7 +65,7 @@ SET global innodb_file_format_max='Salmon';
ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon' ERROR 42000: Variable 'innodb_file_format_max' can't be set to the value of 'Salmon'
SET @@global.innodb_file_format_max = @start_global_value; SET @@global.innodb_file_format_max = @start_global_value;
Warnings: Warnings:
Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_file_format_max is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SELECT @@global.innodb_file_format_max; SELECT @@global.innodb_file_format_max;
@@global.innodb_file_format_max @@global.innodb_file_format_max
Barracuda Barracuda

View File

@ -25,7 +25,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON INNODB_LARGE_PREFIX ON
set global innodb_large_prefix='OFF'; set global innodb_large_prefix='OFF';
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@global.innodb_large_prefix; select @@global.innodb_large_prefix;
@@global.innodb_large_prefix @@global.innodb_large_prefix
0 0
@ -37,7 +37,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF INNODB_LARGE_PREFIX OFF
set @@global.innodb_large_prefix=1; set @@global.innodb_large_prefix=1;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@global.innodb_large_prefix; select @@global.innodb_large_prefix;
@@global.innodb_large_prefix @@global.innodb_large_prefix
1 1
@ -49,7 +49,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX ON INNODB_LARGE_PREFIX ON
set global innodb_large_prefix=0; set global innodb_large_prefix=0;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@global.innodb_large_prefix; select @@global.innodb_large_prefix;
@@global.innodb_large_prefix @@global.innodb_large_prefix
0 0
@ -61,7 +61,7 @@ VARIABLE_NAME VARIABLE_VALUE
INNODB_LARGE_PREFIX OFF INNODB_LARGE_PREFIX OFF
set @@global.innodb_large_prefix='ON'; set @@global.innodb_large_prefix='ON';
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
select @@global.innodb_large_prefix; select @@global.innodb_large_prefix;
@@global.innodb_large_prefix @@global.innodb_large_prefix
1 1
@ -96,7 +96,7 @@ set global innodb_large_prefix='AUTO';
ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO' ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of 'AUTO'
SET @@global.innodb_large_prefix = @start_global_value; SET @@global.innodb_large_prefix = @start_global_value;
Warnings: Warnings:
Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html Warning 131 Using innodb_large_prefix is deprecated and the parameter may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
SELECT @@global.innodb_large_prefix; SELECT @@global.innodb_large_prefix;
@@global.innodb_large_prefix @@global.innodb_large_prefix
1 1

View File

@ -853,3 +853,32 @@ execute stmt;
deallocate prepare stmt; deallocate prepare stmt;
drop table t1; drop table t1;
--echo #
--echo # MDEV-14852: CTE using temporary table in query
--echo # with two references to the CTE
--echo #
create temporary table t1 (i int);
insert into t1 values (5),(4),(1),(2),(3);
with
c1 as (select i from t1),
c2 as (select i from c1 where c1.i=2)
select i from c1 where i > 3 union select i from c2;
drop table t1;
create table t1 (term char(10));
create temporary table t2 (term char(10));
insert into t1 values ('TERM01'),('TERM02'),('TERM03');
insert into t2 values ('TERM02'),('TERM03'),('TERM04');
with c1 as (select * from t1), c2 as (select * from t2)
(select * from c1 left outer join c2 on c1.term = c2.term)
union all
(select * from c1 right outer join c2 on c1.term = c2.term
where c1.term is null);
drop table t1,t2;

View File

@ -1999,6 +1999,93 @@ set @var=
drop table t1; drop table t1;
--echo #
--echo # mdev-14777: crash caused by the same as in mdev-14755
--echo #
--source include/have_sequence.inc
CREATE TABLE t1 (i1 int NOT NULL, i2 int);
CREATE TABLE t2 (d1 int NOT NULL PRIMARY KEY);
CREATE TABLE t3 (i int );
insert into t1 select seq,seq from seq_1_to_100000;
insert into t2 select seq from seq_1000_to_100000;
insert into t3 select seq from seq_1_to_1000;
SELECT *
FROM
(
SELECT *
FROM
(
WITH RECURSIVE rt AS
(
SELECT i2 P, i1 C FROM t1 WHERE i1 IN (SELECT d1 FROM t2)
UNION
SELECT t1.i2 P, rt.C C FROM t1, rt
)
SELECT C,P
FROM ( SELECT P,C FROM rt WHERE NOT EXISTS (SELECT 1 FROM t1) ) Y
) X
WHERE 1 = 1
) K, t3;
drop table t1,t2,t3;
--echo #
--echo # mdev-14879: subquery with recursive reference in WHERE of CTE
--echo #
create table flights
(departure varchar(32),
arrival varchar(32),
carrier varchar(20),
flight_number char(7));
insert into flights values
('Seattle', 'Frankfurt', 'Lufthansa', 'LH 491'),
('Seattle', 'Chicago', 'American', 'AA 2573'),
('Seattle', 'Los Angeles', 'Alaska Air', 'AS 410'),
('Chicago', 'New York', 'American', 'AA 375'),
('Chicago', 'Montreal', 'Air Canada', 'AC 3053'),
('Los Angeles', 'New York', 'Delta', 'DL 1197'),
('Moscow', 'Tokyo', 'Aeroflot', 'SU 264'),
('New York', 'Paris', 'Air France', 'AF 23'),
('Frankfurt', 'Moscow', 'Lufthansa', 'LH 1444'),
('Tokyo', 'Seattle', 'ANA', 'NH 178'),
('Los Angeles', 'Tokyo', 'ANA', 'NH 175'),
('Moscow', 'Los Angeles', 'Aeroflot', 'SU 106'),
('Montreal', 'Paris', 'Air Canada', 'AC 870'),
('Cairo', 'Paris', 'Air France', 'AF 503'),
('New York', 'Seattle', 'American', 'AA 45'),
('Paris', 'Chicago', 'Air France', 'AF 6734');
with recursive destinations (city) as
( select a.arrival from flights a where a.departure='Cairo'
union
select b.arrival from destinations r, flights b where r.city=b.departure)
select * from destinations;
set standard_compliant_cte=0;
let $q=
with recursive destinations (city, legs) as
(
select a.arrival, 1 from flights a where a.departure='Cairo'
union
select b.arrival, r.legs + 1 from destinations r, flights b
where r.city=b.departure and b.arrival not in (select city from destinations)
)
select * from destinations;
eval $q;
eval explain extended $q;
set standard_compliant_cte=default;
drop table flights;
--echo # --echo #
--echo # MDEV-14217 [db crash] Recursive CTE when SELECT includes new field --echo # MDEV-14217 [db crash] Recursive CTE when SELECT includes new field
--echo # --echo #

View File

@ -1566,6 +1566,31 @@ eval explain format=json $q;
drop table t1; drop table t1;
--echo #
--echo # MDEV-13454: consequence of mdev-14368 fixed for 5.5
--echo #
SET sql_mode = 'ONLY_FULL_GROUP_BY';
create table t1 (id int, id2 int);
insert into t1 values (1,1),(2,3),(3,4),(7,2);
create table t2(id2 int);
insert t2 values (1),(2),(3);
let $q=
SELECT * FROM t1
LEFT OUTER JOIN
(SELECT id2, COUNT(*) as ct FROM t2 GROUP BY id2) vc USING (id2)
WHERE (vc.ct>0);
eval $q;
eval EXPLAIN FORMAT=JSON $q;
DROP TABLE t1,t2;
SET sql_mode = DEFAULT;
--echo # --echo #
--echo # MDEV-10855: Pushdown into derived with window functions --echo # MDEV-10855: Pushdown into derived with window functions
--echo # --echo #
@ -1851,4 +1876,3 @@ SELECT * FROM v3 JOIN t1 ON (bmax = b);
DROP VIEW v1,v2,v3; DROP VIEW v1,v2,v3;
DROP TABLE t1,t2; DROP TABLE t1,t2;

View File

@ -6078,6 +6078,33 @@ SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
--echo # --echo #
drop table t1, t2; drop table t1, t2;
--echo #
--echo # MDEV-13933: Wrong results in COUNT() query with EXISTS and exists_to_in
--echo # (5.5 test)
--echo #
SET @optimiser_switch_save= @@optimizer_switch;
CREATE TABLE t1 (a INT NOT NULL);
INSERT INTO t1 VALUES (1),(1),(1),(5),(5);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (5),(1);
CREATE TABLE t3 (c INT, KEY(c));
INSERT INTO t3 VALUES (5),(5);
SET optimizer_switch='semijoin=on';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
SET optimizer_switch='semijoin=off';
select t1.a from t1 where t1.a in (select `test`.`t2`.`b` from `test`.`t2`)
and t1.a in (select `test`.`t3`.`c` from `test`.`t3`);
SET @@optimizer_switch= @optimiser_switch_save;
DROP TABLE t1, t2, t3;
--echo End of 5.5 tests
--echo # End of 10.0 tests --echo # End of 10.0 tests
--echo # --echo #

View File

@ -2676,7 +2676,8 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
LooseScan detector in best_access_path) LooseScan detector in best_access_path)
*/ */
remaining_tables &= ~new_join_tab->table->map; remaining_tables &= ~new_join_tab->table->map;
table_map dups_producing_tables; table_map dups_producing_tables, prev_dups_producing_tables,
prev_sjm_lookup_tables;
if (idx == join->const_tables) if (idx == join->const_tables)
dups_producing_tables= 0; dups_producing_tables= 0;
@ -2687,7 +2688,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
if ((emb_sj_nest= new_join_tab->emb_sj_nest)) if ((emb_sj_nest= new_join_tab->emb_sj_nest))
dups_producing_tables |= emb_sj_nest->sj_inner_tables; dups_producing_tables |= emb_sj_nest->sj_inner_tables;
Semi_join_strategy_picker **strategy; Semi_join_strategy_picker **strategy, **prev_strategy;
if (idx == join->const_tables) if (idx == join->const_tables)
{ {
/* First table, initialize pickers */ /* First table, initialize pickers */
@ -2739,23 +2740,54 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx,
3. We have no clue what to do about fanount of semi-join Y. 3. We have no clue what to do about fanount of semi-join Y.
*/ */
if ((dups_producing_tables & handled_fanout) || if ((dups_producing_tables & handled_fanout) ||
(read_time < *current_read_time && (read_time < *current_read_time &&
!(handled_fanout & pos->inner_tables_handled_with_other_sjs))) !(handled_fanout & pos->inner_tables_handled_with_other_sjs)))
{ {
/* Mark strategy as used */ DBUG_ASSERT(pos->sj_strategy != sj_strategy);
(*strategy)->mark_used(); /*
pos->sj_strategy= sj_strategy; If the strategy choosen first time or
if (sj_strategy == SJ_OPT_MATERIALIZE) the strategy replace strategy which was used to exectly the same
join->sjm_lookup_tables |= handled_fanout; tables
*/
if (pos->sj_strategy == SJ_OPT_NONE ||
handled_fanout ==
(prev_dups_producing_tables ^ dups_producing_tables))
{
prev_strategy= strategy;
if (pos->sj_strategy == SJ_OPT_NONE)
{
prev_dups_producing_tables= dups_producing_tables;
prev_sjm_lookup_tables= join->sjm_lookup_tables;
}
/* Mark strategy as used */
(*strategy)->mark_used();
pos->sj_strategy= sj_strategy;
if (sj_strategy == SJ_OPT_MATERIALIZE)
join->sjm_lookup_tables |= handled_fanout;
else
join->sjm_lookup_tables &= ~handled_fanout;
*current_read_time= read_time;
*current_record_count= rec_count;
dups_producing_tables &= ~handled_fanout;
//TODO: update bitmap of semi-joins that were handled together with
// others.
if (is_multiple_semi_joins(join, join->positions, idx,
handled_fanout))
pos->inner_tables_handled_with_other_sjs |= handled_fanout;
}
else else
join->sjm_lookup_tables &= ~handled_fanout; {
*current_read_time= read_time; /* Conflict fall to most general variant */
*current_record_count= rec_count; (*prev_strategy)->set_empty();
dups_producing_tables &= ~handled_fanout; dups_producing_tables= prev_dups_producing_tables;
//TODO: update bitmap of semi-joins that were handled together with join->sjm_lookup_tables= prev_sjm_lookup_tables;
// others. // mark it 'none' to avpoid loops
if (is_multiple_semi_joins(join, join->positions, idx, handled_fanout)) pos->sj_strategy= SJ_OPT_NONE;
pos->inner_tables_handled_with_other_sjs |= handled_fanout; // next skip to last;
strategy= pickers +
(sizeof(pickers)/sizeof(Semi_join_strategy_picker*) - 3);
continue;
}
} }
else else
{ {

View File

@ -816,12 +816,19 @@ st_select_lex_unit *With_element::clone_parsed_spec(THD *thd,
parse_status= parse_sql(thd, &parser_state, 0); parse_status= parse_sql(thd, &parser_state, 0);
if (parse_status) if (parse_status)
goto err; goto err;
if (check_dependencies_in_with_clauses(lex->with_clauses_list))
goto err;
spec_tables= lex->query_tables; spec_tables= lex->query_tables;
spec_tables_tail= 0; spec_tables_tail= 0;
for (TABLE_LIST *tbl= spec_tables; for (TABLE_LIST *tbl= spec_tables;
tbl; tbl;
tbl= tbl->next_global) tbl= tbl->next_global)
{ {
if (!tbl->derived && !tbl->schema_table &&
thd->open_temporary_table(tbl))
goto err;
spec_tables_tail= tbl; spec_tables_tail= tbl;
} }
if (check_table_access(thd, SELECT_ACL, spec_tables, FALSE, UINT_MAX, FALSE)) if (check_table_access(thd, SELECT_ACL, spec_tables, FALSE, UINT_MAX, FALSE))

View File

@ -3243,6 +3243,9 @@ mysql_execute_command(THD *thd)
thd->get_stmt_da()->opt_clear_warning_info(thd->query_id); thd->get_stmt_da()->opt_clear_warning_info(thd->query_id);
} }
if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list))
DBUG_RETURN(1);
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
if (unlikely(thd->slave_thread)) if (unlikely(thd->slave_thread))
{ {
@ -3700,14 +3703,6 @@ mysql_execute_command(THD *thd)
ulong privileges_requested= lex->exchange ? SELECT_ACL | FILE_ACL : ulong privileges_requested= lex->exchange ? SELECT_ACL | FILE_ACL :
SELECT_ACL; SELECT_ACL;
/*
The same function must be called for DML commands
when CTEs are supported in DML statements
*/
res= check_dependencies_in_with_clauses(thd->lex->with_clauses_list);
if (res)
break;
if (all_tables) if (all_tables)
res= check_table_access(thd, res= check_table_access(thd,
privileges_requested, privileges_requested,
@ -4134,8 +4129,7 @@ mysql_execute_command(THD *thd)
/* Copy temporarily the statement flags to thd for lock_table_names() */ /* Copy temporarily the statement flags to thd for lock_table_names() */
uint save_thd_create_info_options= thd->lex->create_info.options; uint save_thd_create_info_options= thd->lex->create_info.options;
thd->lex->create_info.options|= create_info.options; thd->lex->create_info.options|= create_info.options;
if (!(res= check_dependencies_in_with_clauses(lex->with_clauses_list))) res= open_and_lock_tables(thd, create_info, lex->query_tables, TRUE, 0);
res= open_and_lock_tables(thd, create_info, lex->query_tables, TRUE, 0);
thd->lex->create_info.options= save_thd_create_info_options; thd->lex->create_info.options= save_thd_create_info_options;
if (res) if (res)
{ {
@ -4749,8 +4743,7 @@ end_with_restore_list:
unit->set_limit(select_lex); unit->set_limit(select_lex);
if (!(res= check_dependencies_in_with_clauses(lex->with_clauses_list)) && if (!(res=open_and_lock_tables(thd, all_tables, TRUE, 0)))
!(res=open_and_lock_tables(thd, all_tables, TRUE, 0)))
{ {
MYSQL_INSERT_SELECT_START(thd->query()); MYSQL_INSERT_SELECT_START(thd->query());
/* /*
@ -5081,9 +5074,6 @@ end_with_restore_list:
{ {
List<set_var_base> *lex_var_list= &lex->var_list; List<set_var_base> *lex_var_list= &lex->var_list;
if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list))
goto error;
if ((check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE) if ((check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE)
|| open_and_lock_tables(thd, all_tables, TRUE, 0))) || open_and_lock_tables(thd, all_tables, TRUE, 0)))
goto error; goto error;
@ -6402,8 +6392,6 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
new (thd->mem_root) Item_int(thd, new (thd->mem_root) Item_int(thd,
(ulonglong) thd->variables.select_limit); (ulonglong) thd->variables.select_limit);
} }
if (check_dependencies_in_with_clauses(lex->with_clauses_list))
return 1;
if (!(res= open_and_lock_tables(thd, all_tables, TRUE, 0))) if (!(res= open_and_lock_tables(thd, all_tables, TRUE, 0)))
{ {

View File

@ -1516,8 +1516,6 @@ static int mysql_test_select(Prepared_statement *stmt,
lex->select_lex.context.resolve_in_select_list= TRUE; lex->select_lex.context.resolve_in_select_list= TRUE;
ulong privilege= lex->exchange ? SELECT_ACL | FILE_ACL : SELECT_ACL; ulong privilege= lex->exchange ? SELECT_ACL | FILE_ACL : SELECT_ACL;
if (check_dependencies_in_with_clauses(lex->with_clauses_list))
goto error;
if (tables) if (tables)
{ {
if (check_table_access(thd, privilege, tables, FALSE, UINT_MAX, FALSE)) if (check_table_access(thd, privilege, tables, FALSE, UINT_MAX, FALSE))
@ -1784,9 +1782,6 @@ static bool mysql_test_create_table(Prepared_statement *stmt)
if (create_table_precheck(thd, tables, create_table)) if (create_table_precheck(thd, tables, create_table))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
if (check_dependencies_in_with_clauses(lex->with_clauses_list))
DBUG_RETURN(TRUE);
if (select_lex->item_list.elements) if (select_lex->item_list.elements)
{ {
/* Base table and temporary table are not in the same name space. */ /* Base table and temporary table are not in the same name space. */
@ -2177,9 +2172,6 @@ static bool mysql_test_insert_select(Prepared_statement *stmt,
if (insert_precheck(stmt->thd, tables)) if (insert_precheck(stmt->thd, tables))
return 1; return 1;
if (check_dependencies_in_with_clauses(lex->with_clauses_list))
return 1;
/* store it, because mysql_insert_select_prepare_tester change it */ /* store it, because mysql_insert_select_prepare_tester change it */
first_local_table= lex->select_lex.table_list.first; first_local_table= lex->select_lex.table_list.first;
DBUG_ASSERT(first_local_table != 0); DBUG_ASSERT(first_local_table != 0);
@ -2282,6 +2274,9 @@ static bool check_prepared_statement(Prepared_statement *stmt)
if (tables) if (tables)
thd->get_stmt_da()->opt_clear_warning_info(thd->query_id); thd->get_stmt_da()->opt_clear_warning_info(thd->query_id);
if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list))
goto error;
if (sql_command_flags[sql_command] & CF_HA_CLOSE) if (sql_command_flags[sql_command] & CF_HA_CLOSE)
mysql_ha_rm_tables(thd, tables); mysql_ha_rm_tables(thd, tables);

View File

@ -18099,7 +18099,7 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
table->in_use->inc_status_created_tmp_tables(); table->in_use->inc_status_created_tmp_tables();
table->in_use->query_plan_flags|= QPLAN_TMP_DISK; table->in_use->query_plan_flags|= QPLAN_TMP_DISK;
share->db_record_offset= 1; share->db_record_offset= 1;
table->created= TRUE; table->set_created();
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
DBUG_RETURN(1); DBUG_RETURN(1);
@ -18599,8 +18599,8 @@ int rr_sequential_and_unpack(READ_RECORD *info)
*/ */
bool instantiate_tmp_table(TABLE *table, KEY *keyinfo, bool instantiate_tmp_table(TABLE *table, KEY *keyinfo,
MARIA_COLUMNDEF *start_recinfo, TMP_ENGINE_COLUMNDEF *start_recinfo,
MARIA_COLUMNDEF **recinfo, TMP_ENGINE_COLUMNDEF **recinfo,
ulonglong options) ulonglong options)
{ {
if (table->s->db_type() == TMP_ENGINE_HTON) if (table->s->db_type() == TMP_ENGINE_HTON)

View File

@ -2287,8 +2287,8 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo,
TMP_ENGINE_COLUMNDEF **recinfo, TMP_ENGINE_COLUMNDEF **recinfo,
ulonglong options); ulonglong options);
bool instantiate_tmp_table(TABLE *table, KEY *keyinfo, bool instantiate_tmp_table(TABLE *table, KEY *keyinfo,
MARIA_COLUMNDEF *start_recinfo, TMP_ENGINE_COLUMNDEF *start_recinfo,
MARIA_COLUMNDEF **recinfo, TMP_ENGINE_COLUMNDEF **recinfo,
ulonglong options); ulonglong options);
bool open_tmp_table(TABLE *table); bool open_tmp_table(TABLE *table);
void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps); void setup_tmp_table_column_bitmaps(TABLE *table, uchar *bitmaps);

View File

@ -1715,6 +1715,7 @@ bool st_select_lex_unit::exec_recursive()
sq; sq;
sq= sq->next_with_rec_ref) sq= sq->next_with_rec_ref)
{ {
sq->reset();
sq->engine->force_reexecution(); sq->engine->force_reexecution();
} }

View File

@ -4360,11 +4360,7 @@ loop:
<< ". The most probable cause" << ". The most probable cause"
" of this error may be that the" " of this error may be that the"
" table has been corrupted." " table has been corrupted."
" You can try to fix this" " See https://mariadb.com/kb/en/library/xtradbinnodb-recovery-modes/";
" problem by using"
" innodb_force_recovery."
" Please see " REFMAN " for more"
" details. Aborting...";
} }
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -80,6 +80,10 @@ static const ulint BUF_LRU_SEARCH_SCAN_THRESHOLD = 100;
frames in the buffer pool, we set this to TRUE */ frames in the buffer pool, we set this to TRUE */
static bool buf_lru_switched_on_innodb_mon = false; static bool buf_lru_switched_on_innodb_mon = false;
/** True if diagnostic message about difficult to find free blocks
in the buffer bool has already printed. */
static bool buf_lru_free_blocks_error_printed;
/******************************************************************//** /******************************************************************//**
These statistics are not 'of' LRU but 'for' LRU. We keep count of I/O These statistics are not 'of' LRU but 'for' LRU. We keep count of I/O
and page_zip_decompress() operations. Based on the statistics, and page_zip_decompress() operations. Based on the statistics,
@ -1079,8 +1083,6 @@ buf_LRU_get_free_block(
bool freed = false; bool freed = false;
ulint n_iterations = 0; ulint n_iterations = 0;
ulint flush_failures = 0; ulint flush_failures = 0;
bool mon_value_was = false;
bool started_monitor = false;
MONITOR_INC(MONITOR_LRU_GET_FREE_SEARCH); MONITOR_INC(MONITOR_LRU_GET_FREE_SEARCH);
loop: loop:
@ -1088,6 +1090,11 @@ loop:
buf_LRU_check_size_of_non_data_objects(buf_pool); buf_LRU_check_size_of_non_data_objects(buf_pool);
DBUG_EXECUTE_IF("ib_lru_force_no_free_page",
if (!buf_lru_free_blocks_error_printed) {
n_iterations = 21;
goto not_found;});
/* If there is a block in the free list, take it */ /* If there is a block in the free list, take it */
block = buf_LRU_get_free_only(buf_pool); block = buf_LRU_get_free_only(buf_pool);
@ -1097,11 +1104,6 @@ loop:
ut_ad(buf_pool_from_block(block) == buf_pool); ut_ad(buf_pool_from_block(block) == buf_pool);
memset(&block->page.zip, 0, sizeof block->page.zip); memset(&block->page.zip, 0, sizeof block->page.zip);
if (started_monitor) {
srv_print_innodb_monitor =
static_cast<my_bool>(mon_value_was);
}
block->skip_flush_check = false; block->skip_flush_check = false;
block->page.flush_observer = NULL; block->page.flush_observer = NULL;
return(block); return(block);
@ -1131,24 +1133,24 @@ loop:
} }
} }
#ifndef DBUG_OFF
not_found:
#endif
buf_pool_mutex_exit(buf_pool); buf_pool_mutex_exit(buf_pool);
if (freed) { if (freed) {
goto loop; goto loop;
} }
if (n_iterations > 20 if (n_iterations > 20 && !buf_lru_free_blocks_error_printed
&& srv_buf_pool_old_size == srv_buf_pool_size) { && srv_buf_pool_old_size == srv_buf_pool_size) {
ib::warn() << "Difficult to find free blocks in the buffer pool" ib::warn() << "Difficult to find free blocks in the buffer pool"
" (" << n_iterations << " search iterations)! " " (" << n_iterations << " search iterations)! "
<< flush_failures << " failed attempts to" << flush_failures << " failed attempts to"
" flush a page! Consider increasing the buffer pool" " flush a page!"
" size. It is also possible that in your Unix version" " Consider increasing innodb_buffer_pool_size."
" fsync is very slow, or completely frozen inside"
" the OS kernel. Then upgrading to a newer version"
" of your operating system may help. Look at the"
" number of fsyncs in diagnostic info below."
" Pending flushes (fsync) log: " " Pending flushes (fsync) log: "
<< fil_n_pending_log_flushes << fil_n_pending_log_flushes
<< "; buffer pool: " << "; buffer pool: "
@ -1156,13 +1158,9 @@ loop:
<< ". " << os_n_file_reads << " OS file reads, " << ". " << os_n_file_reads << " OS file reads, "
<< os_n_file_writes << " OS file writes, " << os_n_file_writes << " OS file writes, "
<< os_n_fsyncs << os_n_fsyncs
<< " OS fsyncs. Starting InnoDB Monitor to print" << " OS fsyncs.";
" further diagnostics to the standard output.";
mon_value_was = srv_print_innodb_monitor; buf_lru_free_blocks_error_printed = true;
started_monitor = true;
srv_print_innodb_monitor = true;
os_event_set(srv_monitor_event);
} }
/* If we have scanned the whole LRU and still are unable to /* If we have scanned the whole LRU and still are unable to

View File

@ -3442,6 +3442,7 @@ dict_foreign_find_index(
&& !(index->type & DICT_FTS) && !(index->type & DICT_FTS)
&& !dict_index_is_spatial(index) && !dict_index_is_spatial(index)
&& !index->to_be_dropped && !index->to_be_dropped
&& !dict_index_is_online_ddl(index)
&& dict_foreign_qualify_index( && dict_foreign_qualify_index(
table, col_names, columns, n_cols, table, col_names, columns, n_cols,
index, types_idx, index, types_idx,

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -773,8 +773,9 @@ rtr_page_get_father_node_ptr(
error << ". You should dump + drop + reimport the table to" error << ". You should dump + drop + reimport the table to"
" fix the corruption. If the crash happens at" " fix the corruption. If the crash happens at"
" database startup, see " REFMAN " database startup, see "
"forcing-innodb-recovery.html about forcing" "https://mariadb.com/kb/en/library/xtradbinnodb-recovery-modes/"
" about forcing"
" recovery. Then dump + drop + reimport."; " recovery. Then dump + drop + reimport.";
} }

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2017, MariaDB Corporation. Copyright (c) 2013, 2018, MariaDB Corporation.
Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc. Copyright (c) 2009, Percona Inc.
Copyright (c) 2012, Facebook Inc. Copyright (c) 2012, Facebook Inc.
@ -3652,7 +3652,7 @@ static uint innobase_partition_flags()
#define DEPRECATED_FORMAT_PARAMETER(x) \ #define DEPRECATED_FORMAT_PARAMETER(x) \
"Using " x " is deprecated and the parameter" \ "Using " x " is deprecated and the parameter" \
" may be removed in future releases." \ " may be removed in future releases." \
" See " REFMAN "innodb-file-format.html" " See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/"
/** Deprecation message about innodb_file_format */ /** Deprecation message about innodb_file_format */
static const char* deprecated_file_format static const char* deprecated_file_format
@ -22580,7 +22580,8 @@ const char* BUG_REPORT_MSG =
"Submit a detailed bug report to https://jira.mariadb.org/"; "Submit a detailed bug report to https://jira.mariadb.org/";
const char* FORCE_RECOVERY_MSG = const char* FORCE_RECOVERY_MSG =
"Please refer to " REFMAN "forcing-innodb-recovery.html" "Please refer to "
"https://mariadb.com/kb/en/library/xtradbinnodb-recovery-modes/"
" for information about forcing recovery."; " for information about forcing recovery.";
const char* ERROR_CREATING_MSG = const char* ERROR_CREATING_MSG =
@ -22588,17 +22589,17 @@ const char* ERROR_CREATING_MSG =
const char* OPERATING_SYSTEM_ERROR_MSG = const char* OPERATING_SYSTEM_ERROR_MSG =
"Some operating system error numbers are described at" "Some operating system error numbers are described at"
" " REFMAN "operating-system-error-codes.html"; " https://mariadb.com/kb/en/library/operating-system-error-codes/";
const char* FOREIGN_KEY_CONSTRAINTS_MSG = const char* FOREIGN_KEY_CONSTRAINTS_MSG =
"Please refer to " REFMAN "innodb-foreign-key-constraints.html" "Please refer to https://mariadb.com/kb/en/library/foreign-keys/"
" for correct foreign key definition."; " for correct foreign key definition.";
const char* SET_TRANSACTION_MSG = const char* SET_TRANSACTION_MSG =
"Please refer to " REFMAN "set-transaction.html"; "Please refer to https://mariadb.com/kb/en/library/set-transaction/";
const char* INNODB_PARAMETERS_MSG = const char* INNODB_PARAMETERS_MSG =
"Please refer to " REFMAN "innodb-parameters.html"; "Please refer to https://mariadb.com/kb/en/library/xtradbinnodb-server-system-variables/";
/********************************************************************** /**********************************************************************
Converts an identifier from my_charset_filename to UTF-8 charset. Converts an identifier from my_charset_filename to UTF-8 charset.

View File

@ -2,7 +2,7 @@
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2009, Google Inc. Copyright (c) 2009, Google Inc.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described Google, Inc. Those modifications are gratefully acknowledged and are described
@ -513,6 +513,8 @@ or the MySQL version that created the redo log file. */
/** The redo log format identifier corresponding to the current format version. /** The redo log format identifier corresponding to the current format version.
Stored in LOG_HEADER_FORMAT. */ Stored in LOG_HEADER_FORMAT. */
#define LOG_HEADER_FORMAT_CURRENT 1 #define LOG_HEADER_FORMAT_CURRENT 1
/** The MariaDB 10.3.2 log format */
#define LOG_HEADER_FORMAT_10_3 103
/** Encrypted MariaDB redo log */ /** Encrypted MariaDB redo log */
#define LOG_HEADER_FORMAT_ENCRYPTED (1U<<31) #define LOG_HEADER_FORMAT_ENCRYPTED (1U<<31)

View File

@ -2,7 +2,7 @@
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc. Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2017, MariaDB Corporation. Copyright (c) 2013, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -842,7 +842,7 @@ recv_find_max_checkpoint_0(log_group_t** max_group, ulint* max_field)
" This redo log was created before MariaDB 10.2.2," " This redo log was created before MariaDB 10.2.2,"
" and we did not find a valid checkpoint." " and we did not find a valid checkpoint."
" Please follow the instructions at" " Please follow the instructions at"
" " REFMAN "upgrading.html"; " https://mariadb.com/kb/en/library/upgrading/";
return(DB_ERROR); return(DB_ERROR);
} }
@ -869,7 +869,7 @@ recv_log_format_0_recover(lsn_t lsn)
" This redo log was created before MariaDB 10.2.2"; " This redo log was created before MariaDB 10.2.2";
static const char* NO_UPGRADE_RTFM_MSG = static const char* NO_UPGRADE_RTFM_MSG =
". Please follow the instructions at " ". Please follow the instructions at "
REFMAN "upgrading.html"; "https://mariadb.com/kb/en/library/upgrading/";
fil_io(IORequestLogRead, true, fil_io(IORequestLogRead, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no), page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
@ -907,6 +907,58 @@ recv_log_format_0_recover(lsn_t lsn)
return(DB_SUCCESS); return(DB_SUCCESS);
} }
/** Determine if a redo log from MariaDB 10.3 is clean.
@return error code
@retval DB_SUCCESS if the redo log is clean
@retval DB_CORRUPTION if the redo log is corrupted
@retval DB_ERROR if the redo log is not empty */
static
dberr_t
recv_log_recover_10_3()
{
log_group_t* group = &log_sys->log;
const lsn_t lsn = group->lsn;
const lsn_t source_offset = log_group_calc_lsn_offset(lsn, group);
const ulint page_no
= (ulint) (source_offset / univ_page_size.physical());
byte* buf = log_sys->buf;
fil_io(IORequestLogRead, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size,
(ulint) ((source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1))
% univ_page_size.physical()),
OS_FILE_LOG_BLOCK_SIZE, buf, NULL);
if (log_block_calc_checksum(buf) != log_block_get_checksum(buf)) {
return(DB_CORRUPTION);
}
if (group->is_encrypted()) {
log_crypt(buf, lsn, OS_FILE_LOG_BLOCK_SIZE, true);
}
/* On a clean shutdown, the redo log will be logically empty
after the checkpoint lsn. */
if (log_block_get_data_len(buf)
!= (source_offset & (OS_FILE_LOG_BLOCK_SIZE - 1))) {
return(DB_ERROR);
}
/* Mark the redo log for downgrading. */
srv_log_file_size = 0;
recv_sys->parse_start_lsn = recv_sys->recovered_lsn
= recv_sys->scanned_lsn
= recv_sys->mlog_checkpoint_lsn = lsn;
log_sys->last_checkpoint_lsn = log_sys->next_checkpoint_lsn
= log_sys->lsn = log_sys->write_lsn
= log_sys->current_flush_lsn = log_sys->flushed_to_disk_lsn
= lsn;
log_sys->next_checkpoint_no = 0;
return(DB_SUCCESS);
}
/** Find the latest checkpoint in the log header. /** Find the latest checkpoint in the log header.
@param[out] max_field LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2 @param[out] max_field LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2
@return error code or DB_SUCCESS */ @return error code or DB_SUCCESS */
@ -938,18 +990,24 @@ recv_find_max_checkpoint(ulint* max_field)
return(DB_CORRUPTION); return(DB_CORRUPTION);
} }
char creator[LOG_HEADER_CREATOR_END - LOG_HEADER_CREATOR + 1];
memcpy(creator, buf + LOG_HEADER_CREATOR, sizeof creator);
/* Ensure that the string is NUL-terminated. */
creator[LOG_HEADER_CREATOR_END - LOG_HEADER_CREATOR] = 0;
switch (group->format) { switch (group->format) {
case 0: case 0:
return(recv_find_max_checkpoint_0(&group, max_field)); return(recv_find_max_checkpoint_0(&group, max_field));
case LOG_HEADER_FORMAT_CURRENT: case LOG_HEADER_FORMAT_CURRENT:
case LOG_HEADER_FORMAT_CURRENT | LOG_HEADER_FORMAT_ENCRYPTED: case LOG_HEADER_FORMAT_CURRENT | LOG_HEADER_FORMAT_ENCRYPTED:
case LOG_HEADER_FORMAT_10_3:
case LOG_HEADER_FORMAT_10_3 | LOG_HEADER_FORMAT_ENCRYPTED:
break; break;
default: default:
/* Ensure that the string is NUL-terminated. */
buf[LOG_HEADER_CREATOR_END] = 0;
ib::error() << "Unsupported redo log format." ib::error() << "Unsupported redo log format."
" The redo log was created" " The redo log was created"
" with " << buf + LOG_HEADER_CREATOR << " with " << creator <<
". Please follow the instructions at " ". Please follow the instructions at "
REFMAN "upgrading-downgrading.html"; REFMAN "upgrading-downgrading.html";
/* Do not issue a message about a possibility /* Do not issue a message about a possibility
@ -1018,6 +1076,20 @@ recv_find_max_checkpoint(ulint* max_field)
return(DB_ERROR); return(DB_ERROR);
} }
switch (group->format) {
case LOG_HEADER_FORMAT_10_3:
case LOG_HEADER_FORMAT_10_3 | LOG_HEADER_FORMAT_ENCRYPTED:
dberr_t err = recv_log_recover_10_3();
if (err != DB_SUCCESS) {
ib::error()
<< "Downgrade after a crash is not supported."
" The redo log was created with " << creator
<< (err == DB_ERROR
? "." : ", and it appears corrupted.");
}
return(err);
}
return(DB_SUCCESS); return(DB_SUCCESS);
} }
@ -1166,6 +1238,8 @@ parse_log:
redo log been written with something redo log been written with something
older than InnoDB Plugin 1.0.4. */ older than InnoDB Plugin 1.0.4. */
ut_ad(0 ut_ad(0
/* fil_crypt_rotate_page() writes this */
|| offs == FIL_PAGE_SPACE_ID
|| offs == IBUF_TREE_SEG_HEADER || offs == IBUF_TREE_SEG_HEADER
+ IBUF_HEADER + FSEG_HDR_SPACE + IBUF_HEADER + FSEG_HDR_SPACE
|| offs == IBUF_TREE_SEG_HEADER || offs == IBUF_TREE_SEG_HEADER

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -2167,8 +2167,6 @@ rec_get_trx_id(
const rec_t* rec, const rec_t* rec,
const dict_index_t* index) const dict_index_t* index)
{ {
const page_t* page
= page_align(rec);
ulint trx_id_col ulint trx_id_col
= dict_index_get_sys_col_pos(index, DATA_TRX_ID); = dict_index_get_sys_col_pos(index, DATA_TRX_ID);
const byte* trx_id; const byte* trx_id;
@ -2179,11 +2177,7 @@ rec_get_trx_id(
ulint* offsets = offsets_; ulint* offsets = offsets_;
ut_ad(trx_id_col <= MAX_REF_PARTS); ut_ad(trx_id_col <= MAX_REF_PARTS);
ut_ad(fil_page_index_page_check(page));
ut_ad(mach_read_from_8(page + PAGE_HEADER + PAGE_INDEX_ID)
== index->id);
ut_ad(dict_index_is_clust(index)); ut_ad(dict_index_is_clust(index));
ut_ad(page_rec_is_leaf(rec));
ut_ad(trx_id_col > 0); ut_ad(trx_id_col > 0);
ut_ad(trx_id_col != ULINT_UNDEFINED); ut_ad(trx_id_col != ULINT_UNDEFINED);

View File

@ -1425,17 +1425,6 @@ row_insert_for_mysql(
} else if (high_level_read_only) { } else if (high_level_read_only) {
return(DB_READ_ONLY); return(DB_READ_ONLY);
} }
DBUG_EXECUTE_IF("mark_table_corrupted", {
/* Mark the table corrupted for the clustered index */
dict_index_t* index = dict_table_get_first_index(table);
ut_ad(dict_index_is_clust(index));
dict_set_corrupted(index, trx, "INSERT TABLE"); });
if (dict_table_is_corrupted(table)) {
ib::error() << "Table " << table->name << " is corrupt.";
return(DB_TABLE_CORRUPT);
}
DBUG_EXECUTE_IF("mark_table_corrupted", { DBUG_EXECUTE_IF("mark_table_corrupted", {
/* Mark the table corrupted for the clustered index */ /* Mark the table corrupted for the clustered index */

View File

@ -3,7 +3,7 @@
Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, Google Inc. Copyright (c) 2008, Google Inc.
Copyright (c) 2009, Percona Inc. Copyright (c) 2009, Percona Inc.
Copyright (c) 2013, 2017, MariaDB Corporation. Copyright (c) 2013, 2018, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described Google, Inc. Those modifications are gratefully acknowledged and are described
@ -1413,7 +1413,11 @@ srv_prepare_to_delete_redo_log_files(
{ {
ib::info info; ib::info info;
if (srv_log_file_size == 0) { if (srv_log_file_size == 0) {
info << "Upgrading redo log: "; info << ((log_sys->log.format
& ~LOG_HEADER_FORMAT_ENCRYPTED)
!= LOG_HEADER_FORMAT_10_3
? "Upgrading redo log: "
: "Downgrading redo log: ");
} else if (n_files != srv_n_log_files } else if (n_files != srv_n_log_files
|| srv_log_file_size || srv_log_file_size
!= srv_log_file_size_requested) { != srv_log_file_size_requested) {

View File

@ -1162,28 +1162,6 @@ trx_purge_rseg_get_next_history_log(
mutex_exit(&(rseg->mutex)); mutex_exit(&(rseg->mutex));
mtr_commit(&mtr); mtr_commit(&mtr);
trx_sys_mutex_enter();
/* Add debug code to track history list corruption reported
on the MySQL mailing list on Nov 9, 2004. The fut0lst.cc
file-based list was corrupt. The prev node pointer was
FIL_NULL, even though the list length was over 8 million nodes!
We assume that purge truncates the history list in large
size pieces, and if we here reach the head of the list, the
list cannot be longer than 2000 000 undo logs now. */
if (trx_sys->rseg_history_len > 2000000) {
ib::warn() << "Purge reached the head of the history"
" list, but its length is still reported as "
<< trx_sys->rseg_history_len << "! Make"
" a detailed bug report, and submit it to"
" https://jira.mariadb.org/";
ut_ad(0);
}
trx_sys_mutex_exit();
return; return;
} }

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -53,7 +53,7 @@ ut_dbg_assertion_failed(
" or crashes, even\n" " or crashes, even\n"
"InnoDB: immediately after the mysqld startup, there may be\n" "InnoDB: immediately after the mysqld startup, there may be\n"
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n" "InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
"InnoDB: " REFMAN "forcing-innodb-recovery.html\n" "InnoDB: https://mariadb.com/kb/en/library/xtradbinnodb-recovery-modes/\n"
"InnoDB: about forcing recovery.\n", stderr); "InnoDB: about forcing recovery.\n", stderr);
fflush(stderr); fflush(stderr);

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -87,6 +87,10 @@ buffer pools. */
frames in the buffer pool, we set this to TRUE */ frames in the buffer pool, we set this to TRUE */
static ibool buf_lru_switched_on_innodb_mon = FALSE; static ibool buf_lru_switched_on_innodb_mon = FALSE;
/** True if diagnostic message about difficult to find free blocks
in the buffer bool has already printed. */
static bool buf_lru_free_blocks_error_printed;
/******************************************************************//** /******************************************************************//**
These statistics are not 'of' LRU but 'for' LRU. We keep count of I/O These statistics are not 'of' LRU but 'for' LRU. We keep count of I/O
and page_zip_decompress() operations. Based on the statistics, and page_zip_decompress() operations. Based on the statistics,
@ -1080,68 +1084,39 @@ buf_LRU_check_size_of_non_data_objects(
} }
/** Diagnose failure to get a free page and request InnoDB monitor output in /** Diagnose failure to get a free page and request InnoDB monitor output in
the error log if more than two seconds have been spent already. the error log if it has not yet printed.
@param[in] n_iterations how many buf_LRU_get_free_page iterations @param[in] n_iterations how many buf_LRU_get_free_page iterations
already completed already completed
@param[in] started_ms timestamp in ms of when the attempt to get the
free page started
@param[in] flush_failures how many times single-page flush, if allowed, @param[in] flush_failures how many times single-page flush, if allowed,
has failed has failed
@param[out] mon_value_was previous srv_print_innodb_monitor value
@param[out] started_monitor whether InnoDB monitor print has been requested
*/ */
static static
void void
buf_LRU_handle_lack_of_free_blocks(ulint n_iterations, ulint started_ms, buf_LRU_handle_lack_of_free_blocks(
ulint flush_failures, ulint n_iterations,
ibool *mon_value_was, ulint flush_failures)
ibool *started_monitor)
{ {
static ulint last_printout_ms = 0; if (n_iterations > 20 && !buf_lru_free_blocks_error_printed) {
ib_logf(IB_LOG_LEVEL_WARN,
"Difficult to find free blocks in"
" the buffer pool (" ULINTPF " search iterations)! "
ULINTPF " failed attempts to flush a page!",
n_iterations, flush_failures);
ib_logf(IB_LOG_LEVEL_INFO,
"Consider increasing the buffer pool size.");
ib_logf(IB_LOG_LEVEL_INFO,
"Pending flushes (fsync) log: " ULINTPF
" buffer pool: " ULINTPF
" OS file reads: " ULINTPF " OS file writes: "
ULINTPF " OS fsyncs: " ULINTPF "",
fil_n_pending_log_flushes,
fil_n_pending_tablespace_flushes,
os_n_file_reads,
os_n_file_writes,
os_n_fsyncs);
/* Legacy algorithm started warning after at least 2 seconds, we buf_lru_free_blocks_error_printed = true;
emulate this. */
const ulint current_ms = ut_time_ms();
if ((current_ms > started_ms + 2000)
&& (current_ms > last_printout_ms + 2000)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: difficult to find free blocks in\n"
"InnoDB: the buffer pool (%lu search iterations)!\n"
"InnoDB: %lu failed attempts to flush a page!"
" Consider\n"
"InnoDB: increasing the buffer pool size.\n"
"InnoDB: It is also possible that"
" in your Unix version\n"
"InnoDB: fsync is very slow, or"
" completely frozen inside\n"
"InnoDB: the OS kernel. Then upgrading to"
" a newer version\n"
"InnoDB: of your operating system may help."
" Look at the\n"
"InnoDB: number of fsyncs in diagnostic info below.\n"
"InnoDB: Pending flushes (fsync) log: %lu;"
" buffer pool: %lu\n"
"InnoDB: %lu OS file reads, %lu OS file writes,"
" %lu OS fsyncs\n"
"InnoDB: Starting InnoDB Monitor to print further\n"
"InnoDB: diagnostics to the standard output.\n",
(ulong) n_iterations,
(ulong) flush_failures,
(ulong) fil_n_pending_log_flushes,
(ulong) fil_n_pending_tablespace_flushes,
(ulong) os_n_file_reads, (ulong) os_n_file_writes,
(ulong) os_n_fsyncs);
last_printout_ms = current_ms;
*mon_value_was = srv_print_innodb_monitor;
*started_monitor = TRUE;
srv_print_innodb_monitor = TRUE;
os_event_set(lock_sys->timeout_event);
} }
} }
/** The maximum allowed backoff sleep time duration, microseconds */ /** The maximum allowed backoff sleep time duration, microseconds */
@ -1189,9 +1164,6 @@ buf_LRU_get_free_block(
ibool freed = FALSE; ibool freed = FALSE;
ulint n_iterations = 0; ulint n_iterations = 0;
ulint flush_failures = 0; ulint flush_failures = 0;
ibool mon_value_was = FALSE;
ibool started_monitor = FALSE;
ulint started_ms = 0;
ut_ad(!mutex_own(&buf_pool->LRU_list_mutex)); ut_ad(!mutex_own(&buf_pool->LRU_list_mutex));
@ -1199,42 +1171,20 @@ buf_LRU_get_free_block(
loop: loop:
buf_LRU_check_size_of_non_data_objects(buf_pool); buf_LRU_check_size_of_non_data_objects(buf_pool);
/* If there is a block in the free list, take it */ DBUG_EXECUTE_IF("ib_lru_force_no_free_page",
if (DBUG_EVALUATE_IF("simulate_lack_of_pages", true, false)) { if (!buf_lru_free_blocks_error_printed) {
n_iterations = 21;
goto not_found;});
block = NULL; block = buf_LRU_get_free_only(buf_pool);
if (srv_debug_monitor_printed)
DBUG_SET("-d,simulate_lack_of_pages");
} else if (DBUG_EVALUATE_IF("simulate_recovery_lack_of_pages",
recv_recovery_on, false)) {
block = NULL;
if (srv_debug_monitor_printed)
DBUG_SUICIDE();
} else {
block = buf_LRU_get_free_only(buf_pool);
}
if (block) { if (block) {
ut_ad(buf_pool_from_block(block) == buf_pool); ut_ad(buf_pool_from_block(block) == buf_pool);
memset(&block->page.zip, 0, sizeof block->page.zip); memset(&block->page.zip, 0, sizeof block->page.zip);
if (started_monitor) {
srv_print_innodb_monitor =
static_cast<my_bool>(mon_value_was);
}
return(block); return(block);
} }
if (!started_ms)
started_ms = ut_time_ms();
if (srv_empty_free_list_algorithm == SRV_EMPTY_FREE_LIST_BACKOFF if (srv_empty_free_list_algorithm == SRV_EMPTY_FREE_LIST_BACKOFF
&& buf_lru_manager_is_active && buf_lru_manager_is_active
&& (srv_shutdown_state == SRV_SHUTDOWN_NONE && (srv_shutdown_state == SRV_SHUTDOWN_NONE
@ -1272,10 +1222,7 @@ loop:
: FREE_LIST_BACKOFF_LOW_PRIO_DIVIDER)); : FREE_LIST_BACKOFF_LOW_PRIO_DIVIDER));
} }
buf_LRU_handle_lack_of_free_blocks(n_iterations, started_ms, buf_LRU_handle_lack_of_free_blocks(n_iterations, flush_failures);
flush_failures,
&mon_value_was,
&started_monitor);
n_iterations++; n_iterations++;
@ -1314,13 +1261,8 @@ loop:
mutex_exit(&buf_pool->flush_state_mutex); mutex_exit(&buf_pool->flush_state_mutex);
if (DBUG_EVALUATE_IF("simulate_recovery_lack_of_pages", true, false)
|| DBUG_EVALUATE_IF("simulate_lack_of_pages", true, false)) {
buf_pool->try_LRU_scan = false;
}
freed = FALSE; freed = FALSE;
if (buf_pool->try_LRU_scan || n_iterations > 0) { if (buf_pool->try_LRU_scan || n_iterations > 0) {
/* If no block was in the free list, search from the /* If no block was in the free list, search from the
@ -1345,9 +1287,11 @@ loop:
} }
buf_LRU_handle_lack_of_free_blocks(n_iterations, started_ms, #ifndef DBUG_OFF
flush_failures, &mon_value_was, not_found:
&started_monitor); #endif
buf_LRU_handle_lack_of_free_blocks(n_iterations, flush_failures);
/* If we have scanned the whole LRU and still are unable to /* If we have scanned the whole LRU and still are unable to
find a free block then we should sleep here to let the find a free block then we should sleep here to let the

View File

@ -3409,6 +3409,7 @@ dict_foreign_find_index(
if (types_idx != index if (types_idx != index
&& !(index->type & DICT_FTS) && !(index->type & DICT_FTS)
&& !index->to_be_dropped && !index->to_be_dropped
&& !dict_index_is_online_ddl(index)
&& dict_foreign_qualify_index( && dict_foreign_qualify_index(
table, col_names, columns, n_cols, table, col_names, columns, n_cols,
index, types_idx, index, types_idx,

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved. Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
Copyright (C) 2014, 2017, MariaDB Corporation. All Rights Reserved. Copyright (C) 2014, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -73,6 +73,8 @@ log_encrypt_before_write(
/*=====================*/ /*=====================*/
ib_uint64_t next_checkpoint_no, /*!< in: log group to be flushed */ ib_uint64_t next_checkpoint_no, /*!< in: log group to be flushed */
byte* block, /*!< in/out: pointer to a log block */ byte* block, /*!< in/out: pointer to a log block */
lsn_t lsn, /*!< in: log sequence number of
the start of the buffer */
const ulint size); /*!< in: size of log blocks */ const ulint size); /*!< in: size of log blocks */
/******************************************************** /********************************************************
@ -83,6 +85,8 @@ void
log_decrypt_after_read( log_decrypt_after_read(
/*===================*/ /*===================*/
byte* frame, /*!< in/out: log segment */ byte* frame, /*!< in/out: log segment */
lsn_t lsn, /*!< in: log sequence number of the start
of the buffer */
const ulint size); /*!< in: log segment size */ const ulint size); /*!< in: log segment size */
/* Error codes for crypt info */ /* Error codes for crypt info */

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved. Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
Copyright (C) 2014, 2017, MariaDB Corporation. All Rights Reserved. Copyright (C) 2014, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -69,22 +69,6 @@ struct crypt_info_t {
static std::deque<crypt_info_t> crypt_info; static std::deque<crypt_info_t> crypt_info;
/*********************************************************************//**
Get a log block's start lsn.
@return a log block's start lsn */
static inline
lsn_t
log_block_get_start_lsn(
/*====================*/
lsn_t lsn, /*!< in: checkpoint lsn */
ulint log_block_no) /*!< in: log block number */
{
lsn_t start_lsn =
(lsn & (lsn_t)0xffffffff00000000ULL) |
(((log_block_no - 1) & (lsn_t)0x3fffffff) << 9);
return start_lsn;
}
/*********************************************************************//** /*********************************************************************//**
Get crypt info from checkpoint. Get crypt info from checkpoint.
@return a crypt info or NULL if not present. */ @return a crypt info or NULL if not present. */
@ -161,6 +145,8 @@ Crypt_result
log_blocks_crypt( log_blocks_crypt(
/*=============*/ /*=============*/
const byte* block, /*!< in: blocks before encrypt/decrypt*/ const byte* block, /*!< in: blocks before encrypt/decrypt*/
lsn_t lsn, /*!< in: log sequence number of the start
of the buffer */
ulint size, /*!< in: size of block */ ulint size, /*!< in: size of block */
byte* dst_block, /*!< out: blocks after encrypt/decrypt */ byte* dst_block, /*!< out: blocks after encrypt/decrypt */
int what, /*!< in: encrypt or decrypt*/ int what, /*!< in: encrypt or decrypt*/
@ -170,21 +156,18 @@ log_blocks_crypt(
Crypt_result rc = MY_AES_OK; Crypt_result rc = MY_AES_OK;
uint dst_len; uint dst_len;
byte aes_ctr_counter[MY_AES_BLOCK_SIZE]; byte aes_ctr_counter[MY_AES_BLOCK_SIZE];
byte is_encrypt= what == ENCRYPTION_FLAG_ENCRYPT;
lsn_t lsn = is_encrypt ? log_sys->lsn : srv_start_lsn;
const uint src_len = OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_HDR_SIZE; const uint src_len = OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_HDR_SIZE;
for (ulint i = 0; i < size ; i += OS_FILE_LOG_BLOCK_SIZE) { for (ulint i = 0; i < size ; i += OS_FILE_LOG_BLOCK_SIZE,
lsn += OS_FILE_LOG_BLOCK_SIZE) {
ulint log_block_no = log_block_get_hdr_no(log_block); ulint log_block_no = log_block_get_hdr_no(log_block);
lsn_t log_block_start_lsn = log_block_get_start_lsn(
lsn, log_block_no);
const crypt_info_t* info = crypt_info == NULL ? get_crypt_info(log_block) : const crypt_info_t* info = crypt_info == NULL ? get_crypt_info(log_block) :
crypt_info; crypt_info;
#ifdef DEBUG_CRYPT #ifdef DEBUG_CRYPT
fprintf(stderr, fprintf(stderr,
"%s %lu chkpt: %lu key: %u lsn: %lu\n", "%s %lu chkpt: %lu key: %u lsn: %lu\n",
is_encrypt ? "crypt" : "decrypt", what == ENCRYPTION_FLAG_ENCRYPT ? "crypt" : "decrypt",
log_block_no, log_block_no,
log_block_get_checkpoint_no(log_block), log_block_get_checkpoint_no(log_block),
info ? info->key_version : 0, info ? info->key_version : 0,
@ -213,7 +196,7 @@ log_blocks_crypt(
// (1-byte, only 5 bits are used). "+" means concatenate. // (1-byte, only 5 bits are used). "+" means concatenate.
bzero(aes_ctr_counter, MY_AES_BLOCK_SIZE); bzero(aes_ctr_counter, MY_AES_BLOCK_SIZE);
memcpy(aes_ctr_counter, info->crypt_nonce, 3); memcpy(aes_ctr_counter, info->crypt_nonce, 3);
mach_write_to_8(aes_ctr_counter + 3, log_block_start_lsn); mach_write_to_8(aes_ctr_counter + 3, lsn);
mach_write_to_4(aes_ctr_counter + 11, log_block_no); mach_write_to_4(aes_ctr_counter + 11, log_block_no);
bzero(aes_ctr_counter + 15, 1); bzero(aes_ctr_counter + 15, 1);
@ -458,19 +441,6 @@ add_crypt_info(
return true; return true;
} }
/*********************************************************************//**
Encrypt log blocks. */
UNIV_INTERN
Crypt_result
log_blocks_encrypt(
/*===============*/
const byte* block, /*!< in: blocks before encryption */
const ulint size, /*!< in: size of blocks, must be multiple of a log block */
byte* dst_block) /*!< out: blocks after encryption */
{
return log_blocks_crypt(block, size, dst_block, ENCRYPTION_FLAG_ENCRYPT, NULL);
}
/*********************************************************************//** /*********************************************************************//**
Set next checkpoint's key version to latest one, and generate current Set next checkpoint's key version to latest one, and generate current
key. Key version 0 means no encryption. */ key. Key version 0 means no encryption. */
@ -522,6 +492,8 @@ log_encrypt_before_write(
/*=====================*/ /*=====================*/
ib_uint64_t next_checkpoint_no, /*!< in: log group to be flushed */ ib_uint64_t next_checkpoint_no, /*!< in: log group to be flushed */
byte* block, /*!< in/out: pointer to a log block */ byte* block, /*!< in/out: pointer to a log block */
lsn_t lsn, /*!< in: log sequence number of
the start of the buffer */
const ulint size) /*!< in: size of log blocks */ const ulint size) /*!< in: size of log blocks */
{ {
ut_ad(size % OS_FILE_LOG_BLOCK_SIZE == 0); ut_ad(size % OS_FILE_LOG_BLOCK_SIZE == 0);
@ -540,7 +512,8 @@ log_encrypt_before_write(
byte* dst_frame = (byte*)malloc(size); byte* dst_frame = (byte*)malloc(size);
//encrypt log blocks content //encrypt log blocks content
Crypt_result result = log_blocks_crypt(block, size, dst_frame, ENCRYPTION_FLAG_ENCRYPT, NULL); Crypt_result result = log_blocks_crypt(
block, lsn, size, dst_frame, ENCRYPTION_FLAG_ENCRYPT, NULL);
if (result == MY_AES_OK) { if (result == MY_AES_OK) {
ut_ad(block[0] == dst_frame[0]); ut_ad(block[0] == dst_frame[0]);
@ -560,13 +533,16 @@ void
log_decrypt_after_read( log_decrypt_after_read(
/*===================*/ /*===================*/
byte* frame, /*!< in/out: log segment */ byte* frame, /*!< in/out: log segment */
lsn_t lsn, /*!< in: log sequence number of the start
of the buffer */
const ulint size) /*!< in: log segment size */ const ulint size) /*!< in: log segment size */
{ {
ut_ad(size % OS_FILE_LOG_BLOCK_SIZE == 0); ut_ad(size % OS_FILE_LOG_BLOCK_SIZE == 0);
byte* dst_frame = (byte*)malloc(size); byte* dst_frame = (byte*)malloc(size);
// decrypt log blocks content // decrypt log blocks content
Crypt_result result = log_blocks_crypt(frame, size, dst_frame, ENCRYPTION_FLAG_DECRYPT, NULL); Crypt_result result = log_blocks_crypt(
frame, lsn, size, dst_frame, ENCRYPTION_FLAG_DECRYPT, NULL);
if (result == MY_AES_OK) { if (result == MY_AES_OK) {
memcpy(frame, dst_frame, size); memcpy(frame, dst_frame, size);

View File

@ -1490,7 +1490,7 @@ loop:
ut_a(next_offset / UNIV_PAGE_SIZE <= ULINT_MAX); ut_a(next_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
log_encrypt_before_write(log_sys->next_checkpoint_no, log_encrypt_before_write(log_sys->next_checkpoint_no,
buf, write_len); buf, start_lsn, write_len);
#ifdef DEBUG_CRYPT #ifdef DEBUG_CRYPT
fprintf(stderr, "WRITE: block: %lu checkpoint: %lu %.8lx %.8lx\n", fprintf(stderr, "WRITE: block: %lu checkpoint: %lu %.8lx %.8lx\n",
@ -2582,7 +2582,7 @@ loop:
log_block_get_checksum(buf), source_offset); log_block_get_checksum(buf), source_offset);
#endif #endif
log_decrypt_after_read(buf, len); log_decrypt_after_read(buf, start_lsn, len);
#ifdef DEBUG_CRYPT #ifdef DEBUG_CRYPT
fprintf(stderr, "AFTER DECRYPT: block: %lu checkpoint: %lu %.8lx %.8lx\n", fprintf(stderr, "AFTER DECRYPT: block: %lu checkpoint: %lu %.8lx %.8lx\n",
@ -2890,7 +2890,8 @@ loop:
MONITOR_INC(MONITOR_LOG_IO); MONITOR_INC(MONITOR_LOG_IO);
//TODO (jonaso): This must be dead code?? //TODO (jonaso): This must be dead code??
log_encrypt_before_write(log_sys->next_checkpoint_no, buf, len); log_encrypt_before_write(log_sys->next_checkpoint_no,
buf, start_lsn, len);
fil_io(OS_FILE_WRITE | OS_FILE_LOG, false, group->archive_space_id, fil_io(OS_FILE_WRITE | OS_FILE_LOG, false, group->archive_space_id,
0, 0,

View File

@ -584,32 +584,6 @@ trx_purge_rseg_get_next_history_log(
mutex_exit(&(rseg->mutex)); mutex_exit(&(rseg->mutex));
mtr_commit(&mtr); mtr_commit(&mtr);
mutex_enter(&trx_sys->mutex);
/* Add debug code to track history list corruption reported
on the MySQL mailing list on Nov 9, 2004. The fut0lst.cc
file-based list was corrupt. The prev node pointer was
FIL_NULL, even though the list length was over 8 million nodes!
We assume that purge truncates the history list in large
size pieces, and if we here reach the head of the list, the
list cannot be longer than 2000 000 undo logs now. */
if (trx_sys->rseg_history_len > 2000000) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: purge reached the"
" head of the history list,\n"
"InnoDB: but its length is still"
" reported as %lu! Make a detailed bug\n"
"InnoDB: report, and submit it"
" to https://jira.mariadb.org/\n",
(ulong) trx_sys->rseg_history_len);
ut_ad(0);
}
mutex_exit(&trx_sys->mutex);
return; return;
} }

View File

@ -34,4 +34,5 @@ ADD_DEFINITIONS(-DDISABLE_MYSQL_THREAD_H)
ADD_CONVENIENCE_LIBRARY(strings ${STRINGS_SOURCES}) ADD_CONVENIENCE_LIBRARY(strings ${STRINGS_SOURCES})
ADD_EXECUTABLE(conf_to_src EXCLUDE_FROM_ALL conf_to_src.c) ADD_EXECUTABLE(conf_to_src EXCLUDE_FROM_ALL conf_to_src.c)
TARGET_LINK_LIBRARIES(conf_to_src strings) SET_TARGET_PROPERTIES(conf_to_src PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
TARGET_LINK_LIBRARIES(conf_to_src mysys strings)