From: Jorgen Loland Date: February 16 2011 9:50am Subject: Re: bzr commit into mysql-5.5 branch (tor.didriksen:3326) Bug#11766860 List-Archive: http://lists.mysql.com/commits/131393 Message-Id: <4D5B9DF8.90302@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Didrik, Great work. Approved. (There is one small comment inline) On 02/15/2011 11:27 AM, Tor Didriksen wrote: > #At file:///export/home/didrik/repo/5.5-foo/ based on revid:joerg@stripped > > 3326 Tor Didriksen 2011-02-15 > Bug #11766860 - 60085: CRASH IN ITEM::SAVE_IN_FIELD() WITH TIME DATA TYPE > > This assumption in Item_cache_datetime::cache_value_int > was wrong: > - /* Assume here that the underlying item will do correct conversion.*/ > - int_value= example->val_int_result(); > @ mysql-test/r/subselect_innodb.result > New test case. > @ mysql-test/t/subselect_innodb.test > New test case. > @ sql/item.cc > In Item_cache_datetime::cache_value_int() > - call get_time() or get_date() depending on desired type > - convert the returned MYSQL_TIME value to longlong depending on desired type > @ sql/item.h > The cached int_value in Item_cache_datetime should not be unsigned: > - it is used mostly in signed context > - it can actually have negative value (for TIME data type) > @ sql/item_subselect.cc > Add some DBUG_TRACE for easier bug-hunting. > > modified: > mysql-test/r/subselect_innodb.result > mysql-test/t/subselect_innodb.test > sql/item.cc > sql/item.h > sql/item_subselect.cc > === modified file 'mysql-test/r/subselect_innodb.result' > --- a/mysql-test/r/subselect_innodb.result 2006-01-26 16:54:34 +0000 > +++ b/mysql-test/r/subselect_innodb.result 2011-02-15 10:27:30 +0000 > @@ -245,3 +245,12 @@ x > NULL > drop procedure p1; > drop tables t1,t2,t3; > +# > +# Bug#60085 crash in Item::save_in_field() with time data type > +# > +CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb; > +INSERT INTO t1 VALUES ('2011-05-13', 0); > +SELECT 1 FROM t1 WHERE b< (SELECT CAST(a as date) FROM t1 GROUP BY a); > +1 > +1 I suggest "SELECT *" here -- Jørgen Løland | Senior Software Engineer | +47 73842138 Oracle MySQL Trondheim, Norway