Commit 633d252e authored by Marko Mäkelä's avatar Marko Mäkelä

Merge bb-10.2-ext into 10.3

parents f40c11d8 4074c745
......@@ -2705,7 +2705,11 @@ fts_cmp_set_sync_doc_id(
fts_table.parent = table->name.m_name;
trx = trx_allocate_for_background();
if (srv_read_only_mode) {
trx_start_internal_read_only(trx);
} else {
trx_start_internal(trx);
}
trx->op_info = "update the next FTS document id";
......@@ -2814,6 +2818,10 @@ fts_update_sync_doc_id(
fts_cache_t* cache = table->fts->cache;
char fts_name[MAX_FULL_NAME_LEN];
if (srv_read_only_mode) {
return DB_READ_ONLY;
}
fts_table.suffix = "CONFIG";
fts_table.table_id = table->id;
fts_table.type = FTS_COMMON_TABLE;
......@@ -3058,6 +3066,10 @@ fts_commit_table(
/*=============*/
fts_trx_table_t* ftt) /*!< in: FTS table to commit*/
{
if (srv_read_only_mode) {
return DB_READ_ONLY;
}
const ib_rbt_node_t* node;
ib_rbt_t* rows;
dberr_t error = DB_SUCCESS;
......@@ -3807,7 +3819,6 @@ fts_doc_fetch_by_doc_id(
trx_t* trx = trx_allocate_for_background();
que_t* graph;
trx_start_internal(trx);
trx->op_info = "fetching indexed FTS document";
/* The FTS index can be supplied by caller directly with
......@@ -3895,13 +3906,7 @@ fts_doc_fetch_by_doc_id(
}
error = fts_eval_sql(trx, graph);
if (error == DB_SUCCESS) {
fts_sql_commit(trx);
} else {
fts_sql_rollback(trx);
}
trx_free_for_background(trx);
if (!get_doc) {
......@@ -4370,6 +4375,10 @@ fts_sync(
bool wait,
bool has_dict)
{
if (srv_read_only_mode) {
return DB_READ_ONLY;
}
ulint i;
dberr_t error = DB_SUCCESS;
fts_cache_t* cache = sync->table->fts->cache;
......@@ -7346,7 +7355,11 @@ fts_load_stopword(
if (!trx) {
trx = trx_allocate_for_background();
if (srv_read_only_mode) {
trx_start_internal_read_only(trx);
} else {
trx_start_internal(trx);
}
trx->op_info = "upload FTS stopword";
new_trx = TRUE;
}
......
......@@ -989,7 +989,6 @@ fts_table_fetch_doc_ids(
if (!trx) {
trx = trx_allocate_for_background();
trx_start_internal(trx);
alloc_bk_trx = TRUE;
}
......@@ -1018,17 +1017,14 @@ fts_table_fetch_doc_ids(
"CLOSE c;");
error = fts_eval_sql(trx, graph);
fts_sql_commit(trx);
mutex_enter(&dict_sys->mutex);
que_graph_free(graph);
mutex_exit(&dict_sys->mutex);
if (error == DB_SUCCESS) {
fts_sql_commit(trx);
ib_vector_sort(doc_ids->doc_ids, fts_update_doc_id_cmp);
} else {
fts_sql_rollback(trx);
}
if (alloc_bk_trx) {
......@@ -2442,6 +2438,10 @@ fts_optimize_table(
/*===============*/
dict_table_t* table) /*!< in: table to optimiza */
{
if (srv_read_only_mode) {
return DB_READ_ONLY;
}
dberr_t error = DB_SUCCESS;
fts_optimize_t* optim = NULL;
fts_t* fts = table->fts;
......
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