@@ -978,7 +978,7 @@ bool IDX_activate_index(thread_db* tdbb, Cached::Relation* relation, MetaId id)
978978}
979979
980980
981- void IDX_mark_index (thread_db* tdbb, Cached::Relation* relation, MetaId id)
981+ bool IDX_mark_index (thread_db* tdbb, Cached::Relation* relation, MetaId id)
982982{
983983/* *************************************
984984 *
@@ -992,13 +992,19 @@ void IDX_mark_index(thread_db* tdbb, Cached::Relation* relation, MetaId id)
992992 **************************************/
993993 SET_TDBB (tdbb);
994994
995- auto * relPages = relation->fillPages (tdbb);
996- fb_assert (relPages->rel_index_root );
995+ auto * relPages = relation->getPages (tdbb, MAX_TRA_NUMBER , false );
996+ if (relPages)
997+ {
998+ fb_assert (relPages->rel_index_root );
997999
998- WIN window (relPages->rel_pg_space_id , relPages->rel_index_root );
999- index_root_page* root = BTR_fetch_root_for_update (FB_FUNCTION , tdbb, &window);
1000+ WIN window (relPages->rel_pg_space_id , relPages->rel_index_root );
1001+ index_root_page* root = BTR_fetch_root_for_update (FB_FUNCTION , tdbb, &window);
10001002
1001- BTR_mark_index_for_delete (tdbb, relation, id, &window, root, 0 );
1003+ BTR_mark_index_for_delete (tdbb, relation, id, &window, root, 0 );
1004+ return true ;
1005+ }
1006+
1007+ return false ;
10021008}
10031009
10041010void IDX_mark_temp (thread_db* tdbb, RelationPermanent* relation, MetaId id, Attachment* current, TraNumber tran)
@@ -1087,40 +1093,6 @@ void IDX_delete_indices(thread_db* tdbb, RelationPermanent* relation, RelationPa
10871093}
10881094
10891095
1090- void IDX_mark_indices (thread_db* tdbb, Cached::Relation* relation)
1091- {
1092- /* *************************************
1093- *
1094- * I D X _ m a r k _ i n d i c e s
1095- *
1096- **************************************
1097- *
1098- * Functional description
1099- * Mark all known indices for delete in preparation for deleting a
1100- * complete relation.
1101- *
1102- **************************************/
1103- SET_TDBB (tdbb);
1104-
1105- auto * relPages = relation->fillPages (tdbb);
1106- fb_assert (relPages->rel_index_root );
1107-
1108- WIN window (relPages->rel_pg_space_id , relPages->rel_index_root );
1109- index_root_page* root = BTR_fetch_root_for_update (FB_FUNCTION , tdbb, &window);
1110-
1111- // loop through pagespaces and mark for delete %%%%%%
1112- // if ((relation->rel_flags & REL_temp_conn) && (relPages->rel_instance_id != 0))
1113-
1114- for (USHORT i = 0 ; i < root->irt_count ; i++)
1115- {
1116- BTR_mark_index_for_delete (tdbb, relation, i, &window, root, 0 );
1117- root = BTR_fetch_root_for_update (FB_FUNCTION , tdbb, &window);
1118- }
1119-
1120- CCH_RELEASE (tdbb, &window);
1121- }
1122-
1123-
11241096void IDX_erase (thread_db* tdbb, record_param* rpb, jrd_tra* transaction)
11251097{
11261098/* *************************************
0 commit comments