[TD-5517]<fix>: return error when apply schema action failed

This commit is contained in:
shenglian zhou 2021-07-26 10:37:35 +08:00
parent 11dd18cff2
commit 09d4fe1b5e
1 changed files with 10 additions and 2 deletions

View File

@ -518,7 +518,11 @@ static int32_t modifyDBSchemas(TAOS* taos, SArray* stableSchemas) {
bool actionNeeded = false; bool actionNeeded = false;
generateSchemaAction(pointTag, dbTagHash, dbSchema.tags, true, pointSchema->sTableName, &schemaAction, &actionNeeded); generateSchemaAction(pointTag, dbTagHash, dbSchema.tags, true, pointSchema->sTableName, &schemaAction, &actionNeeded);
if (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; bool actionNeeded = false;
generateSchemaAction(pointCol, dbFieldHash, dbSchema.fields,false, pointSchema->sTableName, &schemaAction, &actionNeeded); generateSchemaAction(pointCol, dbFieldHash, dbSchema.fields,false, pointSchema->sTableName, &schemaAction, &actionNeeded);
if (actionNeeded) { if (actionNeeded) {
applySchemaAction(taos, &schemaAction); code = applySchemaAction(taos, &schemaAction);
if (code != 0) {
destroySmlSTableSchema(&dbSchema);
return code;
}
} }
} }