Skip to content

Commit 08401bd

Browse files
committed
Remove now-dead prepend-savepoint machinery
With the #203 fix, SetStatementSvp no longer defers the internal SAVEPOINT to be prepended onto the next query, so PREPEND_IN_PROGRESS is never set. Remove the unreachable prepend handling in CC_send_query_append (the prepend_savepoint local and its branch) and the PREPEND_IN_PROGRESS enumerator. No behavior change.
1 parent 3affd6f commit 08401bd

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

connection.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ CC_send_query_append(ConnectionClass *self, const char *query, QueryInfo *qi, UD
18751875
create_keyset = ((flag & CREATE_KEYSET) != 0),
18761876
issue_begin = ((flag & GO_INTO_TRANSACTION) != 0 && !CC_is_in_trans(self)),
18771877
rollback_on_error, query_rollback, end_with_commit,
1878-
read_only, prepend_savepoint = FALSE,
1878+
read_only,
18791879
ignore_roundtrip_time = ((self->connInfo.extra_opts & BIT_IGNORE_ROUND_TRIP_TIME) != 0);
18801880

18811881
char *ptr;
@@ -1979,16 +1979,12 @@ CC_send_query_append(ConnectionClass *self, const char *query, QueryInfo *qi, UD
19791979
}
19801980
}
19811981

1982-
/* prepend internal savepoint command ? */
1983-
if (PREPEND_IN_PROGRESS == self->internal_op)
1984-
prepend_savepoint = TRUE;
1985-
19861982
/* append all these together, to avoid round-trips */
19871983
query_len = strlen(query);
19881984
MYLOG(0, "query_len=" FORMAT_SIZE_T "\n", query_len);
19891985

19901986
initPQExpBuffer(&query_buf);
1991-
/* issue_begin, query_rollback and prepend_savepoint are exclusive */
1987+
/* issue_begin and query_rollback are exclusive */
19921988
if (issue_begin)
19931989
{
19941990
appendPQExpBuffer(&query_buf, "%s;", bgncmd);
@@ -1999,14 +1995,6 @@ CC_send_query_append(ConnectionClass *self, const char *query, QueryInfo *qi, UD
19991995
appendPQExpBuffer(&query_buf, "%s %s;", svpcmd, per_query_svp);
20001996
discard_next_savepoint = TRUE;
20011997
}
2002-
else if (prepend_savepoint)
2003-
{
2004-
char prepend_cmd[128];
2005-
2006-
GenerateSvpCommand(self, INTERNAL_SAVEPOINT_OPERATION, prepend_cmd, sizeof(prepend_cmd));
2007-
appendPQExpBuffer(&query_buf, "%s;", prepend_cmd);
2008-
self->internal_op = SAVEPOINT_IN_PROGRESS;
2009-
}
20101998
appendPQExpBufferStr(&query_buf, query);
20111999
if (appendq)
20122000
{

connection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ int GenerateSvpCommand(ConnectionClass *conn, int type, char *cmd, int bufsize);
521521
/* Operations in progress */
522522
enum {
523523
SAVEPOINT_IN_PROGRESS = 1
524-
,PREPEND_IN_PROGRESS
525524
};
526525
/* StatementSvp entry option */
527526
enum {

0 commit comments

Comments
 (0)