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

PSQL functions (continued).

This commit is contained in:
dimitr 2009-12-25 13:30:38 +00:00
parent 5191d2e2fd
commit a3886ecb19
2 changed files with 87 additions and 0 deletions

View File

@ -122,6 +122,9 @@ enum irq_type_t
irq_m_fields4, // process a modification of RDB$FIELDS for procedures (TYPE OF COLUMN)
irq_m_fields5, // process a modification of RDB$FIELDS for triggers (TYPE OF COLUMN)
irq_m_fields6, // process a modification of RDB$FIELDS for packaged procedures (TYPE OF COLUMN)
irq_m_fields7, // process a modification of RDB$FIELDS for functions
irq_m_fields8, // process a modification of RDB$FIELDS for functions (TYPE OF COLUMN)
irq_m_fields9, // process a modification of RDB$FIELDS for packaged functions (TYPE OF COLUMN)
irq_l_colls, // lookup collations
irq_l_relfield, // lookup a relation field
irq_verify_trusted_role, // ensure trusted role exists

View File

@ -975,6 +975,90 @@ DeferredWork* MET_change_fields(thread_db* tdbb, jrd_tra* transaction, const dsc
if (!REQUEST(irq_m_fields5))
REQUEST(irq_m_fields5) = request;
request = CMP_find_request(tdbb, irq_m_fields7, IRQ_REQUESTS);
FOR(REQUEST_HANDLE request)
DEP IN RDB$DEPENDENCIES CROSS
FUN IN RDB$FUNCTIONS
WITH DEP.RDB$DEPENDED_ON_NAME EQ field_source->dsc_address AND
DEP.RDB$DEPENDED_ON_TYPE EQ obj_field AND
DEP.RDB$DEPENDENT_TYPE EQ obj_udf AND
DEP.RDB$DEPENDENT_NAME EQ FUN.RDB$FUNCTION_NAME AND
FUN.RDB$PACKAGE_NAME MISSING
if (!REQUEST(irq_m_fields7))
REQUEST(irq_m_fields7) = request;
Firebird::MetaName name(FUN.RDB$FUNCTION_NAME);
dsc desc;
desc.makeText(name.length(), CS_METADATA, (UCHAR*) name.c_str());
DeferredWork* dw2 =
DFW_post_work(transaction, dfw_modify_function, &desc, FUN.RDB$FUNCTION_ID);
DFW_post_work_arg(transaction, dw2, NULL, 0, dfw_arg_check_blr);
END_FOR;
if (!REQUEST(irq_m_fields7))
REQUEST(irq_m_fields7) = request;
request = CMP_find_request(tdbb, irq_m_fields8, IRQ_REQUESTS);
FOR(REQUEST_HANDLE request)
RFL IN RDB$RELATION_FIELDS CROSS
DEP IN RDB$DEPENDENCIES CROSS
FUN IN RDB$FUNCTIONS
WITH RFL.RDB$FIELD_SOURCE EQ field_source->dsc_address AND
DEP.RDB$DEPENDED_ON_NAME EQ RFL.RDB$RELATION_NAME AND
DEP.RDB$FIELD_NAME EQ RFL.RDB$FIELD_NAME AND
DEP.RDB$DEPENDED_ON_TYPE EQ obj_relation AND
DEP.RDB$DEPENDENT_TYPE EQ obj_udf AND
DEP.RDB$DEPENDENT_NAME EQ FUN.RDB$FUNCTION_NAME AND
FUN.RDB$PACKAGE_NAME MISSING
if (!REQUEST(irq_m_fields8))
REQUEST(irq_m_fields8) = request;
Firebird::MetaName name(FUN.RDB$FUNCTION_NAME);
dsc desc;
desc.makeText(name.length(), CS_METADATA, (UCHAR*) name.c_str());
DeferredWork* dw2 =
DFW_post_work(transaction, dfw_modify_function, &desc, FUN.RDB$FUNCTION_ID);
DFW_post_work_arg(transaction, dw2, NULL, 0, dfw_arg_check_blr);
END_FOR;
if (!REQUEST(irq_m_fields8))
REQUEST(irq_m_fields8) = request;
request = CMP_find_request(tdbb, irq_m_fields9, IRQ_REQUESTS);
FOR(REQUEST_HANDLE request)
DEP IN RDB$DEPENDENCIES CROSS
FUN IN RDB$FUNCTIONS
WITH DEP.RDB$DEPENDED_ON_NAME EQ field_source->dsc_address AND
DEP.RDB$DEPENDED_ON_TYPE EQ obj_field AND
(DEP.RDB$DEPENDENT_TYPE EQ obj_package_header OR
DEP.RDB$DEPENDENT_TYPE EQ obj_package_body) AND
DEP.RDB$DEPENDENT_NAME EQ FUN.RDB$PACKAGE_NAME
if (!REQUEST(irq_m_fields9))
REQUEST(irq_m_fields9) = request;
Firebird::MetaName name(FUN.RDB$FUNCTION_NAME);
dsc desc;
desc.makeText(name.length(), CS_METADATA, (UCHAR*) name.c_str());
DeferredWork* dw2 = DFW_post_work(transaction, dfw_modify_function, &desc,
FUN.RDB$FUNCTION_ID, FUN.RDB$PACKAGE_NAME);
DFW_post_work_arg(transaction, dw2, NULL, 0, dfw_arg_check_blr);
END_FOR;
if (!REQUEST(irq_m_fields9))
REQUEST(irq_m_fields9) = request;
return dw;
}