Details
-
Bug
-
Status: Open (View Workflow)
-
Blocker
-
Resolution: Unresolved
-
10.6
Description
CREATE TABLE t (c TIMESTAMP); |
PREPARE s FROM 'DELETE FROM t WHERE c=?'; |
EXECUTE s USING 1; |
INSERT INTO t (c) VALUES (now()); |
EXECUTE s USING NULL; |
Leads to:
CS 10.6.21 7372ecc396517839a1546a8c1dd9192711922ef1 (Debug) |
mariadbd: /test/10.6_dbg/sql/item.cc:4657: virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t): Assertion `type_handler()->result_type() == value.type_handler()->result_type()' failed.
|
CS 10.6.21 7372ecc396517839a1546a8c1dd9192711922ef1 (Debug) |
Core was generated by `/test/MD061224-mariadb-10.6.21-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
[Current thread is 1 (Thread 0x147bb8102700 (LWP 3470158))]
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#1 0x0000147bcf727859 in __GI_abort () at abort.c:79
|
#2 0x0000147bcf727729 in __assert_fail_base (fmt=0x147bcf8bd588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x559dbce30d38 "type_handler()->result_type() == value.type_handler()->result_type()", file=0x559dbce2fbb5 "/test/10.6_dbg/sql/item.cc", line=4657, function=<optimized out>) at assert.c:92
|
#3 0x0000147bcf738fd6 in __GI___assert_fail (assertion=assertion@entry=0x559dbce30d38 "type_handler()->result_type() == value.type_handler()->result_type()", file=file@entry=0x559dbce2fbb5 "/test/10.6_dbg/sql/item.cc", line=line@entry=4657, function=function@entry=0x559dbce30d80 "virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)") at assert.c:101
|
#4 0x0000559dbc3523df in Item_param::get_date (this=0x147b8c029990, thd=0x147b8c000d48, res=0x147bb80ffac0, fuzzydate={m_mode = (date_mode_t::FUZZY_DATES | date_mode_t::FRAC_TRUNCATE | date_mode_t::INVALID_DATES)}) at /test/10.6_dbg/sql/sql_type.h:7572
|
#5 0x0000559dbbf85351 in Item::get_date_result (this=this@entry=0x147b8c029990, thd=thd@entry=0x147b8c000d48, ltime=ltime@entry=0x147bb80ffac0, fuzzydate=<optimized out>) at /test/10.6_dbg/sql/item.h:2109
|
#6 0x0000559dbc358d48 in Item::val_datetime_packed_result (this=this@entry=0x147b8c029990, thd=0x147b8c000d48) at /test/10.6_dbg/sql/sql_basic_types.h:81
|
#7 0x0000559dbc358e53 in Item_cache_temporal::cache_value (this=0x147b8c0134a0) at /test/10.6_dbg/sql/item.cc:10453
|
#8 0x0000559dbc36f20c in Item_cache::has_value (this=0x147b8c0134a0) at /test/10.6_dbg/sql/item.h:7584
|
#9 Item_cache_datetime::val_datetime_packed (this=0x147b8c0134a0) at /test/10.6_dbg/sql/item.h:7584
|
#10 0x0000559dbc383880 in Arg_comparator::compare_datetime (this=0x147b8c029bf0) at /test/10.6_dbg/sql/item_cmpfunc.cc:796
|
#11 0x0000559dbc382340 in Arg_comparator::compare (this=0x147b8c029bf0) at /test/10.6_dbg/sql/item_cmpfunc.h:117
|
#12 Item_func_eq::val_bool (this=0x147b8c029b40) at /test/10.6_dbg/sql/item_cmpfunc.cc:1851
|
#13 0x0000559dbc51a4dc in SQL_SELECT::skip_record (thd=0x147b8c000d48, this=0x147b8c013540) at /test/10.6_dbg/sql/opt_range.h:1740
|
#14 record_should_be_deleted (thd=thd@entry=0x147b8c000d48, table=table@entry=0x147b8c025d58, sel=sel@entry=0x147b8c013540, explain=explain@entry=0x147b8c013710, truncate_history=truncate_history@entry=false) at /test/10.6_dbg/sql/sql_delete.cc:229
|
#15 0x0000559dbc51d5c7 in mysql_delete (thd=thd@entry=0x147b8c000d48, table_list=0x147b8c029168, conds=<optimized out>, order_list=order_list@entry=0x147b8c027ff8, limit=18446744073709551615, options=<optimized out>, result=<optimized out>) at /test/10.6_dbg/sql/sql_delete.cc:833
|
#16 0x0000559dbc072140 in mysql_execute_command (thd=0x147b8c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /test/10.6_dbg/sql/sql_limit.h:94
|
#17 0x0000559dbc086972 in Prepared_statement::execute (this=this@entry=0x147b8c01bd98, expanded_query=expanded_query@entry=0x147bb8100cd0, open_cursor=open_cursor@entry=false) at /test/10.6_dbg/sql/sql_prepare.cc:5265
|
#18 0x0000559dbc086d0b in Prepared_statement::execute_loop (this=this@entry=0x147b8c01bd98, expanded_query=expanded_query@entry=0x147bb8100cd0, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/10.6_dbg/sql/sql_prepare.cc:4671
|
#19 0x0000559dbc08737e in mysql_sql_stmt_execute (thd=thd@entry=0x147b8c000d48) at /test/10.6_dbg/sql/sql_prepare.cc:3697
|
#20 0x0000559dbc06fcff in mysql_execute_command (thd=thd@entry=0x147b8c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.6_dbg/sql/sql_parse.cc:4020
|
#21 0x0000559dbc05cdde in mysql_parse (thd=thd@entry=0x147b8c000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147bb8101320) at /test/10.6_dbg/sql/sql_parse.cc:8199
|
#22 0x0000559dbc06b28b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147b8c000d48, packet=packet@entry=0x147b8c00ade9 "EXECUTE s USING NULL", packet_length=packet_length@entry=20, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1419
|
#23 0x0000559dbc06d997 in do_command (thd=thd@entry=0x147b8c000d48, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1422
|
#24 0x0000559dbc1beb95 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559dbfa75178, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1386
|
#25 0x0000559dbc1bf063 in handle_one_connection (arg=0x559dbfa75178) at /test/10.6_dbg/sql/sql_connect.cc:1298
|
#26 0x0000147bcfc53609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#27 0x0000147bcf824133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.6.21 (dbg)
The issue occurs after this commit
commit 3de412fbe884a85b2ec7ae56fee47152c008e6c0 (HEAD)
|
Author: Alexander Barkov <bar@mariadb.com>
|
Date: Tue Nov 19 12:44:42 2024 +0400
|
 |
MDEV-25593 Assertion `0' failed in Type_handler_temporal_result::Item_get_date on double EXECUTE
|
|
When binding to NULL, DEFAULT or IGNORE from an Item value, Item_param did not
|
change m_type_handler, so its value remained from the previous bind.
|
Thid led to DBUG_ASSERTs in Item_param::get_date() and
|
Timestamp_or_zero_datetime_native_null.
|
|
Fix:
|
|
Set Item_param::m_type_handler to &type_handler_null when
|
binding from an Item returning NULL.
|
|
This patch also fixes MDEV-35427.
|
Attachments
Issue Links
- is caused by
-
MDEV-25593 Assertion `0' failed in Type_handler_temporal_result::Item_get_date on double EXECUTE
- Closed