[MDEV-24663] Assertion `0' failed in Protocol::end_statement upon ANALYZE SELECT Created: 2021-01-23  Updated: 2023-07-13  Resolved: 2023-07-13

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.3, 10.4, 10.5, 10.6
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

Yet another Assertion `0' in Protocol::end_statement, now on upon ANALYZE. Couldn't reproduce with plain SELECT or with EXPLAIN, and we don't seem to have open bugs for this failure on ANALYZE, so filing a new one.

CREATE TABLE t1 (f1 INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2);
CREATE VIEW v1 AS SELECT f1, COUNT(*) as f FROM t1 GROUP BY f1;
ANALYZE SELECT * FROM v1 WHERE 'x';
 
# Cleanup
DROP VIEW v1;
DROP TABLE t1;

10.3 4e503aec

mysqld: /data/src/10.3/sql/protocol.cc:600: void Protocol::end_statement(): Assertion `0' failed.
210124  0:49:38 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f4972d3ff36 in __GI___assert_fail (assertion=0x562d924de2d0 "0", file=0x562d924ddec8 "/data/src/10.3/sql/protocol.cc", line=600, function=0x562d924de278 "void Protocol::end_statement()") at assert.c:101
#8  0x0000562d91793a00 in Protocol::end_statement (this=0x7f495c001348) at /data/src/10.3/sql/protocol.cc:600
#9  0x0000562d918ad04e in dispatch_command (command=COM_QUERY, thd=0x7f495c000d90, packet=0x7f495c008f11 "ANALYZE SELECT * FROM v1 WHERE 'x'", packet_length=34, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:2409
#10 0x0000562d918a9c8c in do_command (thd=0x7f495c000d90) at /data/src/10.3/sql/sql_parse.cc:1398
#11 0x0000562d91a28295 in do_handle_one_connection (connect=0x562d95908070) at /data/src/10.3/sql/sql_connect.cc:1403
#12 0x0000562d91a27ff1 in handle_one_connection (arg=0x562d95908070) at /data/src/10.3/sql/sql_connect.cc:1308
#13 0x0000562d923f3eb3 in pfs_spawn_thread (arg=0x562d958eb440) at /data/src/10.3/storage/perfschema/pfs.cc:1869
#14 0x00007f497324f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x00007f4972e2b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Reproducible on 10.3+.
Couldn't reproduce on 10.2.
No obvious problem on a non-debug build.



 Comments   
Comment by Alice Sherepa [ 2023-07-13 ]

not reproducible on current 10.4-11.0

ANALYZE SELECT * FROM v1 WHERE 'x';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	r_rows	filtered	r_filtered	Extra
1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
2	DERIVED	t1	index	NULL	PRIMARY	4	NULL	2	NULL	100.00	NULL	Using index
Warnings:
Warning	1292	Truncated incorrect DOUBLE value: 'x'

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