66
}
67
69
>
treeRow := &sqlplugin.HistoryTreeRow{
70
>
ShardID: request.ShardID,
71
>
TreeID: treeIDBytes,
72
>
BranchID: branchIDBytes,
73
>
Data: treeInfoBlob.Data,
74
>
DataEncoding: treeInfoBlob.EncodingType.String(),
75
>
}
76
>
77
>
return m.txExecute(ctx, "AppendHistoryNodes", func(tx sqlplugin.Tx) error {
78
>
result, err := tx.InsertIntoHistoryNode(ctx, nodeRow)
79
>
if err != nil {
80
return err
81
}
83
>
if err != nil {
84
return err
85
}
87
return fmt.Errorf("expected 1 or 2 row to be affected for node table, got %v", rowsAffected)
88
}
89
91
>
switch err {
92
>
case nil:
93
>
rowsAffected, err = result.RowsAffected()
94
>
if err != nil {
95
return err
96
}
98
return fmt.Errorf("expected 1 or 2 rows to be affected for tree table as we allow upserts, got %v", rowsAffected)
99
}
101
case context.DeadlineExceeded, context.Canceled:
102
return &p.AppendHistoryTimeoutError{