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

Fixed CORE-1249 plus minor corrections for the single-user shutdown mode.

The change in CCH allows to report isc_shutdown instead of the LM error code in Classic (GFIX depends on this behaviour).
This commit is contained in:
dimitr 2007-05-08 08:24:59 +00:00
parent 9c93e6cc6d
commit 0eab23976a
2 changed files with 10 additions and 4 deletions

View File

@ -440,6 +440,10 @@ bool CCH_exclusive(thread_db* tdbb, USHORT level, SSHORT wait_flag)
break;
}
// Clear the status vector, as our callers check the return value
// and throw custom exceptions themselves
tdbb->tdbb_status_vector[0] = 0;
/* If we are supposed to wait (presumably patiently),
but can't get the lock, generate an error */

View File

@ -247,10 +247,12 @@ bool SHUT_database(Database* dbb, SSHORT flag, SSHORT delay)
dbb->dbb_ast_flags |= DBB_shutdown;
dbb->dbb_ast_flags &= ~(DBB_shutdown_single | DBB_shutdown_full);
if (flag & isc_dpb_shut_single)
switch (flag & isc_dpb_shut_mode_mask) {
case isc_dpb_shut_single:
dbb->dbb_ast_flags |= DBB_shutdown_single;
else if (flag & isc_dpb_shut_full)
case isc_dpb_shut_full:
dbb->dbb_ast_flags |= DBB_shutdown_full;
}
if (!exclusive && (flag & isc_dpb_shut_force)) {
// TMN: Ugly counting!
@ -482,7 +484,7 @@ static bool notify_shutdown(Database* dbb, SSHORT flag, SSHORT delay)
/* Send blocking ASTs to database users */
bool exclusive =
CCH_exclusive(tdbb, LCK_PW, delay > 0 ? -SHUT_WAIT_TIME : LCK_NO_WAIT);
CCH_exclusive(tdbb, LCK_PW, delay > 0 ? -SHUT_WAIT_TIME : -1);
if (exclusive && (delay != -1)) {
return shutdown_locks(dbb, flag);
@ -532,7 +534,7 @@ static bool shutdown_locks(Database* dbb, SSHORT flag)
}
Attachment* attachment;
for (attachment = dbb->dbb_attachments; attachment;
attachment = attachment->att_next)
{