List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:September 28 2006 8:32pm
Subject:bk commit into 5.0 tree (iggy:1.2276)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of iggy. When iggy does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-28 14:32:30-04:00, iggy@stripped +3 -0
  Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20305/my41-bug20305
  into  rolltop.ignatz42.dyndns.org:/mnt/storeage/bug20305/my50-bug20305
  MERGE: 1.1616.2734.6

  mysql-test/r/analyse.result@stripped, 2006-09-28 14:30:45-04:00, iggy@stripped +0 -0
    Auto merged
    MERGE: 1.14.1.5

  mysql-test/t/analyse.test@stripped, 2006-09-28 14:32:27-04:00, iggy@stripped +0 -1
    manual merge
    MERGE: 1.12.1.4

  sql/sql_analyse.cc@stripped, 2006-09-28 14:30:45-04:00, iggy@stripped +0 -0
    Auto merged
    MERGE: 1.45.1.10

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	iggy
# Host:	rolltop.ignatz42.dyndns.org
# Root:	/mnt/storeage/bug20305/my50-bug20305/RESYNC

--- 1.67/sql/sql_analyse.cc	2006-09-28 14:32:34 -04:00
+++ 1.68/sql/sql_analyse.cc	2006-09-28 14:32:34 -04:00
@@ -807,9 +807,9 @@
     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 @@
   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));
   }

--- 1.26/mysql-test/r/analyse.result	2006-09-28 14:32:34 -04:00
+++ 1.27/mysql-test/r/analyse.result	2006-09-28 14:32:34 -04:00
@@ -141,3 +141,16 @@
 sum(profit)	10	6900	11	11	0	0	1946.2500	2867.6719	ENUM('10','275','600','6900') NOT NULL
 avg(profit)	10.0000	1380.0000	16	16	0	0	394.68750000	570.20033144	ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL
 drop table t1,t2;
+create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5));
+insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555);
+select f1 from t1 procedure analyse(1, 1);
+Field_name	Min_value	Max_value	Min_length	Max_length	Empties_or_zeros	Nulls	Avg_value_or_avg_length	Std	Optimal_fieldtype
+test.t1.f1	5.99900	9.55500	7	7	0	0	7.77700	1.77800	FLOAT(4,3) NOT NULL
+select f2 from t1 procedure analyse(1, 1);
+Field_name	Min_value	Max_value	Min_length	Max_length	Empties_or_zeros	Nulls	Avg_value_or_avg_length	Std	Optimal_fieldtype
+test.t1.f2	5.9999	9.5555	6	6	0	0	6.0000	NULL	FLOAT(5,4) UNSIGNED NOT NULL
+select f3 from t1 procedure analyse(1, 1);
+Field_name	Min_value	Max_value	Min_length	Max_length	Empties_or_zeros	Nulls	Avg_value_or_avg_length	Std	Optimal_fieldtype
+test.t1.f3	5.99999	9.55555	7	7	0	0	7.77777	1.77778	FLOAT(6,5) NOT NULL
+drop table t1;
+End of 4.1 tests

--- 1.17/mysql-test/t/analyse.test	2006-09-28 14:32:34 -04:00
+++ 1.18/mysql-test/t/analyse.test	2006-09-28 14:32:34 -04:00
@@ -90,5 +90,16 @@
 insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland');
 select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse();
 drop table t1,t2;
-# End of 4.1 tests
 
+#
+# Bug #20305 PROCEDURE ANALYSE() returns wrong M for FLOAT(M, D) and DOUBLE(M, D)
+#
+
+create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5));
+insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555);
+select f1 from t1 procedure analyse(1, 1);
+select f2 from t1 procedure analyse(1, 1);
+select f3 from t1 procedure analyse(1, 1);
+drop table t1;
+
+--echo End of 4.1 tests
Thread
bk commit into 5.0 tree (iggy:1.2276)Ignacio Galarza28 Sep