Create encrypted table using some keys
Restart server with different keys and innodb-defragment=1
optimize table (defragment table)
Stack:
hread pointer: 0x0x7f3388c63060
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7f337c2bfe70 thread_stack 0x48000
mysys/stacktrace.c:246(my_print_stacktrace)[0x7f33854f6993]
sql/signal_handler.cc:162(handle_fatal_signal)[0x7f3384ea2098]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0)[0x7f338439a8d0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f33820ef107]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f33820f04e8]
include/btr0btr.ic:124(btr_page_get_level_low)[0x7f3385290787]
btr/btr0defragment.cc:221(btr_defragment_add_index(dict_index_t*, bool))[0x7f33852917a2]
handler/ha_innodb.cc:12703(ha_innobase::defragment_table(char const*, char const*, bool))[0x7f33850b310c]
handler/ha_innodb.cc:13920(ha_innobase::optimize(THD*, st_ha_check_opt*))[0x7f33850b54eb]
sql/handler.cc:4067(handler::ha_optimize(THD*, st_ha_check_opt*))[0x7f3384eac0c3]
sql/sql_admin.cc:750(mysql_admin_table)[0x7f3384db4e99]
sql/sql_admin.cc:1246(Sql_cmd_optimize_table::execute(THD*))[0x7f3384db6c2a]
sql/sql_parse.cc:5611(mysql_execute_command(THD*))[0x7f3384c7f35d]
sql/sql_parse.cc:7214(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x7f3384c83471]
sql/sql_parse.cc:1477(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x7f3384c7246f]
sql/sql_parse.cc:1097(do_command(THD*))[0x7f3384c711a5]
sql/sql_connect.cc:1350(do_handle_one_connection(THD*))[0x7f3384da3b98]
sql/sql_connect.cc:1263(handle_one_connection)[0x7f3384da38fc]
perfschema/pfs.cc:1862(pfs_spawn_thread)[0x7f33850859d8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)[0x7f33843930a4]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f33821a004d]
Test case:
--source include/have_innodb.inc
# embedded does not support restart
-- source include/not_embedded.inc
-- source include/not_valgrind.inc
# Avoid CrashReporter popup on Mac
-- source include/not_crashrep.inc
#
# MDEV-8750: Server crashes in page_cur_is_after_last on altering table using a wrong encryption key
#
call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--write_file $MYSQLTEST_VARDIR/keys1.txt
1;770A8A65DA156D24EE2A093277530142
4;770A8A65DA156D24EE2A093277530143
EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
--let $MYSQLD_DATADIR = `SELECT @@datadir`
--disable_query_log
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
--enable_query_log
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--write_file $MYSQLTEST_VARDIR/keys2.txt
1;770A8A65DA156D24EE2A093277530142
4;770A8A65DA156D24EE2A093277530144
EOF
--exec echo "restart:--innodb-encrypt-tables --innodb-defragment=1 --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
OPTIMIZE TABLE t1;
--remove_file $MYSQLTEST_VARDIR/keys1.txt
--remove_file $MYSQLTEST_VARDIR/keys2.txt
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
--enable_query_log
Jan Lindström (Inactive)
made changes -
2015-09-14 12:17
Fix Version/s
10.1.8
[ 19605
]
Fix Version/s
10.1
[ 16100
]
Resolution
Fixed
[ 1
]
Status
In Progress
[ 3
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2021-12-06 21:42
Workflow
MariaDB v3
[ 71413
]
MariaDB v4
[ 149591
]
{"report":{"fcp":2025.0999999046326,"ttfb":842,"pageVisibility":"visible","entityId":53013,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"a797f5db-a462-4f42-b970-9510e524f632","navigationType":0,"readyForUser":2119,"redirectCount":0,"resourceLoadedEnd":1879.1999998092651,"resourceLoadedStart":847.8999996185303,"resourceTiming":[{"duration":561,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":847.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":847.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1408.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":561.4000000953674,"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":848.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":848.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1409.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":758.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":848.3999996185303,"connectEnd":848.3999996185303,"connectStart":848.3999996185303,"domainLookupEnd":848.3999996185303,"domainLookupStart":848.3999996185303,"fetchStart":848.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1415.0999999046326,"responseEnd":1607,"responseStart":1438.5,"secureConnectionStart":848.3999996185303},{"duration":886,"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":848.5999999046326,"connectEnd":848.5999999046326,"connectStart":848.5999999046326,"domainLookupEnd":848.5999999046326,"domainLookupStart":848.5999999046326,"fetchStart":848.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1414.5,"responseEnd":1734.5999999046326,"responseStart":1437.5,"secureConnectionStart":848.5999999046326},{"duration":603.2000002861023,"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":848.7999997138977,"connectEnd":848.7999997138977,"connectStart":848.7999997138977,"domainLookupEnd":848.7999997138977,"domainLookupStart":848.7999997138977,"fetchStart":848.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1415.1999998092651,"responseEnd":1452,"responseStart":1446.7999997138977,"secureConnectionStart":848.7999997138977},{"duration":599.1000003814697,"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":848.8999996185303,"connectEnd":848.8999996185303,"connectStart":848.8999996185303,"domainLookupEnd":848.8999996185303,"domainLookupStart":848.8999996185303,"fetchStart":848.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1415.7999997138977,"responseEnd":1448,"responseStart":1445.1999998092651,"secureConnectionStart":848.8999996185303},{"duration":603.0999999046326,"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":849.0999999046326,"connectEnd":849.0999999046326,"connectStart":849.0999999046326,"domainLookupEnd":849.0999999046326,"domainLookupStart":849.0999999046326,"fetchStart":849.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1416.1999998092651,"responseEnd":1452.1999998092651,"responseStart":1448.0999999046326,"secureConnectionStart":849.0999999046326},{"duration":564.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":849.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":849.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1414.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":603.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":849.5,"connectEnd":849.5,"connectStart":849.5,"domainLookupEnd":849.5,"domainLookupStart":849.5,"fetchStart":849.5,"redirectEnd":0,"redirectStart":0,"requestStart":1417.1999998092651,"responseEnd":1452.5999999046326,"responseStart":1449,"secureConnectionStart":849.5},{"duration":567,"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":849.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":849.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1416.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":603.0999999046326,"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":849.7999997138977,"connectEnd":849.7999997138977,"connectStart":849.7999997138977,"domainLookupEnd":849.7999997138977,"domainLookupStart":849.7999997138977,"fetchStart":849.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1420.5,"responseEnd":1452.8999996185303,"responseStart":1450.0999999046326,"secureConnectionStart":849.7999997138977},{"duration":880.3000001907349,"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":855.2999997138977,"connectEnd":855.2999997138977,"connectStart":855.2999997138977,"domainLookupEnd":855.2999997138977,"domainLookupStart":855.2999997138977,"fetchStart":855.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1715,"responseEnd":1735.5999999046326,"responseStart":1732.8999996185303,"secureConnectionStart":855.2999997138977},{"duration":1023.8000001907349,"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":855.3999996185303,"connectEnd":855.3999996185303,"connectStart":855.3999996185303,"domainLookupEnd":855.3999996185303,"domainLookupStart":855.3999996185303,"fetchStart":855.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1865.8999996185303,"responseEnd":1879.1999998092651,"responseStart":1878.0999999046326,"secureConnectionStart":855.3999996185303},{"duration":174.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1735,"connectEnd":1735,"connectStart":1735,"domainLookupEnd":1735,"domainLookupStart":1735,"fetchStart":1735,"redirectEnd":0,"redirectStart":0,"requestStart":1871.5,"responseEnd":1909.3999996185303,"responseStart":1908.6999998092651,"secureConnectionStart":1735},{"duration":199.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1960.5999999046326,"connectEnd":1960.5999999046326,"connectStart":1960.5999999046326,"domainLookupEnd":1960.5999999046326,"domainLookupStart":1960.5999999046326,"fetchStart":1960.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":2122.7999997138977,"responseEnd":2159.699999809265,"responseStart":2158.8999996185303,"secureConnectionStart":1960.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":637,"responseStart":842,"responseEnd":847,"domLoading":845,"domInteractive":2230,"domContentLoadedEventStart":2230,"domContentLoadedEventEnd":2302,"domComplete":2653,"loadEventStart":2653,"loadEventEnd":2654,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2203.8999996185303},{"name":"bigPipe.sidebar-id.end","time":2204.699999809265},{"name":"bigPipe.activity-panel-pipe-id.start","time":2204.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":2207.0999999046326},{"name":"activityTabFullyLoaded","time":2318.7999997138977}],"measures":[],"correlationId":"9fe0c37e52988d","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":128,"dbReadsTimeInMs":15,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
commit ddaddf1019f07f00ba419988f69f8cb9ebd3e169
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Mon Sep 14 12:15:27 2015 +0300
MDEV-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keysAdd error handling when getting block from encrypted table and decryption
fails.