Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
N/A
-
None
-
Not for Release Notes
Description
SELECT TO_DATE('100', 'RRRR') AS x; |
|
bb-12.3-MDEV-19683-to_date 7cbf7a8c641379d4318067607b71704956e87e5e |
mariadbd: /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item_timefunc.cc:559: uint oracle_year_2000_handling(uint): Assertion `year < 100' failed.
|
260120 15:56:58 [ERROR] /share8t/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/mariadbd got signal 6 ;
|
|
|
#9 0x00007f8bbe453eb2 in __GI___assert_fail (assertion=0x556af2479b70 "year < 100", file=0x556af2479998 "/data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item_timefunc.cc", line=559, function=0x556af2479b80 "uint oracle_year_2000_handling(uint)") at ./assert/assert.c:101
|
#10 0x0000556af17b14be in oracle_year_2000_handling (year=100) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item_timefunc.cc:559
|
#11 0x0000556af17b2022 in extract_oracle_date_time (thd=0x7f8b9c000dc8, format=0x7f8b9c018b92, val=0x7f8b9c047448 "100", '\245' <repeats 13 times>, "h4z\025", '\217' <repeats 12 times>, "q", length=3, val_cs=0x556af312f860 <my_charset_utf8mb4_general_ci>, l_time=0x7f8bb8075bf8, locale=0x556af3167160 <my_locale_en_US>, date_time_type=0x556af247b1a7 "datetime", fuzzydate=..., give_error=true) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item_timefunc.cc:798
|
#12 0x0000556af17c0d3c in Item_func_to_date::get_date_common (this=0x7f8b9c018a08, thd=0x7f8b9c000dc8, ltime=0x7f8bb8075bf8, fuzzydate=..., tstype=MYSQL_TIMESTAMP_DATETIME) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item_timefunc.cc:4983
|
#13 0x0000556af17c89ed in Func_handler_str_to_date_datetime_sec::get_date (this=0x556af2f31f38 <func_handler_str_to_date_datetime_sec>, thd=0x7f8b9c000dc8, item=0x7f8b9c018a08, to=0x7f8bb8075bf8, fuzzy=...) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item_timefunc.h:2165
|
#14 0x0000556af151fe1f in Item_handled_func::get_date (this=0x7f8b9c018a08, thd=0x7f8b9c000dc8, to=0x7f8bb8075bf8, fuzzydate=...) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item_func.h:917
|
#15 0x0000556af150f28b in Type_handler::Item_send_datetime (this=0x556af318eaa0 <type_handler_datetime2>, item=0x7f8b9c018a08, protocol=0x7f8b9c0014a8, buf=0x7f8bb8075bf0) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_type.cc:7657
|
#16 0x0000556af13d5d08 in Type_handler_datetime_common::Item_send (this=0x556af318eaa0 <type_handler_datetime2>, item=0x7f8b9c018a08, protocol=0x7f8b9c0014a8, buf=0x7f8bb8075bf0) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_type.h:6711
|
#17 0x0000556af1037158 in Item::send (this=0x7f8b9c018a08, protocol=0x7f8b9c0014a8, buffer=0x7f8bb8075bf0) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/item.h:1231
|
#18 0x0000556af108f037 in Protocol::send_result_set_row (this=0x7f8b9c0014a8, row_items=0x7f8b9c0186b8) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/protocol.cc:1359
|
#19 0x0000556af1154721 in select_send::send_data (this=0x7f8b9c0195f0, items=...) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_class.cc:3348
|
#20 0x0000556af11543b6 in select_result_sink::send_data_with_check (this=0x7f8b9c0195f0, items=..., u=0x7f8b9c0053e8, sent=0) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_class.cc:3246
|
#21 0x0000556af1266706 in JOIN::exec_inner (this=0x7f8b9c019618) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_select.cc:5005
|
#22 0x0000556af1265fd6 in JOIN::exec (this=0x7f8b9c019618) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_select.cc:4922
|
#23 0x0000556af1267995 in mysql_select (thd=0x7f8b9c000dc8, tables=0x0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x7f8b9c0195f0, unit=0x7f8b9c0053e8, select_lex=0x7f8b9c018400) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_select.cc:5450
|
#24 0x0000556af1255448 in handle_select (thd=0x7f8b9c000dc8, lex=0x7f8b9c005308, result=0x7f8b9c0195f0, setup_tables_done_option=0) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_select.cc:636
|
#25 0x0000556af11f6c05 in execute_sqlcom_select (thd=0x7f8b9c000dc8, all_tables=0x0) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_parse.cc:6172
|
#26 0x0000556af11ee6d9 in mysql_execute_command (thd=0x7f8b9c000dc8, is_called_from_prepared_stmt=false) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_parse.cc:3951
|
#27 0x0000556af11fbccf in mysql_parse (thd=0x7f8b9c000dc8, rawbuf=0x7f8b9c018358 "SELECT TO_DATE('100', 'RRRR') AS x", length=34, parser_state=0x7f8bb80772c0) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_parse.cc:7895
|
#28 0x0000556af11e7d7f in dispatch_command (command=COM_QUERY, thd=0x7f8b9c000dc8, packet=0x7f8b9c00c129 "", packet_length=34, blocking=true) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_parse.cc:1878
|
#29 0x0000556af11e66d8 in do_command (thd=0x7f8b9c000dc8, blocking=true) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_parse.cc:1417
|
#30 0x0000556af13f9c33 in do_handle_one_connection (connect=0x556af8a9ae38, put_in_cache=true) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_connect.cc:1503
|
#31 0x0000556af13f99b4 in handle_one_connection (arg=0x556af8aa05c8) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/sql/sql_connect.cc:1415
|
#32 0x0000556af19dcc50 in pfs_spawn_thread (arg=0x556af8adf388) at /data/bld/preview-12.3/bb-12.3-MDEV-19683-to_date-debug/storage/perfschema/pfs.cc:2198
|
#33 0x00007f8bbe4a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
|
#34 0x00007f8bbe52885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
|
Note that it's not error handling gone wrong. The query is actually valid on Oracle, and it works on a non-debug MariaDB too, but the result is different from one on Oracle:
|
Oracle |
SELECT TO_DATE('100', 'RRRR') AS x; |
X
|
01-JAN-00
|
|
|
SELECT TO_CHAR(TO_DATE('100', 'RRRR'), 'YYYY-MM-DD') AS xx; |
XX
|
0100-01-01
|
|
bb-12.3-MDEV-19683-to_date non-debug |
SELECT TO_DATE('100', 'RRRR') AS x; |
x
|
2000-01-20 00:00:00
|
SELECT TO_CHAR(TO_DATE('100', 'RRRR'), 'YYYY-MM-DD') AS xx; |
xx
|
2000-01-20
|
Attachments
Issue Links
- is caused by
-
MDEV-19683 Add support for Oracle TO_DATE()
-
- In Testing
-