Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#52365
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
hawkingrei authored and ti-chi-bot committed May 23, 2024
1 parent e98aba5 commit d716478
Showing 3 changed files with 5,077 additions and 0 deletions.
1,810 changes: 1,810 additions & 0 deletions pkg/planner/core/plan_cache_test.go

Large diffs are not rendered by default.

3,258 changes: 3,258 additions & 0 deletions tests/integrationtest/r/planner/core/partition_pruner.result

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions util/ranger/ranger.go
Original file line number Diff line number Diff line change
@@ -169,11 +169,20 @@ func convertPoint(sctx sessionctx.Context, point *point, tp *types.FieldType) (*
// see issue #20101: overflow when converting integer to year
} else if tp.GetType() == mysql.TypeBit && terror.ErrorEqual(err, types.ErrDataTooLong) {
// see issue #19067: we should ignore the types.ErrDataTooLong when we convert value to TypeBit value
<<<<<<< HEAD:util/ranger/ranger.go
} else if tp.GetType() == mysql.TypeNewDecimal && terror.ErrorEqual(err, types.ErrOverflow) {
// Ignore the types.ErrOverflow when we convert TypeNewDecimal values.
// A trimmed valid boundary point value would be returned then. Accordingly, the `excl` of the point
// would be adjusted. Impossible ranges would be skipped by the `validInterval` call later.
} else if point.value.Kind() == types.KindMysqlTime && tp.GetType() == mysql.TypeTimestamp && terror.ErrorEqual(err, types.ErrWrongValue) {
=======
} else if (newTp.GetType() == mysql.TypeNewDecimal || newTp.GetType() == mysql.TypeLonglong) && terror.ErrorEqual(err, types.ErrOverflow) {
// Ignore the types.ErrOverflow when we convert TypeNewDecimal/TypeLonglong values.
// A trimmed valid boundary point value would be returned then. Accordingly, the `excl` of the point
// would be adjusted. Impossible ranges would be skipped by the `validInterval` call later.
// tests in TestIndexRange/TestIndexRangeForDecimal
} else if point.value.Kind() == types.KindMysqlTime && newTp.GetType() == mysql.TypeTimestamp && terror.ErrorEqual(err, types.ErrWrongValue) {
>>>>>>> fe5858b00cd (ranger: handle longlong overflow properly (#52365)):pkg/util/ranger/ranger.go
// See issue #28424: query failed after add index
// Ignore conversion from Date[Time] to Timestamp since it must be either out of range or impossible date, which will not match a point select
} else if tp.GetType() == mysql.TypeEnum && terror.ErrorEqual(err, types.ErrTruncated) {

0 comments on commit d716478

Please sign in to comment.