From a243d2b91d4630464568fb0088d5af9cb10e1fa6 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Wed, 25 Aug 2021 17:08:09 +0800 Subject: [PATCH] schemaless: fix errors about modify_column --- src/client/src/tscParseLineProtocol.c | 12 ++++++------ src/mnode/src/mnodeTable.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/src/tscParseLineProtocol.c b/src/client/src/tscParseLineProtocol.c index c66800620a..52e4bd3d40 100644 --- a/src/client/src/tscParseLineProtocol.c +++ b/src/client/src/tscParseLineProtocol.c @@ -891,12 +891,12 @@ static int32_t insertChildTableBatch(TAOS* taos, char* cTableName, SArray* cols if (code == TSDB_CODE_APP_NOT_READY || code == TSDB_CODE_TDB_INVALID_TABLE_ID || code == TSDB_CODE_VND_INVALID_VGROUP_ID) { -// TAOS_RES* res2 = taos_query(taos, "RESET QUERY CACHE"); -// int32_t code2 = taos_errno(res2); -// if (code2 != TSDB_CODE_SUCCESS) { -// tscError("SML:0x%" PRIx64 " insert child table. reset query cache. error: %s", info->id, taos_errstr(res2)); -// } -// taos_free_result(res2); + TAOS_RES* res2 = taos_query(taos, "RESET QUERY CACHE"); + int32_t code2 = taos_errno(res2); + if (code2 != TSDB_CODE_SUCCESS) { + tscError("SML:0x%" PRIx64 " insert child table. reset query cache. error: %s", info->id, taos_errstr(res2)); + } + taos_free_result(res2); if (tryAgain) { taosMsleep(50 * (2 << try)); } diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 1bc5607da5..7a0108026e 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1518,7 +1518,6 @@ static int32_t mnodeChangeSuperTableColumn(SMnodeMsg *pMsg) { // update SSchema *schema = (SSchema *) (pStable->schema + col); ASSERT(schema->type == TSDB_DATA_TYPE_BINARY || schema->type == TSDB_DATA_TYPE_NCHAR); - schema->bytes = pAlter->schema[0].bytes; if (pAlter->schema[0].bytes <= schema->bytes) { mError("msg:%p, app:%p stable:%s, modify column len. column:%s, len from %d to %d", pMsg, pMsg->rpcMsg.ahandle, @@ -1526,6 +1525,7 @@ static int32_t mnodeChangeSuperTableColumn(SMnodeMsg *pMsg) { return TSDB_CODE_MND_INVALID_COLUMN_LENGTH; } + schema->bytes = pAlter->schema[0].bytes; pStable->sversion++; mInfo("msg:%p, app:%p stable %s, start to modify column %s len to %d", pMsg, pMsg->rpcMsg.ahandle, pStable->info.tableId, name, schema->bytes);