rm -rf 89534 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/89534 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/89534 --early-plugin-load=keyring_file.so --keyring_file_data=$PWD/89534/keyring --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=$PWD/89534/log.err 2>&1 & -- Extracted steps from innodb.table_encrypt_kill [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/mysql-test: cat t/tt.test #------------------------------------------------------------------------------ # InnoDB transparent tablespace data encryption # This test case will test basic recovery. # Test does following # - runs command in parallel on encrypt table # - server is killed # - server restarted with same options #------------------------------------------------------------------------------ --source include/no_valgrind_without_big.inc --source include/have_innodb.inc --source include/not_embedded.inc # Avoid CrashReporter popup on Mac --source include/not_crashrep.inc #------------------------------------------------------------------------------ # Initial setup --disable_warnings DROP DATABASE IF EXISTS tde_db; DROP TABLE IF EXISTS tde_db. t_encrypt; CREATE DATABASE tde_db; USE tde_db; --enable_warnings SET GLOBAL innodb_file_per_table = 1; SELECT @@innodb_file_per_table; # Create a table with encryption CREATE TABLE tde_db.t_encrypt(c2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c3 CHAR(255) Default 'No text', c4 JSON , c5 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_a')) STORED, c6 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_b')) VIRTUAL, c7 POINT NOT NULL, spatial INDEX idx2 (c7) ) ENCRYPTION="Y" ENGINE = InnoDB; CREATE TABLE tde_db.t_non_encrypt(c2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c3 CHAR(255) Default 'No text', c4 JSON , c5 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_a')) STORED, c6 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_b')) VIRTUAL, c7 POINT NOT NULL, spatial INDEX idx2 (c7) ) ENGINE = InnoDB; DELIMITER |; CREATE PROCEDURE tde_db.populate_t_encrypt() begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO insert into tde_db.t_encrypt(c2,c3,c4,c7) VALUES(i,CONCAT(REPEAT('a',200),LPAD(CAST(i AS CHAR),4,'0')),'{ "key_a": 1, "key_b": 2, "key_c": 3 }',ST_GeomFromText('POINT(383293632 1754448)')); set i = i + 1; end while; end| CREATE PROCEDURE tde_db.populate_t_non_encrypt() begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO insert into tde_db.t_non_encrypt(c2,c3,c4,c7) VALUES(i,CONCAT(REPEAT('a',200),LPAD(CAST(i AS CHAR),4,'0')),'{ "key_a": 1, "key_b": 2, "key_c": 3 }',ST_GeomFromText('POINT(383293632 1754448)')); set i = i + 1; end while; end| CREATE PROCEDURE tde_db.update_t_encrypt() begin declare i int default 1; declare ustr varchar(1000); declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO SET @sql_text = CONCAT (" UPDATE tde_db.t_encrypt SET c3 ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ORDER BY RAND() LIMIT 1"); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.delete_t_encrypt() begin declare i int default 1; declare ustr varchar(1000); declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO SET @sql_text = CONCAT (' DELETE FROM tde_db.t_encrypt LIMIT 1'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.read_t_encrypt() begin declare i int default 1; while (i <= 5000) DO SELECT * FROM (SELECT * FROM tde_db.t_encrypt ORDER BY RAND() LIMIT 1) AS A WHERE A.c2 < 0 ; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.alter_t_encrypt() begin declare i int default 1; declare has_error int default 0; while (i <= 5000) DO ALTER INSTANCE ROTATE INNODB MASTER KEY; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.create_t_encrypt(encrypt VARCHAR(5), tcnt INT) begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1050 SET has_error = 1; SET i = tcnt ; while (i <= 5000) DO SET @sql_text = CONCAT('CREATE TABLE ',CONCAT('tde_db.t_encrypt_',encrypt,'_',i),' (c1 INT) ENCRYPTION="',encrypt,'"' ,' ENGINE=InnoDB'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| DELIMITER ;| SHOW CREATE TABLE tde_db.t_encrypt; call tde_db.populate_t_encrypt(); call tde_db.update_t_encrypt(); call tde_db.delete_t_encrypt(); call tde_db.read_t_encrypt(); -- create database test [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/mysql-test: ./mysql-test-run.pl --extern socket=/tmp/mysql_ushastry.sock tt Logging: ./mysql-test-run.pl --extern socket=/tmp/mysql_ushastry.sock tt MySQL Version 5.7.21 Checking supported features... - SSL connections supported Collecting tests... Using parallel: 1 ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 DROP DATABASE IF EXISTS tde_db; DROP TABLE IF EXISTS tde_db. t_encrypt; CREATE DATABASE tde_db; USE tde_db; SET GLOBAL innodb_file_per_table = 1; SELECT @@innodb_file_per_table; @@innodb_file_per_table 1 CREATE TABLE tde_db.t_encrypt(c2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c3 CHAR(255) Default 'No text', c4 JSON , c5 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_a')) STORED, c6 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_b')) VIRTUAL, c7 POINT NOT NULL, spatial INDEX idx2 (c7) ) ENCRYPTION="Y" ENGINE = InnoDB; CREATE TABLE tde_db.t_non_encrypt(c2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c3 CHAR(255) Default 'No text', c4 JSON , c5 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_a')) STORED, c6 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_b')) VIRTUAL, c7 POINT NOT NULL, spatial INDEX idx2 (c7) ) ENGINE = InnoDB; CREATE PROCEDURE tde_db.populate_t_encrypt() begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO insert into tde_db.t_encrypt(c2,c3,c4,c7) VALUES(i,CONCAT(REPEAT('a',200),LPAD(CAST(i AS CHAR),4,'0')),'{ "key_a": 1, "key_b": 2, "key_c": 3 }',ST_GeomFromText('POINT(383293632 1754448)')); set i = i + 1; end while; end| CREATE PROCEDURE tde_db.populate_t_non_encrypt() begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO insert into tde_db.t_non_encrypt(c2,c3,c4,c7) VALUES(i,CONCAT(REPEAT('a',200),LPAD(CAST(i AS CHAR),4,'0')),'{ "key_a": 1, "key_b": 2, "key_c": 3 }',ST_GeomFromText('POINT(383293632 1754448)')); set i = i + 1; end while; end| CREATE PROCEDURE tde_db.update_t_encrypt() begin declare i int default 1; declare ustr varchar(1000); declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO SET @sql_text = CONCAT (" UPDATE tde_db.t_encrypt SET c3 ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ORDER BY RAND() LIMIT 1"); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.delete_t_encrypt() begin declare i int default 1; declare ustr varchar(1000); declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO SET @sql_text = CONCAT (' DELETE FROM tde_db.t_encrypt LIMIT 1'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.read_t_encrypt() begin declare i int default 1; while (i <= 5000) DO SELECT * FROM (SELECT * FROM tde_db.t_encrypt ORDER BY RAND() LIMIT 1) AS A WHERE A.c2 < 0 ; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.alter_t_encrypt() begin declare i int default 1; declare has_error int default 0; while (i <= 5000) DO ALTER INSTANCE ROTATE INNODB MASTER KEY; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.create_t_encrypt(encrypt VARCHAR(5), tcnt INT) begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1050 SET has_error = 1; SET i = tcnt ; while (i <= 5000) DO SET @sql_text = CONCAT('CREATE TABLE ',CONCAT('tde_db.t_encrypt_',encrypt,'_',i),' (c1 INT) ENCRYPTION="',encrypt,'"' ,' ENGINE=InnoDB'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| SHOW CREATE TABLE tde_db.t_encrypt; Table Create Table t_encrypt CREATE TABLE `t_encrypt` ( `c2` int(11) NOT NULL AUTO_INCREMENT, `c3` char(255) DEFAULT 'No text', `c4` json DEFAULT NULL, `c5` int(11) GENERATED ALWAYS AS (json_extract(`c4`,'$.key_a')) STORED, `c6` int(11) GENERATED ALWAYS AS (json_extract(`c4`,'$.key_b')) VIRTUAL, `c7` point NOT NULL, PRIMARY KEY (`c2`), SPATIAL KEY `idx2` (`c7`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ENCRYPTION='Y' call tde_db.populate_t_encrypt(); call tde_db.update_t_encrypt(); call tde_db.delete_t_encrypt(); call tde_db.read_t_encrypt(); c2 c3 c4 c5 c6 c7 c2 c3 c4 c5 c6 c7 ^^ kill mysqld once above step is over umshastr 23157 2.8 0.0 1837276 219920 pts/2 Sl 09:35 0:26 bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21 --datadir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/89534 --early-plugin-load=keyring_file.so --keyring_file_data=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/89534/keyring --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/89534/log.err [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: kill -9 23157 -- restart without keyring [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/89534 --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=$PWD/89534/log.err 2>&1 & [1] 24577 [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: [1]+ Segmentation fault (core dumped) bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/89534 --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=$PWD/89534/log.err 2>&1 -- extract from error log 018-02-06T08:51:48.103909Z 0 [ERROR] InnoDB: Failed to find tablespace for table `tde_db`.`t_encrypt` in the cache. Attempting to load the tablespace with space id 43 2018-02-06T08:51:48.104030Z 0 [ERROR] InnoDB: Encryption can't find master key, please check the keyring plugin is loaded. 2018-02-06T08:51:48.104044Z 0 [ERROR] InnoDB: Encryption information in datafile: ./tde_db/t_encrypt.ibd can't be decrypted , please confirm the keyfile is match and keyring plugin is loaded. 08:51:48 UTC - mysqld got signal 11 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. Attempting to collect some information that could help diagnose the problem. As this is a crash and something is definitely wrong, the information collection process might fail. key_buffer_size=8388608 read_buffer_size=131072 max_used_connections=0 max_threads=151 thread_count=0 connection_count=0 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68193 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x7fcce40008c0 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 = 7fcced7fae20 thread_stack 0x40000 bin/mysqld(my_print_stacktrace+0x2c)[0xed741c] bin/mysqld(handle_fatal_signal+0x451)[0x7c3371] /lib64/libpthread.so.0(+0xf130)[0x7fcd113b9130] bin/mysqld(_Z28fil_space_is_being_truncatedm+0x77)[0x11548d7] bin/mysqld(_Z14row_purge_stepP9que_thr_t+0x273)[0x100c093] bin/mysqld(_Z15que_run_threadsP9que_thr_t+0x859)[0xfbb749] bin/mysqld(srv_worker_thread+0x455)[0x1041615] /lib64/libpthread.so.0(+0x7df5)[0x7fcd113b1df5] /lib64/libc.so.6(clone+0x6d)[0x7fcd0fdf660d] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (0): Connection ID (thread ID): 0 Status: NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. Writing a core file [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: gdb bin/mysqld 89534/core.24577 GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-64.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/bin/mysqld...done. Illegal process-id: 89534/core.24577. [New LWP 24597] [New LWP 24584] [New LWP 24577] [New LWP 24599] [New LWP 24582] [New LWP 24580] [New LWP 24586] [New LWP 24592] [New LWP 24595] [New LWP 24593] [New LWP 24594] [New LWP 24598] [New LWP 24581] [New LWP 24579] [New LWP 24583] [New LWP 24587] [New LWP 24578] [New LWP 24589] [New LWP 24585] [New LWP 24588] [New LWP 24596] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/GABuilds/mysql'. Program terminated with signal 11, Segmentation fault. #0 0x00007fcd113b6771 in pthread_kill () from /lib64/libpthread.so.0 warning: File "/export/umesh/server/binaries/tools/gcc-7_2/lib64/libstdc++.so.6.0.24-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py". To enable execution of this file add add-auto-load-safe-path /export/umesh/server/binaries/tools/gcc-7_2/lib64/libstdc++.so.6.0.24-gdb.py line to your configuration file "/home/umshastr/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/umshastr/.gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" Missing separate debuginfos, use: debuginfo-install glibc-2.17-78.0.1.el7.x86_64 libaio-0.3.109-12.el7.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 numactl-libs-2.0.9-5.el7_1.x86_64 (gdb) bt #0 0x00007fcd113b6771 in pthread_kill () from /lib64/libpthread.so.0 #1 0x00000000007c32e5 in handle_fatal_signal (sig=11) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/sql/signal_handler.cc:220 #2 #3 fil_space_is_being_truncated (id=43) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/fil/fil0fil.cc:1623 #4 0x000000000100c093 in row_purge_parse_undo_rec (thr=, updated_extern=0x7fcced7fac20, undo_rec=, node=) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/row/row0purge.cc:872 #5 row_purge (thr=0x7fcced7fac40, undo_rec=, node=) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/row/row0purge.cc:1043 #6 row_purge_step (thr=thr@entry=0x47dac98) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/row/row0purge.cc:1125 #7 0x0000000000fbb749 in que_thr_step (thr=0x6) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/que/que0que.cc:1053 #8 que_run_threads_low (thr=0x6) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/que/que0que.cc:1115 #9 que_run_threads (thr=thr@entry=0x47dac98) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/que/que0que.cc:1155 #10 0x0000000001041615 in srv_task_execute () at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/srv/srv0srv.cc:2472 #11 srv_worker_thread (arg=) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/srv/srv0srv.cc:2522 #12 0x00007fcd113b1df5 in start_thread () from /lib64/libpthread.so.0 #13 0x00007fcd0fdf660d in clone () from /lib64/libc.so.6 ############# second attempt rm -rf 89534 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/89534 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/89534 --early-plugin-load=keyring_file.so --keyring_file_data=$PWD/89534/keyring --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=$PWD/89534/log.err 2>&1 & [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: bin/mysql -uroot -S /tmp/mysql_ushastry.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.21-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database test; Query OK, 1 row affected (0.00 sec) -- invoke mtr against running server and run tt, once tt test is over, kill -9 mysqld [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/mysql-test: ./mysql-test-run.pl --extern socket=/tmp/mysql_ushastry.sock tt Logging: ./mysql-test-run.pl --extern socket=/tmp/mysql_ushastry.sock tt MySQL Version 5.7.21 Checking supported features... - SSL connections supported Collecting tests... Using parallel: 1 ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 DROP DATABASE IF EXISTS tde_db; DROP TABLE IF EXISTS tde_db. t_encrypt; CREATE DATABASE tde_db; USE tde_db; SET GLOBAL innodb_file_per_table = 1; SELECT @@innodb_file_per_table; @@innodb_file_per_table 1 CREATE TABLE tde_db.t_encrypt(c2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c3 CHAR(255) Default 'No text', c4 JSON , c5 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_a')) STORED, c6 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_b')) VIRTUAL, c7 POINT NOT NULL, spatial INDEX idx2 (c7) ) ENCRYPTION="Y" ENGINE = InnoDB; CREATE TABLE tde_db.t_non_encrypt(c2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c3 CHAR(255) Default 'No text', c4 JSON , c5 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_a')) STORED, c6 INT GENERATED ALWAYS AS (JSON_EXTRACT(c4,'$.key_b')) VIRTUAL, c7 POINT NOT NULL, spatial INDEX idx2 (c7) ) ENGINE = InnoDB; CREATE PROCEDURE tde_db.populate_t_encrypt() begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO insert into tde_db.t_encrypt(c2,c3,c4,c7) VALUES(i,CONCAT(REPEAT('a',200),LPAD(CAST(i AS CHAR),4,'0')),'{ "key_a": 1, "key_b": 2, "key_c": 3 }',ST_GeomFromText('POINT(383293632 1754448)')); set i = i + 1; end while; end| CREATE PROCEDURE tde_db.populate_t_non_encrypt() begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO insert into tde_db.t_non_encrypt(c2,c3,c4,c7) VALUES(i,CONCAT(REPEAT('a',200),LPAD(CAST(i AS CHAR),4,'0')),'{ "key_a": 1, "key_b": 2, "key_c": 3 }',ST_GeomFromText('POINT(383293632 1754448)')); set i = i + 1; end while; end| CREATE PROCEDURE tde_db.update_t_encrypt() begin declare i int default 1; declare ustr varchar(1000); declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO SET @sql_text = CONCAT (" UPDATE tde_db.t_encrypt SET c3 ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ORDER BY RAND() LIMIT 1"); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.delete_t_encrypt() begin declare i int default 1; declare ustr varchar(1000); declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1062 SET has_error = 1; while (i <= 5000) DO SET @sql_text = CONCAT (' DELETE FROM tde_db.t_encrypt LIMIT 1'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.read_t_encrypt() begin declare i int default 1; while (i <= 5000) DO SELECT * FROM (SELECT * FROM tde_db.t_encrypt ORDER BY RAND() LIMIT 1) AS A WHERE A.c2 < 0 ; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.alter_t_encrypt() begin declare i int default 1; declare has_error int default 0; while (i <= 5000) DO ALTER INSTANCE ROTATE INNODB MASTER KEY; set i = i + 1; end while; end| CREATE PROCEDURE tde_db.create_t_encrypt(encrypt VARCHAR(5), tcnt INT) begin declare i int default 1; declare has_error int default 0; DECLARE CONTINUE HANDLER FOR 1050 SET has_error = 1; SET i = tcnt ; while (i <= 5000) DO SET @sql_text = CONCAT('CREATE TABLE ',CONCAT('tde_db.t_encrypt_',encrypt,'_',i),' (c1 INT) ENCRYPTION="',encrypt,'"' ,' ENGINE=InnoDB'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; set i = i + 1; end while; end| SHOW CREATE TABLE tde_db.t_encrypt; Table Create Table t_encrypt CREATE TABLE `t_encrypt` ( `c2` int(11) NOT NULL AUTO_INCREMENT, `c3` char(255) DEFAULT 'No text', `c4` json DEFAULT NULL, `c5` int(11) GENERATED ALWAYS AS (json_extract(`c4`,'$.key_a')) STORED, `c6` int(11) GENERATED ALWAYS AS (json_extract(`c4`,'$.key_b')) VIRTUAL, `c7` point NOT NULL, PRIMARY KEY (`c2`), SPATIAL KEY `idx2` (`c7`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ENCRYPTION='Y' call tde_db.populate_t_encrypt(); call tde_db.update_t_encrypt(); call tde_db.delete_t_encrypt(); call tde_db.read_t_encrypt(); c2 c3 c4 c5 c6 c7 c2 c3 c4 c5 c6 c7 c2 c3 c4 c5 c6 c7 . c2 c3 c4 c5 c6 c7 c2 c3 c4 c5 c6 c7 main.tt [ pass ] 52051 -------------------------------------------------------------------------- The servers were restarted 0 times Spent 52.051 of 53 seconds executing testcases Completed: All 1 tests were successful. kill mysqld umshastr 25003 0.2 0.0 1311944 174360 pts/2 Sl 09:58 0:00 bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21 --datadir=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/89534 --early-plugin-load=keyring_file.so --keyring_file_data=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/89534/keyring --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/89534/log.err umshastr 25389 0.0 0.0 112636 972 pts/8 S+ 10:00 0:00 grep --color=auto mysqld [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: kill -9 25003 -- restart without keyring [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/89534 --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=$PWD/89534/log.err 2>&1 & [1] 25425 [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: [1]+ Segmentation fault (core dumped) bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/89534 --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=$PWD/89534/log.err 2>&1 [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21: gdb bin/mysqld 89534/core.25425 GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-64.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /export/umesh/server/binaries/GABuilds/mysql-advanced-5.7.21/bin/mysqld...done. Illegal process-id: 89534/core.25425. [New LWP 25445] [New LWP 25436] [New LWP 25442] [New LWP 25443] [New LWP 25440] [New LWP 25446] [New LWP 25426] [New LWP 25427] [New LWP 25429] [New LWP 25433] [New LWP 25434] [New LWP 25425] [New LWP 25447] [New LWP 25435] [New LWP 25444] [New LWP 25428] [New LWP 25437] [New LWP 25432] [New LWP 25441] [New LWP 25430] [New LWP 25431] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/GABuilds/mysql'. Program terminated with signal 11, Segmentation fault. #0 0x00007f0cf0c65771 in pthread_kill () from /lib64/libpthread.so.0 warning: File "/export/umesh/server/binaries/tools/gcc-7_2/lib64/libstdc++.so.6.0.24-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py". To enable execution of this file add add-auto-load-safe-path /export/umesh/server/binaries/tools/gcc-7_2/lib64/libstdc++.so.6.0.24-gdb.py line to your configuration file "/home/umshastr/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/umshastr/.gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" Missing separate debuginfos, use: debuginfo-install glibc-2.17-78.0.1.el7.x86_64 libaio-0.3.109-12.el7.x86_64 nss-softokn-freebl-3.16.2.3-13.el7_1.x86_64 numactl-libs-2.0.9-5.el7_1.x86_64 (gdb) bt #0 0x00007f0cf0c65771 in pthread_kill () from /lib64/libpthread.so.0 #1 0x00000000007c32e5 in handle_fatal_signal (sig=11) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/sql/signal_handler.cc:220 #2 #3 fil_space_is_being_truncated (id=23) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/fil/fil0fil.cc:1623 #4 0x000000000100c093 in row_purge_parse_undo_rec (thr=, updated_extern=0x7f0cccdf9c20, undo_rec=, node=) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/row/row0purge.cc:872 #5 row_purge (thr=0x7f0cccdf9c40, undo_rec=, node=) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/row/row0purge.cc:1043 #6 row_purge_step (thr=thr@entry=0x3789800) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/row/row0purge.cc:1125 #7 0x0000000000fbb749 in que_thr_step (thr=0x6) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/que/que0que.cc:1053 #8 que_run_threads_low (thr=0x6) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/que/que0que.cc:1115 #9 que_run_threads (thr=thr@entry=0x3789800) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/que/que0que.cc:1155 #10 0x0000000001041615 in srv_task_execute () at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/srv/srv0srv.cc:2472 #11 srv_worker_thread (arg=) at /export/home/pb2/build/sb_0-25673884-1510161542.84/mysqlcom-pro-5.7.21/storage/innobase/srv/srv0srv.cc:2522 #12 0x00007f0cf0c60df5 in start_thread () from /lib64/libpthread.so.0 #13 0x00007f0cef6a560d in clone () from /lib64/libc.so.6