mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 15:23:03 +01:00
Frontported fix for CORE-5355: XpbBuilder fails to create new TPB
This commit is contained in:
parent
c98ca99ce2
commit
10a4cded1a
@ -48,6 +48,7 @@ int main()
|
||||
// status vector and main dispatcher
|
||||
ThrowStatusWrapper status(master->getStatus());
|
||||
IProvider* prov = master->getDispatcher();
|
||||
IUtil* utl = master->getUtilInterface();
|
||||
|
||||
// declare pointers to required interfaces
|
||||
IAttachment* att = NULL;
|
||||
@ -55,6 +56,7 @@ int main()
|
||||
IStatement* stmt = NULL;
|
||||
IMessageMetadata* meta = NULL;
|
||||
IMetadataBuilder* builder = NULL;
|
||||
IXpbBuilder* tpb = NULL;
|
||||
|
||||
// Interface provides access to data returned by SELECT statement
|
||||
IResultSet* curs = NULL;
|
||||
@ -64,8 +66,13 @@ int main()
|
||||
// attach employee db
|
||||
att = prov->attachDatabase(&status, "employee", 0, NULL);
|
||||
|
||||
// start default transaction
|
||||
tra = att->startTransaction(&status, 0, NULL);
|
||||
// start read only transaction
|
||||
tpb = utl->getXpbBuilder(&status, IXpbBuilder::TPB, NULL, 0);
|
||||
tpb->insertTag(&status, isc_tpb_read_committed);
|
||||
tpb->insertTag(&status, isc_tpb_no_rec_version);
|
||||
tpb->insertTag(&status, isc_tpb_wait);
|
||||
tpb->insertTag(&status, isc_tpb_read);
|
||||
tra = att->startTransaction(&status, tpb->getBufferLength(&status), tpb->getBuffer(&status));
|
||||
|
||||
// prepare statement
|
||||
stmt = att->prepare(&status, tra, 0, "select last_name, first_name, phone_ext from phone_list "
|
||||
@ -192,6 +199,8 @@ int main()
|
||||
tra->release();
|
||||
if (att)
|
||||
att->release();
|
||||
if (tpb)
|
||||
tpb->dispose();
|
||||
|
||||
prov->release();
|
||||
status.dispose();
|
||||
|
@ -739,6 +739,7 @@ public:
|
||||
: pb(NULL), strVal(getPool())
|
||||
{
|
||||
ClumpletReader::Kind k;
|
||||
UCHAR tag = 0;
|
||||
const ClumpletReader::KindList* kl = NULL;
|
||||
|
||||
switch(kind)
|
||||
@ -754,6 +755,7 @@ public:
|
||||
break;
|
||||
case TPB:
|
||||
k = ClumpletReader::Tpb;
|
||||
tag = isc_tpb_version3;
|
||||
break;
|
||||
default:
|
||||
fatal_exception::raiseFmt("Wrong parameters block kind %d, should be from %d to %d", kind, DPB, TPB);
|
||||
@ -765,7 +767,7 @@ public:
|
||||
if (kl)
|
||||
pb = FB_NEW_POOL(getPool()) ClumpletWriter(getPool(), kl, MAX_DPB_SIZE);
|
||||
else
|
||||
pb = FB_NEW_POOL(getPool()) ClumpletWriter(getPool(), k, MAX_DPB_SIZE);
|
||||
pb = FB_NEW_POOL(getPool()) ClumpletWriter(getPool(), k, MAX_DPB_SIZE, tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user