未验证 提交 85de706d 编写于 作者: G groot 提交者: GitHub

#1929 Skip mysql meta schema field width check (#1937)

* #1929 Skip mysql meta schema field width check
Signed-off-by: Ngroot <yihua.mo@zilliz.com>

* typo
Signed-off-by: Ngroot <yihua.mo@zilliz.com>

* merge master
Signed-off-by: Ngroot <yihua.mo@zilliz.com>
上级 59035d98
...@@ -6,6 +6,7 @@ Please mark all change in change log and use the issue from GitHub ...@@ -6,6 +6,7 @@ Please mark all change in change log and use the issue from GitHub
## Bug ## Bug
- \#1705 Limit the insert data batch size - \#1705 Limit the insert data batch size
- \#1929 Skip MySQL meta schema field width check
## Feature ## Feature
......
...@@ -80,6 +80,15 @@ class MetaField { ...@@ -80,6 +80,15 @@ class MetaField {
IsEqual(const MetaField& field) const { IsEqual(const MetaField& field) const {
size_t name_len_min = field.name_.length() > name_.length() ? name_.length() : field.name_.length(); size_t name_len_min = field.name_.length() > name_.length() ? name_.length() : field.name_.length();
size_t type_len_min = field.type_.length() > type_.length() ? type_.length() : field.type_.length(); size_t type_len_min = field.type_.length() > type_.length() ? type_.length() : field.type_.length();
// only check field type, don't check field width, for example: VARCHAR(255) and VARCHAR(100) is equal
std::vector<std::string> type_split;
milvus::server::StringHelpFunctions::SplitStringByDelimeter(type_, "(", type_split);
if (!type_split.empty()) {
type_len_min = type_split[0].length() > type_len_min ? type_len_min : type_split[0].length();
}
// field name must be equal, ignore type width
return strncasecmp(field.name_.c_str(), name_.c_str(), name_len_min) == 0 && return strncasecmp(field.name_.c_str(), name_.c_str(), name_len_min) == 0 &&
strncasecmp(field.type_.c_str(), type_.c_str(), type_len_min) == 0; strncasecmp(field.type_.c_str(), type_.c_str(), type_len_min) == 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册