diff --git a/src/jrd/btr.cpp b/src/jrd/btr.cpp index b38e690e52..17f3c8f458 100644 --- a/src/jrd/btr.cpp +++ b/src/jrd/btr.cpp @@ -1542,6 +1542,8 @@ void BTR_reserve_slot(thread_db* tdbb, jrd_rel* relation, jrd_tra* transaction, const Database* dbb = tdbb->tdbb_database; CHECK_DBB(dbb); + fb_assert(relation && relation->rel_index_root); + // Get root page, assign an index id, and store the index descriptor. // Leave the root pointer null for the time being. WIN window(relation->rel_index_root); diff --git a/src/jrd/idx.cpp b/src/jrd/idx.cpp index a536c609e2..0212859b64 100644 --- a/src/jrd/idx.cpp +++ b/src/jrd/idx.cpp @@ -193,6 +193,10 @@ void IDX_create_index( isc_arg_string, ERR_cstring(relation->rel_name), 0); } + if (!relation->rel_index_root) { + get_root_page(tdbb, relation); + } + BTR_reserve_slot(tdbb, relation, transaction, idx); if (index_id) {