From: <fir...@us...> - 2011-04-30 03:16:07
|
Revision: 52856 http://firebird.svn.sourceforge.net/firebird/?rev=52856&view=rev Author: firebirds Date: 2011-04-30 03:16:00 +0000 (Sat, 30 Apr 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-04-30 02:28:31 UTC (rev 52855) +++ firebird/trunk/ChangeLog 2011-04-30 03:16:00 UTC (rev 52856) @@ -1,3 +1,55 @@ + 2011-04-30 02:28 asfernandes + M src/common/classes/SyncObject.cpp + M src/common/classes/SyncObject.h + M src/common/classes/Synchronize.cpp + M src/common/classes/Synchronize.h + M src/common/classes/fb_atomic.h + M src/jrd/jrd.cpp + M src/yvalve/PluginManager.cpp + M src/yvalve/why.cpp +Misc. + + 2011-04-29 19:11 hvlad + M src/common/classes/fb_atomic.h +Windows version of PlatformAtomicPointer + + 2011-04-29 16:24 alexpeshkoff + M src/common/classes/ImplementHelper.h + M src/include/FirebirdPluginApi.h + M src/jrd/jrd.cpp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/PluginManager.cpp + M src/yvalve/PluginManager.h +Added delay before unloading plugin module after last reference to that module outside plugin manager is gone + + 2011-04-29 15:50 alexpeshkoff + D src/common/classes/Interlock.h + M src/common/classes/SyncObject.cpp + M src/common/classes/alloc.cpp + M src/common/classes/alloc.h + M src/common/classes/fb_atomic.h +Cleanup: make fb_atomic be the single file working with atomic operations and membars + + 2011-04-29 15:16 asfernandes + M src/dsql/DdlNodes.epp +Correction. + + 2011-04-29 12:03 hvlad + M src/common/classes/fb_atomic.h +Typo and missed cast + + 2011-04-29 11:34 hvlad + M src/common/classes/SyncObject.cpp +Cleanup and some comments + + 2011-04-29 11:12 hvlad + M src/common/classes/fb_atomic.h +Let PlatformAtomicCounter::setValue() returns old value on Windows too + + 2011-04-29 09:25 alexpeshkoff + M src/common/classes/fb_atomic.h +Fixed posix build + 2011-04-28 16:59 dimitr M src/common/classes/SyncObject.cpp M src/common/classes/SyncObject.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-04-30 02:28:31 UTC (rev 52855) +++ firebird/trunk/src/jrd/build_no.h 2011-04-30 03:16:00 UTC (rev 52856) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29319 + FORMAL BUILD NUMBER:29328 */ -#define PRODUCT_VER_STRING "3.0.0.29319" -#define FILE_VER_STRING "WI-T3.0.0.29319" -#define LICENSE_VER_STRING "WI-T3.0.0.29319" -#define FILE_VER_NUMBER 3, 0, 0, 29319 +#define PRODUCT_VER_STRING "3.0.0.29328" +#define FILE_VER_STRING "WI-T3.0.0.29328" +#define LICENSE_VER_STRING "WI-T3.0.0.29328" +#define FILE_VER_NUMBER 3, 0, 0, 29328 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29319" +#define FB_BUILD_NO "29328" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-04-30 02:28:31 UTC (rev 52855) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-04-30 03:16:00 UTC (rev 52856) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29319 +BuildNum=29328 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-01 03:16:33
|
Revision: 52860 http://firebird.svn.sourceforge.net/firebird/?rev=52860&view=rev Author: firebirds Date: 2011-05-01 03:16:27 +0000 (Sun, 01 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-04-30 18:23:04 UTC (rev 52859) +++ firebird/trunk/ChangeLog 2011-05-01 03:16:27 UTC (rev 52860) @@ -1,3 +1,15 @@ + 2011-04-30 18:23 asfernandes + M src/common/config/os/config_root.h +Invert the functionality of addSlash to fixPath. It was creating paths with double slashes in config files. +The right way to create paths in others places is with PathUtils::concatPath, and it don't need what addSlash was doing. + + 2011-04-30 11:38 hvlad + M src/common/classes/SyncObject.cpp + M src/common/classes/SyncObject.h + M src/common/classes/Synchronize.cpp + M src/common/classes/Synchronize.h +Some refactoring and cleanup. + 2011-04-30 02:28 asfernandes M src/common/classes/SyncObject.cpp M src/common/classes/SyncObject.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-04-30 18:23:04 UTC (rev 52859) +++ firebird/trunk/src/jrd/build_no.h 2011-05-01 03:16:27 UTC (rev 52860) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29328 + FORMAL BUILD NUMBER:29330 */ -#define PRODUCT_VER_STRING "3.0.0.29328" -#define FILE_VER_STRING "WI-T3.0.0.29328" -#define LICENSE_VER_STRING "WI-T3.0.0.29328" -#define FILE_VER_NUMBER 3, 0, 0, 29328 +#define PRODUCT_VER_STRING "3.0.0.29330" +#define FILE_VER_STRING "WI-T3.0.0.29330" +#define LICENSE_VER_STRING "WI-T3.0.0.29330" +#define FILE_VER_NUMBER 3, 0, 0, 29330 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29328" +#define FB_BUILD_NO "29330" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-04-30 18:23:04 UTC (rev 52859) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-01 03:16:27 UTC (rev 52860) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29328 +BuildNum=29330 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-04 03:17:16
|
Revision: 52872 http://firebird.svn.sourceforge.net/firebird/?rev=52872&view=rev Author: firebirds Date: 2011-05-04 03:17:09 +0000 (Wed, 04 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-03 17:09:46 UTC (rev 52871) +++ firebird/trunk/ChangeLog 2011-05-04 03:17:09 UTC (rev 52872) @@ -1,3 +1,11 @@ + 2011-05-03 12:03 hvlad + M src/common/classes/alloc.cpp +Don't use placement new[] as its behavior is inconsistent between compilers + + 2011-05-03 07:43 alexpeshkoff + M src/yvalve/MasterImplementation.cpp +This should fix deadlock, noticed by Damyan + 2011-04-30 18:23 asfernandes M src/common/config/os/config_root.h Invert the functionality of addSlash to fixPath. It was creating paths with double slashes in config files. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-03 17:09:46 UTC (rev 52871) +++ firebird/trunk/src/jrd/build_no.h 2011-05-04 03:17:09 UTC (rev 52872) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29330 + FORMAL BUILD NUMBER:29332 */ -#define PRODUCT_VER_STRING "3.0.0.29330" -#define FILE_VER_STRING "WI-T3.0.0.29330" -#define LICENSE_VER_STRING "WI-T3.0.0.29330" -#define FILE_VER_NUMBER 3, 0, 0, 29330 +#define PRODUCT_VER_STRING "3.0.0.29332" +#define FILE_VER_STRING "WI-T3.0.0.29332" +#define LICENSE_VER_STRING "WI-T3.0.0.29332" +#define FILE_VER_NUMBER 3, 0, 0, 29332 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29330" +#define FB_BUILD_NO "29332" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-03 17:09:46 UTC (rev 52871) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-04 03:17:09 UTC (rev 52872) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29330 +BuildNum=29332 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-06 03:17:42
|
Revision: 52883 http://firebird.svn.sourceforge.net/firebird/?rev=52883&view=rev Author: firebirds Date: 2011-05-06 03:17:35 +0000 (Fri, 06 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-05 22:05:59 UTC (rev 52882) +++ firebird/trunk/ChangeLog 2011-05-06 03:17:35 UTC (rev 52883) @@ -1,3 +1,24 @@ + 2011-05-05 22:05 hvlad + M src/jrd/dpm.epp +Fixed bug CORE-3468 : Attempt to read after the end of file when nbackup state is stalled + + 2011-05-05 18:11 hvlad + M src/jrd/cch.cpp + M src/jrd/cch.h + M src/jrd/cch_proto.h + M src/jrd/nbak.cpp +Fixed bug CORE-3466 : Some changes could be lost during the merge of delta file into main database file. +Removed BDB_merge flag and related code. + + 2011-05-05 17:40 hvlad + M src/jrd/cch.cpp +FiFixed bug CORE-3465 : Nbackup state lock could be not released after cache error. It results in "Can't lock state for write" bugcheck when backup state is going to be changed. + + 2011-05-05 14:33 hvlad + M src/jrd/cch.cpp +Fixed bug CORE-3464. +Correct error reporting - bugcheck's 215 and 216 was confused with each other. + 2011-05-03 12:03 hvlad M src/common/classes/alloc.cpp Don't use placement new[] as its behavior is inconsistent between compilers Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-05 22:05:59 UTC (rev 52882) +++ firebird/trunk/src/jrd/build_no.h 2011-05-06 03:17:35 UTC (rev 52883) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29332 + FORMAL BUILD NUMBER:29336 */ -#define PRODUCT_VER_STRING "3.0.0.29332" -#define FILE_VER_STRING "WI-T3.0.0.29332" -#define LICENSE_VER_STRING "WI-T3.0.0.29332" -#define FILE_VER_NUMBER 3, 0, 0, 29332 +#define PRODUCT_VER_STRING "3.0.0.29336" +#define FILE_VER_STRING "WI-T3.0.0.29336" +#define LICENSE_VER_STRING "WI-T3.0.0.29336" +#define FILE_VER_NUMBER 3, 0, 0, 29336 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29332" +#define FB_BUILD_NO "29336" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-05 22:05:59 UTC (rev 52882) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-06 03:17:35 UTC (rev 52883) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29332 +BuildNum=29336 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2011-05-07 19:52:52
|
Revision: 52892 http://firebird.svn.sourceforge.net/firebird/?rev=52892&view=rev Author: asfernandes Date: 2011-05-07 19:52:44 +0000 (Sat, 07 May 2011) Log Message: ----------- Integrate IAttachment and ITransaction in the external engines API. Modified Paths: -------------- firebird/trunk/builds/posix/firebird.vers firebird/trunk/builds/win32/defs/firebird.def firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp firebird/trunk/src/include/FirebirdApi.h firebird/trunk/src/include/FirebirdExternalApi.h firebird/trunk/src/include/FirebirdUdrCpp.h firebird/trunk/src/include/Interface.h firebird/trunk/src/include/ProviderInterface.h firebird/trunk/src/jrd/Attachment.cpp firebird/trunk/src/jrd/Attachment.h firebird/trunk/src/jrd/EngineInterface.h firebird/trunk/src/jrd/ExtEngineManager.cpp firebird/trunk/src/jrd/ExtEngineManager.h firebird/trunk/src/jrd/extds/InternalDS.cpp firebird/trunk/src/jrd/ibase.h firebird/trunk/src/jrd/jrd.cpp firebird/trunk/src/jrd/tra.h firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp firebird/trunk/src/remote/client/interface.cpp firebird/trunk/src/yvalve/MasterImplementation.cpp firebird/trunk/src/yvalve/MasterImplementation.h firebird/trunk/src/yvalve/PluginManager.cpp firebird/trunk/src/yvalve/why.cpp firebird/trunk/src/yvalve/why_proto.h Modified: firebird/trunk/builds/posix/firebird.vers =================================================================== --- firebird/trunk/builds/posix/firebird.vers 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/builds/posix/firebird.vers 2011-05-07 19:52:44 UTC (rev 52892) @@ -342,6 +342,9 @@ fb_get_master_interface +fb_get_database_handle +fb_get_transaction_handle + # Other misc functions isc_ftof Modified: firebird/trunk/builds/win32/defs/firebird.def =================================================================== --- firebird/trunk/builds/win32/defs/firebird.def 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/builds/win32/defs/firebird.def 2011-05-07 19:52:44 UTC (rev 52892) @@ -352,6 +352,8 @@ fb_ping fb_get_master_interface + fb_get_database_handle + fb_get_transaction_handle gds__trace gds__trace_raw Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -158,8 +158,6 @@ unsigned char* eveBuffer; unsigned char* eveResult; - // NOTE: isc_event_block leaks the two memory buffers allocated. - // You should manually construct the EPB if you care. int eveLen = funcEventBlock(&eveBuffer, &eveResult, 1, s); ISC_STATUS_ARRAY statusVector = {0}; @@ -173,6 +171,9 @@ statusVector); funcEventCounts(&counter, eveLen, eveBuffer, eveResult); + isc_free((char*) eveBuffer); + isc_free((char*) eveResult); + // returns the counter result->setInt(ThrowError(), counter); } Modified: firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp =================================================================== --- firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -720,6 +720,18 @@ fb_assert(false); return NULL; } + + virtual IAttachment* registerAttachment(IProvider* /*provider*/, IAttachment* /*attachment*/) + { + fb_assert(false); + return NULL; + } + + virtual ITransaction* registerTransaction(IAttachment* /*attachment*/, ITransaction* /*transaction*/) + { + fb_assert(false); + return NULL; + } }; Modified: firebird/trunk/src/include/FirebirdApi.h =================================================================== --- firebird/trunk/src/include/FirebirdApi.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/include/FirebirdApi.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -106,25 +106,6 @@ }; -class Attachment : public Disposable -{ -public: - // Get an ISC compatible attachment handle. - virtual Handle FB_CALL getHandle(Error* error) const = 0; - - virtual const char* FB_CALL getUserName() const = 0; - virtual const char* FB_CALL getDatabaseName() const = 0; -}; - - -class Transaction -{ -public: - // Get an ISC compatible transaction handle. - virtual Handle FB_CALL getHandle(Error* error) const = 0; -}; - - // Represents a parameter or column. class Value { Modified: firebird/trunk/src/include/FirebirdExternalApi.h =================================================================== --- firebird/trunk/src/include/FirebirdExternalApi.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/include/FirebirdExternalApi.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -35,6 +35,7 @@ #include "FirebirdApi.h" #include "FirebirdPluginApi.h" +#include "ProviderInterface.h" namespace Firebird { @@ -58,12 +59,15 @@ virtual ExternalEngine* FB_CALL getEngine(Error* error) = 0; // Gets the Attachment associated with this context. - virtual Attachment* FB_CALL getAttachment(Error* error) = 0; + virtual IAttachment* FB_CALL getAttachment(Error* error) = 0; // Obtained transaction is valid only before control is returned to the engine // or in ExternalResultSet::fetch calls of correspondent ExternalProcedure::open. - virtual Transaction* FB_CALL getTransaction(Error* error) = 0; + virtual ITransaction* FB_CALL getTransaction(Error* error) = 0; + virtual const char* FB_CALL getUserName() = 0; + virtual const char* FB_CALL getDatabaseName() = 0; + // Get user attachment character set. virtual const Utf8* FB_CALL getClientCharSet() = 0; Modified: firebird/trunk/src/include/FirebirdUdrCpp.h =================================================================== --- firebird/trunk/src/include/FirebirdUdrCpp.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/include/FirebirdUdrCpp.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -438,14 +438,20 @@ public: static isc_db_handle getIscDbHandle(ExternalContext* context) { - Attachment* att = context->getAttachment(ThrowError()); - return att->getHandle(ThrowError()); + ISC_STATUS_ARRAY status = {0}; + isc_db_handle handle = 0; + fb_get_database_handle(status, &handle, context->getAttachment(ThrowError())); + ThrowError::check(status); + return handle; } static isc_tr_handle getIscTrHandle(ExternalContext* context) { - Transaction* tra = context->getTransaction(ThrowError()); - return tra->getHandle(ThrowError()); + ISC_STATUS_ARRAY status = {0}; + isc_tr_handle handle = 0; + fb_get_transaction_handle(status, &handle, context->getTransaction(ThrowError())); + ThrowError::check(status); + return handle; } static void* getEntryPoint(ExternalContext* /*context*/, const char* entryPoint) Modified: firebird/trunk/src/include/Interface.h =================================================================== --- firebird/trunk/src/include/Interface.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/include/Interface.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -77,6 +77,8 @@ class IProvider; class IPluginManager; class ITimerControl; +class IAttachment; +class ITransaction; // Master interface is used to access almost all other interfaces. class IMaster : public IDisposable @@ -91,6 +93,8 @@ virtual int FB_CARG upgradeInterface(IInterface* toUpgrade, int desiredVersion, void* missingFunctionClass) = 0; virtual const char* FB_CARG circularAlloc(const char* s, size_t len, intptr_t thr) = 0; virtual ITimerControl* FB_CARG getTimerControl() = 0; + virtual IAttachment* registerAttachment(IProvider* provider, IAttachment* attachment) = 0; + virtual ITransaction* registerTransaction(IAttachment* attachment, ITransaction* transaction) = 0; }; } // namespace Firebird Modified: firebird/trunk/src/include/ProviderInterface.h =================================================================== --- firebird/trunk/src/include/ProviderInterface.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/include/ProviderInterface.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -178,8 +178,7 @@ unsigned int bufferLength, unsigned char* buffer) = 0; // virtual ITransaction* FB_CARG startTransaction(IStatus* status, unsigned int tpbLength, const unsigned char* tpb) = 0; // second form is tmp - not to rewrite external engines right now - virtual ITransaction* FB_CARG startTransaction(IStatus* status, unsigned int tpbLength, const unsigned char* tpb, - FB_API_HANDLE api) = 0; + virtual ITransaction* FB_CARG startTransaction(IStatus* status, unsigned int tpbLength, const unsigned char* tpb) = 0; virtual ITransaction* FB_CARG reconnectTransaction(IStatus* status, unsigned int length, const unsigned char* id) = 0; virtual IStatement* FB_CARG allocateStatement(IStatus* status) = 0; virtual IRequest* FB_CARG compileRequest(IStatus* status, unsigned int blrLength, const unsigned char* blr) = 0; @@ -230,10 +229,10 @@ class IProvider : public IPluginBase { public: - virtual void FB_CARG attachDatabase(IStatus* status, IAttachment** ptr, FB_API_HANDLE api, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb) = 0; - virtual void FB_CARG createDatabase(IStatus* status, IAttachment** ptr, FB_API_HANDLE api, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb) = 0; + virtual IAttachment* FB_CARG attachDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb) = 0; + virtual IAttachment* FB_CARG createDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb) = 0; virtual IService* FB_CARG attachServiceManager(IStatus* status, const char* service, unsigned int spbLength, const unsigned char* spb) = 0; //virtual ITransaction* FB_CARG startTransaction(IStatus* status, unsigned int count, ...) = 0; Modified: firebird/trunk/src/jrd/Attachment.cpp =================================================================== --- firebird/trunk/src/jrd/Attachment.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/Attachment.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -48,13 +48,13 @@ // static method -Jrd::Attachment* Jrd::Attachment::create(Database* dbb, FB_API_HANDLE publicHandle) +Jrd::Attachment* Jrd::Attachment::create(Database* dbb) { MemoryPool* const pool = dbb->createPool(); try { - Attachment* const attachment = FB_NEW(*pool) Attachment(pool, dbb, publicHandle); + Attachment* const attachment = FB_NEW(*pool) Attachment(pool, dbb); pool->setStatsGroup(attachment->att_memory_stats); return attachment; } @@ -135,11 +135,10 @@ } -Jrd::Attachment::Attachment(MemoryPool* pool, Database* dbb, FB_API_HANDLE publicHandle) +Jrd::Attachment::Attachment(MemoryPool* pool, Database* dbb) : att_pool(pool), att_memory_stats(&dbb->dbb_memory_stats), att_database(dbb), - att_public_handle(publicHandle), att_requests(*pool), att_lock_owner_id(Database::getLockOwnerId()), att_backup_state_counter(0), @@ -157,7 +156,8 @@ att_ext_connection(NULL), att_ext_call_depth(0), att_trace_manager(FB_NEW(*att_pool) TraceManager(this)), - att_interface(NULL) + att_interface(NULL), + att_public_interface(NULL) { } Modified: firebird/trunk/src/jrd/Attachment.h =================================================================== --- firebird/trunk/src/jrd/Attachment.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/Attachment.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -121,14 +121,13 @@ class Attachment : public pool_alloc<type_att> { public: - static Attachment* create(Database* dbb, FB_API_HANDLE publicHandle); + static Attachment* create(Database* dbb); static void destroy(Attachment* const attachment); MemoryPool* const att_pool; // Memory pool Firebird::MemoryStats att_memory_stats; Database* att_database; // Parent database block - FB_API_HANDLE att_public_handle; // Public handle Attachment* att_next; // Next attachment to database UserId* att_user; // User identification jrd_tra* att_transactions; // Transactions belonging to attachment @@ -177,6 +176,7 @@ TraceManager* att_trace_manager; // Trace API manager JAttachment* att_interface; + Firebird::IAttachment* att_public_interface; bool locksmith() const; jrd_tra* getSysTransaction(); @@ -216,7 +216,7 @@ void backupStateReadUnLock(thread_db* tdbb); private: - Attachment(MemoryPool* pool, Database* dbb, FB_API_HANDLE publicHandle); + Attachment(MemoryPool* pool, Database* dbb); ~Attachment(); }; Modified: firebird/trunk/src/jrd/EngineInterface.h =================================================================== --- firebird/trunk/src/jrd/EngineInterface.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/EngineInterface.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -256,8 +256,8 @@ virtual void FB_CARG getInfo(Firebird::IStatus* status, unsigned int itemsLength, const unsigned char* items, unsigned int bufferLength, unsigned char* buffer); - virtual JTransaction* FB_CARG startTransaction(Firebird::IStatus* status, unsigned int tpbLength, const unsigned char* tpb, - FB_API_HANDLE api); + virtual JTransaction* FB_CARG startTransaction(Firebird::IStatus* status, + unsigned int tpbLength, const unsigned char* tpb); virtual JTransaction* FB_CARG reconnectTransaction(Firebird::IStatus* status, unsigned int length, const unsigned char* id); virtual JStatement* FB_CARG allocateStatement(Firebird::IStatus* status); virtual JRequest* FB_CARG compileRequest(Firebird::IStatus* status, unsigned int blr_length, const unsigned char* blr); @@ -353,10 +353,10 @@ } // IProvider implementation - virtual void FB_CARG attachDatabase(Firebird::IStatus* status, Firebird::IAttachment** ptr, - FB_API_HANDLE api, const char* fileName, unsigned int dpbLength, const unsigned char* dpb); - virtual void FB_CARG createDatabase(Firebird::IStatus* status, Firebird::IAttachment** ptr, - FB_API_HANDLE api, const char* fileName, unsigned int dpbLength, const unsigned char* dpb); + virtual JAttachment* FB_CARG attachDatabase(Firebird::IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb); + virtual JAttachment* FB_CARG createDatabase(Firebird::IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb); virtual JService* FB_CARG attachServiceManager(Firebird::IStatus* status, const char* service, unsigned int spbLength, const unsigned char* spb); //virtual ITransaction* startTransaction(Firebird::IStatus* status, unsigned int count, ...); Modified: firebird/trunk/src/jrd/ExtEngineManager.cpp =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -60,40 +60,6 @@ namespace Jrd { -class ExtEngineManager::AttachmentImpl : public Firebird::Attachment -{ -public: - AttachmentImpl(ExternalContextImpl* aContext, Handle aHandle, Jrd::Attachment* aAttachment); - virtual ~AttachmentImpl(); - -public: - virtual void FB_CALL dispose(Error* error); - - virtual Handle FB_CALL getHandle(Error* error) const; - virtual const char* FB_CALL getUserName() const; - virtual const char* FB_CALL getDatabaseName() const; - -private: - ExternalContextImpl* context; - FB_API_HANDLE handle; - Jrd::Attachment* attachment; -}; - - -class ExtEngineManager::TransactionImpl : public Firebird::Transaction -{ -public: - TransactionImpl(Handle aHandle); - virtual ~TransactionImpl(); - -public: - virtual Handle FB_CALL getHandle(Error* error) const; - -private: - FB_API_HANDLE handle; -}; - - template <typename T> class ExtEngineManager::ContextManager { public: @@ -200,89 +166,18 @@ //--------------------- -ExtEngineManager::AttachmentImpl::AttachmentImpl(ExternalContextImpl* aContext, Handle aHandle, - Jrd::Attachment* aAttachment) - : context(aContext), - handle(aHandle), - attachment(aAttachment) -{ -} - -ExtEngineManager::AttachmentImpl::~AttachmentImpl() -{ - context->attachment.release(); - handle = 0; - dispose(LogError()); -} - -void FB_CALL ExtEngineManager::AttachmentImpl::dispose(Error* error) -{ - ISC_STATUS_ARRAY statusVector; - - if (handle) - { - if (isc_detach_database(statusVector, &handle) != 0) - { - ErrorImpl::statusVectorToError(statusVector, error); - return; - } - } - - context->attachment = NULL; -} - -Handle FB_CALL ExtEngineManager::AttachmentImpl::getHandle(Error* /*error*/) const -{ - return handle; -} - - -const char* FB_CALL ExtEngineManager::AttachmentImpl::getUserName() const -{ - return attachment->att_user->usr_user_name.c_str(); -} - - -const char* FB_CALL ExtEngineManager::AttachmentImpl::getDatabaseName() const -{ - return attachment->att_database->dbb_database_name.c_str(); -} - - -//--------------------- - - -ExtEngineManager::TransactionImpl::TransactionImpl(Handle aHandle) - : handle(aHandle) -{ -} - -ExtEngineManager::TransactionImpl::~TransactionImpl() -{ -} - -Handle FB_CALL ExtEngineManager::TransactionImpl::getHandle(Error* /*error*/) const -{ - return handle; -} - - -//--------------------- - - ExtEngineManager::ExternalContextImpl::ExternalContextImpl(thread_db* tdbb, ExternalEngine* aEngine) : engine(aEngine), internalAttachment(tdbb->getAttachment()), - miscInfo(*internalAttachment->att_pool), - traHandle(0) + internalTransaction(NULL), + externalAttachment(NULL), + externalTransaction(NULL), + miscInfo(*internalAttachment->att_pool) { //// TODO: admin rights - attHandle = internalAttachment->att_public_handle; clientCharSet = INTL_charset_lookup(tdbb, internalAttachment->att_client_charset)->getName(); - - setTransaction(tdbb); } ExtEngineManager::ExternalContextImpl::~ExternalContextImpl() @@ -292,21 +187,48 @@ void ExtEngineManager::ExternalContextImpl::releaseTransaction() { - if (traHandle) + if (externalTransaction) { - traHandle = 0; - transaction = NULL; + externalTransaction->release(); + externalTransaction = NULL; } + + if (externalAttachment) + { + externalAttachment->release(); + externalAttachment = NULL; + } + + internalTransaction = NULL; } void ExtEngineManager::ExternalContextImpl::setTransaction(thread_db* tdbb) { + jrd_tra* newTransaction = tdbb->getTransaction(); + + if (newTransaction == internalTransaction) + return; + releaseTransaction(); + fb_assert(!externalAttachment && !externalTransaction); - jrd_tra* tra = tdbb->getTransaction(); - traHandle = tra ? tra->tra_public_handle : 0; + MasterInterfacePtr master; - transaction = FB_NEW(*internalAttachment->att_pool) TransactionImpl(traHandle); + if (internalAttachment) + { + internalAttachment->att_interface->addRef(); + + externalAttachment = master->registerAttachment(currentProvider(), + internalAttachment->att_interface); + } + + if ((internalTransaction = newTransaction)) + { + internalTransaction->tra_interface->addRef(); + + externalTransaction = master->registerTransaction(externalAttachment, + internalTransaction->tra_interface); + } } ExternalEngine* ExtEngineManager::ExternalContextImpl::getEngine(Error* /*error*/) @@ -314,37 +236,37 @@ return engine; } -Firebird::Attachment* FB_CALL ExtEngineManager::ExternalContextImpl::getAttachment(Error* /*error*/) +Firebird::IAttachment* FB_CALL ExtEngineManager::ExternalContextImpl::getAttachment(Error* /*error*/) { - if (!this->attachment) - { - thread_db* tdbb = JRD_get_thread_data(); - attachment = FB_NEW(*internalAttachment->att_pool) AttachmentImpl(this, attHandle, - tdbb->getAttachment()); - } + return externalAttachment; +} - return attachment; +Firebird::ITransaction* FB_CALL ExtEngineManager::ExternalContextImpl::getTransaction(Error* /*error*/) +{ + return externalTransaction; } -Firebird::Transaction* FB_CALL ExtEngineManager::ExternalContextImpl::getTransaction(Error* /*error*/) +const char* FB_CALL ExtEngineManager::ExternalContextImpl::getUserName() { - return transaction; + return internalAttachment->att_user->usr_user_name.c_str(); } +const char* FB_CALL ExtEngineManager::ExternalContextImpl::getDatabaseName() +{ + return internalAttachment->att_database->dbb_database_name.c_str(); +} const Utf8* FB_CALL ExtEngineManager::ExternalContextImpl::getClientCharSet() { return clientCharSet.c_str(); } - int FB_CALL ExtEngineManager::ExternalContextImpl::obtainInfoCode() { static AtomicCounter counter; return ++counter; } - void* FB_CALL ExtEngineManager::ExternalContextImpl::getInfo(int code) { void* value = NULL; @@ -352,7 +274,6 @@ return value; } - void* FB_CALL ExtEngineManager::ExternalContextImpl::setInfo(int code, void* value) { void* oldValue = getInfo(code); @@ -705,8 +626,11 @@ if (attInfo) { - ContextManager<ExternalFunction> ctxManager(tdbb, attInfo, attInfo->adminCharSet); - engine->closeAttachment(LogError(), attInfo->context); + { // scope + ContextManager<ExternalFunction> ctxManager(tdbb, attInfo, attInfo->adminCharSet); + engine->closeAttachment(LogError(), attInfo->context); + } + delete attInfo; } } Modified: firebird/trunk/src/jrd/ExtEngineManager.h =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -41,6 +41,7 @@ class thread_db; class jrd_prc; +class jrd_tra; class Attachment; class Database; class Format; @@ -72,8 +73,10 @@ void setTransaction(thread_db* tdbb); virtual Firebird::ExternalEngine* FB_CALL getEngine(Firebird::Error* error); - virtual Firebird::Attachment* FB_CALL getAttachment(Firebird::Error* error); - virtual Firebird::Transaction* FB_CALL getTransaction(Firebird::Error* error); + virtual Firebird::IAttachment* FB_CALL getAttachment(Firebird::Error* error); + virtual Firebird::ITransaction* FB_CALL getTransaction(Firebird::Error* error); + virtual const char* FB_CALL getUserName(); + virtual const char* FB_CALL getDatabaseName(); virtual const Firebird::Utf8* FB_CALL getClientCharSet(); virtual int FB_CALL obtainInfoCode(); virtual void* FB_CALL getInfo(int code); @@ -82,12 +85,11 @@ private: Firebird::ExternalEngine* engine; Attachment* internalAttachment; + jrd_tra* internalTransaction; + Firebird::IAttachment* externalAttachment; + Firebird::ITransaction* externalTransaction; Firebird::GenericMap<Firebird::NonPooled<int, void*> > miscInfo; - FB_API_HANDLE traHandle; - FB_API_HANDLE attHandle; Firebird::MetaName clientCharSet; - Firebird::AutoPtr<AttachmentImpl> attachment; - Firebird::AutoPtr<TransactionImpl> transaction; }; struct EngineAttachment Modified: firebird/trunk/src/jrd/extds/InternalDS.cpp =================================================================== --- firebird/trunk/src/jrd/extds/InternalDS.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/extds/InternalDS.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -163,7 +163,7 @@ { EngineCallbackGuard guard(tdbb, *this); - currentProvider()->attachDatabase(&status, &a, 0, m_dbName.c_str(), + a = currentProvider()->attachDatabase(&status, m_dbName.c_str(), m_dpb.getBufferLength(), m_dpb.getBuffer()); } @@ -277,8 +277,7 @@ EngineCallbackGuard guard(tdbb, *this); IntStatus s(status); - m_transaction = att->startTransaction(&s, tpb.getBufferLength(), tpb.getBuffer(), 0); - //// FIXME: public_handle + m_transaction = att->startTransaction(&s, tpb.getBufferLength(), tpb.getBuffer()); } } Modified: firebird/trunk/src/jrd/ibase.h =================================================================== --- firebird/trunk/src/jrd/ibase.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/ibase.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -1154,6 +1154,13 @@ ISC_STATUS ISC_EXPORT fb_ping(ISC_STATUS*, isc_db_handle*); +/***********************/ +/* Object interface */ +/***********************/ + +ISC_STATUS ISC_EXPORT fb_get_database_handle(ISC_STATUS*, isc_db_handle*, void*); +ISC_STATUS ISC_EXPORT fb_get_transaction_handle(ISC_STATUS*, isc_tr_handle*, void*); + /********************************/ /* Client information functions */ /********************************/ Modified: firebird/trunk/src/jrd/jrd.cpp =================================================================== --- firebird/trunk/src/jrd/jrd.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/jrd.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -788,8 +788,7 @@ static Database* init(thread_db*, const PathName&, RefPtr<Config>, bool); static void prepare_tra(thread_db*, jrd_tra*, USHORT, const UCHAR*); static void start_transaction(thread_db* tdbb, bool transliterate, jrd_tra** tra_handle, - Jrd::Attachment* attachment, unsigned int tpb_length, const UCHAR* tpb, - FB_API_HANDLE public_handle = 0); + Jrd::Attachment* attachment, unsigned int tpb_length, const UCHAR* tpb); static void release_attachment(thread_db*, Jrd::Attachment*); static void rollback(thread_db*, jrd_tra*, const bool); static void shutdown_database(Database*, const bool); @@ -1076,12 +1075,8 @@ namespace Jrd { -void JProvider::attachDatabase(IStatus* user_status, - Firebird::IAttachment** handle, - FB_API_HANDLE public_handle, - const char* filename, - unsigned int dpb_length, - const unsigned char* dpb) +JAttachment* FB_CARG JProvider::attachDatabase(IStatus* user_status, const char* filename, + unsigned int dpb_length, const unsigned char* dpb) { /************************************** * @@ -1094,8 +1089,6 @@ * sullied by user data. * **************************************/ - *handle = NULL; - try { ThreadContextHolder tdbb(user_status); @@ -1223,7 +1216,7 @@ } } - attachment = Jrd::Attachment::create(dbb, public_handle); + attachment = Jrd::Attachment::create(dbb); tdbb->setAttachment(attachment); attachment->att_filename = is_alias ? file_name : expanded_name; attachment->att_network_protocol = options.dpb_network_protocol; @@ -1662,7 +1655,6 @@ attachment->att_interface = jAtt; MutexLockGuard guard(*(jAtt->getMutex())); - *handle = jAtt; if (attachment->att_trace_manager->needs(TRACE_EVENT_ATTACH)) { @@ -1706,7 +1698,6 @@ } catch (const Exception&) { - *handle = NULL; attachment->att_flags = save_flags; if (!(dbb->dbb_flags & DBB_bugcheck) && transaction) TRA_rollback(tdbb, transaction, false, false); @@ -1717,7 +1708,7 @@ // guardDatabases.leave(); jAtt->addRef(); - return; + return jAtt; } // try catch (const Exception& ex) { @@ -1733,7 +1724,8 @@ { ex.stuffException(user_status); } - *handle = NULL; + + return NULL; } @@ -2161,9 +2153,8 @@ } -void JProvider::createDatabase(IStatus* user_status, Firebird::IAttachment** handle, - FB_API_HANDLE public_handle, const char* filename, unsigned int dpb_length, - const unsigned char* dpb) +JAttachment* FB_CARG JProvider::createDatabase(IStatus* user_status, const char* filename, + unsigned int dpb_length, const unsigned char* dpb) { /************************************** * @@ -2175,8 +2166,6 @@ * Create a nice, squeeky clean database, uncorrupted by user data. * **************************************/ - *handle = NULL; - try { ThreadContextHolder tdbb(user_status); @@ -2277,7 +2266,7 @@ dbb->dbb_encrypt_key = options.dpb_key; } - attachment = Jrd::Attachment::create(dbb, public_handle); + attachment = Jrd::Attachment::create(dbb); tdbb->setAttachment(attachment); attachment->att_filename = is_alias ? file_name : expanded_name; attachment->att_network_protocol = options.dpb_network_protocol; @@ -2348,7 +2337,7 @@ { if (options.dpb_overwrite) { - attachDatabase(user_status, handle, public_handle, filename, dpb_length, dpb); + JAttachment* attachment2 = attachDatabase(user_status, filename, dpb_length, dpb); if (user_status->get()[1] == isc_adm_task_denied) { throw; @@ -2356,10 +2345,10 @@ bool allow_overwrite = false; - if (*handle) + if (attachment2) { - allow_overwrite = reinterpret_cast<Attachment*>(*handle)->att_user->locksmith(); - (*handle)->detach(user_status); + allow_overwrite = attachment2->getHandle()->att_user->locksmith(); + attachment2->detach(user_status); } else { @@ -2506,9 +2495,8 @@ JAttachment* jAtt = new JAttachment(attachment); jAtt->addRef(); attachment->att_interface = jAtt; - *handle = jAtt; - return; + return jAtt; } // try catch (const Exception& ex) { @@ -2525,7 +2513,7 @@ ex.stuffException(user_status); } - *handle = NULL; + return NULL; } @@ -3910,7 +3898,7 @@ JTransaction* JAttachment::startTransaction(IStatus* user_status, - unsigned int tpbLength, const unsigned char* tpb, FB_API_HANDLE public_handle) + unsigned int tpbLength, const unsigned char* tpb) { /************************************** * @@ -3929,7 +3917,7 @@ EngineContextHolder tdbb(user_status, this); check_database(tdbb); - start_transaction(tdbb, true, &tra, getHandle(), tpbLength, tpb, public_handle); + start_transaction(tdbb, true, &tra, getHandle(), tpbLength, tpb); } catch (const Exception& ex) { @@ -7147,8 +7135,7 @@ static void start_transaction(thread_db* tdbb, bool transliterate, jrd_tra** tra_handle, - Jrd::Attachment* attachment, unsigned int tpb_length, const UCHAR* tpb, - FB_API_HANDLE public_handle) + Jrd::Attachment* attachment, unsigned int tpb_length, const UCHAR* tpb) { /************************************** * @@ -7172,7 +7159,6 @@ { jrd_tra* transaction = TRA_start(tdbb, tpb_length, tpb); - transaction->tra_public_handle = public_handle; transaction->tra_sibling = NULL; *tra_handle = transaction; @@ -7318,6 +7304,7 @@ } +#if 0 namespace { typedef Array<FB_API_HANDLE> PingQueue; @@ -7336,6 +7323,7 @@ return 0; } } // namespace +#endif void JRD_shutdown_attachments(const Database* dbb) @@ -7352,6 +7340,7 @@ **************************************/ fb_assert(dbb); +#if 0 //// FIXME: try { MemoryPool& pool = *getDefaultMemoryPool(); @@ -7370,6 +7359,7 @@ } catch (const Exception&) {} // no-op +#endif } Modified: firebird/trunk/src/jrd/tra.h =================================================================== --- firebird/trunk/src/jrd/tra.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/jrd/tra.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -161,6 +161,7 @@ tra_transactions(*p), tra_sorts(*p), tra_interface(NULL), + tra_public_interface(NULL), tra_blob_space(NULL), tra_undo_space(NULL), tra_undo_record(NULL), @@ -262,6 +263,7 @@ EDS::Transaction *tra_ext_common; //Transaction *tra_ext_two_phase; JTransaction* tra_interface; + Firebird::ITransaction* tra_public_interface; private: TempSpace* tra_blob_space; // temp blob storage Modified: firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp =================================================================== --- firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -577,12 +577,7 @@ PathName path; PathUtils::concatPath(path, *i, *moduleName); - ModuleLoader::Module* module = ModuleLoader::loadModule(path); - if (!module) - { - ModuleLoader::doctorModuleExtension(path); - module = ModuleLoader::loadModule(path); - } + ModuleLoader::Module* module = ModuleLoader::fixAndLoadModule(path); if (module) { Modified: firebird/trunk/src/remote/client/interface.cpp =================================================================== --- firebird/trunk/src/remote/client/interface.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/remote/client/interface.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -354,8 +354,8 @@ unsigned int bufferLength, unsigned char* buffer); // virtual Firebird::ITransaction* startTransaction(IStatus* status, unsigned int tpbLength, const unsigned char* tpb); // second form is tmp - not to rewrite external engines right now - virtual Firebird::ITransaction* FB_CARG startTransaction(IStatus* status, unsigned int tpbLength, const unsigned char* tpb, - FB_API_HANDLE api); + virtual Firebird::ITransaction* FB_CARG startTransaction(IStatus* status, + unsigned int tpbLength, const unsigned char* tpb); virtual Firebird::ITransaction* FB_CARG reconnectTransaction(IStatus* status, unsigned int length, const unsigned char* id); virtual Firebird::IStatement* FB_CARG allocateStatement(IStatus* status); virtual Firebird::IRequest* FB_CARG compileRequest(IStatus* status, unsigned int blr_length, const unsigned char* blr); @@ -460,10 +460,10 @@ } // IProvider implementation - virtual void FB_CARG attachDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE api, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb); - virtual void FB_CARG createDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE api, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb); + virtual IAttachment* FB_CARG attachDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb); + virtual IAttachment* FB_CARG createDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb); virtual Firebird::IService* FB_CARG attachServiceManager(IStatus* status, const char* service, unsigned int spbLength, const unsigned char* spb); //virtual Firebird::ITransaction* startTransaction(IStatus* status, unsigned int count, ...); @@ -502,10 +502,10 @@ } // IProvider implementation - virtual void FB_CARG attachDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE api, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb); - virtual void FB_CARG createDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE api, const char* fileName, - unsigned int dpbLength, const unsigned char* dpb); + virtual IAttachment* FB_CARG attachDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb); + virtual IAttachment* FB_CARG createDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb); virtual Firebird::IService* FB_CARG attachServiceManager(IStatus* status, const char* service, unsigned int spbLength, const unsigned char* spb); }; @@ -669,8 +669,8 @@ } -void Provider::attachDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE /*public_handle*/, - const char* filename, unsigned int dpb_length, const unsigned char* dpb) +IAttachment* Provider::attachDatabase(IStatus* status, const char* filename, + unsigned int dpb_length, const unsigned char* dpb) { /************************************** * @@ -683,12 +683,12 @@ * **************************************/ - *ptr = attach(status, filename, dpb_length, dpb, false); + return attach(status, filename, dpb_length, dpb, false); } -void Loopback::attachDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE /*public_handle*/, - const char* filename, unsigned int dpb_length, const unsigned char* dpb) +IAttachment* Loopback::attachDatabase(IStatus* status, const char* filename, + unsigned int dpb_length, const unsigned char* dpb) { /************************************** * @@ -701,7 +701,7 @@ * **************************************/ - *ptr = attach(status, filename, dpb_length, dpb, true); + return attach(status, filename, dpb_length, dpb, true); } @@ -1154,8 +1154,8 @@ } -void Provider::createDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE /*public_handle*/, - const char* fileName, unsigned int dpbLength, const unsigned char* dpb) +IAttachment* Provider::createDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb) { /************************************** * @@ -1168,12 +1168,12 @@ * **************************************/ - *ptr = create(status, fileName, dpbLength, dpb, false); + return create(status, fileName, dpbLength, dpb, false); } -void Loopback::createDatabase(IStatus* status, Firebird::IAttachment** ptr, FB_API_HANDLE /*public_handle*/, - const char* fileName, unsigned int dpbLength, const unsigned char* dpb) +IAttachment* Loopback::createDatabase(IStatus* status, const char* fileName, + unsigned int dpbLength, const unsigned char* dpb) { /************************************** * @@ -1186,7 +1186,7 @@ * **************************************/ - *ptr = create(status, fileName, dpbLength, dpb, true); + return create(status, fileName, dpbLength, dpb, true); } @@ -4338,9 +4338,8 @@ } -Firebird::ITransaction* Attachment::startTransaction(IStatus* status, - unsigned int tpbLength, const unsigned char* tpb, - FB_API_HANDLE /*api*/) +Firebird::ITransaction* Attachment::startTransaction(IStatus* status, unsigned int tpbLength, + const unsigned char* tpb) { /************************************** * Modified: firebird/trunk/src/yvalve/MasterImplementation.cpp =================================================================== --- firebird/trunk/src/yvalve/MasterImplementation.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/yvalve/MasterImplementation.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -31,7 +31,6 @@ #include "Timer.h" #include "../yvalve/MasterImplementation.h" -#include "../common/classes/ImplementHelper.h" #include "../common/classes/init.h" #include "../common/StatusHolder.h" #include "../yvalve/PluginManager.h" @@ -48,18 +47,6 @@ namespace Why { -class MasterImplementation : public StackIface<IMaster> -{ -public: - // IMaster implementation - IStatus* FB_CARG getStatus(); - IProvider* FB_CARG getDispatcher(); - IPluginManager* FB_CARG getPluginManager(); - int FB_CARG upgradeInterface(IInterface* toUpgrade, int desiredVersion, void* missingFunctionClass); - const char* FB_CARG circularAlloc(const char* s, size_t len, intptr_t thr); - ITimerControl* FB_CARG getTimerControl(); -}; - // // getStatus() // Modified: firebird/trunk/src/yvalve/MasterImplementation.h =================================================================== --- firebird/trunk/src/yvalve/MasterImplementation.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/yvalve/MasterImplementation.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -31,11 +31,28 @@ #include "firebird.h" #include "Interface.h" +#include "../common/classes/ImplementHelper.h" namespace Why { extern Firebird::IProvider* dispatcherPtr; + class MasterImplementation : public Firebird::StackIface<Firebird::IMaster> + { + public: + // IMaster implementation + Firebird::IStatus* FB_CARG getStatus(); + Firebird::IProvider* FB_CARG getDispatcher(); + Firebird::IPluginManager* FB_CARG getPluginManager(); + int FB_CARG upgradeInterface(Firebird::IInterface* toUpgrade, int desiredVersion, void* missingFunctionClass); + const char* FB_CARG circularAlloc(const char* s, size_t len, intptr_t thr); + Firebird::ITimerControl* FB_CARG getTimerControl(); + Firebird::IAttachment* registerAttachment(Firebird::IProvider* provider, + Firebird::IAttachment* attachment); + Firebird::ITransaction* registerTransaction(Firebird::IAttachment* attachment, + Firebird::ITransaction* transaction); + }; + void shutdownTimers(); } // namespace Why Modified: firebird/trunk/src/yvalve/PluginManager.cpp =================================================================== --- firebird/trunk/src/yvalve/PluginManager.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/yvalve/PluginManager.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -926,7 +926,7 @@ if (plugin->release() == 0) { - fb_assert(parent); + ///fb_assert(parent); if (parent) { parent->release(); Modified: firebird/trunk/src/yvalve/why.cpp =================================================================== --- firebird/trunk/src/yvalve/why.cpp 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/yvalve/why.cpp 2011-05-07 19:52:44 UTC (rev 52892) @@ -681,7 +681,7 @@ YEvents(YAttachment* aAttachment, IEvents* aNext, IEventCallback* aCallback); - virtual ~YEvents() + ~YEvents() { if (deleteCallback) delete callback; @@ -696,7 +696,7 @@ { if (next) { - next->release(); + next = NULL; destroy(); } @@ -732,7 +732,7 @@ { if (next) { - next->release(); + next = NULL; destroy(); } @@ -798,7 +798,7 @@ { if (next) { - next->release(); + next = NULL; destroy(); } @@ -850,7 +850,7 @@ { if (next) { - next->release(); + next = NULL; destroy(); } @@ -891,7 +891,7 @@ { if (next) { - next->release(); + next = NULL; destroy(); } @@ -968,12 +968,10 @@ handle = makeHandle(&attachments, this); } - virtual ~YAttachment() + ~YAttachment() { if (provider) - { PluginManagerInterfacePtr()->releasePlugin(provider); - } } void destroy(); @@ -986,7 +984,7 @@ { if (next) { - next->release(); + next = NULL; destroy(); } @@ -1000,7 +998,7 @@ virtual void FB_CARG getInfo(IStatus* status, unsigned int itemsLength, const unsigned char* items, unsigned int bufferLength, unsigned char* buffer); virtual YTransaction* FB_CARG startTransaction(IStatus* status, unsigned int tpbLength, - const unsigned char* tpb, FB_API_HANDLE api); + const unsigned char* tpb); virtual YTransaction* FB_CARG reconnectTransaction(IStatus* status, unsigned int length, const unsigned char* id); virtual YStatement* FB_CARG allocateStatement(IStatus* status); @@ -1059,12 +1057,10 @@ handle = makeHandle(&services, this); } - virtual ~YService() + ~YService() { if (provider) - { PluginManagerInterfacePtr()->releasePlugin(provider); - } } void destroy(); @@ -1076,7 +1072,7 @@ { if (next) { - next->release(); + next = NULL; destroy(); } @@ -1109,10 +1105,10 @@ } // IProvider implementation - virtual void FB_CARG attachDatabase(IStatus* status, IAttachment** attachment, - FB_API_HANDLE api, const char* filename, unsigned int dpbLength, const unsigned char* dpb); - virtual void FB_CARG createDatabase(IStatus* status, IAttachment** ptr, - FB_API_HANDLE api, const char* filename, unsigned int dpbLength, const unsigned char* dpb); + virtual YAttachment* FB_CARG attachDatabase(IStatus* status, const char* filename, + unsigned int dpbLength, const unsigned char* dpb); + virtual YAttachment* FB_CARG createDatabase(IStatus* status, const char* filename, + unsigned int dpbLength, const unsigned char* dpb); virtual YService* FB_CARG attachServiceManager(IStatus* status, const char* serviceName, unsigned int spbLength, const unsigned char* spb); virtual void FB_CARG shutdown(IStatus* status, unsigned int timeout, const int reason); @@ -1763,15 +1759,13 @@ PathName pathName(filename, fileLength ? fileLength : strlen(filename)); - IAttachment* attachment = NULL; - dispatcher->attachDatabase(&status, &attachment, 0, pathName.c_str(), dpbLength, + YAttachment* attachment = dispatcher->attachDatabase(&status, pathName.c_str(), dpbLength, reinterpret_cast<const UCHAR*>(dpb)); if (!status.isSuccess()) return status[1]; - YAttachment* yAttach = static_cast<YAttachment*>(attachment); - *publicHandle = yAttach->handle; + *publicHandle = attachment->handle; } catch (const Exception& e) { @@ -2044,15 +2038,13 @@ PathName pathName(filename, fileLength ? fileLength : strlen(filename)); - IAttachment* attachment = NULL; - dispatcher->createDatabase(&status, &attachment, 0, pathName.c_str(), dpbLength, + YAttachment* attachment = dispatcher->createDatabase(&status, pathName.c_str(), dpbLength, reinterpret_cast<const UCHAR*>(dpb)); if (!status.isSuccess()) return status[1]; - YAttachment* yAttach = static_cast<YAttachment*>(attachment); - *publicHandle = yAttach->handle; + *publicHandle = attachment->handle; } catch (const Exception& e) { @@ -3530,7 +3522,7 @@ RefPtr<YAttachment> attachment(translateHandle(attachments, vector->teb_database)); YTransaction* transaction = attachment->startTransaction(&status, - vector->teb_tpb_length, vector->teb_tpb, 0); + vector->teb_tpb_length, vector->teb_tpb); if (!status.isSuccess()) status_exception::raise(status); @@ -3747,9 +3739,62 @@ } +// Get the legacy handle of a database. +ISC_STATUS API_ROUTINE fb_get_database_handle(ISC_STATUS* userStatus, FB_API_HANDLE* handle, void* obj) +{ + StatusVector status(userStatus); + + try + { + YAttachment* yObject = static_cast<YAttachment*>(obj); + *handle = yObject->handle; + } + catch (const Exception& e) + { + e.stuffException(&status); + } + + return status[1]; +} + + +// Get the legacy handle of a transaction. +ISC_STATUS API_ROUTINE fb_get_transaction_handle(ISC_STATUS* userStatus, FB_API_HANDLE* handle, void* obj) +{ + StatusVector status(userStatus); + + try + { + YTransaction* yObject = static_cast<YTransaction*>(obj); + *handle = yObject->handle; + } + catch (const Exception& e) + { + e.stuffException(&status); + } + + return status[1]; +} + + //------------------------------------- +IAttachment* MasterImplementation::registerAttachment(IProvider* provider, IAttachment* attachment) +{ + return new YAttachment(provider, attachment, ""); +} + +ITransaction* MasterImplementation::registerTransaction(IAttachment* attachment, + ITransaction* transaction) +{ + return new YTransaction(static_cast<YAttachment*>(attachment), transaction); +} + + +//------------------------------------- + + YEvents::YEvents(YAttachment* aAttachment, IEvents* aNext, IEventCallback* aCallback) : attachment(aAttachment), next(aNext), @@ -3766,8 +3811,11 @@ removeHandle(&events, handle); - next = NULL; - release(); + if (next) + { + next = NULL; + release(); + } } void YEvents::cancel(IStatus* status) @@ -3812,8 +3860,11 @@ removeHandle(&requests, handle); - next = NULL; - release(); + if (next) + { + next = NULL; + release(); + } } void YRequest::receive(IStatus* status, int level, unsigned int msgType, @@ -3940,8 +3991,11 @@ removeHandle(&blobs, handle); - next = NULL; - release(); + if (next) + { + next = NULL; + release(); + } } void YBlob::getInfo(IStatus* status, unsigned int itemsLength, @@ -4061,8 +4115,11 @@ removeHandle(&statements, handle); - next = NULL; - release(); + if (next) + { + next = NULL; + release(); + } } void YStatement::prepare(IStatus* status, ITransaction* transaction, @@ -4334,8 +4391,11 @@ removeHandle(&transactions, handle); - next = NULL; - release(); + if (next) + { + next = NULL; + release(); + } } void YTransaction::getInfo(IStatus* status, unsigned int itemsLength, @@ -4674,8 +4734,11 @@ removeHandle(&attachments, handle); - next = NULL; - release(); + if (next) + { + next = NULL; + release(); + } } // Get the full database pathname and put it in the transaction description record. @@ -4715,13 +4778,13 @@ } YTransaction* YAttachment::startTransaction(IStatus* status, unsigned int tpbLength, - const unsigned char* tpb, FB_API_HANDLE api) + const unsigned char* tpb) { try { YEntry entry(status, this); - ITransaction* transaction = next->startTransaction(status, tpbLength, tpb, api); + ITransaction* transaction = next->startTransaction(status, tpbLength, tpb); if (transaction) transaction = new YTransaction(this, transaction); @@ -5064,8 +5127,11 @@ { removeHandle(&services, handle); - next = NULL; - release(); + if (next) + { + next = NULL; + release(); + } } void YService::detach(IStatus* status) @@ -5118,15 +5184,13 @@ // Attach a database through the first subsystem that recognizes it. -void Dispatcher::attachDatabase(IStatus* status, IAttachment** attachment, FB_API_HANDLE /*api*/, - const char* filename, unsigned int dpbLength, const unsigned char* dpb) +YAttachment* Dispatcher::attachDatabase(IStatus* status, const char* filename, + unsigned int dpbLength, const unsigned char* dpb) { try { YEntry entry(status); - *attachment = NULL; - if (shutdownStarted) status_exception::raise(Arg::Gds(isc_att_shutdown)); @@ -5213,18 +5277,15 @@ { IProvider* provider = providerIterator.plugin(); - provider->attachDatabase(currentStatus, attachment, 0, expandedFilename.c_str(), - newDpb.getBufferLength(), newDpb.getBuffer()); + IAttachment* attachment = provider->attachDatabase(currentStatus, + expandedFilename.c_str(), newDpb.getBufferLength(), newDpb.getBuffer()); if (currentStatus->isSuccess()) { - *attachment = new YAttachment(provider, *attachment, expandedFilename); status->set(currentStatus->get()); - return; + return new YAttachment(provider, attachment, expandedFilename); } - *attachment = NULL; - if (currentStatus->get()[1] != isc_unavailable) currentStatus = &temp; @@ -5236,22 +5297,19 @@ } catch (const Exception& e) { - if (*attachment) - (*attachment)->release(); - e.stuffException(status); } + + return NULL; } -void Dispatcher::createDatabase(IStatus* status, IAttachment** attachment, FB_API_HANDLE /*api*/, - const char* filename, unsigned int dpbLength, const unsigned char* dpb) +YAttachment* Dispatcher::createDatabase(IStatus* status, const char* filename, + unsigned int dpbLength, const unsigned char* dpb) { try { YEntry entry(status); - *attachment = NULL; - if (shutdownStarted) status_exception::raise(Arg::Gds(isc_att_shutdown)); @@ -5342,8 +5400,8 @@ { IProvider* provider = providerIterator.plugin(); - provider->createDatabase(currentStatus, attachment, 0, expandedFilename.c_str(), - newDpb.getBufferLength(), newDpb.getBuffer()); + IAttachment* attachment = provider->createDatabase(currentStatus, + expandedFilename.c_str(), newDpb.getBufferLength(), newDpb.getBuffer()); if (currentStatus->isSuccess()) { @@ -5354,13 +5412,10 @@ PathName path(orgFilename); #endif - *attachment = new YAttachment(provider, *attachment, path); status->set(currentStatus->get()); - return; + return new YAttachment(provider, attachment, path); } - *attachment = NULL; - if (currentStatus->get()[1] != isc_unavailable) currentStatus = &temp; @@ -5372,14 +5427,10 @@ } catch (const Exception& e) { - if (*attachment) - { - StatusVector temp(NULL); - (*attachment)->drop(&temp); - } - e.stuffException(status); } + + return NULL; } // Attach a service through the first subsystem that recognizes it. Modified: firebird/trunk/src/yvalve/why_proto.h =================================================================== --- firebird/trunk/src/yvalve/why_proto.h 2011-05-07 19:33:46 UTC (rev 52891) +++ firebird/trunk/src/yvalve/why_proto.h 2011-05-07 19:52:44 UTC (rev 52892) @@ -244,6 +244,9 @@ ISC_STATUS API_ROUTINE fb_ping(ISC_STATUS*, FB_API_HANDLE*); +ISC_STATUS API_ROUTINE fb_get_database_handle(ISC_STATUS*, FB_API_HANDLE*, void*); +ISC_STATUS API_ROUTINE fb_get_transaction_handle(ISC_STATUS*, FB_API_HANDLE*, void*); + typedef void AttachmentCleanupRoutine(FB_API_HANDLE*, void*); typedef void TransactionCleanupRoutine(FB_API_HANDLE, void*); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-08 03:17:42
|
Revision: 52893 http://firebird.svn.sourceforge.net/firebird/?rev=52893&view=rev Author: firebirds Date: 2011-05-08 03:17:35 +0000 (Sun, 08 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-07 19:52:44 UTC (rev 52892) +++ firebird/trunk/ChangeLog 2011-05-08 03:17:35 UTC (rev 52893) @@ -1,3 +1,39 @@ + 2011-05-07 19:52 asfernandes + M builds/posix/firebird.vers + M builds/win32/defs/firebird.def + M examples/udr/UdrCppExample.cpp + M src/gpre/boot/gpre_meta_boot.cpp + M src/include/FirebirdApi.h + M src/include/FirebirdExternalApi.h + M src/include/FirebirdUdrCpp.h + M src/include/Interface.h + M src/include/ProviderInterface.h + M src/jrd/Attachment.cpp + M src/jrd/Attachment.h + M src/jrd/EngineInterface.h + M src/jrd/ExtEngineManager.cpp + M src/jrd/ExtEngineManager.h + M src/jrd/extds/InternalDS.cpp + M src/jrd/ibase.h + M src/jrd/jrd.cpp + M src/jrd/tra.h + M src/plugins/udr_engine/UdrEngine.cpp + M src/remote/client/interface.cpp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h + M src/yvalve/PluginManager.cpp + M src/yvalve/why.cpp + M src/yvalve/why_proto.h +Integrate IAttachment and ITransaction in the external engines API. + + 2011-05-07 19:33 asfernandes + M src/common/classes/SyncObject.h + M src/common/classes/Synchronize.h + M src/common/classes/alloc.cpp + M src/jrd/cch.cpp + M src/jrd/cch.h +Misc. + 2011-05-05 22:05 hvlad M src/jrd/dpm.epp Fixed bug CORE-3468 : Attempt to read after the end of file when nbackup state is stalled Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-07 19:52:44 UTC (rev 52892) +++ firebird/trunk/src/jrd/build_no.h 2011-05-08 03:17:35 UTC (rev 52893) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29336 + FORMAL BUILD NUMBER:29338 */ -#define PRODUCT_VER_STRING "3.0.0.29336" -#define FILE_VER_STRING "WI-T3.0.0.29336" -#define LICENSE_VER_STRING "WI-T3.0.0.29336" -#define FILE_VER_NUMBER 3, 0, 0, 29336 +#define PRODUCT_VER_STRING "3.0.0.29338" +#define FILE_VER_STRING "WI-T3.0.0.29338" +#define LICENSE_VER_STRING "WI-T3.0.0.29338" +#define FILE_VER_NUMBER 3, 0, 0, 29338 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29336" +#define FB_BUILD_NO "29338" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-07 19:52:44 UTC (rev 52892) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-08 03:17:35 UTC (rev 52893) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29336 +BuildNum=29338 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-09 03:17:22
|
Revision: 52895 http://firebird.svn.sourceforge.net/firebird/?rev=52895&view=rev Author: firebirds Date: 2011-05-09 03:17:15 +0000 (Mon, 09 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-08 17:53:37 UTC (rev 52894) +++ firebird/trunk/ChangeLog 2011-05-09 03:17:15 UTC (rev 52895) @@ -1,3 +1,12 @@ + 2011-05-08 17:53 asfernandes + M src/include/FirebirdApi.h + M src/include/FirebirdExternalApi.h + M src/include/FirebirdUdr.h + M src/include/FirebirdUdrCpp.h + M src/include/Interface.h +Remove "#pragma GCC system_header". Current build with GCC 4.5.2 and clang 2.8 shows no related warning. +This pragma was interfering with -MMD dependency output, causing crashes after full build when the API is changed. + 2011-05-07 19:52 asfernandes M builds/posix/firebird.vers M builds/win32/defs/firebird.def Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-08 17:53:37 UTC (rev 52894) +++ firebird/trunk/src/jrd/build_no.h 2011-05-09 03:17:15 UTC (rev 52895) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29338 + FORMAL BUILD NUMBER:29339 */ -#define PRODUCT_VER_STRING "3.0.0.29338" -#define FILE_VER_STRING "WI-T3.0.0.29338" -#define LICENSE_VER_STRING "WI-T3.0.0.29338" -#define FILE_VER_NUMBER 3, 0, 0, 29338 +#define PRODUCT_VER_STRING "3.0.0.29339" +#define FILE_VER_STRING "WI-T3.0.0.29339" +#define LICENSE_VER_STRING "WI-T3.0.0.29339" +#define FILE_VER_NUMBER 3, 0, 0, 29339 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29338" +#define FB_BUILD_NO "29339" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-08 17:53:37 UTC (rev 52894) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-09 03:17:15 UTC (rev 52895) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29338 +BuildNum=29339 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hv...@us...> - 2011-05-09 10:15:29
|
Revision: 52896 http://firebird.svn.sourceforge.net/firebird/?rev=52896&view=rev Author: hvlad Date: 2011-05-09 10:15:19 +0000 (Mon, 09 May 2011) Log Message: ----------- Shared page cache implementation Modified Paths: -------------- firebird/trunk/builds/install/misc/firebird.conf.in firebird/trunk/src/common/classes/SyncObject.h firebird/trunk/src/common/classes/locks.h firebird/trunk/src/common/config/config.cpp firebird/trunk/src/common/config/config.h firebird/trunk/src/common/isc_sync.cpp firebird/trunk/src/dsql/AggNodes.cpp firebird/trunk/src/dsql/dsql.cpp firebird/trunk/src/dsql/dsql.h firebird/trunk/src/jrd/Attachment.cpp firebird/trunk/src/jrd/Attachment.h firebird/trunk/src/jrd/Database.cpp firebird/trunk/src/jrd/Database.h firebird/trunk/src/jrd/DatabaseSnapshot.cpp firebird/trunk/src/jrd/ExtEngineManager.cpp firebird/trunk/src/jrd/ExtEngineManager.h firebird/trunk/src/jrd/Function.epp firebird/trunk/src/jrd/GlobalRWLock.cpp firebird/trunk/src/jrd/GlobalRWLock.h firebird/trunk/src/jrd/JrdStatement.cpp firebird/trunk/src/jrd/Relation.cpp firebird/trunk/src/jrd/Relation.h firebird/trunk/src/jrd/RuntimeStatistics.cpp firebird/trunk/src/jrd/RuntimeStatistics.h firebird/trunk/src/jrd/ValueImpl.cpp firebird/trunk/src/jrd/blb.cpp firebird/trunk/src/jrd/cch.cpp firebird/trunk/src/jrd/cch.h firebird/trunk/src/jrd/cch_proto.h firebird/trunk/src/jrd/cmp.cpp firebird/trunk/src/jrd/dfw.epp firebird/trunk/src/jrd/dpm.epp firebird/trunk/src/jrd/dyn.epp firebird/trunk/src/jrd/exe.cpp firebird/trunk/src/jrd/exe_proto.h firebird/trunk/src/jrd/ext.cpp firebird/trunk/src/jrd/extds/ExtDS.cpp firebird/trunk/src/jrd/fun.epp firebird/trunk/src/jrd/idx.cpp firebird/trunk/src/jrd/inf.cpp firebird/trunk/src/jrd/ini.epp firebird/trunk/src/jrd/intl.cpp firebird/trunk/src/jrd/jrd.cpp firebird/trunk/src/jrd/jrd.h firebird/trunk/src/jrd/jrd_proto.h firebird/trunk/src/jrd/lck.cpp firebird/trunk/src/jrd/lck.h firebird/trunk/src/jrd/met.epp firebird/trunk/src/jrd/nbak.cpp firebird/trunk/src/jrd/nbak.h firebird/trunk/src/jrd/os/pio.h firebird/trunk/src/jrd/os/win32/winnt.cpp firebird/trunk/src/jrd/pag.cpp firebird/trunk/src/jrd/pcmet.epp firebird/trunk/src/jrd/recsrc/SortedStream.cpp firebird/trunk/src/jrd/sdw.cpp firebird/trunk/src/jrd/shut.cpp firebird/trunk/src/jrd/sort.cpp firebird/trunk/src/jrd/sort.h firebird/trunk/src/jrd/tpc.cpp firebird/trunk/src/jrd/tpc_proto.h firebird/trunk/src/jrd/tra.cpp firebird/trunk/src/jrd/tra.h firebird/trunk/src/jrd/trace/TraceDSQLHelpers.h firebird/trunk/src/jrd/trace/TraceJrdHelpers.h firebird/trunk/src/jrd/trace/TraceObjects.cpp firebird/trunk/src/jrd/trace/TraceObjects.h firebird/trunk/src/jrd/validation.cpp firebird/trunk/src/jrd/vio.cpp firebird/trunk/src/lock/lock.cpp firebird/trunk/src/lock/lock_proto.h firebird/trunk/src/remote/server/os/win32/srvr_w32.cpp firebird/trunk/src/remote/server/server.cpp Modified: firebird/trunk/builds/install/misc/firebird.conf.in =================================================================== --- firebird/trunk/builds/install/misc/firebird.conf.in 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/builds/install/misc/firebird.conf.in 2011-05-09 10:15:19 UTC (rev 52896) @@ -660,11 +660,11 @@ # The value is taken from a bit map in which each bit represents a CPU. # Thus, to use only the first processor, the value is 1. To use both # CPU 1 and CPU 2, the value is 3. To use CPU 2 and CPU 3, the value -# is 6. The default value is 1. +# is 6. The default value is 0 - no affinity will be set. # # Type: integer # -#CpuAffinityMask = 1 +#CpuAffinityMask = 0 # ---------------------------- @@ -838,3 +838,16 @@ # 16 16777216 320 335544320 896 939524096 # 32 33554432 384 402653184 1024 1073741824 # + +# Type: boolean +#SharedCache = true + +# Type: boolean +#SharedDatabase = false + + +# SharedCache SharedDatabase Mode +# false false Classic with exlusive access // single attachment only ? +# false true Classic with shared access // traditional CS\SC +# true false Super with exlusive access // traditional SS +# true true Super with shared access // Modified: firebird/trunk/src/common/classes/SyncObject.h =================================================================== --- firebird/trunk/src/common/classes/SyncObject.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/common/classes/SyncObject.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -173,6 +173,11 @@ syncObject = obj; } + SyncType getState() const + { + return state; + } + protected: SyncType state; SyncType request; @@ -199,27 +204,28 @@ } }; -class SyncUnlockGuard : public Sync +class SyncUnlockGuard { public: - SyncUnlockGuard(SyncObject* obj, const char* fromWhere) - : Sync(obj, fromWhere) + SyncUnlockGuard(Sync& _sync) : + sync(_sync) { - oldState = state; + oldState = sync.getState(); fb_assert(oldState != SYNC_NONE); if (oldState != SYNC_NONE) - unlock(); + sync.unlock(); } ~SyncUnlockGuard() { if (oldState != SYNC_NONE) - lock(oldState); + sync.lock(oldState); } private: SyncType oldState; + Sync& sync; }; } // namespace Firebird Modified: firebird/trunk/src/common/classes/locks.h =================================================================== --- firebird/trunk/src/common/classes/locks.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/common/classes/locks.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -378,6 +378,49 @@ Mutex* lock; }; +class MutexUnlockGuard +{ +public: + explicit MutexUnlockGuard(Mutex &aLock) + : lock(&aLock) + { + try { + lock->leave(); + } + catch (const Exception&) + { + DtorException::devHalt(); + } + } + + ~MutexUnlockGuard() + { + lock->enter(); + } + +private: + // Forbid copying + MutexUnlockGuard(const MutexUnlockGuard&); + MutexUnlockGuard& operator=(const MutexUnlockGuard&); + + Mutex* lock; +}; + + +class MutexCheckoutGuard +{ +public: + MutexCheckoutGuard(Mutex& mtxCout, Mutex& mtxLock) : + unlock(mtxCout), + lock(mtxLock) + { + } + +private: + MutexUnlockGuard unlock; + MutexLockGuard lock; +}; + } //namespace Firebird #endif // CLASSES_LOCKS_H Modified: firebird/trunk/src/common/config/config.cpp =================================================================== --- firebird/trunk/src/common/config/config.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/common/config/config.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -115,7 +115,7 @@ {TYPE_INTEGER, "TempCacheLimit", (ConfigValue) -1}, // bytes {TYPE_BOOLEAN, "RemoteFileOpenAbility", (ConfigValue) false}, {TYPE_INTEGER, "GuardianOption", (ConfigValue) 1}, - {TYPE_INTEGER, "CpuAffinityMask", (ConfigValue) 1}, + {TYPE_INTEGER, "CpuAffinityMask", (ConfigValue) 0}, {TYPE_INTEGER, "TcpRemoteBufferSize", (ConfigValue) 8192}, // bytes {TYPE_BOOLEAN, "TcpNoNagle", (ConfigValue) true}, {TYPE_INTEGER, "DefaultDbCachePages", (ConfigValue) -1}, // pages @@ -171,7 +171,9 @@ {TYPE_STRING, "AuthClient", (ConfigValue) "Legacy_Auth, Win_Sspi"}, {TYPE_STRING, "UserManager", (ConfigValue) "Legacy_Auth"}, {TYPE_STRING, "TracePlugin", (ConfigValue) "fbtrace"}, - {TYPE_STRING, "SecurityDatabase", (ConfigValue) "$(root)/security3.fdb"} // security database name + {TYPE_STRING, "SecurityDatabase", (ConfigValue) "$(root)/security3.fdb"}, // security database name + {TYPE_BOOLEAN, "SharedCache", (ConfigValue) true}, + {TYPE_BOOLEAN, "SharedDatabase", (ConfigValue) false} }; /****************************************************************************** @@ -668,20 +670,12 @@ bool Config::getSharedCache() { -#ifdef SUPERSERVER - return true; -#else - return false; -#endif + return (bool) getDefaultConfig()->values[KEY_SHARED_CACHE]; } bool Config::getSharedDatabase() { -#ifdef SUPERSERVER - return false; -#else - return true; -#endif + return (bool) getDefaultConfig()->values[KEY_SHARED_DATABASE]; } bool Config::getMultiClientServer() Modified: firebird/trunk/src/common/config/config.h =================================================================== --- firebird/trunk/src/common/config/config.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/common/config/config.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -135,6 +135,8 @@ KEY_PLUG_AUTH_MANAGE, KEY_PLUG_TRACE, KEY_SECURITY_DATABASE, + KEY_SHARED_CACHE, + KEY_SHARED_DATABASE, MAX_CONFIG_KEY // keep it last }; Modified: firebird/trunk/src/common/isc_sync.cpp =================================================================== --- firebird/trunk/src/common/isc_sync.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/common/isc_sync.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -1334,13 +1334,9 @@ * **************************************/ -#ifdef SUPERSERVER - event->event_id = 0; -#else - static int idCounter = 0; // Should it be AtomicCounter? AP-2008 + static AtomicCounter idCounter; event->event_id = ++idCounter; -#endif event->event_pid = process_id = getpid(); event->event_count = 0; @@ -2745,16 +2741,12 @@ BOOL res = FALSE; if (fnSwitchToThread) { -#if !defined SUPERSERVER const HANDLE hThread = GetCurrentThread(); SetThreadPriority(hThread, THREAD_PRIORITY_ABOVE_NORMAL); -#endif res = (*fnSwitchToThread)(); -#if !defined SUPERSERVER SetThreadPriority(hThread, THREAD_PRIORITY_NORMAL); -#endif } return res; Modified: firebird/trunk/src/dsql/AggNodes.cpp =================================================================== --- firebird/trunk/src/dsql/AggNodes.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/dsql/AggNodes.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -322,7 +322,7 @@ asbImpure->iasb_sort = NULL; asbImpure->iasb_sort = FB_NEW(request->req_sorts.getPool()) Sort( - database, &request->req_sorts, asb->length, + request->req_attachment, &request->req_sorts, asb->length, asb->keyItems.getCount(), 1, asb->keyItems.begin(), RecordSource::rejectDuplicate, 0); } Modified: firebird/trunk/src/dsql/dsql.cpp =================================================================== --- firebird/trunk/src/dsql/dsql.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/dsql/dsql.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -1381,10 +1381,9 @@ if (attachment->att_dsql_instance) return attachment->att_dsql_instance; - MemoryPool& pool = *attachment->att_database->createPool(); + MemoryPool& pool = *attachment->createPool(); dsql_dbb* const database = FB_NEW(pool) dsql_dbb(pool); database->dbb_attachment = attachment; - database->dbb_database = attachment->att_database; attachment->att_dsql_instance = database; INI_init_dsql(tdbb, database); Modified: firebird/trunk/src/dsql/dsql.h =================================================================== --- firebird/trunk/src/dsql/dsql.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/dsql/dsql.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -37,7 +37,7 @@ #include "../common/common.h" #include "../jrd/RuntimeStatistics.h" #include "../jrd/val.h" // Get rid of duplicated FUN_T enum. -#include "../jrd/Database.h" +#include "../jrd/Attachment.h" #include "../dsql/BlrWriter.h" #include "../common/classes/array.h" #include "../common/classes/GenericMap.h" @@ -146,7 +146,6 @@ Firebird::string, class dsql_req*> > > dbb_cursors; // known cursors in database MemoryPool& dbb_pool; // The current pool for the dbb - Database* dbb_database; Attachment* dbb_attachment; dsql_str* dbb_dfl_charset; bool dbb_no_charset; @@ -170,12 +169,12 @@ MemoryPool* createPool() { - return dbb_database->createPool(); + return dbb_attachment->createPool(); } void deletePool(MemoryPool* pool) { - dbb_database->deletePool(pool); + dbb_attachment->deletePool(pool); } }; Modified: firebird/trunk/src/jrd/Attachment.cpp =================================================================== --- firebird/trunk/src/jrd/Attachment.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/Attachment.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -25,6 +25,7 @@ #include "firebird.h" #include "../jrd/Attachment.h" #include "../jrd/Database.h" +#include "../jrd/Function.h" #include "../jrd/nbak.h" #include "../jrd/trace/TraceManager.h" #include "../jrd/PreparedStatement.h" @@ -95,6 +96,29 @@ } +MemoryPool* Jrd::Attachment::createPool() +{ + MemoryPool* const pool = MemoryPool::createPool(att_pool, att_memory_stats); + att_pools.add(pool); + return pool; +} + + +void Jrd::Attachment::deletePool(MemoryPool* pool) +{ + if (pool) + { + size_t pos; + if (att_pools.find(pool, pos)) + { + att_pools.remove(pos); + } + + MemoryPool::deletePool(pool); + } +} + + bool Jrd::Attachment::backupStateWriteLock(thread_db* tdbb, SSHORT wait) { if (att_backup_state_counter++) @@ -157,15 +181,29 @@ att_ext_call_depth(0), att_trace_manager(FB_NEW(*att_pool) TraceManager(this)), att_interface(NULL), - att_public_interface(NULL) + att_public_interface(NULL), + att_functions(*pool), + att_internal(*pool), + att_dyn_req(*pool), + att_charsets(*pool), + att_charset_ids(*pool), + att_pools(*pool) { + att_internal.grow(irq_MAX); + att_dyn_req.grow(drq_MAX); } Jrd::Attachment::~Attachment() { + destroyIntlObjects(); delete att_trace_manager; + while (att_pools.getCount()) + { + deletePool(att_pools.pop()); + } + // For normal attachments that happens in release_attachment(), // but for special ones like GC should be done also in dtor - // they do not (and should not) call release_attachment(). @@ -326,6 +364,12 @@ * block doesn't get dereferenced after it is released * **************************************/ + if (!att_long_locks) + return; + + Sync lckSync(&att_database->dbb_lck_sync, "Attachment::detachLocksFromAttachment"); + lckSync.lock(SYNC_EXCLUSIVE); + Lock* long_lock = att_long_locks; while (long_lock) { @@ -337,3 +381,134 @@ } att_long_locks = NULL; } + +// Find an inactive incarnation of a system request. If necessary, clone it. +jrd_req* Jrd::Attachment::findSystemRequest(thread_db* tdbb, USHORT id, USHORT which) +{ + static const int MAX_RECURSION = 100; + + // If the request hasn't been compiled or isn't active, there're nothing to do. + + //Database::CheckoutLockGuard guard(this, dbb_cmp_clone_mutex); + + fb_assert(which == IRQ_REQUESTS || which == DYN_REQUESTS); + + JrdStatement* statement = (which == IRQ_REQUESTS ? att_internal[id] : att_dyn_req[id]); + + if (!statement) + return NULL; + + // Look for requests until we find one that is available. + + for (int n = 0;; ++n) + { + if (n > MAX_RECURSION) + { + ERR_post(Arg::Gds(isc_no_meta_update) << + Arg::Gds(isc_req_depth_exceeded) << Arg::Num(MAX_RECURSION)); + // Msg363 "request depth exceeded. (Recursive definition?)" + } + + jrd_req* clone = statement->getRequest(tdbb, n); + + if (!(clone->req_flags & (req_active | req_reserved))) + { + clone->req_flags |= req_reserved; + return clone; + } + } +} + +void Jrd::Attachment::shutdown(thread_db* tdbb) +{ + // go through relations and indices and release + // all existence locks that might have been taken + + vec<jrd_rel*>* rvector = att_relations; + if (rvector) + { + vec<jrd_rel*>::iterator ptr, end; + for (ptr = rvector->begin(), end = rvector->end(); ptr < end; ++ptr) + { + jrd_rel* relation = *ptr; + if (relation) + { + if (relation->rel_existence_lock) + { + LCK_release(tdbb, relation->rel_existence_lock); + relation->rel_flags |= REL_check_existence; + relation->rel_use_count = 0; + } + if (relation->rel_partners_lock) + { + LCK_release(tdbb, relation->rel_partners_lock); + relation->rel_flags |= REL_check_partners; + } + if (relation->rel_rescan_lock) + { + LCK_release(tdbb, relation->rel_rescan_lock); + relation->rel_flags &= ~REL_scanned; + } + for (IndexLock* index = relation->rel_index_locks; index; index = index->idl_next) + { + if (index->idl_lock) + { + index->idl_count = 0; + LCK_release(tdbb, index->idl_lock); + } + } + } + } + } + + // release all procedure existence locks that might have been taken + + vec<jrd_prc*>* pvector = att_procedures; + if (pvector) + { + vec<jrd_prc*>::iterator pptr, pend; + for (pptr = pvector->begin(), pend = pvector->end(); pptr < pend; ++pptr) + { + jrd_prc* procedure = *pptr; + if (procedure) + { + if (procedure->prc_existence_lock) + { + LCK_release(tdbb, procedure->prc_existence_lock); + procedure->prc_flags |= PRC_check_existence; + procedure->prc_use_count = 0; + } + } + } + } + + // release all function existence locks that might have been taken + + for (Function** iter = att_functions.begin(); iter < att_functions.end(); ++iter) + { + Function* const function = *iter; + + if (function) + { + function->releaseLocks(tdbb); + } + } + + // release collation existence locks + + releaseIntlObjects(); + + // And release the system requests. + + for (JrdStatement** itr = att_internal.begin(); itr != att_internal.end(); ++itr) + { + if (*itr) + (*itr)->release(tdbb); + } + + for (JrdStatement** itr = att_dyn_req.begin(); itr != att_dyn_req.end(); ++itr) + { + if (*itr) + (*itr)->release(tdbb); + } +} Modified: firebird/trunk/src/jrd/Attachment.h =================================================================== --- firebird/trunk/src/jrd/Attachment.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/Attachment.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -45,6 +45,8 @@ class Connection; } +class CharSetContainer; + namespace Jrd { class thread_db; @@ -71,6 +73,12 @@ class PreparedStatement; class TraceManager; template <typename T> class vec; + class jrd_rel; + class jrd_prc; + class Trigger; + typedef Firebird::ObjectsArray<Trigger> trig_vec; + class Function; + class JrdStatement; struct DSqlCacheItem { @@ -121,6 +129,95 @@ class Attachment : public pool_alloc<type_att> { public: + class SyncGuard + { + public: + SyncGuard(Attachment* att, bool optional = false) : + m_mutex(NULL) + { + if (att && att->att_interface) + m_mutex = att->att_interface->getMutex(); + + fb_assert(optional || m_mutex); + + if (m_mutex) + m_mutex->enter(); + } + + ~SyncGuard() + { + if (m_mutex) + m_mutex->leave(); + } + + private: + // copying is prohibited + SyncGuard(const SyncGuard&); + SyncGuard& operator=(const SyncGuard&); + + Firebird::Mutex* m_mutex; + }; + + class Checkout + { + public: + Checkout(Attachment* att, bool optional = false) : + m_mutex(NULL) + { + if (att && att->att_interface) + { + m_ref = att->att_interface; + m_mutex = att->att_interface->getMutex(); + } + + fb_assert(optional || m_mutex); + + if (m_mutex) + m_mutex->leave(); + } + + ~Checkout() + { + if (m_mutex) + m_mutex->enter(); + } + + private: + // copying is prohibited + Checkout(const Checkout&); + Checkout& operator=(const Checkout&); + + Firebird::Mutex* m_mutex; + Firebird::RefPtr<JAttachment> m_ref; + }; + + class CheckoutLockGuard + { + public: + CheckoutLockGuard(Attachment* att, Firebird::Mutex& mutex, bool optional = false) : + m_mutex(mutex) + { + if (!m_mutex.tryEnter()) + { + Checkout attCout(att, optional); + m_mutex.enter(); + } + } + + ~CheckoutLockGuard() + { + m_mutex.leave(); + } + + private: + // copying is prohibited + CheckoutLockGuard(const CheckoutLockGuard&); + CheckoutLockGuard& operator=(const CheckoutLockGuard&); + + Firebird::Mutex& m_mutex; + }; + +public: static Attachment* create(Database* dbb); static void destroy(Attachment* const attachment); @@ -170,6 +267,7 @@ Firebird::SortedArray<void*> att_udf_pointers; dsql_dbb* att_dsql_instance; bool att_in_use; // attachment in use (can't be detached or dropped) + int att_use_count; // number of API calls running except of asyncronous ones EDS::Connection* att_ext_connection; // external connection executed by this attachment ULONG att_ext_call_depth; // external connection call depth, 0 for user attachment @@ -178,6 +276,35 @@ JAttachment* att_interface; Firebird::IAttachment* att_public_interface; +/// former Database members + vec<jrd_rel*>* att_relations; // relation vector + vec<jrd_prc*>* att_procedures; // scanned procedures + trig_vec* att_triggers[DB_TRIGGER_MAX]; + trig_vec* att_ddl_triggers; + Firebird::Array<Function*> att_functions; // User defined functions + + Firebird::Array<JrdStatement*> att_internal; // internal statements + Firebird::Array<JrdStatement*> att_dyn_req; // internal dyn statements + + jrd_req* findSystemRequest(thread_db* tdbb, USHORT id, USHORT which); + + Firebird::Array<CharSetContainer*> att_charsets; // intl character set descriptions + Firebird::GenericMap<Firebird::Pair<Firebird::Left< + Firebird::MetaName, USHORT> > > att_charset_ids; // Character set ids + + void releaseIntlObjects(); // defined in intl.cpp + void destroyIntlObjects(); // defined in intl.cpp + + // from CMP_shutdown_database and CMP_fini + void shutdown(thread_db* tdbb); + + Firebird::Array<MemoryPool*> att_pools; // pools + + MemoryPool* createPool(); + void deletePool(MemoryPool* pool); + +/// former Database members + bool locksmith() const; jrd_tra* getSysTransaction(); void setSysTransaction(jrd_tra* trans); // used only by TRA_init Modified: firebird/trunk/src/jrd/Database.cpp =================================================================== --- firebird/trunk/src/jrd/Database.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/Database.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -77,12 +77,14 @@ Database::~Database() { - destroyIntlObjects(); - - fb_assert(dbb_pools[0] == dbb_permanent); - for (size_t i = 1; i < dbb_pools.getCount(); ++i) { - MemoryPool::deletePool(dbb_pools[i]); + Firebird::SyncLockGuard guard(&dbb_pools_sync, SYNC_EXCLUSIVE, "Database::~Database"); + + fb_assert(dbb_pools[0] == dbb_permanent); + for (size_t i = 1; i < dbb_pools.getCount(); ++i) + { + MemoryPool::deletePool(dbb_pools[i]); + } } delete dbb_monitoring_data; @@ -90,7 +92,8 @@ dbb_flags |= DBB_destroying; - Checkout dcoHolder(this); +// Checkout dcoHolder(this); + // This line decrements the usage counter and may cause the destructor to be called. // It should happen with the dbb_sync unlocked. LockManager::destroy(dbb_lock_mgr); @@ -101,57 +104,19 @@ { if (pool) { - size_t pos; - if (dbb_pools.find(pool, pos)) { - dbb_pools.remove(pos); + Firebird::SyncLockGuard guard(&dbb_pools_sync, SYNC_EXCLUSIVE, "Database::deletePool"); + size_t pos; + if (dbb_pools.find(pool, pos)) + { + dbb_pools.remove(pos); + } } MemoryPool::deletePool(pool); } } - // Find an inactive incarnation of a system request. If necessary, clone it. - jrd_req* Database::findSystemRequest(thread_db* tdbb, USHORT id, USHORT which) - { - static const int MAX_RECURSION = 100; - - // If the request hasn't been compiled or isn't active, there're nothing to do. - - Database::CheckoutLockGuard guard(this, dbb_cmp_clone_mutex); - - fb_assert(which == IRQ_REQUESTS || which == DYN_REQUESTS); - - JrdStatement* statement = (which == IRQ_REQUESTS ? dbb_internal[id] : dbb_dyn_req[id]); - - if (!statement) - return NULL; - - // Look for requests until we find one that is available. - - for (int n = 0;; ++n) - { - if (n > MAX_RECURSION) - { - ERR_post(Arg::Gds(isc_no_meta_update) << - Arg::Gds(isc_req_depth_exceeded) << Arg::Num(MAX_RECURSION)); - // Msg363 "request depth exceeded. (Recursive definition?)" - } - - jrd_req* clone = statement->getRequest(tdbb, n); - - if (!(clone->req_flags & (req_active | req_reserved))) - { - clone->req_flags |= req_reserved; - clone->setAttachment(tdbb->getAttachment()); - fb_assert(clone->req_attachment); - return clone; - } - } - } - - // Database::SharedCounter implementation - Database::SharedCounter::SharedCounter() { memset(m_counters, 0, sizeof(m_counters)); @@ -180,6 +145,8 @@ ValueCache* const counter = &m_counters[space]; Database* const dbb = tdbb->getDatabase(); + SyncLockGuard guard(&dbb->dbb_sh_counter_sync, SYNC_EXCLUSIVE, "Database::SharedCounter::generate"); + if (!counter->lock) { Lock* const lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) Lock(); @@ -225,11 +192,13 @@ try { - Database::SyncGuard dsGuard(dbb, true); + if (dbb->dbb_flags & DBB_not_in_use) + return 0; + SyncLockGuard guard(&dbb->dbb_sh_counter_sync, SYNC_EXCLUSIVE, "Database::blockingAstSharedCounter"); + ThreadContextHolder tdbb; tdbb->setDatabase(dbb); - // tdbb->setAttachment(counter->lock->lck_attachment); Jrd::ContextPoolHolder context(tdbb, dbb->dbb_permanent); Modified: firebird/trunk/src/jrd/Database.h =================================================================== --- firebird/trunk/src/jrd/Database.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/Database.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -62,25 +62,21 @@ #include "../jrd/event_proto.h" #include "../lock/lock_proto.h" #include "../common/config/config.h" +#include "../common/classes/SyncObject.h" +#include "../common/classes/Synchronize.h" -class CharSetContainer; - namespace Jrd { - class Trigger; - template <typename T> class vec; - class jrd_prc; - class jrd_rel; - class Shadow; - class BlobFilter; - class TxPageCache; - class BackupManager; - class ExternalFileDirectoryList; - class MonitoringData; +template <typename T> class vec; +class jrd_rel; +class Shadow; +class BlobFilter; +class TipCache; +class BackupManager; +class ExternalFileDirectoryList; +class MonitoringData; - typedef Firebird::ObjectsArray<Trigger> trig_vec; - // general purpose vector template <class T, BlockType TYPE = type_vec> class vec_base : protected pool_alloc<TYPE> @@ -238,150 +234,7 @@ class Database : public pool_alloc<type_dbb> { - class Sync : public Firebird::RefCounted - { - public: - Sync() : threadId(0) - {} - - void lock() - { - ThreadPriorityScheduler::enter(); - ++waiters; - syncMutex.enter(); - --waiters; - threadId = getThreadId(); - } - - void unlock() - { - ThreadPriorityScheduler::exit(); - threadId = 0; - syncMutex.leave(); - } - - bool hasContention() const - { - return (waiters.value() > 0); - } - - private: - ~Sync() - { - if (threadId) - { - syncMutex.leave(); - } - } - - // copying is prohibited - Sync(const Sync&); - Sync& operator=(const Sync&); - - Firebird::Mutex syncMutex; - Firebird::AtomicCounter waiters; - FB_THREAD_ID threadId; - }; - public: - - class SyncGuard - { - public: - explicit SyncGuard(Database* dbb, bool ast = false) - : sync(*dbb->dbb_sync) - { - if (!dbb) - { - Firebird::status_exception::raise(Firebird::Arg::Gds(isc_bad_db_handle)); - } - - sync.addRef(); - sync.lock(); - - if (ast && dbb->dbb_flags & DBB_destroying) - { - sync.unlock(); - sync.release(); - Firebird::LongJump::raise(); - } - } - - ~SyncGuard() - { - try - { - sync.unlock(); - } - catch (const Firebird::Exception&) - { - DtorException::devHalt(); - } - sync.release(); - } - - private: - // copying is prohibited - SyncGuard(const SyncGuard&); - SyncGuard& operator=(const SyncGuard&); - - Sync& sync; - }; - - class Checkout - { - public: - explicit Checkout(Database* dbb) - : sync(*dbb->dbb_sync) - { - sync.unlock(); - } - - ~Checkout() - { - sync.lock(); - } - - private: - // copying is prohibited - Checkout(const Checkout&); - Checkout& operator=(const Checkout&); - - Sync& sync; - }; - - class CheckoutLockGuard - { - public: - CheckoutLockGuard(Database* dbb, Firebird::Mutex& m) - : mutex(m) - { - if (!mutex.tryEnter()) - { - Checkout dcoHolder(dbb); - mutex.enter(); - } - } - - ~CheckoutLockGuard() - { - try { - mutex.leave(); - } - catch (const Firebird::Exception&) - { - DtorException::devHalt(); - } - } - - private: - // copying is prohibited - CheckoutLockGuard(const CheckoutLockGuard&); - CheckoutLockGuard& operator=(const CheckoutLockGuard&); - - Firebird::Mutex& mutex; - }; - class SharedCounter { static const ULONG DEFAULT_CACHE_SIZE = 16; @@ -452,44 +305,42 @@ return fb_utils::genUniqueId(); } - mutable Firebird::RefPtr<Sync> dbb_sync; // Database sync primitive + Firebird::SyncObject dbb_sync; + Firebird::SyncObject dbb_lck_sync; // syncronize operations with att_long_locks at different attachments + LockManager* dbb_lock_mgr; EventManager* dbb_event_mgr; Database* dbb_next; // Next database block in system Attachment* dbb_attachments; // Active attachments BufferControl* dbb_bcb; // Buffer control block - vec<jrd_rel*>* dbb_relations; // relation vector - vec<jrd_prc*>* dbb_procedures; // scanned procedures int dbb_monitoring_id; // dbb monitoring identifier Lock* dbb_lock; // granddaddy lock + + Firebird::SyncObject dbb_sh_counter_sync; + + Firebird::SyncObject dbb_shadow_sync; Shadow* dbb_shadow; // shadow control block Lock* dbb_shadow_lock; // lock for synchronizing addition of shadows + Lock* dbb_retaining_lock; // lock for preserving commit retaining snapshot Lock* dbb_monitor_lock; // lock for monitoring purposes PageManager dbb_page_manager; vcl* dbb_t_pages; // pages number for transactions vcl* dbb_gen_id_pages; // known pages for gen_id BlobFilter* dbb_blob_filters; // known blob filters - trig_vec* dbb_triggers[DB_TRIGGER_MAX]; - trig_vec* dbb_ddl_triggers; - MonitoringData* dbb_monitoring_data; // monitoring data + Firebird::SyncObject dbb_mon_sync; // syncronize operations with dbb_monitor_lock + MonitoringData* dbb_monitoring_data; // monitoring data DatabaseModules dbb_modules; // external function/filter modules - ExtEngineManager dbb_extManager; // external engine manager + ExtEngineManager dbb_extManager; // external engine manager - Firebird::Mutex dbb_meta_mutex; // Mutex to protect metadata changes while dbb_sync is unlocked - Firebird::Mutex dbb_cmp_clone_mutex; - Firebird::Mutex dbb_exe_clone_mutex; - Firebird::Mutex dbb_flush_count_mutex; - Firebird::Mutex dbb_dyn_mutex; + Firebird::SyncObject dbb_flush_count_mutex; - //SLONG dbb_sort_size; // Size of sort space per sort, unused for now - - ULONG dbb_ast_flags; // flags modified at AST level - ULONG dbb_flags; + Firebird::AtomicCounter dbb_ast_flags; // flags modified at AST level + Firebird::AtomicCounter dbb_flags; USHORT dbb_ods_version; // major ODS version number USHORT dbb_minor_version; // minor ODS version number USHORT dbb_page_size; // page size @@ -508,30 +359,17 @@ Firebird::string dbb_encrypt_key; // encryption key MemoryPool* dbb_permanent; - MemoryPool* dbb_bufferpool; - Firebird::Array<MemoryPool*> dbb_pools; // pools + Firebird::SyncObject dbb_pools_sync; + Firebird::Array<MemoryPool*> dbb_pools; // pools - Firebird::Array<JrdStatement*> dbb_internal; // internal statements - Firebird::Array<JrdStatement*> dbb_dyn_req; // internal dyn statements - SLONG dbb_oldest_active; // Cached "oldest active" transaction SLONG dbb_oldest_transaction; // Cached "oldest interesting" transaction SLONG dbb_oldest_snapshot; // Cached "oldest snapshot" of all active transactions SLONG dbb_next_transaction; // Next transaction id used by NETWARE SLONG dbb_attachment_id; // Next attachment id for ReadOnly DB's - SLONG dbb_page_incarnation; // Cache page incarnation counter ULONG dbb_page_buffers; // Page buffers from header page - Firebird::Semaphore dbb_writer_sem; // Wake up cache writer - Firebird::Semaphore dbb_writer_init;// Cache writer initialization - Firebird::Semaphore dbb_writer_fini;// Cache writer finalization -#ifdef SUPERSERVER_V2 - // the code in cch.cpp is not tested for semaphore instead event !!! - Firebird::Semaphore dbb_reader_sem; // Wake up cache reader - Firebird::Semaphore dbb_reader_init;// Cache reader initialization - Firebird::Semaphore dbb_reader_fini;// Cache reader finalization -#endif #ifdef GARBAGE_THREAD Firebird::Semaphore dbb_gc_sem; // Event to wake up garbage collector @@ -554,14 +392,10 @@ crypt_routine dbb_encrypt; // External encryption routine crypt_routine dbb_decrypt; // External decryption routine - Firebird::Array<CharSetContainer*> dbb_charsets; // intl character set descriptions - TxPageCache* dbb_tip_cache; // cache of latest known state of all transactions in system + TipCache* dbb_tip_cache; // cache of latest known state of all transactions in system TransactionsVector* dbb_pc_transactions; // active precommitted transactions BackupManager* dbb_backup_manager; // physical backup manager Firebird::TimeStamp dbb_creation_date; // creation date - Firebird::Array<Function*> dbb_functions; // User defined functions - Firebird::GenericMap<Firebird::Pair<Firebird::Left< - Firebird::MetaName, USHORT> > > dbb_charset_ids; // Character set ids ExternalFileDirectoryList* dbb_external_file_directory_list; Firebird::RefPtr<Config> dbb_config; @@ -576,6 +410,8 @@ MemoryPool* createPool() { MemoryPool* const pool = MemoryPool::createPool(dbb_permanent, dbb_memory_stats); + + Firebird::SyncLockGuard guard(&dbb_pools_sync, Firebird::SYNC_EXCLUSIVE, "Database::createPool"); dbb_pools.add(pool); return pool; } @@ -584,8 +420,7 @@ private: explicit Database(MemoryPool* p) - : dbb_sync(FB_NEW(*getDefaultMemoryPool()) Sync), - dbb_page_manager(this, *p), + : dbb_page_manager(this, *p), dbb_modules(*p), dbb_extManager(*p), dbb_filename(*p), @@ -593,31 +428,18 @@ dbb_encrypt_key(*p), dbb_permanent(p), dbb_pools(*p, 4), - dbb_internal(*p), - dbb_dyn_req(*p), dbb_stats(*p), dbb_lock_owner_id(getLockOwnerId()), - dbb_charsets(*p), dbb_creation_date(Firebird::TimeStamp::getCurrentTimeStamp()), - dbb_functions(*p), - dbb_charset_ids(*p), + dbb_tip_cache(NULL), dbb_external_file_directory_list(NULL) { dbb_pools.add(p); - dbb_internal.grow(irq_MAX); - dbb_dyn_req.grow(drq_MAX); } ~Database(); public: - // temporary measure to avoid unstable state of lock file - - // this is anyway called in ~Database(), and in theory should be private - void releaseIntlObjects(); // defined in intl.cpp - void destroyIntlObjects(); // defined in intl.cpp - - jrd_req* findSystemRequest(thread_db* tdbb, USHORT id, USHORT which); - SLONG generateAttachmentId(thread_db* tdbb) { return dbb_shared_counter.generate(tdbb, SharedCounter::ATTACHMENT_ID_SPACE, 1); Modified: firebird/trunk/src/jrd/DatabaseSnapshot.cpp =================================================================== --- firebird/trunk/src/jrd/DatabaseSnapshot.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/DatabaseSnapshot.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -350,32 +350,33 @@ { Lock* const lock = dbb->dbb_monitor_lock; - Database::SyncGuard dsGuard(dbb, true); - ThreadContextHolder tdbb; tdbb->setDatabase(lock->lck_dbb); - tdbb->setAttachment(lock->lck_attachment); - ContextPoolHolder context(tdbb, dbb->dbb_permanent); - if (!(dbb->dbb_ast_flags & DBB_monitor_off)) { - // Write the data to the shared memory - if (!(dbb->dbb_flags & DBB_not_in_use)) + SyncLockGuard monGuard(&dbb->dbb_mon_sync, SYNC_EXCLUSIVE, "DatabaseSnapshot::blockingAst"); + + if (!(dbb->dbb_ast_flags & DBB_monitor_off)) { - try + // Write the data to the shared memory + if (!(dbb->dbb_flags & DBB_not_in_use)) { - dumpData(tdbb); + ContextPoolHolder context(tdbb, dbb->dbb_permanent); + try + { + dumpData(tdbb); + } + catch (const Exception& ex) + { + iscLogException("Cannot dump the monitoring data", ex); + } } - catch (const Exception& ex) - { - iscLogException("Cannot dump the monitoring data", ex); - } + + // Release the lock and mark dbb as requesting a new one + LCK_release(tdbb, lock); + dbb->dbb_ast_flags |= DBB_monitor_off; } - - // Release the lock and mark dbb as requesting a new one - LCK_release(tdbb, lock); - dbb->dbb_ast_flags |= DBB_monitor_off; } } catch (const Exception&) @@ -406,17 +407,21 @@ RecordBuffer* const ctx_var_buffer = allocBuffer(tdbb, pool, rel_mon_ctx_vars); RecordBuffer* const mem_usage_buffer = allocBuffer(tdbb, pool, rel_mon_mem_usage); - // Release our own lock - LCK_release(tdbb, dbb->dbb_monitor_lock); - dbb->dbb_ast_flags &= ~DBB_monitor_off; + { + SyncLockGuard monGuard(&dbb->dbb_mon_sync, SYNC_EXCLUSIVE, "DatabaseSnapshot::DatabaseSnapshot"); - { // scope for the RAII object + // Release our own lock + LCK_release(tdbb, dbb->dbb_monitor_lock); + dbb->dbb_ast_flags &= ~DBB_monitor_off; - // Ensure we'll be dealing with a valid backup state inside the call below - BackupManager::StateReadGuard holder(tdbb); + { // scope for the RAII object - // Dump our own data - dumpData(tdbb); + // Ensure we'll be dealing with a valid backup state inside the call below + BackupManager::StateReadGuard holder(tdbb); + + // Dump our own data + dumpData(tdbb); + } } // Signal other processes to dump their data @@ -770,9 +775,15 @@ putDatabase(dbb, writer, fb_utils::genUniqueId()); // Attachment information + + Attachment* old_attachment = tdbb->getAttachment(); + Attachment::Checkout attCout(old_attachment, true); for (Attachment* attachment = dbb->dbb_attachments; attachment; attachment = attachment->att_next) { + Attachment::SyncGuard attGuard(attachment); + tdbb->setAttachment(attachment); + if (!putAttachment(tdbb, attachment, writer, fb_utils::genUniqueId())) continue; @@ -823,6 +834,8 @@ } } } + + tdbb->setAttachment(old_attachment); } Modified: firebird/trunk/src/jrd/ExtEngineManager.cpp =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -134,7 +134,7 @@ Utf8 charSetName[MAX_SQL_IDENTIFIER_SIZE]; { // scope - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(attachment); obj->getCharSet(RaiseError(), attInfo->context, charSetName, MAX_SQL_IDENTIFIER_LEN); charSetName[MAX_SQL_IDENTIFIER_LEN] = '\0'; @@ -299,7 +299,7 @@ ExtEngineManager::Function::~Function() { - Database::Checkout dcoHolder(database); + // Database::Checkout dcoHolder(database); function->dispose(LogError()); } @@ -358,7 +358,7 @@ } { // scope - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); function->execute(RaiseError(), attInfo->context, ¶ms, &result); } } @@ -397,7 +397,7 @@ ExtEngineManager::Procedure::~Procedure() { - Database::Checkout dcoHolder(database); + //Database::Checkout dcoHolder(database); procedure->dispose(LogError()); } @@ -415,7 +415,7 @@ ExtEngineManager::ResultSet::ResultSet(thread_db* tdbb, ValuesImpl* inputParams, ValuesImpl* outputParams, const ExtEngineManager::Procedure* aProcedure) : procedure(aProcedure), - database(tdbb->getDatabase()), + attachment(tdbb->getAttachment()), firstFetch(true) { attInfo = procedure->extManager->getEngineAttachment(tdbb, procedure->engine); @@ -423,11 +423,10 @@ (procedure->prc->getName().package.isEmpty() ? CallerName(obj_procedure, procedure->prc->getName().identifier) : CallerName(obj_package_header, procedure->prc->getName().package))); - Attachment* attachment = tdbb->getAttachment(); charSet = attachment->att_charset; - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(attachment); resultSet = procedure->procedure->open(RaiseError(), attInfo->context, inputParams, outputParams); @@ -438,7 +437,8 @@ { if (resultSet) { - Database::Checkout dcoHolder(database); + fb_assert(attachment == JRD_get_thread_data()->getAttachment()); + Attachment::Checkout attCout(attachment); resultSet->dispose(LogError()); } } @@ -457,7 +457,8 @@ CallerName(obj_procedure, procedure->prc->getName().identifier) : CallerName(obj_package_header, procedure->prc->getName().package))); - Database::Checkout dcoHolder(tdbb->getDatabase()); + fb_assert(attachment == tdbb->getAttachment()); + Attachment::Checkout attCout(attachment); return resultSet->fetch(RaiseError()); } @@ -479,6 +480,7 @@ ExtEngineManager::Trigger::~Trigger() { + // hvlad: shouldn't we call trigger->dispose() here ? } @@ -504,7 +506,7 @@ valueNewCount = setValues(tdbb, pool, newValues, descs, newRpb); { // scope - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); trigger->execute(RaiseError(), attInfo->context, action, oldValues, newValues); @@ -605,7 +607,7 @@ } -void ExtEngineManager::closeAttachment(thread_db* tdbb, Attachment* /*attachment*/) +void ExtEngineManager::closeAttachment(thread_db* tdbb, Attachment* attachment) { Array<ExternalEngine*> enginesCopy; @@ -617,7 +619,7 @@ enginesCopy.add(accessor.current()->second); } - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(attachment, true); for (Array<ExternalEngine*>::iterator i = enginesCopy.begin(); i != enginesCopy.end(); ++i) { @@ -652,7 +654,7 @@ ExternalFunction* externalFunction; { // scope - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); externalFunction = attInfo->engine->makeFunction(RaiseError(), attInfo->context, udf->getName().package.nullStr(), udf->getName().identifier.c_str(), @@ -672,7 +674,7 @@ } catch (...) { - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); externalFunction->dispose(LogError()); throw; } @@ -694,7 +696,7 @@ ExternalProcedure* externalProcedure; { // scope - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); externalProcedure = attInfo->engine->makeProcedure(RaiseError(), attInfo->context, prc->getName().package.nullStr(), prc->getName().identifier.c_str(), @@ -714,7 +716,7 @@ } catch (...) { - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); externalProcedure->dispose(LogError()); throw; } @@ -738,7 +740,7 @@ ExternalTrigger* externalTrigger; { // scope - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); externalTrigger = attInfo->engine->makeTrigger(RaiseError(), attInfo->context, trg->name.c_str(), entryPointTrimmed.nullStr(), body.nullStr(), @@ -757,7 +759,7 @@ } catch (...) { - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); externalTrigger->dispose(LogError()); throw; } @@ -786,7 +788,7 @@ try { - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); engine = engineControl.plugin(); if (engine) @@ -799,7 +801,7 @@ Arg::Num(version) << name); } - Database::SyncGuard dsGuard(tdbb->getDatabase()); + Attachment::SyncGuard attGuard(tdbb->getAttachment()); key = EngineAttachment(engine, tdbb->getAttachment()); attInfo = FB_NEW(getPool()) EngineAttachmentInfo(); @@ -874,7 +876,7 @@ enginesAttachments.put(key, attInfo); ContextManager<ExternalFunction> ctxManager(tdbb, attInfo, attInfo->adminCharSet); - Database::Checkout dcoHolder(tdbb->getDatabase()); + Attachment::Checkout attCout(tdbb->getAttachment()); engine->openAttachment(LogError(), attInfo->context); } Modified: firebird/trunk/src/jrd/ExtEngineManager.h =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -179,7 +179,7 @@ private: const Procedure* procedure; - Database* database; + Attachment* attachment; bool firstFetch; EngineAttachmentInfo* attInfo; Firebird::ExternalResultSet* resultSet; Modified: firebird/trunk/src/jrd/Function.epp =================================================================== --- firebird/trunk/src/jrd/Function.epp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/Function.epp 2011-05-09 10:15:19 UTC (rev 52896) @@ -65,7 +65,7 @@ Database* const dbb = tdbb->getDatabase(); Function* check_function = NULL; - Function* function = (id < dbb->dbb_functions.getCount()) ? dbb->dbb_functions[id] : NULL; + Function* function = (id < attachment->att_functions.getCount()) ? attachment->att_functions[id] : NULL; if (function && function->getId() == id && !(function->fun_flags & FUN_being_scanned) && @@ -117,7 +117,7 @@ // See if we already know the function by name - for (Function** iter = dbb->dbb_functions.begin(); iter < dbb->dbb_functions.end(); ++iter) + for (Function** iter = attachment->att_functions.begin(); iter < attachment->att_functions.end(); ++iter) { Function* const function = *iter; @@ -174,15 +174,13 @@ jrd_tra* sysTransaction = attachment->getSysTransaction(); Database* const dbb = tdbb->getDatabase(); - if (id >= dbb->dbb_functions.getCount()) + if (id >= attachment->att_functions.getCount()) { - dbb->dbb_functions.grow(id + 1); + attachment->att_functions.grow(id + 1); } - Database::CheckoutLockGuard guard(dbb, dbb->dbb_meta_mutex); + Function* function = attachment->att_functions[id]; - Function* function = dbb->dbb_functions[id]; - if (function && !(function->fun_flags & FUN_obsolete)) { // Make sure FUN_being_scanned and FUN_scanned are not set at the same time @@ -196,7 +194,7 @@ if (!function) { - function = FB_NEW(*dbb->dbb_permanent) Function(*dbb->dbb_permanent); + function = FB_NEW(*attachment->att_pool) Function(*attachment->att_pool); } try @@ -205,11 +203,11 @@ function->fun_flags &= ~FUN_obsolete; function->setId(id); - dbb->dbb_functions[id] = function; + attachment->att_functions[id] = function; if (!function->fun_existence_lock) { - Lock* const lock = FB_NEW_RPT(*dbb->dbb_permanent, 0) Lock; + Lock* const lock = FB_NEW_RPT(*attachment->att_pool, 0) Lock; function->fun_existence_lock = lock; lock->lck_parent = dbb->dbb_lock; lock->lck_dbb = dbb; @@ -328,7 +326,7 @@ { function->fun_defaults++; - MemoryPool* const csb_pool = dbb->createPool(); + MemoryPool* const csb_pool = attachment->createPool(); Jrd::ContextPoolHolder context(tdbb, csb_pool); try @@ -338,7 +336,7 @@ } catch (const Exception&) { - dbb->deletePool(csb_pool); + attachment->deletePool(csb_pool); throw; // an explicit error message would be better } } @@ -403,7 +401,7 @@ } else if (!X.RDB$FUNCTION_BLR.NULL) { - MemoryPool* const csb_pool = dbb->createPool(); + MemoryPool* const csb_pool = attachment->createPool(); Jrd::ContextPoolHolder context(tdbb, csb_pool); try @@ -427,7 +425,7 @@ } catch (const Exception&) { - dbb->deletePool(csb_pool); + attachment->deletePool(csb_pool); throw; } @@ -513,8 +511,9 @@ try { Database* const dbb = function->fun_existence_lock->lck_dbb; + Jrd::Attachment* att = function->fun_existence_lock->lck_attachment; - Database::SyncGuard dsGuard(dbb, true); + Jrd::Attachment::SyncGuard guard(att); ThreadContextHolder tdbb; tdbb->setDatabase(dbb); @@ -624,8 +623,8 @@ { fun_use_count--; - Database* const dbb = tdbb->getDatabase(); - if (fun_use_count == 0 && dbb->dbb_functions[getId()] != this) + Jrd::Attachment* attachment = tdbb->getAttachment(); + if (fun_use_count == 0 && attachment->att_functions[getId()] != this) { if (getStatement()) { Modified: firebird/trunk/src/jrd/GlobalRWLock.cpp =================================================================== --- firebird/trunk/src/jrd/GlobalRWLock.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/GlobalRWLock.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -35,6 +35,7 @@ #include "jrd.h" #include "lck_proto.h" #include "err_proto.h" +#include "Attachment.h" #include "../common/classes/rwlock.h" #include "../common/classes/condition.h" @@ -43,6 +44,7 @@ IMPLEMENT_TRACE_ROUTINE(cos_trace, "COS") #endif + namespace Jrd { int GlobalRWLock::blocking_ast_cached_lock(void* ast_object) @@ -56,8 +58,6 @@ return 0; Database* dbb = globalRWLock->cachedLock->lck_dbb; - Database::SyncGuard dsGuard(dbb, true); - ThreadContextHolder tdbb; tdbb->setDatabase(dbb); @@ -101,7 +101,7 @@ { thread_db* tdbb = JRD_get_thread_data(); - Database::CheckoutLockGuard counterGuard(tdbb->getDatabase(), counterMutex); + Attachment::CheckoutLockGuard counterGuard(tdbb->getAttachment(), counterMutex, true); COS_TRACE(("(%p)->shutdownLock readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)", this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical)); @@ -119,19 +119,18 @@ { SET_TDBB(tdbb); - Database* dbb = tdbb->getDatabase(); + Attachment* att = tdbb->getAttachment(); { // scope 1 + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); - COS_TRACE(("(%p)->lockWrite stage 1 readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)", this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical)); ++pendingWriters; while (readers > 0 ) { - Database::Checkout checkoutDbb(dbb); + Attachment::Checkout attCout(att, true); noReaders.wait(counterMutex); } @@ -140,7 +139,7 @@ while (currentWriter || pendingLock) { - Database::Checkout checkoutDbb(dbb); + Attachment::Checkout attCout(att, true); writerFinished.wait(counterMutex); } @@ -164,7 +163,7 @@ if (!LCK_lock(tdbb, cachedLock, LCK_write, wait)) { - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); --pendingLock; if (--pendingWriters) { @@ -175,9 +174,8 @@ } { // scope 2 + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); - --pendingLock; --pendingWriters; @@ -196,10 +194,9 @@ { SET_TDBB(tdbb); - Database* dbb = tdbb->getDatabase(); + Attachment* att = tdbb->getAttachment(); + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); - COS_TRACE(("(%p)->unlockWrite readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)", this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical)); @@ -225,12 +222,12 @@ { SET_TDBB(tdbb); - Database* dbb = tdbb->getDatabase(); + Attachment* att = tdbb->getAttachment(); bool needFetch; { // scope 1 - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); COS_TRACE(("(%p)->lockRead stage 1 readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)", this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical)); @@ -246,7 +243,7 @@ while (pendingWriters > 0 || currentWriter) { - Database::Checkout checkoutDbb(dbb); + Attachment::Checkout attCout(att, true); writerFinished.wait(counterMutex); } @@ -256,9 +253,9 @@ if (!pendingLock) break; - counterMutex.leave(); - Database::Checkout checkoutDbb(dbb); - counterMutex.enter(); + Firebird::MutexUnlockGuard cout(counterMutex); + Attachment::Checkout attCout(att, true); + THD_yield(); } needFetch = cachedLock->lck_physical < LCK_read; @@ -275,14 +272,13 @@ if (!LCK_lock(tdbb, cachedLock, LCK_read, wait)) { - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); --pendingLock; return false; } { // scope 2 - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); - + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); --pendingLock; ++readers; @@ -297,10 +293,9 @@ { SET_TDBB(tdbb); - Database* dbb = tdbb->getDatabase(); + Attachment* att = tdbb->getAttachment(); + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); - Database::CheckoutLockGuard counterGuard(dbb, counterMutex); - COS_TRACE(("(%p)->unlockRead readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)", this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical)); readers--; @@ -321,7 +316,8 @@ bool GlobalRWLock::tryReleaseLock(thread_db* tdbb) { - Database::CheckoutLockGuard counterGuard(tdbb->getDatabase(), counterMutex); + Attachment* att = tdbb->getAttachment(); + Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); COS_TRACE(("(%p)->tryReleaseLock readers(%d), blocking(%d), pendingWriters(%d), currentWriter(%d), lck_physical(%d)", this, readers, blocking, pendingWriters, currentWriter, cachedLock->lck_physical)); Modified: firebird/trunk/src/jrd/GlobalRWLock.h =================================================================== --- firebird/trunk/src/jrd/GlobalRWLock.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/GlobalRWLock.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -87,8 +87,9 @@ virtual void blockingAstHandler(thread_db* tdbb); + Firebird::Mutex counterMutex; // Protects counter and blocking flag + private: - Firebird::Mutex counterMutex; // Protects counter and blocking flag ULONG pendingLock; ULONG readers; Modified: firebird/trunk/src/jrd/JrdStatement.cpp =================================================================== --- firebird/trunk/src/jrd/JrdStatement.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/JrdStatement.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -288,8 +288,6 @@ if (!this) BUGCHECK(167); /* msg 167 invalid SEND request */ - Database::CheckoutLockGuard guard(dbb, dbb->dbb_exe_clone_mutex); - // Search clones for one request in use by this attachment. // If not found, return first inactive request. @@ -539,7 +537,8 @@ sqlText = NULL; - dbb->deletePool(pool); + Jrd::Attachment* const att = tdbb->getAttachment(); + att->deletePool(pool); } // Check that we have enough rights to access all resources this list of triggers touches. Modified: firebird/trunk/src/jrd/Relation.cpp =================================================================== --- firebird/trunk/src/jrd/Relation.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/Relation.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -137,10 +137,8 @@ else inst_id = PAG_attachment_id(tdbb); - if (!rel_pages_inst) - { - MemoryPool& pool = *dbb->dbb_permanent; - rel_pages_inst = FB_NEW(pool) RelationPagesInstances(pool); + if (!rel_pages_inst) { + rel_pages_inst = FB_NEW(*rel_pool) RelationPagesInstances(*rel_pool); } size_t pos; @@ -155,7 +153,7 @@ const size_t BULK_ALLOC = 8; RelationPages* allocatedPages = newPages = - FB_NEW(*dbb->dbb_permanent) RelationPages[BULK_ALLOC]; + FB_NEW(*rel_pool) RelationPages[BULK_ALLOC]; rel_pages_free = ++allocatedPages; for (size_t i = 1; i < BULK_ALLOC - 1; i++, allocatedPages++) Modified: firebird/trunk/src/jrd/Relation.h =================================================================== --- firebird/trunk/src/jrd/Relation.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/Relation.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -25,6 +25,7 @@ #include "../jrd/jrd.h" #include "../jrd/pag.h" #include "../jrd/val.h" +#include "../jrd/Attachment.h" namespace Jrd { @@ -179,6 +180,7 @@ class jrd_rel : public pool_alloc<type_rel> { public: + MemoryPool* rel_pool; USHORT rel_id; USHORT rel_current_fmt; // Current format number ULONG rel_flags; @@ -278,7 +280,7 @@ public: explicit jrd_rel(MemoryPool& p) - : rel_name(p), rel_owner_name(p), rel_view_contexts(p), rel_security_name(p) + : rel_pool(&p), rel_name(p), rel_owner_name(p), rel_view_contexts(p), rel_security_name(p) { } bool hasTriggers() const; Modified: firebird/trunk/src/jrd/RuntimeStatistics.cpp =================================================================== --- firebird/trunk/src/jrd/RuntimeStatistics.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/RuntimeStatistics.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -226,7 +226,7 @@ } } -PerformanceInfo* RuntimeStatistics::computeDifference(Database* dbb, +PerformanceInfo* RuntimeStatistics::computeDifference(Attachment* att, const RuntimeStatistics& new_stat, PerformanceInfo& dest, TraceCountsArray& temp) @@ -262,8 +262,8 @@ // Point TraceCounts to counts array from baseline object if (!all_zeros) { - jrd_rel* relation = size_t(new_cnts->rlc_relation_id) < dbb->dbb_relations->count() ? - (*dbb->dbb_relations)[new_cnts->rlc_relation_id] : NULL; + jrd_rel* relation = size_t(new_cnts->rlc_relation_id) < att->att_relations->count() ? + (*att->att_relations)[new_cnts->rlc_relation_id] : NULL; TraceCounts traceCounts; traceCounts.trc_relation_id = new_cnts->rlc_relation_id; traceCounts.trc_counters = base_cnts->rlc_counter; @@ -276,8 +276,8 @@ } else { - jrd_rel* relation = size_t(new_cnts->rlc_relation_id) < dbb->dbb_relations->count() ? - (*dbb->dbb_relations)[new_cnts->rlc_relation_id] : NULL; + jrd_rel* relation = size_t(new_cnts->rlc_relation_id) < att->att_relations->count() ? + (*att->att_relations)[new_cnts->rlc_relation_id] : NULL; // Point TraceCounts to counts array from object with updated counters TraceCounts traceCounts; Modified: firebird/trunk/src/jrd/RuntimeStatistics.h =================================================================== --- firebird/trunk/src/jrd/RuntimeStatistics.h 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/RuntimeStatistics.h 2011-05-09 10:15:19 UTC (rev 52896) @@ -35,6 +35,7 @@ // #define REL_COUNTS_TREE // #define REL_COUNTS_PTR +class Attachment; class Database; // Performance counters for individual table @@ -135,7 +136,7 @@ // Calculate difference between counts stored in this object and current // counts of given request. Counts stored in object are destroyed. - PerformanceInfo* computeDifference(Database* dbb, const RuntimeStatistics& new_stat, + PerformanceInfo* computeDifference(Attachment* att, const RuntimeStatistics& new_stat, PerformanceInfo& dest, TraceCountsArray& temp); // bool operator==(const RuntimeStatistics& other) const; Modified: firebird/trunk/src/jrd/ValueImpl.cpp =================================================================== --- firebird/trunk/src/jrd/ValueImpl.cpp 2011-05-09 03:17:15 UTC (rev 52895) +++ firebird/trunk/src/jrd/ValueImpl.cpp 2011-05-09 10:15:19 UTC (rev 52896) @@ -45,7 +45,7 @@ void ValueMover::getClientCharSetName(Firebird::MetaName& name) const { thread_db* tdbb = getThreadData(); - Database::SyncGuard dsGuard(tdbb->getDatabase()); + Attachment::SyncGuard attGuard(tdbb->getAttachment()); CharSet* cs = INTL_charset_lookup(tdbb, tdbb->getAttachment()->att_charset); name = cs->getName()... [truncated message content] |
From: <asf...@us...> - 2011-05-10 01:12:21
|
Revision: 52897 http://firebird.svn.sourceforge.net/firebird/?rev=52897&view=rev Author: asfernandes Date: 2011-05-10 01:12:14 +0000 (Tue, 10 May 2011) Log Message: ----------- Misc. Modified Paths: -------------- firebird/trunk/builds/install/misc/firebird.conf.in firebird/trunk/src/common/classes/SyncObject.h firebird/trunk/src/common/classes/locks.h firebird/trunk/src/common/isc_sync.cpp firebird/trunk/src/jrd/Attachment.cpp firebird/trunk/src/jrd/Attachment.h firebird/trunk/src/jrd/Database.cpp firebird/trunk/src/jrd/Database.h firebird/trunk/src/jrd/DatabaseSnapshot.cpp firebird/trunk/src/jrd/ExtEngineManager.cpp firebird/trunk/src/jrd/Function.epp firebird/trunk/src/jrd/GlobalRWLock.cpp firebird/trunk/src/jrd/Relation.cpp firebird/trunk/src/jrd/cch.cpp firebird/trunk/src/jrd/cch.h firebird/trunk/src/jrd/dyn.epp firebird/trunk/src/jrd/exe.cpp firebird/trunk/src/jrd/extds/ExtDS.cpp firebird/trunk/src/jrd/ibase.h firebird/trunk/src/jrd/inf.cpp firebird/trunk/src/jrd/intl.cpp firebird/trunk/src/jrd/jrd.cpp firebird/trunk/src/jrd/jrd.h firebird/trunk/src/jrd/lck.cpp firebird/trunk/src/jrd/os/win32/winnt.cpp firebird/trunk/src/jrd/tpc.cpp firebird/trunk/src/jrd/tpc_proto.h Modified: firebird/trunk/builds/install/misc/firebird.conf.in =================================================================== --- firebird/trunk/builds/install/misc/firebird.conf.in 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/builds/install/misc/firebird.conf.in 2011-05-10 01:12:14 UTC (rev 52897) @@ -848,6 +848,6 @@ # SharedCache SharedDatabase Mode # false false Classic with exlusive access // single attachment only ? -# false true Classic with shared access // traditional CS\SC +# false true Classic with shared access // traditional CS/SC # true false Super with exlusive access // traditional SS # true true Super with shared access // Modified: firebird/trunk/src/common/classes/SyncObject.h =================================================================== --- firebird/trunk/src/common/classes/SyncObject.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/common/classes/SyncObject.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -204,11 +204,11 @@ } }; -class SyncUnlockGuard +class SyncUnlockGuard { public: - SyncUnlockGuard(Sync& _sync) : - sync(_sync) + SyncUnlockGuard(Sync& aSync) : + sync(aSync) { oldState = sync.getState(); @@ -225,7 +225,7 @@ private: SyncType oldState; - Sync& sync; + Sync& sync; }; } // namespace Firebird Modified: firebird/trunk/src/common/classes/locks.h =================================================================== --- firebird/trunk/src/common/classes/locks.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/common/classes/locks.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -361,7 +361,8 @@ ~MutexLockGuard() { - try { + try + { lock->leave(); } catch (const Exception&) @@ -384,7 +385,8 @@ explicit MutexUnlockGuard(Mutex &aLock) : lock(&aLock) { - try { + try + { lock->leave(); } catch (const Exception&) Modified: firebird/trunk/src/common/isc_sync.cpp =================================================================== --- firebird/trunk/src/common/isc_sync.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/common/isc_sync.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -2732,13 +2732,14 @@ if (!bInit) { HMODULE hLib = GetModuleHandle("kernel32.dll"); - if (hLib) { + if (hLib) fnSwitchToThread = (pfnSwitchToThread) GetProcAddress(hLib, "SwitchToThread"); - } + bInit = true; } BOOL res = FALSE; + if (fnSwitchToThread) { const HANDLE hThread = GetCurrentThread(); Modified: firebird/trunk/src/jrd/Attachment.cpp =================================================================== --- firebird/trunk/src/jrd/Attachment.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/Attachment.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -110,9 +110,7 @@ { size_t pos; if (att_pools.find(pool, pos)) - { att_pools.remove(pos); - } MemoryPool::deletePool(pool); } @@ -199,10 +197,8 @@ destroyIntlObjects(); delete att_trace_manager; - while (att_pools.getCount()) - { + while (att_pools.hasData()) deletePool(att_pools.pop()); - } // For normal attachments that happens in release_attachment(), // but for special ones like GC should be done also in dtor - @@ -421,16 +417,19 @@ void Jrd::Attachment::shutdown(thread_db* tdbb) { - // go through relations and indices and release - // all existence locks that might have been taken + // Go through relations and indices and release + // all existence locks that might have been taken. vec<jrd_rel*>* rvector = att_relations; + if (rvector) { vec<jrd_rel*>::iterator ptr, end; + for (ptr = rvector->begin(), end = rvector->end(); ptr < end; ++ptr) { jrd_rel* relation = *ptr; + if (relation) { if (relation->rel_existence_lock) @@ -439,16 +438,19 @@ relation->rel_flags |= REL_check_existence; relation->rel_use_count = 0; } + if (relation->rel_partners_lock) { LCK_release(tdbb, relation->rel_partners_lock); relation->rel_flags |= REL_check_partners; } + if (relation->rel_rescan_lock) { LCK_release(tdbb, relation->rel_rescan_lock); relation->rel_flags &= ~REL_scanned; } + for (IndexLock* index = relation->rel_index_locks; index; index = index->idl_next) { if (index->idl_lock) @@ -461,15 +463,18 @@ } } - // release all procedure existence locks that might have been taken + // Release all procedure existence locks that might have been taken. vec<jrd_prc*>* pvector = att_procedures; + if (pvector) { vec<jrd_prc*>::iterator pptr, pend; + for (pptr = pvector->begin(), pend = pvector->end(); pptr < pend; ++pptr) { jrd_prc* procedure = *pptr; + if (procedure) { if (procedure->prc_existence_lock) @@ -482,20 +487,17 @@ } } - // release all function existence locks that might have been taken + // Release all function existence locks that might have been taken. for (Function** iter = att_functions.begin(); iter < att_functions.end(); ++iter) { Function* const function = *iter; if (function) - { function->releaseLocks(tdbb); - } } - // release collation existence locks - + // Release collation existence locks. releaseIntlObjects(); // And release the system requests. Modified: firebird/trunk/src/jrd/Attachment.h =================================================================== --- firebird/trunk/src/jrd/Attachment.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/Attachment.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -132,8 +132,8 @@ class SyncGuard { public: - SyncGuard(Attachment* att, bool optional = false) : - m_mutex(NULL) + SyncGuard(Attachment* att, bool optional = false) + : m_mutex(NULL) { if (att && att->att_interface) m_mutex = att->att_interface->getMutex(); @@ -161,8 +161,8 @@ class Checkout { public: - Checkout(Attachment* att, bool optional = false) : - m_mutex(NULL) + Checkout(Attachment* att, bool optional = false) + : m_mutex(NULL) { if (att && att->att_interface) { @@ -194,8 +194,8 @@ class CheckoutLockGuard { public: - CheckoutLockGuard(Attachment* att, Firebird::Mutex& mutex, bool optional = false) : - m_mutex(mutex) + CheckoutLockGuard(Attachment* att, Firebird::Mutex& mutex, bool optional = false) + : m_mutex(mutex) { if (!m_mutex.tryEnter()) { @@ -267,7 +267,7 @@ Firebird::SortedArray<void*> att_udf_pointers; dsql_dbb* att_dsql_instance; bool att_in_use; // attachment in use (can't be detached or dropped) - int att_use_count; // number of API calls running except of asyncronous ones + int att_use_count; // number of API calls running except of asyncronous ones EDS::Connection* att_ext_connection; // external connection executed by this attachment ULONG att_ext_call_depth; // external connection call depth, 0 for user attachment @@ -276,7 +276,8 @@ JAttachment* att_interface; Firebird::IAttachment* att_public_interface; -/// former Database members + /// former Database members - start + vec<jrd_rel*>* att_relations; // relation vector vec<jrd_prc*>* att_procedures; // scanned procedures trig_vec* att_triggers[DB_TRIGGER_MAX]; @@ -294,7 +295,7 @@ void releaseIntlObjects(); // defined in intl.cpp void destroyIntlObjects(); // defined in intl.cpp - + // from CMP_shutdown_database and CMP_fini void shutdown(thread_db* tdbb); @@ -303,7 +304,7 @@ MemoryPool* createPool(); void deletePool(MemoryPool* pool); -/// former Database members + /// former Database members - end bool locksmith() const; jrd_tra* getSysTransaction(); Modified: firebird/trunk/src/jrd/Database.cpp =================================================================== --- firebird/trunk/src/jrd/Database.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/Database.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -57,14 +57,14 @@ #endif } - Firebird::string Database::getUniqueFileId() const + string Database::getUniqueFileId() const { const PageSpace* const pageSpace = dbb_page_manager.findPageSpace(DB_PAGE_SPACE); - Firebird::UCharBuffer buffer; + UCharBuffer buffer; PIO_get_unique_file_id(pageSpace->file, buffer); - Firebird::string file_id; + string file_id; char* s = file_id.getBuffer(2 * buffer.getCount()); for (size_t i = 0; i < buffer.getCount(); i++) { @@ -78,13 +78,12 @@ Database::~Database() { { - Firebird::SyncLockGuard guard(&dbb_pools_sync, SYNC_EXCLUSIVE, "Database::~Database"); - + SyncLockGuard guard(&dbb_pools_sync, SYNC_EXCLUSIVE, "Database::~Database"); + fb_assert(dbb_pools[0] == dbb_permanent); + for (size_t i = 1; i < dbb_pools.getCount(); ++i) - { MemoryPool::deletePool(dbb_pools[i]); - } } delete dbb_monitoring_data; @@ -92,7 +91,7 @@ dbb_flags |= DBB_destroying; -// Checkout dcoHolder(this); + //Checkout dcoHolder(this); // This line decrements the usage counter and may cause the destructor to be called. // It should happen with the dbb_sync unlocked. @@ -105,12 +104,11 @@ if (pool) { { - Firebird::SyncLockGuard guard(&dbb_pools_sync, SYNC_EXCLUSIVE, "Database::deletePool"); + SyncLockGuard guard(&dbb_pools_sync, SYNC_EXCLUSIVE, "Database::deletePool"); size_t pos; + if (dbb_pools.find(pool, pos)) - { dbb_pools.remove(pos); - } } MemoryPool::deletePool(pool); @@ -204,7 +202,7 @@ LCK_downgrade(tdbb, counter->lock); } - catch (const Firebird::Exception&) + catch (const Exception&) {} // no-op return 0; Modified: firebird/trunk/src/jrd/Database.h =================================================================== --- firebird/trunk/src/jrd/Database.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/Database.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -317,9 +317,9 @@ BufferControl* dbb_bcb; // Buffer control block int dbb_monitoring_id; // dbb monitoring identifier Lock* dbb_lock; // granddaddy lock - + Firebird::SyncObject dbb_sh_counter_sync; - + Firebird::SyncObject dbb_shadow_sync; Shadow* dbb_shadow; // shadow control block Lock* dbb_shadow_lock; // lock for synchronizing addition of shadows Modified: firebird/trunk/src/jrd/DatabaseSnapshot.cpp =================================================================== --- firebird/trunk/src/jrd/DatabaseSnapshot.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/DatabaseSnapshot.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -363,6 +363,7 @@ if (!(dbb->dbb_flags & DBB_not_in_use)) { ContextPoolHolder context(tdbb, dbb->dbb_permanent); + try { dumpData(tdbb); @@ -410,13 +411,13 @@ { SyncLockGuard monGuard(&dbb->dbb_mon_sync, SYNC_EXCLUSIVE, "DatabaseSnapshot::DatabaseSnapshot"); - // Release our own lock + // Release our own lock. LCK_release(tdbb, dbb->dbb_monitor_lock); dbb->dbb_ast_flags &= ~DBB_monitor_off; { // scope for the RAII object - // Ensure we'll be dealing with a valid backup state inside the call below + // Ensure we'll be dealing with a valid backup state inside the call below. BackupManager::StateReadGuard holder(tdbb); // Dump our own data @@ -775,7 +776,7 @@ putDatabase(dbb, writer, fb_utils::genUniqueId()); // Attachment information - + Attachment* old_attachment = tdbb->getAttachment(); Attachment::Checkout attCout(old_attachment, true); Modified: firebird/trunk/src/jrd/ExtEngineManager.cpp =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -299,7 +299,7 @@ ExtEngineManager::Function::~Function() { - // Database::Checkout dcoHolder(database); + //Database::Checkout dcoHolder(database); function->dispose(LogError()); } Modified: firebird/trunk/src/jrd/Function.epp =================================================================== --- firebird/trunk/src/jrd/Function.epp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/Function.epp 2011-05-10 01:12:14 UTC (rev 52897) @@ -175,9 +175,7 @@ Database* const dbb = tdbb->getDatabase(); if (id >= attachment->att_functions.getCount()) - { attachment->att_functions.grow(id + 1); - } Function* function = attachment->att_functions[id]; @@ -193,9 +191,7 @@ } if (!function) - { function = FB_NEW(*attachment->att_pool) Function(*attachment->att_pool); - } try { Modified: firebird/trunk/src/jrd/GlobalRWLock.cpp =================================================================== --- firebird/trunk/src/jrd/GlobalRWLock.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/GlobalRWLock.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -164,12 +164,15 @@ if (!LCK_lock(tdbb, cachedLock, LCK_write, wait)) { Attachment::CheckoutLockGuard counterGuard(att, counterMutex, true); + --pendingLock; + if (--pendingWriters) { if (!currentWriter) writerFinished.notifyAll(); } + return false; } Modified: firebird/trunk/src/jrd/Relation.cpp =================================================================== --- firebird/trunk/src/jrd/Relation.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/Relation.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -137,9 +137,8 @@ else inst_id = PAG_attachment_id(tdbb); - if (!rel_pages_inst) { + if (!rel_pages_inst) rel_pages_inst = FB_NEW(*rel_pool) RelationPagesInstances(*rel_pool); - } size_t pos; if (!rel_pages_inst->find(inst_id, pos)) Modified: firebird/trunk/src/jrd/cch.cpp =================================================================== --- firebird/trunk/src/jrd/cch.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/cch.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -109,7 +109,7 @@ #define PAGE_OVERHEAD (sizeof(bcb_repeat) + sizeof(BufferDesc) + sizeof(Lock) + (int) bcb->bcb_page_size) -enum LatchState +enum LatchState { lsOk, lsTimeout, @@ -402,7 +402,7 @@ if (!exLock) { dsGuard.lock(SYNC_SHARED); } - + Jrd::Attachment* attachment = tdbb->getAttachment(); if (attachment->att_flags & ATT_exclusive) { return true; @@ -772,7 +772,7 @@ BufferDesc* bdb = get_buffer(tdbb, window->win_page, ((lock_type >= LCK_write) ? SYNC_EXCLUSIVE : SYNC_SHARED), wait); - if (wait != 1 && bdb == 0) + if (wait != 1 && bdb == 0) { attachment->backupStateReadUnLock(tdbb); return lsLatchTimeout; // latch timeout @@ -1351,7 +1351,7 @@ Sync bcbSync(&bcb->bcb_syncObject, "CCH_get_related"); bcbSync.lock(SYNC_SHARED); - + BufferDesc* bdb = find_buffer(bcb, page, false); bcbSync.unlock(); @@ -1406,7 +1406,7 @@ BufferDesc *bdb = window->win_bdb; // unmark - if ((bdb->bdb_writers == 1) && (bdb->bdb_flags & BDB_marked)) + if ((bdb->bdb_writers == 1) && (bdb->bdb_flags & BDB_marked)) { bdb->bdb_flags &= ~BDB_marked; bdb->unLockIO(tdbb); @@ -1428,8 +1428,8 @@ volatile PageNumber pg = window->win_page; - // This prevents a deadlock with the precedence queue, as shown by - // mwrite mwrite1 2 mwrite2 2 test.fdb + // This prevents a deadlock with the precedence queue, as shown by + // mwrite mwrite1 2 mwrite2 2 test.fdb const int wait2 = bdb->ourExclusiveLock() ? LCK_NO_WAIT : wait; LockState must_read = CCH_fetch_lock(tdbb, window, lock, wait2, page_type); @@ -2005,7 +2005,7 @@ tdbb->getAttachment()->backupStateReadUnLock(tdbb); // if (bdb->bdb_writers == 1 || bdb->bdb_use_count == 1) - if (bdb->bdb_writers == 1 || + if (bdb->bdb_writers == 1 || bdb->bdb_writers == 0 && (bdb->bdb_flags & BDB_must_write)) { const bool marked = bdb->bdb_flags & BDB_marked; @@ -2063,7 +2063,7 @@ { bdb->bdb_flags &= ~BDB_garbage_collect; } - + // hvlad: we want to make it least recently used, not most recently used //recentlyUsed(bdb); #ifdef CACHE_WRITER @@ -2235,7 +2235,7 @@ if (bdb->bdb_flags & BDB_marked) { BUGCHECK(268); // msg 268 buffer marked during cache unwind } - + tdbb->getAttachment()->backupStateReadUnLock(tdbb); if (bdb->ourExclusiveLock()) { @@ -2271,7 +2271,7 @@ // hvlad : as far as I understand thread can't hold more than two shared latches // on the same bdb, so findSharedLatch below will not be called many times - + SharedLatch* latch = findSharedLatch(tdbb, bdb); while (latch) { @@ -2280,7 +2280,7 @@ release_bdb(tdbb, bdb, true, false, false); latch = findSharedLatch(tdbb, bdb); } - + #ifndef SUPERSERVER const pag* const page = bdb->bdb_buffer; if (page->pag_type == pag_header || page->pag_type == pag_transactions) @@ -2359,7 +2359,7 @@ page = (pag*) spare_buffer.getBuffer(dbb->dbb_page_size); memcpy(page, bdb->bdb_buffer, HDR_SIZE); old_buffer = bdb->bdb_buffer; - + // hvlad: is it mt-safe ? bdb->bdb_buffer = page; } @@ -2555,7 +2555,7 @@ { BufferControl *bcb = bdb->bdb_bcb; fb_assert(!(bcb->bcb_flags & BCB_exclusive)); - + Database* dbb = bcb->bcb_database; fb_assert(dbb); @@ -2574,7 +2574,7 @@ const bool keep_pages = (bcb->bcb_flags & BCB_keep_pages) != 0; bcb->bcb_flags |= BCB_keep_pages; - down_grade(tdbb, bdb); + down_grade(tdbb, bdb); if (!keep_pages) { bcb->bcb_flags &= ~BCB_keep_pages; @@ -2665,9 +2665,9 @@ continue; } - if ((transaction_mask & bdb->bdb_transactions) || + if ((transaction_mask & bdb->bdb_transactions) || (bdb->bdb_flags & BDB_system_dirty) || - (!transaction_mask && !sys_only) || + (!transaction_mask && !sys_only) || (!bdb->bdb_transactions)) { flush.add(bdb); @@ -2799,7 +2799,7 @@ } bdb->release(tdbb); - if (release_flag) + if (release_flag) { PAGE_LOCK_RELEASE(tdbb, bcb, bdb->bdb_lock); } @@ -3059,7 +3059,7 @@ dpb.reset(isc_dpb_version1); dpb.insertString(isc_dpb_trusted_auth, "Cache Writer"); - if (jrd8_attach_database(status_vector, NULL, dbb->dbb_filename.c_str(), &attachment, + if (jrd8_attach_database(status_vector, NULL, dbb->dbb_filename.c_str(), &attachment, dpb.getBufferLength(), dpb.getBuffer())) { gds__log_status(dbb->dbb_filename.c_str(), status_vector); @@ -3245,7 +3245,7 @@ // Start by finding the buffer containing the high priority page Sync bcbSync(&bcb->bcb_syncObject, "check_precedence"); - bcbSync.lock(SYNC_SHARED); + bcbSync.lock(SYNC_SHARED); BufferDesc* high = find_buffer(bcb, page, false); bcbSync.unlock(); @@ -3271,7 +3271,7 @@ // forget about about establishing the relationship. Sync precSync(&bcb->bcb_syncPrecedence, "check_precedence"); - precSync.lock(SYNC_EXCLUSIVE); + precSync.lock(SYNC_EXCLUSIVE); if (QUE_NOT_EMPTY(high->bdb_lower)) { @@ -3283,7 +3283,7 @@ if (relationship == PRE_UNKNOWN) { - precSync.unlock(); + precSync.unlock(); const PageNumber high_page = high->bdb_page; if (!write_buffer(tdbb, high, high_page, false, tdbb->tdbb_status_vector, true)) { CCH_unwind(tdbb, true); @@ -3372,7 +3372,7 @@ BufferDesc* low_bdb = precedence->pre_low; QUE_DELETE(precedence->pre_higher); QUE_DELETE(precedence->pre_lower); - + precedence->pre_hi = (BufferDesc*) bcb->bcb_free; bcb->bcb_free = precedence; if (!(precedence->pre_flags & PRE_cleared)) @@ -3492,7 +3492,7 @@ syncPrec.unlock(); down_grade(tdbb, blocking_bdb); - if (blocking_bdb->bdb_flags & BDB_dirty && !(precedence->pre_flags & PRE_cleared)) + if (blocking_bdb->bdb_flags & BDB_dirty && !(precedence->pre_flags & PRE_cleared)) { in_use = true; } @@ -3502,7 +3502,7 @@ in_use = false; que_inst = bdb->bdb_higher.que_forward; } - + break; } } @@ -3650,7 +3650,7 @@ for (bcb_repeat* old_tail = old_rpt; old_tail < old_end; old_tail++, new_tail++) { new_tail->bcb_bdb = old_tail->bcb_bdb; - while (QUE_NOT_EMPTY(old_tail->bcb_page_mod)) + while (QUE_NOT_EMPTY(old_tail->bcb_page_mod)) { QUE que_inst = old_tail->bcb_page_mod.que_forward; BufferDesc* bdb = BLOCK(que_inst, BufferDesc*, bdb_que); @@ -3697,7 +3697,7 @@ for (; que_inst != mod_que; que_inst = que_inst->que_forward) { BufferDesc* bdb = BLOCK(que_inst, BufferDesc*, bdb_que); - if (bdb->bdb_page == page) + if (bdb->bdb_page == page) return bdb; } @@ -3716,7 +3716,7 @@ } -static LatchState latch_buffer(thread_db* tdbb, Sync &bcbSync, BufferDesc *bdb, +static LatchState latch_buffer(thread_db* tdbb, Sync &bcbSync, BufferDesc *bdb, const PageNumber page, SyncType syncType, int wait) { //++bdb->bdb_use_count; @@ -3730,16 +3730,16 @@ recentlyUsed(bdb); } - // If buffer is currently replacing by another page but still writting - // to disk we should wait until this write finished, else we could - // allocate another buffer and read old page image (or even zero's) + // If buffer is currently replacing by another page but still writting + // to disk we should wait until this write finished, else we could + // allocate another buffer and read old page image (or even zero's) // from disk into new buffer const bool waitPending = (bdb->bdb_flags & BDB_free_pending && bdb->bdb_page == page); bcbSync.unlock(); - if (waitPending) + if (waitPending) { //--bdb->bdb_use_count; if (wait <= 0) { @@ -3751,7 +3751,7 @@ else { bool latchOk = true; - if (wait <= 0) + if (wait <= 0) latchOk = bdb->addRefConditional(tdbb, syncType); else bdb->addRef(tdbb, syncType); @@ -3814,7 +3814,7 @@ { bcbSync.lock(SYNC_SHARED); BufferDesc *bdb = find_buffer(bcb, page, true); - while (bdb) + while (bdb) { const LatchState ret = latch_buffer(tdbb, bcbSync, bdb, page, syncType, wait); if (ret == lsOk) { @@ -3840,7 +3840,7 @@ { // Check to see if buffer has already been assigned to page BufferDesc *bdb = find_buffer(bcb, page, true); - while (bdb) + while (bdb) { const LatchState ret = latch_buffer(tdbb, bcbSync, bdb, page, syncType, wait); if (ret == lsOk) { @@ -3896,7 +3896,7 @@ que_inst = bcb->bcb_empty.que_forward; QUE_DELETE(*que_inst); BufferDesc* bdb = BLOCK(que_inst, BufferDesc*, bdb_que); - + bcb->bcb_inuse++; bdb->addRef(tdbb, SYNC_EXCLUSIVE); @@ -3993,7 +3993,7 @@ continue; } #endif - + #ifdef CACHE_WRITER if (oldest->bdb_flags & (BDB_dirty | BDB_db_dirty)) { @@ -4024,7 +4024,7 @@ QUE_DELETE(bdb->bdb_que); QUE_INSERT(bcb->bcb_pending, bdb->bdb_que); - + lruSync.unlock(); bcbSync.unlock(); @@ -4050,7 +4050,7 @@ // screwed up, the only precedence blocks that can still be hanging // around are ones cleared at AST level. - if (QUE_NOT_EMPTY(bdb->bdb_higher) || QUE_NOT_EMPTY(bdb->bdb_lower)) + if (QUE_NOT_EMPTY(bdb->bdb_higher) || QUE_NOT_EMPTY(bdb->bdb_lower)) { Sync precSync(&bcb->bcb_syncPrecedence, "get_buffer"); precSync.lock(SYNC_EXCLUSIVE); @@ -4074,7 +4074,7 @@ bcbSync.lock(SYNC_EXCLUSIVE); QUE_DELETE(bdb->bdb_que); // bcb_pending - + QUE mod_que = &bcb->bcb_rpt[page.getPageNum() % bcb->bcb_count].bcb_page_mod; QUE_INSERT((*mod_que), bdb->bdb_que); bdb->bdb_flags &= ~BDB_free_pending; @@ -4092,7 +4092,7 @@ bdb->bdb_flags &= BDB_lru_chained; // yes, clear all except BDB_lru_chained bdb->bdb_flags |= BDB_read_pending; bdb->bdb_scan_count = 0; - + bcbSync.unlock(); if (page != FREE_PAGE) @@ -4242,7 +4242,7 @@ const USHORT lock_type = (bdb->bdb_flags & (BDB_dirty | BDB_writer)) ? LCK_write : LCK_read; - CCH_TRACE(("FE LOCK %d:%06d, %s", bdb->bdb_page.getPageSpaceID(), bdb->bdb_page.getPageNum(), + CCH_TRACE(("FE LOCK %d:%06d, %s", bdb->bdb_page.getPageSpaceID(), bdb->bdb_page.getPageNum(), (lock_type >= LCK_write) ? "EX" : "SH" )); Lock* const lock = bdb->bdb_lock; @@ -4361,7 +4361,7 @@ ERR_log(JRD_BUGCHK, 215, errmsg); // msg 215 page %ld, page type %ld lock conversion denied CCH_unwind(tdbb, true); - + return lsError; // Added to get rid of Compiler Warning } @@ -4923,7 +4923,7 @@ BufferDesc* hi_bdb = precedence->pre_hi; const PageNumber hi_page = hi_bdb->bdb_page; - + int write_status = 0; syncPrec.unlock(); @@ -4967,7 +4967,7 @@ { result = write_page(tdbb, bdb, status, false); } - + bdb->unLockIO(tdbb); if (result) { clear_precedence(tdbb, bdb); @@ -5006,7 +5006,7 @@ // hvlad: why it is needed in Vulcan ??? //Sync syncWrite(&bcb->bcb_syncPageWrite, "write_page"); //syncWrite.lock(SYNC_EXCLUSIVE); - + if (bdb->bdb_flags & BDB_not_valid) { ERR_build_status(status, Arg::Gds(isc_buf_invalid) << Arg::Num(bdb->bdb_page.getPageNum())); @@ -5389,6 +5389,6 @@ if (--bdb_io_locks == 0) { bdb_io = NULL; } - + bdb_syncIO.unlock(NULL, SYNC_EXCLUSIVE); } Modified: firebird/trunk/src/jrd/cch.h =================================================================== --- firebird/trunk/src/jrd/cch.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/cch.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -82,10 +82,10 @@ class BufferControl : public pool_alloc<type_bcb> { - explicit BufferControl(MemoryPool& p) : + explicit BufferControl(MemoryPool& p) : bcb_bufferpool(&p), - bcb_memory(p) - { + bcb_memory(p) + { bcb_database = NULL; QUE_INIT(bcb_in_use); QUE_INIT(bcb_pending); @@ -123,10 +123,10 @@ que bcb_pending; // Que of buffers which are going to be freed and reassigned que bcb_empty; // Que of empty buffers - // Recently used buffer put there without locking common LRU que (bcb_in_use). + // Recently used buffer put there without locking common LRU que (bcb_in_use). // When bcb_syncLRU is locked this chain is merged into bcb_in_use. See also // requeueRecentlyUsed() and recentlyUsed() - Firebird::AtomicPointer<BufferDesc> bcb_lru_chain; + Firebird::AtomicPointer<BufferDesc> bcb_lru_chain; que bcb_dirty; // que of dirty buffers SLONG bcb_dirty_count; // count of pages in dirty page btree @@ -179,8 +179,8 @@ class BufferDesc : public pool_alloc<type_bdb> { public: - BufferDesc(BufferControl* bcb) : - bdb_bcb(bcb), + BufferDesc(BufferControl* bcb) : + bdb_bcb(bcb), bdb_page(0, 0), bdb_pending_page(0, 0) { Modified: firebird/trunk/src/jrd/dyn.epp =================================================================== --- firebird/trunk/src/jrd/dyn.epp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/dyn.epp 2011-05-10 01:12:14 UTC (rev 52897) @@ -123,9 +123,8 @@ const UCHAR* ptr = ddl; - if (*ptr++ != isc_dyn_version_1) { + if (*ptr++ != isc_dyn_version_1) ERR_post(Arg::Gds(isc_wrodynver)); - } fb_utils::init_status(tdbb->tdbb_status_vector); @@ -136,7 +135,8 @@ MemoryPool* const tempPool = attachment->createPool(); Jrd::ContextPoolHolder context(tdbb, tempPool); - try { + try + { VIO_start_save_point(tdbb, transaction); transaction->tra_save_point->sav_verb_count++; Modified: firebird/trunk/src/jrd/exe.cpp =================================================================== --- firebird/trunk/src/jrd/exe.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/exe.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -492,7 +492,7 @@ **************************************/ Jrd::Attachment* attachment = tdbb->getAttachment(); - // do nothing if user doesn't want database triggers + // Do nothing if user doesn't want database triggers. if (attachment->att_flags & ATT_no_db_triggers) return; Modified: firebird/trunk/src/jrd/extds/ExtDS.cpp =================================================================== --- firebird/trunk/src/jrd/extds/ExtDS.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/extds/ExtDS.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -1615,16 +1615,17 @@ if (m_tdbb) { Jrd::Attachment* attachment = m_tdbb->getAttachment(); - if (attachment) + + if (attachment) { attachment->att_interface->getMutex()->enter(); attachment->att_ext_connection = m_saveConnection; } jrd_tra* transaction = m_tdbb->getTransaction(); - if (transaction) { + + if (transaction) transaction->tra_callback_count--; - } } } Modified: firebird/trunk/src/jrd/ibase.h =================================================================== --- firebird/trunk/src/jrd/ibase.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/ibase.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -1154,9 +1154,9 @@ ISC_STATUS ISC_EXPORT fb_ping(ISC_STATUS*, isc_db_handle*); -/***********************/ +/********************/ /* Object interface */ -/***********************/ +/********************/ ISC_STATUS ISC_EXPORT fb_get_database_handle(ISC_STATUS*, isc_db_handle*, void*); ISC_STATUS ISC_EXPORT fb_get_transaction_handle(ISC_STATUS*, isc_tr_handle*, void*); Modified: firebird/trunk/src/jrd/inf.cpp =================================================================== --- firebird/trunk/src/jrd/inf.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/inf.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -589,12 +589,14 @@ { SyncLockGuard sync(&dbb->dbb_sync, SYNC_SHARED, "INF_database_info"); + for (const Jrd::Attachment* att = dbb->dbb_attachments; att; att = att->att_next) { if (att->att_flags & ATT_shutdown) continue; const UserId* user = att->att_user; + if (user) { const char* user_name = user->usr_user_name.hasData() ? @@ -603,6 +605,7 @@ const SSHORT len = strlen(user_name); *p++ = len; memcpy(p, user_name, len); + if (!(info = INF_put_item(item, len + 1, buffer, info, end))) { if (transaction) @@ -610,6 +613,7 @@ sync.unlock(); TRA_commit(tdbb, transaction, false); } + return; } } Modified: firebird/trunk/src/jrd/intl.cpp =================================================================== --- firebird/trunk/src/jrd/intl.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/intl.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -352,6 +352,7 @@ Jrd::Attachment::CheckoutLockGuard guard(att, createCollationMtx); // are we need it ? Collation* to_delete = NULL; + if (id < charset_collations.getCount() && charset_collations[id] != NULL) { if (charset_collations[id]->obsolete) @@ -364,9 +365,8 @@ delete charset_collations[id]; } else - { to_delete = charset_collations[id]; - } + charset_collations[id] = NULL; } else @@ -509,9 +509,7 @@ for (size_t i = 0; i < att_charsets.getCount(); i++) { if (att_charsets[i]) - { att_charsets[i]->release(); - } } } Modified: firebird/trunk/src/jrd/jrd.cpp =================================================================== --- firebird/trunk/src/jrd/jrd.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/jrd.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -435,7 +435,7 @@ { public: AttachmentHolder(thread_db* tdbb, JAttachment* ja, bool lockAsync) - : mutex(ja->getMutex(lockAsync)), + : mutex(ja->getMutex(lockAsync)), attachment(ja->getHandle()), async(lockAsync) { @@ -880,7 +880,7 @@ if (!lockedAtt && dbb->dbb_attachments != att) { break; } - } + } att = lockedAtt ? lockedAtt->att_next : dbb->dbb_attachments; } } @@ -4927,9 +4927,9 @@ Database* dbb = tdbb->getDatabase(); Jrd::Attachment* attachment = tdbb->getAttachment(); - // hvlad: i think the check below is unnecessary as attachment pointer is + // hvlad: i think the check below is unnecessary as attachment pointer is // already validated at AttachmentHolder. If i'm wrong and check is must be - // then it should be moved into AttachmentHolder or even into + // then it should be moved into AttachmentHolder or even into // DatabaseContexHolder to not lock dbb_sync with attachment mutex locked. // //{ Modified: firebird/trunk/src/jrd/jrd.h =================================================================== --- firebird/trunk/src/jrd/jrd.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/jrd.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -429,7 +429,7 @@ ~thread_db() { #ifdef DEV_BUILD - for (size_t n = 0; n < tdbb_bdbs.getCount(); n++) + for (size_t n = 0; n < tdbb_bdbs.getCount(); ++n) { fb_assert(tdbb_bdbs[n] == NULL); } @@ -548,12 +548,14 @@ tdbb_bdbs.shrink(pos + 1); break; } + if (pos == 0) { tdbb_bdbs.shrink(0); break; } - pos--; + + --pos; } } } Modified: firebird/trunk/src/jrd/lck.cpp =================================================================== --- firebird/trunk/src/jrd/lck.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/lck.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -75,23 +75,26 @@ #ifdef DEBUG_LCK -class LckSync +namespace { -public: - LckSync(Lock* lock, const char* sWhere) : - m_sync(&lock->lck_sync, sWhere) + class LckSync { - ThreadSync *thd = ThreadSync::getThread(NULL); - m_sync.lock(SYNC_EXCLUSIVE); - } + public: + LckSync(Lock* lock, const char* sWhere) + : m_sync(&lock->lck_sync, sWhere) + { + /***ThreadSync* thd =***/ ThreadSync::getThread(NULL); + m_sync.lock(SYNC_EXCLUSIVE); + } - ~LckSync() - { - } + ~LckSync() + { + } -private: - Sync m_sync; -}; + private: + Sync m_sync; + }; +} #endif // globals and macros @@ -236,9 +239,9 @@ class WaitCancelGuard { public: - WaitCancelGuard(thread_db* tdbb, Lock* lock, int wait) : - m_tdbb(tdbb), - m_save_lock(NULL) + WaitCancelGuard(thread_db* tdbb, Lock* lock, int wait) + : m_tdbb(tdbb), + m_save_lock(NULL) { Jrd::Attachment* att = m_tdbb->getAttachment(); m_save_lock = att ? att->att_wait_lock : NULL; @@ -254,7 +257,7 @@ fb_assert(att); m_tdbb->tdbb_flags &= ~TDBB_wait_cancel_disable; - if (att) + if (att) { att->att_wait_lock = lock; } @@ -1497,7 +1500,7 @@ if (lock->lck_attachment == attachment) return; - Database* dbb = attachment ? attachment->att_database : + Database* dbb = attachment ? attachment->att_database : (lock->lck_attachment ? lock->lck_attachment->att_database : NULL); fb_assert(dbb); Modified: firebird/trunk/src/jrd/os/win32/winnt.cpp =================================================================== --- firebird/trunk/src/jrd/os/win32/winnt.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/os/win32/winnt.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -299,7 +299,7 @@ if (!main_file->fil_ext_lock) return; -// Database::Checkout dcoHolder(dbb); + //Database::Checkout dcoHolder(dbb); FileExtendLockGuard extLock(main_file->fil_ext_lock, true); ULONG leftPages = extPages; @@ -343,11 +343,10 @@ * Flush the operating system cache back to good, solid oxide. * **************************************/ -// Database::Checkout dcoHolder(dbb); + //Database::Checkout dcoHolder(dbb); + for (jrd_file* file = main_file; file; file = file->fil_next) - { FlushFileBuffers(file->fil_desc); - } } @@ -495,7 +494,7 @@ const char* const zero_buff = zeros().getBuffer(); const size_t zero_buff_size = zeros().getSize(); -// Database::Checkout dcoHolder(dbb); + //Database::Checkout dcoHolder(dbb); FileExtendLockGuard extLock(main_file->fil_ext_lock, false); // Fake buffer, used in seek_file. Page space ID doesn't matter there @@ -626,7 +625,7 @@ const DWORD size = bcb->bcb_page_size; Database* const dbb = bcb->bcb_database; -// Database::Checkout dcoHolder(dbb); + //Database::Checkout dcoHolder(dbb); FileExtendLockGuard extLock(file->fil_ext_lock, false); OVERLAPPED overlapped, *overlapped_ptr; @@ -697,7 +696,7 @@ **************************************/ OVERLAPPED overlapped, *overlapped_ptr; -// Database::Checkout dcoHolder(dbb); + //Database::Checkout dcoHolder(dbb); // If an I/O status block was passed the caller wants to queue an asynchronous I/O. @@ -785,7 +784,7 @@ * Check the status of an asynchronous I/O. * **************************************/ -// Database::Checkout dcoHolder(dbb); + //Database::Checkout dcoHolder(dbb); if (!(piob->piob_flags & PIOB_success)) { @@ -829,7 +828,7 @@ const DWORD size = bcb->bcb_page_size; Database* const dbb = bcb->bcb_database; -// Database::Checkout dcoHolder(dbb); + //Database::Checkout dcoHolder(dbb); FileExtendLockGuard extLock(file->fil_ext_lock, false); file = seek_file(file, bdb, status_vector, &overlapped, &overlapped_ptr); @@ -1043,7 +1042,7 @@ static jrd_file* setup_file(Database* dbb, const Firebird::PathName& file_name, HANDLE desc, - bool read_only, + bool read_only, bool shareMode) { /************************************** Modified: firebird/trunk/src/jrd/tpc.cpp =================================================================== --- firebird/trunk/src/jrd/tpc.cpp 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/tpc.cpp 2011-05-10 01:12:14 UTC (rev 52897) @@ -71,7 +71,7 @@ SyncLockGuard sync(&m_sync, SYNC_SHARED, "TipCache::CacheState"); - if (!m_cache.getCount()) + if (!m_cache.getCount()) { SyncUnlockGuard unlock(sync); InitializeTpc(tdbb, number); @@ -217,7 +217,7 @@ SyncLockGuard sync(&m_sync, SYNC_SHARED, "TipCache::SnapshotState"); - if (!m_cache.getCount()) + if (!m_cache.getCount()) { sync.unlock(); cacheTransactions(tdbb, 0); @@ -286,7 +286,7 @@ return TRA_fetch_state(tdbb, number); } // if the transaction has been started since we last looked, extend the cache upward - + sync.unlock(); return extendCache(tdbb, number); } @@ -410,9 +410,9 @@ oldest = MAX(oldest, hdr_oldest); - // now get the inventory of all transactions, which will automatically + // now get the inventory of all transactions, which will automatically // fill in the tip cache pages - // hvlad: note, call below will call UpdateCache() which will acquire m_sync + // hvlad: note, call below will call UpdateCache() which will acquire m_sync // in exclusive mode. This is the reason why m_sync must be unlocked at the // entry of this routine @@ -515,4 +515,4 @@ return tra_active; } -} // namespace Jrd +} // namespace Jrd Modified: firebird/trunk/src/jrd/tpc_proto.h =================================================================== --- firebird/trunk/src/jrd/tpc_proto.h 2011-05-09 10:15:19 UTC (rev 52896) +++ firebird/trunk/src/jrd/tpc_proto.h 2011-05-10 01:12:14 UTC (rev 52897) @@ -52,10 +52,10 @@ class TxPage : public pool_alloc_rpt<SCHAR, type_tpc> { public: - SLONG tpc_base; // id of first transaction in this block - UCHAR tpc_transactions[1]; // two bits per transaction + SLONG tpc_base; // id of first transaction in this block + UCHAR tpc_transactions[1]; // two bits per transaction - static const SLONG generate(const void*, const TxPage* item) + static const SLONG generate(const void*, const TxPage* item) { return item->tpc_base; } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-10 03:17:45
|
Revision: 52898 http://firebird.svn.sourceforge.net/firebird/?rev=52898&view=rev Author: firebirds Date: 2011-05-10 03:17:39 +0000 (Tue, 10 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-10 01:12:14 UTC (rev 52897) +++ firebird/trunk/ChangeLog 2011-05-10 03:17:39 UTC (rev 52898) @@ -1,3 +1,109 @@ + 2011-05-10 01:12 asfernandes + M builds/install/misc/firebird.conf.in + M src/common/classes/SyncObject.h + M src/common/classes/locks.h + M src/common/isc_sync.cpp + M src/jrd/Attachment.cpp + M src/jrd/Attachment.h + M src/jrd/Database.cpp + M src/jrd/Database.h + M src/jrd/DatabaseSnapshot.cpp + M src/jrd/ExtEngineManager.cpp + M src/jrd/Function.epp + M src/jrd/GlobalRWLock.cpp + M src/jrd/Relation.cpp + M src/jrd/cch.cpp + M src/jrd/cch.h + M src/jrd/dyn.epp + M src/jrd/exe.cpp + M src/jrd/extds/ExtDS.cpp + M src/jrd/ibase.h + M src/jrd/inf.cpp + M src/jrd/intl.cpp + M src/jrd/jrd.cpp + M src/jrd/jrd.h + M src/jrd/lck.cpp + M src/jrd/os/win32/winnt.cpp + M src/jrd/tpc.cpp + M src/jrd/tpc_proto.h +Misc. + + 2011-05-09 10:15 hvlad + M builds/install/misc/firebird.conf.in + M src/common/classes/SyncObject.h + M src/common/classes/locks.h + M src/common/config/config.cpp + M src/common/config/config.h + M src/common/isc_sync.cpp + M src/dsql/AggNodes.cpp + M src/dsql/dsql.cpp + M src/dsql/dsql.h + M src/jrd/Attachment.cpp + M src/jrd/Attachment.h + M src/jrd/Database.cpp + M src/jrd/Database.h + M src/jrd/DatabaseSnapshot.cpp + M src/jrd/ExtEngineManager.cpp + M src/jrd/ExtEngineManager.h + M src/jrd/Function.epp + M src/jrd/GlobalRWLock.cpp + M src/jrd/GlobalRWLock.h + M src/jrd/JrdStatement.cpp + M src/jrd/Relation.cpp + M src/jrd/Relation.h + M src/jrd/RuntimeStatistics.cpp + M src/jrd/RuntimeStatistics.h + M src/jrd/ValueImpl.cpp + M src/jrd/blb.cpp + M src/jrd/cch.cpp + M src/jrd/cch.h + M src/jrd/cch_proto.h + M src/jrd/cmp.cpp + M src/jrd/dfw.epp + M src/jrd/dpm.epp + M src/jrd/dyn.epp + M src/jrd/exe.cpp + M src/jrd/exe_proto.h + M src/jrd/ext.cpp + M src/jrd/extds/ExtDS.cpp + M src/jrd/fun.epp + M src/jrd/idx.cpp + M src/jrd/inf.cpp + M src/jrd/ini.epp + M src/jrd/intl.cpp + M src/jrd/jrd.cpp + M src/jrd/jrd.h + M src/jrd/jrd_proto.h + M src/jrd/lck.cpp + M src/jrd/lck.h + M src/jrd/met.epp + M src/jrd/nbak.cpp + M src/jrd/nbak.h + M src/jrd/os/pio.h + M src/jrd/os/win32/winnt.cpp + M src/jrd/pag.cpp + M src/jrd/pcmet.epp + M src/jrd/recsrc/SortedStream.cpp + M src/jrd/sdw.cpp + M src/jrd/shut.cpp + M src/jrd/sort.cpp + M src/jrd/sort.h + M src/jrd/tpc.cpp + M src/jrd/tpc_proto.h + M src/jrd/tra.cpp + M src/jrd/tra.h + M src/jrd/trace/TraceDSQLHelpers.h + M src/jrd/trace/TraceJrdHelpers.h + M src/jrd/trace/TraceObjects.cpp + M src/jrd/trace/TraceObjects.h + M src/jrd/validation.cpp + M src/jrd/vio.cpp + M src/lock/lock.cpp + M src/lock/lock_proto.h + M src/remote/server/os/win32/srvr_w32.cpp + M src/remote/server/server.cpp +Shared page cache implementation + 2011-05-08 17:53 asfernandes M src/include/FirebirdApi.h M src/include/FirebirdExternalApi.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-10 01:12:14 UTC (rev 52897) +++ firebird/trunk/src/jrd/build_no.h 2011-05-10 03:17:39 UTC (rev 52898) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29339 + FORMAL BUILD NUMBER:29341 */ -#define PRODUCT_VER_STRING "3.0.0.29339" -#define FILE_VER_STRING "WI-T3.0.0.29339" -#define LICENSE_VER_STRING "WI-T3.0.0.29339" -#define FILE_VER_NUMBER 3, 0, 0, 29339 +#define PRODUCT_VER_STRING "3.0.0.29341" +#define FILE_VER_STRING "WI-T3.0.0.29341" +#define LICENSE_VER_STRING "WI-T3.0.0.29341" +#define FILE_VER_NUMBER 3, 0, 0, 29341 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29339" +#define FB_BUILD_NO "29341" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-10 01:12:14 UTC (rev 52897) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-10 03:17:39 UTC (rev 52898) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29339 +BuildNum=29341 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-11 03:18:46
|
Revision: 52916 http://firebird.svn.sourceforge.net/firebird/?rev=52916&view=rev Author: firebirds Date: 2011-05-11 03:18:40 +0000 (Wed, 11 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-11 02:43:39 UTC (rev 52915) +++ firebird/trunk/ChangeLog 2011-05-11 03:18:40 UTC (rev 52916) @@ -1,3 +1,50 @@ + 2011-05-11 02:43 asfernandes + M src/jrd/jrd.cpp + M src/remote/server/server.cpp +Warning / error. + + 2011-05-11 01:18 asfernandes + M src/jrd/met.epp + M src/jrd/nbak.cpp + M src/jrd/sdw.cpp + M src/jrd/tpc.cpp + M src/jrd/tpc_proto.h + M src/jrd/tra.cpp + M src/jrd/validation.cpp + M src/jrd/vio.cpp + M src/remote/server/os/win32/srvr_w32.cpp + M src/yvalve/PluginManager.cpp +Misc. + + 2011-05-10 14:03 alexpeshkoff + M src/jrd/os/posix/unix.cpp +make it compile with shared cache + + 2011-05-10 13:44 hvlad + M src/yvalve/PluginManager.cpp +Temporary solution to not crash utilities working with embedded engine on exit. + + 2011-05-10 13:37 hvlad + M builds/install/arch-specific/win32/install_super.bat +Don't use Guardian with services + + 2011-05-10 13:36 hvlad + M src/utilities/fbcpl/fbdialog.cpp + M src/utilities/fbcpl/fbpanel.cpp +Adjusted CPL applet with current binaries names and paths. +Make it show error even when there is no registry information. + + 2011-05-10 13:03 hvlad + M src/iscguard/iscguard.h + M src/utilities/install/install_nt.h + M src/utilities/install/install_reg.cpp + M src/utilities/install/install_svc.cpp +Adjusted instreg, instsvc and fbguard with current binaries names and paths + + 2011-05-10 11:56 alexpeshkoff + M src/jrd/Database.h +fixed gcc warning + 2011-05-10 01:12 asfernandes M builds/install/misc/firebird.conf.in M src/common/classes/SyncObject.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-11 02:43:39 UTC (rev 52915) +++ firebird/trunk/src/jrd/build_no.h 2011-05-11 03:18:40 UTC (rev 52916) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29341 + FORMAL BUILD NUMBER:29349 */ -#define PRODUCT_VER_STRING "3.0.0.29341" -#define FILE_VER_STRING "WI-T3.0.0.29341" -#define LICENSE_VER_STRING "WI-T3.0.0.29341" -#define FILE_VER_NUMBER 3, 0, 0, 29341 +#define PRODUCT_VER_STRING "3.0.0.29349" +#define FILE_VER_STRING "WI-T3.0.0.29349" +#define LICENSE_VER_STRING "WI-T3.0.0.29349" +#define FILE_VER_NUMBER 3, 0, 0, 29349 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29341" +#define FB_BUILD_NO "29349" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-11 02:43:39 UTC (rev 52915) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-11 03:18:40 UTC (rev 52916) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29341 +BuildNum=29349 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-12 03:16:17
|
Revision: 52925 http://firebird.svn.sourceforge.net/firebird/?rev=52925&view=rev Author: firebirds Date: 2011-05-12 03:16:10 +0000 (Thu, 12 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-12 00:42:40 UTC (rev 52924) +++ firebird/trunk/ChangeLog 2011-05-12 03:16:10 UTC (rev 52925) @@ -1,3 +1,42 @@ + 2011-05-12 00:42 asfernandes + M src/jrd/cch.cpp + M src/jrd/cch.h +Misc. + + 2011-05-11 17:42 asfernandes + M src/jrd/EngineInterface.h + M src/jrd/ExtEngineManager.cpp + M src/jrd/extds/InternalDS.cpp + M src/jrd/jrd.cpp + M src/jrd/jrd_proto.h +Lets try to avoid global functions using name with mixed new (functionName) and old SUBSYS_name name style. + + 2011-05-11 15:57 asfernandes + M src/yvalve/why.cpp +Fix the build. + + 2011-05-11 14:45 hvlad + M src/jrd/ExtEngineManager.cpp + M src/jrd/extds/InternalDS.cpp + M src/jrd/jrd.cpp + M src/jrd/jrd_proto.h +Renamed currentProvider to EngineProvider to better reflect its nature and corrected its declaration (with Alex permission ;). Removed unneeded cast. + + 2011-05-11 14:24 hvlad + M src/yvalve/why.cpp +Avoid memory leaks due to wrong reference counting. + + 2011-05-11 09:56 hvlad + M src/remote/server/os/win32/property.rc +Show long version string in "Firebird Server Properties" dialog properly + + 2011-05-11 09:39 hvlad + M src/jrd/Attachment.cpp + M src/jrd/Attachment.h + M src/jrd/jrd.cpp +Adjust order of releasing metadata objects when attachment is released. +It also avoids assert in MET_verify_cache() pointed privately by Alex. + 2011-05-11 02:43 asfernandes M src/jrd/jrd.cpp M src/remote/server/server.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-12 00:42:40 UTC (rev 52924) +++ firebird/trunk/src/jrd/build_no.h 2011-05-12 03:16:10 UTC (rev 52925) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29349 + FORMAL BUILD NUMBER:29356 */ -#define PRODUCT_VER_STRING "3.0.0.29349" -#define FILE_VER_STRING "WI-T3.0.0.29349" -#define LICENSE_VER_STRING "WI-T3.0.0.29349" -#define FILE_VER_NUMBER 3, 0, 0, 29349 +#define PRODUCT_VER_STRING "3.0.0.29356" +#define FILE_VER_STRING "WI-T3.0.0.29356" +#define LICENSE_VER_STRING "WI-T3.0.0.29356" +#define FILE_VER_NUMBER 3, 0, 0, 29356 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29349" +#define FB_BUILD_NO "29356" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-12 00:42:40 UTC (rev 52924) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-12 03:16:10 UTC (rev 52925) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29349 +BuildNum=29356 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-13 03:17:47
|
Revision: 52935 http://firebird.svn.sourceforge.net/firebird/?rev=52935&view=rev Author: firebirds Date: 2011-05-13 03:17:35 +0000 (Fri, 13 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-13 01:23:53 UTC (rev 52934) +++ firebird/trunk/ChangeLog 2011-05-13 03:17:35 UTC (rev 52935) @@ -1,3 +1,20 @@ + 2011-05-13 01:23 asfernandes + M src/common/classes/fb_atomic.h +Correction. + + 2011-05-13 01:15 asfernandes + M src/jrd/cch.cpp + M src/jrd/jrd.cpp +Misc. + + 2011-05-12 14:56 dimitr + M src/dsql/dsql.cpp +Fixed CORE-3477: Passing non-existing SQL parameters always crash server. + + 2011-05-12 08:45 dimitr + M src/jrd/met.epp +Front-ported CORE-3314: Dependencies are not removed after dropping the procedure and the table it depends on in the same transaction. + 2011-05-12 00:42 asfernandes M src/jrd/cch.cpp M src/jrd/cch.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-13 01:23:53 UTC (rev 52934) +++ firebird/trunk/src/jrd/build_no.h 2011-05-13 03:17:35 UTC (rev 52935) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29356 + FORMAL BUILD NUMBER:29360 */ -#define PRODUCT_VER_STRING "3.0.0.29356" -#define FILE_VER_STRING "WI-T3.0.0.29356" -#define LICENSE_VER_STRING "WI-T3.0.0.29356" -#define FILE_VER_NUMBER 3, 0, 0, 29356 +#define PRODUCT_VER_STRING "3.0.0.29360" +#define FILE_VER_STRING "WI-T3.0.0.29360" +#define LICENSE_VER_STRING "WI-T3.0.0.29360" +#define FILE_VER_NUMBER 3, 0, 0, 29360 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29356" +#define FB_BUILD_NO "29360" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-13 01:23:53 UTC (rev 52934) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-13 03:17:35 UTC (rev 52935) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29356 +BuildNum=29360 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-14 03:18:26
|
Revision: 52940 http://firebird.svn.sourceforge.net/firebird/?rev=52940&view=rev Author: firebirds Date: 2011-05-14 03:18:18 +0000 (Sat, 14 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-14 02:49:02 UTC (rev 52939) +++ firebird/trunk/ChangeLog 2011-05-14 03:18:18 UTC (rev 52940) @@ -1,3 +1,15 @@ + 2011-05-14 02:49 asfernandes + M src/dsql/pass1.cpp +Fixed crash with nested unions, reported by Vlad. +SELECT 'a' FROM RDB$DATABASE +UNION ALL +SELECT X FROM + ( + SELECT 'b' AS X FROM RDB$DATABASE + UNION ALL + SELECT 'c' FROM RDB$DATABASE + ) AS T; + 2011-05-13 01:23 asfernandes M src/common/classes/fb_atomic.h Correction. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-14 02:49:02 UTC (rev 52939) +++ firebird/trunk/src/jrd/build_no.h 2011-05-14 03:18:18 UTC (rev 52940) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29360 + FORMAL BUILD NUMBER:29361 */ -#define PRODUCT_VER_STRING "3.0.0.29360" -#define FILE_VER_STRING "WI-T3.0.0.29360" -#define LICENSE_VER_STRING "WI-T3.0.0.29360" -#define FILE_VER_NUMBER 3, 0, 0, 29360 +#define PRODUCT_VER_STRING "3.0.0.29361" +#define FILE_VER_STRING "WI-T3.0.0.29361" +#define LICENSE_VER_STRING "WI-T3.0.0.29361" +#define FILE_VER_NUMBER 3, 0, 0, 29361 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29360" +#define FB_BUILD_NO "29361" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-14 02:49:02 UTC (rev 52939) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-14 03:18:18 UTC (rev 52940) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29360 +BuildNum=29361 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-15 03:17:16
|
Revision: 52943 http://firebird.svn.sourceforge.net/firebird/?rev=52943&view=rev Author: firebirds Date: 2011-05-15 03:17:09 +0000 (Sun, 15 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-14 21:44:07 UTC (rev 52942) +++ firebird/trunk/ChangeLog 2011-05-15 03:17:09 UTC (rev 52943) @@ -1,3 +1,7 @@ + 2011-05-14 21:44 asfernandes + M src/common/classes/SyncObject.h +Fix warning. + 2011-05-14 02:49 asfernandes M src/dsql/pass1.cpp Fixed crash with nested unions, reported by Vlad. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-14 21:44:07 UTC (rev 52942) +++ firebird/trunk/src/jrd/build_no.h 2011-05-15 03:17:09 UTC (rev 52943) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29361 + FORMAL BUILD NUMBER:29362 */ -#define PRODUCT_VER_STRING "3.0.0.29361" -#define FILE_VER_STRING "WI-T3.0.0.29361" -#define LICENSE_VER_STRING "WI-T3.0.0.29361" -#define FILE_VER_NUMBER 3, 0, 0, 29361 +#define PRODUCT_VER_STRING "3.0.0.29362" +#define FILE_VER_STRING "WI-T3.0.0.29362" +#define LICENSE_VER_STRING "WI-T3.0.0.29362" +#define FILE_VER_NUMBER 3, 0, 0, 29362 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29361" +#define FB_BUILD_NO "29362" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-14 21:44:07 UTC (rev 52942) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-15 03:17:09 UTC (rev 52943) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29361 +BuildNum=29362 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2011-05-15 15:37:18
|
Revision: 52944 http://firebird.svn.sourceforge.net/firebird/?rev=52944&view=rev Author: asfernandes Date: 2011-05-15 15:37:11 +0000 (Sun, 15 May 2011) Log Message: ----------- Added IRoutineMetadata to external engines. Not well tested: 1) EE is broken after shared page cache. 2) Semantics of addRef/release still keeps changing in developers minds. Modified Paths: -------------- firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/include/FirebirdExternalApi.h firebird/trunk/src/include/FirebirdUdr.h firebird/trunk/src/include/FirebirdUdrCpp.h firebird/trunk/src/jrd/ExtEngineManager.cpp firebird/trunk/src/jrd/ExtEngineManager.h firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2011-05-15 03:17:09 UTC (rev 52943) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2011-05-15 15:37:11 UTC (rev 52944) @@ -30,6 +30,8 @@ using namespace Firebird::Udr; +typedef IMaster* (ISC_EXPORT *FuncGetMasterInterface)(); + typedef ISC_LONG (ISC_EXPORT_VARARG *FuncEventBlock)(ISC_UCHAR**, ISC_UCHAR**, ISC_USHORT, ...); typedef ISC_STATUS (ISC_EXPORT *FuncWaitForEvent)(ISC_STATUS*, isc_db_handle*, short, const ISC_UCHAR*, ISC_UCHAR*); @@ -50,6 +52,87 @@ unsigned short, const ISC_SCHAR*, unsigned short, XSQLDA*); +namespace +{ + template <typename T> + class AutoDispose + { + public: + AutoDispose<T>(T* aPtr = NULL) + : ptr(aPtr) + { + } + + ~AutoDispose() + { + clear(); + } + + AutoDispose<T>& operator =(T* aPtr) + { + clear(); + ptr = aPtr; + return *this; + } + + operator T*() + { + return ptr; + } + + operator const T*() const + { + return ptr; + } + + bool operator !() const + { + return !ptr; + } + + bool hasData() const + { + return ptr != NULL; + } + + T* operator ->() + { + return ptr; + } + + T* release() + { + T* tmp = ptr; + ptr = NULL; + return tmp; + } + + void reset(T* aPtr = NULL) + { + if (aPtr != ptr) + { + clear(); + ptr = aPtr; + } + } + + private: + void clear() + { + if (ptr) + ptr->dispose(); + } + + // not implemented + AutoDispose<T>(AutoDispose<T>&); + void operator =(AutoDispose<T>&); + + private: + T* ptr; + }; +} + + /*** create function wait_event ( event_name varchar(31) character set ascii @@ -135,6 +218,7 @@ isc_stmt_handle stmtHandle; // ISC entry points + FuncGetMasterInterface funcGetMasterInterface; FuncDsqlAllocateStatement funcDsqlAllocateStatement; FuncDsqlDescribe funcDsqlDescribe; FuncDsqlDescribeBind funcDsqlDescribeBind; @@ -246,6 +330,7 @@ return; // ISC entry points + funcGetMasterInterface = (FuncGetMasterInterface) getEntryPoint(context, "fb_get_master_interface"); funcDsqlAllocateStatement = (FuncDsqlAllocateStatement) getEntryPoint(context, "isc_dsql_allocate_statement"); funcDsqlDescribe = (FuncDsqlDescribe) getEntryPoint(context, "isc_dsql_describe"); @@ -265,14 +350,33 @@ "select data_source from replicate_config where name = ?", SQL_DIALECT_CURRENT, NULL), statusVector); + AutoDispose<IMaster> master(funcGetMasterInterface()); + AutoDispose<IStatus> status(master->getStatus()); + + const char* table = metadata->getTriggerTable(status); + ThrowError::check(status->get()); + + // Skip the first exclamation point, separing the module name and entry point. + const char* info = strchr(metadata->getEntryPoint(status), '!'); + ThrowError::check(status->get()); + + // Skip the second exclamation point, separing the entry point and the misc info (config). + if (info) + info = strchr(info + 1, '!'); + + if (info) + ++info; + else + info = ""; + inSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); inSqlDa->version = SQLDA_VERSION1; inSqlDa->sqln = 1; ThrowError::check(funcDsqlDescribeBind(statusVector, &stmtHandle, SQL_DIALECT_CURRENT, inSqlDa), statusVector); inSqlDa->sqlvar[0].sqldata = new char[sizeof(short) + inSqlDa->sqlvar[0].sqllen]; - strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), metaInfo->info, inSqlDa->sqlvar[0].sqllen); - *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(metaInfo->info); + strncpy(inSqlDa->sqlvar[0].sqldata + sizeof(short), info, inSqlDa->sqlvar[0].sqllen); + *reinterpret_cast<short*>(inSqlDa->sqlvar[0].sqldata) = strlen(info); XSQLDA* outSqlDa = reinterpret_cast<XSQLDA*>(new char[(XSQLDA_LENGTH(1))]); outSqlDa->version = SQLDA_VERSION1; @@ -304,7 +408,7 @@ const char* name = val->getName(ThrowError()); strcat(buffer, " p"); - sprintf(buffer + strlen(buffer), "%d type of column \"%s\".\"%s\" = ?", i, metaInfo->table, name); + sprintf(buffer + strlen(buffer), "%d type of column \"%s\".\"%s\" = ?", i, table, name); } strcat(buffer, @@ -313,7 +417,7 @@ "begin\n" " execute statement ('insert into \""); - strcat(buffer, metaInfo->table); + strcat(buffer, table); strcat(buffer, "\" ("); for (int i = 1; i <= count; ++i) @@ -449,7 +553,7 @@ { case SQL_VARYING: { - uint len; + unsigned len; const char* s = val->getString(ThrowError(), &len); *reinterpret_cast<unsigned short*>(var->sqldata) = len; memcpy(var->sqldata + sizeof(unsigned short), s, len); Modified: firebird/trunk/src/include/FirebirdExternalApi.h =================================================================== --- firebird/trunk/src/include/FirebirdExternalApi.h 2011-05-15 03:17:09 UTC (rev 52943) +++ firebird/trunk/src/include/FirebirdExternalApi.h 2011-05-15 15:37:11 UTC (rev 52944) @@ -152,6 +152,19 @@ }; +class IRoutineMetadata // : public IVersioned +{ +public: + virtual const char* FB_CARG getPackage(IStatus* status) const = 0; + virtual const char* FB_CARG getName(IStatus* status) const = 0; + virtual const char* FB_CARG getEntryPoint(IStatus* status) const = 0; + virtual const char* FB_CARG getBody(IStatus* status) const = 0; + virtual const char* FB_CARG getTriggerTable(IStatus* status) const = 0; + virtual ExternalTrigger::Type FB_CARG getTriggerType(IStatus* status) const = 0; +}; +// #define FB_I_ROUTINE_METADATA_VERSION (FB_VERSIONED_VERSION + 6) + + // In SuperServer, shared by all attachments to one database and disposed when last (non-external) // user attachment to the database is closed. class ExternalEngine : public IPluginBase @@ -175,12 +188,11 @@ // Called when engine wants to load object in the cache. Objects are disposed when // going out of the cache. virtual ExternalFunction* FB_CALL makeFunction(Error* error, ExternalContext* context, - const char* package, const char* name, const char* entryPoint, const char* body) = 0; + const IRoutineMetadata* metadata) = 0; virtual ExternalProcedure* FB_CALL makeProcedure(Error* error, ExternalContext* context, - const char* package, const char* name, const char* entryPoint, const char* body) = 0; + const IRoutineMetadata* metadata) = 0; virtual ExternalTrigger* FB_CALL makeTrigger(Error* error, ExternalContext* context, - const char* name, const char* entryPoint, const char* body, - const char* table, ExternalTrigger::Type type) = 0; + const IRoutineMetadata* metadata) = 0; }; #define FB_EXTERNAL_ENGINE_VERSION (FB_PLUGIN_VERSION + 7) Modified: firebird/trunk/src/include/FirebirdUdr.h =================================================================== --- firebird/trunk/src/include/FirebirdUdr.h 2011-05-15 03:17:09 UTC (rev 52943) +++ firebird/trunk/src/include/FirebirdUdr.h 2011-05-15 15:37:11 UTC (rev 52944) @@ -34,24 +34,6 @@ //------------------------------------------------------------------------------ -// Metadata information passed from the UDR engine to user's routines factories when asking to -// create routines instances. -struct MetaInfo -{ - const char* package; // package name - NULL from triggers - const char* name; // metadata object name - const char* entryPoint; // external routine's name - const char* info; // misc. info encoded on the external name - const char* body; // body text -}; - -struct TriggerMetaInfo : public MetaInfo -{ - ExternalTrigger::Type type; // trigger type - const char* table; // table name -}; - - // Factory classes. They should be singletons instances created by user's modules and // registered. When UDR engine is going to load a routine, it calls newItem. @@ -59,21 +41,21 @@ { public: virtual const char* FB_CALL getName() = 0; - virtual ExternalFunction* FB_CALL newItem(MetaInfo* metaInfo) = 0; + virtual ExternalFunction* FB_CALL newItem(const IRoutineMetadata* metadata) = 0; }; class ProcedureFactory { public: virtual const char* FB_CALL getName() = 0; - virtual ExternalProcedure* FB_CALL newItem(MetaInfo* metaInfo) = 0; + virtual ExternalProcedure* FB_CALL newItem(const IRoutineMetadata* metadata) = 0; }; class TriggerFactory { public: virtual const char* FB_CALL getName() = 0; - virtual ExternalTrigger* FB_CALL newItem(TriggerMetaInfo* metaInfo) = 0; + virtual ExternalTrigger* FB_CALL newItem(const IRoutineMetadata* metadata) = 0; }; Modified: firebird/trunk/src/include/FirebirdUdrCpp.h =================================================================== --- firebird/trunk/src/include/FirebirdUdrCpp.h 2011-05-15 03:17:09 UTC (rev 52943) +++ firebird/trunk/src/include/FirebirdUdrCpp.h 2011-05-15 15:37:11 UTC (rev 52944) @@ -503,7 +503,7 @@ } public: - MetaInfo* metaInfo; + const IRoutineMetadata* metadata; }; @@ -525,7 +525,7 @@ } public: - MetaInfo* metaInfo; + const IRoutineMetadata* metadata; }; @@ -547,7 +547,7 @@ } public: - TriggerMetaInfo* metaInfo; + const IRoutineMetadata* metadata; }; @@ -566,10 +566,10 @@ return name; } - virtual ExternalFunction* FB_CALL newItem(MetaInfo* metaInfo) + virtual ExternalFunction* FB_CALL newItem(const IRoutineMetadata* metadata) { Function* function = new T(); - function->metaInfo = metaInfo; + function->metadata = metadata; return function; } @@ -593,10 +593,10 @@ return name; } - virtual ExternalProcedure* FB_CALL newItem(MetaInfo* metaInfo) + virtual ExternalProcedure* FB_CALL newItem(const IRoutineMetadata* metadata) { Procedure* procedure = new T(); - procedure->metaInfo = metaInfo; + procedure->metadata = metadata; return procedure; } @@ -620,10 +620,10 @@ return name; } - virtual ExternalTrigger* FB_CALL newItem(TriggerMetaInfo* metaInfo) + virtual ExternalTrigger* FB_CALL newItem(const IRoutineMetadata* metadata) { Trigger* trigger = new T(); - trigger->metaInfo = metaInfo; + trigger->metadata = metadata; return trigger; } Modified: firebird/trunk/src/jrd/ExtEngineManager.cpp =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-15 03:17:09 UTC (rev 52943) +++ firebird/trunk/src/jrd/ExtEngineManager.cpp 2011-05-15 15:37:11 UTC (rev 52944) @@ -286,10 +286,11 @@ ExtEngineManager::Function::Function(thread_db* tdbb, ExtEngineManager* aExtManager, - ExternalEngine* aEngine, ExternalFunction* aFunction, + ExternalEngine* aEngine, RoutineMetadata* aMetadata, ExternalFunction* aFunction, const Jrd::Function* aUdf) : extManager(aExtManager), engine(aEngine), + metadata(aMetadata), function(aFunction), udf(aUdf), database(tdbb->getDatabase()) @@ -384,10 +385,11 @@ ExtEngineManager::Procedure::Procedure(thread_db* tdbb, ExtEngineManager* aExtManager, - ExternalEngine* aEngine, ExternalProcedure* aProcedure, + ExternalEngine* aEngine, RoutineMetadata* aMetadata, ExternalProcedure* aProcedure, const jrd_prc* aPrc) : extManager(aExtManager), engine(aEngine), + metadata(aMetadata), procedure(aProcedure), prc(aPrc), database(tdbb->getDatabase()) @@ -467,10 +469,11 @@ ExtEngineManager::Trigger::Trigger(thread_db* tdbb, ExtEngineManager* aExtManager, - ExternalEngine* aEngine, ExternalTrigger* aTrigger, + ExternalEngine* aEngine, RoutineMetadata* aMetadata, ExternalTrigger* aTrigger, const Jrd::Trigger* aTrg) : extManager(aExtManager), engine(aEngine), + metadata(aMetadata), trigger(aTrigger), trg(aTrg), database(tdbb->getDatabase()) @@ -651,14 +654,19 @@ CallerName(obj_udf, udf->getName().identifier) : CallerName(obj_package_header, udf->getName().package))); + MemoryPool& pool = *tdbb->getDefaultPool(); + AutoPtr<RoutineMetadata> metadata(FB_NEW(pool) RoutineMetadata(pool)); + metadata->package = udf->getName().package; + metadata->name = udf->getName().identifier; + metadata->entryPoint = entryPointTrimmed; + metadata->body = body; + ExternalFunction* externalFunction; { // scope Attachment::Checkout attCout(tdbb->getAttachment()); - externalFunction = attInfo->engine->makeFunction(RaiseError(), - attInfo->context, udf->getName().package.nullStr(), udf->getName().identifier.c_str(), - entryPointTrimmed.nullStr(), body.nullStr()); + externalFunction = attInfo->engine->makeFunction(RaiseError(), attInfo->context, metadata); if (!externalFunction) { @@ -670,7 +678,8 @@ try { - return FB_NEW(getPool()) Function(tdbb, this, attInfo->engine, externalFunction, udf); + return FB_NEW(getPool()) Function(tdbb, this, attInfo->engine, metadata.release(), + externalFunction, udf); } catch (...) { @@ -693,14 +702,19 @@ CallerName(obj_procedure, prc->getName().identifier) : CallerName(obj_package_header, prc->getName().package))); + MemoryPool& pool = *tdbb->getDefaultPool(); + AutoPtr<RoutineMetadata> metadata(FB_NEW(pool) RoutineMetadata(pool)); + metadata->package = prc->getName().package; + metadata->name = prc->getName().identifier; + metadata->entryPoint = entryPointTrimmed; + metadata->body = body; + ExternalProcedure* externalProcedure; { // scope Attachment::Checkout attCout(tdbb->getAttachment()); - externalProcedure = attInfo->engine->makeProcedure(RaiseError(), - attInfo->context, prc->getName().package.nullStr(), prc->getName().identifier.c_str(), - entryPointTrimmed.nullStr(), body.nullStr()); + externalProcedure = attInfo->engine->makeProcedure(RaiseError(), attInfo->context, metadata); if (!externalProcedure) { @@ -712,7 +726,8 @@ try { - return FB_NEW(getPool()) Procedure(tdbb, this, attInfo->engine, externalProcedure, prc); + return FB_NEW(getPool()) Procedure(tdbb, this, attInfo->engine, metadata.release(), + externalProcedure, prc); } catch (...) { @@ -729,22 +744,25 @@ string entryPointTrimmed = entryPoint; entryPointTrimmed.trim(); - MetaName relationNameTrimmed; - if (trg->relation) - relationNameTrimmed = trg->relation->rel_name; - EngineAttachmentInfo* attInfo = getEngineAttachment(tdbb, engine); ContextManager<ExternalTrigger> ctxManager(tdbb, attInfo, attInfo->adminCharSet, CallerName(obj_trigger, trg->name)); + MemoryPool& pool = *tdbb->getDefaultPool(); + AutoPtr<RoutineMetadata> metadata(FB_NEW(pool) RoutineMetadata(pool)); + metadata->name = trg->name; + metadata->entryPoint = entryPointTrimmed; + metadata->body = body; + metadata->triggerType = type; + if (trg->relation) + metadata->triggerTable = trg->relation->rel_name; + ExternalTrigger* externalTrigger; { // scope Attachment::Checkout attCout(tdbb->getAttachment()); - externalTrigger = attInfo->engine->makeTrigger(RaiseError(), attInfo->context, - trg->name.c_str(), entryPointTrimmed.nullStr(), body.nullStr(), - relationNameTrimmed.c_str(), type); + externalTrigger = attInfo->engine->makeTrigger(RaiseError(), attInfo->context, metadata); if (!externalTrigger) { @@ -755,7 +773,8 @@ try { - return FB_NEW(getPool()) Trigger(tdbb, this, attInfo->engine, externalTrigger, trg); + return FB_NEW(getPool()) Trigger(tdbb, this, attInfo->engine, metadata.release(), + externalTrigger, trg); } catch (...) { Modified: firebird/trunk/src/jrd/ExtEngineManager.h =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-15 03:17:09 UTC (rev 52943) +++ firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-15 15:37:11 UTC (rev 52944) @@ -61,6 +61,59 @@ template <typename T> class ContextManager; class TransactionImpl; + class RoutineMetadata : public Firebird::IRoutineMetadata, public Firebird::PermanentStorage + { + public: + RoutineMetadata(MemoryPool& pool) + : PermanentStorage(pool), + package(pool), + name(pool), + entryPoint(pool), + body(pool), + triggerTable(pool), + triggerType(Firebird::ExternalTrigger::Type(0)) + { + } + + virtual const char* FB_CARG getPackage(Firebird::IStatus* /*status*/) const + { + return package.nullStr(); + } + + virtual const char* FB_CARG getName(Firebird::IStatus* /*status*/) const + { + return name.c_str(); + } + + virtual const char* FB_CARG getEntryPoint(Firebird::IStatus* /*status*/) const + { + return entryPoint.c_str(); + } + + virtual const char* FB_CARG getBody(Firebird::IStatus* /*status*/) const + { + return body.c_str(); + } + + virtual const char* FB_CARG getTriggerTable(Firebird::IStatus* /*status*/) const + { + return triggerTable.c_str(); + } + + virtual Firebird::ExternalTrigger::Type FB_CARG getTriggerType(Firebird::IStatus* /*status*/) const + { + return triggerType; + } + + public: + Firebird::MetaName package; + Firebird::MetaName name; + Firebird::string entryPoint; + Firebird::string body; + Firebird::MetaName triggerTable; + Firebird::ExternalTrigger::Type triggerType; + }; + class ExternalContextImpl : public Firebird::ExternalContext { friend class AttachmentImpl; @@ -130,6 +183,7 @@ public: Function(thread_db* tdbb, ExtEngineManager* aExtManager, Firebird::ExternalEngine* aEngine, + RoutineMetadata* aMetadata, Firebird::ExternalFunction* aFunction, const Jrd::Function* aUdf); ~Function(); @@ -140,6 +194,7 @@ private: ExtEngineManager* extManager; Firebird::ExternalEngine* engine; + Firebird::AutoPtr<RoutineMetadata> metadata; Firebird::ExternalFunction* function; const Jrd::Function* udf; Database* database; @@ -152,6 +207,7 @@ public: Procedure(thread_db* tdbb, ExtEngineManager* aExtManager, Firebird::ExternalEngine* aEngine, + RoutineMetadata* aMetadata, Firebird::ExternalProcedure* aProcedure, const jrd_prc* aPrc); ~Procedure(); @@ -161,6 +217,7 @@ private: ExtEngineManager* extManager; Firebird::ExternalEngine* engine; + Firebird::AutoPtr<RoutineMetadata> metadata; Firebird::ExternalProcedure* procedure; const jrd_prc* prc; Database* database; @@ -191,6 +248,7 @@ public: Trigger(thread_db* tdbb, ExtEngineManager* aExtManager, Firebird::ExternalEngine* aEngine, + RoutineMetadata* aMetadata, Firebird::ExternalTrigger* aTrigger, const Jrd::Trigger* aTrg); ~Trigger(); @@ -205,6 +263,7 @@ ExtEngineManager* extManager; Firebird::ExternalEngine* engine; + Firebird::AutoPtr<RoutineMetadata> metadata; Firebird::ExternalTrigger* trigger; const Jrd::Trigger* trg; Database* database; Modified: firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp =================================================================== --- firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2011-05-15 03:17:09 UTC (rev 52943) +++ firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp 2011-05-15 15:37:11 UTC (rev 52944) @@ -36,6 +36,7 @@ #include "../common/os/mod_loader.h" #include "../common/os/path_utils.h" #include "../common/classes/ImplementHelper.h" +#include "../common/StatusHolder.h" namespace Firebird @@ -130,7 +131,7 @@ } public: - void loadModule(const string& str, PathName* moduleName, string* entryPoint, string* info); + void loadModule(const IRoutineMetadata* metadata, PathName* moduleName, string* entryPoint); template <typename NodeType, typename ObjType, typename SharedObjType> ObjType* getChild( GenericMap<Pair<NonPooled<ExternalContext*, ObjType*> > >& children, SharedObjType* sharedObj, ExternalContext* context, NodeType* nodes, SortedArray<SharedObjType*>& sharedObjs, @@ -138,12 +139,12 @@ template <typename ObjType> void deleteChildren( GenericMap<Pair<NonPooled<ExternalContext*, ObjType*> > >& children); - template <typename T, typename T2> T* findNode(T* nodes, const PathName& moduleName, - T2* metaInfo); + template <typename T> T* findNode(T* nodes, const PathName& moduleName, + const string& entryPoint); private: - template <typename T, typename T2, typename T3> T2* getNode(T* nodes, const PathName& moduleName, - T3* metaInfo); + template <typename T, typename T2> T2* getNode(T* nodes, const PathName& moduleName, + const IRoutineMetadata* metadata, const string& entryPoint); public: virtual int FB_CALL getVersion(Error* error); @@ -151,12 +152,11 @@ virtual void FB_CALL openAttachment(Error* error, ExternalContext* context); virtual void FB_CALL closeAttachment(Error* error, ExternalContext* context); virtual ExternalFunction* FB_CALL makeFunction(Error* error, ExternalContext* context, - const char* package, const char* name, const char* entryPoint, const char* body); + const IRoutineMetadata* metadata); virtual ExternalProcedure* FB_CALL makeProcedure(Error* error, ExternalContext* context, - const char* package, const char* name, const char* entryPoint, const char* body); + const IRoutineMetadata* metadata); virtual ExternalTrigger* FB_CALL makeTrigger(Error* error, ExternalContext* context, - const char* name, const char* entryPoint, const char* body, const char* table, - ExternalTrigger::Type type); + const IRoutineMetadata* metadata); public: virtual void FB_CALL dispose(Error* error); @@ -205,25 +205,16 @@ class SharedFunction : public ExternalFunction { public: - SharedFunction(Engine* aEngine, const string& aPackage, const string& aName, - const string& aEntryPoint, const string& aBody) + SharedFunction(Engine* aEngine, const IRoutineMetadata* aMetadata) : engine(aEngine), - package(*getDefaultMemoryPool(), aPackage), - name(*getDefaultMemoryPool(), aName), - entryPoint(*getDefaultMemoryPool()), - body(*getDefaultMemoryPool(), aBody), + metadata(aMetadata), moduleName(*getDefaultMemoryPool()), + entryPoint(*getDefaultMemoryPool()), info(*getDefaultMemoryPool()), children(*getDefaultMemoryPool()) { - engine->loadModule(aEntryPoint, &moduleName, &entryPoint, &info); - metaInfo.package = package.nullStr(); - metaInfo.name = name.c_str(); - metaInfo.entryPoint = entryPoint.c_str(); - metaInfo.body = body.c_str(); - metaInfo.info = info.c_str(); - - engine->findNode<FunctionNode, MetaInfo>(registeredFunctions, moduleName, &metaInfo); + engine->loadModule(metadata, &moduleName, &entryPoint); + engine->findNode<FunctionNode>(registeredFunctions, moduleName, entryPoint); } virtual ~SharedFunction() @@ -266,13 +257,10 @@ } public: - MetaInfo metaInfo; Engine* engine; - string package; - string name; - string entryPoint; - string body; + const IRoutineMetadata* metadata; PathName moduleName; + string entryPoint; string info; GenericMap<Pair<NonPooled<ExternalContext*, ExternalFunction*> > > children; }; @@ -284,25 +272,15 @@ class SharedProcedure : public ExternalProcedure { public: - SharedProcedure(Engine* aEngine, const string& aPackage, const string& aName, - const string& aEntryPoint, const string& aBody) + SharedProcedure(Engine* aEngine, const IRoutineMetadata* aMetadata) : engine(aEngine), - package(*getDefaultMemoryPool(), aPackage), - name(*getDefaultMemoryPool(), aName), - entryPoint(*getDefaultMemoryPool(), aEntryPoint), - body(*getDefaultMemoryPool(), aBody), moduleName(*getDefaultMemoryPool()), + entryPoint(*getDefaultMemoryPool()), info(*getDefaultMemoryPool()), children(*getDefaultMemoryPool()) { - engine->loadModule(aEntryPoint, &moduleName, &entryPoint, &info); - metaInfo.package = package.nullStr(); - metaInfo.name = name.c_str(); - metaInfo.entryPoint = entryPoint.c_str(); - metaInfo.body = body.c_str(); - metaInfo.info = info.c_str(); - - engine->findNode<ProcedureNode, MetaInfo>(registeredProcedures, moduleName, &metaInfo); + engine->loadModule(metadata, &moduleName, &entryPoint); + engine->findNode<ProcedureNode>(registeredProcedures, moduleName, entryPoint); } virtual ~SharedProcedure() @@ -352,13 +330,10 @@ } public: - MetaInfo metaInfo; Engine* engine; - string package; - string name; - string entryPoint; - string body; + const IRoutineMetadata* metadata; PathName moduleName; + string entryPoint; string info; GenericMap<Pair<NonPooled<ExternalContext*, ExternalProcedure*> > > children; }; @@ -370,28 +345,16 @@ class SharedTrigger : public ExternalTrigger { public: - SharedTrigger(Engine* aEngine, const string& aName, const string& aEntryPoint, - const string& aBody, const string& aTable, ExternalTrigger::Type aType) + SharedTrigger(Engine* aEngine, const IRoutineMetadata* aMetadata) : engine(aEngine), - name(*getDefaultMemoryPool(), aName), - entryPoint(*getDefaultMemoryPool(), aEntryPoint), - body(*getDefaultMemoryPool(), aBody), + metadata(aMetadata), moduleName(*getDefaultMemoryPool()), + entryPoint(*getDefaultMemoryPool()), info(*getDefaultMemoryPool()), - table(*getDefaultMemoryPool(), aTable), - type(aType), children(*getDefaultMemoryPool()) { - engine->loadModule(aEntryPoint, &moduleName, &entryPoint, &info); - metaInfo.package = NULL; - metaInfo.name = name.c_str(); - metaInfo.entryPoint = entryPoint.c_str(); - metaInfo.body = body.c_str(); - metaInfo.info = info.c_str(); - metaInfo.type = type; - metaInfo.table = table.nullStr(); - - engine->findNode<TriggerNode, TriggerMetaInfo>(registeredTriggers, moduleName, &metaInfo); + engine->loadModule(metadata, &moduleName, &entryPoint); + engine->findNode<TriggerNode>(registeredTriggers, moduleName, entryPoint); } virtual ~SharedTrigger() @@ -434,15 +397,11 @@ } public: - TriggerMetaInfo metaInfo; Engine* engine; - string name; - string entryPoint; - string body; + const IRoutineMetadata* metadata; PathName moduleName; + string entryPoint; string info; - string table; - ExternalTrigger::Type type; GenericMap<Pair<NonPooled<ExternalContext*, ExternalTrigger*> > > children; }; @@ -530,8 +489,12 @@ //-------------------------------------- -void Engine::loadModule(const string& str, PathName* moduleName, string* entryPoint, string* info) +void Engine::loadModule(const IRoutineMetadata* metadata, PathName* moduleName, string* entryPoint) { + LocalStatus status; + const string str(metadata->getEntryPoint(&status)); + ThrowError::check(status.get()); + const size_t pos = str.find('!'); if (pos == string::npos) { @@ -562,7 +525,6 @@ *entryPoint = str.substr(pos + 1); size_t n = entryPoint->find('!'); - *info = (n == string::npos ? "" : entryPoint->substr(n + 1)); *entryPoint = (n == string::npos ? *entryPoint : entryPoint->substr(0, n)); MutexLockGuard guard(modulesMutex); @@ -612,7 +574,7 @@ ObjType* obj; if (!children.get(context, obj)) { - obj = getNode<NodeType, ObjType>(nodes, moduleName, &sharedObj->metaInfo); + obj = getNode<NodeType, ObjType>(nodes, moduleName, sharedObj->metadata, sharedObj->entryPoint); if (obj) children.put(context, obj); } @@ -634,11 +596,9 @@ } -template <typename T, typename T2> T* Engine::findNode(T* nodes, - const PathName& moduleName, T2* params) +template <typename T> T* Engine::findNode(T* nodes, const PathName& moduleName, + const string& entryPoint) { - const string entryPoint(params->entryPoint); - for (T* node = nodes; node; node = node->next) { if (node->module == moduleName && entryPoint == node->factory->getName()) @@ -658,11 +618,11 @@ } -template <typename T, typename T2, typename T3> T2* Engine::getNode(T* nodes, - const PathName& moduleName, T3* params) +template <typename T, typename T2> T2* Engine::getNode(T* nodes, const PathName& moduleName, + const IRoutineMetadata* metadata, const string& entryPoint) { - T* node = findNode<T, T3>(nodes, moduleName, params); - return node->factory->newItem(params); + T* node = findNode<T>(nodes, moduleName, entryPoint); + return node->factory->newItem(metadata); } @@ -720,12 +680,11 @@ ExternalFunction* FB_CALL Engine::makeFunction(Error* error, ExternalContext* /*context*/, - const char* package, const char* name, const char* entryPoint, const char* body) + const IRoutineMetadata* metadata) { try { - return new SharedFunction(this, (package ? package : ""), name, - (entryPoint ? entryPoint : ""), (body ? body : "")); + return new SharedFunction(this, metadata); } catch (const ThrowError::Exception& e) { @@ -736,12 +695,11 @@ ExternalProcedure* FB_CALL Engine::makeProcedure(Error* error, ExternalContext* /*context*/, - const char* package, const char* name, const char* entryPoint, const char* body) + const IRoutineMetadata* metadata) { try { - return new SharedProcedure(this, (package ? package : ""), name, - (entryPoint ? entryPoint : ""), (body ? body : "")); + return new SharedProcedure(this, metadata); } catch (const ThrowError::Exception& e) { @@ -752,13 +710,11 @@ ExternalTrigger* FB_CALL Engine::makeTrigger(Error* error, ExternalContext* /*context*/, - const char* name, const char* entryPoint, const char* body, const char* table, - ExternalTrigger::Type type) + const IRoutineMetadata* metadata) { try { - return new SharedTrigger(this, name, (entryPoint ? entryPoint : ""), (body ? body : ""), - table, type); + return new SharedTrigger(this, metadata); } catch (const ThrowError::Exception& e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-16 03:17:19
|
Revision: 52947 http://firebird.svn.sourceforge.net/firebird/?rev=52947&view=rev Author: firebirds Date: 2011-05-16 03:17:12 +0000 (Mon, 16 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-15 19:56:12 UTC (rev 52946) +++ firebird/trunk/ChangeLog 2011-05-16 03:17:12 UTC (rev 52947) @@ -1,3 +1,22 @@ + 2011-05-15 15:37 asfernandes + M src/jrd/os/posix/unix.cpp + M src/utilities/fbcpl/fbpanel.cpp + M src/yvalve/why.cpp +Misc + + 2011-05-15 15:37 asfernandes + M examples/udr/UdrCppExample.cpp + M src/include/FirebirdExternalApi.h + M src/include/FirebirdUdr.h + M src/include/FirebirdUdrCpp.h + M src/jrd/ExtEngineManager.cpp + M src/jrd/ExtEngineManager.h + M src/plugins/udr_engine/UdrEngine.cpp +Added IRoutineMetadata to external engines. +Not well tested: +1) EE is broken after shared page cache. +2) Semantics of addRef/release still keeps changing in developers minds. + 2011-05-14 21:44 asfernandes M src/common/classes/SyncObject.h Fix warning. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-15 19:56:12 UTC (rev 52946) +++ firebird/trunk/src/jrd/build_no.h 2011-05-16 03:17:12 UTC (rev 52947) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29362 + FORMAL BUILD NUMBER:29364 */ -#define PRODUCT_VER_STRING "3.0.0.29362" -#define FILE_VER_STRING "WI-T3.0.0.29362" -#define LICENSE_VER_STRING "WI-T3.0.0.29362" -#define FILE_VER_NUMBER 3, 0, 0, 29362 +#define PRODUCT_VER_STRING "3.0.0.29364" +#define FILE_VER_STRING "WI-T3.0.0.29364" +#define LICENSE_VER_STRING "WI-T3.0.0.29364" +#define FILE_VER_NUMBER 3, 0, 0, 29364 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29362" +#define FB_BUILD_NO "29364" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-15 19:56:12 UTC (rev 52946) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-16 03:17:12 UTC (rev 52947) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29362 +BuildNum=29364 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2011-05-19 16:24:55
|
Revision: 52968 http://firebird.svn.sourceforge.net/firebird/?rev=52968&view=rev Author: alexpeshkoff Date: 2011-05-19 16:24:46 +0000 (Thu, 19 May 2011) Log Message: ----------- Better interfaces hierarchy: all of them are derived from IVersioned Modified Paths: -------------- firebird/trunk/examples/udr/UdrCppExample.cpp firebird/trunk/src/auth/AuthInterface.h firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp firebird/trunk/src/common/Auth.cpp firebird/trunk/src/common/Auth.h firebird/trunk/src/common/StatementMetadata.h firebird/trunk/src/common/StatusHolder.h firebird/trunk/src/common/classes/GetPlugins.h firebird/trunk/src/common/classes/ImplementHelper.h firebird/trunk/src/common/config/config.h firebird/trunk/src/common/security.h firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp firebird/trunk/src/include/FirebirdExternalApi.h firebird/trunk/src/include/FirebirdPluginApi.h firebird/trunk/src/include/Interface.h firebird/trunk/src/include/ProviderInterface.h firebird/trunk/src/include/Timer.h firebird/trunk/src/jrd/EngineInterface.h firebird/trunk/src/jrd/ExtEngineManager.h firebird/trunk/src/jrd/UserManagement.cpp firebird/trunk/src/jrd/UserManagement.h firebird/trunk/src/jrd/dyn.epp firebird/trunk/src/jrd/jrd.cpp firebird/trunk/src/jrd/ntrace.h firebird/trunk/src/jrd/trace/TraceConfigStorage.h firebird/trunk/src/jrd/trace/TraceObjects.cpp firebird/trunk/src/jrd/trace/TraceObjects.h firebird/trunk/src/remote/client/interface.cpp firebird/trunk/src/utilities/gsec/gsec.cpp firebird/trunk/src/utilities/ntrace/PluginLogWriter.h firebird/trunk/src/utilities/ntrace/TracePluginImpl.h firebird/trunk/src/yvalve/DistributedTransaction.cpp firebird/trunk/src/yvalve/MasterImplementation.cpp firebird/trunk/src/yvalve/MasterImplementation.h firebird/trunk/src/yvalve/PluginManager.cpp firebird/trunk/src/yvalve/PluginManager.h firebird/trunk/src/yvalve/why.cpp Modified: firebird/trunk/examples/udr/UdrCppExample.cpp =================================================================== --- firebird/trunk/examples/udr/UdrCppExample.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/examples/udr/UdrCppExample.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -350,7 +350,7 @@ "select data_source from replicate_config where name = ?", SQL_DIALECT_CURRENT, NULL), statusVector); - AutoDispose<IMaster> master(funcGetMasterInterface()); + IMaster* master(funcGetMasterInterface()); AutoDispose<IStatus> status(master->getStatus()); const char* table = metadata->getTriggerTable(status); Modified: firebird/trunk/src/auth/AuthInterface.h =================================================================== --- firebird/trunk/src/auth/AuthInterface.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/auth/AuthInterface.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -39,20 +39,22 @@ enum Result {AUTH_SUCCESS, AUTH_CONTINUE, AUTH_FAILED, AUTH_MORE_DATA}; -class IWriter : public Firebird::IDisposable +class IWriter : public Firebird::IVersioned { public: virtual void FB_CARG reset() = 0; virtual void FB_CARG add(const char* user, const char* method, const char* details) = 0; }; +#define FB_AUTH_WRITER_VERSION (FB_VERSIONED_VERSION + 2) -class IDpbReader : public Firebird::IDisposable +class IDpbReader : public Firebird::IVersioned { public: virtual int FB_CARG find(UCHAR tag) = 0; virtual void FB_CARG add(UCHAR tag, const void* bytes, unsigned int count) = 0; virtual void FB_CARG drop() = 0; }; +#define FB_AUTH_DPB_READER_VERSION (FB_VERSIONED_VERSION + 3) class IServer : public Firebird::IPluginBase { @@ -75,13 +77,14 @@ }; #define FB_AUTH_CLIENT_VERSION (FB_PLUGIN_VERSION + 3) -class IUserField : public Firebird::IDisposable +class IUserField : public Firebird::IVersioned { public: virtual int FB_CARG entered() = 0; virtual int FB_CARG specified() = 0; virtual void FB_CARG setEntered(int newValue) = 0; }; +#define FB_AUTH_FIELD_VERSION (FB_VERSIONED_VERSION + 3) class ICharUserField : public IUserField { @@ -89,6 +92,7 @@ virtual const char* FB_CARG get() = 0; virtual void FB_CARG set(const char* newValue) = 0; }; +#define FB_AUTH_CHAR_FIELD_VERSION (FB_AUTH_FIELD_VERSION + 2) class IIntUserField : public IUserField { @@ -96,8 +100,9 @@ virtual int FB_CARG get() = 0; virtual void FB_CARG set(int newValue) = 0; }; +#define FB_AUTH_INT_FIELD_VERSION (FB_AUTH_FIELD_VERSION + 2) -class IUser : public Firebird::IDisposable +class IUser : public Firebird::IVersioned { public: virtual int FB_CARG operation() = 0; @@ -116,14 +121,16 @@ virtual void FB_CARG clear() = 0; }; +#define FB_AUTH_USER_VERSION (FB_VERSIONED_VERSION + 11) -class IListUsers : public Firebird::IDisposable +class IListUsers : public Firebird::IVersioned { public: virtual void FB_CARG list(IUser* user) = 0; }; +#define FB_AUTH_LIST_USERS_VERSION (FB_VERSIONED_VERSION + 1) -class ILogonInfo : public Firebird::IDisposable +class ILogonInfo : public Firebird::IVersioned { public: virtual const char* FB_CARG name() = 0; @@ -132,6 +139,7 @@ virtual const char* FB_CARG networkProtocol() = 0; virtual const char* FB_CARG remoteAddress() = 0; }; +#define FB_AUTH_LOGON_INFO_VERSION (FB_VERSIONED_VERSION + 5) class IManagement : public Firebird::IPluginBase { Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp =================================================================== --- firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -122,7 +122,7 @@ namespace Auth { -class SecurityDatabase : public Firebird::StdIface<Firebird::ITimer, FB_I_TIMER_VERSION> +class SecurityDatabase : public Firebird::RefCntIface<Firebird::ITimer, FB_TIMER_VERSION> { public: Result verify(IWriter* authBlock, Firebird::ClumpletReader& originalDpb); Modified: firebird/trunk/src/common/Auth.cpp =================================================================== --- firebird/trunk/src/common/Auth.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/Auth.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -33,7 +33,8 @@ namespace Auth { WriterImplementation::WriterImplementation(bool svcFlag) - : body(getPool()), sequence(0), tag(svcFlag ? isc_spb_auth_block : isc_dpb_auth_block) + : body(*getDefaultMemoryPool()), + sequence(0), tag(svcFlag ? isc_spb_auth_block : isc_dpb_auth_block) { } void WriterImplementation::store(Firebird::ClumpletWriter& to) Modified: firebird/trunk/src/common/Auth.h =================================================================== --- firebird/trunk/src/common/Auth.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/Auth.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -41,7 +41,7 @@ bool legacy(const char* nm); -class WriterImplementation : public Firebird::StackIface<IWriter> +class WriterImplementation : public Firebird::AutoIface<IWriter, FB_AUTH_WRITER_VERSION> { public: WriterImplementation(bool svcFlag); @@ -58,7 +58,7 @@ unsigned char tag; }; -class DpbImplementation : public Firebird::StackIface<IDpbReader> +class DpbImplementation : public Firebird::AutoIface<IDpbReader, FB_AUTH_DPB_READER_VERSION> { public: DpbImplementation(Firebird::ClumpletWriter& base); Modified: firebird/trunk/src/common/StatementMetadata.h =================================================================== --- firebird/trunk/src/common/StatementMetadata.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/StatementMetadata.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -30,6 +30,7 @@ #include "../common/classes/array.h" #include "../common/classes/fb_string.h" #include "../common/classes/objects_array.h" +#include "../common/classes/ImplementHelper.h" namespace Firebird { @@ -38,7 +39,8 @@ class StatementMetadata : public PermanentStorage { public: - class Parameters : public IParametersMetadata, public PermanentStorage + class Parameters : public VersionedIface<IParametersMetadata, FB_PARAMETERS_METADATA_VERSION>, + public PermanentStorage { public: struct Item : public PermanentStorage Modified: firebird/trunk/src/common/StatusHolder.h =================================================================== --- firebird/trunk/src/common/StatusHolder.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/StatusHolder.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -80,8 +80,11 @@ ISC_STATUS vector[40]; // FixMe - may be a kind of dynamic storage will be better? }; -class LocalStatus : public StackIface<BaseStatus> +class LocalStatus : public AutoIface<BaseStatus, FB_STATUS_VERSION> { +public: + virtual void FB_CARG dispose() + { } }; class StatusHolder Modified: firebird/trunk/src/common/classes/GetPlugins.h =================================================================== --- firebird/trunk/src/common/classes/GetPlugins.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/classes/GetPlugins.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -1,7 +1,7 @@ /* * PROGRAM: Firebird interface. * MODULE: ImplementHelper.h - * DESCRIPTION: Tools to help write plugins. + * DESCRIPTION: Tools to help access plugins. * * The contents of this file are subject to the Initial * Developer's Public License Version 1.0 (the "License"); @@ -50,7 +50,7 @@ { public: GetPlugins(unsigned int interfaceType, unsigned int desiredVersion, const char* namesList = NULL) - : masterInterface(fb_get_master_interface()), pluginInterface(masterInterface->getPluginManager()), missing(), + : masterInterface(), pluginInterface(masterInterface), missing(), pluginSet(pluginInterface->getPlugins(interfaceType, namesList ? namesList : Config::getPlugins(interfaceType), desiredVersion, &missing, NULL)), currentPlugin(NULL) @@ -61,7 +61,7 @@ GetPlugins(unsigned int interfaceType, unsigned int desiredVersion, Config* knownConfig, const char* namesList = NULL) - : masterInterface(fb_get_master_interface()), pluginInterface(masterInterface->getPluginManager()), missing(), + : masterInterface(), pluginInterface(masterInterface), missing(), pluginSet(pluginInterface->getPlugins(interfaceType, namesList ? namesList : Config::getPlugins(interfaceType), desiredVersion, &missing, new FirebirdConf(knownConfig))), currentPlugin(NULL) @@ -122,8 +122,8 @@ } private: - AutoPtr<IMaster, AutoDisposable> masterInterface; - AutoPtr<IPluginManager, AutoDisposable> pluginInterface; + MasterInterfacePtr masterInterface; + PluginManagerInterfacePtr pluginInterface; M missing; RefPtr<IPluginSet> pluginSet; P* currentPlugin; Modified: firebird/trunk/src/common/classes/ImplementHelper.h =================================================================== --- firebird/trunk/src/common/classes/ImplementHelper.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/classes/ImplementHelper.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -1,7 +1,7 @@ /* * PROGRAM: Firebird interface. * MODULE: ImplementHelper.h - * DESCRIPTION: Tools to help write plugins. + * DESCRIPTION: Tools to help create interfaces. * * The contents of this file are subject to the Initial * Developer's Public License Version 1.0 (the "License"); @@ -59,25 +59,30 @@ // Implement standard interface and plugin functions -// Helps to implement disposable interfaces -template <class C, typename S = GlobalStorage> -class DisposeIface : public C, public S +// Helps to implement generic versioned interfaces +template <class C, int V> +class VersionedIface : public C { public: - DisposeIface() { } + VersionedIface() { } + int FB_CARG getVersion() + { + return V; + } + private: - DisposeIface(const DisposeIface&); - DisposeIface& operator=(const DisposeIface&); + VersionedIface(const VersionedIface&); + VersionedIface& operator=(const VersionedIface&); }; -// Helps to implement disposable interfaces on stack or static -template <class C, typename S = GlobalStorage> -class StackIface : public DisposeIface<C, S> + +// Helps to implement versioned interfaces on stack or static +template <class C, int V> +class AutoIface : public VersionedIface<C, V> { public: - void FB_CARG dispose() - { } + AutoIface() { } void* operator new(size_t, void* memory) throw() { @@ -85,20 +90,23 @@ } }; +// Helps to implement disposable interfaces +template <class C, int V> +class DisposeIface : public VersionedIface<C, V>, public GlobalStorage +{ +public: + DisposeIface() { } +}; + // Helps to implement standard interfaces -template <class C, int V, typename S = GlobalStorage> -class StdIface : public C, public S +template <class C, int V> +class RefCntIface : public VersionedIface<C, V>, public GlobalStorage { public: - StdIface() : refCounter(0) { } + RefCntIface() : refCounter(0) { } - int FB_CARG getVersion() - { - return V; - } - #ifdef DEV_BUILD - ~StdIface() + ~RefCntIface() { fb_assert(refCounter.value() == 0); } @@ -111,30 +119,26 @@ protected: AtomicCounter refCounter; - -private: - StdIface(const StdIface&); - StdIface& operator=(const StdIface&); }; // Helps to implement plugins -template <class C, int V, typename S = GlobalStorage> -class StdPlugin : public StdIface<C, V, S> +template <class C, int V> +class StdPlugin : public RefCntIface<C, V> { private: - IInterface* owner; + IRefCounted* owner; public: StdPlugin() : owner(NULL) { } - IInterface* FB_CARG getOwner() + IRefCounted* FB_CARG getOwner() { return owner; } - void FB_CARG setOwner(IInterface* iface) + void FB_CARG setOwner(IRefCounted* iface) { owner = iface; } @@ -143,7 +147,7 @@ // Trivial factory template <class P> -class SimpleFactoryBase : public StackIface<IPluginFactory> +class SimpleFactoryBase : public AutoIface<IPluginFactory, FB_PLUGIN_FACTORY_VERSION> { public: IPluginBase* FB_CARG createPlugin(IPluginConfig* factoryParameter) @@ -160,40 +164,68 @@ }; +// Base for interface type indpendent accessors +template <typename C> +class AccessAutoInterface +{ +public: + AccessAutoInterface(C* aPtr) + : ptr(aPtr) + { } + + operator C*() + { + return ptr; + } + + C* operator->() + { + return ptr; + } + +private: + C* ptr; +}; + // Master interface access -class MasterInterfacePtr : public AutoPtr<IMaster, AutoDisposable> +class MasterInterfacePtr : public AccessAutoInterface<IMaster> { public: - MasterInterfacePtr() : AutoPtr<IMaster, AutoDisposable>(fb_get_master_interface()) + MasterInterfacePtr() + : AccessAutoInterface<IMaster>(fb_get_master_interface()) { } }; // Generic plugins interface access -class PluginManagerInterfacePtr : public AutoPtr<IPluginManager, AutoDisposable> +class PluginManagerInterfacePtr : public AccessAutoInterface<IPluginManager> { public: - PluginManagerInterfacePtr() : AutoPtr<IPluginManager, AutoDisposable>(fb_get_master_interface()->getPluginManager()) + PluginManagerInterfacePtr() + : AccessAutoInterface<IPluginManager>(MasterInterfacePtr()->getPluginManager()) { } - PluginManagerInterfacePtr(IMaster* master) : AutoPtr<IPluginManager, AutoDisposable>(master->getPluginManager()) + PluginManagerInterfacePtr(IMaster* master) + : AccessAutoInterface<IPluginManager>(master->getPluginManager()) { } }; // Control timer interface access -class TimerInterfacePtr : public AutoPtr<ITimerControl, AutoDisposable> +class TimerInterfacePtr : public AccessAutoInterface<ITimerControl> { public: - TimerInterfacePtr() : AutoPtr<ITimerControl, AutoDisposable>(fb_get_master_interface()->getTimerControl()) + TimerInterfacePtr() + : AccessAutoInterface<ITimerControl>(fb_get_master_interface()->getTimerControl()) { } }; // Distributed transactions coordinator access -class DtcInterfacePtr : public AutoPtr<IDtc, AutoDisposable> +class DtcInterfacePtr : public AccessAutoInterface<IDtc> { public: - DtcInterfacePtr() : AutoPtr<IDtc, AutoDisposable>(fb_get_master_interface()->getDtc()) + DtcInterfacePtr() + : AccessAutoInterface<IDtc>(fb_get_master_interface()->getDtc()) { } }; @@ -203,12 +235,8 @@ // when yvalve is starting fb_shutdown(). This causes almost unavoidable segfault. // To avoid it this class is added - it detects spontaneous (not by PluginManager) // module unload and notifies PluginManager about this said fact. -class DummyStorage +class UnloadDetectorHelper : public VersionedIface<IPluginModule, FB_PLUGIN_MODULE_VERSION> { -}; - -class UnloadDetectorHelper : public DisposeIface<IPluginModule, DummyStorage> -{ public: explicit UnloadDetectorHelper(MemoryPool&) : flagOsUnload(true) @@ -230,11 +258,6 @@ return !flagOsUnload; } - void FB_CARG dispose() - { - // delete this; -don't do that! - } - private: bool flagOsUnload; Modified: firebird/trunk/src/common/config/config.h =================================================================== --- firebird/trunk/src/common/config/config.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/config/config.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -351,7 +351,7 @@ }; // Implementation of interface to access master configuration file -class FirebirdConf : public Firebird::StdIface<Firebird::IFirebirdConf, FB_I_FIREBIRD_CONF_VERSION> +class FirebirdConf : public Firebird::RefCntIface<Firebird::IFirebirdConf, FB_FIREBIRD_CONF_VERSION> { public: FirebirdConf(Config* existingConfig) Modified: firebird/trunk/src/common/security.h =================================================================== --- firebird/trunk/src/common/security.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/common/security.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -30,7 +30,7 @@ namespace Auth { -class CharField : public Firebird::StackIface<ICharUserField> +class CharField : public Firebird::AutoIface<ICharUserField, FB_AUTH_CHAR_FIELD_VERSION> { public: CharField() @@ -88,7 +88,7 @@ Firebird::string value; }; -class IntField : public Firebird::StackIface<IIntUserField> +class IntField : public Firebird::AutoIface<IIntUserField, FB_AUTH_INT_FIELD_VERSION> { public: IntField() @@ -207,7 +207,7 @@ CharField database, dba, dbaPassword, role, trustedUser; }; -class StackUserData : public Firebird::StackIface<UserData> +class StackUserData : public Firebird::AutoIface<UserData, FB_AUTH_USER_VERSION> { }; Modified: firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp =================================================================== --- firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/gpre/boot/gpre_meta_boot.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -678,8 +678,9 @@ { public: // IMaster implementation (almost dummy, for boot build) - virtual void FB_CARG dispose() + virtual int FB_CARG getVersion() { + return FB_MASTER_VERSION; } virtual IStatus* FB_CARG getStatus() @@ -700,7 +701,7 @@ return NULL; } - virtual int FB_CARG upgradeInterface(IInterface* /*toUpgrade*/, int /*desiredVersion*/, + virtual int FB_CARG upgradeInterface(IVersioned* /*toUpgrade*/, int /*desiredVersion*/, void* /*missingFunctionClass*/) { fb_assert(false); Modified: firebird/trunk/src/include/FirebirdExternalApi.h =================================================================== --- firebird/trunk/src/include/FirebirdExternalApi.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/include/FirebirdExternalApi.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -152,7 +152,7 @@ }; -class IRoutineMetadata // : public IVersioned +class IRoutineMetadata : public IVersioned { public: virtual const char* FB_CARG getPackage(IStatus* status) const = 0; @@ -162,7 +162,7 @@ virtual const char* FB_CARG getTriggerTable(IStatus* status) const = 0; virtual ExternalTrigger::Type FB_CARG getTriggerType(IStatus* status) const = 0; }; -// #define FB_I_ROUTINE_METADATA_VERSION (FB_VERSIONED_VERSION + 6) +#define FB_ROUTINE_METADATA_VERSION (FB_VERSIONED_VERSION + 6) // In SuperServer, shared by all attachments to one database and disposed when last (non-external) Modified: firebird/trunk/src/include/FirebirdPluginApi.h =================================================================== --- firebird/trunk/src/include/FirebirdPluginApi.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/include/FirebirdPluginApi.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -70,7 +70,7 @@ namespace Firebird { // IPluginBase interface - base for master plugin interfaces (factories are registered for them) -class IPluginBase : public IInterface +class IPluginBase : public IRefCounted { public: // Additional (compared with Interface) functions getOwner() and setOwner() @@ -79,13 +79,13 @@ // after plugin itself, and therefore module is unloaded after release of last plugin from it. // Releasing owner from release() of plugin will unload module and after returning control // to missing code segfault is unavoidable. - virtual void FB_CARG setOwner(IInterface*) = 0; - virtual IInterface* FB_CARG getOwner() = 0; + virtual void FB_CARG setOwner(IRefCounted*) = 0; + virtual IRefCounted* FB_CARG getOwner() = 0; }; -#define FB_PLUGIN_VERSION (FB_INTERFACE_VERSION + 2) +#define FB_PLUGIN_VERSION (FB_REFCOUNTED_VERSION + 2) // IPluginSet - low level tool to access plugins according to parameter from firebird.conf -class IPluginSet : public IInterface +class IPluginSet : public IRefCounted { public: virtual const char* FB_CARG getName() const = 0; @@ -94,33 +94,33 @@ virtual void FB_CARG next() = 0; virtual void FB_CARG set(const char*) = 0; }; -#define FB_PLUGIN_SET_VERSION (FB_INTERFACE_VERSION + 5) +#define FB_PLUGIN_SET_VERSION (FB_REFCOUNTED_VERSION + 5) // Interfaces to work with configuration data class IConfig; // Entry in configuration file -class IConfigEntry : public IInterface +class IConfigEntry : public IRefCounted { public: virtual const char* FB_CARG getName() = 0; virtual const char* FB_CARG getValue() = 0; virtual IConfig* FB_CARG getSubConfig() = 0; }; -#define FB_I_CONFIG_PARAMETER_VERSION (FB_INTERFACE_VERSION + 3) +#define FB_CONFIG_PARAMETER_VERSION (FB_REFCOUNTED_VERSION + 3) // Generic form of access to configuration file - find specific entry in it -class IConfig : public IInterface +class IConfig : public IRefCounted { public: virtual IConfigEntry* FB_CARG find(const char* name) = 0; virtual IConfigEntry* FB_CARG findValue(const char* name, const char* value) = 0; virtual IConfigEntry* FB_CARG findPos(const char* name, unsigned int pos) = 0; }; -#define FB_I_CONFIG_VERSION (FB_INTERFACE_VERSION + 3) +#define FB_CONFIG_VERSION (FB_REFCOUNTED_VERSION + 3) // Used to access config values from firebird.conf (may be DB specific) -class IFirebirdConf : public IInterface +class IFirebirdConf : public IRefCounted { public: // Get integer key by it's name @@ -132,37 +132,40 @@ // Use to access string values virtual const char* FB_CARG asString(unsigned int key) = 0; }; -#define FB_I_FIREBIRD_CONF_VERSION (FB_INTERFACE_VERSION + 3) +#define FB_FIREBIRD_CONF_VERSION (FB_REFCOUNTED_VERSION + 3) // This interface is passed to plugin's factory as it's single parameter // and contains methods to access specific plugin's configuration data -class IPluginConfig : public IInterface +class IPluginConfig : public IRefCounted { public: virtual const char* FB_CARG getConfigFileName() = 0; virtual IConfig* FB_CARG getDefaultConfig() = 0; virtual IFirebirdConf* FB_CARG getFirebirdConf() = 0; }; -#define FB_FACTORY_PARAMETER_VERSION (FB_INTERFACE_VERSION + 3) +#define FB_PLUGIN_CONFIG_VERSION (FB_REFCOUNTED_VERSION + 3) // Required to creat instances of given plugin -class IPluginFactory : public IDisposable +class IPluginFactory : public IVersioned { public: virtual IPluginBase* FB_CARG createPlugin(IPluginConfig* factoryParameter) = 0; }; +#define FB_PLUGIN_FACTORY_VERSION (FB_VERSIONED_VERSION + 1) // Required to let plugins manager invoke module's cleanup routine before unloading it. // For some OS/compiler this may be done in dtor of global variable in module itself. // Others (Windows/VC) fail to create some very useful resources (threads) when module is unloading. -class IPluginModule : public IDisposable +class IPluginModule : public IVersioned { public: virtual void FB_CARG doClean() = 0; }; +#define FB_PLUGIN_MODULE_VERSION (FB_VERSIONED_VERSION + 1) + // Interface to deal with plugins here and there, returned by master interface -class IPluginManager : public IDisposable +class IPluginManager : public IVersioned { public: // Main function called by plugin modules in firebird_plugin() @@ -192,7 +195,9 @@ // will cause resources leak virtual void FB_CARG releasePlugin(IPluginBase* plugin) = 0; }; +#define FB_PLUGIN_MANAGER_VERSION (FB_VERSIONED_VERSION + 6) + typedef void PluginEntrypoint(IMaster* masterInterface); namespace PluginType { Modified: firebird/trunk/src/include/Interface.h =================================================================== --- firebird/trunk/src/include/Interface.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/include/Interface.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -39,22 +39,33 @@ namespace Firebird { -// Regular interface - base for refCounted FB interfaces -class IInterface +// Versioned interface - base for all FB interfaces +class IVersioned { public: + virtual int FB_CARG getVersion() = 0; +}; +// If this is changed, types of all interfaces must be changed +#define FB_VERSIONED_VERSION 1 + +// Reference counted interface - base for refCounted FB interfaces +class IRefCounted : public IVersioned +{ +public: virtual void FB_CARG addRef() = 0; virtual int FB_CARG release() = 0; - virtual int FB_CARG getVersion() = 0; }; -#define FB_INTERFACE_VERSION 3 // If this is changed, types of all interfaces must be changed +// If this is changed, types of refCounted interfaces must be changed +#define FB_REFCOUNTED_VERSION (FB_VERSIONED_VERSION + 2) -// Disposable interface - base for static and onStack interfaces, may be used in regular case too +// Disposable interface - base for disposable FB interfaces class IDisposable { public: virtual void FB_CARG dispose() = 0; }; +// If this is changed, types of disposable interfaces must be changed +#define FB_DISPOSABLE_VERSION (FB_VERSIONED_VERSION + 1) // Interface to work with status vector // Created by master interface by request @@ -69,6 +80,7 @@ virtual const ISC_STATUS* FB_CARG get() const = 0; virtual int FB_CARG isSuccess() const = 0; }; +#define FB_STATUS_VERSION (FB_DISPOSABLE_VERSION + 5) class IProvider; class IPluginManager; @@ -78,22 +90,20 @@ class IDtc; // Master interface is used to access almost all other interfaces. -class IMaster : public IDisposable +class IMaster : public IVersioned { public: - // This interface can't be upgraded - therefore another form of version is used - const static unsigned int VERSION = 1; // To be changed each time any interface, passed - // by firebird to plugins is changed virtual IStatus* FB_CARG getStatus() = 0; virtual IProvider* FB_CARG getDispatcher() = 0; virtual IPluginManager* FB_CARG getPluginManager() = 0; - virtual int FB_CARG upgradeInterface(IInterface* toUpgrade, int desiredVersion, void* missingFunctionClass) = 0; + virtual int FB_CARG upgradeInterface(IVersioned* toUpgrade, int desiredVersion, void* missingFunctionClass) = 0; virtual const char* FB_CARG circularAlloc(const char* s, size_t len, intptr_t thr) = 0; virtual ITimerControl* FB_CARG getTimerControl() = 0; virtual IDtc* FB_CARG getDtc() = 0; virtual IAttachment* registerAttachment(IProvider* provider, IAttachment* attachment) = 0; virtual ITransaction* registerTransaction(IAttachment* attachment, ITransaction* transaction) = 0; }; +#define FB_MASTER_VERSION (FB_VERSIONED_VERSION + 6) } // namespace Firebird Modified: firebird/trunk/src/include/ProviderInterface.h =================================================================== --- firebird/trunk/src/include/ProviderInterface.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/include/ProviderInterface.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -46,11 +46,12 @@ unsigned int bufferLength; }; -class IEventCallback +class IEventCallback : public IVersioned { public: virtual void FB_CARG eventCallbackFunction(unsigned int length, const unsigned char* events) = 0; }; +#define FB_EVENT_CALLBACK_VERSION (FB_VERSIONED_VERSION + 1) /* class ShutdownCallback @@ -60,7 +61,7 @@ }; */ -class IBlob : public IInterface +class IBlob : public IRefCounted { public: virtual void FB_CARG getInfo(IStatus* status, @@ -74,9 +75,9 @@ virtual void FB_CARG close(IStatus* status) = 0; virtual int FB_CARG seek(IStatus* status, int mode, int offset) = 0; // returns position }; -#define FB_I_BLOB_VERSION (FB_INTERFACE_VERSION + 6) +#define FB_BLOB_VERSION (FB_REFCOUNTED_VERSION + 6) -class ITransaction : public IInterface +class ITransaction : public IRefCounted { public: virtual void FB_CARG getInfo(IStatus* status, @@ -93,9 +94,9 @@ virtual ITransaction* FB_CARG validate(IStatus* status, IAttachment* attachment) = 0; virtual ITransaction* FB_CARG enterDtc(IStatus* status) = 0; }; -#define FB_I_TRANSACTION_VERSION (FB_INTERFACE_VERSION + 10) +#define FB_TRANSACTION_VERSION (FB_REFCOUNTED_VERSION + 10) -class IParametersMetadata // : public IVersioned +class IParametersMetadata : public IVersioned { public: virtual unsigned FB_CARG getCount(IStatus* status) const = 0; @@ -109,9 +110,9 @@ virtual unsigned FB_CARG getLength(IStatus* status, unsigned index) const = 0; virtual unsigned FB_CARG getScale(IStatus* status, unsigned index) const = 0; }; -// #define FB_I_PARAMETERS_METADATA_VERSION (FB_VERSIONED_VERSION + 10) +#define FB_PARAMETERS_METADATA_VERSION (FB_VERSIONED_VERSION + 10) -class IStatement : public IInterface +class IStatement : public IRefCounted { public: // Prepare flags. @@ -146,9 +147,9 @@ virtual void FB_CARG insert(IStatus* status, const FbMessage* msgBuffer) = 0; virtual void FB_CARG free(IStatus* status, unsigned int option) = 0; }; -#define FB_I_STATEMENT_VERSION (FB_INTERFACE_VERSION + 12) +#define FB_STATEMENT_VERSION (FB_REFCOUNTED_VERSION + 12) -class IRequest : public IInterface +class IRequest : public IRefCounted { public: virtual void FB_CARG receive(IStatus* status, int level, unsigned int msgType, @@ -164,16 +165,16 @@ virtual void FB_CARG unwind(IStatus* status, int level) = 0; virtual void FB_CARG free(IStatus* status) = 0; }; -#define FB_I_REQUEST_VERSION (FB_INTERFACE_VERSION + 7) +#define FB_REQUEST_VERSION (FB_REFCOUNTED_VERSION + 7) -class IEvents : public IInterface +class IEvents : public IRefCounted { public: virtual void FB_CARG cancel(IStatus* status) = 0; }; -#define FB_I_EVENTS_VERSION (FB_INTERFACE_VERSION + 1) +#define FB_EVENTS_VERSION (FB_REFCOUNTED_VERSION + 1) -class IAttachment : public IInterface +class IAttachment : public IRefCounted { public: virtual void FB_CARG getInfo(IStatus* status, @@ -212,9 +213,9 @@ virtual void FB_CARG detach(IStatus* status) = 0; virtual void FB_CARG drop(IStatus* status) = 0; }; -#define FB_I_ATTACHMENT_VERSION (FB_INTERFACE_VERSION + 17) +#define FB_ATTACHMENT_VERSION (FB_REFCOUNTED_VERSION + 17) -class IService : public IInterface +class IService : public IRefCounted { public: virtual void FB_CARG detach(IStatus* status) = 0; @@ -225,7 +226,7 @@ virtual void FB_CARG start(IStatus* status, unsigned int spbLength, const unsigned char* spb) = 0; }; -#define FB_I_SERVICE_VERSION (FB_INTERFACE_VERSION + 3) +#define FB_SERVICE_VERSION (FB_REFCOUNTED_VERSION + 3) class IProvider : public IPluginBase { @@ -238,7 +239,7 @@ unsigned int spbLength, const unsigned char* spb) = 0; virtual void FB_CARG shutdown(IStatus* status, unsigned int timeout, const int reason) = 0; }; -#define FB_I_PROVIDER_VERSION (FB_PLUGIN_VERSION + 4) +#define FB_PROVIDER_VERSION (FB_PLUGIN_VERSION + 4) // DtcStart - structure to start transaction over >1 attachments (former TEB) struct DtcStart @@ -249,12 +250,13 @@ }; // Distributed transactions coordinator -class IDtc : public IDisposable +class IDtc : public IVersioned { public: virtual ITransaction* FB_CARG start(IStatus* status, unsigned int cnt, DtcStart* components) = 0; virtual ITransaction* FB_CARG join(IStatus* status, ITransaction* one, ITransaction* two) = 0; }; +#define FB_DTC_VERSION (FB_VERSIONED_VERSION + 2) } // namespace Firebird Modified: firebird/trunk/src/include/Timer.h =================================================================== --- firebird/trunk/src/include/Timer.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/include/Timer.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -35,17 +35,17 @@ // Identifies particular timer. // Callback function is invoked when timer fires. -class ITimer : public IInterface +class ITimer : public IRefCounted { public: virtual void FB_CARG handler() = 0; }; -#define FB_I_TIMER_VERSION (FB_INTERFACE_VERSION + 1) +#define FB_TIMER_VERSION (FB_REFCOUNTED_VERSION + 1) typedef ISC_INT64 TimerDelay; // Interface to set timer for particular time -class ITimerControl : public IDisposable +class ITimerControl : public IVersioned { public: // Set timer @@ -53,6 +53,7 @@ // Stop timer virtual void FB_CARG stop(ITimer* timer) = 0; }; +#define FB_TIMER_CONTROL_VERSION (FB_VERSIONED_VERSION + 2) } // namespace Firebird Modified: firebird/trunk/src/jrd/EngineInterface.h =================================================================== --- firebird/trunk/src/jrd/EngineInterface.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/EngineInterface.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -42,7 +42,7 @@ class JAttachment; class JProvider; -class JBlob : public Firebird::StdIface<Firebird::IBlob, FB_I_BLOB_VERSION> +class JBlob : public Firebird::RefCntIface<Firebird::IBlob, FB_BLOB_VERSION> { public: // IBlob implementation @@ -79,7 +79,7 @@ void freeEngineData(Firebird::IStatus* status); }; -class JTransaction : public Firebird::StdIface<Firebird::ITransaction, FB_I_TRANSACTION_VERSION> +class JTransaction : public Firebird::RefCntIface<Firebird::ITransaction, FB_TRANSACTION_VERSION> { public: // ITransaction implementation @@ -137,7 +137,7 @@ void freeEngineData(Firebird::IStatus* status); }; -class JStatement : public Firebird::StdIface<Firebird::IStatement, FB_I_STATEMENT_VERSION> +class JStatement : public Firebird::RefCntIface<Firebird::IStatement, FB_STATEMENT_VERSION> { public: // IStatement implementation @@ -185,7 +185,7 @@ void freeEngineData(Firebird::IStatus* status, unsigned int option); }; -class JRequest : public Firebird::StdIface<Firebird::IRequest, FB_I_REQUEST_VERSION> +class JRequest : public Firebird::RefCntIface<Firebird::IRequest, FB_REQUEST_VERSION> { public: // IRequest implementation @@ -226,7 +226,7 @@ void freeEngineData(Firebird::IStatus* status); }; -class JEvents : public Firebird::StdIface<Firebird::IEvents, FB_I_EVENTS_VERSION> +class JEvents : public Firebird::RefCntIface<Firebird::IEvents, FB_EVENTS_VERSION> { public: // IEvents implementation @@ -256,7 +256,7 @@ void freeEngineData(Firebird::IStatus* status); }; -class JAttachment : public Firebird::StdIface<Firebird::IAttachment, FB_I_ATTACHMENT_VERSION> +class JAttachment : public Firebird::RefCntIface<Firebird::IAttachment, FB_ATTACHMENT_VERSION> { public: // IAttachment implementation @@ -334,7 +334,7 @@ void freeEngineData(Firebird::IStatus* status); }; -class JService : public Firebird::StdIface<Firebird::IService, FB_I_SERVICE_VERSION> +class JService : public Firebird::RefCntIface<Firebird::IService, FB_SERVICE_VERSION> { public: // IService implementation @@ -356,7 +356,7 @@ void freeEngineData(Firebird::IStatus* status); }; -class JProvider : public Firebird::StdPlugin<Firebird::IProvider, FB_I_PROVIDER_VERSION> +class JProvider : public Firebird::StdPlugin<Firebird::IProvider, FB_PROVIDER_VERSION> { public: explicit JProvider(Firebird::IPluginConfig*) Modified: firebird/trunk/src/jrd/ExtEngineManager.h =================================================================== --- firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/ExtEngineManager.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -33,6 +33,7 @@ #include "../common/classes/NestConst.h" #include "../common/classes/auto.h" #include "../common/classes/rwlock.h" +#include "../common/classes/ImplementHelper.h" ///#include "../dsql/Nodes.h" struct dsc; @@ -61,7 +62,8 @@ template <typename T> class ContextManager; class TransactionImpl; - class RoutineMetadata : public Firebird::IRoutineMetadata, public Firebird::PermanentStorage + class RoutineMetadata : public Firebird::VersionedIface<Firebird::IRoutineMetadata, FB_ROUTINE_METADATA_VERSION>, + public Firebird::PermanentStorage { public: RoutineMetadata(MemoryPool& pool) Modified: firebird/trunk/src/jrd/UserManagement.cpp =================================================================== --- firebird/trunk/src/jrd/UserManagement.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/UserManagement.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -71,7 +71,7 @@ fb_assert(manager); manager->addRef(); - class UserIdInfo : public StackIface<Auth::ILogonInfo> + class UserIdInfo : public AutoIface<Auth::ILogonInfo, FB_AUTH_LOGON_INFO_VERSION> { public: explicit UserIdInfo(const Attachment* pAtt) Modified: firebird/trunk/src/jrd/UserManagement.h =================================================================== --- firebird/trunk/src/jrd/UserManagement.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/UserManagement.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -54,7 +54,7 @@ class UserManagement : public DataDump { public: - class Display : public Firebird::StackIface<Auth::IListUsers> + class Display : public Firebird::AutoIface<Auth::IListUsers, FB_AUTH_LIST_USERS_VERSION> { public: explicit Display(UserManagement* um) Modified: firebird/trunk/src/jrd/dyn.epp =================================================================== --- firebird/trunk/src/jrd/dyn.epp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/dyn.epp 2011-05-19 16:24:46 UTC (rev 52968) @@ -1969,16 +1969,24 @@ ISC_STATUS_ARRAY status; try { - class DisposeableUserData : public Firebird::DisposeIface<Auth::UserData, pool_alloc<type_user_data> > + class DynamicUserData : public Firebird::VersionedIface<Auth::UserData, FB_AUTH_USER_VERSION> { public: - void FB_CARG dispose() + +#ifdef DEBUG_GDS_ALLOC + void* operator new(size_t size, Firebird::MemoryPool& pool, const char* fileName, int line) { - delete this; + return pool.allocate(size, fileName, line); } +#else // DEBUG_GDS_ALLOC + void* operator new(size_t size, Firebird::MemoryPool& pool) + { + return pool.allocate(size); + } +#endif // DEBUG_GDS_ALLOC }; - DisposeableUserData* userData = FB_NEW(*tra->tra_pool) DisposeableUserData; + DynamicUserData* userData = FB_NEW(*tra->tra_pool) DynamicUserData; UCHAR verb; while ((verb = *(*ptr)++) != isc_user_end) { Modified: firebird/trunk/src/jrd/jrd.cpp =================================================================== --- firebird/trunk/src/jrd/jrd.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/jrd.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -315,7 +315,7 @@ static GlobalPtr<ShutdownBeforeUnload, InstanceControl::PRIORITY_DETECT_UNLOAD> shutdownBeforeUnload; -class EngineFactory : public StackIface<IPluginFactory> +class EngineFactory : public AutoIface<IPluginFactory, FB_PLUGIN_FACTORY_VERSION> { public: // IPluginFactory implementation @@ -745,7 +745,7 @@ /// trace manager support -class TraceFailedConnection : public StackIface<TraceConnection> +class TraceFailedConnection : public AutoIface<TraceConnection, FB_TRACE_CONNECTION_VERSION> { public: TraceFailedConnection(const char* filename, const DatabaseOptions* options); Modified: firebird/trunk/src/jrd/ntrace.h =================================================================== --- firebird/trunk/src/jrd/ntrace.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/ntrace.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -37,7 +37,7 @@ struct PerformanceInfo; -class TraceConnection : public Firebird::IDisposable +class TraceConnection : public Firebird::IVersioned { public: virtual int FB_CARG getConnectionID() = 0; @@ -52,6 +52,7 @@ virtual int FB_CARG getRemoteProcessID() = 0; virtual const char* FB_CARG getRemoteProcessName() = 0; }; +#define FB_TRACE_CONNECTION_VERSION (FB_VERSIONED_VERSION + 10) enum ntrace_tra_isolation_t { @@ -61,7 +62,7 @@ tra_iso_read_committed_norecver }; -class TraceTransaction : public Firebird::IDisposable +class TraceTransaction : public Firebird::IVersioned { public: virtual int FB_CARG getTransactionID() = 0; @@ -70,22 +71,25 @@ virtual ntrace_tra_isolation_t FB_CARG getIsolation() = 0; virtual PerformanceInfo* FB_CARG getPerf() = 0; }; +#define FB_TRACE_TRANSACTION_VERSION (FB_VERSIONED_VERSION + 5) typedef int ntrace_relation_t; -class TraceParams : public Firebird::IDisposable +class TraceParams : public Firebird::IVersioned { public: virtual size_t FB_CARG getCount() = 0; virtual const struct dsc* FB_CARG getParam(size_t idx) = 0; }; +#define FB_TRACE_PARAMS_VERSION (FB_VERSIONED_VERSION + 2) -class TraceStatement : public Firebird::IDisposable +class TraceStatement : public Firebird::IVersioned { public: virtual int FB_CARG getStmtID() = 0; virtual PerformanceInfo* FB_CARG getPerf() = 0; }; +#define FB_TRACE_STATEMENT_VERSION (FB_VERSIONED_VERSION + 2) class TraceSQLStatement : public TraceStatement { @@ -95,6 +99,7 @@ virtual TraceParams* FB_CARG getInputs() = 0; virtual const char* FB_CARG getTextUTF8() = 0; }; +#define FB_TRACE_SQL_STATEMENT_VERSION (FB_TRACE_STATEMENT_VERSION + 4) class TraceBLRStatement : public TraceStatement { @@ -103,32 +108,36 @@ virtual size_t FB_CARG getDataLength() = 0; virtual const char* FB_CARG getText() = 0; }; +#define FB_TRACE_BLR_STATEMENT_VERSION (FB_TRACE_STATEMENT_VERSION + 3) -class TraceDYNRequest : public Firebird::IDisposable +class TraceDYNRequest : public Firebird::IVersioned { public: virtual const unsigned char* FB_CARG getData() = 0; virtual size_t FB_CARG getDataLength() = 0; virtual const char* FB_CARG getText() = 0; }; +#define FB_TRACE_DYN_REQUEST_VERSION (FB_VERSIONED_VERSION + 3) -class TraceContextVariable : public Firebird::IDisposable +class TraceContextVariable : public Firebird::IVersioned { public: virtual const char* FB_CARG getNameSpace() = 0; virtual const char* FB_CARG getVarName() = 0; virtual const char* FB_CARG getVarValue() = 0; }; +#define FB_TRACE_CONTEXT_VARIABLE_VERSION (FB_VERSIONED_VERSION + 3) -class TraceProcedure : public Firebird::IDisposable +class TraceProcedure : public Firebird::IVersioned { public: virtual const char* FB_CARG getProcName() = 0; virtual TraceParams* FB_CARG getInputs() = 0; virtual PerformanceInfo* FB_CARG getPerf() = 0; }; +#define FB_TRACE_PROCEDURE_VERSION (FB_VERSIONED_VERSION + 3) -class TraceTrigger : public Firebird::IDisposable +class TraceTrigger : public Firebird::IVersioned { public: virtual const char* FB_CARG getTriggerName() = 0; @@ -137,10 +146,11 @@ virtual int FB_CARG getWhich() = 0; virtual PerformanceInfo* FB_CARG getPerf() = 0; }; +#define FB_TRACE_TRIGGER_VERSION (FB_VERSIONED_VERSION + 5) typedef void* ntrace_service_t; -class TraceService : public Firebird::IDisposable +class TraceService : public Firebird::IVersioned { public: virtual ntrace_service_t FB_CARG getServiceID() = 0; @@ -155,6 +165,7 @@ virtual int FB_CARG getRemoteProcessID() = 0; virtual const char* FB_CARG getRemoteProcessName() = 0; }; +#define FB_TRACE_SERVICE_VERSION (FB_VERSIONED_VERSION + 10) // Plugin-specific argument. Passed by the engine to each hook @@ -221,14 +232,14 @@ ntrace_counter_t pin_records_fetched; // records fetched from statement/procedure }; -class TraceLogWriter : public Firebird::IInterface +class TraceLogWriter : public Firebird::IRefCounted { public: virtual size_t FB_CARG write(const void* buf, size_t size) = 0; }; -#define FB_TRACE_LOG_WRITER_VERSION (FB_INTERFACE_VERSION + 1) +#define FB_TRACE_LOG_WRITER_VERSION (FB_REFCOUNTED_VERSION + 1) -class TraceInitInfo : public Firebird::IDisposable +class TraceInitInfo : public Firebird::IVersioned { public: virtual const char* FB_CARG getConfigText() = 0; @@ -239,10 +250,11 @@ virtual TraceConnection* FB_CARG getConnection() = 0; virtual TraceLogWriter* FB_CARG getLogWriter() = 0; }; +#define FB_TRACE_INIT_INFO_VERSION (FB_VERSIONED_VERSION + 7) // API of trace plugin. Used to deliver notifications for each database -class TracePlugin : public Firebird::IInterface +class TracePlugin : public Firebird::IRefCounted { public: // Function to return error string for hook failure @@ -295,7 +307,7 @@ const ntrace_byte_t* recv_items, ntrace_result_t query_result) = 0; virtual int FB_CARG trace_service_detach(TraceService* service, ntrace_result_t detach_result) = 0; }; -#define FB_TRACE_PLUGIN_VERSION (FB_INTERFACE_VERSION + 18) +#define FB_TRACE_PLUGIN_VERSION (FB_REFCOUNTED_VERSION + 18) // Trace plugin second level factory (this is what is known to PluginManager as "trace plugin") class TraceFactory : public Firebird::IPluginBase Modified: firebird/trunk/src/jrd/trace/TraceConfigStorage.h =================================================================== --- firebird/trunk/src/jrd/trace/TraceConfigStorage.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/trace/TraceConfigStorage.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -70,7 +70,7 @@ void checkFile(); void touchFile(); - class TouchFile : public Firebird::StdIface<Firebird::ITimer, FB_I_TIMER_VERSION> + class TouchFile : public Firebird::RefCntIface<Firebird::ITimer, FB_TIMER_VERSION> { public: void FB_CARG handler(); Modified: firebird/trunk/src/jrd/trace/TraceObjects.cpp =================================================================== --- firebird/trunk/src/jrd/trace/TraceObjects.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/trace/TraceObjects.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -427,7 +427,7 @@ /// TraceLogWriterImpl -class TraceLogWriterImpl : public StdIface<TraceLogWriter, FB_TRACE_LOG_WRITER_VERSION> +class TraceLogWriterImpl : public RefCntIface<TraceLogWriter, FB_TRACE_LOG_WRITER_VERSION> { public: TraceLogWriterImpl(const TraceSession& session) : Modified: firebird/trunk/src/jrd/trace/TraceObjects.h =================================================================== --- firebird/trunk/src/jrd/trace/TraceObjects.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/jrd/trace/TraceObjects.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -49,7 +49,7 @@ class Attachment; class jrd_tra; -class TraceConnectionImpl : public Firebird::StackIface<TraceConnection> +class TraceConnectionImpl : public Firebird::AutoIface<TraceConnection, FB_TRACE_CONNECTION_VERSION> { public: TraceConnectionImpl(const Attachment* att) : @@ -73,7 +73,7 @@ }; -class TraceTransactionImpl : public Firebird::StackIface<TraceTransaction> +class TraceTransactionImpl : public Firebird::AutoIface<TraceTransaction, FB_TRACE_TRANSACTION_VERSION> { public: TraceTransactionImpl(const jrd_tra* tran, PerformanceInfo* perf = NULL) : @@ -94,7 +94,7 @@ }; -class BLRPrinter : public Firebird::StackIface<TraceBLRStatement> +class BLRPrinter : public Firebird::AutoIface<TraceBLRStatement, FB_TRACE_BLR_STATEMENT_VERSION> { public: BLRPrinter(const unsigned char* blr, size_t length) : @@ -147,7 +147,7 @@ }; -class TraceSQLStatementImpl : public Firebird::StackIface<TraceSQLStatement> +class TraceSQLStatementImpl : public Firebird::AutoIface<TraceSQLStatement, FB_TRACE_SQL_STATEMENT_VERSION> { public: TraceSQLStatementImpl(const dsql_req* stmt, PerformanceInfo* perf) : @@ -166,7 +166,7 @@ virtual const char* FB_CARG getTextUTF8(); private: - class DSQLParamsImpl : public Firebird::StackIface<TraceParams> + class DSQLParamsImpl : public Firebird::AutoIface<TraceParams, FB_TRACE_PARAMS_VERSION> { public: DSQLParamsImpl(Firebird::MemoryPool& pool, const Firebird::Array<dsql_par*>* params) : @@ -192,7 +192,7 @@ }; -class TraceFailedSQLStatement : public Firebird::StackIface<TraceSQLStatement> +class TraceFailedSQLStatement : public Firebird::AutoIface<TraceSQLStatement, FB_TRACE_SQL_STATEMENT_VERSION> { public: TraceFailedSQLStatement(Firebird::string& text) : @@ -213,7 +213,7 @@ }; -class TraceContextVarImpl : public Firebird::StackIface<TraceContextVariable> +class TraceContextVarImpl : public Firebird::AutoIface<TraceContextVariable, FB_TRACE_CONTEXT_VARIABLE_VERSION> { public: TraceContextVarImpl(const char* ns, const char* name, const char* value) : @@ -233,7 +233,7 @@ const char* const m_value; }; -class TraceProcedureImpl : public Firebird::StackIface<TraceProcedure> +class TraceProcedureImpl : public Firebird::AutoIface<TraceProcedure, FB_TRACE_PROCEDURE_VERSION> { public: TraceProcedureImpl(jrd_req* request, PerformanceInfo* perf) : @@ -252,7 +252,7 @@ virtual PerformanceInfo* FB_CARG getPerf() { return m_perf; }; private: - class JrdParamsImpl : public Firebird::StackIface<TraceParams> + class JrdParamsImpl : public Firebird::AutoIface<TraceParams, FB_TRACE_PARAMS_VERSION> { public: JrdParamsImpl(Firebird::MemoryPool& pool, jrd_req* request, const ValueListNode* params) : @@ -278,7 +278,7 @@ }; -class TraceTriggerImpl : public Firebird::StackIface<TraceTrigger> +class TraceTriggerImpl : public Firebird::AutoIface<TraceTrigger, FB_TRACE_TRIGGER_VERSION> { public: TraceTriggerImpl(const jrd_req* trig, SSHORT which, PerformanceInfo* perf) : @@ -301,7 +301,7 @@ }; -class TraceServiceImpl : public Firebird::StackIface<TraceService> +class TraceServiceImpl : public Firebird::AutoIface<TraceService, FB_TRACE_SERVICE_VERSION> { public: TraceServiceImpl(const Service* svc) : @@ -340,7 +340,7 @@ }; -class TraceInitInfoImpl : public Firebird::StackIface<TraceInitInfo> +class TraceInitInfoImpl : public Firebird::AutoIface<TraceInitInfo, FB_TRACE_INIT_INFO_VERSION> { public: TraceInitInfoImpl(const Firebird::TraceSession& session, const Attachment* att, Modified: firebird/trunk/src/remote/client/interface.cpp =================================================================== --- firebird/trunk/src/remote/client/interface.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/remote/client/interface.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -132,7 +132,7 @@ class Attachment; -class Blob : public Firebird::StdIface<Firebird::IBlob, FB_I_BLOB_VERSION> +class Blob : public Firebird::RefCntIface<Firebird::IBlob, FB_BLOB_VERSION> { public: // IBlob implementation @@ -173,7 +173,7 @@ return 0; } -class Transaction : public Firebird::StdIface<Firebird::ITransaction, FB_I_TRANSACTION_VERSION> +class Transaction : public Firebird::RefCntIface<Firebird::ITransaction, FB_TRANSACTION_VERSION> { public: // ITransaction implementation @@ -235,7 +235,7 @@ return 0; } -class Statement : public Firebird::StdIface<Firebird::IStatement, FB_I_STATEMENT_VERSION> +class Statement : public Firebird::RefCntIface<Firebird::IStatement, FB_STATEMENT_VERSION> { public: // IStatement implementation @@ -289,7 +289,7 @@ return 0; } -class Request : public Firebird::StdIface<Firebird::IRequest, FB_I_REQUEST_VERSION> +class Request : public Firebird::RefCntIface<Firebird::IRequest, FB_REQUEST_VERSION> { public: // IRequest implementation @@ -333,7 +333,7 @@ return 0; } -class Events : public Firebird::StdIface<Firebird::IEvents, FB_I_EVENTS_VERSION> +class Events : public Firebird::RefCntIface<Firebird::IEvents, FB_EVENTS_VERSION> { public: // IEvents implementation @@ -363,7 +363,7 @@ return 0; } -class Attachment : public Firebird::StdIface<Firebird::IAttachment, FB_I_ATTACHMENT_VERSION> +class Attachment : public Firebird::RefCntIface<Firebird::IAttachment, FB_ATTACHMENT_VERSION> { public: // IAttachment implementation @@ -446,7 +446,7 @@ return 0; } -class Service : public Firebird::StdIface<Firebird::IService, FB_I_SERVICE_VERSION> +class Service : public Firebird::RefCntIface<Firebird::IService, FB_SERVICE_VERSION> { public: // IService implementation @@ -482,7 +482,7 @@ return 0; } -class Provider : public Firebird::StdPlugin<Firebird::IProvider, FB_I_PROVIDER_VERSION> +class Provider : public Firebird::StdPlugin<Firebird::IProvider, FB_PROVIDER_VERSION> { public: explicit Provider(IPluginConfig*) Modified: firebird/trunk/src/utilities/gsec/gsec.cpp =================================================================== --- firebird/trunk/src/utilities/gsec/gsec.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/utilities/gsec/gsec.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -252,7 +252,7 @@ fb_assert(user_data->trustedUser.entered()); if (user_data->trustedUser.entered()) { - class GsecInfo : public Firebird::StackIface<Auth::ILogonInfo> + class GsecInfo : public Firebird::AutoIface<Auth::ILogonInfo, FB_AUTH_LOGON_INFO_VERSION> { public: GsecInfo(const char* pTrustedUser, const char* pRole, int pTrustedRole, @@ -335,7 +335,7 @@ } } - class Display : public Firebird::StackIface<Auth::IListUsers> + class Display : public Firebird::AutoIface<Auth::IListUsers, FB_AUTH_LIST_USERS_VERSION> { public: explicit Display(tsec* t) Modified: firebird/trunk/src/utilities/ntrace/PluginLogWriter.h =================================================================== --- firebird/trunk/src/utilities/ntrace/PluginLogWriter.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/utilities/ntrace/PluginLogWriter.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -47,7 +47,7 @@ #include <sys/stat.h> -class PluginLogWriter : public Firebird::StdIface<TraceLogWriter, FB_TRACE_LOG_WRITER_VERSION> +class PluginLogWriter : public Firebird::RefCntIface<TraceLogWriter, FB_TRACE_LOG_WRITER_VERSION> { public: PluginLogWriter(const char* fileName, size_t maxSize); Modified: firebird/trunk/src/utilities/ntrace/TracePluginImpl.h =================================================================== --- firebird/trunk/src/utilities/ntrace/TracePluginImpl.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/utilities/ntrace/TracePluginImpl.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -44,7 +44,7 @@ // Bring in off_t #include <sys/types.h> -class TracePluginImpl : public Firebird::StdIface<TracePlugin, FB_TRACE_PLUGIN_VERSION> +class TracePluginImpl : public Firebird::RefCntIface<TracePlugin, FB_TRACE_PLUGIN_VERSION> { public: // Serialize exception to TLS buffer to return it to user Modified: firebird/trunk/src/yvalve/DistributedTransaction.cpp =================================================================== --- firebird/trunk/src/yvalve/DistributedTransaction.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/yvalve/DistributedTransaction.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -43,7 +43,7 @@ namespace { -class DTransaction : public StdIface<ITransaction, FB_I_TRANSACTION_VERSION> +class DTransaction : public RefCntIface<ITransaction, FB_TRANSACTION_VERSION> { public: DTransaction() @@ -178,7 +178,7 @@ return true; } -class Dtc : public StackIface<IDtc> +class Dtc : public AutoIface<IDtc, FB_DTC_VERSION> { public: // IDtc implementation Modified: firebird/trunk/src/yvalve/MasterImplementation.cpp =================================================================== --- firebird/trunk/src/yvalve/MasterImplementation.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/yvalve/MasterImplementation.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -51,7 +51,7 @@ // getStatus() // -class UserStatus : public Firebird::DisposeIface<Firebird::BaseStatus> +class UserStatus : public Firebird::DisposeIface<Firebird::BaseStatus, FB_STATUS_VERSION> { private: // IStatus implementation @@ -106,7 +106,7 @@ GlobalPtr<RWLock> mapLock; } -int FB_CARG MasterImplementation::upgradeInterface(IInterface* toUpgrade, +int FB_CARG MasterImplementation::upgradeInterface(IVersioned* toUpgrade, int desiredVersion, void* missingFunctionClass) { @@ -466,7 +466,7 @@ } // namespace -class TimerImplementation : public StackIface<ITimerControl> +class TimerImplementation : public AutoIface<ITimerControl, FB_TIMER_CONTROL_VERSION> { public: // ITimerControl implementation Modified: firebird/trunk/src/yvalve/MasterImplementation.h =================================================================== --- firebird/trunk/src/yvalve/MasterImplementation.h 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/yvalve/MasterImplementation.h 2011-05-19 16:24:46 UTC (rev 52968) @@ -37,14 +37,14 @@ { extern Firebird::IProvider* dispatcherPtr; - class MasterImplementation : public Firebird::StackIface<Firebird::IMaster> + class MasterImplementation : public Firebird::AutoIface<Firebird::IMaster, FB_MASTER_VERSION> { public: // IMaster implementation Firebird::IStatus* FB_CARG getStatus(); Firebird::IProvider* FB_CARG getDispatcher(); Firebird::IPluginManager* FB_CARG getPluginManager(); - int FB_CARG upgradeInterface(Firebird::IInterface* toUpgrade, int desiredVersion, void* missingFunctionClass); + int FB_CARG upgradeInterface(Firebird::IVersioned* toUpgrade, int desiredVersion, void* missingFunctionClass); const char* FB_CARG circularAlloc(const char* s, size_t len, intptr_t thr); Firebird::ITimerControl* FB_CARG getTimerControl(); Firebird::IAttachment* registerAttachment(Firebird::IProvider* provider, Modified: firebird/trunk/src/yvalve/PluginManager.cpp =================================================================== --- firebird/trunk/src/yvalve/PluginManager.cpp 2011-05-19 11:38:38 UTC (rev 52967) +++ firebird/trunk/src/yvalve/PluginManager.cpp 2011-05-19 16:24:46 UTC (rev 52968) @@ -126,10 +126,10 @@ bool flShutdown = false; - class ConfigParameterAccess : public StdIface<IConfigEntry, FB_I_CONFIG_PARAMETER_VERSION> + class ConfigParameterAccess : public RefCntIface<IConfigEntry, FB_CONFIG_PARAMETER_VERSION> { public: - ConfigParameterAccess(IInterface* c, const ConfigFile::Parameter* p) : cf(c), par(p) { } + ConfigParameterAccess(IRefCounted* c, const ConfigFile::Parameter* p) : cf(c), par(p) { } // IConfigEntry implementation const char* FB_CARG getName() @@ -156,11 +156,11 @@ } private: - RefPtr<IInterface> cf; + RefPtr<IRefCounted> cf; const ConfigFile::Parameter* par; }; - class ConfigAccess : public StdIface<IConfig, FB_I_CONFIG_VERSION> + class ConfigAccess : public RefCntIface<IConfig, FB_CONFIG_VERSION> { public: ConfigAccess(RefPtr<ConfigFile> c) : confFile(c) { } @@ -338,11 +338,6 @@ } *prev = next; - for (unsigned int i = 0; i < regPlugins.getCount(); ++i) - { - regPlugins[i].factory->dispose(); - } - if (cleanup) { cleanup->doClean(); @@ -453,7 +448,7 @@ }; // Delays destruction of ConfiguredPlugin instance - class PluginDestroyTimer : public Firebird::StdIface<Firebird::ITimer, FB_I_TIMER_VERSION> + class PluginDestroyTimer : public RefCntIface<ITimer, FB_TIMER_VERSION> { public: PluginDestroyTimer(ConfiguredPlugin* cp) @@ -480,7 +475,7 @@ }; // Provides per-database configuration from aliases.conf. - class FactoryParameter : public StdIface<IPluginConfig, FB_FACTORY_PARAMETER_VERSION> + class FactoryParameter : public RefCntIface<IPluginConfig, FB_PLUGIN_CONFIG_VERSION> { public: FactoryParameter(ConfiguredPlugin* cp, IFirebirdConf* fc) @@ -633,7 +628,7 @@ } // Provides access to plugins of given type / name. - class PluginSet : public StdI... [truncated message content] |
From: <fir...@us...> - 2011-05-20 03:18:18
|
Revision: 52971 http://firebird.svn.sourceforge.net/firebird/?rev=52971&view=rev Author: firebirds Date: 2011-05-20 03:18:11 +0000 (Fri, 20 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-19 17:09:44 UTC (rev 52970) +++ firebird/trunk/ChangeLog 2011-05-20 03:18:11 UTC (rev 52971) @@ -1,3 +1,80 @@ + 2011-05-19 17:09 alexpeshkoff + M src/gpre/languages/rmc.cpp +warnings + + 2011-05-19 16:24 alexpeshkoff + M examples/udr/UdrCppExample.cpp + M src/auth/AuthInterface.h + M src/auth/SecurityDatabase/LegacyServer.cpp + M src/common/Auth.cpp + M src/common/Auth.h + M src/common/StatementMetadata.h + M src/common/StatusHolder.h + M src/common/classes/GetPlugins.h + M src/common/classes/ImplementHelper.h + M src/common/config/config.h + M src/common/security.h + M src/gpre/boot/gpre_meta_boot.cpp + M src/include/FirebirdExternalApi.h + M src/include/FirebirdPluginApi.h + M src/include/Interface.h + M src/include/ProviderInterface.h + M src/include/Timer.h + M src/jrd/EngineInterface.h + M src/jrd/ExtEngineManager.h + M src/jrd/UserManagement.cpp + M src/jrd/UserManagement.h + M src/jrd/dyn.epp + M src/jrd/jrd.cpp + M src/jrd/ntrace.h + M src/jrd/trace/TraceConfigStorage.h + M src/jrd/trace/TraceObjects.cpp + M src/jrd/trace/TraceObjects.h + M src/remote/client/interface.cpp + M src/utilities/gsec/gsec.cpp + M src/utilities/ntrace/PluginLogWriter.h + M src/utilities/ntrace/TracePluginImpl.h + M src/yvalve/DistributedTransaction.cpp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h + M src/yvalve/PluginManager.cpp + M src/yvalve/PluginManager.h + M src/yvalve/why.cpp +Better interfaces hierarchy: all of them are derived from IVersioned + + 2011-05-19 11:38 alexpeshkoff + M src/alice/alice_meta.epp + M src/alice/tdr.cpp + M src/common/classes/ImplementHelper.h + M src/common/classes/array.h + M src/common/utils.cpp + M src/common/utils_proto.h + M src/gpre/boot/gpre_meta_boot.cpp + M src/include/Interface.h + M src/include/ProviderInterface.h + M src/jrd/EngineInterface.h + M src/jrd/inf.cpp + M src/jrd/inf_pub.h + M src/jrd/jrd.cpp + M src/remote/client/interface.cpp + M src/remote/server/server.cpp + A src/yvalve/DistributedTransaction.cpp + M src/yvalve/MasterImplementation.h + M src/yvalve/why.cpp +Interface for 2PC (distributed transactions coordinator) + + 2011-05-19 11:12 mapopa + M src/common/common.h +cleanup comment EKU: obsolete, replaced by _FILE_OFFSET_BITS + + 2011-05-19 09:46 mapopa + M src/jrd/inf_pub.h +header cleanup , unused defines anywhere (long dead platforms) + + 2011-05-19 09:44 mapopa + M src/jrd/ibase.h +Disabled, not found anywhere function (commented anyway) + 2011-05-15 15:37 asfernandes M src/jrd/os/posix/unix.cpp M src/utilities/fbcpl/fbpanel.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-19 17:09:44 UTC (rev 52970) +++ firebird/trunk/src/jrd/build_no.h 2011-05-20 03:18:11 UTC (rev 52971) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29364 + FORMAL BUILD NUMBER:29370 */ -#define PRODUCT_VER_STRING "3.0.0.29364" -#define FILE_VER_STRING "WI-T3.0.0.29364" -#define LICENSE_VER_STRING "WI-T3.0.0.29364" -#define FILE_VER_NUMBER 3, 0, 0, 29364 +#define PRODUCT_VER_STRING "3.0.0.29370" +#define FILE_VER_STRING "WI-T3.0.0.29370" +#define LICENSE_VER_STRING "WI-T3.0.0.29370" +#define FILE_VER_NUMBER 3, 0, 0, 29370 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29364" +#define FB_BUILD_NO "29370" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-19 17:09:44 UTC (rev 52970) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-20 03:18:11 UTC (rev 52971) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29364 +BuildNum=29370 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-21 03:18:47
|
Revision: 52980 http://firebird.svn.sourceforge.net/firebird/?rev=52980&view=rev Author: firebirds Date: 2011-05-21 03:18:40 +0000 (Sat, 21 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-21 01:02:33 UTC (rev 52979) +++ firebird/trunk/ChangeLog 2011-05-21 03:18:40 UTC (rev 52980) @@ -1,3 +1,37 @@ + 2011-05-21 01:02 asfernandes + M src/gpre/sqe.cpp + M src/qli/exe.h + M src/qli/gener_proto.h +Warnings. + + 2011-05-20 17:14 alexpeshkoff + M src/yvalve/why.cpp +Destroy transaction only when next level returns success + + 2011-05-20 16:45 alexpeshkoff + M src/common/classes/fb_atomic.h +Atomic operations: use gcc builtin functions instead asm, fix atomic_ops library use + + 2011-05-20 16:44 alexpeshkoff + M builds/posix/Makefile.in +misc + + 2011-05-20 09:13 mapopa + M src/gpre/gpre.h +fix warning: using the result of an assignment as a condition without parentheses +note:place parentheses around the assignment to silence this warning + + 2011-05-20 08:31 mapopa + M autogen.sh +PKG_NAME is now Firebird3 for trunk + + 2011-05-20 07:22 hvlad + M builds/win32/msvc10/yvalve.vcxproj + M builds/win32/msvc10/yvalve.vcxproj.filters + M builds/win32/msvc8/yvalve.vcproj + M builds/win32/msvc9/yvalve.vcproj +Update Windows build + 2011-05-19 17:09 alexpeshkoff M src/gpre/languages/rmc.cpp warnings Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-21 01:02:33 UTC (rev 52979) +++ firebird/trunk/src/jrd/build_no.h 2011-05-21 03:18:40 UTC (rev 52980) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29370 + FORMAL BUILD NUMBER:29377 */ -#define PRODUCT_VER_STRING "3.0.0.29370" -#define FILE_VER_STRING "WI-T3.0.0.29370" -#define LICENSE_VER_STRING "WI-T3.0.0.29370" -#define FILE_VER_NUMBER 3, 0, 0, 29370 +#define PRODUCT_VER_STRING "3.0.0.29377" +#define FILE_VER_STRING "WI-T3.0.0.29377" +#define LICENSE_VER_STRING "WI-T3.0.0.29377" +#define FILE_VER_NUMBER 3, 0, 0, 29377 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29370" +#define FB_BUILD_NO "29377" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-21 01:02:33 UTC (rev 52979) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-21 03:18:40 UTC (rev 52980) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29370 +BuildNum=29377 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-22 03:17:42
|
Revision: 52987 http://firebird.svn.sourceforge.net/firebird/?rev=52987&view=rev Author: firebirds Date: 2011-05-22 03:17:35 +0000 (Sun, 22 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-21 21:43:13 UTC (rev 52986) +++ firebird/trunk/ChangeLog 2011-05-22 03:17:35 UTC (rev 52987) @@ -1,3 +1,39 @@ + 2011-05-21 21:43 asfernandes + M src/yvalve/why.cpp +Misc. + + 2011-05-21 19:11 asfernandes + M src/common/classes/fb_atomic.h + M src/common/utils.cpp + M src/common/utils_proto.h + M src/remote/client/interface.cpp + M src/yvalve/why.cpp +Misc. + + 2011-05-21 19:10 asfernandes + M src/include/Interface.h +Correction. + + 2011-05-21 18:56 asfernandes + M src/common/Auth.cpp + M src/common/classes/ImplementHelper.h + M src/common/classes/fb_atomic.h + M src/gpre/gpre.h + M src/include/ProviderInterface.h + M src/jrd/jrd.cpp + M src/remote/client/interface.cpp + M src/yvalve/DistributedTransaction.cpp + M src/yvalve/why.cpp +Misc. + + 2011-05-21 18:55 asfernandes + M src/include/Interface.h +Correction. + + 2011-05-21 14:04 asfernandes + M src/jrd/blb.cpp +Fixed CORE-3476 - LIST function wrongly concatenates binary blobs. + 2011-05-21 01:02 asfernandes M src/gpre/sqe.cpp M src/qli/exe.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-21 21:43:13 UTC (rev 52986) +++ firebird/trunk/src/jrd/build_no.h 2011-05-22 03:17:35 UTC (rev 52987) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29377 + FORMAL BUILD NUMBER:29383 */ -#define PRODUCT_VER_STRING "3.0.0.29377" -#define FILE_VER_STRING "WI-T3.0.0.29377" -#define LICENSE_VER_STRING "WI-T3.0.0.29377" -#define FILE_VER_NUMBER 3, 0, 0, 29377 +#define PRODUCT_VER_STRING "3.0.0.29383" +#define FILE_VER_STRING "WI-T3.0.0.29383" +#define LICENSE_VER_STRING "WI-T3.0.0.29383" +#define FILE_VER_NUMBER 3, 0, 0, 29383 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29377" +#define FB_BUILD_NO "29383" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-21 21:43:13 UTC (rev 52986) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-22 03:17:35 UTC (rev 52987) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29377 +BuildNum=29383 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-24 03:19:12
|
Revision: 52991 http://firebird.svn.sourceforge.net/firebird/?rev=52991&view=rev Author: firebirds Date: 2011-05-24 03:19:05 +0000 (Tue, 24 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-23 15:33:19 UTC (rev 52990) +++ firebird/trunk/ChangeLog 2011-05-24 03:19:05 UTC (rev 52991) @@ -1,3 +1,16 @@ + 2011-05-23 15:33 asfernandes + M src/common/classes/Synchronize.cpp + M src/common/classes/Synchronize.h +Make synchronization primitives work in the POSIX build. + + 2011-05-23 11:45 alexpeshkoff + M src/yvalve/why.cpp +Fixed isc_start_multiple() - thanks to Adriano + + 2011-05-23 11:45 alexpeshkoff + M src/include/ProviderInterface.h +Slightly better struct layout from cunning alignment POV + 2011-05-21 21:43 asfernandes M src/yvalve/why.cpp Misc. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-23 15:33:19 UTC (rev 52990) +++ firebird/trunk/src/jrd/build_no.h 2011-05-24 03:19:05 UTC (rev 52991) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29383 + FORMAL BUILD NUMBER:29386 */ -#define PRODUCT_VER_STRING "3.0.0.29383" -#define FILE_VER_STRING "WI-T3.0.0.29383" -#define LICENSE_VER_STRING "WI-T3.0.0.29383" -#define FILE_VER_NUMBER 3, 0, 0, 29383 +#define PRODUCT_VER_STRING "3.0.0.29386" +#define FILE_VER_STRING "WI-T3.0.0.29386" +#define LICENSE_VER_STRING "WI-T3.0.0.29386" +#define FILE_VER_NUMBER 3, 0, 0, 29386 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29383" +#define FB_BUILD_NO "29386" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-23 15:33:19 UTC (rev 52990) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-24 03:19:05 UTC (rev 52991) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29383 +BuildNum=29386 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-25 03:19:06
|
Revision: 53003 http://firebird.svn.sourceforge.net/firebird/?rev=53003&view=rev Author: firebirds Date: 2011-05-25 03:18:59 +0000 (Wed, 25 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-25 00:54:59 UTC (rev 53002) +++ firebird/trunk/ChangeLog 2011-05-25 03:18:59 UTC (rev 53003) @@ -1,3 +1,35 @@ + 2011-05-25 00:54 asfernandes + M src/yvalve/why.cpp +Fix attachment leak due to variable shadow in isc_start_multiple. + + 2011-05-25 00:45 asfernandes + M src/yvalve/DistributedTransaction.cpp +Misc. + + 2011-05-24 22:39 asfernandes + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h +Hope this fixes the windows build. + + 2011-05-24 20:44 hvlad + M builds/win32/msvc10/common.vcxproj + M builds/win32/msvc10/common.vcxproj.filters + M builds/win32/msvc10/engine.vcxproj + M builds/win32/msvc10/engine.vcxproj.filters + M builds/win32/msvc10/yvalve.vcxproj.filters +Cleanup + + 2011-05-24 15:20 asfernandes + M src/yvalve/DistributedTransaction.cpp + M src/yvalve/MasterImplementation.cpp + M src/yvalve/MasterImplementation.h + A src/yvalve/YObjects.h + M src/yvalve/why.cpp +Fix problems with new multi-db transactions implementation: +1) fb_get_transaction_handle access object of invalid type and crash +2) Attachment::createBlob/openBlob access object of invalid type and crash +3) isc_start_multiple creates YTransaction with NULL attachment and makes its constructor crash + 2011-05-23 15:33 asfernandes M src/common/classes/Synchronize.cpp M src/common/classes/Synchronize.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-25 00:54:59 UTC (rev 53002) +++ firebird/trunk/src/jrd/build_no.h 2011-05-25 03:18:59 UTC (rev 53003) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29386 + FORMAL BUILD NUMBER:29391 */ -#define PRODUCT_VER_STRING "3.0.0.29386" -#define FILE_VER_STRING "WI-T3.0.0.29386" -#define LICENSE_VER_STRING "WI-T3.0.0.29386" -#define FILE_VER_NUMBER 3, 0, 0, 29386 +#define PRODUCT_VER_STRING "3.0.0.29391" +#define FILE_VER_STRING "WI-T3.0.0.29391" +#define LICENSE_VER_STRING "WI-T3.0.0.29391" +#define FILE_VER_NUMBER 3, 0, 0, 29391 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29386" +#define FB_BUILD_NO "29391" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-25 00:54:59 UTC (rev 53002) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-25 03:18:59 UTC (rev 53003) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29386 +BuildNum=29391 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2011-05-25 12:59:48
|
Revision: 53011 http://firebird.svn.sourceforge.net/firebird/?rev=53011&view=rev Author: alexpeshkoff Date: 2011-05-25 12:59:41 +0000 (Wed, 25 May 2011) Log Message: ----------- Frontported fix for CORE-3482: nbackup ctrl-c segfaults and leaves db locked (delta file continues to grow) Modified Paths: -------------- firebird/trunk/lang_helpers/gds_codes.ftn firebird/trunk/lang_helpers/gds_codes.pas firebird/trunk/src/include/gen/codetext.h firebird/trunk/src/include/gen/iberror.h firebird/trunk/src/include/gen/msgs.h firebird/trunk/src/include/gen/sql_code.h firebird/trunk/src/include/gen/sql_state.h firebird/trunk/src/msgs/facilities2.sql firebird/trunk/src/msgs/messages2.sql firebird/trunk/src/msgs/system_errors2.sql firebird/trunk/src/utilities/nbackup/nbackup.cpp Modified: firebird/trunk/lang_helpers/gds_codes.ftn =================================================================== --- firebird/trunk/lang_helpers/gds_codes.ftn 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/lang_helpers/gds_codes.ftn 2011-05-25 12:59:41 UTC (rev 53011) @@ -2274,6 +2274,8 @@ PARAMETER (GDS__nbackup_lostguid_l0bk = 337117251) INTEGER*4 GDS__nbackup_switchd_parameter PARAMETER (GDS__nbackup_switchd_parameter = 337117255) + INTEGER*4 GDS__nbackup_user_stop + PARAMETER (GDS__nbackup_user_stop = 337117257) INTEGER*4 GDS__trace_conflict_acts PARAMETER (GDS__trace_conflict_acts = 337182750) INTEGER*4 GDS__trace_act_notfound Modified: firebird/trunk/lang_helpers/gds_codes.pas =================================================================== --- firebird/trunk/lang_helpers/gds_codes.pas 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/lang_helpers/gds_codes.pas 2011-05-25 12:59:41 UTC (rev 53011) @@ -1144,6 +1144,7 @@ gds_nbackup_err_eofhdr_restdb = 337117250; gds_nbackup_lostguid_l0bk = 337117251; gds_nbackup_switchd_parameter = 337117255; + gds_nbackup_user_stop = 337117257; gds_trace_conflict_acts = 337182750; gds_trace_act_notfound = 337182751; gds_trace_switch_once = 337182752; Modified: firebird/trunk/src/include/gen/codetext.h =================================================================== --- firebird/trunk/src/include/gen/codetext.h 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/include/gen/codetext.h 2011-05-25 12:59:41 UTC (rev 53011) @@ -1133,6 +1133,7 @@ {"nbackup_err_eofhdr_restdb", 337117250}, {"nbackup_lostguid_l0bk", 337117251}, {"nbackup_switchd_parameter", 337117255}, + {"nbackup_user_stop", 337117257}, {"trace_conflict_acts", 337182750}, {"trace_act_notfound", 337182751}, {"trace_switch_once", 337182752}, Modified: firebird/trunk/src/include/gen/iberror.h =================================================================== --- firebird/trunk/src/include/gen/iberror.h 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/include/gen/iberror.h 2011-05-25 12:59:41 UTC (rev 53011) @@ -1167,6 +1167,7 @@ const ISC_STATUS isc_nbackup_err_eofhdr_restdb = 337117250L; const ISC_STATUS isc_nbackup_lostguid_l0bk = 337117251L; const ISC_STATUS isc_nbackup_switchd_parameter = 337117255L; +const ISC_STATUS isc_nbackup_user_stop = 337117257L; const ISC_STATUS isc_trace_conflict_acts = 337182750L; const ISC_STATUS isc_trace_act_notfound = 337182751L; const ISC_STATUS isc_trace_switch_once = 337182752L; @@ -1178,7 +1179,7 @@ const ISC_STATUS isc_trace_switch_param_miss = 337182758L; const ISC_STATUS isc_trace_param_act_notcompat = 337182759L; const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L; -const ISC_STATUS isc_err_max = 1122; +const ISC_STATUS isc_err_max = 1123; #else /* c definitions */ @@ -2315,6 +2316,7 @@ #define isc_nbackup_err_eofhdr_restdb 337117250L #define isc_nbackup_lostguid_l0bk 337117251L #define isc_nbackup_switchd_parameter 337117255L +#define isc_nbackup_user_stop 337117257L #define isc_trace_conflict_acts 337182750L #define isc_trace_act_notfound 337182751L #define isc_trace_switch_once 337182752L @@ -2326,7 +2328,7 @@ #define isc_trace_switch_param_miss 337182758L #define isc_trace_param_act_notcompat 337182759L #define isc_trace_mandatory_switch_miss 337182760L -#define isc_err_max 1122 +#define isc_err_max 1123 #endif Modified: firebird/trunk/src/include/gen/msgs.h =================================================================== --- firebird/trunk/src/include/gen/msgs.h 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/include/gen/msgs.h 2011-05-25 12:59:41 UTC (rev 53011) @@ -1136,6 +1136,7 @@ {337117250, "Unexpected end of file when reading header of restored database file (stage @1)"}, /* nbackup_err_eofhdr_restdb */ {337117251, "Cannot get backup guid clumplet from L0 backup"}, /* nbackup_lostguid_l0bk */ {337117255, "Wrong parameter @1 for switch -D, need ON or OFF"}, /* nbackup_switchd_parameter */ + {337117257, "Terminated due to user request"}, /* nbackup_user_stop */ {337182750, "conflicting actions \"@1\" and \"@2\" found"}, /* trace_conflict_acts */ {337182751, "action switch not found"}, /* trace_act_notfound */ {337182752, "switch \"@1\" must be set only once"}, /* trace_switch_once */ Modified: firebird/trunk/src/include/gen/sql_code.h =================================================================== --- firebird/trunk/src/include/gen/sql_code.h 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/include/gen/sql_code.h 2011-05-25 12:59:41 UTC (rev 53011) @@ -1132,6 +1132,7 @@ {337117250, -901}, /* 66 nbackup_err_eofhdr_restdb */ {337117251, -901}, /* 67 nbackup_lostguid_l0bk */ {337117255, -901}, /* 71 nbackup_switchd_parameter */ + {337117257, -901}, /* 73 nbackup_user_stop */ {337182750, -901}, /* 30 trace_conflict_acts */ {337182751, -901}, /* 31 trace_act_notfound */ {337182752, -901}, /* 32 trace_switch_once */ Modified: firebird/trunk/src/include/gen/sql_state.h =================================================================== --- firebird/trunk/src/include/gen/sql_state.h 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/include/gen/sql_state.h 2011-05-25 12:59:41 UTC (rev 53011) @@ -1132,6 +1132,7 @@ {337117250, "00000"}, // 66 nbackup_err_eofhdr_restdb {337117251, "00000"}, // 67 nbackup_lostguid_l0bk {337117255, "00000"}, // 71 nbackup_switchd_parameter + {337117257, "08006"}, // 73 nbackup_user_stop {337182750, "00000"}, // 30 trace_conflict_acts {337182751, "00000"}, // 31 trace_act_notfound {337182752, "00000"}, // 32 trace_switch_once Modified: firebird/trunk/src/msgs/facilities2.sql =================================================================== --- firebird/trunk/src/msgs/facilities2.sql 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/msgs/facilities2.sql 2011-05-25 12:59:41 UTC (rev 53011) @@ -35,7 +35,7 @@ ('2009-12-26 14:22:00', 'GSTAT', 21, 50) ('2009-12-18 19:33:34', 'FBSVCMGR', 22, 57) ('2009-07-18 12:12:12', 'UTL', 23, 2) -('2009-12-19 06:19:15', 'NBACKUP', 24, 73) +('2011-05-25 16:17:34', 'NBACKUP', 24, 74) ('2009-07-20 07:55:48', 'FBTRACEMGR', 25, 41) stop Modified: firebird/trunk/src/msgs/messages2.sql =================================================================== --- firebird/trunk/src/msgs/messages2.sql 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/msgs/messages2.sql 2011-05-25 12:59:41 UTC (rev 53011) @@ -3147,6 +3147,7 @@ (NULL, 'usage', 'nbackup.cpp', NULL, 24, 70, NULL, ' -D(IRECT) [ON | OFF] Use or not direct I/O when backing up database', NULL, NULL) ('nbackup_switchd_parameter', 'main', 'nbackup.cpp', NULL, 24, 71, NULL, 'Wrong parameter @1 for switch -D, need ON or OFF', NULL, NULL) (NULL, 'usage', 'nbackup.cpp', NULL, 24, 72, NULL, 'special options are:', NULL, NULL) +('nbackup_user_stop', 'checkCtrlC()', 'nbackup.cpp', NULL, 24, 73, NULL, 'Terminated due to user request', NULL, NULL) -- FBTRACEMGR -- All messages use the new format. (NULL, 'usage', 'TraceCmdLine.cpp', NULL, 25, 1, NULL, 'Firebird Trace Manager version @1', NULL, NULL) Modified: firebird/trunk/src/msgs/system_errors2.sql =================================================================== --- firebird/trunk/src/msgs/system_errors2.sql 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/msgs/system_errors2.sql 2011-05-25 12:59:41 UTC (rev 53011) @@ -1130,6 +1130,7 @@ (-901, '00', '000', 24, 66, 'nbackup_err_eofhdr_restdb', NULL, NULL) (-901, '00', '000', 24, 67, 'nbackup_lostguid_l0bk', NULL, NULL) (-901, '00', '000', 24, 71, 'nbackup_switchd_parameter', NULL, NULL) +(-901, '08', '006', 24, 73, 'nbackup_user_stop', NULL, NULL) -- FBTRACEMGR (-901, '00', '000', 25, 30, 'trace_conflict_acts', NULL, NULL) (-901, '00', '000', 25, 31, 'trace_act_notfound', NULL, NULL) Modified: firebird/trunk/src/utilities/nbackup/nbackup.cpp =================================================================== --- firebird/trunk/src/utilities/nbackup/nbackup.cpp 2011-05-25 11:50:25 UTC (rev 53010) +++ firebird/trunk/src/utilities/nbackup/nbackup.cpp 2011-05-25 12:59:41 UTC (rev 53011) @@ -212,10 +212,30 @@ } #endif // HAVE_POSIX_FADVISE + bool flShutdown = false; + + int nbackupShutdown(const int reason, const int, void*) + { + if (reason == fb_shutrsn_signal) + { + flShutdown = true; + return FB_FAILURE; + } + return FB_SUCCESS; + } + } // namespace +static void checkCtrlC(UtilSvc* uSvc) +{ + if (flShutdown) + { + Arg::Gds(isc_nbackup_user_stop).raise(); + } +} + #ifdef WIN_NT #define FILE_HANDLE HANDLE #else @@ -261,6 +281,15 @@ if (!ResolveDatabaseAlias(db, dbname, NULL)) dbname = db; + + if (!uSvc->isService()) + { + // It's time to take care about shutdown handling + if (fb_shutdown_callback(status, nbackupShutdown, fb_shut_confirmation, NULL)) + { + pr_error(status, "setting shutdown callback"); + } + } } typedef ObjectsArray<PathName> BackupFiles; @@ -960,6 +989,8 @@ page_writes++; } + checkCtrlC(uSvc); + if ((db_size_pages != 0) && (db_size == 0)) break; @@ -1241,6 +1272,7 @@ } seek_file(dbase, ((SINT64) pageNum) * bakheader.page_size); write_file(dbase, page_buffer, bakheader.page_size); + checkCtrlC(uSvc); } delete_database = false; } @@ -1252,6 +1284,7 @@ status_exception::raise(Arg::Gds(isc_nbackup_err_copy) << dbname.c_str() << bakname.c_str() << Arg::OsError()); } + checkCtrlC(uSvc); delete_database = true; // database is possibly broken open_database_write(); #else @@ -1263,6 +1296,7 @@ if (bytesRead == 0) break; write_file(dbase, buffer, bytesRead); + checkCtrlC(uSvc); } seek_file(dbase, 0); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-05-26 03:18:41
|
Revision: 53012 http://firebird.svn.sourceforge.net/firebird/?rev=53012&view=rev Author: firebirds Date: 2011-05-26 03:18:34 +0000 (Thu, 26 May 2011) Log Message: ----------- nightly update Modified Paths: -------------- firebird/trunk/ChangeLog firebird/trunk/src/jrd/build_no.h firebird/trunk/src/misc/writeBuildNum.sh Modified: firebird/trunk/ChangeLog =================================================================== --- firebird/trunk/ChangeLog 2011-05-25 12:59:41 UTC (rev 53011) +++ firebird/trunk/ChangeLog 2011-05-26 03:18:34 UTC (rev 53012) @@ -1,3 +1,21 @@ + 2011-05-25 12:59 alexpeshkoff + M lang_helpers/gds_codes.ftn + M lang_helpers/gds_codes.pas + M src/include/gen/codetext.h + M src/include/gen/iberror.h + M src/include/gen/msgs.h + M src/include/gen/sql_code.h + M src/include/gen/sql_state.h + M src/msgs/facilities2.sql + M src/msgs/messages2.sql + M src/msgs/system_errors2.sql + M src/utilities/nbackup/nbackup.cpp +Frontported fix for CORE-3482: nbackup ctrl-c segfaults and leaves db locked (delta file continues to grow) + + 2011-05-25 10:59 dimitr + M src/dsql/ExprNodes.cpp +Fixed CORE-3493: Adding a value to a timestamp below '16.11.1858 00:00:01' throws 'value exceeds the range for valid timestamp'. v2.1 wasn't really affected although the validation sequence was wrong. + 2011-05-25 00:54 asfernandes M src/yvalve/why.cpp Fix attachment leak due to variable shadow in isc_start_multiple. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-05-25 12:59:41 UTC (rev 53011) +++ firebird/trunk/src/jrd/build_no.h 2011-05-26 03:18:34 UTC (rev 53012) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29391 + FORMAL BUILD NUMBER:29393 */ -#define PRODUCT_VER_STRING "3.0.0.29391" -#define FILE_VER_STRING "WI-T3.0.0.29391" -#define LICENSE_VER_STRING "WI-T3.0.0.29391" -#define FILE_VER_NUMBER 3, 0, 0, 29391 +#define PRODUCT_VER_STRING "3.0.0.29393" +#define FILE_VER_STRING "WI-T3.0.0.29393" +#define LICENSE_VER_STRING "WI-T3.0.0.29393" +#define FILE_VER_NUMBER 3, 0, 0, 29393 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29391" +#define FB_BUILD_NO "29393" #define FB_BUILD_TYPE "T" #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable" Modified: firebird/trunk/src/misc/writeBuildNum.sh =================================================================== --- firebird/trunk/src/misc/writeBuildNum.sh 2011-05-25 12:59:41 UTC (rev 53011) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-05-26 03:18:34 UTC (rev 53012) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29391 +BuildNum=29393 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |