summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2018-10-16 13:02:50 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2018-10-16 13:02:50 +0530
commit1dacd5f299be63b8dea8f6ff802739abba96b4e1 (patch)
tree6c3b89f7262e5deee84f1f98681b841f6809a994 /storage
parent3c5f6aa21c54e2f93c96162a23f2e32772cf50bf (diff)
downloadmariadb-git-1dacd5f299be63b8dea8f6ff802739abba96b4e1.tar.gz
MDEV-12547: InnoDB FULLTEXT index has too strict innodb_ft_result_cache_limit max limit
- Backported the MYSQL_SYSVAR_SIZE_T to 10.0 - The parameter innodb_ft_result_cache_limit was only 32 bits wide also on 64-bit systems. Make it size_t, so that it will be 64 bits on 64-bit systems. - Added a test case that show how innodb_ft_result_cache_limit variables behaves in 32bit and 64 bit system.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/fts/fts0fts.cc4
-rw-r--r--storage/innobase/fts/fts0que.cc6
-rw-r--r--storage/innobase/handler/ha_innodb.cc4
-rw-r--r--storage/innobase/include/fts0fts.h2
-rw-r--r--storage/innobase/include/fts0types.h4
-rw-r--r--storage/xtradb/fts/fts0fts.cc4
-rw-r--r--storage/xtradb/fts/fts0que.cc6
-rw-r--r--storage/xtradb/handler/ha_innodb.cc4
-rw-r--r--storage/xtradb/include/fts0fts.h2
-rw-r--r--storage/xtradb/include/fts0types.h4
10 files changed, 20 insertions, 20 deletions
diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc
index 6044abd8e79..4891e572741 100644
--- a/storage/innobase/fts/fts0fts.cc
+++ b/storage/innobase/fts/fts0fts.cc
@@ -67,7 +67,7 @@ UNIV_INTERN ulong fts_max_total_cache_size;
/** This is FTS result cache limit for each query and would be
a configurable variable */
-UNIV_INTERN ulong fts_result_cache_limit;
+UNIV_INTERN size_t fts_result_cache_limit;
/** Variable specifying the maximum FTS max token size */
UNIV_INTERN ulong fts_max_token_size;
@@ -4308,7 +4308,7 @@ fts_sync_begin(
if (fts_enable_diag_print) {
ib_logf(IB_LOG_LEVEL_INFO,
"FTS SYNC for table %s, deleted count: %ld size: "
- "%lu bytes",
+ "%zu bytes",
sync->table->name,
ib_vector_size(cache->deleted_doc_ids),
cache->total_size);
diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc
index 78521df75d9..7983181c23a 100644
--- a/storage/innobase/fts/fts0que.cc
+++ b/storage/innobase/fts/fts0que.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+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 */
@@ -4039,7 +4039,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)
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 58060cd2edb..2092cd113a5 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -16931,10 +16931,10 @@ static MYSQL_SYSVAR_ULONG(ft_total_cache_size, fts_max_total_cache_size,
"Total memory allocated for InnoDB Fulltext Search cache",
NULL, NULL, 640000000, 32000000, 1600000000, 0);
-static MYSQL_SYSVAR_ULONG(ft_result_cache_limit, fts_result_cache_limit,
+static MYSQL_SYSVAR_SIZE_T(ft_result_cache_limit, fts_result_cache_limit,
PLUGIN_VAR_RQCMDARG,
"InnoDB Fulltext search query result cache limit in bytes",
- NULL, NULL, 2000000000L, 1000000L, 4294967295UL, 0);
+ NULL, NULL, 2000000000L, 1000000L, SIZE_T_MAX, 0);
static MYSQL_SYSVAR_ULONG(ft_min_token_size, fts_min_token_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h
index 4c2d247e0a6..ce30a17c4b4 100644
--- a/storage/innobase/include/fts0fts.h
+++ b/storage/innobase/include/fts0fts.h
@@ -355,7 +355,7 @@ extern ulong fts_max_cache_size;
extern ulong fts_max_total_cache_size;
/** Variable specifying the FTS result cache limit for each query */
-extern ulong fts_result_cache_limit;
+extern size_t fts_result_cache_limit;
/** Variable specifying the maximum FTS max token size */
extern ulong fts_max_token_size;
diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h
index 0dad75d8f1b..9ecd9080881 100644
--- a/storage/innobase/include/fts0types.h
+++ b/storage/innobase/include/fts0types.h
@@ -161,7 +161,7 @@ struct fts_cache_t {
the document from the table. Each
element is of type fts_doc_t */
- ulint total_size; /*!< total size consumed by the ilist
+ size_t total_size; /*!< total size consumed by the ilist
field of all nodes. SYNC is run
whenever this gets too big */
fts_sync_t* sync; /*!< sync structure to sync data to
@@ -243,7 +243,7 @@ struct fts_fetch_t {
fts_sql_callback
read_record; /*!< Callback for reading index
record */
- ulint total_memory; /*!< Total memory used */
+ size_t total_memory; /*!< Total memory used */
};
/** For horizontally splitting an FTS auxiliary index */
diff --git a/storage/xtradb/fts/fts0fts.cc b/storage/xtradb/fts/fts0fts.cc
index 2f9e331219b..e2a479bf0ae 100644
--- a/storage/xtradb/fts/fts0fts.cc
+++ b/storage/xtradb/fts/fts0fts.cc
@@ -67,7 +67,7 @@ UNIV_INTERN ulong fts_max_total_cache_size;
/** This is FTS result cache limit for each query and would be
a configurable variable */
-UNIV_INTERN ulong fts_result_cache_limit;
+UNIV_INTERN size_t fts_result_cache_limit;
/** Variable specifying the maximum FTS max token size */
UNIV_INTERN ulong fts_max_token_size;
@@ -4308,7 +4308,7 @@ fts_sync_begin(
if (fts_enable_diag_print) {
ib_logf(IB_LOG_LEVEL_INFO,
"FTS SYNC for table %s, deleted count: %ld size: "
- "%lu bytes",
+ "%zu bytes",
sync->table->name,
ib_vector_size(cache->deleted_doc_ids),
cache->total_size);
diff --git a/storage/xtradb/fts/fts0que.cc b/storage/xtradb/fts/fts0que.cc
index 9966656e772..b9ad43c626a 100644
--- a/storage/xtradb/fts/fts0que.cc
+++ b/storage/xtradb/fts/fts0que.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2007, 2018, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+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 */
@@ -4058,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)
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index e32d928d45e..6bc4c76f88e 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -18460,10 +18460,10 @@ static MYSQL_SYSVAR_ULONG(ft_total_cache_size, fts_max_total_cache_size,
"Total memory allocated for InnoDB Fulltext Search cache",
NULL, NULL, 640000000, 32000000, 1600000000, 0);
-static MYSQL_SYSVAR_ULONG(ft_result_cache_limit, fts_result_cache_limit,
+static MYSQL_SYSVAR_SIZE_T(ft_result_cache_limit, fts_result_cache_limit,
PLUGIN_VAR_RQCMDARG,
"InnoDB Fulltext search query result cache limit in bytes",
- NULL, NULL, 2000000000L, 1000000L, 4294967295UL, 0);
+ NULL, NULL, 2000000000L, 1000000L, SIZE_T_MAX, 0);
static MYSQL_SYSVAR_ULONG(ft_min_token_size, fts_min_token_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
diff --git a/storage/xtradb/include/fts0fts.h b/storage/xtradb/include/fts0fts.h
index 4c2d247e0a6..ce30a17c4b4 100644
--- a/storage/xtradb/include/fts0fts.h
+++ b/storage/xtradb/include/fts0fts.h
@@ -355,7 +355,7 @@ extern ulong fts_max_cache_size;
extern ulong fts_max_total_cache_size;
/** Variable specifying the FTS result cache limit for each query */
-extern ulong fts_result_cache_limit;
+extern size_t fts_result_cache_limit;
/** Variable specifying the maximum FTS max token size */
extern ulong fts_max_token_size;
diff --git a/storage/xtradb/include/fts0types.h b/storage/xtradb/include/fts0types.h
index 0dad75d8f1b..9ecd9080881 100644
--- a/storage/xtradb/include/fts0types.h
+++ b/storage/xtradb/include/fts0types.h
@@ -161,7 +161,7 @@ struct fts_cache_t {
the document from the table. Each
element is of type fts_doc_t */
- ulint total_size; /*!< total size consumed by the ilist
+ size_t total_size; /*!< total size consumed by the ilist
field of all nodes. SYNC is run
whenever this gets too big */
fts_sync_t* sync; /*!< sync structure to sync data to
@@ -243,7 +243,7 @@ struct fts_fetch_t {
fts_sql_callback
read_record; /*!< Callback for reading index
record */
- ulint total_memory; /*!< Total memory used */
+ size_t total_memory; /*!< Total memory used */
};
/** For horizontally splitting an FTS auxiliary index */