From f266d593ef26c255d4f492de2800ced051fbaa37 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 7 Apr 2022 20:34:12 +0800 Subject: [PATCH 1/4] restore current add .smad/.smal --- source/dnode/vnode/src/tsdb/tsdbFS.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbFS.c b/source/dnode/vnode/src/tsdb/tsdbFS.c index aa235f88de..51d6efe077 100644 --- a/source/dnode/vnode/src/tsdb/tsdbFS.c +++ b/source/dnode/vnode/src/tsdb/tsdbFS.c @@ -1111,7 +1111,7 @@ static int tsdbRestoreDFileSet(STsdb *pRepo) { char bname[TSDB_FILENAME_LEN]; STfsDir * tdir = NULL; const STfsFile *pf = NULL; - const char * pattern = "^v[0-9]+f[0-9]+\\.(head|data|last)(-ver[0-9]+)?$"; + const char * pattern = "^v[0-9]+f[0-9]+\\.(head|data|last|smad|smal)(-ver[0-9]+)?$"; SArray * fArray = NULL; regex_t regex; STsdbFS * pfs = REPO_FS(pRepo); From 451a65f53f4d3f6a5d5684bd9f21a73d28a44d22 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 7 Apr 2022 20:49:18 +0800 Subject: [PATCH 2/4] add dstVgId --- source/dnode/mnode/impl/src/mndSma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndSma.c b/source/dnode/mnode/impl/src/mndSma.c index 94114a96bf..b402a27a41 100644 --- a/source/dnode/mnode/impl/src/mndSma.c +++ b/source/dnode/mnode/impl/src/mndSma.c @@ -416,8 +416,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SNodeMsg *pReq, SMCreateSmaReq *pCre streamObj.version = 1; streamObj.sql = pCreate->sql; streamObj.createdBy = STREAM_CREATED_BY__SMA; - // TODO - streamObj.fixedSinkVgId = 0; + streamObj.fixedSinkVgId = smaObj.dstVgId; streamObj.smaId = smaObj.uid; /*streamObj.physicalPlan = "";*/ streamObj.logicalPlan = "not implemented"; From 29138ae0c7229aeac1c0ae7c6ad386a97a8f9af0 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Fri, 8 Apr 2022 06:48:01 +0800 Subject: [PATCH 3/4] trigger CI From 57c574e38aa4c380b53824a2be096653ca54adf5 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Fri, 8 Apr 2022 10:40:55 +0800 Subject: [PATCH 4/4] [TD-14575]: fix rtrim result not correct for nchar columns --- source/libs/scalar/src/sclfunc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 1a6abb7100..df9e1bf36d 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -267,7 +267,7 @@ static void trtrim(char *input, char *output, int32_t type, int32_t charLen) { numOfSpaces++; } } else { //NCHAR - for (int32_t i = charLen - 1; i < charLen; ++i) { + for (int32_t i = charLen - 1; i >= 0; --i) { if (!iswspace(*((uint32_t *)varDataVal(input) + i))) { break; }