mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00'))
This commit is contained in:
parent
04fd2f18cb
commit
f1b4718ec8
4 changed files with 24 additions and 1 deletions
|
@ -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
|
||||
#
|
||||
|
|
|
@ -128,6 +128,12 @@ drop table t1;
|
|||
--echo #
|
||||
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 #
|
||||
|
|
|
@ -252,7 +252,8 @@ String *Item::val_string_from_decimal(String *str)
|
|||
String *Item::val_string_from_date(String *str)
|
||||
{
|
||||
MYSQL_TIME ltime;
|
||||
if (get_date(<ime, 0) ||
|
||||
if (get_date(<ime,
|
||||
field_type() == MYSQL_TYPE_TIME ? TIME_TIME_ONLY : 0) ||
|
||||
str->alloc(MAX_DATE_STRING_REP_LENGTH))
|
||||
{
|
||||
null_value= 1;
|
||||
|
|
|
@ -2480,6 +2480,13 @@ bool Item_func_min_max::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue