8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:03:02 +01:00

Improvement CORE-4880 - Increase speed of creating package when number of its functions more than several hundreds.

This commit is contained in:
asfernandes 2015-08-03 01:27:37 +00:00
parent 2b401cbbb8
commit c272477a97
2 changed files with 18 additions and 40 deletions

View File

@ -211,8 +211,6 @@ Function* Function::loadMetadata(thread_db* tdbb, USHORT id, bool noscan, USHORT
if (!noscan)
{
bool valid_blr = true;
AutoCacheRequest request_fun(tdbb, irq_l_functions, IRQ_REQUESTS);
FOR(REQUEST_HANDLE request_fun)
@ -457,31 +455,22 @@ Function* Function::loadMetadata(thread_db* tdbb, USHORT id, bool noscan, USHORT
function->setImplemented(false);
}
if (X.RDB$VALID_BLR.NULL || X.RDB$VALID_BLR == FALSE)
valid_blr = false;
function->flags |= Routine::FLAG_SCANNED;
}
END_FOR
if (!dbb->readOnly() && !valid_blr)
{
// if the BLR was marked as invalid but the function was compiled,
// mark the BLR as valid
AutoRequest request_set_valid;
FOR(REQUEST_HANDLE request_set_valid)
F IN RDB$FUNCTIONS WITH
F.RDB$FUNCTION_ID EQ function->getId() AND F.RDB$FUNCTION_BLR NOT MISSING
if (!dbb->readOnly() &&
!X.RDB$FUNCTION_BLR.NULL &&
!X.RDB$VALID_BLR.NULL && X.RDB$VALID_BLR == FALSE)
{
MODIFY F USING
F.RDB$VALID_BLR = TRUE;
F.RDB$VALID_BLR.NULL = FALSE;
// If the BLR was marked as invalid but the function was compiled,
// mark the BLR as valid.
MODIFY X USING
X.RDB$VALID_BLR = TRUE;
X.RDB$VALID_BLR.NULL = FALSE;
END_MODIFY
}
END_FOR
}
END_FOR
}
// Make sure that it is really being scanned

View File

@ -3213,8 +3213,6 @@ jrd_prc* MET_procedure(thread_db* tdbb, USHORT id, bool noscan, USHORT flags)
if (!noscan)
{
bool valid_blr = true;
AutoCacheRequest request(tdbb, irq_r_procedure, IRQ_REQUESTS);
FOR(REQUEST_HANDLE request)
@ -3416,31 +3414,22 @@ jrd_prc* MET_procedure(thread_db* tdbb, USHORT id, bool noscan, USHORT flags)
procedure->setImplemented(false);
}
if (P.RDB$VALID_BLR.NULL || P.RDB$VALID_BLR == FALSE)
valid_blr = false;
}
END_FOR
procedure->flags |= Routine::FLAG_SCANNED;
procedure->flags |= Routine::FLAG_SCANNED;
if (!dbb->readOnly() && !valid_blr)
{
// if the BLR was marked as invalid but the procedure was compiled,
// mark the BLR as valid
AutoRequest request5;
FOR(REQUEST_HANDLE request5)
P IN RDB$PROCEDURES WITH
P.RDB$PROCEDURE_ID EQ procedure->getId() AND P.RDB$PROCEDURE_BLR NOT MISSING
if (!dbb->readOnly() &&
!P.RDB$PROCEDURE_BLR.NULL &&
!P.RDB$VALID_BLR.NULL && P.RDB$VALID_BLR == FALSE)
{
// If the BLR was marked as invalid but the procedure was compiled,
// mark the BLR as valid.
MODIFY P USING
P.RDB$VALID_BLR = TRUE;
P.RDB$VALID_BLR.NULL = FALSE;
END_MODIFY
}
END_FOR
}
END_FOR
} // if !noscan
// Make sure that it is really being scanned