MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / IDX_create_index_block

Function IDX_create_index_block

src/jrd/idx.cpp:983–1018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

981
982
983IndexBlock* IDX_create_index_block(thread_db* tdbb, jrd_rel* relation, USHORT id)
984{
985/**************************************
986 *
987 * I D X _ c r e a t e _ i n d e x _ b l o c k
988 *
989 **************************************
990 *
991 * Functional description
992 * Create an index block and an associated
993 * lock block for the specified index.
994 *
995 **************************************/
996 SET_TDBB(tdbb);
997 Database* dbb = tdbb->getDatabase();
998 CHECK_DBB(dbb);
999
1000 IndexBlock* index_block = FB_NEW_POOL(*relation->rel_pool) IndexBlock();
1001 index_block->idb_id = id;
1002
1003 // link the block in with the relation linked list
1004
1005 index_block->idb_next = relation->rel_index_blocks;
1006 relation->rel_index_blocks = index_block;
1007
1008 // create a shared lock for the index, to coordinate
1009 // any modification to the index so that the cached information
1010 // about the index will be discarded
1011
1012 Lock* lock = FB_NEW_RPT(*relation->rel_pool, 0)
1013 Lock(tdbb, sizeof(SLONG), LCK_expression, index_block, index_block_flush);
1014 index_block->idb_lock = lock;
1015 lock->setKey((relation->rel_id << 16) | index_block->idb_id);
1016
1017 return index_block;
1018}
1019
1020
1021void IDX_delete_index(thread_db* tdbb, jrd_rel* relation, USHORT id)

Callers 1

signal_index_deletionFunction · 0.85

Calls 6

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
getDatabaseMethod · 0.80
IndexBlockClass · 0.70
LockClass · 0.70
setKeyMethod · 0.45

Tested by

no test coverage detected