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
fe8d3ddd
Commit
fe8d3ddd
authored
Dec 06, 2007
by
tnurnberg@white.intern.koehntopp.de
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/misc/mysql/31177/50-31177
into mysql.com:/misc/mysql/31177/51-31177
parents
ae8b22d9
b1e77cfc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
sql/set_var.cc
sql/set_var.cc
+24
-8
sql/set_var.h
sql/set_var.h
+1
-0
No files found.
sql/set_var.cc
View file @
fe8d3ddd
...
...
@@ -122,6 +122,7 @@ static void fix_trans_mem_root(THD *thd, enum_var_type type);
static
void
fix_server_id
(
THD
*
thd
,
enum_var_type
type
);
static
ulonglong
fix_unsigned
(
THD
*
thd
,
ulonglong
num
,
const
struct
my_option
*
option_limits
);
static
bool
get_unsigned
(
THD
*
thd
,
set_var
*
var
);
static
void
throw_bounds_warning
(
THD
*
thd
,
const
char
*
name
,
ulonglong
num
);
static
KEY_CACHE
*
create_key_cache
(
const
char
*
name
,
uint
length
);
void
fix_sql_mode_var
(
THD
*
thd
,
enum_var_type
type
);
...
...
@@ -1124,6 +1125,18 @@ static ulonglong fix_unsigned(THD *thd, ulonglong num,
return
out
;
}
static
bool
get_unsigned
(
THD
*
thd
,
set_var
*
var
)
{
if
(
var
->
value
->
unsigned_flag
)
var
->
save_result
.
ulonglong_value
=
(
ulonglong
)
var
->
value
->
val_int
();
else
{
longlong
v
=
var
->
value
->
val_int
();
var
->
save_result
.
ulonglong_value
=
(
ulonglong
)
((
v
<
0
)
?
0
:
v
);
}
return
0
;
}
sys_var_long_ptr
::
sys_var_long_ptr
(
sys_var_chain
*
chain
,
const
char
*
name_arg
,
ulong
*
value_ptr_arg
,
...
...
@@ -1135,9 +1148,7 @@ sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr_ar
bool
sys_var_long_ptr_global
::
check
(
THD
*
thd
,
set_var
*
var
)
{
longlong
v
=
var
->
value
->
val_int
();
var
->
save_result
.
ulonglong_value
=
v
<
0
?
0
:
v
;
return
0
;
return
get_unsigned
(
thd
,
var
);
}
bool
sys_var_long_ptr_global
::
update
(
THD
*
thd
,
set_var
*
var
)
...
...
@@ -1150,9 +1161,9 @@ bool sys_var_long_ptr_global::update(THD *thd, set_var *var)
{
#if SIZEOF_LONG < SIZEOF_LONG_LONG
/* Avoid overflows on 32 bit systems */
if
(
tmp
>
(
ulonglong
)
~
(
ulong
)
0
)
if
(
tmp
>
ULONG_MAX
)
{
tmp
=
((
ulonglong
)
~
(
ulong
)
0
)
;
tmp
=
ULONG_MAX
;
throw_bounds_warning
(
thd
,
name
,
var
->
save_result
.
ulonglong_value
);
}
#endif
...
...
@@ -1220,7 +1231,7 @@ uchar *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
bool
sys_var_thd_ulong
::
check
(
THD
*
thd
,
set_var
*
var
)
{
return
(
sys_var_thd
::
check
(
thd
,
var
)
||
return
(
get_unsigned
(
thd
,
var
)
||
(
check_func
&&
(
*
check_func
)(
thd
,
var
)));
}
...
...
@@ -1238,9 +1249,9 @@ bool sys_var_thd_ulong::update(THD *thd, set_var *var)
if
(
option_limits
)
tmp
=
(
ulong
)
fix_unsigned
(
thd
,
tmp
,
option_limits
);
#if SIZEOF_LONG < SIZEOF_LONG_LONG
else
if
(
tmp
>
(
ulonglong
)
~
(
ulong
)
0
)
else
if
(
tmp
>
ULONG_MAX
)
{
tmp
=
((
ulonglong
)
~
(
ulong
)
0
)
;
tmp
=
ULONG_MAX
;
throw_bounds_warning
(
thd
,
name
,
var
->
save_result
.
ulonglong_value
);
}
#endif
...
...
@@ -1320,6 +1331,11 @@ uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
return
(
uchar
*
)
&
(
thd
->
variables
.
*
offset
);
}
bool
sys_var_thd_ulonglong
::
check
(
THD
*
thd
,
set_var
*
var
)
{
return
get_unsigned
(
thd
,
var
);
}
bool
sys_var_thd_ulonglong
::
update
(
THD
*
thd
,
set_var
*
var
)
{
ulonglong
tmp
=
var
->
save_result
.
ulonglong_value
;
...
...
sql/set_var.h
View file @
fe8d3ddd
...
...
@@ -379,6 +379,7 @@ class sys_var_thd_ulonglong :public sys_var_thd
void
set_default
(
THD
*
thd
,
enum_var_type
type
);
SHOW_TYPE
show_type
()
{
return
SHOW_LONGLONG
;
}
uchar
*
value_ptr
(
THD
*
thd
,
enum_var_type
type
,
LEX_STRING
*
base
);
bool
check
(
THD
*
thd
,
set_var
*
var
);
bool
check_default
(
enum_var_type
type
)
{
return
type
==
OPT_GLOBAL
&&
!
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