Date parameters are converted to string automatically #45190
Closed
Description
TiDB handles the date parameters as string, which is not expected. TiDB should construct a data, but not string for these parameters. See:
case mysql.TypeDate, mysql.TypeTimestamp, mysql.TypeDatetime:
if len(paramValues) < (pos + 1) {
err = mysql.ErrMalformPacket
return
}
// See https://dev.mysql.com/doc/internals/en/binary-protocol-value.html
// for more details.
length := paramValues[pos]
pos++
switch length {
case 0:
tmp = types.ZeroDatetimeStr
case 4:
pos, tmp = binaryDate(pos, paramValues)
case 7:
pos, tmp = binaryDateTime(pos, paramValues)
case 11:
pos, tmp = binaryTimestamp(pos, paramValues)
case 13:
pos, tmp = binaryTimestampWithTZ(pos, paramValues)
default:
err = mysql.ErrMalformPacket
return
}
args[i] = types.NewDatum(tmp) // FIXME: After check works!!!!!!
continue
Activity