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
42507efd
Commit
42507efd
authored
Dec 10, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: if there is return from if-part, we don't need else statement
parent
c5af365a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
36 additions
and
56 deletions
+36
-56
sql/field.cc
sql/field.cc
+2
-2
sql/item.cc
sql/item.cc
+2
-3
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+2
-3
sql/item_func.cc
sql/item_func.cc
+10
-15
sql/item_strfunc.cc
sql/item_strfunc.cc
+5
-8
sql/item_sum.cc
sql/item_sum.cc
+2
-4
sql/mysqld.cc
sql/mysqld.cc
+1
-1
sql/opt_range.cc
sql/opt_range.cc
+1
-1
sql/sql_analyse.cc
sql/sql_analyse.cc
+2
-6
sql/sql_insert.cc
sql/sql_insert.cc
+8
-11
sql/sql_parse.cc
sql/sql_parse.cc
+1
-2
No files found.
sql/field.cc
View file @
42507efd
...
@@ -848,7 +848,7 @@ int Field_decimal::cmp(const char *a_ptr,const char *b_ptr)
...
@@ -848,7 +848,7 @@ int Field_decimal::cmp(const char *a_ptr,const char *b_ptr)
return
0
;
return
0
;
if
(
*
a_ptr
==
'-'
)
if
(
*
a_ptr
==
'-'
)
return
-
1
;
return
-
1
;
else
if
(
*
b_ptr
==
'-'
)
if
(
*
b_ptr
==
'-'
)
return
1
;
return
1
;
while
(
a_ptr
!=
end
)
while
(
a_ptr
!=
end
)
...
@@ -3018,7 +3018,7 @@ void Field_year::store(const char *from, uint len)
...
@@ -3018,7 +3018,7 @@ void Field_year::store(const char *from, uint len)
current_thd
->
cuted_fields
++
;
current_thd
->
cuted_fields
++
;
return
;
return
;
}
}
else
if
(
current_thd
->
count_cuted_fields
&&
!
test_if_int
(
from
,
len
))
if
(
current_thd
->
count_cuted_fields
&&
!
test_if_int
(
from
,
len
))
current_thd
->
cuted_fields
++
;
current_thd
->
cuted_fields
++
;
if
(
nr
!=
0
||
len
!=
4
)
if
(
nr
!=
0
||
len
!=
4
)
{
{
...
...
sql/item.cc
View file @
42507efd
...
@@ -694,10 +694,9 @@ Item_result item_cmp_type(Item_result a,Item_result b)
...
@@ -694,10 +694,9 @@ Item_result item_cmp_type(Item_result a,Item_result b)
{
{
if
(
a
==
STRING_RESULT
&&
b
==
STRING_RESULT
)
if
(
a
==
STRING_RESULT
&&
b
==
STRING_RESULT
)
return
STRING_RESULT
;
return
STRING_RESULT
;
else
if
(
a
==
INT_RESULT
&&
b
==
INT_RESULT
)
if
(
a
==
INT_RESULT
&&
b
==
INT_RESULT
)
return
INT_RESULT
;
return
INT_RESULT
;
else
return
REAL_RESULT
;
return
REAL_RESULT
;
}
}
...
...
sql/item_cmpfunc.cc
View file @
42507efd
...
@@ -463,10 +463,9 @@ static Item_result item_store_type(Item_result a,Item_result b)
...
@@ -463,10 +463,9 @@ static Item_result item_store_type(Item_result a,Item_result b)
{
{
if
(
a
==
STRING_RESULT
||
b
==
STRING_RESULT
)
if
(
a
==
STRING_RESULT
||
b
==
STRING_RESULT
)
return
STRING_RESULT
;
return
STRING_RESULT
;
else
if
(
a
==
REAL_RESULT
||
b
==
REAL_RESULT
)
if
(
a
==
REAL_RESULT
||
b
==
REAL_RESULT
)
return
REAL_RESULT
;
return
REAL_RESULT
;
else
return
INT_RESULT
;
return
INT_RESULT
;
}
}
void
void
...
...
sql/item_func.cc
View file @
42507efd
...
@@ -214,8 +214,7 @@ String *Item_real_func::val_str(String *str)
...
@@ -214,8 +214,7 @@ String *Item_real_func::val_str(String *str)
double
nr
=
val
();
double
nr
=
val
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
);
return
str
;
return
str
;
}
}
...
@@ -227,7 +226,7 @@ String *Item_num_func::val_str(String *str)
...
@@ -227,7 +226,7 @@ String *Item_num_func::val_str(String *str)
longlong
nr
=
val_int
();
longlong
nr
=
val_int
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
if
(
!
unsigned_flag
)
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
);
else
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
);
...
@@ -237,8 +236,7 @@ String *Item_num_func::val_str(String *str)
...
@@ -237,8 +236,7 @@ String *Item_num_func::val_str(String *str)
double
nr
=
val
();
double
nr
=
val
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
);
}
}
return
str
;
return
str
;
}
}
...
@@ -257,7 +255,7 @@ String *Item_int_func::val_str(String *str)
...
@@ -257,7 +255,7 @@ String *Item_int_func::val_str(String *str)
longlong
nr
=
val_int
();
longlong
nr
=
val_int
();
if
(
null_value
)
if
(
null_value
)
return
0
;
return
0
;
else
if
(
!
unsigned_flag
)
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
);
else
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
);
...
@@ -286,7 +284,7 @@ String *Item_num_op::val_str(String *str)
...
@@ -286,7 +284,7 @@ String *Item_num_op::val_str(String *str)
longlong
nr
=
val_int
();
longlong
nr
=
val_int
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
if
(
!
unsigned_flag
)
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
);
else
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
);
...
@@ -296,8 +294,7 @@ String *Item_num_op::val_str(String *str)
...
@@ -296,8 +294,7 @@ String *Item_num_op::val_str(String *str)
double
nr
=
val
();
double
nr
=
val
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
);
}
}
return
str
;
return
str
;
}
}
...
@@ -799,7 +796,7 @@ String *Item_func_min_max::val_str(String *str)
...
@@ -799,7 +796,7 @@ String *Item_func_min_max::val_str(String *str)
longlong
nr
=
val_int
();
longlong
nr
=
val_int
();
if
(
null_value
)
if
(
null_value
)
return
0
;
return
0
;
else
if
(
!
unsigned_flag
)
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
);
else
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
);
...
@@ -810,8 +807,7 @@ String *Item_func_min_max::val_str(String *str)
...
@@ -810,8 +807,7 @@ String *Item_func_min_max::val_str(String *str)
double
nr
=
val
();
double
nr
=
val
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
);
return
str
;
return
str
;
}
}
case
STRING_RESULT
:
case
STRING_RESULT
:
...
@@ -1392,8 +1388,7 @@ String *Item_func_udf_float::val_str(String *str)
...
@@ -1392,8 +1388,7 @@ String *Item_func_udf_float::val_str(String *str)
double
nr
=
val
();
double
nr
=
val
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
);
return
str
;
return
str
;
}
}
...
@@ -1413,7 +1408,7 @@ String *Item_func_udf_int::val_str(String *str)
...
@@ -1413,7 +1408,7 @@ String *Item_func_udf_int::val_str(String *str)
longlong
nr
=
val_int
();
longlong
nr
=
val_int
();
if
(
null_value
)
if
(
null_value
)
return
0
;
return
0
;
else
if
(
!
unsigned_flag
)
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
);
else
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
);
...
...
sql/item_strfunc.cc
View file @
42507efd
...
@@ -1706,14 +1706,11 @@ inline String* alloc_buffer(String *res,String *str,String *tmp_value,
...
@@ -1706,14 +1706,11 @@ inline String* alloc_buffer(String *res,String *str,String *tmp_value,
str
->
length
(
length
);
str
->
length
(
length
);
return
str
;
return
str
;
}
}
else
if
(
tmp_value
->
alloc
(
length
))
{
return
0
;
if
(
tmp_value
->
alloc
(
length
))
(
void
)
tmp_value
->
copy
(
*
res
);
return
0
;
tmp_value
->
length
(
length
);
(
void
)
tmp_value
->
copy
(
*
res
);
return
tmp_value
;
tmp_value
->
length
(
length
);
return
tmp_value
;
}
}
}
res
->
length
(
length
);
res
->
length
(
length
);
return
res
;
return
res
;
...
...
sql/item_sum.cc
View file @
42507efd
...
@@ -1153,8 +1153,7 @@ String *Item_sum_udf_float::val_str(String *str)
...
@@ -1153,8 +1153,7 @@ String *Item_sum_udf_float::val_str(String *str)
double
nr
=
val
();
double
nr
=
val
();
if
(
null_value
)
if
(
null_value
)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
);
return
str
;
return
str
;
}
}
...
@@ -1172,8 +1171,7 @@ String *Item_sum_udf_int::val_str(String *str)
...
@@ -1172,8 +1171,7 @@ String *Item_sum_udf_int::val_str(String *str)
longlong
nr
=
val_int
();
longlong
nr
=
val_int
();
if
(
null_value
)
if
(
null_value
)
return
0
;
return
0
;
else
str
->
set
(
nr
);
str
->
set
(
nr
);
return
str
;
return
str
;
}
}
...
...
sql/mysqld.cc
View file @
42507efd
...
@@ -1043,7 +1043,7 @@ static void set_user(const char *user)
...
@@ -1043,7 +1043,7 @@ static void set_user(const char *user)
}
}
return
;
return
;
}
}
else
if
(
!
user
)
if
(
!
user
)
{
{
if
(
!
opt_bootstrap
)
if
(
!
opt_bootstrap
)
{
{
...
...
sql/opt_range.cc
View file @
42507efd
...
@@ -1474,7 +1474,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
...
@@ -1474,7 +1474,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
}
}
return
0
;
return
0
;
}
}
else
if
(
!
key2
)
if
(
!
key2
)
{
{
key1
->
use_count
--
;
key1
->
use_count
--
;
key1
->
free_tree
();
key1
->
free_tree
();
...
...
sql/sql_analyse.cc
View file @
42507efd
...
@@ -220,8 +220,7 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
...
@@ -220,8 +220,7 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
info
->
is_float
=
1
;
// we can't use variable decimals here
info
->
is_float
=
1
;
// we can't use variable decimals here
return
1
;
return
1
;
}
}
else
return
0
;
return
0
;
}
}
for
(
str
++
;
*
(
end
-
1
)
==
'0'
;
end
--
);
// jump over zeros at the end
for
(
str
++
;
*
(
end
-
1
)
==
'0'
;
end
--
);
// jump over zeros at the end
if
(
str
==
end
)
// number was something like '123.000'
if
(
str
==
end
)
// number was something like '123.000'
...
@@ -236,11 +235,8 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
...
@@ -236,11 +235,8 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
info
->
dval
=
atod
(
begin
);
info
->
dval
=
atod
(
begin
);
return
1
;
return
1
;
}
}
else
return
0
;
}
}
else
return
0
;
return
0
;
}
}
...
...
sql/sql_insert.cc
View file @
42507efd
...
@@ -1409,18 +1409,15 @@ bool select_insert::send_eof()
...
@@ -1409,18 +1409,15 @@ bool select_insert::send_eof()
::
send_error
(
&
thd
->
net
);
::
send_error
(
&
thd
->
net
);
return
1
;
return
1
;
}
}
char
buff
[
160
];
if
(
info
.
handle_duplicates
==
DUP_IGNORE
)
sprintf
(
buff
,
ER
(
ER_INSERT_INFO
),
info
.
records
,
info
.
records
-
info
.
copied
,
thd
->
cuted_fields
);
else
else
{
sprintf
(
buff
,
ER
(
ER_INSERT_INFO
),
info
.
records
,
info
.
deleted
,
char
buff
[
160
];
thd
->
cuted_fields
);
if
(
info
.
handle_duplicates
==
DUP_IGNORE
)
::
send_ok
(
&
thd
->
net
,
info
.
copied
+
info
.
deleted
,
last_insert_id
,
buff
);
sprintf
(
buff
,
ER
(
ER_INSERT_INFO
),
info
.
records
,
info
.
records
-
info
.
copied
,
return
0
;
thd
->
cuted_fields
);
else
sprintf
(
buff
,
ER
(
ER_INSERT_INFO
),
info
.
records
,
info
.
deleted
,
thd
->
cuted_fields
);
::
send_ok
(
&
thd
->
net
,
info
.
copied
+
info
.
deleted
,
last_insert_id
,
buff
);
return
0
;
}
}
}
...
...
sql/sql_parse.cc
View file @
42507efd
...
@@ -268,8 +268,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
...
@@ -268,8 +268,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
decrease_user_connections
(
thd
->
user_connect
);
decrease_user_connections
(
thd
->
user_connect
);
return
error
;
return
error
;
}
}
else
send_ok
(
net
);
// Ready to handle questions
send_ok
(
net
);
// Ready to handle questions
thd
->
password
=
test
(
passwd
[
0
]);
// Remember for error messages
thd
->
password
=
test
(
passwd
[
0
]);
// Remember for error messages
return
0
;
// ok
return
0
;
// ok
}
}
...
...
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