Skip to content

Replace p_batch_free_cancel with p_rlse #8528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/remote/client/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3333,8 +3333,8 @@ void Batch::cancel(CheckStatusWrapper* status)
PACKET* packet = &rdb->rdb_packet;
packet->p_operation = op_batch_cancel;

P_BATCH_FREE_CANCEL* batch = &packet->p_batch_free_cancel;
batch->p_batch_statement = statement->rsr_id;
P_RLSE* batch = &packet->p_rlse;
batch->p_rlse_object = statement->rsr_id;

send_and_receive(status, rdb, packet);

Expand Down Expand Up @@ -3367,8 +3367,8 @@ void Batch::freeClientData(CheckStatusWrapper* status, bool force)
PACKET* packet = &rdb->rdb_packet;
packet->p_operation = op_batch_rls;

P_BATCH_FREE_CANCEL* batch = &packet->p_batch_free_cancel;
batch->p_batch_statement = statement->rsr_id;
P_RLSE* batch = &packet->p_rlse;
batch->p_rlse_object = statement->rsr_id;

if (rdb->rdb_port->port_flags & PORT_lazy)
{
Expand Down
18 changes: 6 additions & 12 deletions src/remote/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,15 @@ bool_t xdr_protocol(RemoteXdr* xdrs, PACKET* p)
case op_commit_retaining:
case op_rollback_retaining:
case op_allocate_statement:
case op_batch_rls:
case op_batch_cancel:
release = &p->p_rlse;
MAP(xdr_short, reinterpret_cast<SSHORT&>(release->p_rlse_object));
DEBUG_PRINTSIZE(xdrs, p->p_operation);
#ifdef NEVERDEF
if (xdrs->x_op != XDR_FREE && (p->p_operation == op_batch_rls || p->p_operation == op_batch_cancel))
DEB_RBATCH(fprintf(stderr, "BatRem: xdr release/cancel %d\n", p->p_operation));
#endif
return P_TRUE(xdrs, p);

case op_prepare2:
Expand Down Expand Up @@ -1081,18 +1087,6 @@ bool_t xdr_protocol(RemoteXdr* xdrs, PACKET* p)
return P_TRUE(xdrs, p);
}

case op_batch_rls:
case op_batch_cancel:
{
P_BATCH_FREE_CANCEL* b = &p->p_batch_free_cancel;
MAP(xdr_short, reinterpret_cast<SSHORT&>(b->p_batch_statement));

if (xdrs->x_op != XDR_FREE)
DEB_RBATCH(fprintf(stderr, "BatRem: xdr release/cancel %d\n", p->p_operation));

return P_TRUE(xdrs, p);
}

case op_batch_sync:
{
return P_TRUE(xdrs, p);
Expand Down
6 changes: 0 additions & 6 deletions src/remote/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,11 +750,6 @@ typedef struct p_batch_cs // completion state
ULONG p_batch_errors; // error's recnums
} P_BATCH_CS;

typedef struct p_batch_free_cancel
{
OBJCT p_batch_statement; // statement object
} P_BATCH_FREE_CANCEL;

typedef struct p_batch_blob
{
OBJCT p_batch_statement; // statement object
Expand Down Expand Up @@ -838,7 +833,6 @@ typedef struct packet
P_BATCH_CREATE p_batch_create; // Create batch interface
P_BATCH_MSG p_batch_msg; // Add messages to batch
P_BATCH_EXEC p_batch_exec; // Run batch
P_BATCH_FREE_CANCEL p_batch_free_cancel; // Cancel or destroy batch
P_BATCH_CS p_batch_cs; // Batch completion state
P_BATCH_BLOB p_batch_blob; // BLOB stream portion in batch
P_BATCH_REGBLOB p_batch_regblob; // Register already existing BLOB in batch
Expand Down
4 changes: 2 additions & 2 deletions src/remote/remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -1725,8 +1725,8 @@ struct rem_port : public Firebird::GlobalStorage, public Firebird::RefCounted
void batch_blob_stream(P_BATCH_BLOB*, PACKET*);
void batch_regblob(P_BATCH_REGBLOB*, PACKET*);
void batch_exec(P_BATCH_EXEC*, PACKET*);
void batch_rls(P_BATCH_FREE_CANCEL*, PACKET*);
void batch_cancel(P_BATCH_FREE_CANCEL*, PACKET*);
void batch_rls(P_RLSE*, PACKET*);
void batch_cancel(P_RLSE*, PACKET*);
void batch_sync(PACKET*);
void batch_bpb(P_BATCH_SETBPB*, PACKET*);
void replicate(P_REPLICATE*, PACKET*);
Expand Down
12 changes: 6 additions & 6 deletions src/remote/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3810,13 +3810,13 @@ void rem_port::batch_exec(P_BATCH_EXEC* batch, PACKET* sendL)
}


void rem_port::batch_rls(P_BATCH_FREE_CANCEL* batch, PACKET* sendL)
void rem_port::batch_rls(P_RLSE* batch, PACKET* sendL)
{
LocalStatus ls;
CheckStatusWrapper status_vector(&ls);

Rsr* statement;
getHandle(statement, batch->p_batch_statement);
getHandle(statement, batch->p_rlse_object);
statement->checkIface();
statement->checkBatch();

Expand All @@ -3827,13 +3827,13 @@ void rem_port::batch_rls(P_BATCH_FREE_CANCEL* batch, PACKET* sendL)
}


void rem_port::batch_cancel(P_BATCH_FREE_CANCEL* batch, PACKET* sendL)
void rem_port::batch_cancel(P_RLSE* batch, PACKET* sendL)
{
LocalStatus ls;
CheckStatusWrapper status_vector(&ls);

Rsr* statement;
getHandle(statement, batch->p_batch_statement);
getHandle(statement, batch->p_rlse_object);
statement->checkIface();
statement->checkBatch();

Expand Down Expand Up @@ -5324,11 +5324,11 @@ static bool process_packet(rem_port* port, PACKET* sendL, PACKET* receive, rem_p
break;

case op_batch_rls:
port->batch_rls(&receive->p_batch_free_cancel, sendL);
port->batch_rls(&receive->p_rlse, sendL);
break;

case op_batch_cancel:
port->batch_cancel(&receive->p_batch_free_cancel, sendL);
port->batch_cancel(&receive->p_rlse, sendL);
break;

case op_batch_sync:
Expand Down
Loading