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

Remove db_prepare_buffer and related mutex from attachment handle. Use local buffer instead.

This commit is contained in:
alexpeshkoff 2008-03-05 13:25:09 +00:00
parent 114f81f6b9
commit cdfde3edcb

View File

@ -350,8 +350,6 @@ namespace
Clean<AttachmentCleanupRoutine, FB_API_HANDLE*> cleanup; Clean<AttachmentCleanupRoutine, FB_API_HANDLE*> cleanup;
StoredAtt* handle; StoredAtt* handle;
Firebird::PathName db_path; Firebird::PathName db_path;
Firebird::Array<SCHAR> db_prepare_buffer;
Firebird::Mutex prepareMutex;
static ISC_STATUS hError() static ISC_STATUS hError()
{ {
@ -667,8 +665,7 @@ namespace
blobs(*getDefaultMemoryPool()), blobs(*getDefaultMemoryPool()),
statements(*getDefaultMemoryPool()), statements(*getDefaultMemoryPool()),
handle(h), handle(h),
db_path(*getDefaultMemoryPool()), db_path(*getDefaultMemoryPool())
db_prepare_buffer(*getDefaultMemoryPool())
{ {
toParent<Attachment>(attachments(), this, attachmentsMutex); toParent<Attachment>(attachments(), this, attachmentsMutex);
parent = this; parent = this;
@ -3356,14 +3353,12 @@ ISC_STATUS API_ROUTINE GDS_DSQL_PREPARE(ISC_STATUS* user_status,
try try
{ {
Statement* statement = translate<Statement>(stmt_handle); Statement* statement = translate<Statement>(stmt_handle);
USHORT buffer_len;
SCHAR *buffer;
sqlda_sup& dasup = statement->das; sqlda_sup& dasup = statement->das;
buffer_len = sqlda_buffer_size(PREPARE_BUFFER_SIZE, sqlda, dialect); USHORT buffer_len = sqlda_buffer_size(PREPARE_BUFFER_SIZE, sqlda, dialect);
Attachment* attachment = statement->parent; Attachment* attachment = statement->parent;
Firebird::MutexLockGuard guard(attachment->prepareMutex); Firebird::Array<SCHAR> db_prepare_buffer;
buffer = attachment->db_prepare_buffer.getBuffer(buffer_len); SCHAR* buffer = db_prepare_buffer.getBuffer(buffer_len);
if (!GDS_DSQL_PREPARE_M(status, if (!GDS_DSQL_PREPARE_M(status,
tra_handle, tra_handle,