@@ -1392,7 +1392,7 @@ repack_one_table(repack_table *table, const char *orderby)
1392
1392
elog (DEBUG2 , "---- drop ----" );
1393
1393
1394
1394
command ("BEGIN ISOLATION LEVEL READ COMMITTED" , 0 , NULL );
1395
- params [1 ] = utoa (temp_obj_num , pgut_strdup ( buffer ) );
1395
+ params [1 ] = utoa (temp_obj_num , indexbuffer );
1396
1396
command ("SELECT repack.repack_drop($1, $2)" , 2 , params );
1397
1397
command ("COMMIT" , 0 , NULL );
1398
1398
temp_obj_num = 0 ; /* reset temporary object counter after cleanup */
@@ -1414,7 +1414,7 @@ repack_one_table(repack_table *table, const char *orderby)
1414
1414
1415
1415
/* Release advisory lock on table. */
1416
1416
params [0 ] = REPACK_LOCK_PREFIX_STR ;
1417
- params [1 ] = utoa (table -> target_oid , pgut_strdup ( buffer ) );
1417
+ params [1 ] = utoa (table -> target_oid , buffer );
1418
1418
1419
1419
res = pgut_execute (connection , "SELECT pg_advisory_unlock($1, CAST(-2147483648 + $2::bigint AS integer))" ,
1420
1420
2 , params );
@@ -1703,11 +1703,12 @@ repack_cleanup_callback(bool fatal, void *userdata)
1703
1703
Oid target_table = * (Oid * ) userdata ;
1704
1704
const char * params [2 ];
1705
1705
char buffer [12 ];
1706
+ char num_buff [12 ];
1706
1707
1707
1708
if (fatal )
1708
1709
{
1709
1710
params [0 ] = utoa (target_table , buffer );
1710
- params [1 ] = utoa (temp_obj_num , pgut_strdup ( buffer ) );
1711
+ params [1 ] = utoa (temp_obj_num , num_buff );
1711
1712
1712
1713
/* testing PQstatus() of connection and conn2, as we do
1713
1714
* in repack_cleanup(), doesn't seem to work here,
@@ -1733,6 +1734,7 @@ repack_cleanup(bool fatal, const repack_table *table)
1733
1734
else
1734
1735
{
1735
1736
char buffer [12 ];
1737
+ char num_buff [12 ];
1736
1738
const char * params [2 ];
1737
1739
1738
1740
/* Try reconnection if not available. */
@@ -1742,7 +1744,7 @@ repack_cleanup(bool fatal, const repack_table *table)
1742
1744
1743
1745
/* do cleanup */
1744
1746
params [0 ] = utoa (table -> target_oid , buffer );
1745
- params [1 ] = utoa (temp_obj_num , pgut_strdup ( buffer ) );
1747
+ params [1 ] = utoa (temp_obj_num , num_buff );
1746
1748
command ("SELECT repack.repack_drop($1, $2)" , 2 , params );
1747
1749
temp_obj_num = 0 ; /* reset temporary object counter after cleanup */
1748
1750
}
0 commit comments