diff --git a/deps/oblib/src/common/ob_field.cpp b/deps/oblib/src/common/ob_field.cpp index 3a0dfec8e..f4d5b2e6d 100644 --- a/deps/oblib/src/common/ob_field.cpp +++ b/deps/oblib/src/common/ob_field.cpp @@ -359,11 +359,7 @@ int ObField::get_field_mb_length(const ObObjType type, if (OB_FAIL(common::ObCharset::get_mbmaxlen_by_coll(charsetnr, mbmaxlen))) { LOG_WARN("fail to get mbmaxlen", K(charsetnr), K(ret)); } else { - if (lib::is_mysql_mode() && (type == ObLongTextType || type == ObJsonType || type == ObGeometryType)) { - // 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) { + if (lib::is_mysql_mode() && tc == ObTextTC) { // compat mysql-jdbc 8.x for judge text type by length length = static_cast(ObAccuracy::MAX_ACCURACY[type].get_length() - 1); } else { diff --git a/src/sql/ob_result_set.cpp b/src/sql/ob_result_set.cpp index 946462cf0..3112dfa50 100644 --- a/src/sql/ob_result_set.cpp +++ b/src/sql/ob_result_set.cpp @@ -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_)); - } 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 || mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_MEDIUM_BLOB || mfield.type_ == obmysql::EMySQLFieldType::MYSQL_TYPE_LONG_BLOB) {