提交 48533eba 编写于 作者: S shenglian zhou

fix memory core dump of wrong ucs-4 size

上级 90cb6f00
......@@ -991,7 +991,8 @@ static void doSetupSDataBlock(SSqlRes* pRes, SSDataBlock* pBlock, void* pFilterI
continue;
}
int32_t len = 0;
taosMbsToUcs4(varDataVal(srcRow), varDataLen(srcRow), varDataVal(dstRow), bytes, &len);
taosMbsToUcs4(varDataVal(srcRow), varDataLen(srcRow), varDataVal(dstRow),
bytes-VARSTR_HEADER_SIZE, &len);
varDataLen(dstRow) = len;
}
memcpy(srcData, dstData, bytes*rows);
......
......@@ -1024,7 +1024,7 @@ if $data60 != @10@ then
endi
print execute sql select char_length(c15) from (select * from stb1);
sql select char_length(c15) from (select * from stb1);
if $data00 != @0@ then
if $data00 != @1@ then
return -1
endi
if $data10 != @NULL@ then
......@@ -1033,25 +1033,25 @@ endi
if $data20 != @NULL@ then
return -1
endi
if $data30 != @0@ then
if $data30 != @1@ then
return -1
endi
if $data40 != @0@ then
if $data40 != @1@ then
return -1
endi
if $data50 != @0@ then
if $data50 != @3@ then
return -1
endi
if $data60 != @0@ then
return -1
endi
if $data70 != @0@ then
if $data70 != @1@ then
return -1
endi
if $data80 != @0@ then
if $data80 != @1@ then
return -1
endi
if $data90 != @0@ then
if $data90 != @1@ then
return -1
endi
print execute sql select char_length(cast(a as binary(10))) from (select avg(c2) as a from stb1 where ts >= '2021-11-11 09:00:00.000' and ts <= '2021-11-11 09:00:09.000' interval(1s) fill(null));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册