The problem appeared in 5.3 tree with the following revision:
------------------------------------------------------------
revno: 3674
revision-id: bar@mariadb.org-20130812124759-8cy7ot1s3ysgned2
parent: sanja@montyprogram.com-20130801084611-udozq8c9kxgy94bq
committer: Alexander Barkov <bar@mariadb.org>
branch nick: 5.3.b4652
timestamp: Mon 2013-08-12 16:47:59 +0400
message:
MDEV-4652 Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00'))
###########################
- Test case:
CREATE TABLE t1 (t TIME);
INSERT INTO t1 VALUES ('03:22:30'),('18:30:05');
SELECT CONVERT_TZ( GREATEST( t, CURRENT_DATE() ), 'Europe/Moscow', 'Japan' ) FROM t1;
################################
mysqld: tztime.cc:792: my_time_t sec_since_epoch(int, int, int, int, int, int): Assertion `mon > 0 && mon < 13' failed.
131221 3:17:21 [ERROR] mysqld got signal 6 ;
#6 0x00007f5df8abd621 in *_GI__assert_fail (assertion=0xd99279 "mon > 0 && mon < 13", file=<optimized out>, line=792, function=0xd9a4e0 "my_time_t sec_since_epoch(int, int, int, int, int, int)") at assert.c:81
#7 0x00000000008c8f20 in sec_since_epoch (year=2013, mon=0, mday=0, hour=9720, min=0, sec=0) at tztime.cc:792
#8 0x00000000008c91a5 in TIME_to_gmt_sec (t=0x7f5deffd8f20, sp=0x34174f8, error_code=0x7f5deffd8ec4) at tztime.cc:935
#9 0x00000000008c9575 in Time_zone_db::TIME_to_gmt_sec (this=0x3418d48, t=0x7f5deffd8f20, error_code=0x7f5deffd8ec4) at tztime.cc:1254
#10 0x000000000061a866 in Item_func_convert_tz::get_date (this=0x346fff0, ltime=0x7f5deffd8f20, fuzzy_date=0) at item_timefunc.cc:1842
#11 0x00000000005af8b3 in Item::send (this=0x346fff0, protocol=0x33ebfd0, buffer=0x7f5deffd8ff0) at item.cc:6113
#12 0x000000000067e53b in select_send::send_data (this=0x3470698, items=...) at sql_class.cc:2012
#13 0x0000000000752c01 in end_send (join=0x34706b8, join_tab=0x349c0a0, end_of_records=false) at sql_select.cc:17329
#14 0x0000000000750b15 in evaluate_join_record (join=0x34706b8, join_tab=0x349bd80, error=0) at sql_select.cc:16469
#15 0x00000000007502fc in sub_select (join=0x34706b8, join_tab=0x349bd80, end_of_records=false) at sql_select.cc:16271
#16 0x000000000074f9fd in do_select (join=0x34706b8, fields=0x33ee770, table=0x0, procedure=0x0) at sql_select.cc:15924
#17 0x000000000072ee0b in JOIN::exec (this=0x34706b8) at sql_select.cc:2788
#18 0x000000000072f6a5 in mysql_select (thd=0x33ebbc8, rref_pointer_array=0x33ee8b8, tables=0x34701f0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0x3470698, unit=0x33ee158, select_lex=0x33ee660) at sql_select.cc:3009
#19 0x0000000000726105 in handle_select (thd=0x33ebbc8, lex=0x33ee0b8, result=0x3470698, setup_tables_done_option=0) at sql_select.cc:288
#20 0x00000000006b4dec in execute_sqlcom_select (thd=0x33ebbc8, all_tables=0x34701f0) at sql_parse.cc:5172
#21 0x00000000006abf88 in mysql_execute_command (thd=0x33ebbc8) at sql_parse.cc:2305
#22 0x00000000006b7753 in mysql_parse (thd=0x33ebbc8, rawbuf=0x346f900 "SELECT CONVERT_TZ( GREATEST( t, CURRENT_DATE() ), 'Europe/Moscow', 'Japan' ) FROM t1", length=84, found_semicolon=0x7f5deffdacb8) at sql_parse.cc:6173
#23 0x00000000006a9768 in dispatch_command (command=COM_QUERY, thd=0x33ebbc8, packet=0x3466499 "", packet_length=84) at sql_parse.cc:1243
#24 0x00000000006a8a54 in do_command (thd=0x33ebbc8) at sql_parse.cc:923
#25 0x00000000006a58dd in handle_one_connection (arg=0x33ebbc8) at sql_connect.cc:1231
#26 0x00007f5df97c9b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#27 0x00007f5df8b6ca7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
The problem appeared in 5.3 tree with the following revision:
------------------------------------------------------------
revno: 3674
revision-id: bar@mariadb.org-20130812124759-8cy7ot1s3ysgned2
parent: sanja@montyprogram.com-20130801084611-udozq8c9kxgy94bq
committer: Alexander Barkov <bar@mariadb.org>
branch nick: 5.3.b4652
timestamp: Mon 2013-08-12 16:47:59 +0400
message:
MDEV-4652Wrong result for CONCAT(GREATEST(TIME('00:00:01'),TIME('00:00:00'))###########################
CREATE TABLE t1 (t TIME);
INSERT INTO t1 VALUES ('03:22:30'),('18:30:05');
SELECT CONVERT_TZ( GREATEST( t, CURRENT_DATE() ), 'Europe/Moscow', 'Japan' ) FROM t1;
################################
mysqld: tztime.cc:792: my_time_t sec_since_epoch(int, int, int, int, int, int): Assertion `mon > 0 && mon < 13' failed.
131221 3:17:21 [ERROR] mysqld got signal 6 ;
#6 0x00007f5df8abd621 in *_GI__assert_fail (assertion=0xd99279 "mon > 0 && mon < 13", file=<optimized out>, line=792, function=0xd9a4e0 "my_time_t sec_since_epoch(int, int, int, int, int, int)") at assert.c:81
#7 0x00000000008c8f20 in sec_since_epoch (year=2013, mon=0, mday=0, hour=9720, min=0, sec=0) at tztime.cc:792
#8 0x00000000008c91a5 in TIME_to_gmt_sec (t=0x7f5deffd8f20, sp=0x34174f8, error_code=0x7f5deffd8ec4) at tztime.cc:935
#9 0x00000000008c9575 in Time_zone_db::TIME_to_gmt_sec (this=0x3418d48, t=0x7f5deffd8f20, error_code=0x7f5deffd8ec4) at tztime.cc:1254
#10 0x000000000061a866 in Item_func_convert_tz::get_date (this=0x346fff0, ltime=0x7f5deffd8f20, fuzzy_date=0) at item_timefunc.cc:1842
#11 0x00000000005af8b3 in Item::send (this=0x346fff0, protocol=0x33ebfd0, buffer=0x7f5deffd8ff0) at item.cc:6113
#12 0x000000000067e53b in select_send::send_data (this=0x3470698, items=...) at sql_class.cc:2012
#13 0x0000000000752c01 in end_send (join=0x34706b8, join_tab=0x349c0a0, end_of_records=false) at sql_select.cc:17329
#14 0x0000000000750b15 in evaluate_join_record (join=0x34706b8, join_tab=0x349bd80, error=0) at sql_select.cc:16469
#15 0x00000000007502fc in sub_select (join=0x34706b8, join_tab=0x349bd80, end_of_records=false) at sql_select.cc:16271
#16 0x000000000074f9fd in do_select (join=0x34706b8, fields=0x33ee770, table=0x0, procedure=0x0) at sql_select.cc:15924
#17 0x000000000072ee0b in JOIN::exec (this=0x34706b8) at sql_select.cc:2788
#18 0x000000000072f6a5 in mysql_select (thd=0x33ebbc8, rref_pointer_array=0x33ee8b8, tables=0x34701f0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0x3470698, unit=0x33ee158, select_lex=0x33ee660) at sql_select.cc:3009
#19 0x0000000000726105 in handle_select (thd=0x33ebbc8, lex=0x33ee0b8, result=0x3470698, setup_tables_done_option=0) at sql_select.cc:288
#20 0x00000000006b4dec in execute_sqlcom_select (thd=0x33ebbc8, all_tables=0x34701f0) at sql_parse.cc:5172
#21 0x00000000006abf88 in mysql_execute_command (thd=0x33ebbc8) at sql_parse.cc:2305
#22 0x00000000006b7753 in mysql_parse (thd=0x33ebbc8, rawbuf=0x346f900 "SELECT CONVERT_TZ( GREATEST( t, CURRENT_DATE() ), 'Europe/Moscow', 'Japan' ) FROM t1", length=84, found_semicolon=0x7f5deffdacb8) at sql_parse.cc:6173
#23 0x00000000006a9768 in dispatch_command (command=COM_QUERY, thd=0x33ebbc8, packet=0x3466499 "", packet_length=84) at sql_parse.cc:1243
#24 0x00000000006a8a54 in do_command (thd=0x33ebbc8) at sql_parse.cc:923
#25 0x00000000006a58dd in handle_one_connection (arg=0x33ebbc8) at sql_connect.cc:1231
#26 0x00007f5df97c9b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#27 0x00007f5df8b6ca7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112