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
1a1a2c99
Commit
1a1a2c99
authored
Oct 04, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new-maint
into polly.(none):/home/kaa/src/maint/mysql-5.1-maint
parents
53ce766b
6d0e074c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
0 deletions
+34
-0
mysql-test/r/variables.result
mysql-test/r/variables.result
+2
-0
mysql-test/t/variables.test
mysql-test/t/variables.test
+1
-0
mysys/my_getopt.c
mysys/my_getopt.c
+16
-0
sql/set_var.cc
sql/set_var.cc
+15
-0
No files found.
mysql-test/r/variables.result
View file @
1a1a2c99
...
...
@@ -286,6 +286,8 @@ select * from information_schema.session_variables where variable_name like 'net
VARIABLE_NAME VARIABLE_VALUE
NET_BUFFER_LENGTH 1024
set net_buffer_length=2000000000;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '2000000000'
show variables like 'net_buffer_length';
Variable_name Value
net_buffer_length 1048576
...
...
mysql-test/t/variables.test
View file @
1a1a2c99
...
...
@@ -161,6 +161,7 @@ select * from information_schema.session_variables where variable_name like 'net
set
net_buffer_length
=
1
;
show
variables
like
'net_buffer_length'
;
select
*
from
information_schema
.
session_variables
where
variable_name
like
'net_buffer_length'
;
--
warning
1292
set
net_buffer_length
=
2000000000
;
show
variables
like
'net_buffer_length'
;
select
*
from
information_schema
.
session_variables
where
variable_name
like
'net_buffer_length'
;
...
...
mysys/my_getopt.c
View file @
1a1a2c99
...
...
@@ -19,6 +19,7 @@
#include <my_sys.h>
#include <mysys_err.h>
#include <my_getopt.h>
#include <errno.h>
static
void
default_reporter
(
enum
loglevel
level
,
const
char
*
format
,
...);
my_error_reporter
my_getopt_error_reporter
=
&
default_reporter
;
...
...
@@ -730,7 +731,15 @@ static longlong eval_num_suffix(char *argument, int *error, char *option_name)
longlong
num
;
*
error
=
0
;
errno
=
0
;
num
=
strtoll
(
argument
,
&
endchar
,
10
);
if
(
errno
==
ERANGE
)
{
my_getopt_error_reporter
(
ERROR_LEVEL
,
"Incorrect integer value: '%s'"
,
argument
);
*
error
=
1
;
return
0
;
}
if
(
*
endchar
==
'k'
||
*
endchar
==
'K'
)
num
*=
1024L
;
else
if
(
*
endchar
==
'm'
||
*
endchar
==
'M'
)
...
...
@@ -767,7 +776,14 @@ static longlong getopt_ll(char *arg, const struct my_option *optp, int *err)
num
=
eval_num_suffix
(
arg
,
err
,
(
char
*
)
optp
->
name
);
if
(
num
>
0
&&
(
ulonglong
)
num
>
(
ulonglong
)
optp
->
max_value
&&
optp
->
max_value
)
/* if max value is not set -> no upper limit */
{
char
buf
[
22
];
my_getopt_error_reporter
(
WARNING_LEVEL
,
"Truncated incorrect %s value: '%s'"
,
optp
->
name
,
llstr
(
num
,
buf
));
num
=
(
ulonglong
)
optp
->
max_value
;
}
num
=
((
num
-
optp
->
sub_size
)
/
block_size
);
num
=
(
longlong
)
(
num
*
block_size
);
return
max
(
num
,
optp
->
min_value
);
...
...
sql/set_var.cc
View file @
1a1a2c99
...
...
@@ -1188,16 +1188,31 @@ bool sys_var_thd_ulong::check(THD *thd, set_var *var)
bool
sys_var_thd_ulong
::
update
(
THD
*
thd
,
set_var
*
var
)
{
ulonglong
tmp
=
var
->
save_result
.
ulonglong_value
;
char
buf
[
22
];
bool
truncated
=
false
;
/* Don't use bigger value than given with --maximum-variable-name=.. */
if
((
ulong
)
tmp
>
max_system_variables
.
*
offset
)
{
truncated
=
true
;
llstr
(
tmp
,
buf
);
tmp
=
max_system_variables
.
*
offset
;
}
#if SIZEOF_LONG == 4
/* Avoid overflows on 32 bit systems */
if
(
tmp
>
(
ulonglong
)
~
(
ulong
)
0
)
{
truncated
=
true
;
llstr
(
tmp
,
buf
);
tmp
=
((
ulonglong
)
~
(
ulong
)
0
);
}
#endif
if
(
truncated
)
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_TRUNCATED_WRONG_VALUE
,
ER
(
ER_TRUNCATED_WRONG_VALUE
),
name
,
buf
);
if
(
option_limits
)
tmp
=
(
ulong
)
getopt_ull_limit_value
(
tmp
,
option_limits
);
...
...
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