| 1019 | |
| 1020 | |
| 1021 | void IDX_delete_index(thread_db* tdbb, jrd_rel* relation, USHORT id) |
| 1022 | { |
| 1023 | /************************************** |
| 1024 | * |
| 1025 | * I D X _ d e l e t e _ i n d e x |
| 1026 | * |
| 1027 | ************************************** |
| 1028 | * |
| 1029 | * Functional description |
| 1030 | * Delete a single index. |
| 1031 | * |
| 1032 | **************************************/ |
| 1033 | SET_TDBB(tdbb); |
| 1034 | |
| 1035 | signal_index_deletion(tdbb, relation, id); |
| 1036 | |
| 1037 | WIN window(get_root_page(tdbb, relation)); |
| 1038 | CCH_FETCH(tdbb, &window, LCK_write, pag_root); |
| 1039 | |
| 1040 | const bool tree_exists = BTR_delete_index(tdbb, &window, id); |
| 1041 | |
| 1042 | if ((relation->rel_flags & REL_temp_conn) && (relation->getPages(tdbb)->rel_instance_id != 0) && |
| 1043 | tree_exists) |
| 1044 | { |
| 1045 | IndexLock* idx_lock = CMP_get_index_lock(tdbb, relation, id); |
| 1046 | if (idx_lock) |
| 1047 | { |
| 1048 | if (!--idx_lock->idl_count) { |
| 1049 | LCK_release(tdbb, idx_lock->idl_lock); |
| 1050 | } |
| 1051 | } |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | |
| 1056 | void IDX_delete_indices(thread_db* tdbb, jrd_rel* relation, RelationPages* relPages) |
nothing calls this directly
no test coverage detected