()
| 655 | } |
| 656 | |
| 657 | func (s *State) commitHandler() { |
| 658 | if tx, ok := s.handler.(sqlTransaction); ok { |
| 659 | if err := tx.Commit(); err != nil { |
| 660 | log.WithError(err).Fatal("failed to commit") |
| 661 | } |
| 662 | } |
| 663 | // reset schema change flag |
| 664 | atomic.StoreUint32(&s.hasSchemaChange, 0) |
| 665 | atomic.StoreUint64(&s.lastCommitPoint, s.getSeq()) |
| 666 | } |
| 667 | |
| 668 | func (s *State) rollbackHandler() { |
| 669 | if tx, ok := s.handler.(sqlTransaction); ok { |