[MDEV-28154] parts.alter_table fails on hfs+, Assertion `mdl_namespace_arg == USER_LOCK || ok_for_lower_case_names(db)' failed in MDL_key::mdl_key_init Created: 2022-03-23  Updated: 2022-03-23

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Alice Sherepa Assignee: Alice Sherepa
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-9089 Server crashes in MDL_key::mdl_key_in... Closed

 Description   

Ubuntu 20.04 + partition formatted as hfsplus:
10.8 f6fcf827b379fc069563d18. I did not try on the other versions.

parts.alter_table 'aria,innodb,lcase2,range' [ fail ]
        Test ended at 2022-03-23 10:09:38
 
CURRENT_TEST: parts.alter_table
mysqltest: At line 213: query 'alter table t1 convert partition p3 to table EXISTENT.TP3' failed: <Unknown> (2013): Lost connection to server during query
 
The result from queries just before the failure was:
< snip >
t1	CREATE TABLE `t1` (
  `x` int(11) DEFAULT NULL
) ENGINE=X DEFAULT CHARSET=latin1
 PARTITION BY RANGE (`x`)
(PARTITION `p1` VALUES LESS THAN (10) ENGINE = X,
 PARTITION `p3` VALUES LESS THAN (30) ENGINE = X,
 PARTITION `p4` VALUES LESS THAN (40) ENGINE = X,
 PARTITION `p5` VALUES LESS THAN (50) ENGINE = X,
 PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = X)
select * from t1 order by x;
x
2
22
32
42
52
alter table t1 convert partition p3 to table inexistent.tp3;
ERROR 42000: Unknown database 'inexistent'
create database EXISTENT;
alter table t1 convert partition p3 to table EXISTENT.TP3;
 
More results from queries before failure can be found in /10.8/mysql-test/var/log/alter_table.log
 
 
Server [mysqld.1 - pid: 570375, winpid: 570375, exit: 256] failed during test run
Server log from this test:
----------SERVER LOG START-----------
$ /10.8/sql/mariadbd --defaults-group-suffix=.1 --defaults-file=/10.8/mysql-test/var/my.cnf --log-output=file --innodb --innodb-cmpmem --innodb-cmp-per-index --innodb-trx --innodb-locks --innodb-lock-waits --innodb-metrics --innodb-buffer-pool-stats --innodb-buffer-page --innodb-buffer-page-lru --innodb-sys-columns --innodb-sys-fields --innodb-sys-foreign --innodb-sys-foreign-cols --innodb-sys-indexes --innodb-sys-tables --innodb-sys-virtual --lower_case_table_names=2 --default-storage-engine=aria --loose-enable-partition --core-file --loose-debug-sync-timeout=300
2022-03-23 10:09:37 0 [Note] /10.8/sql/mariadbd (server 10.8.3-MariaDB-debug-log) starting as process 570376 ...
2022-03-23 10:09:37 0 [Warning] Could not increase number of max_open_files to more than 1024 (request: 32190)
2022-03-23 10:09:37 0 [Warning] Changed limits: max_open_files: 1024  max_connections: 151 (was 151)  table_cache: 421 (was 2000)
2022-03-23 10:09:37 0 [Note] Plugin 'SEQUENCE' is disabled.
2022-03-23 10:09:37 0 [Note] InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
2022-03-23 10:09:37 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-03-23 10:09:37 0 [Note] InnoDB: Number of transaction pools: 1
2022-03-23 10:09:37 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-03-23 10:09:37 0 [Note] mariadbd: O_TMPFILE is not supported on /10.8/mysql-test/var/tmp/mysqld.1 (disabling future attempts)
2022-03-23 10:09:37 0 [Note] InnoDB: Using Linux native AIO
2022-03-23 10:09:37 0 [Note] InnoDB: Initializing buffer pool, total size = 8.000MiB, chunk size = 1.000MiB
2022-03-23 10:09:37 0 [Note] InnoDB: Completed initialization of buffer pool
2022-03-23 10:09:37 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2022-03-23 10:09:37 0 [Note] InnoDB: 128 rollback segments are active.
2022-03-23 10:09:37 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2022-03-23 10:09:37 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2022-03-23 10:09:37 0 [Note] InnoDB: log sequence number 48725; transaction id 17
2022-03-23 10:09:37 0 [Note] InnoDB: Loading buffer pool(s) from /10.8/mysql-test/var/mysqld.1/data/ib_buffer_pool
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_FT_CONFIG' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_SYS_TABLESTATS' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_FT_DELETED' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_CMP' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'THREAD_POOL_WAITS' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_CMP_RESET' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'THREAD_POOL_QUEUES' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_FT_INDEX_TABLE' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'THREAD_POOL_GROUPS' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_CMP_PER_INDEX_RESET' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_FT_INDEX_CACHE' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_FT_BEING_DELETED' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_CMPMEM_RESET' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_FT_DEFAULT_STOPWORD' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_SYS_TABLESPACES' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'user_variables' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'INNODB_TABLESPACES_ENCRYPTION' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'THREAD_POOL_STATS' is disabled.
2022-03-23 10:09:37 0 [Note] Plugin 'unix_socket' is disabled.
2022-03-23 10:09:37 0 [Warning] /10.8/sql/mariadbd: unknown option '--loose-pam-debug'
2022-03-23 10:09:37 0 [Warning] /10.8/sql/mariadbd: unknown option '--loose-aria'
2022-03-23 10:09:37 0 [Note] InnoDB: Buffer pool(s) load completed at 220323 10:09:37
2022-03-23 10:09:37 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-03-23 10:09:37 0 [Note] /10.8/sql/mariadbd: ready for connections.
Version: '10.8.3-MariaDB-debug-log'  socket: '/10.8/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
mariadbd: /10.8/sql/mdl.h:438: void MDL_key::mdl_key_init(MDL_key::enum_mdl_namespace, const char*, const char*): Assertion `mdl_namespace_arg == USER_LOCK || ok_for_lower_case_names(db)' failed.
220323 10:09:37 [ERROR] mysqld got signal 6 ;
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.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.8.3-MariaDB-debug-log
key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 63896 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x7f8c58000db8
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 = 0x7f8c880a3e18 thread_stack 0x49000
mysys/stacktrace.c:212(my_print_stacktrace)[0x555597c48cf4]
sql/signal_handler.cc:226(handle_fatal_signal)[0x555597356800]
sigaction.c:0(__restore_rt)[0x7f8c9586c3c0]
??:0(gsignal)[0x7f8c9535503b]
??:0(abort)[0x7f8c95334859]
/lib/x86_64-linux-gnu/libc.so.6(+0x22729)[0x7f8c95334729]
??:0(__assert_fail)[0x7f8c95346006]
sql/mdl.h:439(MDL_key::mdl_key_init(MDL_key::enum_mdl_namespace, char const*, char const*))[0x5555970cf43a]
sql/mdl.cc:1001(MDL_request::init_with_source(MDL_key::enum_mdl_namespace, char const*, char const*, enum_mdl_type, enum_mdl_duration, char const*, unsigned int))[0x5555971779bb]
sql/sql_table.cc:10036(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool))[0x5555970bb7c4]
sql/sql_alter.cc:547(Sql_cmd_alter_table::execute(THD*))[0x555597173bca]
sql/sql_parse.cc:5988(mysql_execute_command(THD*, bool))[0x555596f9efc6]
sql/sql_parse.cc:8027(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x555596fa5174]
sql/sql_parse.cc:1896(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x555596f91638]
sql/sql_parse.cc:1402(do_command(THD*, bool))[0x555596f8ffd4]
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x5555971686e7]
sql/sql_connect.cc:1314(handle_one_connection)[0x555597168377]
perfschema/pfs.cc:2203(pfs_spawn_thread)[0x5555976b7ea9]
nptl/pthread_create.c:478(start_thread)[0x7f8c95860609]
??:0(clone)[0x7f8c95431163]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f8c58015410): alter table t1 convert partition p3 to table EXISTENT.TP3

also variations -
parts.alter_table 'aria,innodb,lcase_def,range'
parts.alter_table 'aria,innodb,lcase_def,list'
parts.alter_table 'aria,innodb,lcase_def,list'
parts.alter_table 'innodb,innodb,lcase_def,range'


Generated at Thu Feb 08 09:58:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.