[MDEV-23535] SIGSEGV, SIGABRT and SIGILL in typeinfo for Item_func_set_collation (on optimized builds) Created: 2020-08-22  Updated: 2022-03-10  Resolved: 2020-09-03

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.1.48, 10.2.35, 10.3.26, 10.4.16, 10.5.7

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-23658 Wrong result of WHERE with SUB-SELECT... Confirmed

 Description   

USE test;
CREATE TABLE t1(a DATETIME);
CREATE TABLE t2(a VARCHAR(20));
SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2);

Leads to:

10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Debug)

200822 17:22:32 [ERROR] mysqld got signal 4 ;

10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Debug)

Core was generated by `/test/MD110820-mariadb-10.5.6-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14d09f455700 (LWP 1619580))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x000055690b534b86 in my_write_core (sig=sig@entry=11) at /test/10.5_dbg/mysys/stacktrace.c:519
#2  0x000055690acebd7b in handle_fatal_signal (sig=11) at /test/10.5_dbg/sql/signal_handler.cc:330
#3  <signal handler called>
#4  0x000055690c151ef0 in typeinfo for Item_func_set_collation ()
#5  0x000055690add6a69 in Item_singlerow_subselect::reset (this=0x14d07b475cd0) at /test/10.5_dbg/sql/item_subselect.cc:1167
#6  0x000055690add6b14 in Item_singlerow_subselect::bring_value (this=0x14d07b475cd0) at /test/10.5_dbg/sql/item_subselect.cc:1350
#7  0x000055690ad33e41 in Arg_comparator::compare_e_row (this=0x14d07b477840) at /test/10.5_dbg/sql/item_cmpfunc.cc:1112
#8  0x000055690ad3608f in Arg_comparator::compare (this=0x14d07b477840) at /test/10.5_dbg/sql/item_cmpfunc.h:102
#9  Item_func_equal::val_int (this=0x14d07b477770) at /test/10.5_dbg/sql/item_cmpfunc.cc:1791
#10 0x000055690ac27925 in Type_handler::Item_send_long (this=<optimized out>, item=0x14d07b477770, protocol=0x14d07b415650, buf=<optimized out>) at /test/10.5_dbg/sql/sql_type.cc:7330
#11 0x000055690ac2f10f in Type_handler_long::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.5_dbg/sql/sql_type.h:5494
#12 0x000055690a94f5c5 in Item::send (this=0x14d07b477770, protocol=0x14d07b415650, buffer=0x14d09f453070) at /test/10.5_dbg/sql/item.h:1060
#13 0x000055690a94c65f in Protocol::send_result_set_row (this=this@entry=0x14d07b415650, row_items=row_items@entry=0x14d07b4742e0) at /test/10.5_dbg/sql/protocol.cc:1092
#14 0x000055690a9df59a in select_send::send_data (this=0x14d07b478378, items=@0x14d07b4742e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d07b4779b0, last = 0x14d07b4779b0, elements = 1}, <No data fields>}) at /test/10.5_dbg/sql/sql_class.cc:3018
#15 0x000055690aabd36d in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.5_dbg/sql/sql_class.h:5303
#16 JOIN::exec_inner (this=this@entry=0x14d07b4783a0) at /test/10.5_dbg/sql/sql_select.cc:4318
#17 0x000055690aabe14d in JOIN::exec (this=this@entry=0x14d07b4783a0) at /test/10.5_dbg/sql/sql_select.cc:4231
#18 0x000055690aabc449 in mysql_select (thd=thd@entry=0x14d07b415088, tables=<optimized out>, fields=@0x14d07b4742e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d07b4779b0, last = 0x14d07b4779b0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=<optimized out>, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14d07b478378, unit=0x14d07b4190a0, select_lex=0x14d07b474190) at /test/10.5_dbg/sql/sql_select.cc:4655
#19 0x000055690aabc778 in handle_select (thd=thd@entry=0x14d07b415088, lex=lex@entry=0x14d07b418fd8, result=result@entry=0x14d07b478378, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
#20 0x000055690aa44d72 in execute_sqlcom_select (thd=thd@entry=0x14d07b415088, all_tables=0x14d07b474dd8) at /test/10.5_dbg/sql/sql_parse.cc:6210
#21 0x000055690aa3de46 in mysql_execute_command (thd=thd@entry=0x14d07b415088) at /test/10.5_dbg/sql/sql_parse.cc:3932
#22 0x000055690aa4ad4e in mysql_parse (thd=thd@entry=0x14d07b415088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d09f454350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7994
#23 0x000055690aa3777e in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d07b415088, packet=packet@entry=0x14d07b467089 "", packet_length=packet_length@entry=68, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1867
#24 0x000055690aa35f58 in do_command (thd=0x14d07b415088) at /test/10.5_dbg/sql/sql_parse.cc:1348
#25 0x000055690ab92bc9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14d07e4d0808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
#26 0x000055690ab932e5 in handle_one_connection (arg=arg@entry=0x14d07e4d0808) at /test/10.5_dbg/sql/sql_connect.cc:1312
#27 0x000055690aff9572 in pfs_spawn_thread (arg=0x14d09c046508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#28 0x000014d09e3ce6db in start_thread (arg=0x14d09f455700) at pthread_create.c:463
#29 0x000014d09d7cca3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

10.5.6 1c587481966abc7a9ad5309d0a91ca920f7a5657 (Optimized)

Core was generated by `/test/MD110820-mariadb-10.5.6-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14631d1ea700 (LWP 1623877))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x0000558683796267 in my_write_core (sig=sig@entry=11) at /test/10.5_opt/mysys/stacktrace.c:519
#2  0x000055868316514a in handle_fatal_signal (sig=11) at /test/10.5_opt/sql/signal_handler.cc:330
#3  <signal handler called>
#4  0x00005586841d0c68 in typeinfo for Item_func_set_collation ()
#5  0x0000558683214243 in Item_singlerow_subselect::reset (this=0x1462f9448c60) at /test/10.5_opt/sql/item_subselect.cc:1167
#6  Item_singlerow_subselect::bring_value (this=0x1462f9448c60) at /test/10.5_opt/sql/item_subselect.cc:1350
#7  0x0000558683196c9f in Arg_comparator::compare_e_row (this=0x1462f944a7d0) at /test/10.5_opt/sql/item_cmpfunc.cc:1112
#8  0x0000558683196e7b in Arg_comparator::compare (this=<optimized out>) at /test/10.5_opt/sql/item_cmpfunc.h:102
#9  Item_func_equal::val_int (this=<optimized out>) at /test/10.5_opt/sql/item_cmpfunc.cc:1791
#10 0x00005586830cb869 in Type_handler::Item_send_long (this=<optimized out>, item=0x1462f944a700, protocol=0x1462f9412558, buf=<optimized out>) at /test/10.5_opt/sql/sql_type.cc:7330
#11 0x0000558682eb5d28 in Protocol::send_result_set_row (this=this@entry=0x1462f9412558, row_items=row_items@entry=0x1462f9447270) at /test/10.5_opt/sql/protocol.cc:1092
#12 0x0000558682f236f2 in select_send::send_data (this=0x1462f944b308, items=@0x1462f9447270: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1462f944a940, last = 0x1462f944a940, elements = 1}, <No data fields>}) at /test/10.5_opt/sql/sql_class.cc:3018
#13 0x0000558682fcc6e2 in select_result_sink::send_data_with_check (sent=0, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.5_opt/sql/sql_class.h:5300
#14 JOIN::exec_inner (this=this@entry=0x1462f944b330) at /test/10.5_opt/sql/sql_select.cc:4318
#15 0x0000558682fcc877 in JOIN::exec (this=this@entry=0x1462f944b330) at /test/10.5_opt/sql/sql_select.cc:4231
#16 0x0000558682fcaba2 in mysql_select (thd=thd@entry=0x1462f9412018, tables=0x0, fields=@0x1462f9447270: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1462f944a940, last = 0x1462f944a940, elements = 1}, <No data fields>}, conds=0x0, og_num=<optimized out>, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1462f944b308, unit=0x1462f9415e70, select_lex=0x1462f9447120) at /test/10.5_opt/sql/sql_select.cc:4655
#17 0x0000558682fcb561 in handle_select (thd=thd@entry=0x1462f9412018, lex=lex@entry=0x1462f9415da8, result=result@entry=0x1462f944b308, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_opt/sql/sql_select.cc:417
#18 0x0000558682f71b81 in execute_sqlcom_select (thd=thd@entry=0x1462f9412018, all_tables=0x1462f9447d68) at /test/10.5_opt/sql/sql_parse.cc:6210
#19 0x0000558682f6e251 in mysql_execute_command (thd=thd@entry=0x1462f9412018) at /test/10.5_opt/sql/sql_parse.cc:3932
#20 0x0000558682f74cbc in mysql_parse (thd=0x1462f9412018, rawbuf=<optimized out>, length=68, parser_state=0x14631d1e9430, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /test/10.5_opt/sql/sql_parse.cc:7994
#21 0x0000558682f69f85 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1462f9412018, packet=packet@entry=0x1462f943a019 "", packet_length=packet_length@entry=68, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_opt/sql/sql_parse.cc:1867
#22 0x0000558682f682b4 in do_command (thd=0x1462f9412018) at /test/10.5_opt/sql/sql_parse.cc:1348
#23 0x000055868305e001 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14631a0338f8, put_in_cache=put_in_cache@entry=true) at /test/10.5_opt/sql/sql_connect.cc:1410
#24 0x000055868305e364 in handle_one_connection (arg=arg@entry=0x14631a0338f8) at /test/10.5_opt/sql/sql_connect.cc:1312
#25 0x00005586833cf5da in pfs_spawn_thread (arg=0x14631a04f218) at /test/10.5_opt/storage/perfschema/pfs.cc:2201
#26 0x000014631c1636db in start_thread (arg=0x14631d1ea700) at pthread_create.c:463
#27 0x000014631b561a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.3.25 (dbg), 10.3.25 (opt), 10.4.15 (dbg), 10.4.15 (opt), 10.5.6 (dbg), 10.5.6 (opt)

Bug confirmed not present in:
MariaDB: 10.1.47 (dbg), 10.1.47 (opt), 10.2.34 (dbg), 10.2.34 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

10.2.34 (Optimized)

10.2.34>USE test;
Database changed
10.2.34>CREATE TABLE t1(a DATETIME);
Query OK, 0 rows affected (0.03 sec)
10.2.34>CREATE TABLE t2(a VARCHAR(20));
Query OK, 0 rows affected (0.01 sec)
10.2.34>SELECT (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2);
+---------------------------------------------------------------+
| (SELECT CONCAT(a),1 FROM t1) <=> (SELECT CONCAT(a),1 FROM t2) |
+---------------------------------------------------------------+
|                                                             1 |
+---------------------------------------------------------------+
1 row in set (0.00 sec)



 Comments   
Comment by Roel Van de Paar [ 2020-08-22 ]

Similar, but different stack trace with this additional longer testcase

USE test;
CREATE TEMPORARY TABLE t(a VARCHAR(20) NOT NULL, b VARCHAR(20));
ALTER TABLE t MODIFY a DATETIME;
INSERT INTO t VALUES (1, ST_GEOMFROMTEXT('abcdefghijklmnopqrstuvwxyz'));
CREATE TEMPORARY TABLE t2 (a VARCHAR(20), b VARCHAR(20), c VARCHAR(20)) ENGINE=MEMORY;
INSERT INTO t VALUES (45199,1184);
SET NAMES cp850;
SELECT (SELECT CONCAT(a),1 FROM t) <=> (SELECT CONCAT(a),1 FROM t2);

Comment by Roel Van de Paar [ 2020-08-22 ]

Issue seems to cause mysqld hangs at times also, with CLI client immediately hanging on reconnect to mysqld.

Comment by Roel Van de Paar [ 2020-08-25 ]

Different stack on 10.3.25:

10.3.25 bafc5c1321a7dff5f2da292111bf98fed9d1658d (Debug)

Core was generated by `/test/MD110820-mariadb-10.3.25-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14dc48c27700 (LWP 1624761))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x00005581f3e5efb1 in my_write_core (sig=sig@entry=6) at /test/10.3_dbg/mysys/stacktrace.c:482
#2  0x00005581f367888e in handle_fatal_signal (sig=6) at /test/10.3_dbg/sql/signal_handler.cc:343
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x000014dc46ec48b1 in __GI_abort () at abort.c:79
#6  0x000014dc4769f957 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x000014dc476a5ae6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x000014dc476a5b21 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x000014dc476a68ff in __cxa_pure_virtual () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00005581f36bd427 in Arg_comparator::compare_e_string (this=0x14dc20c65a90) at /test/10.3_dbg/sql/item_cmpfunc.cc:800
#11 0x00005581f36ba2ef in Arg_comparator::compare (this=<optimized out>) at /test/10.3_dbg/sql/item_cmpfunc.h:102
#12 Arg_comparator::compare_e_row (this=0x14dc20c64058) at /test/10.3_dbg/sql/item_cmpfunc.cc:1094
#13 0x00005581f36bc114 in Arg_comparator::compare (this=0x14dc20c64058) at /test/10.3_dbg/sql/item_cmpfunc.h:102
#14 Item_func_equal::val_int (this=0x14dc20c63f98) at /test/10.3_dbg/sql/item_cmpfunc.cc:1762
#15 0x00005581f35a1953 in Type_handler::Item_send_long (this=<optimized out>, item=0x14dc20c63f98, protocol=0x14dc20c15628, buf=<optimized out>) at /test/10.3_dbg/sql/sql_type.cc:5420
#16 0x00005581f35a5255 in Type_handler_long::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.3_dbg/sql/sql_type.h:2434
#17 0x00005581f331b405 in Item::send (this=0x14dc20c63f98, protocol=0x14dc20c15628, buffer=0x14dc48c23970) at /test/10.3_dbg/sql/item.h:880
#18 0x00005581f3318e35 in Protocol::send_result_set_row (this=this@entry=0x14dc20c15628, row_items=row_items@entry=0x14dc20c197e8) at /test/10.3_dbg/sql/protocol.cc:997
#19 0x00005581f33a4812 in select_send::send_data (this=0x14dc20c64218, items=@0x14dc20c197e8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14dc20c640f8, last = 0x14dc20c640f8, elements = 1}, <No data fields>}) at /test/10.3_dbg/sql/sql_class.cc:2942
#20 0x00005581f346ddaf in JOIN::exec_inner (this=this@entry=0x14dc20c64240) at /test/10.3_dbg/sql/sql_select.cc:3991
#21 0x00005581f346ea37 in JOIN::exec (this=this@entry=0x14dc20c64240) at /test/10.3_dbg/sql/sql_select.cc:3910
#22 0x00005581f346d178 in mysql_select (thd=thd@entry=0x14dc20c15070, tables=0x0, wild_num=0, fields=@0x14dc20c197e8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14dc20c640f8, last = 0x14dc20c640f8, elements = 1}, <No data fields>}, conds=0x0, og_num=<optimized out>, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14dc20c64218, unit=0x14dc20c18f38, select_lex=0x14dc20c196c0) at /test/10.3_dbg/sql/sql_select.cc:4315
#23 0x00005581f346d424 in handle_select (thd=thd@entry=0x14dc20c15070, lex=lex@entry=0x14dc20c18e78, result=result@entry=0x14dc20c64218, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.3_dbg/sql/sql_select.cc:370
#24 0x00005581f33ebc92 in execute_sqlcom_select (thd=thd@entry=0x14dc20c15070, all_tables=0x14dc20c62058) at /test/10.3_dbg/sql/sql_parse.cc:6286
#25 0x00005581f33f682b in mysql_execute_command (thd=thd@entry=0x14dc20c15070) at /test/10.3_dbg/sql/sql_parse.cc:3812
#26 0x00005581f34009d7 in mysql_parse (thd=thd@entry=0x14dc20c15070, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14dc48c26410, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_parse.cc:7810
#27 0x00005581f34032d2 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14dc20c15070, packet=packet@entry=0x14dc20c55071 "", packet_length=packet_length@entry=68, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.3_dbg/sql/sql_parse.cc:1847
#28 0x00005581f34064bc in do_command (thd=0x14dc20c15070) at /test/10.3_dbg/sql/sql_parse.cc:1393
#29 0x00005581f3524dc2 in do_handle_one_connection (connect=connect@entry=0x14dc458676b0) at /test/10.3_dbg/sql/sql_connect.cc:1403
#30 0x00005581f3524ffb in handle_one_connection (arg=0x14dc458676b0) at /test/10.3_dbg/sql/sql_connect.cc:1308
#31 0x000014dc479a36db in start_thread (arg=0x14dc48c27700) at pthread_create.c:463
#32 0x000014dc46fa5a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment by Roel Van de Paar [ 2020-08-25 ]

Unique bug ID's so far

SIGILL|typeinfo for Item_func_set_collation|Item_singlerow_subselect::reset|Item_singlerow_subselect::bring_value|Arg_comparator::compare_e_row 
SIGSEGV|typeinfo for Item_func_set_collation|Item_singlerow_subselect::reset|Item_singlerow_subselect::bring_value|Arg_comparator::compare_e_row
SIGABRT|__cxa_pure_virtual|Arg_comparator::compare_e_string|Arg_comparator::compare|Arg_comparator::compare_e_row

Comment by Varun Gupta (Inactive) [ 2020-08-28 ]

Reproducible with this script on 10.1 and 10.2 too

--source include/have_innodb.inc
select @@character_set_connection;
set character_set_connection='utf8';
select @@character_set_connection;
 
CREATE TABLE t1(a DATETIME, b VARCHAR(50))ENGINE=INNODB;
INSERT INTO t1 VALUES ('2019-03-10 02:55:05', '2019-03-10 02:55:05');
CREATE TABLE t2(a VARCHAR(50))ENGINE=INNODB;
INSERT INTO t2 VALUES ('2019-03-10 02:55:05');
 
SELECT * FROM t1 WHERE (SELECT 1,CONCAT(a) FROM t1) = (SELECT 1,CONCAT(a) FROM t2);

Comment by Varun Gupta (Inactive) [ 2020-09-01 ]

So putting a breakpoint in the function Item_singlerow_subselect::store
I see:

(lldb) p row[i]
(Item_func_conv_charset *) $1 = 0x0000629000132100
(lldb) p dbug_print_item(row[i])
(const char *) $2 = 0x00000001050aae00 "convert(NULL using latin1)"

and the row is defined as

class Item_singlerow_subselect :public Item_subselect
{
protected:
  Item_cache *value, **row;

So it expect an Item_cache item but instead got an Item_func_conv_charset item.

Comment by Alexander Barkov [ 2020-09-03 ]

Also repeatable with this script (Notice MyISAM instead of InnoDB):

SET NAMES utf8;
CREATE OR REPLACE TABLE t1(a DATETIME) ENGINE=MYISAM;
INSERT INTO t1 VALUES ('2019-03-10 02:55:05');
CREATE OR REPLACE TABLE t2(a VARCHAR(50) CHARACTER SET latin1) ENGINE=MYISAM;
INSERT INTO t2 VALUES ('2019-03-10 02:55:05');
SELECT * FROM t1 WHERE (SELECT 1,CONCAT(a) FROM t1) = (SELECT 1,CONCAT(a) FROM t2);

- MariaDB (DEBUG) versions 10.1, 10.2, 10.3 crash
- MariaDB (DEBUG) versions 10.4 and 10.5 erroneously return empty set (instead of one record)

Comment by Alexander Barkov [ 2020-09-03 ]

Hi Varun, can you please review a patch:

https://github.com/MariaDB/server/commit/1e17055936871e00fde3c5b3e4b137cf2f89beba

Comment by Varun Gupta (Inactive) [ 2020-09-03 ]

Ok to push

Generated at Thu Feb 08 09:23:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.