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
4d213135
Commit
4d213135
authored
May 24, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity medium warnings
parent
946a07e8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
11 deletions
+13
-11
client/mysql.cc
client/mysql.cc
+3
-2
client/mysql_upgrade.c
client/mysql_upgrade.c
+2
-0
client/mysqldump.c
client/mysqldump.c
+2
-3
client/mysqlimport.c
client/mysqlimport.c
+1
-1
client/mysqltest.cc
client/mysqltest.cc
+5
-5
No files found.
client/mysql.cc
View file @
4d213135
...
@@ -4803,10 +4803,11 @@ com_status(String *buffer __attribute__((unused)),
...
@@ -4803,10 +4803,11 @@ com_status(String *buffer __attribute__((unused)),
tee_fprintf
(
stdout
,
"Protocol:
\t\t
Compressed
\n
"
);
tee_fprintf
(
stdout
,
"Protocol:
\t\t
Compressed
\n
"
);
#endif
#endif
if
((
status_str
=
mysql_stat
(
&
mysql
))
&&
!
mysql_error
(
&
mysql
)[
0
])
const
char
*
pos
;
if
((
status_str
=
mysql_stat
(
&
mysql
))
&&
!
mysql_error
(
&
mysql
)[
0
]
&&
(
pos
=
strchr
(
status_str
,
' '
)))
{
{
ulong
sec
;
ulong
sec
;
const
char
*
pos
=
strchr
(
status_str
,
' '
);
/* print label */
/* print label */
tee_fprintf
(
stdout
,
"%.*s
\t\t\t
"
,
(
int
)
(
pos
-
status_str
),
status_str
);
tee_fprintf
(
stdout
,
"%.*s
\t\t\t
"
,
(
int
)
(
pos
-
status_str
),
status_str
);
if
((
status_str
=
str2int
(
pos
,
10
,
0
,
LONG_MAX
,(
long
*
)
&
sec
)))
if
((
status_str
=
str2int
(
pos
,
10
,
0
,
LONG_MAX
,(
long
*
)
&
sec
)))
...
...
client/mysql_upgrade.c
View file @
4d213135
...
@@ -1083,6 +1083,8 @@ int main(int argc, char **argv)
...
@@ -1083,6 +1083,8 @@ int main(int argc, char **argv)
{
{
int
fd
=
create_temp_file
(
cnf_file_path
,
opt_tmpdir
[
0
]
?
opt_tmpdir
:
NULL
,
int
fd
=
create_temp_file
(
cnf_file_path
,
opt_tmpdir
[
0
]
?
opt_tmpdir
:
NULL
,
"mysql_upgrade-"
,
O_CREAT
|
O_WRONLY
,
MYF
(
MY_FAE
));
"mysql_upgrade-"
,
O_CREAT
|
O_WRONLY
,
MYF
(
MY_FAE
));
if
(
fd
<
0
)
die
(
NULL
);
my_write
(
fd
,
USTRING_WITH_LEN
(
"[client]
\n
"
),
MYF
(
MY_FAE
));
my_write
(
fd
,
USTRING_WITH_LEN
(
"[client]
\n
"
),
MYF
(
MY_FAE
));
my_write
(
fd
,
(
uchar
*
)
ds_args
.
str
,
ds_args
.
length
,
MYF
(
MY_FAE
));
my_write
(
fd
,
(
uchar
*
)
ds_args
.
str
,
ds_args
.
length
,
MYF
(
MY_FAE
));
my_close
(
fd
,
MYF
(
0
));
my_close
(
fd
,
MYF
(
0
));
...
...
client/mysqldump.c
View file @
4d213135
...
@@ -92,8 +92,7 @@
...
@@ -92,8 +92,7 @@
static
void
add_load_option
(
DYNAMIC_STRING
*
str
,
const
char
*
option
,
static
void
add_load_option
(
DYNAMIC_STRING
*
str
,
const
char
*
option
,
const
char
*
option_value
);
const
char
*
option_value
);
static
ulong
find_set
(
TYPELIB
*
lib
,
const
char
*
x
,
size_t
length
,
static
ulong
find_set
(
TYPELIB
*
,
const
char
*
,
size_t
,
char
**
,
uint
*
);
char
**
err_pos
,
uint
*
err_len
);
static
char
*
alloc_query_str
(
ulong
size
);
static
char
*
alloc_query_str
(
ulong
size
);
static
void
field_escape
(
DYNAMIC_STRING
*
in
,
const
char
*
from
);
static
void
field_escape
(
DYNAMIC_STRING
*
in
,
const
char
*
from
);
...
@@ -5373,7 +5372,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length,
...
@@ -5373,7 +5372,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length,
var_len
=
(
uint
)
(
pos
-
start
);
var_len
=
(
uint
)
(
pos
-
start
);
strmake
(
buff
,
start
,
MY_MIN
(
sizeof
(
buff
)
-
1
,
var_len
));
strmake
(
buff
,
start
,
MY_MIN
(
sizeof
(
buff
)
-
1
,
var_len
));
find
=
find_type
(
buff
,
lib
,
FIND_TYPE_BASIC
);
find
=
find_type
(
buff
,
lib
,
FIND_TYPE_BASIC
);
if
(
!
find
)
if
(
find
<=
0
)
{
{
*
err_pos
=
(
char
*
)
start
;
*
err_pos
=
(
char
*
)
start
;
*
err_len
=
var_len
;
*
err_len
=
var_len
;
...
...
client/mysqlimport.c
View file @
4d213135
...
@@ -675,7 +675,7 @@ int main(int argc, char **argv)
...
@@ -675,7 +675,7 @@ int main(int argc, char **argv)
MYF
(
0
))))
MYF
(
0
))))
return
-
2
;
return
-
2
;
for
(
counter
=
0
;
*
argv
!=
NULL
;
argv
++
)
/* Loop through tables */
for
(;
*
argv
!=
NULL
;
argv
++
)
/* Loop through tables */
{
{
pthread_mutex_lock
(
&
counter_mutex
);
pthread_mutex_lock
(
&
counter_mutex
);
while
(
counter
==
opt_use_threads
)
while
(
counter
==
opt_use_threads
)
...
...
client/mysqltest.cc
View file @
4d213135
...
@@ -600,7 +600,7 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
...
@@ -600,7 +600,7 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
void
str_to_file
(
const
char
*
fname
,
char
*
str
,
int
size
);
void
str_to_file
(
const
char
*
fname
,
char
*
str
,
int
size
);
void
str_to_file2
(
const
char
*
fname
,
char
*
str
,
int
size
,
my_bool
append
);
void
str_to_file2
(
const
char
*
fname
,
char
*
str
,
int
size
,
my_bool
append
);
void
fix_win_paths
(
const
char
*
val
,
in
t
len
);
void
fix_win_paths
(
const
char
*
val
,
size_
t
len
);
const
char
*
get_errname_from_code
(
uint
error_code
);
const
char
*
get_errname_from_code
(
uint
error_code
);
int
multi_reg_replace
(
struct
st_replace_regex
*
r
,
char
*
val
);
int
multi_reg_replace
(
struct
st_replace_regex
*
r
,
char
*
val
);
...
@@ -814,8 +814,7 @@ class LogFile {
...
@@ -814,8 +814,7 @@ class LogFile {
LogFile
log_file
;
LogFile
log_file
;
LogFile
progress_file
;
LogFile
progress_file
;
void
replace_dynstr_append_mem
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
,
void
replace_dynstr_append_mem
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
,
size_t
len
);
int
len
);
void
replace_dynstr_append
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
);
void
replace_dynstr_append
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
);
void
replace_dynstr_append_uint
(
DYNAMIC_STRING
*
ds
,
uint
val
);
void
replace_dynstr_append_uint
(
DYNAMIC_STRING
*
ds
,
uint
val
);
void
dynstr_append_sorted
(
DYNAMIC_STRING
*
ds
,
DYNAMIC_STRING
*
ds_input
,
void
dynstr_append_sorted
(
DYNAMIC_STRING
*
ds
,
DYNAMIC_STRING
*
ds_input
,
...
@@ -2654,6 +2653,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
...
@@ -2654,6 +2653,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
if
(
!
mysql
)
if
(
!
mysql
)
{
{
struct
st_command
command
;
struct
st_command
command
;
DBUG_ASSERT
(
query_end
);
memset
(
&
command
,
0
,
sizeof
(
command
));
memset
(
&
command
,
0
,
sizeof
(
command
));
command
.
query
=
(
char
*
)
query
;
command
.
query
=
(
char
*
)
query
;
command
.
first_word_len
=
(
*
query_end
-
query
);
command
.
first_word_len
=
(
*
query_end
-
query
);
...
@@ -7530,7 +7530,7 @@ void free_win_path_patterns()
...
@@ -7530,7 +7530,7 @@ void free_win_path_patterns()
=> all \ from c:\mysql\m... until next space is converted into /
=> all \ from c:\mysql\m... until next space is converted into /
*/
*/
void
fix_win_paths
(
const
char
*
val
,
in
t
len
)
void
fix_win_paths
(
const
char
*
val
,
size_
t
len
)
{
{
uint
i
;
uint
i
;
char
*
p
;
char
*
p
;
...
@@ -11031,7 +11031,7 @@ void free_pointer_array(POINTER_ARRAY *pa)
...
@@ -11031,7 +11031,7 @@ void free_pointer_array(POINTER_ARRAY *pa)
/* Append the string to ds, with optional replace */
/* Append the string to ds, with optional replace */
void
replace_dynstr_append_mem
(
DYNAMIC_STRING
*
ds
,
void
replace_dynstr_append_mem
(
DYNAMIC_STRING
*
ds
,
const
char
*
val
,
in
t
len
)
const
char
*
val
,
size_
t
len
)
{
{
char
lower
[
512
];
char
lower
[
512
];
#ifdef __WIN__
#ifdef __WIN__
...
...
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