Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7e2f9d09
Commit
7e2f9d09
authored
Dec 12, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
max_session_mem_used server variable
parent
ab3388c3
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
226 additions
and
174 deletions
+226
-174
mysql-test/r/mysqld--help.result
mysql-test/r/mysqld--help.result
+5
-0
mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
...test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
+84
-84
mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+14
-0
mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
...t/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
+88
-88
mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
...l-test/suite/sys_vars/r/sysvars_server_notembedded.result
+14
-0
sql/mysqld.cc
sql/mysqld.cc
+9
-0
sql/sql_class.cc
sql/sql_class.cc
+4
-2
sql/sql_class.h
sql/sql_class.h
+1
-0
sql/sys_vars.cc
sql/sys_vars.cc
+7
-0
No files found.
mysql-test/r/mysqld--help.result
View file @
7e2f9d09
...
...
@@ -457,6 +457,10 @@ The following options may be given as the first argument:
--max-seeks-for-key=#
Limit assumed max number of seeks when looking up rows
based on a key
--max-session-mem-used=#
Amount of memory a single user session is allowed to
allocate. This limits the value of the session variable
MEM_USED
--max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
values (only the first max_sort_length bytes of each
value are used; the rest are ignored)
...
...
@@ -1266,6 +1270,7 @@ max-long-data-size 4194304
max-prepared-stmt-count 16382
max-relay-log-size 1073741824
max-seeks-for-key 18446744073709551615
max-session-mem-used 9223372036854775807
max-sort-length 1024
max-sp-recursion-depth 0
max-statement-time 0
...
...
mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
View file @
7e2f9d09
This diff is collapsed.
Click to expand it.
mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
View file @
7e2f9d09
...
...
@@ -1997,6 +1997,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SESSION_MEM_USED
SESSION_VALUE 9223372036854775807
GLOBAL_VALUE 9223372036854775807
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 9223372036854775807
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Amount of memory a single user session is allowed to allocate. This limits the value of the session variable MEM_USED
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SORT_LENGTH
SESSION_VALUE 1024
GLOBAL_VALUE 1024
...
...
mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
View file @
7e2f9d09
This diff is collapsed.
Click to expand it.
mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
View file @
7e2f9d09
...
...
@@ -2193,6 +2193,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SESSION_MEM_USED
SESSION_VALUE 9223372036854775807
GLOBAL_VALUE 9223372036854775807
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 9223372036854775807
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Amount of memory a single user session is allowed to allocate. This limits the value of the session variable MEM_USED
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SORT_LENGTH
SESSION_VALUE 1024
GLOBAL_VALUE 1024
...
...
sql/mysqld.cc
View file @
7e2f9d09
...
...
@@ -4001,6 +4001,15 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
(
longlong
)
thd
->
status_var
.
local_memory_used
,
size
));
thd
->
status_var
.
local_memory_used
+=
size
;
if
(
thd
->
status_var
.
local_memory_used
>
(
int64
)
thd
->
variables
.
max_mem_used
&&
!
thd
->
killed
)
{
char
buf
[
1024
];
thd
->
killed
=
KILL_QUERY
;
my_snprintf
(
buf
,
sizeof
(
buf
),
"--max-thread-mem-used=%llu"
,
thd
->
variables
.
max_mem_used
);
my_error
(
ER_OPTION_PREVENTS_STATEMENT
,
MYF
(
0
),
buf
);
}
DBUG_ASSERT
((
longlong
)
thd
->
status_var
.
local_memory_used
>=
0
);
}
else
if
(
likely
(
thd
))
...
...
sql/sql_class.cc
View file @
7e2f9d09
...
...
@@ -906,8 +906,8 @@ THD::THD(bool is_wsrep_applier)
#endif
{
ulong
tmp
;
bzero
(
&
variables
,
sizeof
(
variables
));
mdl_context
.
init
(
this
);
/*
We set THR_THD to temporally point to this THD to register all the
variables that allocates memory for this THD
...
...
@@ -916,8 +916,11 @@ THD::THD(bool is_wsrep_applier)
set_current_thd
(
this
);
status_var
.
local_memory_used
=
sizeof
(
THD
);
status_var
.
global_memory_used
=
0
;
variables
.
max_mem_used
=
global_system_variables
.
max_mem_used
;
main_da
.
init
();
mdl_context
.
init
(
this
);
/*
Pass nominal parameters to init_alloc_root only to ensure that
the destructor works OK in case of an error. The main_mem_root
...
...
@@ -964,7 +967,6 @@ THD::THD(bool is_wsrep_applier)
connection_name
.
str
=
0
;
connection_name
.
length
=
0
;
bzero
(
&
variables
,
sizeof
(
variables
));
file_id
=
0
;
query_id
=
0
;
query_name_consts
=
0
;
...
...
sql/sql_class.h
View file @
7e2f9d09
...
...
@@ -540,6 +540,7 @@ typedef struct system_variables
ulonglong
sortbuff_size
;
ulonglong
group_concat_max_len
;
ulonglong
default_regex_flags
;
ulonglong
max_mem_used
;
/**
Place holders to store Multi-source variables in sys_var.cc during
...
...
sql/sys_vars.cc
View file @
7e2f9d09
...
...
@@ -5401,3 +5401,10 @@ static Sys_var_ulong Sys_log_tc_size(
DEFAULT
(
my_getpagesize
()
*
6
),
BLOCK_SIZE
(
my_getpagesize
()));
#endif
static
Sys_var_ulonglong
Sys_max_thread_mem
(
"max_session_mem_used"
,
"Amount of memory a single user session "
"is allowed to allocate. This limits the value of the "
"session variable MEM_USED"
,
SESSION_VAR
(
max_mem_used
),
CMD_LINE
(
REQUIRED_ARG
),
VALID_RANGE
(
8192
,
ULONGLONG_MAX
),
DEFAULT
(
LONGLONG_MAX
),
BLOCK_SIZE
(
1
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment