From f1d4671900a3544fb8e72143cab0908e90f6491e Mon Sep 17 00:00:00 2001 From: qiuyang19960521 <2810936527@qq.com> Date: Tue, 28 May 2024 11:58:49 +0800 Subject: [PATCH 1/2] index directory error --- storage/tianchi/ha_tse.cc | 18 +++++++++++++++++- storage/tianchi/ha_tse.h | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/storage/tianchi/ha_tse.cc b/storage/tianchi/ha_tse.cc index 703d903..6c39f11 100644 --- a/storage/tianchi/ha_tse.cc +++ b/storage/tianchi/ha_tse.cc @@ -106,6 +106,9 @@ #include "sql/dd/upgrade/server.h" // UPGRADE_FORCE #include "sql/abstract_query_plan.h" +#include "sql/dd/properties.h" +#include "sql/dd/types/partition.h" + #include "tse_stats.h" #include "tse_error.h" #include "tse_log.h" @@ -117,6 +120,7 @@ #include "sql/mysqld.h" #include "sql/plugin_table.h" #include "sql/dd/object_id.h" +#include "sql/dd/string_type.h" #include "sql/dd/cache/dictionary_client.h" #include "sql/dd/dd_schema.h" #include "sql/sql_table.h" @@ -775,7 +779,10 @@ bool ha_tse::check_unsupported_operation(THD *thd, HA_CREATE_INFO *create_info) my_error(ER_NOT_ALLOWED_COMMAND, MYF(0)); return HA_ERR_UNSUPPORTED; } - + if (create_info->index_file_name) { + my_error(ER_ILLEGAL_HA, MYF(0), table_share->table_name.str, HA_WRONG_CREATE_OPTION); + return true; + } return false; } @@ -4948,6 +4955,15 @@ EXTER_ATTACK int ha_tse::create(const char *name, TABLE *form, HA_CREATE_INFO *c dd::Table *table_def) { THD *thd = ha_thd(); ct_errno_t ret = CT_SUCCESS; + for (const auto dd_part : *table_def->leaf_partitions()) { + dd::String_type index_file_name_val; + const dd::Properties &options = dd_part->options(); + if (options.exists(index_file_name_val_key)) + (void)options.get(index_file_name_val_key, &index_file_name_val); + if (!index_file_name_val.empty()) { + create_info->index_file_name = index_file_name_val.c_str(); + } + } if (check_unsupported_operation(thd, create_info)) { tse_log_system("Unsupported operation. sql = %s", thd->query().str); return HA_ERR_WRONG_COMMAND; diff --git a/storage/tianchi/ha_tse.h b/storage/tianchi/ha_tse.h index 9cdeedb..6035264 100644 --- a/storage/tianchi/ha_tse.h +++ b/storage/tianchi/ha_tse.h @@ -36,6 +36,7 @@ #include "sql/abstract_query_plan.h" #include "sql/dd/types/schema.h" #include "sql/dd/types/object_table_definition.h" +#include "sql/dd/string_type.h" #pragma GCC visibility push(default) @@ -148,6 +149,8 @@ again. */ #define IS_PRIMARY_ROLE() (tse_get_cluster_role() == (int32_t)dis_cluster_role::PRIMARY) #define IS_STANDBY_ROLE() (tse_get_cluster_role() == (int32_t)dis_cluster_role::STANDBY) +static const dd::String_type index_file_name_val_key("index_file_name"); + static const uint ROW_ID_LENGTH = sizeof(uint64_t); static const uint TSE_START_TIMEOUT = 120; // seconds extern const char *tse_hton_name; -- Gitee From 11aebd15fc4c1be4cc0de74d07fc71aacd16880b Mon Sep 17 00:00:00 2001 From: qiuyang19960521 Date: Wed, 29 May 2024 09:18:06 +0800 Subject: [PATCH 2/2] index directory --- storage/tianchi/ha_tse.h | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/tianchi/ha_tse.h b/storage/tianchi/ha_tse.h index 6035264..b3095cb 100644 --- a/storage/tianchi/ha_tse.h +++ b/storage/tianchi/ha_tse.h @@ -142,6 +142,7 @@ again. */ #define RETURN_IF_OOM(result) \ { \ if (result == ERR_ALLOC_MEMORY) \ + return HA_ERR_SE_OUT_OF_MEMORY; \ } -- Gitee