[Commits] Rev 3671: MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'), TIME('00:00:00'))) in lp:~maria-captains/maria/5.3

Alexander Barkov bar at mariadb.org
Wed Aug 7 12:36:06 EEST 2013


Hello Sergey,

can you please review this patch?

Thanks.


On 08/07/2013 01:37 PM, Alexander Barkov wrote:
> At lp:~maria-captains/maria/5.3
>
> ------------------------------------------------------------
> revno: 3671
> revision-id: bar at mariadb.org-20130807093420-khdah292yerbor8y
> parent: sergii at pisem.net-20130715163225-6ch6x34lsufode3d
> committer: Alexander Barkov <bar at mariadb.org>
> branch nick: 5.3.b4652
> timestamp: Wed 2013-08-07 13:34:20 +0400
> message:
>    MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')))
> === modified file 'mysql-test/r/type_time.result'
> --- a/mysql-test/r/type_time.result	2013-06-28 08:00:25 +0000
> +++ b/mysql-test/r/type_time.result	2013-08-07 09:34:20 +0000
> @@ -182,5 +182,14 @@ NULL
>   Warnings:
>   Warning	1292	Incorrect datetime value: '0000-00-00 00:00:00'
>   #
> +# MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')))
> +#
> +SELECT CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')));
> +CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')))
> +00:00:01.000000
> +SELECT CONCAT(GREATEST(TIME('32 00:00:01'),TIME('00:00:00')));
> +CONCAT(GREATEST(TIME('32 00:00:01'),TIME('00:00:00')))
> +768:00:01.000000
> +#
>   # End of 5.3 tests
>   #
>
> === modified file 'mysql-test/t/type_time.test'
> --- a/mysql-test/t/type_time.test	2013-06-28 08:00:25 +0000
> +++ b/mysql-test/t/type_time.test	2013-08-07 09:34:20 +0000
> @@ -129,5 +129,11 @@ drop table t1;
>   SELECT CONVERT_TZ(GREATEST(TIME('00:00:00'),TIME('00:00:00')),'+00:00','+7:5');
>
>   --echo #
> +--echo # MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')))
> +--echo #
> +SELECT CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00')));
> +SELECT CONCAT(GREATEST(TIME('32 00:00:01'),TIME('00:00:00')));
> +
> +--echo #
>   --echo # End of 5.3 tests
>   --echo #
>
> === modified file 'sql/item.cc'
> --- a/sql/item.cc	2013-07-03 07:46:20 +0000
> +++ b/sql/item.cc	2013-08-07 09:34:20 +0000
> @@ -252,7 +252,8 @@ String *Item::val_string_from_decimal(St
>   String *Item::val_string_from_date(String *str)
>   {
>     MYSQL_TIME ltime;
> -  if (get_date(&ltime, 0) ||
> +  if (get_date(&ltime,
> +               field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0) ||
>         str->alloc(MAX_DATE_STRING_REP_LENGTH))
>     {
>       null_value= 1;
>
> === modified file 'sql/item_func.cc'
> --- a/sql/item_func.cc	2013-07-03 07:46:20 +0000
> +++ b/sql/item_func.cc	2013-08-07 09:34:20 +0000
> @@ -2480,6 +2480,13 @@ bool Item_func_min_max::get_date(MYSQL_T
>       ltime->time_type= MYSQL_TIMESTAMP_DATE;
>       ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0;
>     }
> +  else if (compare_as_dates->field_type() == MYSQL_TYPE_TIME)
> +  {
> +    ltime->time_type= MYSQL_TIMESTAMP_TIME;
> +    ltime->hour+= (ltime->month * 32 + ltime->day) * 24;
> +    ltime->month= ltime->day= 0;
> +  }
> +
>
>     return 0;
>   }
>
> _______________________________________________
> commits mailing list
> commits at mariadb.org
> https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits
>


More information about the commits mailing list