fix max length of lob types unexpected in aggregate_max_length_for_string_result
This commit is contained in:
6
deps/oblib/src/common/ob_field.cpp
vendored
6
deps/oblib/src/common/ob_field.cpp
vendored
@ -359,11 +359,7 @@ int ObField::get_field_mb_length(const ObObjType type,
|
|||||||
if (OB_FAIL(common::ObCharset::get_mbmaxlen_by_coll(charsetnr, mbmaxlen))) {
|
if (OB_FAIL(common::ObCharset::get_mbmaxlen_by_coll(charsetnr, mbmaxlen))) {
|
||||||
LOG_WARN("fail to get mbmaxlen", K(charsetnr), K(ret));
|
LOG_WARN("fail to get mbmaxlen", K(charsetnr), K(ret));
|
||||||
} else {
|
} else {
|
||||||
if (lib::is_mysql_mode() && (type == ObLongTextType || type == ObJsonType || type == ObGeometryType)) {
|
if (lib::is_mysql_mode() && tc == ObTextTC) {
|
||||||
// issue: 52728955, 52735855, 52731784, 52734963, 52729976
|
|
||||||
// compat mysql .net driver 5.7, longblob, json, gis length is max u32
|
|
||||||
length = UINT32_MAX;
|
|
||||||
} else if (lib::is_mysql_mode() && tc == ObTextTC) {
|
|
||||||
// compat mysql-jdbc 8.x for judge text type by length
|
// compat mysql-jdbc 8.x for judge text type by length
|
||||||
length = static_cast<uint32_t>(ObAccuracy::MAX_ACCURACY[type].get_length() - 1);
|
length = static_cast<uint32_t>(ObAccuracy::MAX_ACCURACY[type].get_length() - 1);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1716,7 +1716,15 @@ void ObResultSet::replace_lob_type(const ObSQLSessionInfo &session,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_TRACE("init field", K(is_use_lob_locator), K(field), K(mfield.type_));
|
LOG_TRACE("init field", K(is_use_lob_locator), K(field), K(mfield.type_));
|
||||||
} else {
|
} else { // mysql mode
|
||||||
|
// issue: 52728955, 52735855, 52731784, 52734963, 52729976
|
||||||
|
// compat mysql .net driver 5.7, longblob, json, gis length is max u32
|
||||||
|
if (mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_LONG_BLOB
|
||||||
|
|| mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_JSON
|
||||||
|
|| mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_GEOMETRY) {
|
||||||
|
mfield.length_ = UINT32_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
if (mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_TINY_BLOB ||
|
if (mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_TINY_BLOB ||
|
||||||
mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_MEDIUM_BLOB ||
|
mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_MEDIUM_BLOB ||
|
||||||
mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_LONG_BLOB) {
|
mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_LONG_BLOB) {
|
||||||
|
|||||||
Reference in New Issue
Block a user