Skip to content

Commit 8769bec

Browse files
committed
server: support DTimestampTZ types in status server scans
Release note: none. Epic: CRDB-24406.
1 parent 1382b26 commit 8769bec

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

pkg/server/admin.go

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3524,24 +3524,30 @@ func (rs resultScanner) ScanIndex(row tree.Datums, index int, dst interface{}) e
35243524
}
35253525

35263526
case *time.Time:
3527-
s, ok := src.(*tree.DTimestamp)
3528-
if !ok {
3527+
switch s := src.(type) {
3528+
case *tree.DTimestamp:
3529+
*d = s.Time
3530+
case *tree.DTimestampTZ:
3531+
*d = s.Time
3532+
default:
35293533
return errors.Errorf("source type assertion failed")
35303534
}
3531-
*d = s.Time
35323535

35333536
// Passing a **time.Time instead of a *time.Time means the source is allowed
35343537
// to be NULL, in which case nil is stored into *src.
35353538
case **time.Time:
3536-
s, ok := src.(*tree.DTimestamp)
3537-
if !ok {
3538-
if src != tree.DNull {
3539+
switch s := src.(type) {
3540+
case *tree.DTimestamp:
3541+
*d = &s.Time
3542+
case *tree.DTimestampTZ:
3543+
*d = &s.Time
3544+
default:
3545+
if src == tree.DNull {
3546+
*d = nil
3547+
} else {
35393548
return errors.Errorf("source type assertion failed")
35403549
}
3541-
*d = nil
3542-
break
35433550
}
3544-
*d = &s.Time
35453551

35463552
case *[]byte:
35473553
s, ok := src.(*tree.DBytes)

0 commit comments

Comments
 (0)