-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add undo log manager-flush undo log func #269 #307
Changes from all commits
2c12009
446fddc
f8dba23
fe349fe
f429cc7
c17be39
aa2aa2e
dbec887
e391e9d
f5765e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,9 +102,26 @@ func (m *BaseUndoLogManager) BatchDeleteUndoLog(xid []string, branchID []int64, | |
return nil | ||
} | ||
|
||
// FlushUndoLog | ||
// FlushUndoLog flush undo log | ||
func (m *BaseUndoLogManager) FlushUndoLog(txCtx *types.TransactionContext, tx driver.Conn) error { | ||
return nil | ||
if !txCtx.HasUndoLog() { | ||
return nil | ||
} | ||
logs := []undo.SQLUndoLog{ | ||
{ | ||
SQLType: types.SQLTypeInsert, | ||
TableName: constant.UndoLogTableName, | ||
Images: *txCtx.RoundImages, | ||
}, | ||
} | ||
branchUndoLogs := []undo.BranchUndoLog{ | ||
{ | ||
Xid: txCtx.XaID, | ||
BranchID: strconv.FormatUint(txCtx.BranchID, 10), | ||
Logs: logs, | ||
}, | ||
} | ||
return m.InsertUndoLog(branchUndoLogs, tx) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. InsertUndoLog 方法好像没有实现,可以再本次PR中一起提交了 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. InsertUndoLog 这个方法已经在 #297 这个PR上实现了 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
好的,这个先忽略哈 |
||
} | ||
|
||
// RunUndo | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BranchUndoLog 加上json tag,确保undolog 转json后是这个格式,和java保持一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已添加json tag