@@ -892,7 +892,7 @@ func tsOrNull(micros int64) (tree.Datum, error) {
892892 return tree .DNull , nil
893893 }
894894 ts := timeutil .Unix (0 , micros * time .Microsecond .Nanoseconds ())
895- return tree .MakeDTimestamp (ts , time .Microsecond )
895+ return tree .MakeDTimestampTZ (ts , time .Microsecond )
896896}
897897
898898const (
@@ -1117,7 +1117,7 @@ func wrapPayloadUnMarshalError(err error, jobID tree.Datum) error {
11171117}
11181118
11191119const (
1120- jobsQSelect = `SELECT id, status, created, payload, progress, claim_session_id, claim_instance_id`
1120+ jobsQSelect = `SELECT id, status, created::timestamptz , payload, progress, claim_session_id, claim_instance_id`
11211121 // Note that we are querying crdb_internal.system_jobs instead of system.jobs directly.
11221122 // The former has access control built in and will filter out jobs that the
11231123 // user is not allowed to see.
@@ -1126,7 +1126,7 @@ const (
11261126 jobsStatusFilter = ` WHERE status = $3`
11271127 oldJobsTypeFilter = ` WHERE crdb_internal.job_payload_type(payload) = $3`
11281128 jobsTypeFilter = ` WHERE job_type = $3`
1129- jobsQuery = jobsQSelect + `, last_run, COALESCE(num_runs, 0), ` + jobs .NextRunClause +
1129+ jobsQuery = jobsQSelect + `, last_run::timestamptz , COALESCE(num_runs, 0), ` + jobs .NextRunClause +
11301130 ` as next_run` + jobsQFrom + ", " + jobsBackoffArgs
11311131)
11321132
@@ -1149,17 +1149,17 @@ CREATE TABLE crdb_internal.jobs (
11491149 descriptor_ids INT[],
11501150 status STRING,
11511151 running_status STRING,
1152- created TIMESTAMP ,
1153- started TIMESTAMP ,
1154- finished TIMESTAMP ,
1155- modified TIMESTAMP ,
1152+ created TIMESTAMPTZ ,
1153+ started TIMESTAMPTZ ,
1154+ finished TIMESTAMPTZ ,
1155+ modified TIMESTAMPTZ ,
11561156 fraction_completed FLOAT,
11571157 high_water_timestamp DECIMAL,
11581158 error STRING,
11591159 coordinator_id INT,
11601160 trace_id INT,
1161- last_run TIMESTAMP ,
1162- next_run TIMESTAMP ,
1161+ last_run TIMESTAMPTZ ,
1162+ next_run TIMESTAMPTZ ,
11631163 num_runs INT,
11641164 execution_errors STRING[],
11651165 execution_events JSONB,
@@ -1258,7 +1258,7 @@ func makeJobsTableRows(
12581258 // marshalled.
12591259 id = tree .NewDInt (tree .DInt (job .JobID ))
12601260 status = tree .NewDString (string (jobs .StatusPending ))
1261- created = eval . TimestampToInexactDTimestamp ( p .txn .ReadTimestamp ())
1261+ created = tree . MustMakeDTimestampTZ ( timeutil . Unix ( 0 , p .txn .ReadTimestamp (). WallTime ), time . Microsecond )
12621262 progressBytes , payloadBytes , err = getPayloadAndProgressFromJobsRecord (p , job )
12631263 if err != nil {
12641264 return matched , err
0 commit comments