Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
11.3.0 , 10.4(EOL) , 10.5 , 10.6 , 10.9(EOL) , 10.10(EOL) , 10.11 , 11.0(EOL) , 11.1(EOL)
Environment:
Ubuntu Desktop 20.04 LTS
Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
The latest version of MariDB Server: Git commit hash: `e987b9350cb83038c73` crashes when executing the following query:
drop database if exists test;
create database test;
use test;
CREATE TABLE IF NOT EXISTS v0 ( c1 SET ( 'abc' ) BINARY UNICODE ) PARTITION BY LINEAR HASH ( c1 MOD c1 ) PARTITIONS 0x100 ;
ALTER TABLE v0 CHECK PARTITION ALL FOR UPGRADE ;
ALTER TABLE v0 LOCK SHARED , ORDER BY v0 ;
Here is a crashing stack trace:
(gdb) bt
#0 0x0000aaaada90e030 in ha_partition::create_handlers (mem_root=0xffff8412ceb0, this=0xffff280caa90) at /home/mysql/mariadb/sql/ha_partition.cc:3034
#1 ha_partition::create_handlers (this=0xffff280caa90, mem_root=0xffff8412ceb0) at /home/mysql/mariadb/sql/ha_partition.cc:3015
#2 0x0000aaaada90e2b0 in ha_partition::setup_engine_array (this=0xffff280caa90, mem_root=0xffff8412ceb0, first_engine=0xaaaae03f49c8)
at /home/mysql/mariadb/sql/ha_partition.cc:3271
#3 0x0000aaaada90f310 in ha_partition::initialize_partition (this=0xffff280caa90, mem_root=<optimized out>) at /home/mysql/mariadb/sql/ha_partition.cc:569
#4 0x0000aaaada9108fc in partition_create_handler (hton=0xaaaae03e1108, share=0xffff8412ce28, mem_root=0xffff8412ceb0) at /home/mysql/mariadb/sql/ha_partition.cc:264
#5 0x0000aaaada7220d0 in get_new_handler (share=share@entry=0xffff8412ce28, alloc=0xffff8412ceb0, db_type=<optimized out>) at /home/mysql/mariadb/sql/handler.cc:384
#6 0x0000aaaada5cc184 in TABLE_SHARE::init_from_binary_frm_image (this=this@entry=0xffff8412ce28, thd=thd@entry=0xffff28000c68, write=<optimized out>,
frm_image=<optimized out>, frm_length=<optimized out>, par_image=par_image@entry=0x0, par_length=par_length@entry=0) at /home/mysql/mariadb/sql/handler.h:1717
#7 0x0000aaaada72a780 in ha_create_table (thd=thd@entry=0xffff28000c68, path=path@entry=0xffff8412fa47 "./test/#sql-alter-5c73-3", db=0xffff28012b48 "test",
table_name=0xffff28012400 "v0", create_info=0xffff8412fde0, create_info@entry=0xffff8412fb90, frm=frm@entry=0xffff8412d4e8, skip_frm_file=false,
skip_frm_file@entry=64) at /home/mysql/mariadb/sql/handler.cc:6122
#8 0x0000aaaada5a732c in mysql_alter_table (thd=thd@entry=0xffff28000c68, new_db=new_db@entry=0xffff280058b8, new_name=new_name@entry=0xffff28005d08,
create_info=0xffff8412fb90, create_info@entry=0xffff8412fde0, table_list=<optimized out>, table_list@entry=0xffff28012438, recreate_info=0xffff00000000,
recreate_info@entry=0xffff8412fce0, alter_info=alter_info@entry=0xffff8412fcf8, order_num=2215836944, order=<optimized out>, ignore=<optimized out>,
if_exists=<optimized out>) at /home/mysql/mariadb/sql/sql_alter.h:298
#9 0x0000aaaada603c94 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0xffff28000c68) at /home/mysql/mariadb/sql/structs.h:568
#10 0x0000aaaada507028 in mysql_execute_command (thd=thd@entry=0xffff28000c68, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)
at /home/mysql/mariadb/sql/sql_parse.cc:5733
#11 0x0000aaaada4f9760 in mysql_parse (thd=thd@entry=0xffff28000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>)
at /home/mysql/mariadb/sql/sql_parse.cc:7760
#12 0x0000aaaada50382c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0xffff28000c68,
packet=packet@entry=0xffff280087b9 "ALTER TABLE v0 LOCK SHARED , ORDER BY v0", packet_length=packet_length@entry=40, blocking=blocking@entry=true)
at /home/mysql/mariadb/sql/sql_class.h:1489
#13 0x0000aaaada505488 in do_command (thd=0xffff28000c68, blocking=blocking@entry=true) at /home/mysql/mariadb/sql/sql_parse.cc:1406
#14 0x0000aaaada5ff814 in do_handle_one_connection (connect=<optimized out>, put_in_cache=put_in_cache@entry=true) at /home/mysql/mariadb/sql/sql_connect.cc:1445
#15 0x0000aaaada5ffbf0 in handle_one_connection (arg=arg@entry=0xaaaae0a66aa8) at /home/mysql/mariadb/sql/sql_connect.cc:1347
#16 0x0000aaaada917698 in pfs_spawn_thread (arg=<optimized out>) at /home/mysql/mariadb/storage/perfschema/pfs.cc:2201
#17 0x0000ffff9ac3d624 in start_thread (arg=0xaaaada9175f8 <pfs_spawn_thread(void*)>) at pthread_create.c:477
#18 0x0000ffff9a8cc49c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78
```
Some other useful information:
```
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=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,sargable_casefold=on
The bug could corrupt the database, causing future MariaDB access to the same database to also crash. Therefore, I label the bug as `Critical`.
relates to
MDEV-31417
ASAN errors in ha_partition::create_handlers upon upgrading from MySQL 5.7 with partitioned tables
Closed
{"report":{"fcp":874.8000001907349,"ttfb":153.5,"pageVisibility":"visible","entityId":125011,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"ad91a4c4-5c6d-4da8-8908-b5d7f0ada345","navigationType":0,"readyForUser":947.6999998092651,"redirectCount":0,"resourceLoadedEnd":1116.3999996185303,"resourceLoadedStart":189.30000019073486,"resourceTiming":[{"duration":230.5999994277954,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":189.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":189.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":419.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":230.39999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":189.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":189.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":419.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":239.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":189.69999980926514,"connectEnd":189.69999980926514,"connectStart":189.69999980926514,"domainLookupEnd":189.69999980926514,"domainLookupStart":189.69999980926514,"fetchStart":189.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":189.69999980926514,"responseEnd":429.5,"responseStart":429.5,"secureConnectionStart":189.69999980926514},{"duration":265,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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","startTime":189.80000019073486,"connectEnd":189.80000019073486,"connectStart":189.80000019073486,"domainLookupEnd":189.80000019073486,"domainLookupStart":189.80000019073486,"fetchStart":189.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":189.80000019073486,"responseEnd":454.80000019073486,"responseStart":454.80000019073486,"secureConnectionStart":189.80000019073486},{"duration":268.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":189.89999961853027,"connectEnd":189.89999961853027,"connectStart":189.89999961853027,"domainLookupEnd":189.89999961853027,"domainLookupStart":189.89999961853027,"fetchStart":189.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":189.89999961853027,"responseEnd":458.69999980926514,"responseStart":458.69999980926514,"secureConnectionStart":189.89999961853027},{"duration":269.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":190,"connectEnd":190,"connectStart":190,"domainLookupEnd":190,"domainLookupStart":190,"fetchStart":190,"redirectEnd":0,"redirectStart":0,"requestStart":190,"responseEnd":459.0999994277954,"responseStart":459.0999994277954,"secureConnectionStart":190},{"duration":269.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":190.0999994277954,"connectEnd":190.0999994277954,"connectStart":190.0999994277954,"domainLookupEnd":190.0999994277954,"domainLookupStart":190.0999994277954,"fetchStart":190.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":190.0999994277954,"responseEnd":459.69999980926514,"responseStart":459.5999994277954,"secureConnectionStart":190.0999994277954},{"duration":270.1000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":190.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":190.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":460.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":269.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":190.30000019073486,"connectEnd":190.30000019073486,"connectStart":190.30000019073486,"domainLookupEnd":190.30000019073486,"domainLookupStart":190.30000019073486,"fetchStart":190.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":190.30000019073486,"responseEnd":460.19999980926514,"responseStart":460.19999980926514,"secureConnectionStart":190.30000019073486},{"duration":270.4000005722046,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":190.39999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":190.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":460.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":270.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":190.5999994277954,"connectEnd":190.5999994277954,"connectStart":190.5999994277954,"domainLookupEnd":190.5999994277954,"domainLookupStart":190.5999994277954,"fetchStart":190.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":190.5999994277954,"responseEnd":460.80000019073486,"responseStart":460.80000019073486,"secureConnectionStart":190.5999994277954},{"duration":751.9000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":191.39999961853027,"connectEnd":191.39999961853027,"connectStart":191.39999961853027,"domainLookupEnd":191.39999961853027,"domainLookupStart":191.39999961853027,"fetchStart":191.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":191.39999961853027,"responseEnd":943.3000001907349,"responseStart":943.3000001907349,"secureConnectionStart":191.39999961853027},{"duration":925,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":191.39999961853027,"connectEnd":191.39999961853027,"connectStart":191.39999961853027,"domainLookupEnd":191.39999961853027,"domainLookupStart":191.39999961853027,"fetchStart":191.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":191.39999961853027,"responseEnd":1116.3999996185303,"responseStart":1116.3999996185303,"secureConnectionStart":191.39999961853027},{"duration":444,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":671.8000001907349,"connectEnd":671.8000001907349,"connectStart":671.8000001907349,"domainLookupEnd":671.8000001907349,"domainLookupStart":671.8000001907349,"fetchStart":671.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":671.8000001907349,"responseEnd":1115.8000001907349,"responseStart":1115.8000001907349,"secureConnectionStart":671.8000001907349},{"duration":264.1000003814697,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":853.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":853.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1117.3000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":18,"responseStart":153,"responseEnd":170,"domLoading":186,"domInteractive":1141,"domContentLoadedEventStart":1141,"domContentLoadedEventEnd":1177,"domComplete":2113,"loadEventStart":2113,"loadEventEnd":2115,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1125.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1126.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1126.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1128.6999998092651},{"name":"activityTabFullyLoaded","time":1184.5}],"measures":[],"correlationId":"c4a161c0729fec","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":69,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}