From: eugene Date: July 20 2005 2:55am Subject: bk commit into 5.0 tree (evgen:1.1956) BUG#11760 List-Archive: http://lists.mysql.com/internals/27328 X-Bug: 11760 Message-Id: <20050720025555.B92CB13EF4A@localhost.moonbone.local> Below is the list of changes that have just been committed into a local 5.0 repository of evgen. When evgen 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.1956 05/07/20 06:55:51 evgen@stripped +4 -0 Fix bug #11760 Typo in Item_func_add_time::print() results in NULLs returned by subtime() in view Item_func_add_time::print() were printing arg[0] instead of arg[1] which results in wrongly created view. Functions addtime() and subtime were affected by this bug. mysql-test/r/date_formats.result 1.17 05/07/20 06:53:52 evgen@stripped +1 -1 Fixed wrong test result. Affected by bug#11760 mysql-test/r/view.result 1.94 05/07/20 06:50:51 evgen@stripped +8 -0 Test case for bug #11760 Typo in Item_func_add_time::print() results in wrongly created view mysql-test/t/view.test 1.88 05/07/20 06:35:41 evgen@stripped +10 -0 Test case for bug #11760 Typo in Item_func_add_time::print() results in wrongly created view sql/item_timefunc.cc 1.89 05/07/20 06:32:59 evgen@stripped +1 -1 Fix bug #11760 Typo in Item_func_add_time::print() results in wrongly created view # 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: evgen # Host: moonbone.local # Root: /work/mysql-5.0-bug-11760 --- 1.88/sql/item_timefunc.cc 2005-07-01 08:05:35 +04:00 +++ 1.89/sql/item_timefunc.cc 2005-07-20 06:32:59 +04:00 @@ -2524,7 +2524,7 @@ } args[0]->print(str); str->append(','); - args[0]->print(str); + args[1]->print(str); str->append(')'); } --- 1.93/mysql-test/r/view.result 2005-07-16 16:10:35 +04:00 +++ 1.94/mysql-test/r/view.result 2005-07-20 06:50:51 +04:00 @@ -2016,3 +2016,11 @@ DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; +create table t1(f1 datetime); +insert into t1 values('2005.01.01 12:0:0'); +create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1; +select * from v1; +f1 sb +2005-01-01 12:00:00 2005-01-01 10:58:59 +drop view v1; +drop table t1; --- 1.87/mysql-test/t/view.test 2005-07-16 01:17:01 +04:00 +++ 1.88/mysql-test/t/view.test 2005-07-20 06:35:41 +04:00 @@ -1853,3 +1853,13 @@ DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; + +# +# Bug #11760 Typo in Item_func_add_time::print() results in NULLs returned +# subtime() in view +create table t1(f1 datetime); +insert into t1 values('2005.01.01 12:0:0'); +create view v1 as select f1, subtime(f1, '1:1:1') as sb from t1; +select * from v1; +drop view v1; +drop table t1; --- 1.16/mysql-test/r/date_formats.result 2005-03-30 17:00:27 +04:00 +++ 1.17/mysql-test/r/date_formats.result 2005-07-20 06:53:52 +04:00 @@ -434,7 +434,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'31.12.97 11.59.59.999999 PM') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` +Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,addtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'1 1.1.1.000002') AS `addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,subtime(_latin1'31.12.97 11.59.59.999999 PM',_latin1'1 1.1.1.000002') AS `subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002")`,timediff(_latin1'01.01.97 11:59:59.000001 PM',_latin1'31.12.95 11:59:59.000002 PM') AS `timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM")`,cast(str_to_date(_latin1'15-01-2001 12:59:59',_latin1'%d-%m-%Y %H:%i:%S') as time) AS `cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME)`,maketime(23,11,12) AS `maketime(23,11,12)`,microsecond(_latin1'1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")` create table t1 (d date); insert into t1 values ('2004-07-14'),('2005-07-14'); select date_format(d,"%d") from t1 order by 1;