Commit 3b99a274 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.0 into 10.1

parents dab4abbb 197bf0fe
...@@ -859,3 +859,32 @@ DROP TABLE dest_db.t1; ...@@ -859,3 +859,32 @@ DROP TABLE dest_db.t1;
DROP TABLE source_db.t1; DROP TABLE source_db.t1;
DROP DATABASE source_db; DROP DATABASE source_db;
DROP DATABASE dest_db; DROP DATABASE dest_db;
#
# BUG #26334149 MYSQL CRASHES WHEN FULL TEXT INDEXES IBD FILES ARE
# ORPHANED DUE TO RENAME TABLE
#
CREATE DATABASE db1;
USE db1;
CREATE TABLE notes (
id int(11) NOT NULL AUTO_INCREMENT,
body text COLLATE utf8_unicode_ci,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
COLLATE=utf8_unicode_ci
ROW_FORMAT=COMPRESSED;
Warnings:
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
Warnings:
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
DROP INDEX index_ft_body ON notes;
Warnings:
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
CREATE DATABASE db2;
RENAME TABLE db1.notes TO db2.notes;
DROP DATABASE db1;
DROP DATABASE db2;
...@@ -481,3 +481,24 @@ eval ALTER TABLE $source_db.t1 DROP INDEX index2, algorithm=inplace; ...@@ -481,3 +481,24 @@ eval ALTER TABLE $source_db.t1 DROP INDEX index2, algorithm=inplace;
eval DROP TABLE $source_db.t1; eval DROP TABLE $source_db.t1;
eval DROP DATABASE $source_db; eval DROP DATABASE $source_db;
eval DROP DATABASE $dest_db; eval DROP DATABASE $dest_db;
--echo #
--echo # BUG #26334149 MYSQL CRASHES WHEN FULL TEXT INDEXES IBD FILES ARE
--echo # ORPHANED DUE TO RENAME TABLE
--echo #
CREATE DATABASE db1; USE db1;
CREATE TABLE notes (
id int(11) NOT NULL AUTO_INCREMENT,
body text COLLATE utf8_unicode_ci,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
COLLATE=utf8_unicode_ci
ROW_FORMAT=COMPRESSED;
ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
DROP INDEX index_ft_body ON notes;
CREATE DATABASE db2;
RENAME TABLE db1.notes TO db2.notes;
DROP DATABASE db1;
DROP DATABASE db2;
...@@ -257,3 +257,37 @@ WHERE MATCH (title,body) ...@@ -257,3 +257,37 @@ WHERE MATCH (title,body)
AGAINST ('"more test proximity"' IN BOOLEAN MODE); AGAINST ('"more test proximity"' IN BOOLEAN MODE);
id title body id title body
drop table articles; drop table articles;
#
# Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
#
create table t1 (f1 int not null primary key, f2 varchar(100),
FTS_DOC_ID bigint(20) unsigned not null,
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
fulltext key (f2))engine=innodb;
insert into t1 values(1, "This is the first record", 20000);
insert into t1 values(2, "This is the second record", 40000);
select FTS_DOC_ID from t1;
FTS_DOC_ID
20000
40000
drop table t1;
create table t1 (f1 int not null primary key, f2 varchar(100),
FTS_DOC_ID bigint(20) unsigned not null auto_increment,
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
fulltext key (f2))engine=innodb;
set auto_increment_increment = 65535;
insert into t1(f1, f2) values(1, "This is the first record");
insert into t1(f1, f2) values(2, "This is the second record");
insert into t1(f1, f2) values(3, "This is the third record");
select FTS_DOC_ID from t1;
FTS_DOC_ID
1
65536
131071
drop table t1;
call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
ERROR HY000: Invalid InnoDB FTS Doc ID
DROP TABLE t1;
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
-- source include/have_innodb.inc -- source include/have_innodb.inc
if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in InnoDB 5.6.10 or earlier
}
# Create FTS table # Create FTS table
CREATE TABLE articles ( CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
...@@ -226,3 +221,37 @@ SELECT * FROM articles ...@@ -226,3 +221,37 @@ SELECT * FROM articles
AGAINST ('"more test proximity"' IN BOOLEAN MODE); AGAINST ('"more test proximity"' IN BOOLEAN MODE);
drop table articles; drop table articles;
--echo #
--echo # Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
--echo #
create table t1 (f1 int not null primary key, f2 varchar(100),
FTS_DOC_ID bigint(20) unsigned not null,
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
fulltext key (f2))engine=innodb;
insert into t1 values(1, "This is the first record", 20000);
insert into t1 values(2, "This is the second record", 40000);
select FTS_DOC_ID from t1;
drop table t1;
create table t1 (f1 int not null primary key, f2 varchar(100),
FTS_DOC_ID bigint(20) unsigned not null auto_increment,
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
fulltext key (f2))engine=innodb;
set auto_increment_increment = 65535;
insert into t1(f1, f2) values(1, "This is the first record");
insert into t1(f1, f2) values(2, "This is the second record");
insert into t1(f1, f2) values(3, "This is the third record");
select FTS_DOC_ID from t1;
drop table t1;
call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
--error 182
INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
DROP TABLE t1;
...@@ -1804,10 +1804,6 @@ PageConverter::update_records( ...@@ -1804,10 +1804,6 @@ PageConverter::update_records(
m_rec_iter.open(block); m_rec_iter.open(block);
if (!page_is_leaf(block->frame)) {
return DB_SUCCESS;
}
while (!m_rec_iter.end()) { while (!m_rec_iter.end()) {
rec_t* rec = m_rec_iter.current(); rec_t* rec = m_rec_iter.current();
...@@ -1922,11 +1918,7 @@ PageConverter::update_index_page( ...@@ -1922,11 +1918,7 @@ PageConverter::update_index_page(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
if (!page_is_leaf(block->frame)) { return page_is_leaf(block->frame) ? update_records(block) : DB_SUCCESS;
return (DB_SUCCESS);
}
return(update_records(block));
} }
/** /**
......
...@@ -1804,10 +1804,6 @@ PageConverter::update_records( ...@@ -1804,10 +1804,6 @@ PageConverter::update_records(
m_rec_iter.open(block); m_rec_iter.open(block);
if (!page_is_leaf(block->frame)) {
return DB_SUCCESS;
}
while (!m_rec_iter.end()) { while (!m_rec_iter.end()) {
rec_t* rec = m_rec_iter.current(); rec_t* rec = m_rec_iter.current();
ibool deleted = rec_get_deleted_flag(rec, comp); ibool deleted = rec_get_deleted_flag(rec, comp);
...@@ -1921,7 +1917,7 @@ PageConverter::update_index_page( ...@@ -1921,7 +1917,7 @@ PageConverter::update_index_page(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
return(update_records(block)); return page_is_leaf(block->frame) ? update_records(block) : DB_SUCCESS;
} }
/** /**
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2000, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, 2018, MariaDB Corporation. Copyright (c) 2015, 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
...@@ -1504,8 +1504,7 @@ row_insert_for_mysql( ...@@ -1504,8 +1504,7 @@ row_insert_for_mysql(
doc_ids difference should not exceed doc_ids difference should not exceed
FTS_DOC_ID_MAX_STEP value. */ FTS_DOC_ID_MAX_STEP value. */
if (next_doc_id > 1 if (doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
&& doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Doc ID " UINT64PF " is too" "InnoDB: Doc ID " UINT64PF " is too"
" big. Its difference with largest" " big. Its difference with largest"
...@@ -5270,7 +5269,8 @@ row_rename_table_for_mysql( ...@@ -5270,7 +5269,8 @@ row_rename_table_for_mysql(
} }
} }
if (dict_table_has_fts_index(table) if ((dict_table_has_fts_index(table)
|| DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID))
&& !dict_tables_have_same_db(old_name, new_name)) { && !dict_tables_have_same_db(old_name, new_name)) {
err = fts_rename_aux_tables(table, new_name, trx); err = fts_rename_aux_tables(table, new_name, trx);
if (err != DB_TABLE_NOT_FOUND) { if (err != DB_TABLE_NOT_FOUND) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment