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
d4b296b6
Commit
d4b296b6
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
78c22772
32680d62
Changes
4
Show 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 @
d4b296b6
...
@@ -203,6 +203,7 @@ double my_strtod(const char *str, char **end, int *error);
...
@@ -203,6 +203,7 @@ double my_strtod(const char *str, char **end, int *error);
double
my_atof
(
const
char
*
nptr
);
double
my_atof
(
const
char
*
nptr
);
extern
char
*
llstr
(
longlong
value
,
char
*
buff
);
extern
char
*
llstr
(
longlong
value
,
char
*
buff
);
extern
char
*
ullstr
(
longlong
value
,
char
*
buff
);
#ifndef HAVE_STRTOUL
#ifndef HAVE_STRTOUL
extern
long
strtol
(
const
char
*
str
,
char
**
ptr
,
int
base
);
extern
long
strtol
(
const
char
*
str
,
char
**
ptr
,
int
base
);
extern
ulong
strtoul
(
const
char
*
str
,
char
**
ptr
,
int
base
);
extern
ulong
strtoul
(
const
char
*
str
,
char
**
ptr
,
int
base
);
...
...
mysql-test/t/variables.test
View file @
d4b296b6
...
@@ -141,9 +141,9 @@ set GLOBAL myisam_max_sort_file_size=2000000;
...
@@ -141,9 +141,9 @@ set GLOBAL myisam_max_sort_file_size=2000000;
show
global
variables
like
'myisam_max_sort_file_size'
;
show
global
variables
like
'myisam_max_sort_file_size'
;
select
*
from
information_schema
.
global_variables
where
variable_name
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
;
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'
;
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'
;
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
;
set
global
net_retry_count
=
10
,
session
net_retry_count
=
10
;
...
...
mysys/my_getopt.c
View file @
d4b296b6
...
@@ -20,14 +20,6 @@
...
@@ -20,14 +20,6 @@
#include <mysys_err.h>
#include <mysys_err.h>
#include <my_getopt.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
,
...);
static
void
default_reporter
(
enum
loglevel
level
,
const
char
*
format
,
...);
my_error_reporter
my_getopt_error_reporter
=
&
default_reporter
;
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,
...
@@ -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
;
*
((
my_bool
*
)
result_pos
)
=
(
my_bool
)
atoi
(
argument
)
!=
0
;
break
;
break
;
case
GET_INT
:
case
GET_INT
:
case
GET_UINT
:
/* fall through */
*
((
int
*
)
result_pos
)
=
(
int
)
getopt_ll
(
argument
,
opts
,
&
err
);
*
((
int
*
)
result_pos
)
=
(
int
)
getopt_ll
(
argument
,
opts
,
&
err
);
break
;
break
;
case
GET_UINT
:
*
((
uint
*
)
result_pos
)
=
(
uint
)
getopt_ull
(
argument
,
opts
,
&
err
);
break
;
case
GET_LONG
:
case
GET_LONG
:
*
((
long
*
)
result_pos
)
=
(
long
)
getopt_ll
(
argument
,
opts
,
&
err
);
*
((
long
*
)
result_pos
)
=
(
long
)
getopt_ll
(
argument
,
opts
,
&
err
);
break
;
break
;
case
GET_ULONG
:
case
GET_ULONG
:
*
((
long
*
)
result_pos
)
=
(
long
)
getopt_ul
(
argument
,
opts
,
&
err
);
*
((
long
*
)
result_pos
)
=
(
long
)
getopt_ul
l
(
argument
,
opts
,
&
err
);
break
;
break
;
case
GET_LL
:
case
GET_LL
:
*
((
longlong
*
)
result_pos
)
=
getopt_ll
(
argument
,
opts
,
&
err
);
*
((
longlong
*
)
result_pos
)
=
getopt_ll
(
argument
,
opts
,
&
err
);
...
@@ -781,13 +775,19 @@ static longlong getopt_ll_limit_value(longlong num,
...
@@ -781,13 +775,19 @@ static longlong getopt_ll_limit_value(longlong num,
const
struct
my_option
*
optp
)
const
struct
my_option
*
optp
)
{
{
ulonglong
block_size
=
(
optp
->
block_size
?
(
ulonglong
)
optp
->
block_size
:
1L
);
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
&&
if
(
num
>
0
&&
(
ulonglong
)
num
>
(
ulonglong
)
optp
->
max_value
&&
optp
->
max_value
)
/* if max value is not set -> no upper limit */
optp
->
max_value
)
/* if max value is not set -> no upper limit */
num
=
(
ulonglong
)
optp
->
max_value
;
num
=
(
ulonglong
)
optp
->
max_value
;
num
=
((
num
-
optp
->
sub_size
)
/
block_size
);
num
=
((
num
-
optp
->
sub_size
)
/
block_size
);
num
=
(
longlong
)
(
num
*
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)
...
@@ -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
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
&&
if
((
ulonglong
)
num
>
(
ulonglong
)
optp
->
max_value
&&
optp
->
max_value
)
/* if max value is not set -> no upper limit */
optp
->
max_value
)
/* if max value is not set -> no upper limit */
num
=
(
ulonglong
)
optp
->
max_value
;
num
=
(
ulonglong
)
optp
->
max_value
;
...
@@ -816,6 +819,9 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp)
...
@@ -816,6 +819,9 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp)
}
}
if
(
num
<
(
ulonglong
)
optp
->
min_value
)
if
(
num
<
(
ulonglong
)
optp
->
min_value
)
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
;
return
num
;
}
}
...
@@ -872,7 +878,7 @@ static void init_one_value(const struct my_option *optp, uchar* *variable,
...
@@ -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
);
*
((
int
*
)
variable
)
=
(
int
)
getopt_ll_limit_value
(
value
,
optp
);
break
;
break
;
case
GET_UINT
:
case
GET_UINT
:
*
((
uint
*
)
variable
)
=
(
uint
)
getopt_ll_limit_value
(
value
,
optp
);
*
((
uint
*
)
variable
)
=
(
uint
)
getopt_
u
ll_limit_value
(
value
,
optp
);
break
;
break
;
case
GET_ENUM
:
case
GET_ENUM
:
*
((
uint
*
)
variable
)
=
(
uint
)
value
;
*
((
uint
*
)
variable
)
=
(
uint
)
value
;
...
@@ -881,7 +887,7 @@ static void init_one_value(const struct my_option *optp, uchar* *variable,
...
@@ -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
);
*
((
long
*
)
variable
)
=
(
long
)
getopt_ll_limit_value
(
value
,
optp
);
break
;
break
;
case
GET_ULONG
:
case
GET_ULONG
:
*
((
ulong
*
)
variable
)
=
(
ulong
)
getopt_ul_limit_value
(
value
,
optp
);
*
((
ulong
*
)
variable
)
=
(
ulong
)
getopt_ul
l
_limit_value
(
value
,
optp
);
break
;
break
;
case
GET_LL
:
case
GET_LL
:
*
((
longlong
*
)
variable
)
=
(
longlong
)
getopt_ll_limit_value
(
value
,
optp
);
*
((
longlong
*
)
variable
)
=
(
longlong
)
getopt_ll_limit_value
(
value
,
optp
);
...
...
strings/llstr.c
View file @
d4b296b6
...
@@ -32,3 +32,10 @@ char *llstr(longlong value,char *buff)
...
@@ -32,3 +32,10 @@ char *llstr(longlong value,char *buff)
longlong10_to_str
(
value
,
buff
,
-
10
);
longlong10_to_str
(
value
,
buff
,
-
10
);
return
buff
;
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