summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorDaniel Black <daniel@linux.vnet.ibm.com>2018-03-27 07:55:56 +1100
committerSergey Vojtovich <svoj@mariadb.org>2018-04-03 10:37:20 +0400
commit8ffbb825e6a09d3055f46ed4b456573aef5c474c (patch)
treebfd9c343b03ead1361e5a75f455ca790fe662e97 /sql
parent10f6b7001bd7b683c013ae407c2c48793caa3633 (diff)
downloadmariadb-git-8ffbb825e6a09d3055f46ed4b456573aef5c474c.tar.gz
increase upper value of max_prepared_stmt_count to UINT32_MAX
The upper 1M limit for max_prepared_stmt_count was set over 10 years ago. It doesn't suite current hardware and a sysbench oltp_read_write test with 512 threads will hit this limit.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/mysqld.h2
-rw-r--r--sql/share/errmsg-utf8.txt4
-rw-r--r--sql/sys_vars.cc4
4 files changed, 7 insertions, 7 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 435fb07279f..f9089ed9eb9 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -532,7 +532,7 @@ bool max_user_connections_checking=0;
Limit of the total number of prepared statements in the server.
Is necessary to protect the server against out-of-memory attacks.
*/
-ulong max_prepared_stmt_count;
+uint max_prepared_stmt_count;
/**
Current total number of prepared statements in the server. This number
is exact, and therefore may not be equal to the difference between
@@ -543,7 +543,7 @@ ulong max_prepared_stmt_count;
two different connections, this counts as two distinct prepared
statements.
*/
-ulong prepared_stmt_count=0;
+uint prepared_stmt_count=0;
ulong thread_id=1L,current_pid;
ulong slow_launch_threads = 0;
uint sync_binlog_period= 0, sync_relaylog_period= 0,
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 78e832e4abc..188ac0449c8 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -178,7 +178,7 @@ extern ulong slave_trans_retries;
extern uint slave_net_timeout;
extern int max_user_connections;
extern ulong what_to_log,flush_time;
-extern ulong max_prepared_stmt_count, prepared_stmt_count;
+extern uint max_prepared_stmt_count, prepared_stmt_count;
extern ulong open_files_limit;
extern ulonglong binlog_cache_size, binlog_stmt_cache_size;
extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 4958473c73d..19611758ee0 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -5577,8 +5577,8 @@ ER_SP_NO_AGGREGATE 42000
eng "AGGREGATE is not supported for stored functions"
ger "AGGREGATE wird bei gespeicherten Funktionen nicht unterstützt"
ER_MAX_PREPARED_STMT_COUNT_REACHED 42000
- eng "Can't create more than max_prepared_stmt_count statements (current value: %lu)"
- ger "Kann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %lu)"
+ eng "Can't create more than max_prepared_stmt_count statements (current value: %u)"
+ ger "Kann nicht mehr Anweisungen als max_prepared_stmt_count erzeugen (aktueller Wert: %u)"
ER_VIEW_RECURSIVE
eng "`%-.192s`.`%-.192s` contains view recursion"
ger "`%-.192s`.`%-.192s` enthält View-Rekursion"
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 8d164ea86f5..edcfd712e3b 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1932,11 +1932,11 @@ static Sys_var_ulong Sys_max_long_data_size(
BLOCK_SIZE(1));
static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count);
-static Sys_var_ulong Sys_max_prepared_stmt_count(
+static Sys_var_uint Sys_max_prepared_stmt_count(
"max_prepared_stmt_count",
"Maximum number of prepared statements in the server",
GLOBAL_VAR(max_prepared_stmt_count), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(0, 1024*1024), DEFAULT(16382), BLOCK_SIZE(1),
+ VALID_RANGE(0, UINT_MAX32), DEFAULT(16382), BLOCK_SIZE(1),
&PLock_prepared_stmt_count);
static Sys_var_ulong Sys_max_sort_length(