summaryrefslogtreecommitdiff
path: root/sql/sql_analyse.cc
diff options
context:
space:
mode:
authorunknown <iggy@rolltop.ignatz42.dyndns.org>2006-09-28 14:32:30 -0400
committerunknown <iggy@rolltop.ignatz42.dyndns.org>2006-09-28 14:32:30 -0400
commite99cf7edb9649fe847e8f1b7ac694febda844968 (patch)
treeadefb048b1160cf1a8a8e448cb8291f9ab9d8330 /sql/sql_analyse.cc
parent131d94f58c07629ec37c0af32c6657dea8bc5e4e (diff)
parent314e10592ceac7def3ea4863d5a1f8b23464bf30 (diff)
downloadmariadb-git-e99cf7edb9649fe847e8f1b7ac694febda844968.tar.gz
Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20305/my41-bug20305
into rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20305/my50-bug20305 mysql-test/r/analyse.result: Auto merged sql/sql_analyse.cc: Auto merged mysql-test/t/analyse.test: manual merge
Diffstat (limited to 'sql/sql_analyse.cc')
-rw-r--r--sql/sql_analyse.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index af9246c673a..62b6d4f7920 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -807,9 +807,9 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows)
else if (num_info.decimals) // DOUBLE(%d,%d) sometime
{
if (num_info.dval > -FLT_MAX && num_info.dval < FLT_MAX)
- sprintf(buff, "FLOAT(%d,%d)", num_info.integers, num_info.decimals);
+ sprintf(buff, "FLOAT(%d,%d)", (num_info.integers + num_info.decimals), num_info.decimals);
else
- sprintf(buff, "DOUBLE(%d,%d)", num_info.integers, num_info.decimals);
+ sprintf(buff, "DOUBLE(%d,%d)", (num_info.integers + num_info.decimals), num_info.decimals);
}
else if (ev_num_info.llval >= -128 &&
ev_num_info.ullval <=
@@ -916,10 +916,10 @@ void field_real::get_opt_type(String *answer,
else
{
if (min_arg >= -FLT_MAX && max_arg <= FLT_MAX)
- sprintf(buff, "FLOAT(%d,%d)", (int) max_length - (item->decimals + 1),
+ sprintf(buff, "FLOAT(%d,%d)", (int) max_length - (item->decimals + 1) + max_notzero_dec_len,
max_notzero_dec_len);
else
- sprintf(buff, "DOUBLE(%d,%d)", (int) max_length - (item->decimals + 1),
+ sprintf(buff, "DOUBLE(%d,%d)", (int) max_length - (item->decimals + 1) + max_notzero_dec_len,
max_notzero_dec_len);
answer->append(buff, (uint) strlen(buff));
}