From 0563f49ba355e27543e940052f35e1a904ef077b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 17 Mar 2015 16:03:05 +0200 Subject: [PATCH] MDEV-7754: innodb assert "array->n_elems < array->max_elems" on a huge blob update Replace static array of thread sync levels with std::vector. --- .../suite/innodb/r/innodb-bigblob.result | 7 +++++++ mysql-test/suite/innodb/t/innodb-bigblob.opt | 2 ++ mysql-test/suite/innodb/t/innodb-bigblob.test | 20 +++++++++++++++++++ storage/innobase/sync/sync0sync.cc | 2 ++ storage/xtradb/sync/sync0sync.cc | 2 ++ 5 files changed, 33 insertions(+) create mode 100644 mysql-test/suite/innodb/r/innodb-bigblob.result create mode 100644 mysql-test/suite/innodb/t/innodb-bigblob.opt create mode 100644 mysql-test/suite/innodb/t/innodb-bigblob.test diff --git a/mysql-test/suite/innodb/r/innodb-bigblob.result b/mysql-test/suite/innodb/r/innodb-bigblob.result new file mode 100644 index 00000000000..314bd3ed088 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-bigblob.result @@ -0,0 +1,7 @@ +call mtr.add_suppression("Resizing redo log from *"); +call mtr.add_suppression("Starting to delete and rewrite log files."); +call mtr.add_suppression("New log files created, LSN=*"); +create table foo (id varchar(37) not null, content longblob) engine=INNODB; +insert into foo (id, content) values('xyz', ''); +update foo set content=repeat('a', 43941888) where id='xyz'; +drop table foo; diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.opt b/mysql-test/suite/innodb/t/innodb-bigblob.opt new file mode 100644 index 00000000000..06cc9e2b979 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-bigblob.opt @@ -0,0 +1,2 @@ +--max-allowed-packet=128M +--innodb-log-file-size=210M diff --git a/mysql-test/suite/innodb/t/innodb-bigblob.test b/mysql-test/suite/innodb/t/innodb-bigblob.test new file mode 100644 index 00000000000..7665c890316 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-bigblob.test @@ -0,0 +1,20 @@ +-- source include/have_innodb.inc +-- source include/big_test.inc +-- source include/not_embedded.inc + +--disable_query_log +let $status_orig=`SELECT @@innodb_status_output`; +--enable_query_log + +call mtr.add_suppression("Resizing redo log from *"); +call mtr.add_suppression("Starting to delete and rewrite log files."); +call mtr.add_suppression("New log files created, LSN=*"); + +create table foo (id varchar(37) not null, content longblob) engine=INNODB; +insert into foo (id, content) values('xyz', ''); +update foo set content=repeat('a', 43941888) where id='xyz'; +drop table foo; + +--disable_query_log +EVAL SET GLOBAL innodb_status_output = $status_orig; +--enable_query_log diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc index 7225ac1a0dc..6a524dc0027 100644 --- a/storage/innobase/sync/sync0sync.cc +++ b/storage/innobase/sync/sync0sync.cc @@ -47,6 +47,8 @@ Created 9/5/1995 Heikki Tuuri #include "ha_prototypes.h" #include "my_cpu.h" +#include + /* There is a bug in Visual Studio 2010. Visual Studio has a feature "Checked Iterators". In a debug build, every iterator operation is checked at runtime for errors, e.g., out of range. diff --git a/storage/xtradb/sync/sync0sync.cc b/storage/xtradb/sync/sync0sync.cc index 131aa718dc9..ed269f86f12 100644 --- a/storage/xtradb/sync/sync0sync.cc +++ b/storage/xtradb/sync/sync0sync.cc @@ -48,6 +48,8 @@ Created 9/5/1995 Heikki Tuuri #include "ha_prototypes.h" #include "my_cpu.h" +#include + /* There is a bug in Visual Studio 2010. Visual Studio has a feature "Checked Iterators". In a debug build, every iterator operation is checked at runtime for errors, e.g., out of range.