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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
155365f0
Commit
155365f0
authored
Oct 19, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria
into gbichot4.local:/home/mysql_src/mysql-maria-for-undo-phase
parents
77017191
fd4ca26d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
15 deletions
+29
-15
include/m_string.h
include/m_string.h
+1
-0
mysql-test/t/variables.test
mysql-test/t/variables.test
+2
-2
mysys/my_getopt.c
mysys/my_getopt.c
+19
-13
strings/llstr.c
strings/llstr.c
+7
-0
No files found.
include/m_string.h
View file @
155365f0
...
...
@@ -203,6 +203,7 @@ double my_strtod(const char *str, char **end, int *error);
double
my_atof
(
const
char
*
nptr
);
extern
char
*
llstr
(
longlong
value
,
char
*
buff
);
extern
char
*
ullstr
(
longlong
value
,
char
*
buff
);
#ifndef HAVE_STRTOUL
extern
long
strtol
(
const
char
*
str
,
char
**
ptr
,
int
base
);
extern
ulong
strtoul
(
const
char
*
str
,
char
**
ptr
,
int
base
);
...
...
mysql-test/t/variables.test
View file @
155365f0
...
...
@@ -141,9 +141,9 @@ set GLOBAL myisam_max_sort_file_size=2000000;
show
global
variables
like
'myisam_max_sort_file_size'
;
select
*
from
information_schema
.
global_variables
where
variable_name
like
'myisam_max_sort_file_size'
;
set
GLOBAL
myisam_max_sort_file_size
=
default
;
--
replace_result
214
7482624
FILE_SIZE
9223372036853727232
FILE_SIZE
--
replace_result
214
6435072
FILE_SIZE
9223372036853727232
FILE_SIZE
show
variables
like
'myisam_max_sort_file_size'
;
--
replace_result
214
7482624
FILE_SIZE
9223372036853727232
FILE_SIZE
--
replace_result
214
6435072
FILE_SIZE
9223372036853727232
FILE_SIZE
select
*
from
information_schema
.
session_variables
where
variable_name
like
'myisam_max_sort_file_size'
;
set
global
net_retry_count
=
10
,
session
net_retry_count
=
10
;
...
...
mysys/my_getopt.c
View file @
155365f0
...
...
@@ -20,14 +20,6 @@
#include <mysys_err.h>
#include <my_getopt.h>
#if SIZEOF_LONG < SIZEOF_LONG_LONG
#define getopt_ul getopt_ll
#define getopt_ul_limit_value getopt_ll_limit_value
#else
#define getopt_ul getopt_ull
#define getopt_ul_limit_value getopt_ull_limit_value
#endif
static
void
default_reporter
(
enum
loglevel
level
,
const
char
*
format
,
...);
my_error_reporter
my_getopt_error_reporter
=
&
default_reporter
;
...
...
@@ -602,14 +594,16 @@ static int setval(const struct my_option *opts, uchar* *value, char *argument,
*
((
my_bool
*
)
result_pos
)
=
(
my_bool
)
atoi
(
argument
)
!=
0
;
break
;
case
GET_INT
:
case
GET_UINT
:
/* fall through */
*
((
int
*
)
result_pos
)
=
(
int
)
getopt_ll
(
argument
,
opts
,
&
err
);
break
;
case
GET_UINT
:
*
((
uint
*
)
result_pos
)
=
(
uint
)
getopt_ull
(
argument
,
opts
,
&
err
);
break
;
case
GET_LONG
:
*
((
long
*
)
result_pos
)
=
(
long
)
getopt_ll
(
argument
,
opts
,
&
err
);
break
;
case
GET_ULONG
:
*
((
long
*
)
result_pos
)
=
(
long
)
getopt_ul
(
argument
,
opts
,
&
err
);
*
((
long
*
)
result_pos
)
=
(
long
)
getopt_ul
l
(
argument
,
opts
,
&
err
);
break
;
case
GET_LL
:
*
((
longlong
*
)
result_pos
)
=
getopt_ll
(
argument
,
opts
,
&
err
);
...
...
@@ -781,13 +775,19 @@ static longlong getopt_ll_limit_value(longlong num,
const
struct
my_option
*
optp
)
{
ulonglong
block_size
=
(
optp
->
block_size
?
(
ulonglong
)
optp
->
block_size
:
1L
);
longlong
old
=
num
;
char
buf1
[
255
]
__attribute__
((
unused
)),
buf2
[
255
]
__attribute__
((
unused
));
if
(
num
>
0
&&
(
ulonglong
)
num
>
(
ulonglong
)
optp
->
max_value
&&
optp
->
max_value
)
/* if max value is not set -> no upper limit */
num
=
(
ulonglong
)
optp
->
max_value
;
num
=
((
num
-
optp
->
sub_size
)
/
block_size
);
num
=
(
longlong
)
(
num
*
block_size
);
return
max
(
num
,
optp
->
min_value
);
num
=
max
(
num
,
optp
->
min_value
);
if
(
num
!=
old
)
DBUG_PRINT
(
"options"
,
(
"option '%s' adjusted %s -> %s"
,
optp
->
name
,
llstr
(
old
,
buf1
),
llstr
(
num
,
buf2
)));
return
num
;
}
/*
...
...
@@ -806,6 +806,9 @@ static ulonglong getopt_ull(char *arg, const struct my_option *optp, int *err)
ulonglong
getopt_ull_limit_value
(
ulonglong
num
,
const
struct
my_option
*
optp
)
{
ulonglong
old
=
num
;
char
buf1
[
255
]
__attribute__
((
unused
)),
buf2
[
255
]
__attribute__
((
unused
));
if
((
ulonglong
)
num
>
(
ulonglong
)
optp
->
max_value
&&
optp
->
max_value
)
/* if max value is not set -> no upper limit */
num
=
(
ulonglong
)
optp
->
max_value
;
...
...
@@ -816,6 +819,9 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp)
}
if
(
num
<
(
ulonglong
)
optp
->
min_value
)
num
=
(
ulonglong
)
optp
->
min_value
;
if
(
num
!=
old
)
DBUG_PRINT
(
"options"
,
(
"option '%s' adjusted %s -> %s"
,
optp
->
name
,
ullstr
(
old
,
buf1
),
ullstr
(
num
,
buf2
)));
return
num
;
}
...
...
@@ -872,7 +878,7 @@ static void init_one_value(const struct my_option *optp, uchar* *variable,
*
((
int
*
)
variable
)
=
(
int
)
getopt_ll_limit_value
(
value
,
optp
);
break
;
case
GET_UINT
:
*
((
uint
*
)
variable
)
=
(
uint
)
getopt_ll_limit_value
(
value
,
optp
);
*
((
uint
*
)
variable
)
=
(
uint
)
getopt_
u
ll_limit_value
(
value
,
optp
);
break
;
case
GET_ENUM
:
*
((
uint
*
)
variable
)
=
(
uint
)
value
;
...
...
@@ -881,7 +887,7 @@ static void init_one_value(const struct my_option *optp, uchar* *variable,
*
((
long
*
)
variable
)
=
(
long
)
getopt_ll_limit_value
(
value
,
optp
);
break
;
case
GET_ULONG
:
*
((
ulong
*
)
variable
)
=
(
ulong
)
getopt_ul_limit_value
(
value
,
optp
);
*
((
ulong
*
)
variable
)
=
(
ulong
)
getopt_ul
l
_limit_value
(
value
,
optp
);
break
;
case
GET_LL
:
*
((
longlong
*
)
variable
)
=
(
longlong
)
getopt_ll_limit_value
(
value
,
optp
);
...
...
strings/llstr.c
View file @
155365f0
...
...
@@ -32,3 +32,10 @@ char *llstr(longlong value,char *buff)
longlong10_to_str
(
value
,
buff
,
-
10
);
return
buff
;
}
char
*
ullstr
(
longlong
value
,
char
*
buff
)
{
longlong10_to_str
(
value
,
buff
,
10
);
return
buff
;
}
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