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

More threading related fixes. As a side effect, it disables a primitive client-side caching of a few predefined queries, but it doesn't show any performance difference.

This commit is contained in:
dimitr 2006-04-07 09:16:55 +00:00
parent 7c49753c21
commit ebed4eb85f
2 changed files with 31 additions and 17 deletions

View File

@ -166,9 +166,13 @@ ISC_STATUS API_ROUTINE isc_array_lookup_bounds(ISC_STATUS* status,
return status[1];
}
ISC_STATUS_ARRAY isc_status = {0};
isc_db_handle DB = *db_handle;
isc_req_handle handle = NULL;
ISC_ARRAY_BOUND* tail = desc->array_desc_bounds;
FOR (TRANSACTION_HANDLE *trans_handle)
FOR (REQUEST_HANDLE handle TRANSACTION_HANDLE *trans_handle)
X IN RDB$FIELD_DIMENSIONS
WITH X.RDB$FIELD_NAME EQ global
SORTED BY X.RDB$DIMENSION
@ -177,9 +181,11 @@ ISC_STATUS API_ROUTINE isc_array_lookup_bounds(ISC_STATUS* status,
++tail;
END_FOR
ON_ERROR
return UTLD_copy_status(gds_status, status);
isc_release_request(isc_status, &handle);
return UTLD_copy_status(isc_status, status);
END_ERROR;
isc_release_request(isc_status, &handle);
return status[1];
}
@ -516,22 +522,20 @@ static ISC_STATUS lookup_desc(ISC_STATUS* status,
* Functional description
*
**************************************/
if (DB && DB != *db_handle)
RELEASE_REQUESTS;
DB = *db_handle;
ISC_STATUS_ARRAY isc_status = {0};
isc_db_handle DB = *db_handle;
isc_req_handle handle = NULL;
copy_exact_name (field_name, desc->array_desc_field_name,
sizeof(desc->array_desc_field_name));
copy_exact_name (relation_name, desc->array_desc_relation_name,
sizeof(desc->array_desc_relation_name));
desc->array_desc_flags = 0;
bool flag = false;
FOR (TRANSACTION_HANDLE *trans_handle)
FOR (REQUEST_HANDLE handle TRANSACTION_HANDLE *trans_handle)
X IN RDB$RELATION_FIELDS CROSS Y IN RDB$FIELDS
WITH X.RDB$FIELD_SOURCE EQ Y.RDB$FIELD_NAME AND
X.RDB$RELATION_NAME EQ desc->array_desc_relation_name AND
@ -548,9 +552,12 @@ static ISC_STATUS lookup_desc(ISC_STATUS* status,
END_FOR
ON_ERROR
return UTLD_copy_status(gds_status, status);
isc_release_request(isc_status, &handle);
return UTLD_copy_status(isc_status, status);
END_ERROR;
isc_release_request(isc_status, &handle);
if (!flag)
return error(status, 5, (ISC_STATUS) isc_fldnotdef,
(ISC_STATUS) isc_arg_string,

View File

@ -146,10 +146,9 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status,
* in the BLOB_DESC.
*
***********************************************/
if (DB && DB != *db_handle)
RELEASE_REQUESTS;
DB = *db_handle;
ISC_STATUS_ARRAY isc_status = {0};
isc_db_handle DB = *db_handle;
isc_req_handle handle = NULL;
copy_exact_name (field_name, desc->blob_desc_field_name,
sizeof(desc->blob_desc_field_name));
@ -158,7 +157,7 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status,
bool flag = false;
FOR (TRANSACTION_HANDLE *trans_handle)
FOR (REQUEST_HANDLE handle TRANSACTION_HANDLE *trans_handle)
X IN RDB$RELATION_FIELDS CROSS Y IN RDB$FIELDS
WITH X.RDB$FIELD_SOURCE EQ Y.RDB$FIELD_NAME AND
X.RDB$RELATION_NAME EQ desc->blob_desc_relation_name AND
@ -175,12 +174,17 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status,
}
END_FOR
ON_ERROR
return UTLD_copy_status(gds_status, status);
isc_release_request(isc_status, &handle);
return UTLD_copy_status(isc_status, status);
END_ERROR;
isc_release_request(isc_status, &handle);
if (!flag)
{
FOR (TRANSACTION_HANDLE *trans_handle)
handle = NULL;
FOR (REQUEST_HANDLE handle TRANSACTION_HANDLE *trans_handle)
X IN RDB$PROCEDURE_PARAMETERS CROSS Y IN RDB$FIELDS
WITH X.RDB$FIELD_SOURCE EQ Y.RDB$FIELD_NAME AND
X.RDB$PROCEDURE_NAME EQ desc->blob_desc_relation_name AND
@ -197,8 +201,11 @@ ISC_STATUS API_ROUTINE isc_blob_lookup_desc(ISC_STATUS* status,
}
END_FOR
ON_ERROR
return UTLD_copy_status(gds_status, status);
isc_release_request(isc_status, &handle);
return UTLD_copy_status(isc_status, status);
END_ERROR;
isc_release_request(isc_status, &handle);
}
if (!flag)