Details
Description
Given s390x and AIX only assuming this is a bigendian fault.
|
Server version: 10.11.9-MariaDB-log source revision: 284489576611aebc565c052d344d06eb3f40e31a
|
key_buffer_size=1048576
|
read_buffer_size=131072
|
max_used_connections=1
|
max_threads=153
|
thread_count=8
|
It is possible that mysqld could use up to
|
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 63839 K bytes of memory
|
Hope that's ok; if not, decrease some variables in the equation.
|
|
Thread pointer: 0x3ff80000c58
|
Attempting backtrace. You can use the following information to find out
|
where mysqld died. If you see no messages after this, something went
|
terribly wrong...
|
stack_bottom = 0x3ffa5e7ebd8 thread_stack 0x49000
|
mysys/stacktrace.c:215(my_print_stacktrace)[0x2aa09ee40d6]
|
sql/signal_handler.cc:239(handle_fatal_signal)[0x2aa099dd306]
|
[0x3ffa5e7c9d6]
|
sql/sql_analyze_stmt.h:172(JOIN::exec())[0x2aa097f0082]
|
sql/sql_select.cc:5203(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x2aa097ee3f6]
|
sql/sql_select.cc:29496(mysql_explain_union(THD*, st_select_lex_unit*, select_result*))[0x2aa097eee9a]
|
sql/sql_select.cc:29450(select_describe(JOIN*, bool, bool, bool, char const*) [clone .isra.534])[0x2aa097eefa0]
|
sql/sql_select.cc:4905(JOIN::exec_inner())[0x2aa097ef9c2]
|
sql/sql_select.cc:4722(JOIN::exec())[0x2aa097f00a2]
|
sql/sql_select.cc:5203(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x2aa097ee3f6]
|
sql/sql_select.cc:29496(mysql_explain_union(THD*, st_select_lex_unit*, select_result*))[0x2aa097eee9a]
|
sql/sql_parse.cc:6324(execute_sqlcom_select(THD*, TABLE_LIST*))[0x2aa0976d1c4]
|
sql/sql_parse.cc:6126(mysql_execute_command(THD*, bool))[0x2aa09777fa8]
|
sql/sql_parse.cc:8146(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x2aa09767830]
|
sql/sql_parse.cc:1866(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x2aa09773ff4]
|
sql/sql_parse.cc:1408(do_command(THD*, bool))[0x2aa09775ffc]
|
sql/sql_connect.cc:1417(do_handle_one_connection(CONNECT*, bool))[0x2aa098a22d4]
|
sql/sql_connect.cc:1323(handle_one_connection)[0x2aa098a269a]
|
perfschema/pfs.cc:2204(pfs_spawn_thread)[0x2aa09bfa2a6]
|
/lib64/libpthread.so.0(+0x80de)[0x3ffa66080de]
|
/lib64/libc.so.6(+0x28b42)[0x3ffa6028b42]
|
[0x0]
|
|
Trying to get some variables.
|
Some pointers may be invalid and cause the dump to abort.
|
Query (0x3ff80010ba0): EXPLAIN FORMAT=JSON SELECT * FROM t1
|
GROUP BY b
|
HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3
|
Attachments
Issue Links
- is part of
-
MDEV-33073 always green buildbot
-
- Stalled
-
- relates to
-
MDEV-29363 Constant subquery causing a crash in pushdown optimization
-
- Closed
-
-
MDEV-32608 Expression with constant subquery causes a crash in pushdown from HAVING
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link | This issue is part of MDEV-33073 [ MDEV-33073 ] |
Labels | crash | crash not-10.5 |
The crash matches MDEV-32608. The test case of MDEV-32608 is the causing the crash. Notably however that MDEV-32608 was fixed in 10.5 and the crash doesn't occur on the 10.5 branch. It was only once the fix for MDEV-32608 got merged to 10.6 (f071b7620b2e7b874de8f9d37b0ba7af468574ef) that this error showed itself.
Link |
This issue relates to |
I saw this on the sparc64, ppc64 and powerpc builders on Debian after uploading MariaDB 11.4.3:
main.having_cond_pushdown w1 [ fail ]
|
Test ended at 2024-08-19 09:30:17
|
|
CURRENT_TEST: main.having_cond_pushdown
|
mysqltest: At line 1727: query 'EXPLAIN FORMAT=JSON $q' failed: <Unknown> (2013): Lost connection to server during query
|
|
The result from queries just before the failure was:
|
< snip >
|
Warning 1292 Truncated incorrect DECIMAL value: 'b'
|
DROP VIEW v1;
|
#
|
# MDEV-32304: Pushdown: server crashes at Item_field::used_tables()
|
# (fixed by the patch for MDEV-29363)
|
#
|
CREATE VIEW v1 AS SELECT 1 AS a;
|
SELECT * FROM v1
|
GROUP BY a HAVING a = (a IS NULL OR a IS NULL);
|
a
|
DROP VIEW v1;
|
#
|
# MDEV-32608: Expression with constant subquery causes a crash
|
# in pushdown from HAVING
|
#
|
CREATE TABLE t1 (a INT, b INT);
|
INSERT INTO t1 VALUES (2, 1), (3, 2);
|
EXPLAIN FORMAT=JSON SELECT * FROM t1
|
GROUP BY b
|
HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3;
|
|
More results from queries before failure can be found in /<<PKGBUILDDIR>>/builddir/mysql-test/var/1/log/having_cond_pushdown.log
|
|
|
Server [mysqld.1 - pid: 708154, winpid: 708154, exit: 256] failed during test run
|
Server log from this test:
|
----------SERVER LOG START-----------
|
240819 9:30:00 [ERROR] mysqld got signal 11 ;
|
Sorry, we probably made a mistake, and this is a bug.
|
|
Your assistance in bug reporting will enable us to fix this for the next release.
|
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
|
|
We will try our best to scrape up some info that will hopefully help
|
diagnose the problem, but since we have already crashed,
|
something is definitely wrong and this may fail.
|
|
Server version: 11.4.3-MariaDB-1-log source revision: 5ab81ffe0097a22a774957df28c5223cf0201de3
|
key_buffer_size=1048576
|
read_buffer_size=131072
|
max_used_connections=1
|
max_threads=153
|
thread_count=8
|
It is possible that mysqld could use up to
|
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 62425 K bytes of memory
|
Hope that's ok; if not, decrease some variables in the equation.
|
|
Thread pointer: 0xeea006d8
|
Attempting backtrace. You can use the following information to find out
|
where mysqld died. If you see no messages after this, something went
|
terribly wrong...
|
stack_bottom = 0xef7f7b7c thread_stack 0x49000
|
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(my_print_stacktrace+0x50)[0x1851520]
|
mysys/stacktrace.c:216(my_print_stacktrace)[0x120cbec]
|
addr2line: 'linux-vdso32.so.1': No such file
|
linux-vdso32.so.1(__kernel_sigtramp32+0x0)[0xf79103f4]
|
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(_ZN4JOIN4execEv+0x3c)[0xf984dc]
|
sql/sql_analyze_stmt.h:172(Time_and_counter_tracker::incr_loops())[0xf96390]
|
sql/sql_select.cc:30818(mysql_explain_union(THD*, st_select_lex_unit*, select_result*))[0xf96ef4]
|
sql/sql_select.cc:30762(select_describe(JOIN*, bool, bool, bool, char const*) [clone .isra.0])[0xf9712c]
|
sql/sql_select.cc:4992(JOIN::exec_inner())[0xf97a58]
|
sql/sql_select.cc:4810(JOIN::exec())[0xf9850c]
|
sql/sql_select.cc:5341(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0xf96390]
|
sql/sql_select.cc:30818(mysql_explain_union(THD*, st_select_lex_unit*, select_result*))[0xf96ef4]
|
sql/sql_parse.cc:6084(execute_sqlcom_select(THD*, TABLE_LIST*))[0xeffb20]
|
sql/sql_parse.cc:5837(mysql_execute_command(THD*, bool))[0xf0e470]
|
sql/sql_profile.h:322(PROFILING::status_change(char const*, char const*, char const*, unsigned int))[0xf102c0]
|
sql/sql_parse.cc:1896(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0xf12140]
|
sql/sql_parse.cc:1409(do_command(THD*, bool))[0xf13ecc]
|
sql/sql_connect.cc:1439(do_handle_one_connection(CONNECT*, bool))[0x1061b04]
|
sql/sql_connect.cc:1345(handle_one_connection)[0x1061fb8]
|
perfschema/pfs.cc:2204(pfs_spawn_thread)[0x14e83d4]
|
/lib/powerpc-linux-gnu/libc.so.6(+0xa16cc)[0xf71416cc]
|
|
main.having_cond_pushdown w27 [ fail ]
|
Test ended at 2024-08-19 09:19:48
|
|
CURRENT_TEST: main.having_cond_pushdown
|
mysqltest: At line 1727: query 'EXPLAIN FORMAT=JSON $q' failed: <Unknown> (2013): Lost connection to server during query
|
|
The result from queries just before the failure was:
|
< snip >
|
Warning 1292 Truncated incorrect DECIMAL value: 'b'
|
DROP VIEW v1;
|
#
|
# MDEV-32304: Pushdown: server crashes at Item_field::used_tables()
|
# (fixed by the patch for MDEV-29363)
|
#
|
CREATE VIEW v1 AS SELECT 1 AS a;
|
SELECT * FROM v1
|
GROUP BY a HAVING a = (a IS NULL OR a IS NULL);
|
a
|
DROP VIEW v1;
|
#
|
# MDEV-32608: Expression with constant subquery causes a crash
|
# in pushdown from HAVING
|
#
|
CREATE TABLE t1 (a INT, b INT);
|
INSERT INTO t1 VALUES (2, 1), (3, 2);
|
EXPLAIN FORMAT=JSON SELECT * FROM t1
|
GROUP BY b
|
HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3;
|
|
More results from queries before failure can be found in /<<PKGBUILDDIR>>/builddir/mysql-test/var/27/log/having_cond_pushdown.log
|
|
- found 'core.45039' (0/1)
|
Core generated by '/<<PKGBUILDDIR>>/builddir/sql/mariadbd'
|
Output from gdb follows. The first stack trace is from the failing thread.
|
The following stack traces are from all threads (so the failing one is
|
duplicated).
|
--------------------------
|
[New LWP 45057]
|
[New LWP 45042]
|
[New LWP 45041]
|
[New LWP 45039]
|
[New LWP 45043]
|
[New LWP 45044]
|
[New LWP 45307]
|
[Thread debugging using libthread_db enabled]
|
Using host libthread_db library "/lib/powerpc64-linux-gnu/libthread_db.so.1".
|
Core was generated by `/<<PKGBUILDDIR>>/builddir/sql/mariadbd --defaults-group-suf'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 0x00007fff865e0fdc in ?? () from /lib/powerpc64-linux-gnu/libc.so.6
|
[Current thread is 1 (Thread 0x7fff7fa67fe0 (LWP 45057))]
|
#0 0x00007fff865e0fdc in ?? () from /lib/powerpc64-linux-gnu/libc.so.6
|
#1 0x00000001048b8bb8 in my_write_core (sig=11) at ./mysys/stacktrace.c:424
|
#2 0x000000010423dff8 in handle_fatal_signal (sig=11) at ./sql/signal_handler.cc:358
|
#3 <signal handler called>
|
#4 0x0000000103f978f8 in Time_and_counter_tracker::incr_loops (this=0xb8) at ./sql/sql_analyze_stmt.h:172
|
#5 JOIN::exec (this=this@entry=0x7fff60bfadc0) at ./sql/sql_select.cc:4808
|
#6 0x0000000103f95514 in mysql_select (thd=thd@entry=0x7fff60000c68, tables=0x7fff600123b0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=result@entry=0x0, unit=unit@entry=0x7fff60012ae0, select_lex=select_lex@entry=0x7fff60011c10) at ./sql/sql_select.cc:5339
|
#7 0x0000000103f9616c in mysql_explain_union (thd=thd@entry=0x7fff60000c68, unit=unit@entry=0x7fff60012ae0, result=0x0) at ./sql/sql_select.cc:30818
|
#8 0x0000000103f9634c in select_describe (message=<optimized out>, distinct=<optimized out>, need_order=<optimized out>, need_tmp_table=<optimized out>, join=0x7fff60bf6da0) at ./sql/sql_select.cc:30762
|
#9 0x0000000103f96da8 in JOIN::exec_inner (this=this@entry=0x7fff60bf6da0) at ./sql/sql_select.cc:4992
|
#10 0x0000000103f9791c in JOIN::exec (this=<optimized out>, this@entry=0x7fff60bf6da0) at ./sql/sql_select.cc:4809
|
#11 0x0000000103f95514 in mysql_select (thd=thd@entry=0x7fff60000c68, tables=0x7fff60011370, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7fff60011bb8, having=0x7fff60013db8, proc_param=0x0, select_options=<optimized out>, result=result@entry=0x7fff60014810, unit=unit@entry=0x7fff60004f38, select_lex=select_lex@entry=0x7fff60010d38) at ./sql/sql_select.cc:5339
|
#12 0x0000000103f9616c in mysql_explain_union (thd=thd@entry=0x7fff60000c68, unit=unit@entry=0x7fff60004f38, result=result@entry=0x7fff60014810) at ./sql/sql_select.cc:30818
|
#13 0x0000000103ef1b58 in execute_sqlcom_select (thd=thd@entry=0x7fff60000c68, all_tables=<optimized out>) at ./sql/sql_parse.cc:6081
|
#14 0x0000000103f01d9c in mysql_execute_command (thd=thd@entry=0x7fff60000c68, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at ./sql/sql_parse.cc:3951
|
#15 0x0000000103f03cf0 in mysql_parse (thd=0x7fff60000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at ./sql/sql_parse.cc:7864
|
#16 0x0000000103f05c58 in dispatch_command (command=command@entry=COM_QUERY, thd=<optimized out>, thd@entry=0x7fff60000c68, packet=packet@entry=0x7fff60b26559 "", packet_length=packet_length@entry=96, blocking=blocking@entry=true) at ./sql/sql_parse.cc:1894
|
#17 0x0000000103f0817c in do_command (thd=0x7fff60000c68, blocking=blocking@entry=true) at ./sql/sql_parse.cc:1407
|
#18 0x0000000104071ac8 in do_handle_one_connection (connect=<optimized out>, put_in_cache=put_in_cache@entry=true) at ./sql/sql_connect.cc:1439
|
#19 0x0000000104072088 in handle_one_connection (arg=<optimized out>) at ./sql/sql_connect.cc:1341
|
#20 0x0000000104533614 in pfs_spawn_thread (arg=<optimized out>) at ./storage/perfschema/pfs.cc:2201
|
#21 0x00007fff865de6d4 in ?? () from /lib/powerpc64-linux-gnu/libc.so.6
|
#22 0x00007fff8667b04c in ?? () from /lib/powerpc64-linux-gnu/libc.so.6
|
Test ended at 2024-08-19 11:02:05
|
|
CURRENT_TEST: main.having_cond_pushdown
|
mysqltest: At line 1727: query 'EXPLAIN FORMAT=JSON $q' failed: <Unknown> (2013): Lost connection to server during query
|
|
The result from queries just before the failure was:
|
< snip >
|
Warning 1292 Truncated incorrect DECIMAL value: 'b'
|
DROP VIEW v1;
|
#
|
# MDEV-32304: Pushdown: server crashes at Item_field::used_tables()
|
# (fixed by the patch for MDEV-29363)
|
#
|
CREATE VIEW v1 AS SELECT 1 AS a;
|
SELECT * FROM v1
|
GROUP BY a HAVING a = (a IS NULL OR a IS NULL);
|
a
|
DROP VIEW v1;
|
#
|
# MDEV-32608: Expression with constant subquery causes a crash
|
# in pushdown from HAVING
|
#
|
CREATE TABLE t1 (a INT, b INT);
|
INSERT INTO t1 VALUES (2, 1), (3, 2);
|
EXPLAIN FORMAT=JSON SELECT * FROM t1
|
GROUP BY b
|
HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3;
|
|
More results from queries before failure can be found in /<<PKGBUILDDIR>>/builddir/mysql-test/var/12/log/having_cond_pushdown.log
|
|
- found 'core.2722853' (1/1)
|
Core generated by '/<<PKGBUILDDIR>>/builddir/sql/mariadbd'
|
Output from gdb follows. The first stack trace is from the failing thread.
|
The following stack traces are from all threads (so the failing one is
|
duplicated).
|
--------------------------
|
[New LWP 2722914]
|
[New LWP 2722887]
|
[New LWP 2722893]
|
[New LWP 2722892]
|
[New LWP 2722899]
|
[New LWP 2723063]
|
[New LWP 2722853]
|
[Thread debugging using libthread_db enabled]
|
Using host libthread_db library "/lib/sparc64-linux-gnu/libthread_db.so.1".
|
Core was generated by `/<<PKGBUILDDIR>>/builddir/sql/mariadbd --defaults-group-suf'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 0xfff80001026941c8 in ?? () from /lib/sparc64-linux-gnu/libc.so.6
|
[Current thread is 1 (Thread 0xfff80001022a88c0 (LWP 2722914))]
|
#0 0xfff80001026941c8 in ?? () from /lib/sparc64-linux-gnu/libc.so.6
|
#1 0x0000010000a755b0 in handle_fatal_signal (sig=11) at ./sql/signal_handler.cc:358
|
Backtrace stopped: Cannot access memory at address 0xf0
|
Full logs have full backtrace.
I saw this also after 10.6.19 upload to Ubuntu in https://launchpadlibrarian.net/747533542/buildlog_ubuntu-jammy-s390x.mariadb-10.6_1%3A10.6.19-0ubuntu0.22.04.1~bpo22.04.1~1725466092.dfa659bac9d+ubuntu.22.04.jammy_BUILDING.txt.gz
x.test - simplied case |
$ cat mysql-test/main/x.test
|
--echo #
|
--echo # MDEV-32608: Expression with constant subquery causes a crash
|
--echo # in pushdown from HAVING
|
--echo #
|
|
CREATE TABLE t1 (a INT, b INT);
|
INSERT INTO t1 VALUES (2, 1), (3, 2);
|
|
let $q=
|
SELECT * FROM t1
|
GROUP BY b
|
HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3;
|
|
eval EXPLAIN FORMAT=JSON $q;
|
|
DROP TABLE t1;
|
Breakpoints:
b mysql_explain_union
|
c
|
b Time_and_counter_tracker::incr_loops
|
c
|
(point of crash on s390x)
|
this -> (Time_and_counter_tracker *) on s390x is freed memory.
|
rr replay mysql-test/var/log/mysqld.1.rr/mariadbd-0 (10.6-b7b2d2bde4f7d92e2f98e28774199bf24dea37a4) |
crash location:
|
#0 Time_and_counter_tracker::incr_loops (this=0x7f307801b740) at /home/dan/repos/mariadb-server-10.6/sql/sql_analyze_stmt.h:170
|
#1 0x00000000009b9c68 in JOIN::exec (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:4711
|
#2 0x0000000000990c6b in mysql_select (thd=0x7f3078000dc8, tables=0x7f3078016f18,
|
fields=@0x7f3078016a40: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7f3078016eb0, last = 0x7f3078016eb0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0,
|
having=0x0, proc_param=0x0, select_options=2147748612, result=0x0, unit=0x7f3078017640, select_lex=0x7f3078016780) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:5191
|
#3 0x00000000009e8ce1 in mysql_explain_union (thd=0x7f3078000dc8, unit=0x7f3078017640, result=0x0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29443
|
#4 0x00000000009bb26b in select_describe (join=0x7f30780193c0, need_tmp_table=true, need_order=true, distinct=false, message=0x0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29397
|
#5 0x00000000009bac0a in JOIN::exec_inner (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:4896
|
#6 0x00000000009b9cae in JOIN::exec (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:4712
|
#7 0x0000000000990c6b in mysql_select (thd=0x7f3078000dc8, tables=0x7f3078015ef0,
|
fields=@0x7f3078015b78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7f3078015ea0, last = 0x7f3078019d60, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0,
|
group=0x7f3078016728, having=0x7f30780188c0, proc_param=0x0, select_options=2147748612, result=0x7f30780192f8, unit=0x7f30780051b0, select_lex=0x7f30780158b8)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:5191
|
#8 0x00000000009e8ce1 in mysql_explain_union (thd=0x7f3078000dc8, unit=0x7f30780051b0, result=0x7f30780192f8) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29443
|
#9 0x0000000000945343 in execute_sqlcom_select (thd=0x7f3078000dc8, all_tables=0x7f3078015ef0) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:6335
|
#10 0x0000000000938b75 in mysql_execute_command (thd=0x7f3078000dc8, is_called_from_prepared_stmt=false) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:3988
|
#11 0x000000000092f62a in mysql_parse (thd=0x7f3078000dc8, rawbuf=0x7f3078015790 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x7f3098ce6898) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:8181
|
#12 0x000000000092bfed in dispatch_command (command=COM_QUERY, thd=0x7f3078000dc8, packet=0x7f307800ba29 "", packet_length=96, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1897
|
#13 0x00000000009308c7 in do_command (thd=0x7f3078000dc8, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1410
|
#14 0x0000000000b2e106 in do_handle_one_connection (connect=0x3d464e38, put_in_cache=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1417
|
#15 0x0000000000b2de5a in handle_one_connection (arg=0x3d451808) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1319
|
#16 0x000000000110ee2f in pfs_spawn_thread (arg=0x3d455f68) at /home/dan/repos/mariadb-server-10.6/storage/perfschema/pfs.cc:2201
|
#17 0x00007f309d4a66d7 in start_thread () from /lib64/libc.so.6
|
#18 0x00007f309d52a414 in clone () from /lib64/libc.so.6
|
|
(rr) watch -l last_start
|
Hardware watchpoint 4: -location last_start
|
(rr) reverse-continue
|
..
|
Allocation location:
|
(rr) bt
|
#0 0x00007f309d58cb31 in __memset_evex_unaligned_erms () from /lib64/libc.so.6
|
#1 0x000000000174cf34 in alloc_root (mem_root=0x7f3078006d68, length=240) at /home/dan/repos/mariadb-server-10.6/mysys/my_alloc.c:270
|
#2 0x00000000007af92d in Sql_alloc::operator new (size=240, mem_root=0x7f3078006d68) at /home/dan/repos/mariadb-server-10.6/sql/sql_alloc.h:37
|
#3 0x00000000009b91bb in JOIN::save_explain_data_intern (this=0x7f307801a088, output=0x7f3078019970, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x0)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29229
|
#4 0x00000000009996ca in JOIN::save_explain_data (this=0x7f307801a088, output=0x7f3078019970, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:4671
|
#5 0x0000000000998d4c in JOIN::build_explain (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1868
|
#6 0x0000000000999b10 in JOIN::optimize (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1933
|
#7 0x00000000008f6e0e in st_select_lex::optimize_unflattened_subqueries (this=0x7f30780158b8, const_only=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_lex.cc:5017
|
#8 0x0000000000ba5b47 in JOIN::optimize_constant_subqueries (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/opt_subselect.cc:5717
|
#9 0x000000000099d92f in JOIN::optimize_inner (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:2259
|
#10 0x0000000000999ac9 in JOIN::optimize (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1927
|
#11 0x0000000000990b80 in mysql_select (thd=0x7f3078000dc8, tables=0x7f3078015ef0,
|
fields=@0x7f3078015b78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7f3078015ea0, last = 0x7f3078019d60, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0,
|
group=0x7f3078016728, having=0x7f30780188c0, proc_param=0x0, select_options=2147748612, result=0x7f30780192f8, unit=0x7f30780051b0, select_lex=0x7f30780158b8)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:5177
|
#12 0x00000000009e8ce1 in mysql_explain_union (thd=0x7f3078000dc8, unit=0x7f30780051b0, result=0x7f30780192f8) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29443
|
#13 0x0000000000945343 in execute_sqlcom_select (thd=0x7f3078000dc8, all_tables=0x7f3078015ef0) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:6335
|
#14 0x0000000000938b75 in mysql_execute_command (thd=0x7f3078000dc8, is_called_from_prepared_stmt=false) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:3988
|
#15 0x000000000092f62a in mysql_parse (thd=0x7f3078000dc8, rawbuf=0x7f3078015790 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x7f3098ce6898) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:8181
|
#16 0x000000000092bfed in dispatch_command (command=COM_QUERY, thd=0x7f3078000dc8, packet=0x7f307800ba29 "", packet_length=96, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1897
|
#17 0x00000000009308c7 in do_command (thd=0x7f3078000dc8, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1410
|
#18 0x0000000000b2e106 in do_handle_one_connection (connect=0x3d464e38, put_in_cache=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1417
|
#19 0x0000000000b2de5a in handle_one_connection (arg=0x3d451808) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1319
|
#20 0x000000000110ee2f in pfs_spawn_thread (arg=0x3d455f68) at /home/dan/repos/mariadb-server-10.6/storage/perfschema/pfs.cc:2201
|
#21 0x00007f309d4a66d7 in start_thread () from /lib64/libc.so.6
|
#22 0x00007f309d52a414 in clone () from /lib64/libc.so.6
|
text diff of traces - use https://www.diffchecker.com/text-compare/
#11 0x0000000000990b80 in mysql_select sql/sql_select.cc:5177 - point of initalization
point of failure:
#2 0x0000000000990c6b in mysql_select sql/sql_select.cc:5191 (14 lines later)
s390x |
root@fbbde0e0d899:/build# mysql-test/mtr --manual-gdb='b mysql_explain_union; r' x.test
|
term2 |
mdborg@ibm-s390x-ubuntu22:~$ docker exec -ti build bash
|
root@fbbde0e0d899:/build# gdb -x /build/mysql-test/var/tmp/gdbinit.mysqld.1 /build/sql/mariadbd
|
|
Thread 6 "mariadbd" hit Breakpoint 1, mysql_explain_union (thd=0x3ff7c000dc8, unit=0x3ff7c0051b0, result=0x3ff7c01bb58) at /source/sql/sql_select.cc:29407
|
29407 DBUG_ENTER("mysql_explain_union");
|
(gdb) bt
|
#0 mysql_explain_union (thd=0x3ff7c000dc8, unit=0x3ff7c0051b0, result=0x3ff7c01bb58) at /source/sql/sql_select.cc:29407
|
#1 0x000002aa059346ae in execute_sqlcom_select (thd=0x3ff7c000dc8, all_tables=0x3ff7c018750) at /source/sql/sql_parse.cc:6335
|
#2 0x000002aa0592af60 in mysql_execute_command (thd=0x3ff7c000dc8, is_called_from_prepared_stmt=false) at /source/sql/sql_parse.cc:3988
|
#3 0x000002aa0593a8e2 in mysql_parse (thd=0x3ff7c000dc8, rawbuf=0x3ff7c017ff0 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x3ff9347e138) at /source/sql/sql_parse.cc:8181
|
#4 0x000002aa05923ea4 in dispatch_command (command=COM_QUERY, thd=0x3ff7c000dc8, packet=0x3ff7c00baf9 "", packet_length=96, blocking=true) at /source/sql/sql_parse.cc:1897
|
#5 0x000002aa05922626 in do_command (thd=0x3ff7c000dc8, blocking=true) at /source/sql/sql_parse.cc:1410
|
#6 0x000002aa05b4cf70 in do_handle_one_connection (connect=0x2aa0a3ed668, put_in_cache=true) at /source/sql/sql_connect.cc:1417
|
#7 0x000002aa05b4cb90 in handle_one_connection (arg=0x2aa0a3ed668) at /source/sql/sql_connect.cc:1319
|
#8 0x000002aa0621e8ee in pfs_spawn_thread (arg=0x2aa0a4127b8) at /source/storage/perfschema/pfs.cc:2201
|
#9 0x000003ff93196296 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
#10 0x000003ff9320ff8e in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
(gdb) b JOIN::save_explain_data_intern
|
Breakpoint 2 at 0x2aa059e6f30: file /source/sql/sql_select.cc, line 29163.
|
(gdb) c
|
Continuing.
|
|
Thread 6 "mariadbd" hit Breakpoint 2, JOIN::save_explain_data_intern (this=0x3ff7c01c8e8, output=0x3ff7c01c1d0, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x0) at /source/sql/sql_select.cc:29163
|
29163 JOIN *join= this; /* Legacy: this code used to be a non-member function */
|
(gdb) bt
|
#0 JOIN::save_explain_data_intern (this=0x3ff7c01c8e8, output=0x3ff7c01c1d0, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x0) at /source/sql/sql_select.cc:29163
|
#1 0x000002aa05998912 in JOIN::save_explain_data (this=0x3ff7c01c8e8, output=0x3ff7c01c1d0, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false) at /source/sql/sql_select.cc:4671
|
#2 0x000002aa0598cfc4 in JOIN::build_explain (this=0x3ff7c01c8e8) at /source/sql/sql_select.cc:1868
|
#3 0x000002aa0598d474 in JOIN::optimize (this=0x3ff7c01c8e8) at /source/sql/sql_select.cc:1933
|
#4 0x000002aa058e2778 in st_select_lex::optimize_unflattened_subqueries (this=0x3ff7c018118, const_only=true) at /source/sql/sql_lex.cc:5017
|
#5 0x000002aa05be62d8 in JOIN::optimize_constant_subqueries (this=0x3ff7c01bc20) at /source/sql/opt_subselect.cc:5717
|
#6 0x000002aa0598e652 in JOIN::optimize_inner (this=0x3ff7c01bc20) at /source/sql/sql_select.cc:2259
|
#7 0x000002aa0598d41e in JOIN::optimize (this=0x3ff7c01bc20) at /source/sql/sql_select.cc:1927
|
#8 0x000002aa0599a892 in mysql_select (thd=0x3ff7c000dc8, tables=0x3ff7c018750, fields=..., conds=0x0, og_num=1, order=0x0, group=0x3ff7c018f88, having=0x3ff7c01b120, proc_param=0x0,
|
select_options=2147748612, result=0x3ff7c01bb58, unit=0x3ff7c0051b0, select_lex=0x3ff7c018118) at /source/sql/sql_select.cc:5177
|
#9 0x000002aa059e8640 in mysql_explain_union (thd=0x3ff7c000dc8, unit=0x3ff7c0051b0, result=0x3ff7c01bb58) at /source/sql/sql_select.cc:29443
|
#10 0x000002aa059346ae in execute_sqlcom_select (thd=0x3ff7c000dc8, all_tables=0x3ff7c018750) at /source/sql/sql_parse.cc:6335
|
#11 0x000002aa0592af60 in mysql_execute_command (thd=0x3ff7c000dc8, is_called_from_prepared_stmt=false) at /source/sql/sql_parse.cc:3988
|
#12 0x000002aa0593a8e2 in mysql_parse (thd=0x3ff7c000dc8, rawbuf=0x3ff7c017ff0 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x3ff9347e138) at /source/sql/sql_parse.cc:8181
|
#13 0x000002aa05923ea4 in dispatch_command (command=COM_QUERY, thd=0x3ff7c000dc8, packet=0x3ff7c00baf9 "", packet_length=96, blocking=true) at /source/sql/sql_parse.cc:1897
|
#14 0x000002aa05922626 in do_command (thd=0x3ff7c000dc8, blocking=true) at /source/sql/sql_parse.cc:1410
|
#15 0x000002aa05b4cf70 in do_handle_one_connection (connect=0x2aa0a3ed668, put_in_cache=true) at /source/sql/sql_connect.cc:1417
|
#16 0x000002aa05b4cb90 in handle_one_connection (arg=0x2aa0a3ed668) at /source/sql/sql_connect.cc:1319
|
#17 0x000002aa0621e8ee in pfs_spawn_thread (arg=0x2aa0a4127b8) at /source/storage/perfschema/pfs.cc:2201
|
#18 0x000003ff93196296 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
#19 0x000003ff9320ff8e in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
s390x assert |
]
|
5 0x000002aa078187b8 in JOIN::save_explain_data (this=0x3ff9808a570, output=0x3ff9801c1d0, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false) at /source/sql/sql_select.cc:4652
|
4652 DBUG_ASSERT(select_lex->select_number == FAKE_SELECT_LEX_ID || !output ||
|
(gdb) p optimization_state
|
$3 = JOIN::OPTIMIZATION_IN_PROGRESS
|
(gdb) p output.selects
|
$4 = {array = {buffer = 0x3ff9801c2d0 "", elements = 3, max_element = 16, alloc_increment = 16, size_of_element = 8, m_psi_key = 7, malloc_flags = 256}}
|
(gdb) p optimization_state
|
$5 = JOIN::OPTIMIZATION_IN_PROGRESS
|
(gdb) bt
|
#0 0x000003ffaeb98116 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
#1 0x000003ffaeb48ac0 in raise () from /lib/s390x-linux-gnu/libc.so.6
|
#2 0x000003ffaeb2a460 in abort () from /lib/s390x-linux-gnu/libc.so.6
|
#3 0x000003ffaeb40184 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
#4 0x000003ffaeb401fe in __assert_fail () from /lib/s390x-linux-gnu/libc.so.6
|
#5 0x000002aa078187b8 in JOIN::save_explain_data (this=0x3ff9808a570, output=0x3ff9801c1d0, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false) at /source/sql/sql_select.cc:4652
|
#6 0x000002aa0780cfc4 in JOIN::build_explain (this=0x3ff9808a570) at /source/sql/sql_select.cc:1868
|
#7 0x000002aa0780d474 in JOIN::optimize (this=0x3ff9808a570) at /source/sql/sql_select.cc:1933
|
#8 0x000002aa07762778 in st_select_lex::optimize_unflattened_subqueries (this=0x3ff98018118, const_only=false) at /source/sql/sql_lex.cc:5017
|
#9 0x000002aa07a66250 in JOIN::optimize_unflattened_subqueries (this=0x3ff9801bc20) at /source/sql/opt_subselect.cc:5683
|
#10 0x000002aa07812680 in JOIN::optimize_stage2 (this=0x3ff9801bc20) at /source/sql/sql_select.cc:3227
|
#11 0x000002aa0781006a in JOIN::optimize_inner (this=0x3ff9801bc20) at /source/sql/sql_select.cc:2636
|
#12 0x000002aa0780d41e in JOIN::optimize (this=0x3ff9801bc20) at /source/sql/sql_select.cc:1927
|
#13 0x000002aa0781a892 in mysql_select (thd=0x3ff98000dc8, tables=0x3ff98018750, fields=..., conds=0x0, og_num=1, order=0x0, group=0x3ff98018f88, having=0x3ff9801b120, proc_param=0x0,
|
select_options=2147748612, result=0x3ff9801bb58, unit=0x3ff980051b0, select_lex=0x3ff98018118) at /source/sql/sql_select.cc:5177
|
#14 0x000002aa07868640 in mysql_explain_union (thd=0x3ff98000dc8, unit=0x3ff980051b0, result=0x3ff9801bb58) at /source/sql/sql_select.cc:29443
|
#15 0x000002aa077b46ae in execute_sqlcom_select (thd=0x3ff98000dc8, all_tables=0x3ff98018750) at /source/sql/sql_parse.cc:6335
|
#16 0x000002aa077aaf60 in mysql_execute_command (thd=0x3ff98000dc8, is_called_from_prepared_stmt=false) at /source/sql/sql_parse.cc:3988
|
#17 0x000002aa077ba8e2 in mysql_parse (thd=0x3ff98000dc8, rawbuf=0x3ff98017ff0 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x3ffaee7e138) at /source/sql/sql_parse.cc:8181
|
#18 0x000002aa077a3ea4 in dispatch_command (command=COM_QUERY, thd=0x3ff98000dc8, packet=0x3ff9800baf9 "", packet_length=96, blocking=true) at /source/sql/sql_parse.cc:1897
|
#19 0x000002aa077a2626 in do_command (thd=0x3ff98000dc8, blocking=true) at /source/sql/sql_parse.cc:1410
|
#20 0x000002aa079ccf70 in do_handle_one_connection (connect=0x2aa0bfb1668, put_in_cache=true) at /source/sql/sql_connect.cc:1417
|
#21 0x000002aa079ccb90 in handle_one_connection (arg=0x2aa0bfb1668) at /source/sql/sql_connect.cc:1319
|
#22 0x000002aa0809e8ee in pfs_spawn_thread (arg=0x2aa0bfd67b8) at /source/storage/perfschema/pfs.cc:2201
|
#23 0x000003ffaeb96296 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
#24 0x000003ffaec0ff8e in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
x86_64 at same point |
(rr) bt
|
#0 JOIN::save_explain_data (this=0x7f307801a088, output=0x7f3078019970, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:4639
|
#1 0x0000000000998d4c in JOIN::build_explain (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1868
|
#2 0x0000000000999b10 in JOIN::optimize (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1933
|
#3 0x00000000008f6e0e in st_select_lex::optimize_unflattened_subqueries (this=0x7f30780158b8, const_only=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_lex.cc:5017
|
#4 0x0000000000ba5b47 in JOIN::optimize_constant_subqueries (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/opt_subselect.cc:5717
|
#5 0x000000000099d92f in JOIN::optimize_inner (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:2259
|
#6 0x0000000000999ac9 in JOIN::optimize (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1927
|
#7 0x0000000000990b80 in mysql_select (thd=0x7f3078000dc8, tables=0x7f3078015ef0,
|
fields=@0x7f3078015b78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7f3078015ea0, last = 0x7f3078019d60, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0,
|
group=0x7f3078016728, having=0x7f30780188c0, proc_param=0x0, select_options=2147748612, result=0x7f30780192f8, unit=0x7f30780051b0, select_lex=0x7f30780158b8)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:5177
|
#8 0x00000000009e8ce1 in mysql_explain_union (thd=0x7f3078000dc8, unit=0x7f30780051b0, result=0x7f30780192f8) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29443
|
#9 0x0000000000945343 in execute_sqlcom_select (thd=0x7f3078000dc8, all_tables=0x7f3078015ef0) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:6335
|
#10 0x0000000000938b75 in mysql_execute_command (thd=0x7f3078000dc8, is_called_from_prepared_stmt=false) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:3988
|
#11 0x000000000092f62a in mysql_parse (thd=0x7f3078000dc8, rawbuf=0x7f3078015790 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x7f3098ce6898) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:8181
|
#12 0x000000000092bfed in dispatch_command (command=COM_QUERY, thd=0x7f3078000dc8, packet=0x7f307800ba29 "", packet_length=96, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1897
|
#13 0x00000000009308c7 in do_command (thd=0x7f3078000dc8, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1410
|
#14 0x0000000000b2e106 in do_handle_one_connection (connect=0x3d464e38, put_in_cache=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1417
|
#15 0x0000000000b2de5a in handle_one_connection (arg=0x3d451808) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1319
|
#16 0x000000000110ee2f in pfs_spawn_thread (arg=0x3d455f68) at /home/dan/repos/mariadb-server-10.6/storage/perfschema/pfs.cc:2201
|
#17 0x00007f309d4a66d7 in start_thread () from /lib64/libc.so.6
|
#18 0x00007f309d52a414 in clone () from /lib64/libc.so.6
|
(rr) p optimization_state
|
$9 = JOIN::OPTIMIZATION_IN_PROGRESS
|
(rr) p output.selects
|
$10 = {array = {buffer = 0x7f3078019a70 '\245' <repeats 128 times>, "\250\3410\002", elements = 0, max_element = 16, alloc_increment = 16, size_of_element = 8, m_psi_key = 7, malloc_flags = 256}}
|
output.selects has 0 elements and not 3 which s390x has.
output is thd->lex->explain
x86-64 getting its 3 elements - later in JOIN::save_explain_data than the s390x assertion |
Thread 2 hit Hardware watchpoint 11: -location output.selects.array.elements
|
|
Old value = 0
|
New value = 3
|
set_dynamic (array=0x7f30780199b0, element=0x7f3098ce3c50, idx=2) at /home/dan/repos/mariadb-server-10.6/mysys/array.c:212
|
212 memcpy(array->buffer+(idx * array->size_of_element),element,
|
(rr) bt
|
#0 set_dynamic (array=0x7f30780199b0, element=0x7f3098ce3c50, idx=2) at /home/dan/repos/mariadb-server-10.6/mysys/array.c:212
|
#1 0x0000000000b7de5d in Dynamic_array<Explain_select*>::resize (this=0x7f30780199b0, new_size=3, default_val=0x0) at /home/dan/repos/mariadb-server-10.6/sql/sql_array.h:275
|
#2 0x0000000000b707f9 in Explain_query::add_node (this=0x7f3078019970, node=0x7f307801b698) at /home/dan/repos/mariadb-server-10.6/sql/sql_explain.cc:129
|
#3 0x00000000009b99fb in JOIN::save_explain_data_intern (this=0x7f307801a088, output=0x7f3078019970, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x0)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29320
|
#4 0x00000000009996ca in JOIN::save_explain_data (this=0x7f307801a088, output=0x7f3078019970, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:4671
|
#5 0x0000000000998d4c in JOIN::build_explain (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1868
|
#6 0x0000000000999b10 in JOIN::optimize (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1933
|
#7 0x00000000008f6e0e in st_select_lex::optimize_unflattened_subqueries (this=0x7f30780158b8, const_only=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_lex.cc:5017
|
#8 0x0000000000ba5b47 in JOIN::optimize_constant_subqueries (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/opt_subselect.cc:5717
|
#9 0x000000000099d92f in JOIN::optimize_inner (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:2259
|
#10 0x0000000000999ac9 in JOIN::optimize (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1927
|
#11 0x0000000000990b80 in mysql_select (thd=0x7f3078000dc8, tables=0x7f3078015ef0,
|
fields=@0x7f3078015b78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7f3078015ea0, last = 0x7f3078019d60, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0,
|
group=0x7f3078016728, having=0x7f30780188c0, proc_param=0x0, select_options=2147748612, result=0x7f30780192f8, unit=0x7f30780051b0, select_lex=0x7f30780158b8)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:5177
|
#12 0x00000000009e8ce1 in mysql_explain_union (thd=0x7f3078000dc8, unit=0x7f30780051b0, result=0x7f30780192f8) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29443
|
#13 0x0000000000945343 in execute_sqlcom_select (thd=0x7f3078000dc8, all_tables=0x7f3078015ef0) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:6335
|
#14 0x0000000000938b75 in mysql_execute_command (thd=0x7f3078000dc8, is_called_from_prepared_stmt=false) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:3988
|
#15 0x000000000092f62a in mysql_parse (thd=0x7f3078000dc8, rawbuf=0x7f3078015790 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x7f3098ce6898) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:8181
|
#16 0x000000000092bfed in dispatch_command (command=COM_QUERY, thd=0x7f3078000dc8, packet=0x7f307800ba29 "", packet_length=96, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1897
|
#17 0x00000000009308c7 in do_command (thd=0x7f3078000dc8, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1410
|
#18 0x0000000000b2e106 in do_handle_one_connection (connect=0x3d464e38, put_in_cache=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1417
|
#19 0x0000000000b2de5a in handle_one_connection (arg=0x3d451808) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1319
|
#20 0x000000000110ee2f in pfs_spawn_thread (arg=0x3d455f68) at /home/dan/repos/mariadb-server-10.6/storage/perfschema/pfs.cc:2201
|
#21 0x00007f309d4a66d7 in start_thread () from /lib64/libc.so.6
|
#22 0x00007f309d52a414 in clone () from /lib64/libc.so.6
|
(rr) up
|
#1 0x0000000000b7de5d in Dynamic_array<Explain_select*>::resize (this=0x7f30780199b0, new_size=3, default_val=0x0) at /home/dan/repos/mariadb-server-10.6/sql/sql_array.h:275
|
275 set_dynamic(&array, (uchar*)&default_val, (uint)(new_size - 1));
|
(rr) up
|
#2 0x0000000000b707f9 in Explain_query::add_node (this=0x7f3078019970, node=0x7f307801b698) at /home/dan/repos/mariadb-server-10.6/sql/sql_explain.cc:129
|
129 selects.resize(MY_MAX(select_id+1, selects.elements()*2), NULL);
|
(rr) up
|
#3 0x00000000009b99fb in JOIN::save_explain_data_intern (this=0x7f307801a088, output=0x7f3078019970, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x0)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29320
|
29320 output->add_node(xpl_sel);
|
(rr) p optimization_state
|
$14 = JOIN::OPTIMIZATION_IN_PROGRESS
|
(rr) c
|
Continuing.
|
|
Thread 2 hit Hardware watchpoint 6: -location optimization_state
|
|
Old value = JOIN::OPTIMIZATION_IN_PROGRESS
|
New value = JOIN::OPTIMIZATION_DONE
|
s390 adding to array |
(gdb) p selects
|
$7 = {array = {buffer = 0x3ff7401c2d0 "", elements = 3, max_element = 16, alloc_increment = 16, size_of_element = 8, m_psi_key = 7, malloc_flags = 256}}
|
(gdb) watch -l selects.array.elements
|
Hardware watchpoint 3: -location selects.array.elements
|
(gdb) bt
|
#0 Explain_query::add_node (this=0x3ff7401c1d0, node=0x3ff7401def8) at /source/sql/sql_explain.cc:131
|
#1 0x000002aa192e7d4e in JOIN::save_explain_data_intern (this=0x3ff7401c8e8, output=0x3ff7401c1d0, need_tmp_table_arg=false, need_order_arg=false, distinct_arg=false, message=0x0)
|
at /source/sql/sql_select.cc:29320
|
#2 0x000002aa19298912 in JOIN::save_explain_data (this=0x3ff7401c8e8, output=0x3ff7401c1d0, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false) at /source/sql/sql_select.cc:4671
|
#3 0x000002aa1928cfc4 in JOIN::build_explain (this=0x3ff7401c8e8) at /source/sql/sql_select.cc:1868
|
#4 0x000002aa1928d474 in JOIN::optimize (this=0x3ff7401c8e8) at /source/sql/sql_select.cc:1933
|
#5 0x000002aa191e2778 in st_select_lex::optimize_unflattened_subqueries (this=0x3ff74018118, const_only=true) at /source/sql/sql_lex.cc:5017
|
#6 0x000002aa194e62d8 in JOIN::optimize_constant_subqueries (this=0x3ff7401bc20) at /source/sql/opt_subselect.cc:5717
|
#7 0x000002aa1928e652 in JOIN::optimize_inner (this=0x3ff7401bc20) at /source/sql/sql_select.cc:2259
|
#8 0x000002aa1928d41e in JOIN::optimize (this=0x3ff7401bc20) at /source/sql/sql_select.cc:1927
|
#9 0x000002aa1929a892 in mysql_select (thd=0x3ff74000dc8, tables=0x3ff74018750, fields=..., conds=0x0, og_num=1, order=0x0, group=0x3ff74018f88, having=0x3ff7401b120, proc_param=0x0,
|
select_options=2147748612, result=0x3ff7401bb58, unit=0x3ff740051b0, select_lex=0x3ff74018118) at /source/sql/sql_select.cc:5177
|
#10 0x000002aa192e8640 in mysql_explain_union (thd=0x3ff74000dc8, unit=0x3ff740051b0, result=0x3ff7401bb58) at /source/sql/sql_select.cc:29443
|
#11 0x000002aa192346ae in execute_sqlcom_select (thd=0x3ff74000dc8, all_tables=0x3ff74018750) at /source/sql/sql_parse.cc:6335
|
#12 0x000002aa1922af60 in mysql_execute_command (thd=0x3ff74000dc8, is_called_from_prepared_stmt=false) at /source/sql/sql_parse.cc:3988
|
#13 0x000002aa1923a8e2 in mysql_parse (thd=0x3ff74000dc8, rawbuf=0x3ff74017ff0 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x3ff8b67e138) at /source/sql/sql_parse.cc:8181
|
#14 0x000002aa19223ea4 in dispatch_command (command=COM_QUERY, thd=0x3ff74000dc8, packet=0x3ff7400baf9 "", packet_length=96, blocking=true) at /source/sql/sql_parse.cc:1897
|
#15 0x000002aa19222626 in do_command (thd=0x3ff74000dc8, blocking=true) at /source/sql/sql_parse.cc:1410
|
#16 0x000002aa1944cf70 in do_handle_one_connection (connect=0x2aa1ce72668, put_in_cache=true) at /source/sql/sql_connect.cc:1417
|
#17 0x000002aa1944cb90 in handle_one_connection (arg=0x2aa1ce72668) at /source/sql/sql_connect.cc:1319
|
#18 0x000002aa19b1e8ee in pfs_spawn_thread (arg=0x2aa1ce977b8) at /source/storage/perfschema/pfs.cc:2201
|
#19 0x000003ff8b396296 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
#20 0x000003ff8b40ff8e in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
(gdb) p optimization_state
|
$8 = JOIN::OPTIMIZATION_IN_PROGRESS
|
(gdb) c
|
Continuing.
|
|
Thread 6 "mariadbd" received signal SIGABRT, Aborted.
|
0x000003ff8b398116 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
|
s390x Item_subselect |
JOIN::is_in_subquery (this=0x3ff9c01c8e8) at /source/sql/sql_select.h:1803
|
1803 return (unit->item && unit->item->is_in_predicate());
|
(gdb) p unit->item
|
$15 = (Item_subselect *) 0x3ff9c01a6c0
|
(gdb) p unit->item->is_in_predicate()
|
$16 = false
|
(gdb) p *unit->item
|
$17 = {<Item_result_field> = {<Item_fixed_hybrid> = {<Item> = {<Value_source> = {<No data fields>}, <Type_all_attributes> = {<Type_std_attributes> = {<Type_numeric_attributes> = {max_length = 11, decimals = 0, unsigned_flag = false}, collation = {
|
collation = 0x2aa03b64070 <my_charset_latin1>, derivation = DERIVATION_NUMERIC, repertoire = MY_REPERTOIRE_ASCII}},
|
_vptr.Type_all_attributes = 0x2aa039f6500 <vtable for Item_singlerow_subselect+16>}, next = 0x3ff9c0195d0, str_value = {<Charset> = {
|
m_charset = 0x2aa03ac11e0 <my_charset_bin>}, <Binary_string> = {<Sql_alloc> = {<No data fields>}, Ptr = 0x0, str_length = 0,
|
Alloced_length = 0, extra_alloc = 0, alloced = false, thread_specific = false}, <No data fields>}, name = {str = 0x0, length = 0},
|
orig_name = 0x0, base_flags = (item_base_t::MAYBE_NULL | item_base_t::FIXED), with_flags = item_with_t::SUBQUERY, marker = 0,
|
null_value = true, is_expensive_cache = -1 '\377', join_tab_idx = 61 '='}, <No data fields>},
|
result_field = 0x0}, <Used_tables_and_const_cache> = {used_tables_cache = 0, const_item_cache = true}, value_assigned = false, own_engine = false,
|
thd = 0x3ff9c000dc8, old_engine = 0x0, max_columns = 1, parsing_place = IN_HAVING, have_to_be_excluded = false,
|
inside_first_fix_fields = false, done_first_fix_fields = false, expr_cache = 0x0, forced_const = false, expensive_fl = false, exec_counter = 0,
|
substitution = 0x0, engine = 0x3ff9c01a848, unit = 0x3ff9c019ea0, filesort_buffer = {m_next_rec_ptr = 0x0, m_rawmem = 0x0,
|
m_record_pointers = 0x0, m_sort_keys = 0x0, m_num_records = 0, m_record_length = 0, m_sort_length = 0, m_size_in_bytes = 0, m_idx = 0},
|
sortbuffer = {str = 0x0, length = 11936128518282651045}, upper_refs = {<base_list> = {<Sql_alloc> = {<No data fields>},
|
first = 0x2aa03c81a38 <end_of_list>, last = 0x3ff9c01a7d8, elements = 0}, <No data fields>}, parent_select = 0x3ff9c018118,
|
eliminated = false, changed = true, is_correlated = false, with_recursive_reference = false, next_with_rec_ref = 0xa5a5a5a5a5a5a5a5}
|
(gdb) bt
|
#0 JOIN::is_in_subquery (this=0x3ff9c01c8e8) at /source/sql/sql_select.h:1803
|
#1 0x000002aa01c8d234 in JOIN::build_explain (this=0x3ff9c01c8e8) at /source/sql/sql_select.cc:1894
|
#2 0x000002aa01c8d474 in JOIN::optimize (this=0x3ff9c01c8e8) at /source/sql/sql_select.cc:1933
|
#3 0x000002aa01be2778 in st_select_lex::optimize_unflattened_subqueries (this=0x3ff9c018118, const_only=true) at /source/sql/sql_lex.cc:5017
|
#4 0x000002aa01ee62d8 in JOIN::optimize_constant_subqueries (this=0x3ff9c01bc20) at /source/sql/opt_subselect.cc:5717
|
#5 0x000002aa01c8e652 in JOIN::optimize_inner (this=0x3ff9c01bc20) at /source/sql/sql_select.cc:2259
|
#6 0x000002aa01c8d41e in JOIN::optimize (this=0x3ff9c01bc20) at /source/sql/sql_select.cc:1927
|
#7 0x000002aa01c9a892 in mysql_select (thd=0x3ff9c000dc8, tables=0x3ff9c018750, fields=..., conds=0x0, og_num=1, order=0x0, group=0x3ff9c018f88,
|
having=0x3ff9c01b120, proc_param=0x0, select_options=2147748612, result=0x3ff9c01bb58, unit=0x3ff9c0051b0, select_lex=0x3ff9c018118)
|
at /source/sql/sql_select.cc:5177
|
#8 0x000002aa01ce8640 in mysql_explain_union (thd=0x3ff9c000dc8, unit=0x3ff9c0051b0, result=0x3ff9c01bb58) at /source/sql/sql_select.cc:29443
|
#9 0x000002aa01c346ae in execute_sqlcom_select (thd=0x3ff9c000dc8, all_tables=0x3ff9c018750) at /source/sql/sql_parse.cc:6335
|
#10 0x000002aa01c2af60 in mysql_execute_command (thd=0x3ff9c000dc8, is_called_from_prepared_stmt=false) at /source/sql/sql_parse.cc:3988
|
#11 0x000002aa01c3a8e2 in mysql_parse (thd=0x3ff9c000dc8,
|
rawbuf=0x3ff9c017ff0 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x3ffb497e138) at /source/sql/sql_parse.cc:8181
|
#12 0x000002aa01c23ea4 in dispatch_command (command=COM_QUERY, thd=0x3ff9c000dc8, packet=0x3ff9c00baf9 "", packet_length=96, blocking=true)
|
at /source/sql/sql_parse.cc:1897
|
#13 0x000002aa01c22626 in do_command (thd=0x3ff9c000dc8, blocking=true) at /source/sql/sql_parse.cc:1410
|
#14 0x000002aa01e4cf70 in do_handle_one_connection (connect=0x2aa05f593b8, put_in_cache=true) at /source/sql/sql_connect.cc:1417
|
#15 0x000002aa01e4cb90 in handle_one_connection (arg=0x2aa05f593b8) at /source/sql/sql_connect.cc:1319
|
#16 0x000002aa0251e8ee in pfs_spawn_thread (arg=0x2aa05f7e508) at /source/storage/perfschema/pfs.cc:2201
|
#17 0x000003ffb4696296 in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
#18 0x000003ffb470ff8e in ?? () from /lib/s390x-linux-gnu/libc.so.6
|
vs x86_64:
x86_64 Item_singlerow_subselect |
OIN::is_in_subquery (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.h:1803
|
1803 return (unit->item && unit->item->is_in_predicate());
|
(rr) p unit->item
|
$33 = (Item_singlerow_subselect *) 0x7f3078017e60
|
(rr) p unit->item->is_in_predicate()
|
$34 = false
|
(rr) p *unit->item
|
$35 = (Item_singlerow_subselect) {<Item_subselect> = {<Item_result_field> = {<Item_fixed_hybrid> = {<Item> = {<Value_source> = {<No data fields>}, <Type_all_attributes> = {<Type_std_attributes> = {<Type_numeric_attributes> = {max_length = 11, decimals = 0, unsigned_flag = false},
|
collation = {collation = 0x21eedd0 <my_charset_latin1>, derivation = DERIVATION_NUMERIC, repertoire = MY_REPERTOIRE_ASCII}},
|
_vptr$Type_all_attributes = 0x20aebc0 <vtable for Item_singlerow_subselect+16>}, next = 0x7f3078016d70, str_value = {<Charset> = {
|
m_charset = 0x214bf30 <my_charset_bin>}, <Binary_string> = {<Sql_alloc> = {<No data fields>}, Ptr = 0x0, str_length = 0,
|
Alloced_length = 0, extra_alloc = 0, alloced = false, thread_specific = false}, <No data fields>}, name = {str = 0x0, length = 0},
|
orig_name = 0x0, base_flags = (item_base_t::MAYBE_NULL | item_base_t::FIXED), with_flags = item_with_t::SUBQUERY, marker = 0,
|
null_value = true, is_expensive_cache = -1 '\377', join_tab_idx = 61 '='}, <No data fields>},
|
result_field = 0x0}, <Used_tables_and_const_cache> = {used_tables_cache = 0, const_item_cache = true}, value_assigned = false,
|
own_engine = false, thd = 0x7f3078000dc8, old_engine = 0x0, max_columns = 1, parsing_place = IN_HAVING, have_to_be_excluded = false,
|
inside_first_fix_fields = false, done_first_fix_fields = false, expr_cache = 0x0, forced_const = false, expensive_fl = false,
|
exec_counter = 0, substitution = 0x0, engine = 0x7f3078017fe8, unit = 0x7f3078017640, filesort_buffer = {m_next_rec_ptr = 0x0,
|
m_rawmem = 0x0, m_record_pointers = 0x0, m_sort_keys = 0x0, m_num_records = 0, m_record_length = 0, m_sort_length = 0, m_size_in_bytes = 0,
|
m_idx = 0}, sortbuffer = {str = 0x0, length = 11936128518282651045}, upper_refs = {<base_list> = {<Sql_alloc> = {<No data fields>},
|
first = 0x230e1a8 <end_of_list>, last = 0x7f3078017f78, elements = 0}, <No data fields>}, parent_select = 0x7f30780158b8,
|
eliminated = false, changed = true, is_correlated = false, with_recursive_reference = false, next_with_rec_ref = 0xa5a5a5a5a5a5a5a5},
|
value = 0x7f307801a9e8, row = 0x7f3078017fa8}
|
(rr) bt
|
#0 JOIN::is_in_subquery (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.h:1803
|
#1 0x0000000000999025 in JOIN::build_explain (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1894
|
#2 0x0000000000999b10 in JOIN::optimize (this=0x7f307801a088) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1933
|
#3 0x00000000008f6e0e in st_select_lex::optimize_unflattened_subqueries (this=0x7f30780158b8, const_only=true)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_lex.cc:5017
|
#4 0x0000000000ba5b47 in JOIN::optimize_constant_subqueries (this=0x7f30780193c0)
|
at /home/dan/repos/mariadb-server-10.6/sql/opt_subselect.cc:5717
|
#5 0x000000000099d92f in JOIN::optimize_inner (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:2259
|
#6 0x0000000000999ac9 in JOIN::optimize (this=0x7f30780193c0) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:1927
|
#7 0x0000000000990b80 in mysql_select (thd=0x7f3078000dc8, tables=0x7f3078015ef0,
|
fields=@0x7f3078015b78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7f3078015ea0, last = 0x7f3078019d60, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x7f3078016728, having=0x7f30780188c0, proc_param=0x0, select_options=2147748612,
|
result=0x7f30780192f8, unit=0x7f30780051b0, select_lex=0x7f30780158b8) at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:5177
|
#8 0x00000000009e8ce1 in mysql_explain_union (thd=0x7f3078000dc8, unit=0x7f30780051b0, result=0x7f30780192f8)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_select.cc:29443
|
#9 0x0000000000945343 in execute_sqlcom_select (thd=0x7f3078000dc8, all_tables=0x7f3078015ef0)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:6335
|
#10 0x0000000000938b75 in mysql_execute_command (thd=0x7f3078000dc8, is_called_from_prepared_stmt=false)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:3988
|
#11 0x000000000092f62a in mysql_parse (thd=0x7f3078000dc8,
|
rawbuf=0x7f3078015790 "EXPLAIN FORMAT=JSON SELECT * FROM t1\nGROUP BY b\nHAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3", length=96,
|
parser_state=0x7f3098ce6898) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:8181
|
#12 0x000000000092bfed in dispatch_command (command=COM_QUERY, thd=0x7f3078000dc8, packet=0x7f307800ba29 "", packet_length=96, blocking=true)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1897
|
#13 0x00000000009308c7 in do_command (thd=0x7f3078000dc8, blocking=true) at /home/dan/repos/mariadb-server-10.6/sql/sql_parse.cc:1410
|
#14 0x0000000000b2e106 in do_handle_one_connection (connect=0x3d464e38, put_in_cache=true)
|
at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1417
|
#15 0x0000000000b2de5a in handle_one_connection (arg=0x3d451808) at /home/dan/repos/mariadb-server-10.6/sql/sql_connect.cc:1319
|
#16 0x000000000110ee2f in pfs_spawn_thread (arg=0x3d455f68) at /home/dan/repos/mariadb-server-10.6/storage/perfschema/pfs.cc:2201
|
#17 0x00007f309d4a66d7 in start_thread () from /lib64/libc.so.6
|
#18 0x00007f309d52a414 in clone () from /lib64/libc.so.6
|
Affects Version/s | 10.6.4 [ 26033 ] |
Assignee | Daniel Black [ danblack ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Daniel Black [ danblack ] | Yuchen Pei [ JIRAUSER52627 ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Turns out, wrong type:
s390x in a5e4c34991ed98357fafd6821eb756ad37ee0353 code |
(gdb) b set_extraction_flag_processor
|
Breakpoint 5 at 0x2aa18b9837c: file /source/sql/item.h, line 2275.
|
(gdb) c
|
Continuing.
|
|
Thread 6 "mariadbd" hit Breakpoint 5, Item::set_extraction_flag_processor (this=0x3ffa401a6c0, arg=0x3ffbbd7c69c) at /source/sql/item.h:2275
|
2275 set_extraction_flag(*(int16*)arg);
|
(gdb) s
|
Item::set_extraction_flag (this=0x3ffa401a6c0, flags=0) at /source/sql/item.h:2730
|
2730 marker &= ~MARKER_EXTRACTION_MASK;
|
(gdb) up
|
#1 0x000002aa18b9839a in Item::set_extraction_flag_processor (this=0x3ffa401a6c0, arg=0x3ffbbd7c69c) at /source/sql/item.h:2275
|
2275 set_extraction_flag(*(int16*)arg);
|
(gdb) p *(int16*)arg
|
$9 = 0
|
(gdb) p *(int*)arg
|
$10 = 512
|
Assignee | Yuchen Pei [ JIRAUSER52627 ] | Daniel Black [ danblack ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Link |
This issue relates to |
issue.field.resolutiondate | 2024-09-11 05:04:26.0 | 2024-09-11 05:04:26.284 |
Fix Version/s | 10.6.20 [ 29903 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Fix Version/s | 10.11.10 [ 29904 ] | |
Fix Version/s | 11.2.6 [ 29906 ] | |
Fix Version/s | 11.4.4 [ 29907 ] |
I confim this applies to MariaDB 11.4.3. Seen in test build at https://launchpadlibrarian.net/743054521/buildlog_ubuntu-noble-s390x.mariadb_1%3A11.4.3-1~bpo24.04.1~1723225565.7d8ce997720+debian.latest_BUILDING.txt.gz
main.having_cond_pushdown w2 [ fail ]
Test ended at 2024-08-09 18:31:53
CURRENT_TEST: main.having_cond_pushdown
mysqltest: At line 1727: query 'EXPLAIN FORMAT=JSON $q' failed: <Unknown> (2013): Lost connection to server during query
The result from queries just before the failure was:
< snip >
Warning 1292 Truncated incorrect DECIMAL value: 'b'
DROP VIEW v1;
#
# MDEV-32304: Pushdown: server crashes at Item_field::used_tables()
# (fixed by the patch for MDEV-29363)
#
CREATE VIEW v1 AS SELECT 1 AS a;
SELECT * FROM v1
GROUP BY a HAVING a = (a IS NULL OR a IS NULL);
a
DROP VIEW v1;
#
# MDEV-32608: Expression with constant subquery causes a crash
# in pushdown from HAVING
#
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (2, 1), (3, 2);
EXPLAIN FORMAT=JSON SELECT * FROM t1
GROUP BY b
HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3;
More results from queries before failure can be found in /<<PKGBUILDDIR>>/builddir/mysql-test/var/2/log/having_cond_pushdown.log
Server [mysqld.1 - pid: 51247, winpid: 51247, exit: 256] failed during test run
Server log from this test:
----------SERVER LOG START-----------
240809 18:31:47 [ERROR] mysqld got signal 11 ;
Sorry, we probably made a mistake, and this is a bug.
Your assistance in bug reporting will enable us to fix this for the next release.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 11.4.3-MariaDB-1~bpo24.04.1~1723225565.7d8ce997720+debian.l source revision: 5ab81ffe0097a22a774957df28c5223cf0201de3
key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=8
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 63844 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x3ff44000c68
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x3ff793e5c90 thread_stack 0x49000
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(my_print_stacktrace+0x34)[0x2aa33298954]
src/mariadb-1:11(my_print_stacktrace)[0x2aa32d4e9d2]
[0x3ff793e394e]
src/mariadb-1:11(handle_fatal_signal)[0x2aa32b2b8a0]
src/mariadb-1:11(Time_and_counter_tracker::incr_loops())[0x2aa32b2999c]
src/mariadb-1:11(mysql_explain_union(THD*, st_select_lex_unit*, select_result*))[0x2aa32b2a504]
src/mariadb-1:11(select_describe(JOIN*, bool, bool, bool, char const*) [clone .isra.0])[0x2aa32b2a678]
src/mariadb-1:11(JOIN::exec_inner())[0x2aa32b2af26]
src/mariadb-1:11(JOIN::exec())[0x2aa32b2b8c2]
src/mariadb-1:11(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x2aa32b2999c]
src/mariadb-1:11(mysql_explain_union(THD*, st_select_lex_unit*, select_result*))[0x2aa32b2a504]
src/mariadb-1:11(execute_sqlcom_select(THD*, TABLE_LIST*))[0x2aa32a9fe24]
src/mariadb-1:11(mysql_execute_command(THD*, bool))[0x2aa32aab078]
src/mariadb-1:11(THD::enter_stage(PSI_stage_info_v1 const*, char const*, char const*, unsigned int))[0x2aa32aae972]
src/mariadb-1:11(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x2aa32ab0e84]
src/mariadb-1:11(do_command(THD*, bool))[0x2aa32ab294e]
src/mariadb-1:11(do_handle_one_connection(CONNECT*, bool))[0x2aa32be4762]
src/mariadb-1:11(handle_one_connection)[0x2aa32be4bac]
src/mariadb-1:11(pfs_spawn_thread)[0x2aa32fa50f6]
/lib/s390x-linux-gnu/libc.so.6(+0x9dd8c)[0x3ff7fd9dd8c]
/lib/s390x-linux-gnu/libc.so.6(+0x11ba80)[0x3ff7fe1ba80]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x3ff44010b20): EXPLAIN FORMAT=JSON SELECT * FROM t1
GROUP BY b
HAVING (SELECT MAX(b) FROM t1) = a AND a + b = 3
Connection ID (thread ID): 369
Status: NOT_KILLED
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/ contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /<<PKGBUILDDIR>>/builddir/mysql-test/var/2/mysqld.1/data
Resource Limits:
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size unlimited unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 64242 64242 processes
Max open files 1024 1024 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 64242 64242 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Core pattern: |/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E
Kernel version: Linux version 5.4.0-190-generic (buildd@bos02-s390x-007) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #210-Ubuntu SMP Fri Jul 5 17:03:06 UTC 2024
----------SERVER LOG END-------------
It happened only on s390x, not any other architecture.