Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
12.0(EOL)
-
None
Description
This searched CASE statement:
SELECT CASE WHEN TRUE THEN ROW(1,2) ELSE ROW(2,1) END; |
crashes with the following stack trace:
#4 0x00007ffff7254c57 in __assert_fail () from /lib64/libc.so.6
|
#5 0x00005555563f114f in Type_handler_hybrid_field_type::aggregate_for_result
|
(this=0x7fff84019b90, funcname=..., items=0x7fff84019bf8, nitems=2,
|
treat_bit_as_number=true) at /home/bar/maria-git/12.0/sql/sql_type.cc:1899
|
#6 0x000055555658f61e in Item_func_case::aggregate_then_and_else_arguments (
|
this=0x7fff84019ae0, thd=0x7fff84000dc8, start=1)
|
at /home/bar/maria-git/12.0/sql/item_cmpfunc.cc:3381
|
#7 0x000055555658f4cc in Item_func_case_searched::fix_length_and_dec (
|
this=0x7fff84019ae0, thd=0x7fff84000dc8)
|
on DEBUG_ASSERT in aggregate_for_result:
│ 1891 bool Type_handler_hybrid_field_type:: │
|
│ 1892 aggregate_for_result(const LEX_CSTRING &funcname, Item **items, uint│
|
│ 1893 bool treat_bit_as_number) │
|
│ 1894 { │
|
│ 1895 bool bit_and_non_bit_mixture_found= false; │
|
│ 1896 uint32 max_display_length; │
|
│ 1897 if (!nitems || items[0]->result_type() == ROW_RESULT) │
|
│ 1898 { │
|
│ > 1899 DBUG_ASSERT(0); │
|
│ 1900 set_handler(&type_handler_null); │
|
│ 1901 return true; │
|
│ 1902 }
|
The problem was introduced by the patch for MDEV-20034.
A similar simple CASE statement does not crash:
SELECT CASE TRUE WHEN TRUE THEN ROW(1,2) ELSE ROW(2,1) END; |
ERROR 1241 (21000): Operand should contain 1 column(s)
|
Attachments
Issue Links
- blocks
-
MDEV-34319 Associative arrays: DECLARE TYPE .. TABLE OF .. INDEX BY in stored routines
-
- Closed
-
- causes
-
MDEV-36763 Assertion `is_json_type_handler(th)' failed in static const Type_handler *Type_handler_json_common::json_type_handler_from_generic(const Type_handler *)
-
- Open
-
-
MDEV-37534 Assertion `a == &type_handler_row || a == &type_handler_null' failed on CREATE TABLE ... ROW()
-
- Open
-
-
MDEV-37625 Server crashes at alloc_root
-
- Confirmed
-
- is caused by
-
MDEV-20034 Add support for the pre-defined weak SYS_REFCURSOR
-
- Closed
-
- relates to
-
MDEV-12252 ROW data type for stored function return values
-
- Closed
-
-
MDEV-12307 ROW data type for built-in function return values
-
- Stalled
-