Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.7(EOL)
Whereas this bug is very similar and likely related to MDEV-22883 and MDEV-18496 in that there is something very Aria-specific happening. In InnoDB:
10.5.6 2bac9782aa81ad386beaf00eb126ccf2d15031a1 (Debug)
10.5.6>USE test;
Database changed
10.5.6>SET SQL_MODE='';
Query OK, 0 rows affected (0.000 sec)
10.5.6>CREATE TABLE t (C1 CHAR (1) PRIMARY KEY, FOREIGN KEY(C1) REFERENCES t (C1)) ENGINE=InnoDB;
ERROR 1005 (HY000): Can't create table `test`.`t` (errno: 150 "Foreign key constraint is incorrectly formed")
And in Aria:
10.5.6 2bac9782aa81ad386beaf00eb126ccf2d15031a1 (Debug)
10.5.6>USE test;
Database changed
10.5.6>SET SQL_MODE='';
Query OK, 0 rows affected (0.000 sec)
10.5.6>CREATE TABLE t (C1 CHAR (1) PRIMARY KEY, FOREIGN KEY(C1) REFERENCES t (C1)) ENGINE=Aria;
Query OK, 0 rows affected (0.011 sec)
Note that no encryption is used, and Aria allowed the FK reference which InnoDB rejects.
The surrounding issue is that a crash can be generated if encryption is enabled.
USE test;
SET SQL_MODE='';
SET GLOBAL aria_encrypt_tables=ON;
CREATE TABLE t (C1 CHAR (1) PRIMARY KEY, FOREIGN KEY(C1) REFERENCES t (C1)) ENGINE=Aria;
CREATE TRIGGER tr1_bi BEFORE INSERT ON t FOR EACH ROW SET @a:=1;
INSERT INTO t VALUES (str_to_date ('abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'));
RENAME TABLE t TO t3,t TO t,t2 TO t;
Leads to:
10.5.6 2bac9782aa81ad386beaf00eb126ccf2d15031a1 (Debug)
mysqld: /test/10.5_dbg/sql/sql_trigger.cc:1460: static bool Table_triggers_list::check_n_load(THD*, const LEX_CSTRING*, const LEX_CSTRING*, TABLE*, bool): Assertion `!parse_error || lex.sphead == 0' failed.
10.5.6 2bac9782aa81ad386beaf00eb126ccf2d15031a1 (Debug)
Core was generated by `/test/MD150920-mariadb-10.5.6-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x14fd8fd15700 (LWP 3550511))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1 0x000055e157f8985a in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:424
#2 0x000055e1577503a9 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
#3 <signal handler called>
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5 0x000014fd8dfab8b1 in __GI_abort () at abort.c:79
#6 0x000014fd8df9b42a in __assert_fail_base (fmt=0x14fd8e122a38 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55e158127f60 "!parse_error || lex.sphead == 0", file=file@entry=0x55e158127bc0 "/test/10.5_dbg/sql/sql_trigger.cc", line=line@entry=1460, function=function@entry=0x55e1581288e0 <Table_triggers_list::check_n_load(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, TABLE*, bool)::__PRETTY_FUNCTION__> "static bool Table_triggers_list::check_n_load(THD*, const LEX_CSTRING*, const LEX_CSTRING*, TABLE*, bool)") at assert.c:92
#7 0x000014fd8df9b4a2 in __GI___assert_fail (assertion=assertion@entry=0x55e158127f60 "!parse_error || lex.sphead == 0", file=file@entry=0x55e158127bc0 "/test/10.5_dbg/sql/sql_trigger.cc", line=line@entry=1460, function=function@entry=0x55e1581288e0 <Table_triggers_list::check_n_load(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, TABLE*, bool)::__PRETTY_FUNCTION__> "static bool Table_triggers_list::check_n_load(THD*, const LEX_CSTRING*, const LEX_CSTRING*, TABLE*, bool)") at assert.c:101
#8 0x000055e157580e98 in Table_triggers_list::check_n_load (thd=thd@entry=0x14fd6bc15088, db=db@entry=0x14fd6bc741e0, table_name=table_name@entry=0x14fd6bc741f0, table=table@entry=0x14fd8fd134c0, names_only=names_only@entry=true) at /test/10.5_dbg/sql/sql_trigger.cc:1460
#9 0x000055e157581eb6 in Table_triggers_list::change_table_name (thd=thd@entry=0x14fd6bc15088, db=db@entry=0x14fd6bc741e0, old_alias=old_alias@entry=0x14fd8fd13a00, old_table=old_table@entry=0x14fd6bc741f0, new_db=new_db@entry=0x14fd6bc748c0, new_table=new_table@entry=0x14fd8fd13a10) at /test/10.5_dbg/sql/sql_trigger.cc:2106
#10 0x000055e1574c6a4f in do_rename (force_if_exists=0x14fd8fd13adf, if_exists=false, skip_error=false, new_table_alias=0x14fd6bc748f0, new_table_name=0x14fd6bc748d0, new_db=0x14fd6bc748c0, ren_table=0x14fd6bc741c8, thd=0x14fd6bc15088) at /test/10.5_dbg/sql/sql_rename.cc:345
#11 rename_tables (thd=thd@entry=0x14fd6bc15088, table_list=table_list@entry=0x14fd6bc741c8, skip_error=skip_error@entry=false, if_exists=if_exists@entry=false, force_if_exists=force_if_exists@entry=0x14fd8fd13adf) at /test/10.5_dbg/sql/sql_rename.cc:421
#12 0x000055e1574c6dbb in mysql_rename_tables (thd=thd@entry=0x14fd6bc15088, table_list=table_list@entry=0x14fd6bc741c8, silent=silent@entry=false, if_exists=<optimized out>) at /test/10.5_dbg/sql/sql_rename.cc:159
#13 0x000055e15749e279 in mysql_execute_command (thd=thd@entry=0x14fd6bc15088) at /test/10.5_dbg/sql/sql_parse.cc:4314
#14 0x000055e1574aa324 in mysql_parse (thd=thd@entry=0x14fd6bc15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14fd8fd14350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7994
#15 0x000055e157496d54 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14fd6bc15088, packet=packet@entry=0x14fd6bc67089 "RENAME TABLE t TO t3,t TO t,t2 TO t", packet_length=packet_length@entry=35, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1867
#16 0x000055e15749553e in do_command (thd=0x14fd6bc15088) at /test/10.5_dbg/sql/sql_parse.cc:1348
#17 0x000055e1575f4893 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x14fd6f0d4808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1410
#18 0x000055e1575f4fb7 in handle_one_connection (arg=arg@entry=0x14fd6f0d4808) at /test/10.5_dbg/sql/sql_connect.cc:1312
#19 0x000055e157a5f5c2 in pfs_spawn_thread (arg=0x14fd8c846508) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#20 0x000014fd8ec8e6db in start_thread (arg=0x14fd8fd15700) at pthread_create.c:463
#21 0x000014fd8e08ca3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.1.47 (dbg), 10.2.34 (dbg), 10.3.25 (dbg), 10.4.15 (dbg), 10.5.6 (dbg), 10.6.0 (dbg), 10.7.0 (dbg)
Bug confirmed not present in:
MariaDB: 10.1.47 (opt), 10.2.34 (opt), 10.3.25 (opt), 10.4.15 (opt), 10.5.6 (opt), 10.6.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.49 (dbg), 5.6.49 (opt), 5.7.31 (dbg), 5.7.31 (opt), 8.0.21 (dbg), 8.0.21 (opt)
{"report":{"fcp":1027.7999992370605,"ttfb":255,"pageVisibility":"visible","entityId":92859,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"9ba859f1-0b61-4f4e-b789-c85bf1b29039","navigationType":0,"readyForUser":1110.1999998092651,"redirectCount":0,"resourceLoadedEnd":1574,"resourceLoadedStart":261.19999980926514,"resourceTiming":[{"duration":305.5999994277954,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":261.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":261.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":566.7999992370605,"responseStart":0,"secureConnectionStart":0},{"duration":305.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":261.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":261.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":567.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":317,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":261.5999994277954,"connectEnd":261.5999994277954,"connectStart":261.5999994277954,"domainLookupEnd":261.5999994277954,"domainLookupStart":261.5999994277954,"fetchStart":261.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":261.5999994277954,"responseEnd":578.5999994277954,"responseStart":578.5999994277954,"secureConnectionStart":261.5999994277954},{"duration":411,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":261.79999923706055,"connectEnd":261.79999923706055,"connectStart":261.79999923706055,"domainLookupEnd":261.79999923706055,"domainLookupStart":261.79999923706055,"fetchStart":261.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":261.79999923706055,"responseEnd":672.7999992370605,"responseStart":672.7999992370605,"secureConnectionStart":261.79999923706055},{"duration":414.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":261.8999996185303,"connectEnd":261.8999996185303,"connectStart":261.8999996185303,"domainLookupEnd":261.8999996185303,"domainLookupStart":261.8999996185303,"fetchStart":261.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":261.8999996185303,"responseEnd":676.5999994277954,"responseStart":676.5999994277954,"secureConnectionStart":261.8999996185303},{"duration":414.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":262.19999980926514,"connectEnd":262.19999980926514,"connectStart":262.19999980926514,"domainLookupEnd":262.19999980926514,"domainLookupStart":262.19999980926514,"fetchStart":262.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":262.19999980926514,"responseEnd":677,"responseStart":677,"secureConnectionStart":262.19999980926514},{"duration":415.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":262.3999996185303,"connectEnd":262.3999996185303,"connectStart":262.3999996185303,"domainLookupEnd":262.3999996185303,"domainLookupStart":262.3999996185303,"fetchStart":262.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":262.3999996185303,"responseEnd":677.7999992370605,"responseStart":677.7999992370605,"secureConnectionStart":262.3999996185303},{"duration":457,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":262.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":719.5,"responseStart":0,"secureConnectionStart":0},{"duration":415.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":262.69999980926514,"connectEnd":262.69999980926514,"connectStart":262.69999980926514,"domainLookupEnd":262.69999980926514,"domainLookupStart":262.69999980926514,"fetchStart":262.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":262.69999980926514,"responseEnd":678.5999994277954,"responseStart":678.5999994277954,"secureConnectionStart":262.69999980926514},{"duration":456.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":262.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":719.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":417.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":263,"connectEnd":263,"connectStart":263,"domainLookupEnd":263,"domainLookupStart":263,"fetchStart":263,"redirectEnd":0,"redirectStart":0,"requestStart":263,"responseEnd":680.1999998092651,"responseStart":680.1999998092651,"secureConnectionStart":263},{"duration":759.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":263.8999996185303,"connectEnd":263.8999996185303,"connectStart":263.8999996185303,"domainLookupEnd":263.8999996185303,"domainLookupStart":263.8999996185303,"fetchStart":263.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":263.8999996185303,"responseEnd":1023.2999992370605,"responseStart":1023.2999992370605,"secureConnectionStart":263.8999996185303},{"duration":1310,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":264,"connectEnd":264,"connectStart":264,"domainLookupEnd":264,"domainLookupStart":264,"fetchStart":264,"redirectEnd":0,"redirectStart":0,"requestStart":264,"responseEnd":1574,"responseStart":1574,"secureConnectionStart":264},{"duration":293.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":731.3999996185303,"connectEnd":731.3999996185303,"connectStart":731.3999996185303,"domainLookupEnd":731.3999996185303,"domainLookupStart":731.3999996185303,"fetchStart":731.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":731.3999996185303,"responseEnd":1024.5999994277954,"responseStart":1024.5999994277954,"secureConnectionStart":731.3999996185303}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":92,"responseStart":255,"responseEnd":258,"domLoading":259,"domInteractive":1596,"domContentLoadedEventStart":1596,"domContentLoadedEventEnd":1637,"domComplete":3000,"loadEventStart":3000,"loadEventEnd":3002,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1578.7999992370605},{"name":"bigPipe.sidebar-id.end","time":1579.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1579.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1582.2999992370605},{"name":"activityTabFullyLoaded","time":1644}],"measures":[],"correlationId":"4858bdeb590b6","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":92,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}