diff --git a/src/common/src/tvariant.c b/src/common/src/tvariant.c index 78d1e38f1ec6cf5aefdebc95150dafe03a526c37..5e378c46217e896b6c5ad8e1726068668f7eb0c9 100644 --- a/src/common/src/tvariant.c +++ b/src/common/src/tvariant.c @@ -144,8 +144,8 @@ void tVariantDestroy(tVariant *pVar) { void tVariantAssign(tVariant *pDst, const tVariant *pSrc) { if (pSrc == NULL || pDst == NULL) return; - *pDst = *pSrc; - + pDst->nType = pSrc->nType; + if (pSrc->nType == TSDB_DATA_TYPE_BINARY || pSrc->nType == TSDB_DATA_TYPE_NCHAR) { int32_t allocLen = pSrc->nLen + 1; int32_t len = pSrc->nLen;