[MDEV-11783] Assertion `checksum_start + checksum_length == f->ptr' failed in mysql_checksum_table Created: 2017-01-12  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Admin statements, Virtual Columns
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-21415 Assertion `inited == RND' failed in h... Confirmed

 Description   

Note: The test case usually fails for me, but sometimes it misses the mark. Run with --repeat=N if it doesn't fail right away.
Important note: It does not fail for me on ASAN debug builds, only non-ASAN debug builds!

--source include/have_innodb.inc
 
CREATE TABLE t1 (
  pk INT AUTO_INCREMENT,
  i INT,
  e ENUM('foo','bar') AS (i) VIRTUAL,
  PRIMARY KEY (pk)
) ENGINE=InnoDB;
 
INSERT INTO t1 (i) VALUES (1),(NULL),(1),(NULL),(2),(1),(2),(NULL);
ALTER TABLE t1 ADD COLUMN f DECIMAL;
CHECKSUM TABLE t1;
 
# Cleanup
DROP TABLE t1;

10.2 37ffdb44ef96

mysqld: /data/src/10.2/sql/sql_table.cc:10422: bool mysql_checksum_table(THD*, TABLE_LIST*, HA_CHECK_OPT*): Assertion `checksum_start + checksum_length == f->ptr' failed.
190120 19:18:46 [ERROR] mysqld got signal 6 ;
 
#7  0x00007fc7ac075ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x000055937180193a in mysql_checksum_table (thd=0x7fc754000b00, tables=0x7fc754012518, check_opt=0x7fc7540055f0) at /data/src/10.2/sql/sql_table.cc:10422
#9  0x00005593717292f3 in mysql_execute_command (thd=0x7fc754000b00) at /data/src/10.2/sql/sql_parse.cc:4258
#10 0x00005593717350a1 in mysql_parse (thd=0x7fc754000b00, rawbuf=0x7fc754012448 "CHECKSUM TABLE t1", length=17, parser_state=0x7fc7a44e1200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8015
#11 0x00005593717229db in dispatch_command (command=COM_QUERY, thd=0x7fc754000b00, packet=0x7fc754096531 "", packet_length=17, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1826
#12 0x0000559371721332 in do_command (thd=0x7fc754000b00) at /data/src/10.2/sql/sql_parse.cc:1379
#13 0x00005593718741c3 in do_handle_one_connection (connect=0x5593756b0bf0) at /data/src/10.2/sql/sql_connect.cc:1335
#14 0x0000559371873f50 in handle_one_connection (arg=0x5593756b0bf0) at /data/src/10.2/sql/sql_connect.cc:1241
#15 0x0000559371c99e72 in pfs_spawn_thread (arg=0x5593755f6ff0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#16 0x00007fc7add4c494 in start_thread (arg=0x7fc7a44e2700) at pthread_create.c:333
#17 0x00007fc7ac13293f in clone () from /lib/x86_64-linux-gnu/libc.so.6

No visible problems on a non-debug build.



 Comments   
Comment by Roel Van de Paar [ 2020-06-19 ]

Possibly connected with MDEV-21415

Comment by Roel Van de Paar [ 2021-08-10 ]

SET SQL_MODE='';
CREATE TABLE t (a INT,b INT GENERATED ALWAYS AS (a+1),c INT) ENGINE=InnoDB PARTITION BY RANGE (b) (PARTITION p0 VALUES LESS THAN (6),PARTITION p VALUES LESS THAN (11),PARTITION p2 VALUES LESS THAN (16),PARTITION p3 VALUES LESS THAN (21));
ALTER TABLE t ENGINE=MyISAM;
INSERT INTO t VALUES (0,0,1);
CHECKSUM TABLE t;

Leads to:

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

mysqld: /test/10.7_dbg/sql/handler.cc:5797: virtual int handler::calculate_checksum(): Assertion `checksum_start + checksum_length == f->ptr' failed.

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

Core was generated by `/test/MD200721-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14cae46c0700 (LWP 2659773))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000014caeeb25859 in __GI_abort () at abort.c:79
#2  0x000014caeeb25729 in __assert_fail_base (fmt=0x14caeecbb588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x556b4c8b72d0 "checksum_start + checksum_length == f->ptr", file=0x556b4c8b5153 "/test/10.7_dbg/sql/handler.cc", line=5797, function=<optimized out>) at assert.c:92
#3  0x000014caeeb36f36 in __GI___assert_fail (assertion=assertion@entry=0x556b4c8b72d0 "checksum_start + checksum_length == f->ptr", file=file@entry=0x556b4c8b5153 "/test/10.7_dbg/sql/handler.cc", line=line@entry=5797, function=function@entry=0x556b4c8b72a0 "virtual int handler::calculate_checksum()") at assert.c:101
#4  0x0000556b4bda38d5 in handler::calculate_checksum (this=0x14ca9c037ea0) at /test/10.7_dbg/sql/handler.cc:5797
#5  0x0000556b4c05f95e in ha_partition::calculate_checksum (this=0x14ca9c01e190) at /test/10.7_dbg/sql/ha_partition.cc:10863
#6  0x0000556b4bb84f8c in mysql_checksum_table (thd=thd@entry=0x14ca9c000db8, tables=tables@entry=0x14ca9c013d48, check_opt=check_opt@entry=0x14ca9c0063c8) at /test/10.7_dbg/sql/sql_table.cc:11367
#7  0x0000556b4baa5a79 in mysql_execute_command (thd=thd@entry=0x14ca9c000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:4384
#8  0x0000556b4ba90ead in mysql_parse (thd=thd@entry=0x14ca9c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14cae46bf400) at /test/10.7_dbg/sql/sql_parse.cc:8026
#9  0x0000556b4ba9f9f8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14ca9c000db8, packet=packet@entry=0x14ca9c00b749 "", packet_length=packet_length@entry=16, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1340
#10 0x0000556b4baa2e05 in do_command (thd=0x14ca9c000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
#11 0x0000556b4bc18f48 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x556b4f76ee88, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1410
#12 0x0000556b4bc1954d in handle_one_connection (arg=arg@entry=0x556b4f76ee88) at /test/10.7_dbg/sql/sql_connect.cc:1312
#13 0x0000556b4c0815b2 in pfs_spawn_thread (arg=0x556b4f6983c8) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
#14 0x000014caef034609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x000014caeec22293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.39 (dbg), 10.3.30 (dbg), 10.4.20 (dbg), 10.5.11 (dbg), 10.6.4 (dbg), 10.7.0 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.39 (opt), 10.3.30 (opt), 10.4.20 (opt), 10.5.11 (opt), 10.6.4 (opt), 10.7.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 8.0.24 (dbg), 8.0.24 (opt)

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