From 303ad57b454869b3faf58ef398f284c8c351cf13 Mon Sep 17 00:00:00 2001 From: Vincent Rogier Date: Wed, 8 Feb 2023 19:30:34 +0100 Subject: [PATCH 1/7] Fix issue #325 --- include/ocilibcpp/types.hpp | 3 +++ tests/TestREportedIssuesCppApi.cpp | 35 +++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) 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/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 From 39a4fb2310705f8cd76eee0d37d65c412bd387f8 Mon Sep 17 00:00:00 2001 From: Vincent Rogier Date: Wed, 8 Feb 2023 20:30:30 +0100 Subject: [PATCH 2/7] Fix issue #326 --- src/connection.c | 12 ++++++------ tests/TestReportedIssuesCApi.cpp | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) 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/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)); From 89005cd6a2e96a084aebd6793eacce4f4f2dd993 Mon Sep 17 00:00:00 2001 From: Vincent Rogier Date: Wed, 8 Feb 2023 20:30:58 +0100 Subject: [PATCH 3/7] Update changelog --- ChangeLog | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4c65617..bc049dc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2023-02-XX 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 + + 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: From 531dc46bdb935e80aa4d431e62a42061a2c8c30f Mon Sep 17 00:00:00 2001 From: Vincent Rogier Date: Thu, 9 Feb 2023 21:11:34 +0100 Subject: [PATCH 4/7] Preparing V4.7.6 release --- ChangeLog | 4 ++-- VERSION | 2 +- doxygen/Doxyfile.dox | 2 +- doxygen/Introduction.txt | 2 +- include/ocilibc/api.h | 8 ++++++-- nuget/ocilib.nuspec | 4 ++-- ocilib.pc | 2 +- proj/dll/main.rc | 20 ++++++++++---------- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc049dc9..bb2277ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2023-02-XX Version 4.7.6 Vincent Rogier vince.rogier@ocilib.net +2023-02-08 Version 4.7.6 Vincent Rogier vince.rogier@ocilib.net * Fixes (C API) @@ -6,7 +6,7 @@ * Fixes (C++ API) - - Issue 325: ocilib::Lob::GetConnection() does not compile anymore + - 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 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/nuget/ocilib.nuspec b/nuget/ocilib.nuspec index 0da82019..d8116943 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 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" From dc726d8a3b9a2ac5fb50032a113cf9042b695c94 Mon Sep 17 00:00:00 2001 From: Vincent Rogier Date: Thu, 9 Feb 2023 21:24:07 +0100 Subject: [PATCH 5/7] updated OCI_VERSION_COMPILE constant to OCI_21_3 --- src/defs.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 */ From 971f6142a73e590ff659573ffc4aadf23d3dafc6 Mon Sep 17 00:00:00 2001 From: Vincent Rogier Date: Thu, 9 Feb 2023 21:33:49 +0100 Subject: [PATCH 6/7] update OCILIB_REVISION_VERSION --- include/ocilibc/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From 2ca30a8e7b39d95fa8f7181ca3d978132918f1a8 Mon Sep 17 00:00:00 2001 From: Vincent Rogier Date: Thu, 9 Feb 2023 22:09:25 +0100 Subject: [PATCH 7/7] Update nuspec for v4.7.6 release --- nuget/ocilib.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget/ocilib.nuspec b/nuget/ocilib.nuspec index d8116943..f4091398 100644 --- a/nuget/ocilib.nuspec +++ b/nuget/ocilib.nuspec @@ -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 - +