summaryrefslogtreecommitdiff
path: root/storage/spider/spd_db_mysql.cc
diff options
context:
space:
mode:
authorKentoku SHIBA <kentokushiba@gmail.com>2015-05-05 03:09:34 +0900
committerKentoku SHIBA <kentokushiba@gmail.com>2015-05-05 03:09:34 +0900
commit9130cc7f3c516bba0dc729dd388af0710d1f28d3 (patch)
treecbe0a497e2f2fb188e3afa17cca34bf7862bbf5e /storage/spider/spd_db_mysql.cc
parent060ec5b6b9384456695b6fc903ccfeb8c7ccd298 (diff)
downloadmariadb-git-9130cc7f3c516bba0dc729dd388af0710d1f28d3.tar.gz
update Spider to 3.2.21
Diffstat (limited to 'storage/spider/spd_db_mysql.cc')
-rw-r--r--storage/spider/spd_db_mysql.cc60
1 files changed, 39 insertions, 21 deletions
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index e4d9d150bcd..1b40265e9b6 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -5384,28 +5384,46 @@ void spider_mysql_handler::create_tmp_bka_table_name(
int *tmp_table_name_length,
int link_idx
) {
- uint adjust_length =
- mysql_share->db_nm_max_length -
- mysql_share->db_names_str[spider->conn_link_idx[link_idx]].length() +
- mysql_share->table_nm_max_length -
- mysql_share->table_names_str[spider->conn_link_idx[link_idx]].length(),
- length;
+ uint adjust_length, length;
DBUG_ENTER("spider_mysql_handler::create_tmp_bka_table_name");
- *tmp_table_name_length = mysql_share->db_nm_max_length +
- mysql_share->table_nm_max_length;
- memset(tmp_table_name, ' ', adjust_length);
- tmp_table_name += adjust_length;
- memcpy(tmp_table_name, mysql_share->db_names_str[link_idx].c_ptr(),
- mysql_share->db_names_str[link_idx].length());
- tmp_table_name += mysql_share->db_names_str[link_idx].length();
- length = my_sprintf(tmp_table_name, (tmp_table_name,
- "%s%s%p%s", SPIDER_SQL_DOT_STR, SPIDER_SQL_TMP_BKA_STR, spider,
- SPIDER_SQL_UNDERSCORE_STR));
- *tmp_table_name_length += length;
- tmp_table_name += length;
- memcpy(tmp_table_name,
- mysql_share->table_names_str[spider->conn_link_idx[link_idx]].c_ptr(),
- mysql_share->table_names_str[spider->conn_link_idx[link_idx]].length());
+ if (spider_param_bka_table_name_type(current_thd,
+ mysql_share->spider_share->
+ bka_table_name_types[spider->conn_link_idx[link_idx]]) == 1)
+ {
+ adjust_length =
+ mysql_share->db_nm_max_length -
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].length() +
+ mysql_share->table_nm_max_length -
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].length();
+ *tmp_table_name_length = mysql_share->db_nm_max_length +
+ mysql_share->table_nm_max_length;
+ memset(tmp_table_name, ' ', adjust_length);
+ tmp_table_name += adjust_length;
+ memcpy(tmp_table_name, mysql_share->db_names_str[link_idx].c_ptr(),
+ mysql_share->db_names_str[link_idx].length());
+ tmp_table_name += mysql_share->db_names_str[link_idx].length();
+ length = my_sprintf(tmp_table_name, (tmp_table_name,
+ "%s%s%p%s", SPIDER_SQL_DOT_STR, SPIDER_SQL_TMP_BKA_STR, spider,
+ SPIDER_SQL_UNDERSCORE_STR));
+ *tmp_table_name_length += length;
+ tmp_table_name += length;
+ memcpy(tmp_table_name,
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].c_ptr(),
+ mysql_share->table_names_str[spider->conn_link_idx[link_idx]].length());
+ } else {
+ adjust_length =
+ mysql_share->db_nm_max_length -
+ mysql_share->db_names_str[spider->conn_link_idx[link_idx]].length();
+ *tmp_table_name_length = mysql_share->db_nm_max_length;
+ memset(tmp_table_name, ' ', adjust_length);
+ tmp_table_name += adjust_length;
+ memcpy(tmp_table_name, mysql_share->db_names_str[link_idx].c_ptr(),
+ mysql_share->db_names_str[link_idx].length());
+ tmp_table_name += mysql_share->db_names_str[link_idx].length();
+ length = my_sprintf(tmp_table_name, (tmp_table_name,
+ "%s%s%p", SPIDER_SQL_DOT_STR, SPIDER_SQL_TMP_BKA_STR, spider));
+ *tmp_table_name_length += length;
+ }
DBUG_VOID_RETURN;
}