summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2003-12-10 22:26:59 +0300
committerunknown <konstantin@mysql.com>2003-12-10 22:26:59 +0300
commit7cfbc5e9336099d4b850e6a7e8282ade3e7aef19 (patch)
tree48c8695dacd3b583cab37706f22ceb9cfd77d7fe /sql
parentfc1f426e8c7f0768611dcd2af70147b5e14a5e95 (diff)
parentceab00b0c8ac072d83f565ac6c0f86bf8e0c22f3 (diff)
downloadmariadb-git-7cfbc5e9336099d4b850e6a7e8282ade3e7aef19.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/kostja/mysql/mysql-4.0-return_else
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc4
-rw-r--r--sql/item.cc5
-rw-r--r--sql/item_cmpfunc.cc5
-rw-r--r--sql/item_func.cc25
-rw-r--r--sql/item_strfunc.cc13
-rw-r--r--sql/item_sum.cc6
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/opt_range.cc2
-rw-r--r--sql/sql_analyse.cc8
-rw-r--r--sql/sql_insert.cc19
-rw-r--r--sql/sql_parse.cc3
11 files changed, 36 insertions, 56 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 1070d0f7b7d..d43089ec35c 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -848,7 +848,7 @@ int Field_decimal::cmp(const char *a_ptr,const char *b_ptr)
return 0;
if (*a_ptr == '-')
return -1;
- else if (*b_ptr == '-')
+ if (*b_ptr == '-')
return 1;
while (a_ptr != end)
@@ -3018,7 +3018,7 @@ void Field_year::store(const char *from, uint len)
current_thd->cuted_fields++;
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++;
if (nr != 0 || len != 4)
{
diff --git a/sql/item.cc b/sql/item.cc
index fc6256d4fed..60fc383d757 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -694,10 +694,9 @@ Item_result item_cmp_type(Item_result a,Item_result b)
{
if (a == STRING_RESULT && b == STRING_RESULT)
return STRING_RESULT;
- else if (a == INT_RESULT && b == INT_RESULT)
+ if (a == INT_RESULT && b == INT_RESULT)
return INT_RESULT;
- else
- return REAL_RESULT;
+ return REAL_RESULT;
}
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 63f3a8985c5..82f368970e2 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -463,10 +463,9 @@ static Item_result item_store_type(Item_result a,Item_result b)
{
if (a == STRING_RESULT || b == STRING_RESULT)
return STRING_RESULT;
- else if (a == REAL_RESULT || b == REAL_RESULT)
+ if (a == REAL_RESULT || b == REAL_RESULT)
return REAL_RESULT;
- else
- return INT_RESULT;
+ return INT_RESULT;
}
void
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 8d7ee637d73..64b1c5d4d8a 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -214,8 +214,7 @@ String *Item_real_func::val_str(String *str)
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
- else
- str->set(nr,decimals);
+ str->set(nr,decimals);
return str;
}
@@ -227,7 +226,7 @@ String *Item_num_func::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0; /* purecov: inspected */
- else if (!unsigned_flag)
+ if (!unsigned_flag)
str->set(nr);
else
str->set((ulonglong) nr);
@@ -237,8 +236,7 @@ String *Item_num_func::val_str(String *str)
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
- else
- str->set(nr,decimals);
+ str->set(nr,decimals);
}
return str;
}
@@ -257,7 +255,7 @@ String *Item_int_func::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
- else if (!unsigned_flag)
+ if (!unsigned_flag)
str->set(nr);
else
str->set((ulonglong) nr);
@@ -286,7 +284,7 @@ String *Item_num_op::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0; /* purecov: inspected */
- else if (!unsigned_flag)
+ if (!unsigned_flag)
str->set(nr);
else
str->set((ulonglong) nr);
@@ -296,8 +294,7 @@ String *Item_num_op::val_str(String *str)
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
- else
- str->set(nr,decimals);
+ str->set(nr,decimals);
}
return str;
}
@@ -799,7 +796,7 @@ String *Item_func_min_max::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
- else if (!unsigned_flag)
+ if (!unsigned_flag)
str->set(nr);
else
str->set((ulonglong) nr);
@@ -810,8 +807,7 @@ String *Item_func_min_max::val_str(String *str)
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
- else
- str->set(nr,decimals);
+ str->set(nr,decimals);
return str;
}
case STRING_RESULT:
@@ -1392,8 +1388,7 @@ String *Item_func_udf_float::val_str(String *str)
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
- else
- str->set(nr,decimals);
+ str->set(nr,decimals);
return str;
}
@@ -1413,7 +1408,7 @@ String *Item_func_udf_int::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
- else if (!unsigned_flag)
+ if (!unsigned_flag)
str->set(nr);
else
str->set((ulonglong) nr);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 40b18755744..7434f6bd57b 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1706,14 +1706,11 @@ inline String* alloc_buffer(String *res,String *str,String *tmp_value,
str->length(length);
return str;
}
- else
- {
- if (tmp_value->alloc(length))
- return 0;
- (void) tmp_value->copy(*res);
- tmp_value->length(length);
- return tmp_value;
- }
+ if (tmp_value->alloc(length))
+ return 0;
+ (void) tmp_value->copy(*res);
+ tmp_value->length(length);
+ return tmp_value;
}
res->length(length);
return res;
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index e18fa83e49d..4121fa65433 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1153,8 +1153,7 @@ String *Item_sum_udf_float::val_str(String *str)
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
- else
- str->set(nr,decimals);
+ str->set(nr,decimals);
return str;
}
@@ -1172,8 +1171,7 @@ String *Item_sum_udf_int::val_str(String *str)
longlong nr=val_int();
if (null_value)
return 0;
- else
- str->set(nr);
+ str->set(nr);
return str;
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 410a1644eec..b75a94a261c 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1043,7 +1043,7 @@ static void set_user(const char *user)
}
return;
}
- else if (!user)
+ if (!user)
{
if (!opt_bootstrap)
{
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 4bbeaca8a79..02b7699fad6 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1474,7 +1474,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
}
return 0;
}
- else if (!key2)
+ if (!key2)
{
key1->use_count--;
key1->free_tree();
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index d6abe6497df..bd8c0e5ba87 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -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
return 1;
}
- else
- return 0;
+ return 0;
}
for (str++; *(end - 1) == '0'; end--); // jump over zeros at the end
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)
info->dval = atod(begin);
return 1;
}
- else
- return 0;
}
- else
- return 0;
+ return 0;
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 3414e76e092..a92379a6d3b 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1409,18 +1409,15 @@ bool select_insert::send_eof()
::send_error(&thd->net);
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
- {
- 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
- 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;
- }
+ 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;
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index fc9c21586d9..d59dda43d67 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -268,8 +268,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user,
decrease_user_connections(thd->user_connect);
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
return 0; // ok
}