List:Commits« Previous MessageNext Message »
From:<gshchepa Date:October 10 2007 10:35pm
Subject:bk commit into 5.0 tree (gshchepa:1.2537) BUG#31384
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of uchum. When uchum 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, 2007-10-11 01:35:08+05:00, gshchepa@stripped +3 -0
  Fixed bug #31384: DATE_ADD() and DATE_SUB() return binary data.
  
  The binary character set has been replaced with the latin1 charset
  to fix this problem.

  mysql-test/r/func_date_add.result@stripped, 2007-10-11 01:29:59+05:00, gshchepa@stripped +11
-0
    Added test case for bug #31384.

  mysql-test/t/func_date_add.test@stripped, 2007-10-11 01:29:52+05:00, gshchepa@stripped +11
-0
    Added test case for bug #31384.

  sql/item_timefunc.cc@stripped, 2007-10-11 01:29:41+05:00, gshchepa@stripped +1 -1
    Fixed bug #31384.
    The Item_date_add_interval::fix_length_and_dec method has been
    modified to the latin1 charset for the resulting data string
    instead of the binary charset.

diff -Nrup a/mysql-test/r/func_date_add.result b/mysql-test/r/func_date_add.result
--- a/mysql-test/r/func_date_add.result	2007-05-30 01:32:57 +05:00
+++ b/mysql-test/r/func_date_add.result	2007-10-11 01:29:59 +05:00
@@ -95,4 +95,15 @@ b + interval a day
 2001-01-02
 2002-02-04
 drop table t1;
+CREATE TABLE t1 SELECT
+DATE_ADD('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS a,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS b;
+DESCRIBE t1;
+Field	Type	Null	Key	Default	Extra
+a	varchar(29)	YES		NULL	
+b	varchar(29)	YES		NULL	
+SELECT * FROM t1;
+a	b
+2007-08-03 17:34:00	2007-08-03 17:32:00
+DROP TABLE t1;
 End of 5.0 tests
diff -Nrup a/mysql-test/t/func_date_add.test b/mysql-test/t/func_date_add.test
--- a/mysql-test/t/func_date_add.test	2007-05-30 01:32:58 +05:00
+++ b/mysql-test/t/func_date_add.test	2007-10-11 01:29:52 +05:00
@@ -87,4 +87,15 @@ select '2007-01-01' + interval a day fro
 select b + interval a day from t1;
 drop table t1;
 
+#
+# Bug#31384: DATE_ADD() and DATE_SUB() return binary data
+#
+
+CREATE TABLE t1 SELECT
+   DATE_ADD('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS a,
+   DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS b;
+DESCRIBE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
 --echo End of 5.0 tests
diff -Nrup a/sql/item_timefunc.cc b/sql/item_timefunc.cc
--- a/sql/item_timefunc.cc	2007-09-22 12:48:34 +05:00
+++ b/sql/item_timefunc.cc	2007-10-11 01:29:41 +05:00
@@ -2056,7 +2056,7 @@ void Item_date_add_interval::fix_length_
 {
   enum_field_types arg0_field_type;
 
-  collation.set(&my_charset_bin);
+  collation.set(&my_charset_latin1);
   maybe_null=1;
   max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
   value.alloc(max_length);
Thread
bk commit into 5.0 tree (gshchepa:1.2537) BUG#31384gshchepa10 Oct