Commit 5bfcabf7 authored by monty@mysql.com's avatar monty@mysql.com

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/my/mysql-5.0
parents 88d2e297 88afe505
...@@ -344,6 +344,10 @@ SOURCE=..\mysys\my_alloc.c ...@@ -344,6 +344,10 @@ SOURCE=..\mysys\my_alloc.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\mysys\my_decimal.cpp
# End Source File
# Begin Source File
SOURCE=..\mysys\my_getopt.c SOURCE=..\mysys\my_getopt.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -1085,6 +1085,10 @@ SOURCE=.\mf_iocache.cpp ...@@ -1085,6 +1085,10 @@ SOURCE=.\mf_iocache.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\my_decimal.cpp
# End Source File
# Begin Source File
SOURCE=.\my_time.c SOURCE=.\my_time.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -177,6 +177,10 @@ SOURCE=.\ctype.c ...@@ -177,6 +177,10 @@ SOURCE=.\ctype.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\decimal.c
# End Source File
# Begin Source File
SOURCE=.\int2str.c SOURCE=.\int2str.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -633,17 +633,8 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p ...@@ -633,17 +633,8 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
return 0; return 0;
} }
#else #else
char t1[4], t2[4];
if (n1 == 3 && n2 == 3)
{
memcpy(t1, p1, 3);
memcpy(t2, p2, 3);
p1 = t1;
p2 = t2;
n1 = n2 = 4;
}
#ifdef ndb_date_sol9x86_cc_xO3_madness #ifdef ndb_date_sol9x86_cc_xO3_madness
if (n2 >= 4) { // may access 4-th byte if (n2 >= 3) {
const uchar* v1 = (const uchar*)p1; const uchar* v1 = (const uchar*)p1;
const uchar* v2 = (const uchar*)p2; const uchar* v2 = (const uchar*)p2;
// from Field_newdate::val_int // from Field_newdate::val_int
...@@ -658,7 +649,7 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p ...@@ -658,7 +649,7 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
return 0; return 0;
} }
#else #else
if (n2 >= 4) { if (n2 >= 3) {
const uchar* v1 = (const uchar*)p1; const uchar* v1 = (const uchar*)p1;
const uchar* v2 = (const uchar*)p2; const uchar* v2 = (const uchar*)p2;
uint j1 = uint3korr(v1); uint j1 = uint3korr(v1);
...@@ -712,7 +703,7 @@ NdbSqlUtil::cmpText(const void* info, const void* p1, unsigned n1, const void* p ...@@ -712,7 +703,7 @@ NdbSqlUtil::cmpText(const void* info, const void* p1, unsigned n1, const void* p
int int
NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full) NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
{ {
if (n2 >= 4) { // may access 4-th byte if (n2 >= 3) {
const uchar* v1 = (const uchar*)p1; const uchar* v1 = (const uchar*)p1;
const uchar* v2 = (const uchar*)p2; const uchar* v2 = (const uchar*)p2;
// from Field_time::val_int // from Field_time::val_int
......
...@@ -1581,10 +1581,10 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value) ...@@ -1581,10 +1581,10 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
DBUG_PRINT("info", ("overflow")); DBUG_PRINT("info", ("overflow"));
set_value_on_overflow(&buff, dec->sign()); set_value_on_overflow(&buff, dec->sign());
my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, field_length, decimals()); my_decimal2binary(E_DEC_FATAL_ERROR, &buff, ptr, field_length, decimals());
DBUG_EXECUTE("info", print_decimal_buff(&buff, ptr, bin_size);); DBUG_EXECUTE("info", print_decimal_buff(&buff, (byte *) ptr, bin_size););
DBUG_RETURN(1); DBUG_RETURN(1);
} }
DBUG_EXECUTE("info", print_decimal_buff(dec, ptr, bin_size);); DBUG_EXECUTE("info", print_decimal_buff(dec, (byte *) ptr, bin_size););
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -1708,7 +1708,7 @@ my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value) ...@@ -1708,7 +1708,7 @@ my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value)
binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value, binary2my_decimal(E_DEC_FATAL_ERROR, ptr, decimal_value,
field_length, field_length,
decimals()); decimals());
DBUG_EXECUTE("info", print_decimal_buff(decimal_value, ptr, bin_size);); DBUG_EXECUTE("info", print_decimal_buff(decimal_value, (byte *) ptr, bin_size););
DBUG_RETURN(decimal_value); DBUG_RETURN(decimal_value);
} }
......
...@@ -463,7 +463,11 @@ class Item_splocal : public Item ...@@ -463,7 +463,11 @@ class Item_splocal : public Item
longlong val_int(); longlong val_int();
String *val_str(String *sp); String *val_str(String *sp);
my_decimal *val_decimal(my_decimal *); my_decimal *val_decimal(my_decimal *);
#ifdef __WIN__
bool is_null();
#else
inline bool is_null(); inline bool is_null();
#endif
void print(String *str); void print(String *str);
inline void make_field(Send_field *field) inline void make_field(Send_field *field)
......
...@@ -1743,7 +1743,7 @@ longlong Item_func_round::int_op() ...@@ -1743,7 +1743,7 @@ longlong Item_func_round::int_op()
if (truncate) if (truncate)
{ {
if (unsigned_flag) if (unsigned_flag)
tmp2= floor(((double)((ulonglong)value))/tmp)*tmp; tmp2= floor(ulonglong2double(value)/tmp)*tmp;
else if (value >= 0) else if (value >= 0)
tmp2= floor(((double)value)/tmp)*tmp; tmp2= floor(((double)value)/tmp)*tmp;
else else
......
...@@ -556,7 +556,7 @@ bool Item_sum_sum_distinct::add() ...@@ -556,7 +556,7 @@ bool Item_sum_sum_distinct::add()
{ {
DBUG_ASSERT(tree); DBUG_ASSERT(tree);
null_value= 0; null_value= 0;
my_decimal2binary(E_DEC_FATAL_ERROR, val, dec_bin_buff, my_decimal2binary(E_DEC_FATAL_ERROR, val, (char *) dec_bin_buff,
args[0]->max_length, args[0]->decimals); args[0]->max_length, args[0]->decimals);
DBUG_RETURN(tree->unique_add(dec_bin_buff)); DBUG_RETURN(tree->unique_add(dec_bin_buff));
} }
...@@ -591,7 +591,7 @@ void Item_sum_sum_distinct::add_real(double val) ...@@ -591,7 +591,7 @@ void Item_sum_sum_distinct::add_real(double val)
void Item_sum_sum_distinct::add_decimal(byte *val) void Item_sum_sum_distinct::add_decimal(byte *val)
{ {
binary2my_decimal(E_DEC_FATAL_ERROR, val, &tmp_dec, binary2my_decimal(E_DEC_FATAL_ERROR, (char *) val, &tmp_dec,
args[0]->max_length, args[0]->decimals); args[0]->max_length, args[0]->decimals);
my_decimal_add(E_DEC_FATAL_ERROR, dec_buffs + (curr_dec_buff^1), my_decimal_add(E_DEC_FATAL_ERROR, dec_buffs + (curr_dec_buff^1),
&tmp_dec, dec_buffs + curr_dec_buff); &tmp_dec, dec_buffs + curr_dec_buff);
......
...@@ -1963,7 +1963,7 @@ sp_merge_table_hash(HASH *hdst, HASH *hsrc) ...@@ -1963,7 +1963,7 @@ sp_merge_table_hash(HASH *hdst, HASH *hsrc)
SP_TABLE *tabsrc= (SP_TABLE *)hash_element(hsrc, i); SP_TABLE *tabsrc= (SP_TABLE *)hash_element(hsrc, i);
if (! (tabdst= (SP_TABLE *)hash_search(hdst, if (! (tabdst= (SP_TABLE *)hash_search(hdst,
tabsrc->qname.str, (byte *) tabsrc->qname.str,
tabsrc->qname.length))) tabsrc->qname.length)))
{ {
my_hash_insert(hdst, (byte *)tabsrc); my_hash_insert(hdst, (byte *)tabsrc);
......
...@@ -1102,7 +1102,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) ...@@ -1102,7 +1102,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
("Handler require invalidation queries of %s.%s %lld-%lld", ("Handler require invalidation queries of %s.%s %lld-%lld",
table_list.db, table_list.alias, table_list.db, table_list.alias,
engine_data, table->engine_data())); engine_data, table->engine_data()));
invalidate_table(table->db(), table->key_length()); invalidate_table((byte *) table->db(), table->key_length());
} }
else else
thd->lex->safe_to_cache_query= 0; // Don't try to cache this thd->lex->safe_to_cache_query= 0; // Don't try to cache this
......
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