(tablet *Tablet)
| 1196 | } |
| 1197 | |
| 1198 | func (s *Session) insertRelationalTablet(tablet *Tablet) error { |
| 1199 | if tablet.Len() == 0 { |
| 1200 | return nil |
| 1201 | } |
| 1202 | request, err := s.genTSInsertTabletReq(tablet, true, true) |
| 1203 | if err != nil { |
| 1204 | return err |
| 1205 | } |
| 1206 | request.ColumnCategories = tablet.getColumnCategories() |
| 1207 | |
| 1208 | r, err := s.client.InsertTablet(context.Background(), request) |
| 1209 | |
| 1210 | if err != nil && r == nil { |
| 1211 | if s.reconnect() { |
| 1212 | request.SessionId = s.sessionId |
| 1213 | r, err = s.client.InsertTablet(context.Background(), request) |
| 1214 | } |
| 1215 | } |
| 1216 | |
| 1217 | if err != nil { |
| 1218 | return err |
| 1219 | } |
| 1220 | return VerifySuccess(r) |
| 1221 | } |
| 1222 | |
| 1223 | func (s *Session) InsertTablet(tablet *Tablet, sorted bool) error { |
| 1224 | if !sorted { |
no test coverage detected