@@ -1617,16 +1617,23 @@ int scheduler_make_atcron_record(scheduler_manager_ctx_t *ctx)
1617
1617
void clean_at_table (scheduler_manager_ctx_t * ctx )
1618
1618
{
1619
1619
spi_response_t * r ;
1620
+ Oid argtypes [1 ]= {TEXTOID };
1621
+ Datum args [1 ];
1620
1622
MemoryContext mem = init_mem_ctx ("clean ctx" );
1621
1623
1624
+ args [0 ]= PointerGetDatum (cstring_to_text (ctx -> nodename ));
1625
+
1622
1626
START_SPI_SNAP ();
1623
- r = execute_spi (mem ,"truncate at" );
1627
+ r = execute_spi_sql_with_args (mem ,
1628
+ "delete from at where node = $1" ,1 ,argtypes ,args ,NULL );
1624
1629
if (r -> retval < 0 )
1625
1630
{
1626
1631
manager_fatal_error (ctx ,0 ,"Cannot clean 'at' table: %s" ,r -> error );
1627
1632
}
1628
1633
destroy_spi_data (r );
1629
- r = execute_spi (mem ,"update cron set _next_exec_time = NULL where _next_exec_time is not NULL" );
1634
+ r = execute_spi_sql_with_args (mem ,
1635
+ "update cron set _next_exec_time = NULL where _next_exec_time is not NULL and node = $1" ,
1636
+ 1 ,argtypes ,args ,NULL );
1630
1637
if (r -> retval < 0 )
1631
1638
{
1632
1639
manager_fatal_error (ctx ,0 ,"Cannot clean cron _next time: %s" ,