@@ -206,7 +206,7 @@ func (t *tikvHandlerTool) getHandle(tb table.PhysicalTable, params map[string]st
206
206
return handle , nil
207
207
}
208
208
209
- func (t * tikvHandlerTool ) getMvccByIdxValue (idx table.Index , values url.Values , idxCols []* model.ColumnInfo , handle kv.Handle ) (* helper.MvccKV , error ) {
209
+ func (t * tikvHandlerTool ) getMvccByIdxValue (idx table.Index , values url.Values , idxCols []* model.ColumnInfo , handle kv.Handle ) ([] * helper.MvccKV , error ) {
210
210
sc := new (stmtctx.StatementContext )
211
211
// HTTP request is not a database session, set timezone to UTC directly here.
212
212
// See https://github.com/pingcap/tidb/blob/master/docs/tidb_http_api.md for more details.
@@ -227,7 +227,18 @@ func (t *tikvHandlerTool) getMvccByIdxValue(idx table.Index, values url.Values,
227
227
if err != nil {
228
228
return nil , err
229
229
}
230
- return & helper.MvccKV {Key : strings .ToUpper (hex .EncodeToString (encodedKey )), RegionID : regionID , Value : data }, err
230
+ idxData := & helper.MvccKV {Key : strings .ToUpper (hex .EncodeToString (encodedKey )), RegionID : regionID , Value : data }
231
+ tablecodec .IndexKey2TempIndexKey (idx .Meta ().ID , encodedKey )
232
+ data , err = t .GetMvccByEncodedKey (encodedKey )
233
+ if err != nil {
234
+ return nil , err
235
+ }
236
+ regionID , err = t .getRegionIDByKey (encodedKey )
237
+ if err != nil {
238
+ return nil , err
239
+ }
240
+ tempIdxData := & helper.MvccKV {Key : strings .ToUpper (hex .EncodeToString (encodedKey )), RegionID : regionID , Value : data }
241
+ return append ([]* helper.MvccKV {}, idxData , tempIdxData ), err
231
242
}
232
243
233
244
// formValue2DatumRow converts URL query string to a Datum Row.
0 commit comments