8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:03:03 +01:00
This commit is contained in:
robocop 2009-11-27 06:57:17 +00:00
parent d442a57339
commit 6b58626584
9 changed files with 34 additions and 77 deletions

View File

@ -425,7 +425,7 @@ void CreateAlterPackageNode::execute(thread_db* tdbb, jrd_tra* transaction)
{
fb_assert(create || alter);
Database* dbb = tdbb->getDatabase();
//Database* dbb = tdbb->getDatabase();
//dbb->checkOdsForDsql(ODS_12_0);
@ -597,7 +597,7 @@ void DropPackageNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const
void DropPackageNode::execute(thread_db* tdbb, jrd_tra* transaction)
{
Database* dbb = tdbb->getDatabase();
//Database* dbb = tdbb->getDatabase();
MetaName metaName(nameInMetaCharSet(tdbb, name));
//dbb->checkOdsForDsql(ODS_12_0);
@ -833,7 +833,7 @@ Node* CreatePackageBodyNode::internalDsqlPass()
void CreatePackageBodyNode::execute(thread_db* tdbb, jrd_tra* transaction)
{
Database* dbb = tdbb->getDatabase();
//Database* dbb = tdbb->getDatabase();
const MetaName metaName(nameInMetaCharSet(tdbb, name));
//dbb->checkOdsForDsql(ODS_12_0);
@ -1014,7 +1014,7 @@ void DropPackageBodyNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const
void DropPackageBodyNode::execute(thread_db* tdbb, jrd_tra* transaction)
{
Database* dbb = tdbb->getDatabase();
//Database* dbb = tdbb->getDatabase();
const MetaName metaName(nameInMetaCharSet(tdbb, name));
//dbb->checkOdsForDsql(ODS_12_0);

View File

@ -1255,41 +1255,16 @@ dsql_prc* METD_get_procedure(CompiledStatement* statement, const dsql_str* name,
if (!DSQL_REQUEST(irq_parameters))
DSQL_REQUEST(irq_parameters) = handle2;
SSHORT pr_collation_id_null = TRUE;
SSHORT pr_collation_id;
SSHORT pr_default_value_null = TRUE;
SSHORT pr_null_flag_null = TRUE;
SSHORT pr_null_flag;
bool pr_type_of = false;
const SSHORT pr_collation_id_null = PR.RDB$COLLATION_ID.NULL;
const SSHORT pr_collation_id = PR.RDB$COLLATION_ID;
jrd_req* handle3 = CMP_find_request(tdbb, irq_parameters2, IRQ_REQUESTS);
const SSHORT pr_default_value_null = PR.RDB$DEFAULT_VALUE.NULL;
const MetaName packageName(PR.RDB$PACKAGE_NAME.NULL ? NULL : PR.RDB$PACKAGE_NAME);
const SSHORT pr_null_flag_null = PR.RDB$NULL_FLAG.NULL;
const SSHORT pr_null_flag = PR.RDB$NULL_FLAG;
FOR(REQUEST_HANDLE handle3 TRANSACTION_HANDLE statement->req_transaction)
PR2 IN RDB$PROCEDURE_PARAMETERS
WITH PR2.RDB$PROCEDURE_NAME EQ PR.RDB$PROCEDURE_NAME AND
PR2.RDB$PACKAGE_NAME EQUIV NULLIF(packageName.c_str(), '') AND
PR2.RDB$PARAMETER_NAME EQ PR.RDB$PARAMETER_NAME
if (!DSQL_REQUEST(irq_parameters2))
DSQL_REQUEST(irq_parameters2) = handle3;
pr_collation_id_null = PR2.RDB$COLLATION_ID.NULL;
pr_collation_id = PR2.RDB$COLLATION_ID;
pr_default_value_null = PR2.RDB$DEFAULT_VALUE.NULL;
pr_null_flag_null = PR2.RDB$NULL_FLAG.NULL;
pr_null_flag = PR2.RDB$NULL_FLAG;
if (!PR2.RDB$PARAMETER_MECHANISM.NULL && PR2.RDB$PARAMETER_MECHANISM == prm_mech_type_of)
pr_type_of = true;
END_FOR
if (!DSQL_REQUEST(irq_parameters2))
DSQL_REQUEST(irq_parameters2) = handle3;
const bool pr_type_of =
(!PR.RDB$PARAMETER_MECHANISM.NULL && PR.RDB$PARAMETER_MECHANISM == prm_mech_type_of);
count++;
// allocate the field block

View File

@ -301,9 +301,7 @@ USHORT CCH_checksum(BufferDesc* bdb)
**************************************/
#ifdef NO_CHECKSUM
return DUMMY_CHECKSUM;
#else
Database* dbb = bdb->bdb_dbb;
#ifdef WIN_NT
#elif defined(WIN_NT)
// ODS_VERSION8 for NT was shipped before page checksums
// were disabled on other platforms. Continue to compute
// checksums for ODS_VERSION8 databases but eliminate them
@ -313,6 +311,7 @@ USHORT CCH_checksum(BufferDesc* bdb)
return DUMMY_CHECKSUM;
#else
Database* dbb = bdb->bdb_dbb;
pag* page = bdb->bdb_buffer;
const ULONG* const end = (ULONG *) ((SCHAR *) page + dbb->dbb_page_size);
@ -350,7 +349,6 @@ USHORT CCH_checksum(BufferDesc* bdb)
return DUMMY_CHECKSUM;
#endif
#endif
}

View File

@ -4718,7 +4718,7 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
}
if (desc2->dsc_dtype)
{
offset = MET_align(dbb, &(*desc2), offset);
offset = MET_align(&(*desc2), offset);
desc2->dsc_address = (UCHAR *) (IPTR) offset;
offset += desc2->dsc_length;
}

View File

@ -892,8 +892,6 @@ USHORT DYN_put_text_blob(Global* gbl, const UCHAR** ptr, bid* blob_id)
const UCHAR* const end = p + length;
try {
Database* dbb = tdbb->getDatabase();
UCharBuffer bpb;
const size_t convSize = 15;
bpb.resize(convSize);

View File

@ -2939,6 +2939,8 @@ void DYN_define_relation(Global* gbl, const UCHAR** ptr, bool view)
REL.RDB$EXTERNAL_FILE.NULL = TRUE;
REL.RDB$FLAGS = 0;
REL.RDB$FLAGS.NULL = FALSE;
REL.RDB$RELATION_TYPE.NULL = FALSE;
UCHAR verb;
while ((verb = *(*ptr)++) != isc_dyn_end)
@ -3024,6 +3026,9 @@ void DYN_define_relation(Global* gbl, const UCHAR** ptr, bool view)
}
} // while
// The relation type cannot be determined definitely inside the above loop,
// because there are many DYN codes that affect it.
REL.RDB$RELATION_TYPE = rel_type;
SSHORT old_id = id;
id = drq_l_rel_info2;
@ -3087,19 +3092,6 @@ void DYN_define_relation(Global* gbl, const UCHAR** ptr, bool view)
if (!DYN_REQUEST(drq_s_rels))
DYN_REQUEST(drq_s_rels) = request;
jrd_req* sub_request = NULL;
FOR(REQUEST_HANDLE sub_request TRANSACTION_HANDLE gbl->gbl_transaction)
REL IN RDB$RELATIONS WITH REL.RDB$RELATION_NAME EQ relation_name.c_str()
MODIFY REL USING
REL.RDB$RELATION_TYPE = rel_type;
REL.RDB$RELATION_TYPE.NULL = FALSE;
END_MODIFY;
END_FOR;
CMP_release(tdbb, sub_request);
if (sql_prot)
{
for (const TEXT* p = ALL_PRIVILEGES; *p; p++)
@ -3888,6 +3880,17 @@ void DYN_define_trigger(Global* gbl,
if (X.RDB$RELATION_NAME.NULL && !tdbb->getAttachment()->locksmith())
ERR_post(Arg::Gds(isc_adm_task_denied));
X.RDB$VALID_BLR = TRUE;
X.RDB$VALID_BLR.NULL = FALSE;
if (debug_info_ptr)
{
X.RDB$DEBUG_INFO.NULL = FALSE;
DYN_put_blr_blob(gbl, &debug_info_ptr, &X.RDB$DEBUG_INFO);
}
else
X.RDB$DEBUG_INFO.NULL = TRUE;
b_ending_store = true;
// the END_STORE_SPECIAL adds the foll. lines of code to the END_STORE
@ -3906,23 +3909,6 @@ void DYN_define_trigger(Global* gbl,
DYN_REQUEST(drq_s_triggers) = request;
}
jrd_req* sub_request = NULL;
FOR(REQUEST_HANDLE sub_request TRANSACTION_HANDLE gbl->gbl_transaction)
TRG IN RDB$TRIGGERS WITH TRG.RDB$TRIGGER_NAME EQ t.c_str()
MODIFY TRG USING
TRG.RDB$VALID_BLR = TRUE;
TRG.RDB$VALID_BLR.NULL = FALSE;
TRG.RDB$DEBUG_INFO.NULL = (debug_info_ptr == NULL) ? TRUE : FALSE;
if (debug_info_ptr)
DYN_put_blr_blob(gbl, &debug_info_ptr, &TRG.RDB$DEBUG_INFO);
END_MODIFY;
END_FOR;
CMP_release(tdbb, sub_request);
}
catch (const Firebird::Exception& ex)
{

View File

@ -2432,7 +2432,7 @@ void DYN_modify_sql_field(Global* gbl, const UCHAR** ptr, const MetaName* relati
*
**************************************/
thread_db* tdbb = JRD_get_thread_data();
Database* dbb = tdbb->getDatabase();
//Database* dbb = tdbb->getDatabase();
dyn_fld orig_fld, new_fld, dom_fld;

View File

@ -1250,7 +1250,7 @@ bool EVL_field(jrd_rel* relation, Record* record, USHORT id, dsc* desc)
if (record && record->rec_format && relation)
{
thread_db* tdbb = JRD_get_thread_data();
Database* dbb = tdbb->getDatabase();
//Database* dbb = tdbb->getDatabase();
while (format &&
(id >= format->fmt_defaults.getCount() ||

View File

@ -652,7 +652,7 @@ void INI_init2(thread_db* tdbb)
{
if (n-- > 0)
{
format->fmt_length = (USHORT) MET_align(dbb, &(*desc), format->fmt_length);
format->fmt_length = (USHORT) MET_align(&(*desc), format->fmt_length);
desc->dsc_address = (UCHAR*) (IPTR) format->fmt_length;
format->fmt_length += desc->dsc_length;
}