8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 18:03:04 +01:00

Fixed bug #7499 : Problem with restore

This commit is contained in:
Vlad Khorsun 2023-03-28 14:00:23 +03:00
parent 0faaf44b53
commit 476d028596
3 changed files with 14 additions and 15 deletions

View File

@ -371,7 +371,8 @@ void ERR_warning(const Arg::StatusVector& v)
FbStatusVector* s = tdbb->tdbb_status_vector;
v.copyTo(s);
tdbb->getRequest()->req_flags |= req_warning;
if (jrd_req* request = tdbb->getRequest())
request->req_flags |= req_warning;
}

View File

@ -1013,10 +1013,15 @@ static void check_indices(const CompilerScratch::csb_repeat* csb_tail)
// if there were no indices fetched at all but the
// user specified some, error out using the first index specified
if (!csb_tail->csb_indices && plan->accessType && !tdbb->getAttachment()->isGbak())
const bool isGbak = tdbb->getAttachment()->isGbak();
if (!csb_tail->csb_indices && plan->accessType)
{
// index %s cannot be used in the specified plan
ERR_post(Arg::Gds(isc_index_unused) << plan->accessType->items[0].indexName);
if (isGbak)
ERR_post_warning(Arg::Warning(isc_index_unused) << plan->accessType->items[0].indexName);
else
ERR_post(Arg::Gds(isc_index_unused) << plan->accessType->items[0].indexName);
}
// check to make sure that all indices are either used or marked not to be used,
@ -1036,7 +1041,10 @@ static void check_indices(const CompilerScratch::csb_repeat* csb_tail)
index_name = "";
// index %s cannot be used in the specified plan
ERR_post(Arg::Gds(isc_index_unused) << Arg::Str(index_name));
if (isGbak)
ERR_post_warning(Arg::Warning(isc_index_unused) << Arg::Str(index_name));
else
ERR_post(Arg::Gds(isc_index_unused) << Arg::Str(index_name));
}
++idx;

View File

@ -1694,17 +1694,7 @@ void PAR_warning(const Arg::StatusVector& v)
*
**************************************/
fb_assert(v.value()[0] == isc_arg_warning);
thread_db* tdbb = JRD_get_thread_data();
// Make sure that the [1] position is 0 indicating that no error has occurred
Arg::Gds p(FB_SUCCESS);
// Now place your warning messages
p.append(v);
// Save into tdbb
p.copyTo(tdbb->tdbb_status_vector);
ERR_post_warning(v);
}