mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 23:23:04 +01:00
Misc
This commit is contained in:
parent
a2026308da
commit
96194d08ba
@ -469,7 +469,7 @@ static void ExtractDriveLetter(const TEXT*, ULONG*);
|
|||||||
|
|
||||||
static Database* init(thread_db*, const PathName&, bool);
|
static Database* init(thread_db*, const PathName&, bool);
|
||||||
static void prepare(thread_db*, jrd_tra*, USHORT, const UCHAR*);
|
static void prepare(thread_db*, jrd_tra*, USHORT, const UCHAR*);
|
||||||
static void release_attachment(thread_db*, Attachment*, ISC_STATUS* = 0);
|
static void release_attachment(thread_db*, Attachment*, ISC_STATUS* = NULL);
|
||||||
static void detachLocksFromAttachment(Attachment*);
|
static void detachLocksFromAttachment(Attachment*);
|
||||||
static void rollback(thread_db*, jrd_tra*, const bool);
|
static void rollback(thread_db*, jrd_tra*, const bool);
|
||||||
static void shutdown_database(Database*, const bool);
|
static void shutdown_database(Database*, const bool);
|
||||||
@ -2220,11 +2220,11 @@ ISC_STATUS GDS_DROP_DATABASE(ISC_STATUS* user_status, Attachment** handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ISC_STATUS GDS_GET_SEGMENT(ISC_STATUS * user_status,
|
ISC_STATUS GDS_GET_SEGMENT(ISC_STATUS* user_status,
|
||||||
blb** blob_handle,
|
blb** blob_handle,
|
||||||
USHORT * length,
|
USHORT* length,
|
||||||
USHORT buffer_length,
|
USHORT buffer_length,
|
||||||
UCHAR * buffer)
|
UCHAR* buffer)
|
||||||
{
|
{
|
||||||
/**************************************
|
/**************************************
|
||||||
*
|
*
|
||||||
@ -3797,11 +3797,13 @@ bool JRD_reschedule(thread_db* tdbb, SLONG quantum, bool punt)
|
|||||||
attachment->att_flags & ATT_shutdown)
|
attachment->att_flags & ATT_shutdown)
|
||||||
{
|
{
|
||||||
const PathName& file_name = attachment->att_filename;
|
const PathName& file_name = attachment->att_filename;
|
||||||
if (punt) {
|
if (punt)
|
||||||
|
{
|
||||||
CCH_unwind(tdbb, false);
|
CCH_unwind(tdbb, false);
|
||||||
ERR_post(Arg::Gds(isc_shutdown) << Arg::Str(file_name));
|
ERR_post(Arg::Gds(isc_shutdown) << Arg::Str(file_name));
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ERR_build_status(tdbb->tdbb_status_vector,
|
ERR_build_status(tdbb->tdbb_status_vector,
|
||||||
Arg::Gds(isc_shutdown) << Arg::Str(file_name));
|
Arg::Gds(isc_shutdown) << Arg::Str(file_name));
|
||||||
return true;
|
return true;
|
||||||
@ -3810,11 +3812,13 @@ bool JRD_reschedule(thread_db* tdbb, SLONG quantum, bool punt)
|
|||||||
else if (attachment->att_flags & ATT_shutdown &&
|
else if (attachment->att_flags & ATT_shutdown &&
|
||||||
!(tdbb->tdbb_flags & TDBB_shutdown_manager))
|
!(tdbb->tdbb_flags & TDBB_shutdown_manager))
|
||||||
{
|
{
|
||||||
if (punt) {
|
if (punt)
|
||||||
|
{
|
||||||
CCH_unwind(tdbb, false);
|
CCH_unwind(tdbb, false);
|
||||||
ERR_post(Arg::Gds(isc_att_shutdown));
|
ERR_post(Arg::Gds(isc_att_shutdown));
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ERR_build_status(tdbb->tdbb_status_vector,
|
ERR_build_status(tdbb->tdbb_status_vector,
|
||||||
Arg::Gds(isc_att_shutdown));
|
Arg::Gds(isc_att_shutdown));
|
||||||
return true;
|
return true;
|
||||||
@ -3833,11 +3837,13 @@ bool JRD_reschedule(thread_db* tdbb, SLONG quantum, bool punt)
|
|||||||
(!transaction || !(transaction->tra_flags & TRA_system)))
|
(!transaction || !(transaction->tra_flags & TRA_system)))
|
||||||
{
|
{
|
||||||
attachment->att_flags &= ~ATT_cancel_raise;
|
attachment->att_flags &= ~ATT_cancel_raise;
|
||||||
if (punt) {
|
if (punt)
|
||||||
|
{
|
||||||
CCH_unwind(tdbb, false);
|
CCH_unwind(tdbb, false);
|
||||||
ERR_post(Arg::Gds(isc_cancelled));
|
ERR_post(Arg::Gds(isc_cancelled));
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
ERR_build_status(tdbb->tdbb_status_vector, Arg::Gds(isc_cancelled));
|
ERR_build_status(tdbb->tdbb_status_vector, Arg::Gds(isc_cancelled));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -4954,7 +4960,7 @@ Attachment::Attachment(MemoryPool* pool, Database* dbb)
|
|||||||
att_remote_process(*pool),
|
att_remote_process(*pool),
|
||||||
att_dsql_cache(*pool),
|
att_dsql_cache(*pool),
|
||||||
att_udf_pointers(*pool),
|
att_udf_pointers(*pool),
|
||||||
att_strings_buffer(0)
|
att_strings_buffer(NULL)
|
||||||
{
|
{
|
||||||
att_mutex.enter();
|
att_mutex.enter();
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
#include "../include/gen/iberror.h"
|
#include "../include/gen/iberror.h"
|
||||||
|
|
||||||
namespace Firebird {
|
namespace Firebird {
|
||||||
class StringsBuffer;
|
class StringsBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
class str;
|
class str;
|
||||||
|
@ -571,11 +571,9 @@ bool BackupManager::actualize_alloc(thread_db* tdbb)
|
|||||||
}
|
}
|
||||||
last_allocated_page = temp_bdb.bdb_page.getPageNum() + alloc_buffer[0];
|
last_allocated_page = temp_bdb.bdb_page.getPageNum() + alloc_buffer[0];
|
||||||
if (alloc_buffer[0] == database->dbb_page_size / sizeof(ULONG) - 1)
|
if (alloc_buffer[0] == database->dbb_page_size / sizeof(ULONG) - 1)
|
||||||
// if page is full adjust position for next pointer page
|
last_allocated_page++; // if page is full adjust position for next pointer page
|
||||||
last_allocated_page++;
|
|
||||||
else
|
else
|
||||||
// We finished reading allocation table
|
break; // We finished reading allocation table
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const Firebird::Exception& ex) {
|
catch (const Firebird::Exception& ex) {
|
||||||
@ -769,8 +767,7 @@ bool BackupManager::actualize_state(thread_db* tdbb)
|
|||||||
temp_bdb.bdb_page = HEADER_PAGE_NUMBER;
|
temp_bdb.bdb_page = HEADER_PAGE_NUMBER;
|
||||||
temp_bdb.bdb_dbb = database;
|
temp_bdb.bdb_dbb = database;
|
||||||
temp_bdb.bdb_buffer = reinterpret_cast<Ods::pag*>(header);
|
temp_bdb.bdb_buffer = reinterpret_cast<Ods::pag*>(header);
|
||||||
PageSpace* pageSpace =
|
PageSpace* pageSpace = database->dbb_page_manager.findPageSpace(DB_PAGE_SPACE);
|
||||||
database->dbb_page_manager.findPageSpace(DB_PAGE_SPACE);
|
|
||||||
fb_assert(pageSpace);
|
fb_assert(pageSpace);
|
||||||
jrd_file* file = pageSpace->file;
|
jrd_file* file = pageSpace->file;
|
||||||
while (!PIO_read(file, &temp_bdb, temp_bdb.bdb_buffer, status)) {
|
while (!PIO_read(file, &temp_bdb, temp_bdb.bdb_buffer, status)) {
|
||||||
|
@ -1448,8 +1448,7 @@ void PAG_init(thread_db* tdbb)
|
|||||||
(dbb->dbb_page_size - OFFSETA(tx_inv_page*, tip_transactions)) * 4;
|
(dbb->dbb_page_size - OFFSETA(tx_inv_page*, tip_transactions)) * 4;
|
||||||
pageSpace->ppFirst = 1;
|
pageSpace->ppFirst = 1;
|
||||||
/* dbb_ods_version can be 0 when a new database is being created */
|
/* dbb_ods_version can be 0 when a new database is being created */
|
||||||
if ((dbb->dbb_ods_version == 0)
|
if ((dbb->dbb_ods_version == 0) || (dbb->dbb_ods_version >= ODS_VERSION10))
|
||||||
|| (dbb->dbb_ods_version >= ODS_VERSION10))
|
|
||||||
{
|
{
|
||||||
pageMgr.gensPerPage =
|
pageMgr.gensPerPage =
|
||||||
(dbb->dbb_page_size -
|
(dbb->dbb_page_size -
|
||||||
|
@ -1660,8 +1660,7 @@ static jrd_nod* par_message(thread_db* tdbb, CompilerScratch* csb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (offset > MAX_FORMAT_SIZE)
|
if (offset > MAX_FORMAT_SIZE)
|
||||||
error(csb, Arg::Gds(isc_imp_exc) <<
|
error(csb, Arg::Gds(isc_imp_exc) << Arg::Gds(isc_blktoobig));
|
||||||
Arg::Gds(isc_blktoobig));
|
|
||||||
|
|
||||||
format->fmt_length = (USHORT) offset;
|
format->fmt_length = (USHORT) offset;
|
||||||
|
|
||||||
@ -2081,8 +2080,10 @@ static void par_procedure_parms(
|
|||||||
(count != procedure->prc_outputs))
|
(count != procedure->prc_outputs))
|
||||||
{
|
{
|
||||||
/** They don't match...Hmmm...Its OK if we were dropping the procedure **/
|
/** They don't match...Hmmm...Its OK if we were dropping the procedure **/
|
||||||
if (!(tdbb->tdbb_flags & TDBB_prc_being_dropped)) {
|
if (!(tdbb->tdbb_flags & TDBB_prc_being_dropped))
|
||||||
error(csb, Arg::Gds(input_flag ? isc_prcmismat : isc_prc_out_param_mismatch) << Arg::Str(procedure->prc_name));
|
{
|
||||||
|
error(csb, Arg::Gds(input_flag ? isc_prcmismat : isc_prc_out_param_mismatch) <<
|
||||||
|
Arg::Str(procedure->prc_name));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mismatch = true;
|
mismatch = true;
|
||||||
@ -2176,7 +2177,8 @@ static void par_procedure_parms(
|
|||||||
else if ((input_flag ? procedure->prc_inputs : procedure->prc_outputs) &&
|
else if ((input_flag ? procedure->prc_inputs : procedure->prc_outputs) &&
|
||||||
!mismatch)
|
!mismatch)
|
||||||
{
|
{
|
||||||
error(csb, Arg::Gds(input_flag ? isc_prcmismat : isc_prc_out_param_mismatch) << Arg::Str(procedure->prc_name));
|
error(csb, Arg::Gds(input_flag ? isc_prcmismat : isc_prc_out_param_mismatch) <<
|
||||||
|
Arg::Str(procedure->prc_name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2984,8 +2986,7 @@ jrd_nod* PAR_parse_node(thread_db* tdbb, CompilerScratch* csb, USHORT expected,
|
|||||||
n = BLR_BYTE;
|
n = BLR_BYTE;
|
||||||
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
|
if (n >= csb->csb_rpt.getCount() || !(csb->csb_rpt[n].csb_flags & csb_used))
|
||||||
error(csb, Arg::Gds(isc_ctxnotdef));
|
error(csb, Arg::Gds(isc_ctxnotdef));
|
||||||
node->nod_arg[e_erase_stream] =
|
node->nod_arg[e_erase_stream] = (jrd_nod*) (IPTR) csb->csb_rpt[n].csb_stream;
|
||||||
(jrd_nod*) (IPTR) csb->csb_rpt[n].csb_stream;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case blr_modify:
|
case blr_modify:
|
||||||
@ -3016,9 +3017,8 @@ jrd_nod* PAR_parse_node(thread_db* tdbb, CompilerScratch* csb, USHORT expected,
|
|||||||
if (BLR_PEEK == (UCHAR) blr_stall)
|
if (BLR_PEEK == (UCHAR) blr_stall)
|
||||||
node->nod_arg[e_for_stall] = PAR_parse_node(tdbb, csb, STATEMENT);
|
node->nod_arg[e_for_stall] = PAR_parse_node(tdbb, csb, STATEMENT);
|
||||||
|
|
||||||
if (BLR_PEEK == (UCHAR) blr_rse ||
|
if (BLR_PEEK == (UCHAR) blr_rse || BLR_PEEK == (UCHAR) blr_singular)
|
||||||
BLR_PEEK == (UCHAR) blr_singular)
|
node->nod_arg[e_for_re] = PAR_parse_node(tdbb, csb, TYPE_RSE);
|
||||||
node->nod_arg[e_for_re] = PAR_parse_node(tdbb, csb, TYPE_RSE);
|
|
||||||
else
|
else
|
||||||
node->nod_arg[e_for_re] = par_rse(tdbb, csb, blr_operator);
|
node->nod_arg[e_for_re] = par_rse(tdbb, csb, blr_operator);
|
||||||
node->nod_arg[e_for_statement] = PAR_parse_node(tdbb, csb, sub_type);
|
node->nod_arg[e_for_statement] = PAR_parse_node(tdbb, csb, sub_type);
|
||||||
|
@ -144,9 +144,11 @@ bool PCMET_expression_index(thread_db* tdbb, SSHORT phase, DeferredWork* work,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IDX.RDB$SEGMENT_COUNT)
|
if (IDX.RDB$SEGMENT_COUNT)
|
||||||
|
{
|
||||||
|
/* Msg359: segments not allowed in expression index %s */
|
||||||
ERR_post(Arg::Gds(isc_no_meta_update) <<
|
ERR_post(Arg::Gds(isc_no_meta_update) <<
|
||||||
Arg::Gds(isc_no_segments_err) << Arg::Str(work->dfw_name));
|
Arg::Gds(isc_no_segments_err) << Arg::Str(work->dfw_name));
|
||||||
/* Msg359: segments not allowed in expression index %s */
|
}
|
||||||
if (IDX.RDB$UNIQUE_FLAG)
|
if (IDX.RDB$UNIQUE_FLAG)
|
||||||
idx.idx_flags |= idx_unique;
|
idx.idx_flags |= idx_unique;
|
||||||
if (IDX.RDB$INDEX_TYPE == 1)
|
if (IDX.RDB$INDEX_TYPE == 1)
|
||||||
|
@ -2749,7 +2749,6 @@ static void inet_error(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* No status value, just format the basic arguments. */
|
/* No status value, just format the basic arguments. */
|
||||||
|
|
||||||
inet_gen_error(port,
|
inet_gen_error(port,
|
||||||
Arg::Gds(isc_network_error) << Arg::Str(port->port_connection->str_data) <<
|
Arg::Gds(isc_network_error) << Arg::Str(port->port_connection->str_data) <<
|
||||||
Arg::Gds(operation));
|
Arg::Gds(operation));
|
||||||
|
@ -617,7 +617,7 @@ void REMOTE_save_status_strings( ISC_STATUS* vector)
|
|||||||
|
|
||||||
// ensure string is correctly terminated
|
// ensure string is correctly terminated
|
||||||
if (status != isc_arg_cstring)
|
if (status != isc_arg_cstring)
|
||||||
attach_failures_ptr[l-1] = 0;
|
attach_failures_ptr[l - 1] = 0;
|
||||||
else
|
else
|
||||||
vector[-1] = l;
|
vector[-1] = l;
|
||||||
|
|
||||||
|
@ -39,25 +39,25 @@
|
|||||||
using MsgFormat::SafeArg;
|
using MsgFormat::SafeArg;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void put_status_arg(ISC_STATUS*& status, const MsgFormat::safe_cell& value)
|
void put_status_arg(ISC_STATUS*& status, const MsgFormat::safe_cell& value)
|
||||||
{
|
|
||||||
using MsgFormat::safe_cell;
|
|
||||||
|
|
||||||
switch (value.type)
|
|
||||||
{
|
{
|
||||||
case safe_cell::at_int64:
|
using MsgFormat::safe_cell;
|
||||||
case safe_cell::at_uint64:
|
|
||||||
*status++ = isc_arg_number;
|
switch (value.type)
|
||||||
*status++ = static_cast<SLONG>(value.i_value); // May truncate number!
|
{
|
||||||
break;
|
case safe_cell::at_int64:
|
||||||
case safe_cell::at_str:
|
case safe_cell::at_uint64:
|
||||||
*status++ = isc_arg_string;
|
*status++ = isc_arg_number;
|
||||||
*status++ = (ISC_STATUS) (IPTR) (value.st_value.s_string);
|
*status++ = static_cast<SLONG>(value.i_value); // May truncate number!
|
||||||
break;
|
break;
|
||||||
default:
|
case safe_cell::at_str:
|
||||||
break;
|
*status++ = isc_arg_string;
|
||||||
|
*status++ = (ISC_STATUS) (IPTR) (value.st_value.s_string);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
void CMD_UTIL_put_svc_status(ISC_STATUS* svc_status,
|
void CMD_UTIL_put_svc_status(ISC_STATUS* svc_status,
|
||||||
|
Loading…
Reference in New Issue
Block a user