mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 02:03:04 +01:00
Fixed bug #7499 : Problem with restore
This commit is contained in:
parent
7fb0a59dce
commit
58ed9926e7
@ -359,7 +359,8 @@ void ERR_warning(const Arg::StatusVector& v)
|
||||
|
||||
v.copyTo(s);
|
||||
DEBUG;
|
||||
tdbb->getRequest()->req_flags |= req_warning;
|
||||
if (jrd_req* request = tdbb->getRequest())
|
||||
request->req_flags |= req_warning;
|
||||
}
|
||||
|
||||
|
||||
|
@ -990,10 +990,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,
|
||||
@ -1013,7 +1018,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;
|
||||
|
@ -1707,17 +1707,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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -364,16 +364,16 @@ int TipCache::snapshotState(thread_db* tdbb, TraNumber number)
|
||||
Lock temp_lock(tdbb, sizeof(TraNumber), LCK_tra);
|
||||
temp_lock.lck_key.lck_long = number;
|
||||
|
||||
// If we can't get a lock on the transaction, it must be active.
|
||||
|
||||
if (!LCK_lock(tdbb, &temp_lock, LCK_read, LCK_NO_WAIT))
|
||||
{
|
||||
fb_utils::init_status(tdbb->tdbb_status_vector);
|
||||
return tra_active;
|
||||
}
|
||||
ThreadStatusGuard tempStatus(tdbb);
|
||||
|
||||
fb_utils::init_status(tdbb->tdbb_status_vector);
|
||||
LCK_release(tdbb, &temp_lock);
|
||||
// If we can't get a lock on the transaction, it must be active.
|
||||
|
||||
if (!LCK_lock(tdbb, &temp_lock, LCK_read, LCK_NO_WAIT))
|
||||
return tra_active;
|
||||
|
||||
LCK_release(tdbb, &temp_lock);
|
||||
}
|
||||
|
||||
// as a last resort we must look at the TIP page to see
|
||||
// whether the transaction is committed or dead; to minimize
|
||||
|
Loading…
Reference in New Issue
Block a user