Details
-
Bug
-
Status: In Review (View Workflow)
-
Blocker
-
Resolution: Unresolved
-
12.3
-
Q2/2026 Server Development
Description
CREATE TABLE t1 (i INT, f INT AS (i) VIRTUAL, KEY(f)); |
INSERT INTO t1 (i) VALUES (1),(2); |
|
|
SELECT i FROM (SELECT * FROM t1) AS sq GROUP BY i HAVING i > 0; |
|
|
DROP TABLE t1; |
|
12.3 ee50a1afbcd2444de477f7a2c4f83351ac55637e |
#4 <signal handler called>
|
#5 0x0000563c7c788e5a in Item_field::used_tables (this=0x62d0000ff468) at /data/bld/12.3-asan-ubsan/sql/item.cc:3723
|
#6 0x0000563c7b0096fe in update_depend_map_for_order (join=join@entry=0x62d0000fd968, order=0x62d0000fcb28) at /data/bld/12.3-asan-ubsan/sql/sql_select.cc:17584
|
#7 0x0000563c7b07ce12 in remove_const (join=join@entry=0x62d0000fd968, first_order=<optimized out>, cond=<optimized out>, change_list=change_list@entry=true, simple_order=simple_order@entry=0x62d0000fdcb4) at /data/bld/12.3-asan-ubsan/sql/sql_select.cc:17709
|
#8 0x0000563c7b1cd1b1 in JOIN::optimize_inner (this=this@entry=0x62d0000fd968) at /data/bld/12.3-asan-ubsan/sql/sql_select.cc:2742
|
#9 0x0000563c7b1ce693 in JOIN::optimize (this=this@entry=0x62d0000fd968) at /data/bld/12.3-asan-ubsan/sql/sql_select.cc:2016
|
#10 0x0000563c7b1cfadb in mysql_select (thd=thd@entry=0x62c0000b0218, tables=<optimized out>, fields=..., conds=conds@entry=0x0, og_num=og_num@entry=1, order=order@entry=0x0, group=<optimized out>, having=<optimized out>, proc_param=<optimized out>, select_options=<optimized out>, result=<optimized out>, unit=<optimized out>, select_lex=<optimized out>) at /data/bld/12.3-asan-ubsan/sql/sql_select.cc:5425
|
#11 0x0000563c7b1d0efe in handle_select (thd=thd@entry=0x62c0000b0218, lex=lex@entry=0x62c0000b4860, result=result@entry=0x62d0000fd938, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/bld/12.3-asan-ubsan/sql/sql_select.cc:636
|
#12 0x0000563c7adfff44 in execute_sqlcom_select (thd=thd@entry=0x62c0000b0218, all_tables=<optimized out>) at /data/bld/12.3-asan-ubsan/sql/sql_parse.cc:6216
|
#13 0x0000563c7ae409b9 in mysql_execute_command (thd=thd@entry=0x62c0000b0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/bld/12.3-asan-ubsan/sql/sql_parse.cc:3989
|
#14 0x0000563c7ae5efa6 in mysql_parse (thd=thd@entry=0x62c0000b0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f45d362aa00) at /data/bld/12.3-asan-ubsan/sql/sql_parse.cc:7944
|
#15 0x0000563c7ae68060 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x62c0000b0218, packet=packet@entry=0x6290002a3219 "SELECT i FROM (SELECT * FROM t1) AS sq GROUP BY i HAVING i > 0", packet_length=packet_length@entry=62, blocking=blocking@entry=true) at /data/bld/12.3-asan-ubsan/sql/sql_parse.cc:1898
|
#16 0x0000563c7ae74b7d in do_command (thd=thd@entry=0x62c0000b0218, blocking=blocking@entry=true) at /data/bld/12.3-asan-ubsan/sql/sql_parse.cc:1432
|
#17 0x0000563c7b82d5f8 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6080000082b8, put_in_cache=put_in_cache@entry=true) at /data/bld/12.3-asan-ubsan/sql/sql_connect.cc:1503
|
#18 0x0000563c7b82e761 in handle_one_connection (arg=0x6080000082b8) at /data/bld/12.3-asan-ubsan/sql/sql_connect.cc:1415
|
#19 0x0000563c7d770db7 in pfs_spawn_thread (arg=0x617000007b18) at /data/bld/12.3-asan-ubsan/storage/perfschema/pfs.cc:2198
|
#20 0x00007f45e0ea81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
|
#21 0x00007f45e0f2885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
|
INSERT is optional, the failure happens on an empty table as well. Fails with at least InnoDB and MyISAM, on release and debug builds alike.
UBSAN additionally throws an error
/data/bld/12.3-asan-ubsan/sql/item.cc:3723:14: runtime error: member access within null pointer of type 'struct Field'
|
The failure started happening after this commit in 12.1:
commit 8cdee25952763a0401e4c2a4d61e92c13499bdc6 (origin/bb-12.1-mdev-36132)
|
Author: Yuchen Pei
|
Date: Wed Jun 4 11:43:30 2025 +1000
|
|
|
MDEV-36132 Substitute vcol expressions with indexed vcol fields in ORDER BY and GROUP BY
|
Attachments
Issue Links
- is caused by
-
MDEV-36132 Optimizer support for functional indexes: handle GROUP/ORDER BY
-
- Closed
-
- relates to
-
MDEV-37435 Assertion `field' failed in virtual bool Item_field::fix_fields(THD *, Item **)
-
- Closed
-