diff options
author | unknown <monty@hundin.mysql.fi> | 2002-03-27 00:50:54 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-03-27 00:50:54 +0200 |
commit | 6229932f1010c270e2319d8dc3be9670d016546e (patch) | |
tree | b4d119bd6bbc308bc83082b866042975b6b7f35c /sql/field.cc | |
parent | 91443b080b7858e69360d598061b4b8a32211aac (diff) | |
download | mariadb-git-6229932f1010c270e2319d8dc3be9670d016546e.tar.gz |
support for unsigned FLOAT/DOUBLE
Docs/manual.texi:
Updated STRCMP and UNION information
configure.in:
Portability fix
include/config-win.h:
Fix for WIN64
include/mysql_com.h:
Cleanup
libmysql/libmysql.c:
Cleanup
myisam/ft_boolean_search.c:
Cleanup
mysys/array.c:
Cleanup
mysys/thr_alarm.c:
Cleanup
sql/ha_innodb.cc:
Cleanup
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc index 2a0d0160d00..32679f549ba 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1713,6 +1713,11 @@ void Field_float::store(double nr) float j; if (dec < NOT_FIXED_DEC) nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point + if (unsigned_flag && nr < 0) + { + current_thd->cuted_fields++; + nr=0; + } if (nr < -FLT_MAX) { j= -FLT_MAX; @@ -1739,6 +1744,11 @@ void Field_float::store(double nr) void Field_float::store(longlong nr) { float j= (float) nr; + if (unsigned_flag && j < 0) + { + current_thd->cuted_fields++; + j=0; + } #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -1945,6 +1955,11 @@ void Field_double::store(const char *from,uint len) double j= atof(tmp_str.c_ptr()); if (errno || current_thd->count_cuted_fields && !test_if_real(from,len)) current_thd->cuted_fields++; + if (unsigned_flag && j < 0) + { + current_thd->cuted_fields++; + j=0; + } #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -1960,6 +1975,11 @@ void Field_double::store(double nr) { if (dec < NOT_FIXED_DEC) nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point + if (unsigned_flag && nr < 0) + { + current_thd->cuted_fields++; + nr=0; + } #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -1974,6 +1994,11 @@ void Field_double::store(double nr) void Field_double::store(longlong nr) { double j= (double) nr; + if (unsigned_flag && j < 0) + { + current_thd->cuted_fields++; + j=0; + } #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { |