From a91607769ab8d54cbc7bc99d3b0e8d56ed85ed80 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Mon, 9 Feb 2009 06:21:48 +0100 Subject: Bug#42661: sec_to_time() and signedness Bug#42662: maketime() and signedness Item_time_typecast::val_int() dropped sign from MYSQL_TIME gotten using from get_time(). Propagates sign now. mysql-test/r/func_sapdb.result: Show that comparisons with TIME(-...) work now. mysql-test/t/func_sapdb.test: Show that comparisons with TIME(-...) work now. sql/item_timefunc.cc: don't drop sign when converting from MYSQL_TIME --- mysql-test/t/func_sapdb.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mysql-test/t/func_sapdb.test') diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 1292c475732..6fed52e1b84 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -169,4 +169,24 @@ SELECT TIMEDIFF(TIME('17:00:00'),TIME('17:00:00'))=TIME('00:00:00') AS 1Eq, TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')), TIMEDIFF(TIME('17:00:00'),TIME('17:59:00')); +# +# Bug#42661 - sec_to_time() and signedness +# + +SELECT sec_to_time(3020399)=time('838:59:59'); +SELECT sec_to_time(-3020399)=time('-838:59:59'); +SELECT sec_to_time(-3020399)='-838:59:59'; +SELECT time(sec_to_time(-3020399))=time('-838:59:59'); +SELECT time(sec_to_time(-3020399))=time('-838:59:58'); + +# +# Bug#42662 - maketime() and signedness +# + +SELECT maketime(-1,0,1)='-01:00:01'; +SELECT TIME(maketime(-1,0,1))=TIME('-01:00:01'); +SELECT maketime(-1,0,1)=TIME('-01:00:01'); +SELECT maketime(1,0,1)=TIME('01:00:01'); +SELECT maketime(1,0,1)=TIME('01:00:02'); + # End of 5.0 tests -- cgit v1.2.1