List:Commits« Previous MessageNext Message »
From:reggie Date:August 17 2006 8:30pm
Subject:bk commit into 5.1 tree (rburnett:1.2274)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of rburnett. When rburnett 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-08-17 22:30:32+02:00, rburnett@stripped +3 -0
  Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
  into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
  MERGE: 1.2264.1.19

  mysql-test/r/type_newdecimal.result@stripped, 2006-08-17 22:19:52+02:00, rburnett@stripped +0 -0
    Auto merged
    MERGE: 1.47.1.1

  mysql-test/t/type_newdecimal.test@stripped, 2006-08-17 22:19:52+02:00, rburnett@stripped +0 -0
    Auto merged
    MERGE: 1.40.1.1

  sql/item_create.cc@stripped, 2006-08-17 22:30:03+02:00, rburnett@stripped +1 -2
    MERGE: 1.64.1.1

# 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:	rburnett
# Host:	bk-internal.mysql.com
# Root:	/data0/bk/mysql-5.1-kt/RESYNC

--- 1.65/sql/item_create.cc	2006-08-17 22:30:53 +02:00
+++ 1.66/sql/item_create.cc	2006-08-17 22:30:53 +02:00
@@ -454,6 +454,8 @@
 		       CHARSET_INFO *cs)
 {
   Item *res;
+  int tmp_len;
+  LINT_INIT(res);
 
   switch (cast_type) {
   case ITEM_CAST_BINARY: 	res= new Item_func_binary(a); break;
@@ -463,7 +465,13 @@
   case ITEM_CAST_TIME:		res= new Item_time_typecast(a); break;
   case ITEM_CAST_DATETIME:	res= new Item_datetime_typecast(a); break;
   case ITEM_CAST_DECIMAL:
-    res= new Item_decimal_typecast(a, (len > 0) ? len : 10, dec);
+    tmp_len= (len>0) ? len : 10;
+    if (tmp_len < dec)
+    {
+      my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
+      return 0;
+    }
+    res= new Item_decimal_typecast(a, tmp_len, dec);
     break;
   case ITEM_CAST_CHAR:
     res= new Item_char_typecast(a, len, cs ? cs : 

--- 1.48/mysql-test/r/type_newdecimal.result	2006-08-17 22:30:53 +02:00
+++ 1.49/mysql-test/r/type_newdecimal.result	2006-08-17 22:30:53 +02:00
@@ -915,9 +915,13 @@
 select cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(30,15));
 cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(30,15))
 0.000000000100000
-select ln(14000) c1, convert(ln(14000),decimal(2,3)) c2, cast(ln(14000) as decimal(2,3)) c3;
+select ln(14000) c1, convert(ln(14000),decimal(5,3)) c2, cast(ln(14000) as decimal(5,3)) c3;
 c1	c2	c3
 9.5468126085974	9.547	9.547
+select convert(ln(14000),decimal(2,3)) c1;
+ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
+select cast(ln(14000) as decimal(2,3)) c1;
+ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
 create table t1 (sl decimal(70,30));
 ERROR 42000: Too big precision 70 specified for column 'sl'. Maximum is 65.
 create table t1 (sl decimal(32,31));

--- 1.41/mysql-test/t/type_newdecimal.test	2006-08-17 22:30:53 +02:00
+++ 1.42/mysql-test/t/type_newdecimal.test	2006-08-17 22:30:53 +02:00
@@ -947,8 +947,12 @@
 #
 # Bug #11708 (conversion to decimal fails in decimal part)
 #
-select ln(14000) c1, convert(ln(14000),decimal(2,3)) c2, cast(ln(14000) as decimal(2,3)) c3;
-
+select ln(14000) c1, convert(ln(14000),decimal(5,3)) c2, cast(ln(14000) as decimal(5,3)) c3;
+--error 1427
+select convert(ln(14000),decimal(2,3)) c1;
+--error 1427
+select cast(ln(14000) as decimal(2,3)) c1;
+ 
 #
 # Bug #8449 (Silent column changes)
 #
Thread
bk commit into 5.1 tree (rburnett:1.2274)reggie17 Aug