List:Commits« Previous MessageNext Message »
From:holyfoot Date:January 16 2006 2:07pm
Subject:bk commit into 5.0 tree (holyfoot:1.2022) BUG#15480
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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
  1.2022 06/01/16 18:07:04 holyfoot@deer.(none) +6 -0
  bug #15480 (Warning message contains junk)

  sql/time.cc
    1.58 06/01/16 18:05:36 holyfoot@stripped +1 -1
    push_warning_printf call fixed with the new message

  sql/share/errmsg.txt
    1.57 06/01/16 18:05:36 holyfoot@stripped +2 -2
    error message fixed

  sql/my_decimal.cc
    1.12 06/01/16 18:05:36 holyfoot@stripped +1 -1
    push_warning_printf call fixed with the new message

  sql/field.cc
    1.298 06/01/16 18:05:35 holyfoot@stripped +3 -3
    push_warning_printf call fixed with the new message

  mysql-test/t/type_newdecimal.test
    1.35 06/01/16 18:05:35 holyfoot@stripped +8 -0
    test case

  mysql-test/r/type_newdecimal.result
    1.38 06/01/16 18:05:35 holyfoot@stripped +8 -0
    test result fixed

# 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:	holyfoot
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.0.15480

--- 1.297/sql/field.cc	Thu Jan 12 11:37:32 2006
+++ 1.298/sql/field.cc	Mon Jan 16 18:05:35 2006
@@ -1082,7 +1082,7 @@
     push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
                         ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, 
                         ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
-                        "integer", tmp.c_ptr(), field_name,
+                        "integer", tmp.length(), tmp.c_ptr(), field_name,
                         (ulong) table->in_use->row_count);
     return 1;					// Empty string
   }
@@ -2417,7 +2417,7 @@
     push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_ERROR,
                         ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
                         ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
-                        "decimal", from, field_name,
+                        "decimal", length, from, field_name,
                         (ulong) table->in_use->row_count);
     DBUG_RETURN(err);
   }
@@ -2434,7 +2434,7 @@
     push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN,
                         ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
                         ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
-                        "decimal", from, field_name,
+                        "decimal", length, from, field_name,
                         (ulong) table->in_use->row_count);
     my_decimal_set_zero(&decimal_value);
     break;

--- 1.57/sql/time.cc	Sun Jul 31 14:49:47 2005
+++ 1.58/sql/time.cc	Mon Jan 16 18:05:36 2006
@@ -708,7 +708,7 @@
   if (field_name)
     cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
                        ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
-                       type_str, str.c_ptr(), field_name,
+                       type_str, str.c_ptr(), str.length(), field_name,
                        (ulong) thd->row_count);
   else
     cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),

--- 1.56/sql/share/errmsg.txt	Tue Dec 20 22:42:13 2005
+++ 1.57/sql/share/errmsg.txt	Mon Jan 16 18:05:36 2006
@@ -5317,8 +5317,8 @@
 	eng "Division by 0"
 	ger "Division durch 0"
 ER_TRUNCATED_WRONG_VALUE_FOR_FIELD  
-	eng "Incorrect %-.32s value: '%-.128s' for column '%.64s' at row %ld"
+	eng "Incorrect %-.32s value: '%.*s' for column '%.64s' at row %ld"
 ER_ILLEGAL_VALUE_FOR_TYPE 22007 
 	eng "Illegal %s '%-.64s' value found during parsing"

--- 1.37/mysql-test/r/type_newdecimal.result	Tue Nov 29 16:42:38 2005
+++ 1.38/mysql-test/r/type_newdecimal.result	Mon Jan 16 18:05:35 2006
@@ -1397,3 +1397,11 @@
 9999999999999999999999999999999999999999999999999999999999999999
 9999999999999999999999999999999999999999999999999999999999999999
 drop table t1;
+CREATE TABLE t1(c DECIMAL(64, 2));
+INSERT INTO t1 VALUES (REPEAT('a', 100));
+Warnings:
+Warning	1366	Incorrect decimal value: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for column 'c' at row 1
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1366	Incorrect decimal value: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for column 'c' at row 1
+DROP TABLE t1;

--- 1.34/mysql-test/t/type_newdecimal.test	Tue Nov 29 16:42:38 2005
+++ 1.35/mysql-test/t/type_newdecimal.test	Mon Jan 16 18:05:35 2006
@@ -1085,3 +1085,11 @@
 insert into t1 values(1e100);
 select * from t1;
 drop table t1;
+
+#
+# Bug #15480 (Warning message contains junk)
+#
+CREATE TABLE t1(c DECIMAL(64, 2));
+INSERT INTO t1 VALUES (REPEAT('a', 100));
+SHOW WARNINGS;
+DROP TABLE t1;

--- 1.11/sql/my_decimal.cc	Sat Oct 15 21:55:26 2005
+++ 1.12/sql/my_decimal.cc	Mon Jan 16 18:05:36 2006
@@ -55,7 +55,7 @@
     push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 			ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
 			ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
-			"decimal", "", "", (long)-1);
+			"decimal", 0, "", "", (long)-1);
     break;
   case E_DEC_OOM:
     my_error(ER_OUT_OF_RESOURCES, MYF(0));
Thread
bk commit into 5.0 tree (holyfoot:1.2022) BUG#15480holyfoot16 Jan