Commit 67108bdf authored by unknown's avatar unknown

Optimizations


mysql-test/r/create.result:
  Changed ERROR -> NOTE (for enum/set)
sql/lock.cc:
  Removed not needed test (table_list->db is always set)
sql/sql_repl.cc:
  Removed not needed test
sql/sql_table.cc:
  ERROR -> NOTE
  Removed not needed test
strings/strtod.c:
  Portabilty fix. (DBL_MAX *10 is not safe)
parent ad73b5ac
...@@ -459,16 +459,16 @@ drop table t1, t2; ...@@ -459,16 +459,16 @@ drop table t1, t2;
create table t1(cenum enum('a'), cset set('b')); create table t1(cenum enum('a'), cset set('b'));
create table t2(cenum enum('a','a'), cset set('b','b')); create table t2(cenum enum('a','a'), cset set('b','b'));
Warnings: Warnings:
Error 1291 Column 'cenum' has duplicated value 'a' in ENUM Note 1291 Column 'cenum' has duplicated value 'a' in ENUM
Error 1291 Column 'cset' has duplicated value 'b' in SET Note 1291 Column 'cset' has duplicated value 'b' in SET
create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d')); create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d'));
Warnings: Warnings:
Error 1291 Column 'cenum' has duplicated value 'a' in ENUM Note 1291 Column 'cenum' has duplicated value 'a' in ENUM
Error 1291 Column 'cenum' has duplicated value 'A' in ENUM Note 1291 Column 'cenum' has duplicated value 'A' in ENUM
Error 1291 Column 'cenum' has duplicated value 'c' in ENUM Note 1291 Column 'cenum' has duplicated value 'c' in ENUM
Error 1291 Column 'cset' has duplicated value 'b' in SET Note 1291 Column 'cset' has duplicated value 'b' in SET
Error 1291 Column 'cset' has duplicated value 'B' in SET Note 1291 Column 'cset' has duplicated value 'B' in SET
Error 1291 Column 'cset' has duplicated value 'd' in SET Note 1291 Column 'cset' has duplicated value 'd' in SET
drop table t1, t2, t3; drop table t1, t2, t3;
create database test_$1; create database test_$1;
use test_$1; use test_$1;
......
...@@ -495,7 +495,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) ...@@ -495,7 +495,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
{ {
TABLE *table; TABLE *table;
char key[MAX_DBKEY_LENGTH]; char key[MAX_DBKEY_LENGTH];
char *db= table_list->db ? table_list->db : (thd->db ? thd->db : (char*) ""); char *db= table_list->db;
uint key_length; uint key_length;
DBUG_ENTER("lock_table_name"); DBUG_ENTER("lock_table_name");
safe_mutex_assert_owner(&LOCK_open); safe_mutex_assert_owner(&LOCK_open);
......
...@@ -662,8 +662,6 @@ Increase max_allowed_packet on master"; ...@@ -662,8 +662,6 @@ Increase max_allowed_packet on master";
int start_slave(THD* thd , MASTER_INFO* mi, bool net_report) int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
{ {
int slave_errno= 0; int slave_errno= 0;
if (!thd)
thd = current_thd;
int thread_mask; int thread_mask;
DBUG_ENTER("start_slave"); DBUG_ENTER("start_slave");
......
...@@ -365,9 +365,6 @@ void check_duplicates_in_interval(const char *set_or_name, ...@@ -365,9 +365,6 @@ void check_duplicates_in_interval(const char *set_or_name,
unsigned int old_count= typelib->count; unsigned int old_count= typelib->count;
const char **old_type_names= typelib->type_names; const char **old_type_names= typelib->type_names;
if (typelib->count <= 1)
return;
old_count= typelib->count; old_count= typelib->count;
old_type_names= typelib->type_names; old_type_names= typelib->type_names;
const char **cur_value= typelib->type_names; const char **cur_value= typelib->type_names;
...@@ -377,7 +374,7 @@ void check_duplicates_in_interval(const char *set_or_name, ...@@ -377,7 +374,7 @@ void check_duplicates_in_interval(const char *set_or_name,
typelib->count--; typelib->count--;
if (find_type((char*)*cur_value,typelib,1)) if (find_type((char*)*cur_value,typelib,1))
{ {
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR, push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_DUPLICATED_VALUE_IN_TYPE, ER_DUPLICATED_VALUE_IN_TYPE,
ER(ER_DUPLICATED_VALUE_IN_TYPE), ER(ER_DUPLICATED_VALUE_IN_TYPE),
name,*cur_value,set_or_name); name,*cur_value,set_or_name);
......
...@@ -36,6 +36,11 @@ static double scaler1[] = { ...@@ -36,6 +36,11 @@ static double scaler1[] = {
1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9 1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9
}; };
#ifndef HUGE_VAL /* Should be +Infinitive */
#define HUGE_VAL DBL_MAX
#endif
double my_strtod(const char *str, char **end) double my_strtod(const char *str, char **end)
{ {
double result= 0.0; double result= 0.0;
...@@ -90,10 +95,7 @@ double my_strtod(const char *str, char **end) ...@@ -90,10 +95,7 @@ double my_strtod(const char *str, char **end)
} }
if (exp >= 1000) if (exp >= 1000)
{ {
if (neg) result= neg ? 0.0 : HUGE_VAL;
result= 0.0;
else
result= DBL_MAX*10;
goto done; goto done;
} }
while (exp >= 100) while (exp >= 100)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment