Commit 7389e540 authored by unknown's avatar unknown

Fix warnings/compilation failures reported by Jan Lindstrom


sql/field.cc:
  Fix warnings/compilation failures.
parent 661b248e
...@@ -5184,20 +5184,20 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs) ...@@ -5184,20 +5184,20 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
int Field_date::store(double nr) int Field_date::store(double nr)
{ {
long tmp; longlong tmp;
int error= 0; int error= 0;
if (nr >= 19000000000000.0 && nr <= 99991231235959.0) if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
nr=floor(nr/1000000.0); // Timestamp to date nr=floor(nr/1000000.0); // Timestamp to date
if (nr < 0.0 || nr > 99991231.0) if (nr < 0.0 || nr > 99991231.0)
{ {
tmp=0L; tmp= LL(0);
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE, ER_WARN_DATA_OUT_OF_RANGE,
nr, MYSQL_TIMESTAMP_DATE); nr, MYSQL_TIMESTAMP_DATE);
error= 1; error= 1;
} }
else else
tmp=(long) rint(nr); tmp= (longlong) rint(nr);
return Field_date::store(tmp); return Field_date::store(tmp);
} }
...@@ -6908,8 +6908,8 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)), ...@@ -6908,8 +6908,8 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
my_decimal *Field_blob::val_decimal(my_decimal *decimal_value) my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
{ {
char *blob; const char *blob;
memcpy_fixed(&blob, ptr+packlength, sizeof(char*)); memcpy_fixed(&blob, ptr+packlength, sizeof(const char*));
if (!blob) if (!blob)
blob= ""; blob= "";
str2my_decimal(E_DEC_FATAL_ERROR, blob, get_length(ptr), charset(), str2my_decimal(E_DEC_FATAL_ERROR, blob, get_length(ptr), charset(),
......
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