File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 59
59
60
60
#include "common/int.h"
61
61
#include "common/logging.h"
62
+ #include "fe_utils/cancel.h"
62
63
#include "fe_utils/conditional.h"
63
64
#include "getopt_long.h"
64
65
#include "libpq-fe.h"
@@ -3894,6 +3895,9 @@ initGenerateDataClientSide(PGconn *con)
3894
3895
exit (1 );
3895
3896
}
3896
3897
3898
+ if (CancelRequested )
3899
+ break ;
3900
+
3897
3901
/*
3898
3902
* If we want to stick with the original logging, print a message each
3899
3903
* 100k inserted rows.
@@ -4109,6 +4113,9 @@ runInitSteps(const char *initialize_steps)
4109
4113
if ((con = doConnect ()) == NULL )
4110
4114
exit (1 );
4111
4115
4116
+ setup_cancel_handler (NULL );
4117
+ SetCancelConn (con );
4118
+
4112
4119
for (step = initialize_steps ; * step != '\0' ; step ++ )
4113
4120
{
4114
4121
instr_time start ;
@@ -4176,6 +4183,7 @@ runInitSteps(const char *initialize_steps)
4176
4183
}
4177
4184
4178
4185
fprintf (stderr , "done in %.2f s (%s).\n" , run_time , stats .data );
4186
+ ResetCancelConn ();
4179
4187
PQfinish (con );
4180
4188
termPQExpBuffer (& stats );
4181
4189
}
You can’t perform that action at this time.
0 commit comments