Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: ailinkid <314806019@qq.com>
  • Loading branch information
AilinKid committed Dec 3, 2021
1 parent ffb94fc commit 4a549e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ddl/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -1353,9 +1353,9 @@ func (w *updateColumnWorker) getRowRecord(handle kv.Handle, recordKey []byte, ra
w.sessCtx.GetSessionVars().StmtCtx.SetWarnings(oldWarn)
val := w.rowMap[w.oldColInfo.ID]
col := w.newColInfo
if val.Kind() == types.KindNull && col.FieldType.Tp == mysql.TypeTimestamp {
if val.Kind() == types.KindNull && col.FieldType.Tp == mysql.TypeTimestamp && mysql.HasNotNullFlag(col.Flag) {
if v, err := expression.GetTimeCurrentTimestamp(w.sessCtx, col.Tp, int8(col.Decimal)); err == nil {
// convert null value to timestamp should be substituted with current timestamp.
// convert null value to timestamp should be substituted with current timestamp if NOT_NULL flag is set.
w.rowMap[w.oldColInfo.ID] = v
}
}
Expand Down

0 comments on commit 4a549e2

Please sign in to comment.