diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2021-04-23 13:04:36 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2021-04-27 11:12:47 +0400 |
commit | 5bc12ca9c294002c09b32238e8bdf4de3dc138dc (patch) | |
tree | 27b1e8d50b92dae24e39269388038b54c65c103b /storage/spider | |
parent | 90a306a7ab9adb3ad79edb95cdca9beafd4c8e60 (diff) | |
download | mariadb-git-5bc12ca9c294002c09b32238e8bdf4de3dc138dc.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.
The name of the table sent as an argument to the handler::init() has the
database name in front of it. So we should use
table_share->table_name.length.
Diffstat (limited to 'storage/spider')
-rw-r--r-- | storage/spider/mysql-test/spider/r/basic_sql.result | 4 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/t/basic_sql.test | 6 | ||||
-rw-r--r-- | storage/spider/spd_table.cc | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/storage/spider/mysql-test/spider/r/basic_sql.result b/storage/spider/mysql-test/spider/r/basic_sql.result index 94a09fc317b..ba904b5f577 100644 --- a/storage/spider/mysql-test/spider/r/basic_sql.result +++ b/storage/spider/mysql-test/spider/r/basic_sql.result @@ -717,6 +717,10 @@ TRUNCATE TABLE ta_l; connection master_1; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') +connection master_1; +create table t2345678911234567892123456789312345678941234567895123234234(id int) ENGINE=SPIDER +COMMENT='host "192.168.21.1", user "spider", password "password", database "test32738123123123"'; +drop table t2345678911234567892123456789312345678941234567895123234234; deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/t/basic_sql.test b/storage/spider/mysql-test/spider/t/basic_sql.test index 5bb040047fc..a3184a14beb 100644 --- a/storage/spider/mysql-test/spider/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/t/basic_sql.test @@ -2677,6 +2677,11 @@ if ($USE_CHILD_GROUP2) --connection master_1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; +--connection master_1 +create table t2345678911234567892123456789312345678941234567895123234234(id int) ENGINE=SPIDER + COMMENT='host "192.168.21.1", user "spider", password "password", database "test32738123123123"'; +drop table t2345678911234567892123456789312345678941234567895123234234; + --echo --echo deinit --disable_warnings @@ -2689,6 +2694,7 @@ if ($USE_CHILD_GROUP2) --connection child2_2 DROP DATABASE IF EXISTS auto_test_remote2; } + --disable_query_log --disable_result_log --source test_deinit.inc diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index fd0ece10c1b..495e1483ee6 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -3552,7 +3552,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, |