[TD-5517]<fix>: return error when apply schema action failed
This commit is contained in:
parent
11dd18cff2
commit
09d4fe1b5e
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue