From 09d4fe1b5eb24ec4b31503b45df086fdefe78029 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Mon, 26 Jul 2021 10:37:35 +0800 Subject: [PATCH] [TD-5517]: return error when apply schema action failed --- src/client/src/tscParseLineProtocol.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscParseLineProtocol.c b/src/client/src/tscParseLineProtocol.c index 8f9cdbf002..7645a30eee 100644 --- a/src/client/src/tscParseLineProtocol.c +++ b/src/client/src/tscParseLineProtocol.c @@ -518,7 +518,11 @@ static int32_t modifyDBSchemas(TAOS* taos, SArray* stableSchemas) { bool actionNeeded = false; generateSchemaAction(pointTag, dbTagHash, dbSchema.tags, true, pointSchema->sTableName, &schemaAction, &actionNeeded); if (actionNeeded) { - applySchemaAction(taos, &schemaAction); + code = applySchemaAction(taos, &schemaAction); + if (code != 0) { + destroySmlSTableSchema(&dbSchema); + return code; + } } } @@ -532,7 +536,11 @@ static int32_t modifyDBSchemas(TAOS* taos, SArray* stableSchemas) { bool actionNeeded = false; generateSchemaAction(pointCol, dbFieldHash, dbSchema.fields,false, pointSchema->sTableName, &schemaAction, &actionNeeded); if (actionNeeded) { - applySchemaAction(taos, &schemaAction); + code = applySchemaAction(taos, &schemaAction); + if (code != 0) { + destroySmlSTableSchema(&dbSchema); + return code; + } } } -- GitLab