Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.5 , 10.6 , 10.11 , 11.1(EOL) , 11.2(EOL) , 11.3(EOL) , 11.4 , 11.5(EOL)
--source include/have_innodb.inc
--source include/have_partition.inc
SET SESSION sql_mode= '' ;
CREATE TABLE t (a DATE ,b INT ,c INT ,d INT ,e INT ,f INT ,g INT ,h INT ,i DATE ,j INT ,k INT ,l INT ,m INT ,n INT ,o INT ,p INT ,q DATE ,r INT ,s INT ,t INT ,u INT ,v INT ,w INT ,x INT ,y DATE ,z INT ,aa INT ,ab INT ,ac INT ,ad INT ,ae INT ,af INT , PRIMARY KEY (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae,af)) ENGINE=InnoDB PARTITION BY KEY (a) (PARTITION p, PARTITION p2);
INSERT INTO t (a) VALUES (0);
SELECT SLEEP(2); # Allow server to finish slow-crashing
Leads to:
11.5.0 3f9182126c64bcec359bebe9ebad2a0e559b13e2 (Debug)
mariadbd: /test/11.5_dbg/storage/innobase/row/row0purge.cc:617: void row_purge_reset_trx_id(purge_node_t*, mtr_t*): Assertion `heap == __null' failed.
11.5.0 3f9182126c64bcec359bebe9ebad2a0e559b13e2 (Debug)
Core was generated by `/test/MD240424-mariadb-11.5.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
Download failed: Invalid argument. Continuing without source file ./nptl/./nptl/pthread_kill.c.
44 ./nptl/pthread_kill.c: Inappropriate ioctl for device.
[Current thread is 1 (LWP 2279836)]
(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
#3 0x0000154e8c43c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
#4 0x0000154e8c42287c in __GI_abort () at ./stdlib/abort.c:79
#5 0x0000154e8c42279b in __assert_fail_base (fmt=0x154e8c5b9f68 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55570b03d943 "heap == __null", file=file@entry=0x55570b023de0 "/test/11.5_dbg/storage/innobase/row/row0purge.cc", line=line@entry=617, function=function@entry=0x55570b023f98 "void row_purge_reset_trx_id(purge_node_t*, mtr_t*)") at ./assert/assert.c:92
#6 0x0000154e8c433b86 in __assert_fail (assertion=0x55570b03d943 "heap == __null", file=0x55570b023de0 "/test/11.5_dbg/storage/innobase/row/row0purge.cc", line=617, function=0x55570b023f98 "void row_purge_reset_trx_id(purge_node_t*, mtr_t*)") at ./assert/assert.c:101
#7 0x000055570a95ee93 in row_purge_reset_trx_id (node=node@entry=0x55570d656d50, mtr=mtr@entry=0x154e53ffe510)at /test/11.5_dbg/storage/innobase/row/row0purge.cc:617
#8 0x000055570a961d01 in row_purge_record_func (node=node@entry=0x55570d656d50, undo_rec=undo_rec@entry=0x154e8262c110 "\001\263\v", thr=thr@entry=0x55570d656cb0, updated_extern=<optimized out>)at /test/11.5_dbg/storage/innobase/row/row0purge.cc:1094
#9 0x000055570a963502 in row_purge (thr=<optimized out>, undo_rec=<optimized out>, node=<optimized out>)at /test/11.5_dbg/storage/innobase/row/row0purge.cc:1138
#10 row_purge_step (thr=thr@entry=0x55570d656cb0)at /test/11.5_dbg/storage/innobase/row/row0purge.cc:1201
#11 0x000055570a8e10f1 in que_thr_step (thr=0x55570d656cb0)at /test/11.5_dbg/storage/innobase/que/que0que.cc:588
#12 que_run_threads_low (thr=0x55570d656cb0)at /test/11.5_dbg/storage/innobase/que/que0que.cc:644
#13 que_run_threads (thr=0x55570d656cb0)at /test/11.5_dbg/storage/innobase/que/que0que.cc:664
#14 0x000055570a9b94b8 in trx_purge (n_tasks=n_tasks@entry=4, history_size=<optimized out>)at /test/11.5_dbg/storage/innobase/trx/trx0purge.cc:1484
#15 0x000055570a9a70b1 in purge_coordinator_state::do_purge (this=this@entry=0x55570c0c46e0 <purge_state>)at /test/11.5_dbg/storage/innobase/srv/srv0srv.cc:1425
#16 0x000055570a9a5ae7 in purge_coordinator_callback ()at /test/11.5_dbg/storage/innobase/srv/srv0srv.cc:1503
#17 0x000055570ab54179 in tpool::task_group::execute (this=0x55570c0c4540 <purge_coordinator_task_group>, t=t@entry=0x55570c0c44a0 <purge_coordinator_task>)at /test/11.5_dbg/tpool/task_group.cc:73
#18 0x000055570ab543c9 in tpool::task::execute (this=0x55570c0c44a0 <purge_coordinator_task>)at /test/11.5_dbg/tpool/task.cc:32
#19 0x000055570ab52171 in tpool::thread_pool_generic::worker_main (this=0x55570d390ec0, thread_var=0x55570d391380)at /test/11.5_dbg/tpool/tpool_generic.cc:583
#20 0x000055570ab53476 in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>(__t=<optimized out>, __f=<optimized out>)at /usr/include/c++/12/bits/invoke.h:74
#21 std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=<optimized out>)at /usr/include/c++/12/bits/invoke.h:96
#22 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>)at /usr/include/c++/12/bits/std_thread.h:279
#23 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator()(this=<optimized out>) at /usr/include/c++/12/bits/std_thread.h:286
#24 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=<optimized out>)at /usr/include/c++/12/bits/std_thread.h:231
#25 0x0000154e8c8e63e3 in std::execute_native_thread_routine (__p=0x154e60000eb0)at ../../../../../src/libstdc++-v3/src/c++11/thread.cc:104
#26 0x0000154e8c48f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
#27 0x0000154e8c51dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Bug confirmed present in:
MariaDB: 10.5.25 (dbg), 10.6.18 (dbg), 10.11.8 (dbg), 11.1.5 (dbg), 11.2.4 (dbg), 11.3.3 (dbg), 11.4.2 (dbg), 11.5.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.5.25 (opt), 10.6.18 (opt), 10.11.8 (opt), 11.1.5 (opt), 11.2.4 (opt), 11.3.3 (opt), 11.4.2 (opt), 11.5.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.44 (dbg), 5.7.44 (opt), 8.0.36 (dbg), 8.0.36 (opt)
{"report":{"fcp":1262.1000003814697,"ttfb":289.5,"pageVisibility":"visible","entityId":129022,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"2677a4fe-5555-4505-a38b-77ac2d39ed92","navigationType":0,"readyForUser":1417.7000002861023,"redirectCount":0,"resourceLoadedEnd":1936.1000003814697,"resourceLoadedStart":295.40000009536743,"resourceTiming":[{"duration":354.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":295.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":650,"responseStart":0,"secureConnectionStart":0},{"duration":354.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":295.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":650.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":366,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":295.90000009536743,"connectEnd":295.90000009536743,"connectStart":295.90000009536743,"domainLookupEnd":295.90000009536743,"domainLookupStart":295.90000009536743,"fetchStart":295.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":295.90000009536743,"responseEnd":661.9000000953674,"responseStart":661.9000000953674,"secureConnectionStart":295.90000009536743},{"duration":451.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":296.1000003814697,"connectEnd":296.1000003814697,"connectStart":296.1000003814697,"domainLookupEnd":296.1000003814697,"domainLookupStart":296.1000003814697,"fetchStart":296.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":296.1000003814697,"responseEnd":747.4000000953674,"responseStart":747.4000000953674,"secureConnectionStart":296.1000003814697},{"duration":457.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":296.30000019073486,"connectEnd":296.30000019073486,"connectStart":296.30000019073486,"domainLookupEnd":296.30000019073486,"domainLookupStart":296.30000019073486,"fetchStart":296.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":296.30000019073486,"responseEnd":753.5,"responseStart":753.5,"secureConnectionStart":296.30000019073486},{"duration":457.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":296.5,"connectEnd":296.5,"connectStart":296.5,"domainLookupEnd":296.5,"domainLookupStart":296.5,"fetchStart":296.5,"redirectEnd":0,"redirectStart":0,"requestStart":296.5,"responseEnd":754.1000003814697,"responseStart":754.1000003814697,"secureConnectionStart":296.5},{"duration":458,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":296.80000019073486,"connectEnd":296.80000019073486,"connectStart":296.80000019073486,"domainLookupEnd":296.80000019073486,"domainLookupStart":296.80000019073486,"fetchStart":296.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":296.80000019073486,"responseEnd":754.8000001907349,"responseStart":754.8000001907349,"secureConnectionStart":296.80000019073486},{"duration":553.9000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":296.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":296.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":850.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":457.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":298.2000002861023,"connectEnd":298.2000002861023,"connectStart":298.2000002861023,"domainLookupEnd":298.2000002861023,"domainLookupStart":298.2000002861023,"fetchStart":298.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":298.2000002861023,"responseEnd":755.3000001907349,"responseStart":755.3000001907349,"secureConnectionStart":298.2000002861023},{"duration":552.5999999046326,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":298.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":298.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":851,"responseStart":0,"secureConnectionStart":0},{"duration":458.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":298.6000003814697,"connectEnd":298.6000003814697,"connectStart":298.6000003814697,"domainLookupEnd":298.6000003814697,"domainLookupStart":298.6000003814697,"fetchStart":298.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":298.6000003814697,"responseEnd":757.1000003814697,"responseStart":757.1000003814697,"secureConnectionStart":298.6000003814697},{"duration":695.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":306.7000002861023,"connectEnd":306.7000002861023,"connectStart":306.7000002861023,"domainLookupEnd":306.7000002861023,"domainLookupStart":306.7000002861023,"fetchStart":306.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":306.7000002861023,"responseEnd":1002.1000003814697,"responseStart":1002.1000003814697,"secureConnectionStart":306.7000002861023},{"duration":1549.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":309.80000019073486,"connectEnd":309.80000019073486,"connectStart":309.80000019073486,"domainLookupEnd":309.80000019073486,"domainLookupStart":309.80000019073486,"fetchStart":309.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":309.80000019073486,"responseEnd":1859.4000000953674,"responseStart":1859.4000000953674,"secureConnectionStart":309.80000019073486},{"duration":129.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":873.5,"connectEnd":873.5,"connectStart":873.5,"domainLookupEnd":873.5,"domainLookupStart":873.5,"fetchStart":873.5,"redirectEnd":0,"redirectStart":0,"requestStart":873.5,"responseEnd":1002.6000003814697,"responseStart":1002.6000003814697,"secureConnectionStart":873.5},{"duration":767.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-jira.view.issue,-jira.navigator.kickass,-viewissue.standalone,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1168.8000001907349,"connectEnd":1168.8000001907349,"connectStart":1168.8000001907349,"domainLookupEnd":1168.8000001907349,"domainLookupStart":1168.8000001907349,"fetchStart":1168.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1168.8000001907349,"responseEnd":1936.1000003814697,"responseStart":1936.1000003814697,"secureConnectionStart":1168.8000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":112,"responseStart":289,"responseEnd":309,"domLoading":293,"domInteractive":1955,"domContentLoadedEventStart":1955,"domContentLoadedEventEnd":2023,"domComplete":2850,"loadEventStart":2850,"loadEventEnd":2851,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1879.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1882.2000002861023},{"name":"bigPipe.activity-panel-pipe-id.start","time":1882.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1886},{"name":"activityTabFullyLoaded","time":2044.3000001907349}],"measures":[],"correlationId":"199977d640b93f","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":13,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Here is a better parameterized test case:
--source include/have_innodb.inc
--source include/have_sequence.inc
DELIMITER $$;
GROUP_CONCAT(seq SEPARATOR
$$
DELIMITER ;$$
If I change the 32 to 33, the test will fail with an error:
' failed: ER_TOO_MANY_KEY_PARTS (1070): Too many key parts specified; max 32 parts allowed
If I change the 32 to 31, the assertion failure will be avoided. The fix is simple:
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 629f4177552..9cce724a7eb 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -1062,12 +1062,12 @@ static void row_purge_reset_trx_id(purge_node_t* node, mtr_t* mtr)
mem_heap_t* heap = NULL;
/* Reserve enough offsets for the PRIMARY KEY and 2 columns
so that we can access DB_TRX_ID, DB_ROLL_PTR. */
- rec_offs offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ rec_offs offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 3];
rec_offs_init(offsets_);
rec_offs* offsets = rec_get_offsets(
rec, index, offsets_, index->n_core_fields,
trx_id_pos + 2, &heap);
- ut_ad(heap == NULL);
+ ut_a(heap == NULL);
ut_ad(dict_index_get_nth_field(index, trx_id_pos)
Because I only had a non-debug build readily available, I changed the debug assertion as well.
The intention here is that the offsets_ will be large enough for storing offsets. There was an off-by-one error in the condition.