mirror of
https://github.com/MariaDB/server.git
synced 2025-04-18 21:44:20 +03:00
MDEV-36061 Incorrect error handling on DDL with FULLTEXT INDEX
row_create_index_for_mysql(): Tolerate DB_LOCK_TABLE_FULL better. fts_create_one_common_table(), fts_create_one_index_table(): Do not corrupt the error state of a non-active transaction object. fts_config_set_value(): Only run another statement if there was no error yet.
This commit is contained in:
parent
c07e355c40
commit
7587b0ec84
@ -5,6 +5,9 @@ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||
title VARCHAR(200),
|
||||
content TEXT
|
||||
) ENGINE= InnoDB;
|
||||
SET STATEMENT debug_dbug='+d,innodb_report_deadlock' FOR
|
||||
CREATE FULLTEXT INDEX idx ON articles (title, content);
|
||||
ERROR HY000: Got error 11 "Resource temporarily unavailable" from storage engine InnoDB
|
||||
CREATE FULLTEXT INDEX idx ON articles (title, content);
|
||||
INSERT INTO articles (title, content) VALUES
|
||||
('MySQL Tutorial','DBMS stands for MySQL DataBase ...'),
|
||||
|
@ -3,6 +3,9 @@
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_debug.inc
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: \\(Deadlock\\) writing `use_stopword'");
|
||||
--enable_query_log
|
||||
|
||||
SET @optimize=@@GLOBAL.INNODB_OPTIMIZE_FULLTEXT_ONLY;
|
||||
SET GLOBAL INNODB_OPTIMIZE_FULLTEXT_ONLY=1;
|
||||
@ -14,6 +17,9 @@ CREATE TABLE articles (
|
||||
content TEXT
|
||||
) ENGINE= InnoDB;
|
||||
|
||||
--error ER_GET_ERRNO
|
||||
SET STATEMENT debug_dbug='+d,innodb_report_deadlock' FOR
|
||||
CREATE FULLTEXT INDEX idx ON articles (title, content);
|
||||
CREATE FULLTEXT INDEX idx ON articles (title, content);
|
||||
|
||||
INSERT INTO articles (title, content) VALUES
|
||||
|
@ -231,7 +231,7 @@ fts_config_set_value(
|
||||
n_rows_updated = trx->undo_no - undo_no;
|
||||
|
||||
/* Check if we need to do an insert. */
|
||||
if (n_rows_updated == 0) {
|
||||
if (error == DB_SUCCESS && n_rows_updated == 0) {
|
||||
info = pars_info_create();
|
||||
|
||||
pars_info_bind_varchar_literal(
|
||||
|
@ -37,6 +37,7 @@ Full Text Search interface
|
||||
#include "fts0plugin.h"
|
||||
#include "dict0stats.h"
|
||||
#include "btr0pcur.h"
|
||||
#include "log.h"
|
||||
|
||||
static const ulint FTS_MAX_ID_LEN = 32;
|
||||
|
||||
@ -1870,8 +1871,10 @@ fts_create_one_common_table(
|
||||
}
|
||||
}
|
||||
|
||||
ib::warn() << "Failed to create FTS common table " << fts_table_name;
|
||||
trx->error_state = error;
|
||||
ut_ad(trx->state == TRX_STATE_NOT_STARTED
|
||||
|| trx->error_state == error);
|
||||
sql_print_warning("InnoDB: Failed to create FTS common table %s: %s",
|
||||
fts_table_name, ut_strerr(error));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -2055,8 +2058,10 @@ fts_create_one_index_table(
|
||||
}
|
||||
}
|
||||
|
||||
ib::warn() << "Failed to create FTS index table " << table_name;
|
||||
trx->error_state = error;
|
||||
ut_ad(trx->state == TRX_STATE_NOT_STARTED
|
||||
|| trx->error_state == error);
|
||||
sql_print_warning("InnoDB: Failed to create FTS index table %s: %s",
|
||||
table_name, ut_strerr(error));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2181,11 +2181,9 @@ row_create_index_for_mysql(
|
||||
|
||||
index = node->index;
|
||||
|
||||
ut_ad(!index == (err != DB_SUCCESS));
|
||||
|
||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||
|
||||
if (index && (index->type & DICT_FTS)) {
|
||||
if (err == DB_SUCCESS && (index->type & DICT_FTS)) {
|
||||
err = fts_create_index_tables(trx, index, table->id);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user