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
95cb8c1d
Commit
95cb8c1d
authored
Jun 04, 2015
by
Arun Kuruvila
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mysql-5.1' into mysql-5.5
parents
e5991403
044e3b1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
8 deletions
+40
-8
client/mysqlslap.c
client/mysqlslap.c
+40
-8
No files found.
client/mysqlslap.c
View file @
95cb8c1d
/*
/*
Copyright (c) 2005, 201
2
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2005, 201
5
, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
@@ -244,7 +244,7 @@ void print_conclusions_csv(conclusions *con);
...
@@ -244,7 +244,7 @@ void print_conclusions_csv(conclusions *con);
void
generate_stats
(
conclusions
*
con
,
option_string
*
eng
,
stats
*
sptr
);
void
generate_stats
(
conclusions
*
con
,
option_string
*
eng
,
stats
*
sptr
);
uint
parse_comma
(
const
char
*
string
,
uint
**
range
);
uint
parse_comma
(
const
char
*
string
,
uint
**
range
);
uint
parse_delimiter
(
const
char
*
script
,
statement
**
stmt
,
char
delm
);
uint
parse_delimiter
(
const
char
*
script
,
statement
**
stmt
,
char
delm
);
u
int
parse_option
(
const
char
*
origin
,
option_string
**
stmt
,
char
delm
);
int
parse_option
(
const
char
*
origin
,
option_string
**
stmt
,
char
delm
);
static
int
drop_schema
(
MYSQL
*
mysql
,
const
char
*
db
);
static
int
drop_schema
(
MYSQL
*
mysql
,
const
char
*
db
);
uint
get_random_string
(
char
*
buf
);
uint
get_random_string
(
char
*
buf
);
static
statement
*
build_table_string
(
void
);
static
statement
*
build_table_string
(
void
);
...
@@ -1242,7 +1242,13 @@ get_options(int *argc,char ***argv)
...
@@ -1242,7 +1242,13 @@ get_options(int *argc,char ***argv)
if
(
num_int_cols_opt
)
if
(
num_int_cols_opt
)
{
{
option_string
*
str
;
option_string
*
str
;
parse_option
(
num_int_cols_opt
,
&
str
,
','
);
if
(
parse_option
(
num_int_cols_opt
,
&
str
,
','
)
==
-
1
)
{
fprintf
(
stderr
,
"Invalid value specified for the option "
"'number-int-cols'
\n
"
);
option_cleanup
(
str
);
return
1
;
}
num_int_cols
=
atoi
(
str
->
string
);
num_int_cols
=
atoi
(
str
->
string
);
if
(
str
->
option
)
if
(
str
->
option
)
num_int_cols_index
=
atoi
(
str
->
option
);
num_int_cols_index
=
atoi
(
str
->
option
);
...
@@ -1252,7 +1258,13 @@ get_options(int *argc,char ***argv)
...
@@ -1252,7 +1258,13 @@ get_options(int *argc,char ***argv)
if
(
num_char_cols_opt
)
if
(
num_char_cols_opt
)
{
{
option_string
*
str
;
option_string
*
str
;
parse_option
(
num_char_cols_opt
,
&
str
,
','
);
if
(
parse_option
(
num_char_cols_opt
,
&
str
,
','
)
==
-
1
)
{
fprintf
(
stderr
,
"Invalid value specified for the option "
"'number-char-cols'
\n
"
);
option_cleanup
(
str
);
return
1
;
}
num_char_cols
=
atoi
(
str
->
string
);
num_char_cols
=
atoi
(
str
->
string
);
if
(
str
->
option
)
if
(
str
->
option
)
num_char_cols_index
=
atoi
(
str
->
option
);
num_char_cols_index
=
atoi
(
str
->
option
);
...
@@ -1488,7 +1500,13 @@ get_options(int *argc,char ***argv)
...
@@ -1488,7 +1500,13 @@ get_options(int *argc,char ***argv)
printf
(
"Parsing engines to use.
\n
"
);
printf
(
"Parsing engines to use.
\n
"
);
if
(
default_engine
)
if
(
default_engine
)
parse_option
(
default_engine
,
&
engine_options
,
','
);
{
if
(
parse_option
(
default_engine
,
&
engine_options
,
','
)
==
-
1
)
{
fprintf
(
stderr
,
"Invalid value specified for the option 'engine'
\n
"
);
return
1
;
}
}
if
(
tty_password
)
if
(
tty_password
)
opt_password
=
get_tty_password
(
NullS
);
opt_password
=
get_tty_password
(
NullS
);
...
@@ -1961,7 +1979,7 @@ pthread_handler_t run_task(void *p)
...
@@ -1961,7 +1979,7 @@ pthread_handler_t run_task(void *p)
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
u
int
int
parse_option
(
const
char
*
origin
,
option_string
**
stmt
,
char
delm
)
parse_option
(
const
char
*
origin
,
option_string
**
stmt
,
char
delm
)
{
{
char
*
retstr
;
char
*
retstr
;
...
@@ -1981,6 +1999,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
...
@@ -1981,6 +1999,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
char
buffer
[
HUGE_STRING_LENGTH
];
char
buffer
[
HUGE_STRING_LENGTH
];
char
*
buffer_ptr
;
char
*
buffer_ptr
;
/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if
((
size_t
)(
retstr
-
ptr
)
>
HUGE_STRING_LENGTH
)
return
-
1
;
count
++
;
count
++
;
strncpy
(
buffer
,
ptr
,
(
size_t
)(
retstr
-
ptr
));
strncpy
(
buffer
,
ptr
,
(
size_t
)(
retstr
-
ptr
));
if
((
buffer_ptr
=
strchr
(
buffer
,
':'
)))
if
((
buffer_ptr
=
strchr
(
buffer
,
':'
)))
...
@@ -2013,6 +2038,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
...
@@ -2013,6 +2038,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
{
{
char
*
origin_ptr
;
char
*
origin_ptr
;
/*
Return an error if the length of the any of the comma seprated value
exceeds HUGE_STRING_LENGTH.
*/
if
(
strlen
(
ptr
)
>
HUGE_STRING_LENGTH
)
return
-
1
;
if
((
origin_ptr
=
strchr
(
ptr
,
':'
)))
if
((
origin_ptr
=
strchr
(
ptr
,
':'
)))
{
{
char
*
option_ptr
;
char
*
option_ptr
;
...
@@ -2023,13 +2055,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
...
@@ -2023,13 +2055,13 @@ parse_option(const char *origin, option_string **stmt, char delm)
option_ptr
=
(
char
*
)
ptr
+
1
+
tmp
->
length
;
option_ptr
=
(
char
*
)
ptr
+
1
+
tmp
->
length
;
/* Move past the : and the first string */
/* Move past the : and the first string */
tmp
->
option_length
=
(
size_t
)((
ptr
+
length
)
-
option_ptr
);
tmp
->
option_length
=
strlen
(
option_ptr
);
tmp
->
option
=
my_strndup
(
option_ptr
,
tmp
->
option_length
,
tmp
->
option
=
my_strndup
(
option_ptr
,
tmp
->
option_length
,
MYF
(
MY_FAE
));
MYF
(
MY_FAE
));
}
}
else
else
{
{
tmp
->
length
=
(
size_t
)((
ptr
+
length
)
-
ptr
);
tmp
->
length
=
strlen
(
ptr
);
tmp
->
string
=
my_strndup
(
ptr
,
tmp
->
length
,
MYF
(
MY_FAE
));
tmp
->
string
=
my_strndup
(
ptr
,
tmp
->
length
,
MYF
(
MY_FAE
));
}
}
...
...
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