Example #1
0
CRUTbl *CRUCache::FetchSingleUsedObject(CRUMV *pUsingMV, 
										const CDDUIDTriple &uidt)
{
	CRUTbl *pTbl;
	BOOL isMV = pUsingMV->IsUsedObjectAnMV(uidt.objUID);

	if (FALSE == isMV) 
	{
		CDDTable *pddTable = GetDDTableByUID(uidt);
		pTbl = new CRURegularTbl(pddTable);
	}
	else 
	{
		CDDMV *pddMV = GetDDMVByUID(uidt);
		pTbl = new CRUMVTbl(pddMV);

		// Read the REFRESH-specific metadata
		pddMV->FetchMVRefreshMetadata();

		// A table based on MV will always inherit the MV's timestamp
		pTbl->SetTimestamp(pddMV->GetRefreshedAtTimestamp());

		// Inherit the MV's feature.
		// If a table is NOT an involved MV, take care not to remove 
		// its dangling DDL lock (if any) accidentally.
		pTbl->SetReleaseDDLLock(pddMV->CanCancelDDLLock());
	}

	pTbl->SetInvolved();
	tableList_.AddTail(pTbl);

	return pTbl;
}