本文整理匯總了Golang中github.com/cockroachdb/cockroach/pkg/sql/sqlbase.TableDescriptor.MakeMutationComplete方法的典型用法代碼示例。如果您正苦於以下問題:Golang TableDescriptor.MakeMutationComplete方法的具體用法?Golang TableDescriptor.MakeMutationComplete怎麽用?Golang TableDescriptor.MakeMutationComplete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/cockroachdb/cockroach/pkg/sql/sqlbase.TableDescriptor
的用法示例。
在下文中一共展示了TableDescriptor.MakeMutationComplete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: convertBackfillError
func convertBackfillError(tableDesc *sqlbase.TableDescriptor, b *client.Batch) error {
// A backfill on a new schema element has failed and the batch contains
// information useful in printing a sensible error. However
// convertBatchError() will only work correctly if the schema elements are
// "live" in the tableDesc. Apply the mutations belonging to the same
// mutationID to make all the mutations live in tableDesc. Note: this
// tableDesc is not written to the k:v store.
mutationID := tableDesc.Mutations[0].MutationID
for _, mutation := range tableDesc.Mutations {
if mutation.MutationID != mutationID {
// Mutations are applied in a FIFO order. Only apply the first set
// of mutations if they have the mutation ID we're looking for.
break
}
tableDesc.MakeMutationComplete(mutation)
}
return convertBatchError(tableDesc, b)
}