[FEAT MERGE]charset latin1

This commit is contained in:
akaError
2023-01-28 15:43:48 +08:00
committed by ob-robot
parent 2663894581
commit af2506b14c
42 changed files with 1215 additions and 392 deletions

View File

@ -16,6 +16,7 @@
#include "sql/session/ob_sql_session_info.h"
#include "sql/ob_sql_utils.h"
#include "common/ob_smart_call.h"
#include "lib/charset/ob_charset.h"
using namespace oceanbase::common;
using namespace oceanbase::sql;
@ -527,8 +528,7 @@ int ObExprUtil::convert_string_collation(const ObString &in_str,
out_str = in_str;
} else {
char *buf = NULL;
const int32_t CharConvertFactorNum = 4; //最多使用4字节存储一个字符
int32_t buf_len = in_str.length() * CharConvertFactorNum;
int32_t buf_len = in_str.length() * ObCharset::CharConvertFactorNum;
uint32_t result_len = 0;
if (OB_ISNULL(buf = static_cast<char*>(alloc.alloc(buf_len)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
@ -622,7 +622,7 @@ int ObExprUtil::convert_utf8_charset(ObIAllocator& allocator,
int ret = OB_SUCCESS;
char *buf = NULL;
//一个字符最多4个byte
int32_t buf_len = from_string.length() * 4;
int32_t buf_len = from_string.length() * ObCharset::CharConvertFactorNum;
uint32_t result_len = 0;
if (0 == buf_len) {
} else if (from_collation == CS_TYPE_UTF8MB4_BIN) {