Skip to content

Commit

Permalink
types/data: the bit operation didn't parse correctly (pingcap#11895)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoxingliang authored and root committed Sep 26, 2019
1 parent 5bd621e commit a68a052
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions types/datum.go
Original file line number Diff line number Diff line change
Expand Up @@ -1225,8 +1225,7 @@ func (d *Datum) convertToMysqlBit(sc *stmtctx.StatementContext, target *FieldTyp
uintValue, err = uintDatum.GetUint64(), err1
}
if target.Flen < 64 && uintValue >= 1<<(uint64(target.Flen)) {
err = ErrDataTooLong.GenWithStack("Data Too Long, field len %d", target.Flen)
return Datum{}, errors.Trace(err)
return Datum{}, errors.Trace(ErrDataTooLong.GenWithStack("Data Too Long, field len %d", target.Flen))
}
byteSize := (target.Flen + 7) >> 3
ret.SetMysqlBit(NewBinaryLiteralFromUint(uintValue, byteSize))
Expand Down

0 comments on commit a68a052

Please sign in to comment.