From: Vladimir T. <pr...@us...> - 2004-02-17 19:28:55
|
Update of /cvsroot/firebird/OdbcJdbc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28539 Modified Files: Tag: v1-2-beta Main.cpp OdbcConnection.cpp OdbcConnection.h OdbcJdbc.rc OdbcObject.cpp OdbcObject.h SetupAttributes.h Log Message: - is added check of loaded modules IscDbc and OdbcJdbc on validation of the versions branch v1-2-beta Index: Main.cpp =================================================================== RCS file: /cvsroot/firebird/OdbcJdbc/Main.cpp,v retrieving revision 1.7.2.7 retrieving revision 1.7.2.8 diff -b -U3 -r1.7.2.7 -r1.7.2.8 --- Main.cpp 14 Feb 2004 16:30:17 -0000 1.7.2.7 +++ Main.cpp 17 Feb 2004 19:19:48 -0000 1.7.2.8 @@ -502,6 +502,7 @@ return ((OdbcConnection*) arg1)->sqlEndTran (arg2); } + GUARD_ENV(arg0); return ((OdbcEnv*) arg0)->sqlEndTran (arg2); } @@ -1121,14 +1122,17 @@ switch (arg0) { - case SQL_HANDLE_ENV: - return ((OdbcEnv*) arg1)->sqlEndTran (arg2); - case SQL_HANDLE_DBC: { GUARD_HDBC(arg1); return ((OdbcConnection*) arg1)->sqlEndTran (arg2); } + + case SQL_HANDLE_ENV: + { + GUARD_ENV(arg1); + return ((OdbcEnv*) arg1)->sqlEndTran (arg2); + } } return SQL_INVALID_HANDLE; Index: OdbcConnection.cpp =================================================================== RCS file: /cvsroot/firebird/OdbcJdbc/OdbcConnection.cpp,v retrieving revision 1.14.2.16 retrieving revision 1.14.2.17 diff -b -U3 -r1.14.2.16 -r1.14.2.17 --- OdbcConnection.cpp 6 Feb 2004 11:48:44 -0000 1.14.2.16 +++ OdbcConnection.cpp 17 Feb 2004 19:19:49 -0000 1.14.2.17 @@ -263,6 +263,11 @@ return test; } +static int getDriverBuildKey() +{ + return MAJOR_VERSION * 1000000 + MINOR_VERSION * 10000 + BUILDNUM_VERSION; +} + ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// @@ -1370,6 +1375,26 @@ #endif connection = (fn)(); //connection = createConnection(); + + if ( getDriverBuildKey() != connection->getDriverBuildKey() ) + { + connection->close(); + connection = NULL; + +#ifdef _WIN32 + FreeLibrary(env->libraryHandle); + env->libraryHandle = NULL; +#endif +#ifdef ELF + dlclose (env->libraryHandle); + env->libraryHandle = 0; +#endif + + JString text; + text.Format (" Unable to load %s Library : can't find ver. %s ", sharedLibrary, DRIVER_VERSION); + return sqlReturn (SQL_ERROR, "HY000", text); + } + properties = connection->allocProperties(); if (account) properties->putValue ("user", account); Index: OdbcConnection.h =================================================================== RCS file: /cvsroot/firebird/OdbcJdbc/OdbcConnection.h,v retrieving revision 1.5.2.6 retrieving revision 1.5.2.7 diff -b -U3 -r1.5.2.6 -r1.5.2.7 --- OdbcConnection.h 27 Jan 2004 19:51:20 -0000 1.5.2.6 +++ OdbcConnection.h 17 Feb 2004 19:19:49 -0000 1.5.2.7 @@ -106,7 +106,7 @@ public: SafeConnectThread(OdbcConnection * connect) { - if(connect->connected) + if(connect && connect->connected) { connection=connect; connection->Lock(); Index: OdbcJdbc.rc =================================================================== RCS file: /cvsroot/firebird/OdbcJdbc/OdbcJdbc.rc,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -b -U3 -r1.4.2.2 -r1.4.2.3 --- OdbcJdbc.rc 5 Nov 2003 17:43:43 -0000 1.4.2.2 +++ OdbcJdbc.rc 17 Feb 2004 19:19:49 -0000 1.4.2.3 @@ -51,13 +51,11 @@ VALUE "FileDescription", "OdbcJdbc\0" VALUE "FileVersion", FILE_VERSION_STR VALUE "InternalName", "OdbcJdbc\0" - VALUE "LegalCopyright", "Copyright © 2000 - 2003\0" - VALUE "LegalTrademarks", "\0" + VALUE "LegalCopyright", "Copyright © 2000 - 2004\0" VALUE "OriginalFilename", "OdbcJdbc.dll\0" - VALUE "PrivateBuild", "\0" VALUE "ProductName", "OdbcJdbc Dynamic Link Library\0" VALUE "ProductVersion", PRODUCT_VERSION_STR - VALUE "SpecialBuild", "Beta\0" + VALUE "SpecialBuild", "v1-2-beta\0" END END BLOCK "VarFileInfo" Index: OdbcObject.cpp =================================================================== RCS file: /cvsroot/firebird/OdbcJdbc/OdbcObject.cpp,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -b -U3 -r1.3.2.4 -r1.3.2.5 --- OdbcObject.cpp 13 Dec 2003 18:29:48 -0000 1.3.2.4 +++ OdbcObject.cpp 17 Feb 2004 19:19:49 -0000 1.3.2.5 @@ -336,66 +336,6 @@ return SQL_NO_DATA_FOUND; } -int OdbcObject::getCType(int type, bool isSigned) -{ - switch (type) - { - case SQL_CHAR: - case SQL_VARCHAR: - case SQL_LONGVARCHAR: - case SQL_DECIMAL: - case SQL_NUMERIC: - return SQL_C_CHAR; - - case SQL_TINYINT: - return (isSigned) ? SQL_C_STINYINT : SQL_C_UTINYINT; - - case SQL_SMALLINT: - return (isSigned) ? SQL_C_SSHORT : SQL_C_USHORT; - - case SQL_INTEGER: - return (isSigned) ? SQL_C_SLONG : SQL_C_ULONG; - - case SQL_BIGINT: - return (isSigned) ? SQL_C_SBIGINT : SQL_C_UBIGINT; - - case SQL_REAL: - return SQL_C_FLOAT; - - case SQL_FLOAT: - case SQL_DOUBLE: - return SQL_C_DOUBLE; - - case SQL_BIT: - return SQL_C_BIT; - - case SQL_BINARY: - case SQL_VARBINARY: - case SQL_LONGVARBINARY: - return SQL_C_BINARY; - - case SQL_DATE: - return SQL_C_DATE; - - case SQL_TYPE_DATE: - return SQL_C_TYPE_DATE; - - case SQL_TIME: - return SQL_C_TIME; - - case SQL_TYPE_TIME: - return SQL_C_TYPE_TIME; - - case SQL_TIMESTAMP: - return SQL_C_TIMESTAMP; - - case SQL_TYPE_TIMESTAMP: - return SQL_C_TYPE_TIMESTAMP; - } - - return type; -} - void OdbcObject::setCursorRowCount(int count) { sqlDiagCursorRowCount = count; Index: OdbcObject.h =================================================================== RCS file: /cvsroot/firebird/OdbcJdbc/OdbcObject.h,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -b -U3 -r1.2.2.3 -r1.2.2.4 --- OdbcObject.h 13 Dec 2003 18:29:48 -0000 1.2.2.3 +++ OdbcObject.h 17 Feb 2004 19:19:49 -0000 1.2.2.4 @@ -47,7 +47,6 @@ { public: void setCursorRowCount (int count); - int getCType (int type, bool isSigned); virtual RETCODE sqlGetDiagField (int recNumber, int diagId, SQLPOINTER ptr, int bufferLength, SQLSMALLINT *stringLength); RETCODE returnStringInfo(SQLPOINTER ptr, SQLSMALLINT maxLength, SQLINTEGER* returnLength, const char * value); RETCODE sqlGetDiagRec (int handleType, int recNumber, SQLCHAR*sqlState,SQLINTEGER*nativeErrorPtr,SQLCHAR*messageText,int bufferLength,SQLSMALLINT*textLengthPtr); Index: SetupAttributes.h =================================================================== RCS file: /cvsroot/firebird/OdbcJdbc/SetupAttributes.h,v retrieving revision 1.3.2.6 retrieving revision 1.3.2.7 diff -b -U3 -r1.3.2.6 -r1.3.2.7 --- SetupAttributes.h 5 Feb 2004 10:24:53 -0000 1.3.2.6 +++ SetupAttributes.h 17 Feb 2004 19:19:49 -0000 1.3.2.7 @@ -26,9 +26,9 @@ #define BUILDTYPE_VERSION "WI_T" -#define MAJOR_VERSION 01 -#define MINOR_VERSION 02 -#define REVNO_VERSION 00 +#define MAJOR_VERSION 1 +#define MINOR_VERSION 2 +#define REVNO_VERSION 0 #define DRIVER_FULL_NAME "Firebird/InterBase(r) driver" #define DRIVER_NAME "OdbcJdbc" @@ -52,13 +52,16 @@ #define BUILD_STR2(x) BUILD_STR(x) #define BUILD_DRIVER_VERSION(major,minor,buildnum) major"."minor"."buildnum -#define BUILD_VERSION(major,minor,revno,buildnum) major,minor,revno,buildnum +#ifdef __BORLANDC__ +#define BUILD_VERSION_STR(major,minor,revno,buildnum) major "," minor "," "0" "," buildnum +#else #define BUILD_VERSION_STR(major,minor,revno,buildnum) major "," minor "," revno "," buildnum +#endif -#define DRIVER_VERSION BUILD_DRIVER_VERSION( BUILD_STR2( MAJOR_VERSION ), BUILD_STR2( MINOR_VERSION ), BUILD_STR2( BUILDNUM_VERSION ) ) -#define FILE_VERSION BUILD_VERSION( MAJOR_VERSION, MINOR_VERSION, REVNO_VERSION, BUILDHEX_VERSION ) -#define FILE_VERSION_STR BUILDTYPE_VERSION BUILD_VERSION_STR( BUILD_STR2( MAJOR_VERSION ), BUILD_STR2( MINOR_VERSION ), BUILD_STR2(REVNO_VERSION), BUILD_STR2(BUILDHEX_VERSION) ) -#define PRODUCT_VERSION BUILD_VERSION ( MAJOR_VERSION, MINOR_VERSION, REVNO_VERSION, BUILDHEX_VERSION ) -#define PRODUCT_VERSION_STR BUILD_VERSION_STR ( BUILD_STR2( MAJOR_VERSION ), BUILD_STR2( MINOR_VERSION ), BUILD_STR2( REVNO_VERSION ), BUILD_STR2( BUILDHEX_VERSION ) ) +#define DRIVER_VERSION BUILD_DRIVER_VERSION( "0" BUILD_STR2( MAJOR_VERSION ), "0" BUILD_STR2( MINOR_VERSION ), "00" BUILD_STR2( BUILDNUM_VERSION ) ) +#define FILE_VERSION MAJOR_VERSION,MINOR_VERSION,REVNO_VERSION,BUILDNUM_VERSION +#define FILE_VERSION_STR BUILDTYPE_VERSION BUILD_VERSION_STR( BUILD_STR2( MAJOR_VERSION ), BUILD_STR2( MINOR_VERSION ), BUILD_STR2(REVNO_VERSION), BUILD_STR2(BUILDNUM_VERSION) ) "\0" +#define PRODUCT_VERSION FILE_VERSION +#define PRODUCT_VERSION_STR BUILD_VERSION_STR ( BUILD_STR2( MAJOR_VERSION ), BUILD_STR2( MINOR_VERSION ), BUILD_STR2( REVNO_VERSION ), BUILD_STR2( BUILDNUM_VERSION ) ) "\0" #endif |