@@ -588,10 +588,34 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
588
588
spi_response_t * r2 ;
589
589
spi_response_t * r3 ;
590
590
591
- const char * get_sql = "select * from at_jobs_process where id = $1" ;
592
- const char * insert_sql = "insert into at_jobs_done values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)" ;
591
+
592
+
593
+
594
+ const char * get_sql = "\
595
+ select \
596
+ id, node, name, comments, at, do_sql, params, depends_on, \
597
+ executor, owner, last_start_available, attempt, resubmit_limit, \
598
+ postpone, max_run_time, canceled, submit_time, start_time \
599
+ from at_jobs_process where id = $1" ;
600
+
601
+ const char * insert_sql = "\
602
+ insert into at_jobs_done \
603
+ (id, node, name, comments, at, do_sql, params, depends_on, \
604
+ executor, owner, last_start_available, attempt, resubmit_limit, \
605
+ postpone, max_run_time, canceled, submit_time, start_time, \
606
+ status, reason, done_time) \
607
+ values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, \
608
+ $15, $16, $17, $18, $19, $20, $21)" ;
593
609
const char * delete_sql = "delete from at_jobs_process where id = $1" ;
594
- const char * resubmit_sql = "insert into at_jobs_submitted values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)" ;
610
+
611
+ const char * resubmit_sql = "\
612
+ insert into at_jobs_submitted \
613
+ (id, node, name, comments, at, do_sql, params, depends_on, \
614
+ executor, owner, last_start_available, attempt, resubmit_limit, \
615
+ postpone, max_run_time, canceled, submit_time) \
616
+ values \
617
+ ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, \
618
+ $15, $16, $17)" ;
595
619
596
620
oldpath = set_schema (NULL , true);
597
621
@@ -636,7 +660,7 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
636
660
{
637
661
if (canceled )
638
662
{
639
- this_error = _mcopy_string (CurrentMemoryContext , "job was canceled while processing: cannot resubmit" );
663
+ this_error = _mcopy_string (CurrentMemoryContext , "job was cancelled while processing: cannot resubmit" );
640
664
sql = insert_sql ;
641
665
n = 21 ;
642
666
@@ -649,6 +673,7 @@ int set_at_job_done(job_t *job, char *error, int64 resubmit, char **set_error)
649
673
sql = resubmit_sql ;
650
674
values [4 ] = TimestampTzGetDatum (timestamp_add_seconds (0 , resubmit ));
651
675
values [11 ] = Int64GetDatum (job -> attempt + 1 );
676
+ nulls [4 ] = nulls [11 ] = ' ' ;
652
677
n = 17 ;
653
678
}
654
679
else
0 commit comments