@@ -13503,6 +13503,8 @@ bool WriteRelationMeta::prepareBatch(BurpGlobals* tdgbl)
1350313503
1350413504void WriteRelationMeta::prepareRequest(BurpGlobals* tdgbl)
1350513505{
13506+ const bool use_bulk_insert = (tdgbl->runtimeODS >= DB_VERSION_DDL14);
13507+
1350613508 m_batchMode = false;
1350713509 m_inMgsNum = 0;
1350813510
@@ -13657,18 +13659,27 @@ void WriteRelationMeta::prepareRequest(BurpGlobals* tdgbl)
1365713659 add_byte(blr, blr_loop);
1365813660 add_byte(blr, blr_receive);
1365913661 add_byte(blr, 0);
13660- if (identity_type == IDENT_TYPE_ALWAYS)
13662+
13663+ if (!use_bulk_insert)
1366113664 {
13662- add_byte(blr, blr_store3);
13663- add_byte(blr, blr_store_override_system);
13665+ if (identity_type == IDENT_TYPE_ALWAYS)
13666+ {
13667+ add_byte(blr, blr_store3);
13668+ add_byte(blr, blr_store_override_system);
13669+ }
13670+ else
13671+ add_byte(blr, blr_store);
13672+
13673+ // Mark this store operation as bulk one
13674+ add_byte(blr, blr_marks);
13675+ add_byte(blr, 1);
13676+ add_byte(blr, 0x10); // must be Jrd::StatementNode::MARK_BULK_INSERT
1366413677 }
1366513678 else
13666- add_byte(blr, blr_store);
13667-
13668- // Mark this store operation as bulk one
13669- add_byte(blr, blr_marks);
13670- add_byte(blr, 1);
13671- add_byte(blr, 0x10); // must be Jrd::StatementNode::MARK_BULK_INSERT
13679+ {
13680+ add_byte(blr, blr_bulk_insert);
13681+ add_byte(blr, blr_null); // no source RSE
13682+ }
1367213683
1367313684 if (m_relation->rel_name.schema.hasData())
1367413685 {
@@ -13710,8 +13721,11 @@ void WriteRelationMeta::prepareRequest(BurpGlobals* tdgbl)
1371013721 }
1371113722
1371213723 add_byte(blr, blr_end);
13713- if (identity_type == IDENT_TYPE_ALWAYS)
13714- add_byte(blr, blr_null);
13724+ if (!use_bulk_insert)
13725+ {
13726+ if (identity_type == IDENT_TYPE_ALWAYS)
13727+ add_byte(blr, blr_null);
13728+ }
1371513729 add_byte(blr, blr_end);
1371613730 add_byte(blr, blr_eoc);
1371713731
@@ -13811,7 +13825,7 @@ void WriteRelationReq::send(BurpGlobals* tdgbl, ITransaction* tran, bool lastRec
1381113825 // memory when there are blobs and arrays fields - CORE-3802.
1381213826
1381313827 FbLocalStatus status;
13814- if (m_resync || m_recs % 1000 == 1)
13828+ if (m_resync || (( m_recs % 1000 == 1) && !tdgbl->gbl_use_auto_release_temp_blobid) )
1381513829 m_request->startAndSend(&status, tran, 0, 0, m_inMsg.getCount(), m_inMsg.begin());
1381613830 else
1381713831 m_request->send(&status, 0, 0, m_inMsg.getCount(), m_inMsg.begin());
0 commit comments