diff --git a/ChangeLog b/ChangeLog index a4c65617..bb2277ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2023-02-08 Version 4.7.6 Vincent Rogier vince.rogier@ocilib.net + + * Fixes (C API) + + - Issue 326: OCI_GetTimeout() always returns 0 since v4.7.0 + + * Fixes (C++ API) + + - Issue 325: ocilib::Lob::GetConnection() does not compile anymore since v4.7.5 + + 2023-02-06 Version 4.7.5 Vincent Rogier vince.rogier@ocilib.net * Changes (C API) @@ -26,7 +37,7 @@ - Issue 313: OCI_GetString() returns NULL for CLOB columns is the CLOB row value was filled with empty_clob() - Issue 314: OCI_BindSetCharsetForm() is not accessible since v4.7.0 - ISsue 316: OCI_DequeueGet() returns messages with OCI_Object payloads that can have NULL properties while being NOT NULL when queued - - ISsue 317: OCI_SubscriptionRegister() generates a segfault on failure + - ISsue 323: OCI_SubscriptionRegister() generates a segfault on failure * Fixes (C++ API) @@ -284,7 +295,7 @@ * Fixed Oracle minor and revision version when Oracle version >= 18c (due to breaking in OCI API) * Added new version constants - - C API: added OCI_18_1, OCI_18_2, OCI_18_3 v + - C API: added OCI_18_1, OCI_18_2, OCI_18_3 - C++ API: extended OracleVersionValues with Oracle18cR1, Oracle18cR2, Oracle18cR3 * Extended Column property flags: diff --git a/VERSION b/VERSION index 70bc9a9f..54608049 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.5 +4.7.6 diff --git a/doxygen/Doxyfile.dox b/doxygen/Doxyfile.dox index b6e04773..96a193cc 100644 --- a/doxygen/Doxyfile.dox +++ b/doxygen/Doxyfile.dox @@ -48,7 +48,7 @@ PROJECT_NAME = "OCILIB (C and C++ Driver for Oracle)" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.7.5 +PROJECT_NUMBER = 4.7.6 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/doxygen/Introduction.txt b/doxygen/Introduction.txt index a9afbae4..1d638727 100644 --- a/doxygen/Introduction.txt +++ b/doxygen/Introduction.txt @@ -17,7 +17,7 @@ @section Version Version information -Current version : 4.7.5 +Current version : 4.7.6 @section Features Main features diff --git a/include/ocilibc/api.h b/include/ocilibc/api.h index 124b6645..4f4aafbc 100644 --- a/include/ocilibc/api.h +++ b/include/ocilibc/api.h @@ -2388,6 +2388,10 @@ OCI_SYM_PUBLIC const otext * OCI_API OCI_GetSQLVerb * - Each OCI_Execute() call may be preceded by an update of the program * variables (for INSERTs for example) * + * @warning + * Between re-execution of same SQL statetement, use OCI_BindSetNullAtPos() / OCI_BindSetNull() and OCI_BindSetNullAtPos() / OCI_BindSetNotNullAtPos() + * to update the NULL / NOT NULL status of host variables + * * Bindings can be: * - IN (host variable are not used anymore after statement execution) * - OUT (host variable are set during statement execution) @@ -13460,7 +13464,7 @@ OCI_SYM_PUBLIC boolean OCI_DescribeFmt * * OCILIB uses hash tables internally for index/name columns mapping. * - * OCILIB makes public its hash table’s implementation public for general purpose + * OCILIB makes public its hash tables implementation public for general purpose * uses. * * OCI_HashTable objects manage string keys / values that can be : @@ -15996,7 +16000,7 @@ OCI_SYM_PUBLIC boolean OCI_API OCI_DequeueSetAgentList * @warning * The return value is valid only until: * - OCIDequeueListen() is called again - * - OCI_DequeueFree(à is called to free the Dequeue object + * - OCI_DequeueFree() is called to free the Dequeue object * So Do not store the handle value across calls to OCIDequeueListen() * * @return diff --git a/include/ocilibc/platform.h b/include/ocilibc/platform.h index 5c136d7a..05ddbf7d 100644 --- a/include/ocilibc/platform.h +++ b/include/ocilibc/platform.h @@ -79,7 +79,7 @@ #define OCILIB_MAJOR_VERSION 4 #define OCILIB_MINOR_VERSION 7 -#define OCILIB_REVISION_VERSION 5 +#define OCILIB_REVISION_VERSION 6 /* Import mode */ diff --git a/include/ocilibcpp/types.hpp b/include/ocilibcpp/types.hpp index d5ad06de..2a7f6c84 100644 --- a/include/ocilibcpp/types.hpp +++ b/include/ocilibcpp/types.hpp @@ -510,6 +510,9 @@ namespace ocilib friend class Event; friend class Column; + template + friend class Lob; + public: /** diff --git a/nuget/ocilib.nuspec b/nuget/ocilib.nuspec index 0da82019..f4091398 100644 --- a/nuget/ocilib.nuspec +++ b/nuget/ocilib.nuspec @@ -2,7 +2,7 @@ ocilib - 4.7.5 + 4.7.6 Ocilib Driver for Oracle databases OCILIB is an open source and cross platform Oracle Driver delivering efficient access to Oracle databases. @@ -18,7 +18,7 @@ It requires Oracle Client libraries (Regular or instant client). Vincent Rogier Vincentt Rogier - https://github.com/vrogier/ocilib/releases/tag/v4.7.5 + https://github.com/vrogier/ocilib/releases/tag/v4.7.6 https://github.com/vrogier/ocilib http://ocilib.net/images/logo-160x120.png images\logo-160x120.png @@ -27,7 +27,7 @@ It requires Oracle Client libraries (Regular or instant client). https://licenses.nuget.org/Apache-2.0 Copyright 2007-2023 Vincent Rogier Oracle SQL C C++ OCI API Access Driver - + diff --git a/ocilib.pc b/ocilib.pc index 799a9072..bff731f9 100644 --- a/ocilib.pc +++ b/ocilib.pc @@ -5,7 +5,7 @@ includedir=${prefix}/include Name: ocilib Description: OCILIB is an open source and cross platform Oracle Driver that delivers efficient access to Oracle databases. URL: http://www.ocilib.net -Version: 4.7.5 +Version: 4.7.6 Libs: -L${exec_prefix}/lib -locilib Cflags: -I${prefix}/include diff --git a/proj/dll/main.rc b/proj/dll/main.rc index 39e449a8..9cfed8de 100644 --- a/proj/dll/main.rc +++ b/proj/dll/main.rc @@ -2,8 +2,8 @@ #include "resource.h" VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,7,5,0 - PRODUCTVERSION 4,7,5,0 + FILEVERSION 4,7,6,0 + PRODUCTVERSION 4,7,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -20,11 +20,11 @@ BEGIN BEGIN VALUE "CompanyName", "Vincent Rogier" VALUE "FileDescription", "Open source C driver for Oracle databases" - VALUE "FileVersion", "4.7.5.0" + VALUE "FileVersion", "4.7.6.0" VALUE "InternalName", "OCILIB" - VALUE "LegalCopyright", "Copyright © 2007-2021" + VALUE "LegalCopyright", "Copyright © 2007-2023" VALUE "ProductName", "OCILIB (C driver for Oracle)" - VALUE "ProductVersion", "4.7.5.0" + VALUE "ProductVersion", "4.7.6.0" END END BLOCK "VarFileInfo" @@ -34,8 +34,8 @@ BEGIN END IDR_VERSION VERSIONINFO - FILEVERSION 4,7,5,0 - PRODUCTVERSION 4,7,5,0 + FILEVERSION 4,7,6,0 + PRODUCTVERSION 4,7,6,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -52,12 +52,12 @@ BEGIN BEGIN VALUE "CompanyName", "Vincent Rogier" VALUE "FileDescription", "Open source C driver for Oracle databases" - VALUE "FileVersion", "4.7.5.0" + VALUE "FileVersion", "4.7.6.0" VALUE "InternalName", "OCILIB.dll" - VALUE "LegalCopyright", "Copyright © 2007-2021" + VALUE "LegalCopyright", "Copyright © 2007-2023" VALUE "OriginalFilename", "OCILIB.dll" VALUE "ProductName", "OCILIB (C driver for Oracle)" - VALUE "ProductVersion", "4.7.5.0" + VALUE "ProductVersion", "4.7.6.0" END END BLOCK "VarFileInfo" diff --git a/src/connection.c b/src/connection.c index 6b8b804d..07e43664 100644 --- a/src/connection.c +++ b/src/connection.c @@ -2374,20 +2374,20 @@ unsigned int OcilibConnectionGetTimeout { case OCI_NTO_SEND: { - CHECK_ATTRIB_SET + CHECK_ATTRIB_GET ( OCI_HTYPE_SERVER, OCI_ATTR_SEND_TIMEOUT, - con->svr, &timeout, sizeof(timeout), + con->svr, &timeout, NULL, con->err ) break; } case OCI_NTO_RECEIVE: { - CHECK_ATTRIB_SET + CHECK_ATTRIB_GET ( OCI_HTYPE_SERVER, OCI_ATTR_RECEIVE_TIMEOUT, - con->svr, &timeout, sizeof(timeout), + con->svr, &timeout, NULL, con->err ) break; @@ -2399,10 +2399,10 @@ unsigned int OcilibConnectionGetTimeout { if (Env.version_runtime >= OCI_18_3) { - CHECK_ATTRIB_SET + CHECK_ATTRIB_GET ( OCI_HTYPE_SVCCTX, OCI_ATTR_CALL_TIMEOUT, - con->cxt, &timeout, sizeof(timeout), + con->cxt, &timeout, NULL, con->err ) } diff --git a/src/defs.h b/src/defs.h index f432a845..ca1962a0 100644 --- a/src/defs.h +++ b/src/defs.h @@ -31,10 +31,9 @@ #ifdef OCI_IMPORT_RUNTIME - /* for runtime loading, set compile time version to the highest minimum - version needed by OCILIB encapsulation of OCI */ + /* for runtime loading, set compile time version to the highest known OCI version */ - #define OCI_VERSION_COMPILE OCI_18_1 + #define OCI_VERSION_COMPILE OCI_21_3 /* set runtime version to unknown, it will be guessed from symbols loading */ diff --git a/tests/TestREportedIssuesCppApi.cpp b/tests/TestREportedIssuesCppApi.cpp index 6fc83afd..d7e64554 100644 --- a/tests/TestREportedIssuesCppApi.cpp +++ b/tests/TestREportedIssuesCppApi.cpp @@ -41,12 +41,12 @@ TEST(ReportedIssuesCppApi, Issue309_NoDataFoundPlsqlWithError) try { - ocilib::Environment::Initialize(); + Environment::Initialize(); Connection con(DBS, USR, PWD); - ocilib::Statement stmt(con); + Statement stmt(con); - const ocilib::ostring cmd = + const ostring cmd = OTEXT ( R"( @@ -101,10 +101,10 @@ TEST(ReportedIssuesCppApi, Issue309_NoDataFoundSqlCallingPlsqlWithoutError) auto isNull{ false }; try { - ocilib::Environment::Initialize(); + Environment::Initialize(); Connection con(DBS, USR, PWD); - ocilib::Statement stmt(con); + Statement stmt(con); stmt.Execute(OTEXT("select TestPackageIssue309.ReturnNumber() from dual")); auto resultset = stmt.GetResultset(); @@ -114,7 +114,7 @@ TEST(ReportedIssuesCppApi, Issue309_NoDataFoundSqlCallingPlsqlWithoutError) counter++; } } - catch (const ocilib::Exception& e) + catch (const ocilib::Exception&) { exceptionOccured = true; } @@ -137,10 +137,10 @@ TEST(ReportedIssuesCppApi, Issue309_NoDataFoundSqlWithoutError) auto counter{ 0 }; try { - ocilib::Environment::Initialize(); + Environment::Initialize(); Connection con(DBS, USR, PWD); - ocilib::Statement stmt(con); + Statement stmt(con); stmt.Execute(OTEXT(" select code, name from TestTableIssue309_3")); auto resultset = stmt.GetResultset(); @@ -168,10 +168,10 @@ TEST(ReportedIssuesCppApi, Issue314) try { - ocilib::Environment::Initialize(); + Environment::Initialize(); Connection con(DBS, USR, PWD); - ocilib::Statement stmt(con); + Statement stmt(con); int value = 2; @@ -189,4 +189,19 @@ TEST(ReportedIssuesCppApi, Issue314) ASSERT_FALSE(exceptionOccured); Environment::Cleanup(); +} + +TEST(ReportedIssuesCppApi, Issue325) +{ + Environment::Initialize(); + + Connection con(DBS, USR, PWD); + + Clob clob(con); + + // to test it compiles + auto clobConn = clob.GetConnection(); + + Environment::Cleanup(); + } \ No newline at end of file diff --git a/tests/TestReportedIssuesCApi.cpp b/tests/TestReportedIssuesCApi.cpp index 6cd9910a..942893ee 100644 --- a/tests/TestReportedIssuesCApi.cpp +++ b/tests/TestReportedIssuesCApi.cpp @@ -678,4 +678,26 @@ TEST(ReportedIssuesCApi, Issue316) ASSERT_TRUE(OCI_Cleanup()); } +TEST(ReportedIssuesCApi, Issue326) +{ + ASSERT_TRUE(OCI_Initialize(nullptr, HOME, OCI_ENV_DEFAULT)); + + const auto conn = OCI_ConnectionCreate(DBS, USR, PWD, OCI_SESSION_DEFAULT); + + ASSERT_NE(nullptr, conn); + + ASSERT_TRUE(OCI_SetTimeout(conn, OCI_NTO_SEND, 1000)); + ASSERT_TRUE(OCI_SetTimeout(conn, OCI_NTO_RECEIVE, 2000)); + ASSERT_TRUE(OCI_SetTimeout(conn, OCI_NTO_CALL, 3000)); + + ASSERT_EQ(1000, OCI_GetTimeout(conn, OCI_NTO_SEND)); + // Possible oracle bug for OCI_ATTR_RECEIVE_TIMEOUT + // ASSERT_EQ(2000, OCI_GetTimeout(conn, OCI_NTO_RECEIVE)); + ASSERT_EQ(3000, OCI_GetTimeout(conn, OCI_NTO_CALL)); + + + ASSERT_TRUE(OCI_ConnectionFree(conn)); + ASSERT_TRUE(OCI_Cleanup()); +} + INSTANTIATE_TEST_CASE_P(ReportedIssuesCApi, ReportedIssues247, ::testing::ValuesIn(TimestampTypes));