From 1c9ca379239dc4c1e0f13a260f3ebda84b651a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Sat, 19 Jun 2021 10:05:12 +0200 Subject: [PATCH] ODBC tests for UUID, updated ActiveRecord projects --- ActiveRecord/ActiveRecord_vs140.vcxproj | 1 - .../ActiveRecord_vs140.vcxproj.filters | 9 +++----- ActiveRecord/ActiveRecord_vs150.vcxproj | 1 - .../ActiveRecord_vs150.vcxproj.filters | 9 +++----- ActiveRecord/ActiveRecord_vs160.vcxproj | 1 - .../ActiveRecord_vs160.vcxproj.filters | 9 +++----- ActiveRecord/ActiveRecord_vs90.vcproj | 4 ---- Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp | 10 ++++++++ Data/ODBC/testsuite/src/ODBCSQLServerTest.h | 1 + Data/ODBC/testsuite/src/ODBCTest.cpp | 15 ++++++++++++ Data/ODBC/testsuite/src/ODBCTest.h | 9 ++++++++ Data/ODBC/testsuite/src/SQLExecutor.cpp | 23 +++++++++++++++++++ Data/ODBC/testsuite/src/SQLExecutor.h | 1 + 13 files changed, 68 insertions(+), 25 deletions(-) diff --git a/ActiveRecord/ActiveRecord_vs140.vcxproj b/ActiveRecord/ActiveRecord_vs140.vcxproj index a29fefe25..eb1d1e32e 100644 --- a/ActiveRecord/ActiveRecord_vs140.vcxproj +++ b/ActiveRecord/ActiveRecord_vs140.vcxproj @@ -547,7 +547,6 @@ - diff --git a/ActiveRecord/ActiveRecord_vs140.vcxproj.filters b/ActiveRecord/ActiveRecord_vs140.vcxproj.filters index 095b4e333..77aa7675c 100644 --- a/ActiveRecord/ActiveRecord_vs140.vcxproj.filters +++ b/ActiveRecord/ActiveRecord_vs140.vcxproj.filters @@ -2,13 +2,13 @@ - {eb0280a1-a66f-43a9-b087-283f3d9139d1} + {a2961e06-9534-4945-9e33-934994da5c47} - {2f82c075-05e0-4477-9388-91cf1e241f3e} + {a04c32cc-eb8e-4257-a1fc-abdceac6ef39} - {31a3a452-f2fc-4069-b735-edde3b7f789c} + {2c6e1f7c-78bd-4a1a-8c85-581b5684a1ee} @@ -30,9 +30,6 @@ ActiveRecord\Header Files - - ActiveRecord\Header Files - diff --git a/ActiveRecord/ActiveRecord_vs150.vcxproj b/ActiveRecord/ActiveRecord_vs150.vcxproj index f214691af..e548fa0ce 100644 --- a/ActiveRecord/ActiveRecord_vs150.vcxproj +++ b/ActiveRecord/ActiveRecord_vs150.vcxproj @@ -547,7 +547,6 @@ - diff --git a/ActiveRecord/ActiveRecord_vs150.vcxproj.filters b/ActiveRecord/ActiveRecord_vs150.vcxproj.filters index 43ecb74d0..f26a5395b 100644 --- a/ActiveRecord/ActiveRecord_vs150.vcxproj.filters +++ b/ActiveRecord/ActiveRecord_vs150.vcxproj.filters @@ -2,13 +2,13 @@ - {ceead541-8bf8-4ce1-9bc2-20efb73de1e6} + {a4ef5b7c-1517-45e6-8856-e9a6c0a9193c} - {f0cd499d-26dc-4a15-950b-713fefc2140e} + {28638692-307b-4c80-9fed-23bcf87f7cc1} - {07561f15-f350-4d4d-bd7c-8108cc3f72ed} + {0b612e41-e6c4-48fa-9e02-ba01ee09fb19} @@ -30,9 +30,6 @@ ActiveRecord\Header Files - - ActiveRecord\Header Files - diff --git a/ActiveRecord/ActiveRecord_vs160.vcxproj b/ActiveRecord/ActiveRecord_vs160.vcxproj index 0317a60e0..d6663ac5c 100644 --- a/ActiveRecord/ActiveRecord_vs160.vcxproj +++ b/ActiveRecord/ActiveRecord_vs160.vcxproj @@ -547,7 +547,6 @@ - diff --git a/ActiveRecord/ActiveRecord_vs160.vcxproj.filters b/ActiveRecord/ActiveRecord_vs160.vcxproj.filters index bcf167d19..f97048f13 100644 --- a/ActiveRecord/ActiveRecord_vs160.vcxproj.filters +++ b/ActiveRecord/ActiveRecord_vs160.vcxproj.filters @@ -2,13 +2,13 @@ - {2d793a01-367a-4494-8825-e83fc6bf6a9b} + {0c7ca2fc-405c-41cb-8a85-0c0be704bb61} - {724c795a-0793-4a4e-a7b2-50ef1a3535e6} + {dc022939-cad7-4896-a860-11904f78b5e8} - {b72bbac1-7fd7-4167-a4fa-4c700c2636bf} + {ff728db9-1520-40b8-89fd-93aa9669be62} @@ -30,9 +30,6 @@ ActiveRecord\Header Files - - ActiveRecord\Header Files - diff --git a/ActiveRecord/ActiveRecord_vs90.vcproj b/ActiveRecord/ActiveRecord_vs90.vcproj index 7dd907060..705042b67 100644 --- a/ActiveRecord/ActiveRecord_vs90.vcproj +++ b/ActiveRecord/ActiveRecord_vs90.vcproj @@ -524,10 +524,6 @@ RelativePath=".\include\Poco\ActiveRecord\StatementPlaceholderProvider.h" > - - setFeature("autoBind", bindValue(i)); + _pSession->setFeature("autoExtract", bindValue(i+1)); + _pExecutor->uuids(); + i += 2; + } +} + + void ODBCTest::testTuple() { if (!_pSession) fail ("Test not available."); diff --git a/Data/ODBC/testsuite/src/ODBCTest.h b/Data/ODBC/testsuite/src/ODBCTest.h index a9e605c29..d574ea8c2 100644 --- a/Data/ODBC/testsuite/src/ODBCTest.h +++ b/Data/ODBC/testsuite/src/ODBCTest.h @@ -113,6 +113,8 @@ public: virtual void testFloat(); virtual void testDouble(); + virtual void testUUID(); + virtual void testTuple(); virtual void testTupleVector(); @@ -166,6 +168,7 @@ protected: virtual void recreateStringsTable(); virtual void recreateIntsTable(); virtual void recreateFloatsTable(); + virtual void recreateUUIDsTable(); virtual void recreateTuplesTable(); virtual void recreateVectorsTable(); virtual void recreateAnysTable(); @@ -317,6 +320,12 @@ inline void ODBCTest::recreateFloatsTable() } +inline void ODBCTest::recreateUUIDsTable() +{ + throw Poco::NotImplementedException("ODBCTest::recreateUUIDsTable()"); +} + + inline void ODBCTest::recreateTuplesTable() { throw Poco::NotImplementedException("ODBCTest::recreateTuplesTable()"); diff --git a/Data/ODBC/testsuite/src/SQLExecutor.cpp b/Data/ODBC/testsuite/src/SQLExecutor.cpp index 483af8f6d..95aa2270b 100644 --- a/Data/ODBC/testsuite/src/SQLExecutor.cpp +++ b/Data/ODBC/testsuite/src/SQLExecutor.cpp @@ -1540,6 +1540,29 @@ void SQLExecutor::doubles() } +void SQLExecutor::uuids() +{ + std::string funct = "uuids()"; + Poco::UUID data("49cf6461-9b62-4163-9659-5472ef73153d"); + Poco::UUID ret; + + try { session() << "INSERT INTO Strings VALUES (?)", use(data), now; } + catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); } + catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); } + + int count = 0; + try { session() << "SELECT COUNT(*) FROM Strings", into(count), now; } + catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); } + catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); } + assertTrue (count == 1); + + try { session() << "SELECT str FROM Strings", into(ret), now; } + catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); } + catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); } + assertTrue (ret == data); +} + + void SQLExecutor::insertSingleBulkVec() { std::string funct = "insertSingleBulkVec()"; diff --git a/Data/ODBC/testsuite/src/SQLExecutor.h b/Data/ODBC/testsuite/src/SQLExecutor.h index d5a473534..fe220e73f 100644 --- a/Data/ODBC/testsuite/src/SQLExecutor.h +++ b/Data/ODBC/testsuite/src/SQLExecutor.h @@ -469,6 +469,7 @@ public: void time(); void floats(); void doubles(); + void uuids(); void tuples(); void tupleVector();