diff --git a/src/share/inner_table/ob_inner_table_schema.12101_12150.cpp b/src/share/inner_table/ob_inner_table_schema.12101_12150.cpp index 6bd0528040..3043933042 100644 --- a/src/share/inner_table/ob_inner_table_schema.12101_12150.cpp +++ b/src/share/inner_table/ob_inner_table_schema.12101_12150.cpp @@ -6120,7 +6120,7 @@ int ObInnerTableSchema::all_virtual_dblink_schema(ObTableSchema &table_schema) 0, //part_key_pos ObVarcharType, //column_type CS_TYPE_INVALID, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length + OB_MAX_DOMIN_NAME_LENGTH, //column_length -1, //column_precision -1, //column_scale true, //is_nullable @@ -6648,7 +6648,7 @@ int ObInnerTableSchema::all_virtual_dblink_history_schema(ObTableSchema &table_s 0, //part_key_pos ObVarcharType, //column_type CS_TYPE_INVALID, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length + OB_MAX_DOMIN_NAME_LENGTH, //column_length -1, //column_precision -1, //column_scale true, //is_nullable diff --git a/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp b/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp index 394374f4ba..bd401aab64 100644 --- a/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15151_15200.cpp @@ -3955,7 +3955,7 @@ int ObInnerTableSchema::all_virtual_dblink_real_agent_ora_schema(ObTableSchema & 0, //part_key_pos ObVarcharType, //column_type CS_TYPE_UTF8MB4_BIN, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length + OB_MAX_DOMIN_NAME_LENGTH, //column_length 2, //column_precision -1, //column_scale true, //is_nullable diff --git a/src/share/inner_table/ob_inner_table_schema.201_250.cpp b/src/share/inner_table/ob_inner_table_schema.201_250.cpp index 62c8dbed8c..afa11436d3 100644 --- a/src/share/inner_table/ob_inner_table_schema.201_250.cpp +++ b/src/share/inner_table/ob_inner_table_schema.201_250.cpp @@ -5063,7 +5063,7 @@ int ObInnerTableSchema::all_dblink_schema(ObTableSchema &table_schema) 0, //part_key_pos ObVarcharType, //column_type CS_TYPE_INVALID, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length + OB_MAX_DOMIN_NAME_LENGTH, //column_length -1, //column_precision -1, //column_scale true, //is_nullable @@ -5607,7 +5607,7 @@ int ObInnerTableSchema::all_dblink_history_schema(ObTableSchema &table_schema) 0, //part_key_pos ObVarcharType, //column_type CS_TYPE_INVALID, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length + OB_MAX_DOMIN_NAME_LENGTH, //column_length -1, //column_precision -1, //column_scale true, //is_nullable diff --git a/src/share/inner_table/ob_inner_table_schema_def.py b/src/share/inner_table/ob_inner_table_schema_def.py index d1614d53e6..d60dff3623 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -2030,7 +2030,7 @@ all_dblink_def = dict( ('passwordx', 'varbinary:OB_MAX_PASSWORD_LENGTH', 'true', ''), ('authpwdx', 'varbinary:OB_MAX_PASSWORD_LENGTH', 'true', ''), ('encrypted_password', 'varchar:OB_MAX_ENCRYPTED_PASSWORD_LENGTH', 'true'), - ('reverse_host_ip', 'varchar:MAX_IP_ADDR_LENGTH', 'true'), + ('reverse_host_ip', 'varchar:OB_MAX_DOMIN_NAME_LENGTH', 'true'), ('reverse_host_port', 'int', 'true'), ('reverse_cluster_name', 'varchar:OB_MAX_CLUSTER_NAME_LENGTH', 'true'), ('reverse_tenant_name', 'varchar:OB_MAX_TENANT_NAME_LENGTH_STORE', 'true'), diff --git a/src/share/schema/ob_schema_struct.cpp b/src/share/schema/ob_schema_struct.cpp index d2bf16a4ff..58ccc28aa3 100644 --- a/src/share/schema/ob_schema_struct.cpp +++ b/src/share/schema/ob_schema_struct.cpp @@ -11196,6 +11196,10 @@ void ObDbLinkBaseInfo::reset() authpwd_.reset(); passwordx_.reset(); authpwdx_.reset(); + host_name_.reset(); + host_port_ = 0; + reverse_host_name_.reset(); + reverse_host_port_ = 0; reverse_cluster_name_.reset(); reverse_tenant_name_.reset(); reverse_user_name_.reset(); @@ -11213,7 +11217,7 @@ bool ObDbLinkBaseInfo::is_valid() const && !dblink_name_.empty() && !tenant_name_.empty() && !user_name_.empty() - && host_addr_.is_valid() + && ((!host_name_.empty() && 0 != host_port_) || host_addr_.is_valid()) && (!password_.empty() || !encrypted_password_.empty()); } @@ -11397,7 +11401,11 @@ OB_SERIALIZE_MEMBER(ObDbLinkInfo, plain_reverse_password_, reverse_host_addr_, database_name_, - if_not_exist_); + if_not_exist_, + host_name_, + host_port_, + reverse_host_name_, + reverse_host_port_); ObDbLinkSchema::ObDbLinkSchema(const ObDbLinkSchema &other) : ObDbLinkBaseInfo() @@ -11419,6 +11427,8 @@ ObDbLinkSchema &ObDbLinkSchema::operator=(const ObDbLinkSchema &other) driver_proto_ = other.driver_proto_; if_not_exist_ = other.if_not_exist_; flag_ = other.flag_; + host_port_ = other.host_port_; + reverse_host_port_ = other.reverse_host_port_; if (OB_FAIL(deep_copy_str(other.dblink_name_, dblink_name_))) { LOG_WARN("Fail to deep copy dblink name", K(ret)); } else if (OB_FAIL(deep_copy_str(other.cluster_name_, cluster_name_))) { @@ -11457,6 +11467,10 @@ ObDbLinkSchema &ObDbLinkSchema::operator=(const ObDbLinkSchema &other) LOG_WARN("Fail to deep copy plain_reverse_password", K(ret), K(other.plain_reverse_password_)); } else if (OB_FAIL(deep_copy_str(other.database_name_, database_name_))) { LOG_WARN("Fail to deep copy database_name", K(ret), K(other.database_name_)); + } else if (OB_FAIL(deep_copy_str(other.host_name_, host_name_))) { + LOG_WARN("Fail to deep copy host_name", K(ret), K(other.host_name_)); + } else if (OB_FAIL(deep_copy_str(other.reverse_host_name_, reverse_host_name_))) { + LOG_WARN("Fail to deep copy host_name", K(ret), K(other.reverse_host_name_)); } host_addr_ = other.host_addr_; reverse_host_addr_ = other.reverse_host_addr_; @@ -11496,7 +11510,11 @@ bool ObDbLinkSchema::operator==(const ObDbLinkSchema &other) const && plain_reverse_password_ == other.plain_reverse_password_ && reverse_host_addr_ == other.reverse_host_addr_ && database_name_ == other.database_name_ - && if_not_exist_ == other.if_not_exist_); + && if_not_exist_ == other.if_not_exist_ + && host_name_ == other.host_name_ + && host_port_ == other.host_port_ + && reverse_host_name_ == other.host_name_ + && reverse_host_port_ == other.host_port_); } ObSynonymInfo::ObSynonymInfo(common::ObIAllocator *allocator): diff --git a/src/share/schema/ob_schema_struct.h b/src/share/schema/ob_schema_struct.h index 537fed1758..84a1dfd7fc 100755 --- a/src/share/schema/ob_schema_struct.h +++ b/src/share/schema/ob_schema_struct.h @@ -6059,7 +6059,9 @@ public: K_(reverse_cluster_name), K_(reverse_tenant_name), K_(reverse_user_name), K_(reverse_password), K_(plain_reverse_password), - K_(reverse_host_addr)); + K_(reverse_host_addr), + K_(host_name), K_(host_port), + K_(reverse_host_name), K_(reverse_host_port)); private: int dblink_encrypt(common::ObString &src, common::ObString &dst); int dblink_decrypt(common::ObString &src, common::ObString &dst); @@ -6092,6 +6094,10 @@ protected: common::ObAddr reverse_host_addr_; // used for reverse dblink common::ObString database_name_; // used for mysql dblink bool if_not_exist_; // used for mysql dblink + common::ObString host_name_; // ip string or domin name + int32_t host_port_; + common::ObString reverse_host_name_; // ip string or domin name + int32_t reverse_host_port_; }; struct ObTenantDbLinkId @@ -6193,7 +6199,9 @@ public: + reverse_user_name_.length() + 1 + reverse_password_.length() + 1 + plain_reverse_password_.length() + 1 - + database_name_.length() + 1; + + database_name_.length() + 1 + + host_name_.length() + 1 + + reverse_host_name_.length() + 1; } }; diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result index b2fcd0701d..6d886208a8 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result @@ -3871,7 +3871,7 @@ authpwd varchar(128) YES passwordx varbinary(128) YES authpwdx varbinary(128) YES encrypted_password varchar(512) YES NULL -reverse_host_ip varchar(46) YES NULL +reverse_host_ip varchar(240) YES NULL reverse_host_port bigint(20) YES NULL reverse_cluster_name varchar(128) YES NULL reverse_tenant_name varchar(128) YES NULL @@ -3906,7 +3906,7 @@ authpwd varchar(128) YES passwordx varbinary(128) YES authpwdx varbinary(128) YES encrypted_password varchar(512) YES NULL -reverse_host_ip varchar(46) YES NULL +reverse_host_ip varchar(240) YES NULL reverse_host_port bigint(20) YES NULL reverse_cluster_name varchar(128) YES NULL reverse_tenant_name varchar(128) YES NULL