diff options
author | Kentoku SHIBA <kentokushiba@gmail.com> | 2021-04-19 22:54:45 +0900 |
---|---|---|
committer | Kentoku SHIBA <kentokushiba@gmail.com> | 2021-04-30 19:18:27 +0900 |
commit | 42cdc37ff92b7c84abee4d9ec49c47ccbd34ba24 (patch) | |
tree | 8f35ad36b9283a3878a0073a44d54e80477538e1 | |
parent | e8b9d8d38cac3ca4c18a09a29601791390323bbb (diff) | |
download | mariadb-git-42cdc37ff92b7c84abee4d9ec49c47ccbd34ba24.tar.gz |
MDEV-22265 Connect string character limit too small for full 64 character InnoDB table-name limit when using ad-hoc Spider server definitions.
Fix length for getting default table name.
6 files changed, 69 insertions, 1 deletions
diff --git a/storage/spider/mysql-test/spider/bugfix/include/mdev_22265_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/mdev_22265_deinit.inc new file mode 100644 index 00000000000..ecb5622af14 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/mdev_22265_deinit.inc @@ -0,0 +1,7 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/bugfix/include/mdev_22265_init.inc b/storage/spider/mysql-test/spider/bugfix/include/mdev_22265_init.inc new file mode 100644 index 00000000000..6cf6b0c1f41 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/mdev_22265_init.inc @@ -0,0 +1,7 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result new file mode 100644 index 00000000000..0331943a878 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_22265.result @@ -0,0 +1,23 @@ +for master_1 +for child2 +for child3 + +this test is for MDEV-22265 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; + +create table +connection master_1; +create table t2345678911234567892123456789312345678941234567895123(id int) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='host "h114", user "spider", password "spider", port "3306", database "test32738"'; + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +for master_1 +for child2 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf new file mode 100644 index 00000000000..b0853e32654 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.cnf @@ -0,0 +1,2 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.test new file mode 100644 index 00000000000..0dcb103133b --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22265.test @@ -0,0 +1,28 @@ +--source ../include/mdev_22265_init.inc +--echo +--echo this test is for MDEV-22265 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +CREATE DATABASE auto_test_local; +USE auto_test_local; +--enable_warnings + +--echo +--echo create table +--connection master_1 +create table t2345678911234567892123456789312345678941234567895123(id int) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='host "h114", user "spider", password "spider", port "3306", database "test32738"'; + +--echo +--echo deinit +--disable_warnings + +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; + +--enable_warnings +--source ../include/mdev_22265_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 415f3be7b6c..8efa5d2551d 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -3737,7 +3737,8 @@ int spider_set_connect_info_default( if (!share->tgt_table_names[roop_count] && table_share) { DBUG_PRINT("info",("spider create default tgt_table_names")); - share->tgt_table_names_lengths[roop_count] = share->table_name_length; + share->tgt_table_names_lengths[roop_count] = + table_share->table_name.length; if ( !(share->tgt_table_names[roop_count] = spider_create_table_name_string( table_share->table_name.str, |