diff options
Diffstat (limited to 'storage/xtradb/fts/fts0que.cc')
-rw-r--r-- | storage/xtradb/fts/fts0que.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/storage/xtradb/fts/fts0que.cc b/storage/xtradb/fts/fts0que.cc index 100dbcd70ca..b9ad43c626a 100644 --- a/storage/xtradb/fts/fts0que.cc +++ b/storage/xtradb/fts/fts0que.cc @@ -1,7 +1,7 @@ /***************************************************************************** -Copyright (c) 2007, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2017, 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 @@ -76,7 +76,7 @@ struct fts_query_t { fts_table_t fts_index_table;/*!< FTS auxiliary index table def */ - ulint total_size; /*!< total memory size used by query */ + size_t total_size; /*!< total memory size used by query */ fts_doc_ids_t* deleted; /*!< Deleted doc ids that need to be filtered from the output */ @@ -3989,6 +3989,7 @@ fts_query( /* Parse the input query string. */ if (fts_query_parse(&query, lc_query_str, result_len)) { fts_ast_node_t* ast = query.root; + ast->trx = trx; /* Optimize query to check if it's a single term */ fts_query_can_optimize(&query, flags); @@ -4002,6 +4003,11 @@ fts_query( query.error = fts_ast_visit( FTS_NONE, ast, fts_query_visitor, &query, &will_be_ignored); + if (query.error == DB_INTERRUPTED) { + error = DB_INTERRUPTED; + ut_free(lc_query_str); + goto func_exit; + } /* If query expansion is requested, extend the search with first search pass result */ @@ -4029,6 +4035,15 @@ fts_query( memset(*result, 0, sizeof(**result)); } + if (trx_is_interrupted(trx)) { + error = DB_INTERRUPTED; + ut_free(lc_query_str); + if (*result) { + fts_query_free_result(*result); + } + goto func_exit; + } + ut_free(lc_query_str); if (fts_enable_diag_print && (*result)) { @@ -4043,7 +4058,7 @@ fts_query( /* Log memory consumption & result size */ ib_logf(IB_LOG_LEVEL_INFO, "Full Search Memory: " - "%lu (bytes), Row: %lu .", + "%zu (bytes), Row: %lu .", query.total_size, (*result)->rankings_by_id ? rbt_size((*result)->rankings_by_id) |