diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2020-01-23 18:15:28 +0530 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-01-23 15:04:08 +0200 |
commit | 0e25a8b4a6a01e3c09407f2f697983dacbcb5cdb (patch) | |
tree | aa65def048b91e1d21f92102184865a49123a376 | |
parent | fde1589f9b52989436d7af3d47d408cac192d968 (diff) | |
download | mariadb-git-0e25a8b4a6a01e3c09407f2f697983dacbcb5cdb.tar.gz |
MDEV-21344: Uninitialized tbl_buf in dict_acquire_mdl_shared<false>()
dict_table_t::parse_name(): Properly calculate the *tbl_name_len.
A failure was easily repeatable during the test
innodb.innodb-alter-debug for the table name test.① ("test/@2460").
The UTF-8 representation of the U+2460 is only 3 bytes "\xe2\x91\xa0"
while the filename-safe encoded counterpart of it in dict_table_t::name
is 5 bytes "@2460".
This bug, introduced by commit ea37b144094a0c2ebfc6774047fd473c1b2a8658
(MDEV-16678), could cause a purge task to hang.
-rw-r--r-- | storage/innobase/dict/dict0dict.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 98d0f85ccd8..b573d5da1a6 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -2,7 +2,7 @@ Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -754,7 +754,6 @@ bool dict_table_t::parse_name(char (&db_name)[NAME_LEN + 1], mutex_exit(&dict_sys.mutex); *db_name_len= db_len; - *tbl_name_len= tbl_len; filename_to_tablename(db_buf, db_name, MAX_DATABASE_NAME_LEN + 1, true); @@ -763,12 +762,10 @@ bool dict_table_t::parse_name(char (&db_name)[NAME_LEN + 1], return false; if (char* is_part= strchr(tbl_buf, '#')) - { - *is_part = '\0'; - *tbl_name_len= is_part - tbl_buf; - } + *is_part= '\0'; filename_to_tablename(tbl_buf, tbl_name, MAX_TABLE_NAME_LEN + 1, true); + *tbl_name_len= strlen(tbl_name); return true; } |