ODBCDB2Test.cpp 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329
  1. //
  2. // ODBCDB2Test.cpp
  3. //
  4. // $Id: //poco/Main/Data/ODBC/testsuite/src/ODBCDB2Test.cpp#5 $
  5. //
  6. // Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
  7. // and Contributors.
  8. //
  9. // Permission is hereby granted, free of charge, to any person or organization
  10. // obtaining a copy of the software and accompanying documentation covered by
  11. // this license (the "Software") to use, reproduce, display, distribute,
  12. // execute, and transmit the Software, and to prepare derivative works of the
  13. // Software, and to permit third-parties to whom the Software is furnished to
  14. // do so, all subject to the following:
  15. //
  16. // The copyright notices in the Software and this entire statement, including
  17. // the above license grant, this restriction and the following disclaimer,
  18. // must be included in all copies of the Software, in whole or in part, and
  19. // all derivative works of the Software, unless such copies or derivative
  20. // works are solely in the form of machine-executable object code generated by
  21. // a source language processor.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  24. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  25. // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  26. // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  27. // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  28. // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  29. // DEALINGS IN THE SOFTWARE.
  30. //
  31. #include "ODBCDB2Test.h"
  32. #include "CppUnit/TestCaller.h"
  33. #include "CppUnit/TestSuite.h"
  34. #include "Poco/String.h"
  35. #include "Poco/Format.h"
  36. #include "Poco/Tuple.h"
  37. #include "Poco/Exception.h"
  38. #include "Poco/Data/Common.h"
  39. #include "Poco/Data/BLOB.h"
  40. #include "Poco/Data/StatementImpl.h"
  41. #include "Poco/Data/ODBC/Connector.h"
  42. #include "Poco/Data/ODBC/Utility.h"
  43. #include "Poco/Data/ODBC/Diagnostics.h"
  44. #include "Poco/Data/ODBC/ODBCException.h"
  45. #include "Poco/Data/ODBC/ODBCStatementImpl.h"
  46. #include <sqltypes.h>
  47. #include <iostream>
  48. using namespace Poco::Data;
  49. using Poco::Data::ODBC::Utility;
  50. using Poco::Data::ODBC::ConnectionException;
  51. using Poco::Data::ODBC::StatementException;
  52. using Poco::Data::ODBC::StatementDiagnostics;
  53. using Poco::format;
  54. using Poco::Tuple;
  55. using Poco::NotFoundException;
  56. const bool ODBCDB2Test::bindValues[8] = {true, true, true, false, false, true, false, false};
  57. Poco::SharedPtr<Poco::Data::Session> ODBCDB2Test::_pSession = 0;
  58. Poco::SharedPtr<SQLExecutor> ODBCDB2Test::_pExecutor = 0;
  59. std::string ODBCDB2Test::_dbConnString;
  60. Poco::Data::ODBC::Utility::DriverMap ODBCDB2Test::_drivers;
  61. ODBCDB2Test::ODBCDB2Test(const std::string& name):
  62. CppUnit::TestCase(name)
  63. {
  64. }
  65. ODBCDB2Test::~ODBCDB2Test()
  66. {
  67. }
  68. void ODBCDB2Test::testBareboneODBC()
  69. {
  70. if (!_pSession) fail ("Test not available.");
  71. std::string tableCreateString = "CREATE TABLE Test "
  72. "(First VARCHAR(30),"
  73. "Second VARCHAR(30),"
  74. "Third BLOB,"
  75. "Fourth INTEGER,"
  76. "Fifth FLOAT,"
  77. "Sixth TIMESTAMP)";
  78. _pExecutor->bareboneODBCTest(_dbConnString, tableCreateString, SQLExecutor::PB_IMMEDIATE, SQLExecutor::DE_MANUAL);
  79. _pExecutor->bareboneODBCTest(_dbConnString, tableCreateString, SQLExecutor::PB_IMMEDIATE, SQLExecutor::DE_BOUND);
  80. _pExecutor->bareboneODBCTest(_dbConnString, tableCreateString, SQLExecutor::PB_AT_EXEC, SQLExecutor::DE_MANUAL);
  81. _pExecutor->bareboneODBCTest(_dbConnString, tableCreateString, SQLExecutor::PB_AT_EXEC, SQLExecutor::DE_BOUND);
  82. }
  83. void ODBCDB2Test::testSimpleAccess()
  84. {
  85. if (!_pSession) fail ("Test not available.");
  86. std::string tableName("Person");
  87. int count = 0;
  88. recreatePersonTable();
  89. *_pSession << "SELECT count(*) FROM sysibm.systables WHERE name = 'PERSON' AND creator = 'DB2ADMIN'",
  90. into(count),
  91. use(tableName),
  92. now;
  93. assert (1 == count);
  94. for (int i = 0; i < 8;)
  95. {
  96. recreatePersonTable();
  97. _pSession->setFeature("autoBind", bindValues[i]);
  98. _pSession->setFeature("autoExtract", bindValues[i+1]);
  99. _pExecutor->simpleAccess();
  100. i += 2;
  101. }
  102. }
  103. void ODBCDB2Test::testComplexType()
  104. {
  105. if (!_pSession) fail ("Test not available.");
  106. for (int i = 0; i < 8;)
  107. {
  108. recreatePersonTable();
  109. _pSession->setFeature("autoBind", bindValues[i]);
  110. _pSession->setFeature("autoExtract", bindValues[i+1]);
  111. _pExecutor->complexType();
  112. i += 2;
  113. }
  114. }
  115. void ODBCDB2Test::testSimpleAccessVector()
  116. {
  117. if (!_pSession) fail ("Test not available.");
  118. for (int i = 0; i < 8;)
  119. {
  120. recreatePersonTable();
  121. _pSession->setFeature("autoBind", bindValues[i]);
  122. _pSession->setFeature("autoExtract", bindValues[i+1]);
  123. _pExecutor->simpleAccessVector();
  124. i += 2;
  125. }
  126. }
  127. void ODBCDB2Test::testComplexTypeVector()
  128. {
  129. if (!_pSession) fail ("Test not available.");
  130. for (int i = 0; i < 8;)
  131. {
  132. recreatePersonTable();
  133. _pSession->setFeature("autoBind", bindValues[i]);
  134. _pSession->setFeature("autoExtract", bindValues[i+1]);
  135. _pExecutor->complexTypeVector();
  136. i += 2;
  137. }
  138. }
  139. void ODBCDB2Test::testInsertVector()
  140. {
  141. if (!_pSession) fail ("Test not available.");
  142. for (int i = 0; i < 8;)
  143. {
  144. recreateStringsTable();
  145. _pSession->setFeature("autoBind", bindValues[i]);
  146. _pSession->setFeature("autoExtract", bindValues[i+1]);
  147. _pExecutor->insertVector();
  148. i += 2;
  149. }
  150. }
  151. void ODBCDB2Test::testInsertEmptyVector()
  152. {
  153. if (!_pSession) fail ("Test not available.");
  154. for (int i = 0; i < 8;)
  155. {
  156. recreateStringsTable();
  157. _pSession->setFeature("autoBind", bindValues[i]);
  158. _pSession->setFeature("autoExtract", bindValues[i+1]);
  159. _pExecutor->insertEmptyVector();
  160. i += 2;
  161. }
  162. }
  163. void ODBCDB2Test::testSimpleAccessList()
  164. {
  165. if (!_pSession) fail ("Test not available.");
  166. for (int i = 0; i < 8;)
  167. {
  168. recreatePersonTable();
  169. _pSession->setFeature("autoBind", bindValues[i]);
  170. _pSession->setFeature("autoExtract", bindValues[i+1]);
  171. _pExecutor->simpleAccessList();
  172. i += 2;
  173. }
  174. }
  175. void ODBCDB2Test::testComplexTypeList()
  176. {
  177. if (!_pSession) fail ("Test not available.");
  178. for (int i = 0; i < 8;)
  179. {
  180. recreatePersonTable();
  181. _pSession->setFeature("autoBind", bindValues[i]);
  182. _pSession->setFeature("autoExtract", bindValues[i+1]);
  183. _pExecutor->complexTypeList();
  184. i += 2;
  185. }
  186. }
  187. void ODBCDB2Test::testInsertList()
  188. {
  189. if (!_pSession) fail ("Test not available.");
  190. for (int i = 0; i < 8;)
  191. {
  192. recreateStringsTable();
  193. _pSession->setFeature("autoBind", bindValues[i]);
  194. _pSession->setFeature("autoExtract", bindValues[i+1]);
  195. _pExecutor->insertList();
  196. i += 2;
  197. }
  198. }
  199. void ODBCDB2Test::testInsertEmptyList()
  200. {
  201. if (!_pSession) fail ("Test not available.");
  202. for (int i = 0; i < 8;)
  203. {
  204. recreateStringsTable();
  205. _pSession->setFeature("autoBind", bindValues[i]);
  206. _pSession->setFeature("autoExtract", bindValues[i+1]);
  207. _pExecutor->insertEmptyList();
  208. i += 2;
  209. }
  210. }
  211. void ODBCDB2Test::testSimpleAccessDeque()
  212. {
  213. if (!_pSession) fail ("Test not available.");
  214. for (int i = 0; i < 8;)
  215. {
  216. recreatePersonTable();
  217. _pSession->setFeature("autoBind", bindValues[i]);
  218. _pSession->setFeature("autoExtract", bindValues[i+1]);
  219. _pExecutor->simpleAccessDeque();
  220. i += 2;
  221. }
  222. }
  223. void ODBCDB2Test::testComplexTypeDeque()
  224. {
  225. if (!_pSession) fail ("Test not available.");
  226. for (int i = 0; i < 8;)
  227. {
  228. recreatePersonTable();
  229. _pSession->setFeature("autoBind", bindValues[i]);
  230. _pSession->setFeature("autoExtract", bindValues[i+1]);
  231. _pExecutor->complexTypeDeque();
  232. i += 2;
  233. }
  234. }
  235. void ODBCDB2Test::testInsertDeque()
  236. {
  237. if (!_pSession) fail ("Test not available.");
  238. for (int i = 0; i < 8;)
  239. {
  240. recreateStringsTable();
  241. _pSession->setFeature("autoBind", bindValues[i]);
  242. _pSession->setFeature("autoExtract", bindValues[i+1]);
  243. _pExecutor->insertDeque();
  244. i += 2;
  245. }
  246. }
  247. void ODBCDB2Test::testInsertEmptyDeque()
  248. {
  249. if (!_pSession) fail ("Test not available.");
  250. for (int i = 0; i < 8;)
  251. {
  252. recreateStringsTable();
  253. _pSession->setFeature("autoBind", bindValues[i]);
  254. _pSession->setFeature("autoExtract", bindValues[i+1]);
  255. _pExecutor->insertEmptyDeque();
  256. i += 2;
  257. }
  258. }
  259. void ODBCDB2Test::testInsertSingleBulk()
  260. {
  261. if (!_pSession) fail ("Test not available.");
  262. for (int i = 0; i < 8;)
  263. {
  264. recreateIntsTable();
  265. _pSession->setFeature("autoBind", bindValues[i]);
  266. _pSession->setFeature("autoExtract", bindValues[i+1]);
  267. _pExecutor->insertSingleBulk();
  268. i += 2;
  269. }
  270. }
  271. void ODBCDB2Test::testInsertSingleBulkVec()
  272. {
  273. if (!_pSession) fail ("Test not available.");
  274. for (int i = 0; i < 8;)
  275. {
  276. recreateIntsTable();
  277. _pSession->setFeature("autoBind", bindValues[i]);
  278. _pSession->setFeature("autoExtract", bindValues[i+1]);
  279. _pExecutor->insertSingleBulkVec();
  280. i += 2;
  281. }
  282. }
  283. void ODBCDB2Test::testLimit()
  284. {
  285. if (!_pSession) fail ("Test not available.");
  286. for (int i = 0; i < 8;)
  287. {
  288. recreateIntsTable();
  289. _pSession->setFeature("autoBind", bindValues[i]);
  290. _pSession->setFeature("autoExtract", bindValues[i+1]);
  291. _pExecutor->limits();
  292. i += 2;
  293. }
  294. }
  295. void ODBCDB2Test::testLimitZero()
  296. {
  297. if (!_pSession) fail ("Test not available.");
  298. for (int i = 0; i < 8;)
  299. {
  300. recreateIntsTable();
  301. _pSession->setFeature("autoBind", bindValues[i]);
  302. _pSession->setFeature("autoExtract", bindValues[i+1]);
  303. _pExecutor->limitZero();
  304. i += 2;
  305. }
  306. }
  307. void ODBCDB2Test::testLimitOnce()
  308. {
  309. if (!_pSession) fail ("Test not available.");
  310. recreateIntsTable();
  311. _pExecutor->limitOnce();
  312. }
  313. void ODBCDB2Test::testLimitPrepare()
  314. {
  315. if (!_pSession) fail ("Test not available.");
  316. for (int i = 0; i < 8;)
  317. {
  318. recreateIntsTable();
  319. _pSession->setFeature("autoBind", bindValues[i]);
  320. _pSession->setFeature("autoExtract", bindValues[i+1]);
  321. _pExecutor->limitPrepare();
  322. i += 2;
  323. }
  324. }
  325. void ODBCDB2Test::testPrepare()
  326. {
  327. if (!_pSession) fail ("Test not available.");
  328. for (int i = 0; i < 8;)
  329. {
  330. recreateIntsTable();
  331. _pSession->setFeature("autoBind", bindValues[i]);
  332. _pSession->setFeature("autoExtract", bindValues[i+1]);
  333. _pExecutor->prepare();
  334. i += 2;
  335. }
  336. }
  337. void ODBCDB2Test::testSetSimple()
  338. {
  339. if (!_pSession) fail ("Test not available.");
  340. for (int i = 0; i < 8;)
  341. {
  342. recreatePersonTable();
  343. _pSession->setFeature("autoBind", bindValues[i]);
  344. _pSession->setFeature("autoExtract", bindValues[i+1]);
  345. _pExecutor->setSimple();
  346. i += 2;
  347. }
  348. }
  349. void ODBCDB2Test::testSetComplex()
  350. {
  351. if (!_pSession) fail ("Test not available.");
  352. for (int i = 0; i < 8;)
  353. {
  354. recreatePersonTable();
  355. _pSession->setFeature("autoBind", bindValues[i]);
  356. _pSession->setFeature("autoExtract", bindValues[i+1]);
  357. _pExecutor->setComplex();
  358. i += 2;
  359. }
  360. }
  361. void ODBCDB2Test::testSetComplexUnique()
  362. {
  363. if (!_pSession) fail ("Test not available.");
  364. for (int i = 0; i < 8;)
  365. {
  366. recreatePersonTable();
  367. _pSession->setFeature("autoBind", bindValues[i]);
  368. _pSession->setFeature("autoExtract", bindValues[i+1]);
  369. _pExecutor->setComplexUnique();
  370. i += 2;
  371. }
  372. }
  373. void ODBCDB2Test::testMultiSetSimple()
  374. {
  375. if (!_pSession) fail ("Test not available.");
  376. for (int i = 0; i < 8;)
  377. {
  378. recreatePersonTable();
  379. _pSession->setFeature("autoBind", bindValues[i]);
  380. _pSession->setFeature("autoExtract", bindValues[i+1]);
  381. _pExecutor->multiSetSimple();
  382. i += 2;
  383. }
  384. }
  385. void ODBCDB2Test::testMultiSetComplex()
  386. {
  387. if (!_pSession) fail ("Test not available.");
  388. for (int i = 0; i < 8;)
  389. {
  390. recreatePersonTable();
  391. _pSession->setFeature("autoBind", bindValues[i]);
  392. _pSession->setFeature("autoExtract", bindValues[i+1]);
  393. _pExecutor->multiSetComplex();
  394. i += 2;
  395. }
  396. }
  397. void ODBCDB2Test::testMapComplex()
  398. {
  399. if (!_pSession) fail ("Test not available.");
  400. for (int i = 0; i < 8;)
  401. {
  402. recreatePersonTable();
  403. _pSession->setFeature("autoBind", bindValues[i]);
  404. _pSession->setFeature("autoExtract", bindValues[i+1]);
  405. _pExecutor->mapComplex();
  406. i += 2;
  407. }
  408. }
  409. void ODBCDB2Test::testMapComplexUnique()
  410. {
  411. if (!_pSession) fail ("Test not available.");
  412. for (int i = 0; i < 8;)
  413. {
  414. recreatePersonTable();
  415. _pSession->setFeature("autoBind", bindValues[i]);
  416. _pSession->setFeature("autoExtract", bindValues[i+1]);
  417. _pExecutor->mapComplexUnique();
  418. i += 2;
  419. }
  420. }
  421. void ODBCDB2Test::testMultiMapComplex()
  422. {
  423. if (!_pSession) fail ("Test not available.");
  424. for (int i = 0; i < 8;)
  425. {
  426. recreatePersonTable();
  427. _pSession->setFeature("autoBind", bindValues[i]);
  428. _pSession->setFeature("autoExtract", bindValues[i+1]);
  429. _pExecutor->multiMapComplex();
  430. i += 2;
  431. }
  432. }
  433. void ODBCDB2Test::testSelectIntoSingle()
  434. {
  435. if (!_pSession) fail ("Test not available.");
  436. for (int i = 0; i < 8;)
  437. {
  438. recreatePersonTable();
  439. _pSession->setFeature("autoBind", bindValues[i]);
  440. _pSession->setFeature("autoExtract", bindValues[i+1]);
  441. _pExecutor->selectIntoSingle();
  442. i += 2;
  443. }
  444. }
  445. void ODBCDB2Test::testSelectIntoSingleStep()
  446. {
  447. if (!_pSession) fail ("Test not available.");
  448. for (int i = 0; i < 8;)
  449. {
  450. recreatePersonTable();
  451. _pSession->setFeature("autoBind", bindValues[i]);
  452. _pSession->setFeature("autoExtract", bindValues[i+1]);
  453. _pExecutor->selectIntoSingleStep();
  454. i += 2;
  455. }
  456. }
  457. void ODBCDB2Test::testSelectIntoSingleFail()
  458. {
  459. if (!_pSession) fail ("Test not available.");
  460. for (int i = 0; i < 8;)
  461. {
  462. recreatePersonTable();
  463. _pSession->setFeature("autoBind", bindValues[i]);
  464. _pSession->setFeature("autoExtract", bindValues[i+1]);
  465. _pExecutor->selectIntoSingleFail();
  466. i += 2;
  467. }
  468. }
  469. void ODBCDB2Test::testLowerLimitOk()
  470. {
  471. if (!_pSession) fail ("Test not available.");
  472. for (int i = 0; i < 8;)
  473. {
  474. recreatePersonTable();
  475. _pSession->setFeature("autoBind", bindValues[i]);
  476. _pSession->setFeature("autoExtract", bindValues[i+1]);
  477. _pExecutor->lowerLimitOk();
  478. i += 2;
  479. }
  480. }
  481. void ODBCDB2Test::testSingleSelect()
  482. {
  483. if (!_pSession) fail ("Test not available.");
  484. for (int i = 0; i < 8;)
  485. {
  486. recreatePersonTable();
  487. _pSession->setFeature("autoBind", bindValues[i]);
  488. _pSession->setFeature("autoExtract", bindValues[i+1]);
  489. _pExecutor->singleSelect();
  490. i += 2;
  491. }
  492. }
  493. void ODBCDB2Test::testLowerLimitFail()
  494. {
  495. if (!_pSession) fail ("Test not available.");
  496. for (int i = 0; i < 8;)
  497. {
  498. recreatePersonTable();
  499. _pSession->setFeature("autoBind", bindValues[i]);
  500. _pSession->setFeature("autoExtract", bindValues[i+1]);
  501. _pExecutor->lowerLimitFail();
  502. i += 2;
  503. }
  504. }
  505. void ODBCDB2Test::testCombinedLimits()
  506. {
  507. if (!_pSession) fail ("Test not available.");
  508. for (int i = 0; i < 8;)
  509. {
  510. recreatePersonTable();
  511. _pSession->setFeature("autoBind", bindValues[i]);
  512. _pSession->setFeature("autoExtract", bindValues[i+1]);
  513. _pExecutor->combinedLimits();
  514. i += 2;
  515. }
  516. }
  517. void ODBCDB2Test::testRange()
  518. {
  519. if (!_pSession) fail ("Test not available.");
  520. for (int i = 0; i < 8;)
  521. {
  522. recreatePersonTable();
  523. _pSession->setFeature("autoBind", bindValues[i]);
  524. _pSession->setFeature("autoExtract", bindValues[i+1]);
  525. _pExecutor->ranges();
  526. i += 2;
  527. }
  528. }
  529. void ODBCDB2Test::testCombinedIllegalLimits()
  530. {
  531. if (!_pSession) fail ("Test not available.");
  532. for (int i = 0; i < 8;)
  533. {
  534. recreatePersonTable();
  535. _pSession->setFeature("autoBind", bindValues[i]);
  536. _pSession->setFeature("autoExtract", bindValues[i+1]);
  537. _pExecutor->combinedIllegalLimits();
  538. i += 2;
  539. }
  540. }
  541. void ODBCDB2Test::testIllegalRange()
  542. {
  543. if (!_pSession) fail ("Test not available.");
  544. for (int i = 0; i < 8;)
  545. {
  546. recreatePersonTable();
  547. _pSession->setFeature("autoBind", bindValues[i]);
  548. _pSession->setFeature("autoExtract", bindValues[i+1]);
  549. _pExecutor->illegalRange();
  550. i += 2;
  551. }
  552. }
  553. void ODBCDB2Test::testEmptyDB()
  554. {
  555. if (!_pSession) fail ("Test not available.");
  556. for (int i = 0; i < 8;)
  557. {
  558. recreatePersonTable();
  559. _pSession->setFeature("autoBind", bindValues[i]);
  560. _pSession->setFeature("autoExtract", bindValues[i+1]);
  561. _pExecutor->emptyDB();
  562. i += 2;
  563. }
  564. }
  565. void ODBCDB2Test::testBLOB()
  566. {
  567. if (!_pSession) fail ("Test not available.");
  568. const std::size_t maxFldSize = 1000000;
  569. _pSession->setProperty("maxFieldSize", Poco::Any(maxFldSize-1));
  570. recreatePersonBLOBTable();
  571. try
  572. {
  573. _pExecutor->blob(maxFldSize);
  574. fail ("must fail");
  575. }
  576. catch (DataException&)
  577. {
  578. _pSession->setProperty("maxFieldSize", Poco::Any(maxFldSize));
  579. }
  580. for (int i = 0; i < 8;)
  581. {
  582. recreatePersonBLOBTable();
  583. _pSession->setFeature("autoBind", bindValues[i]);
  584. _pSession->setFeature("autoExtract", bindValues[i+1]);
  585. _pExecutor->blob(maxFldSize);
  586. i += 2;
  587. }
  588. recreatePersonBLOBTable();
  589. try
  590. {
  591. _pExecutor->blob(maxFldSize+1);
  592. fail ("must fail");
  593. }
  594. catch (DataException&) { }
  595. }
  596. void ODBCDB2Test::testBLOBStmt()
  597. {
  598. if (!_pSession) fail ("Test not available.");
  599. for (int i = 0; i < 8;)
  600. {
  601. recreatePersonBLOBTable();
  602. _pSession->setFeature("autoBind", bindValues[i]);
  603. _pSession->setFeature("autoExtract", bindValues[i+1]);
  604. _pExecutor->blobStmt();
  605. i += 2;
  606. }
  607. }
  608. void ODBCDB2Test::testDateTime()
  609. {
  610. if (!_pSession) fail ("Test not available.");
  611. for (int i = 0; i < 8;)
  612. {
  613. recreatePersonDateTimeTable();
  614. _pSession->setFeature("autoBind", bindValues[i]);
  615. _pSession->setFeature("autoExtract", bindValues[i+1]);
  616. _pExecutor->dateTime();
  617. i += 2;
  618. }
  619. }
  620. void ODBCDB2Test::testFloat()
  621. {
  622. if (!_pSession) fail ("Test not available.");
  623. for (int i = 0; i < 8;)
  624. {
  625. recreateFloatsTable();
  626. _pSession->setFeature("autoBind", bindValues[i]);
  627. _pSession->setFeature("autoExtract", bindValues[i+1]);
  628. _pExecutor->floats();
  629. i += 2;
  630. }
  631. }
  632. void ODBCDB2Test::testDouble()
  633. {
  634. if (!_pSession) fail ("Test not available.");
  635. for (int i = 0; i < 8;)
  636. {
  637. recreateFloatsTable();
  638. _pSession->setFeature("autoBind", bindValues[i]);
  639. _pSession->setFeature("autoExtract", bindValues[i+1]);
  640. _pExecutor->doubles();
  641. i += 2;
  642. }
  643. }
  644. void ODBCDB2Test::testTuple()
  645. {
  646. if (!_pSession) fail ("Test not available.");
  647. for (int i = 0; i < 8;)
  648. {
  649. recreateTuplesTable();
  650. _pSession->setFeature("autoBind", bindValues[i]);
  651. _pSession->setFeature("autoExtract", bindValues[i+1]);
  652. _pExecutor->tuples();
  653. i += 2;
  654. }
  655. }
  656. void ODBCDB2Test::testTupleVector()
  657. {
  658. if (!_pSession) fail ("Test not available.");
  659. for (int i = 0; i < 8;)
  660. {
  661. recreateTuplesTable();
  662. _pSession->setFeature("autoBind", bindValues[i]);
  663. _pSession->setFeature("autoExtract", bindValues[i+1]);
  664. _pExecutor->tupleVector();
  665. i += 2;
  666. }
  667. }
  668. void ODBCDB2Test::testInternalExtraction()
  669. {
  670. if (!_pSession) fail ("Test not available.");
  671. for (int i = 0; i < 8;)
  672. {
  673. recreateVectorsTable();
  674. _pSession->setFeature("autoBind", bindValues[i]);
  675. _pSession->setFeature("autoExtract", bindValues[i+1]);
  676. _pExecutor->internalExtraction();
  677. i += 2;
  678. }
  679. }
  680. void ODBCDB2Test::testInternalStorageType()
  681. {
  682. if (!_pSession) fail ("Test not available.");
  683. for (int i = 0; i < 8;)
  684. {
  685. recreateVectorsTable();
  686. _pSession->setFeature("autoBind", bindValues[i]);
  687. _pSession->setFeature("autoExtract", bindValues[i+1]);
  688. _pExecutor->internalStorageType();
  689. i += 2;
  690. }
  691. }
  692. void ODBCDB2Test::testNull()
  693. {
  694. if (!_pSession) fail ("Test not available.");
  695. // test for NOT NULL violation exception
  696. for (int i = 0; i < 8;)
  697. {
  698. recreateNullsTable("NOT NULL");
  699. _pSession->setFeature("autoBind", bindValues[i]);
  700. _pSession->setFeature("autoExtract", bindValues[i+1]);
  701. _pExecutor->notNulls();
  702. i += 2;
  703. }
  704. // test for null insertion
  705. for (int i = 0; i < 8;)
  706. {
  707. recreateNullsTable();
  708. _pSession->setFeature("autoBind", bindValues[i]);
  709. _pSession->setFeature("autoExtract", bindValues[i+1]);
  710. _pExecutor->nulls();
  711. i += 2;
  712. }
  713. }
  714. void ODBCDB2Test::testStoredProcedure()
  715. {
  716. if (!_pSession) fail ("Test not available.");
  717. for (int k = 0; k < 8;)
  718. {
  719. _pSession->setFeature("autoBind", bindValues[k]);
  720. _pSession->setFeature("autoExtract", bindValues[k+1]);
  721. dropObject("PROCEDURE", "storedProcedure");
  722. *_pSession << "CREATE PROCEDURE storedProcedure(OUT outParam INTEGER) "
  723. "BEGIN "
  724. " SET outParam = -1; "
  725. "END" , now;
  726. int i = 0;
  727. *_pSession << "{call storedProcedure(?)}", out(i), now;
  728. assert(-1 == i);
  729. dropObject("PROCEDURE", "storedProcedure");
  730. *_pSession << "CREATE PROCEDURE storedProcedure(inParam INTEGER, OUT outParam INTEGER) "
  731. "BEGIN "
  732. " SET outParam = inParam*inParam; "
  733. "END" , now;
  734. i = 2;
  735. int j = 0;
  736. *_pSession << "{call storedProcedure(?, ?)}", in(i), out(j), now;
  737. assert(4 == j);
  738. dropObject("PROCEDURE", "storedProcedure");
  739. *_pSession << "CREATE PROCEDURE storedProcedure(INOUT ioParam INTEGER) "
  740. "BEGIN "
  741. " SET ioParam = ioParam*ioParam; "
  742. "END" , now;
  743. i = 2;
  744. *_pSession << "{call storedProcedure(?)}", io(i), now;
  745. assert(4 == i);
  746. dropObject("PROCEDURE", "storedProcedure");
  747. //TIMESTAMP is not supported as stored procedure parameter in DB2
  748. //(SQL0182N An expression with a datetime value or a labeled duration is not valid.)
  749. *_pSession << "CREATE PROCEDURE storedProcedure(inParam VARCHAR(1000), OUT outParam VARCHAR(1000)) "
  750. "BEGIN "
  751. " SET outParam = inParam; "
  752. "END" , now;
  753. std::string inParam =
  754. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  755. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  756. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  757. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  758. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  759. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  760. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  761. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
  762. "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
  763. std::string outParam;
  764. *_pSession << "{call storedProcedure(?,?)}", in(inParam), out(outParam), now;
  765. assert(inParam == outParam);
  766. dropObject("PROCEDURE", "storedProcedure");
  767. k += 2;
  768. }
  769. }
  770. void ODBCDB2Test::testStoredFunction()
  771. {
  772. if (!_pSession) fail ("Test not available.");
  773. for (int k = 0; k < 8;)
  774. {
  775. _pSession->setFeature("autoBind", bindValues[k]);
  776. _pSession->setFeature("autoExtract", bindValues[k+1]);
  777. dropObject("PROCEDURE", "storedFunction");
  778. *_pSession << "CREATE PROCEDURE storedFunction() "
  779. "BEGIN "
  780. " RETURN -1; "
  781. "END" , now;
  782. int i = 0;
  783. *_pSession << "{? = call storedFunction()}", out(i), now;
  784. assert(-1 == i);
  785. dropObject("PROCEDURE", "storedFunction");
  786. *_pSession << "CREATE PROCEDURE storedFunction(inParam INTEGER) "
  787. "BEGIN "
  788. " RETURN inParam*inParam; "
  789. "END" , now;
  790. i = 2;
  791. int result = 0;
  792. *_pSession << "{? = call storedFunction(?)}", out(result), in(i), now;
  793. assert(4 == result);
  794. dropObject("PROCEDURE", "storedFunction");
  795. *_pSession << "CREATE PROCEDURE storedFunction(inParam INTEGER, OUT outParam INTEGER) "
  796. "BEGIN "
  797. " SET outParam = inParam*inParam; "
  798. " RETURN outParam; "
  799. "END" , now;
  800. i = 2;
  801. int j = 0;
  802. result = 0;
  803. *_pSession << "{? = call storedFunction(?, ?)}", out(result), in(i), out(j), now;
  804. assert(4 == j);
  805. assert(j == result);
  806. dropObject("PROCEDURE", "storedFunction");
  807. *_pSession << "CREATE PROCEDURE storedFunction(INOUT param1 INTEGER, INOUT param2 INTEGER) "
  808. "BEGIN "
  809. " DECLARE temp INTEGER;"
  810. " SET temp = param1; "
  811. " SET param1 = param2; "
  812. " SET param2 = temp; "
  813. " RETURN param1 + param2; "
  814. "END" , now;
  815. i = 1;
  816. j = 2;
  817. result = 0;
  818. *_pSession << "{? = call storedFunction(?, ?)}", out(result), io(i), io(j), now;
  819. assert(1 == j);
  820. assert(2 == i);
  821. assert(3 == result);
  822. Tuple<int, int> params(1, 2);
  823. assert(1 == params.get<0>());
  824. assert(2 == params.get<1>());
  825. result = 0;
  826. *_pSession << "{? = call storedFunction(?, ?)}", out(result), io(params), now;
  827. assert(1 == params.get<1>());
  828. assert(2 == params.get<0>());
  829. assert(3 == result);
  830. dropObject("PROCEDURE", "storedFunction");
  831. _pSession->setFeature("autoBind", true);
  832. *_pSession << "CREATE PROCEDURE storedFunction(inParam VARCHAR(10), OUT outParam VARCHAR(10)) "
  833. "BEGIN "
  834. " SET outParam = inParam; "
  835. " RETURN LENGTH(outParam);"//DB2 allows only integer as return type
  836. "END" , now;
  837. std::string inParam = "123456789";
  838. std::string outParam;
  839. int ret;
  840. *_pSession << "{? = call storedFunction(?,?)}", out(ret), in(inParam), out(outParam), now;
  841. assert(inParam == outParam);
  842. assert(ret == inParam.size());
  843. dropObject("PROCEDURE", "storedFunction");
  844. k += 2;
  845. }
  846. }
  847. void ODBCDB2Test::testRowIterator()
  848. {
  849. if (!_pSession) fail ("Test not available.");
  850. for (int i = 0; i < 8;)
  851. {
  852. recreateVectorsTable();
  853. _pSession->setFeature("autoBind", bindValues[i]);
  854. _pSession->setFeature("autoExtract", bindValues[i+1]);
  855. _pExecutor->rowIterator();
  856. i += 2;
  857. }
  858. }
  859. void ODBCDB2Test::dropObject(const std::string& type, const std::string& name)
  860. {
  861. try
  862. {
  863. *_pSession << format("DROP %s %s", type, name), now;
  864. }
  865. catch (StatementException& ex)
  866. {
  867. bool ignoreError = false;
  868. const StatementDiagnostics::FieldVec& flds = ex.diagnostics().fields();
  869. StatementDiagnostics::Iterator it = flds.begin();
  870. for (; it != flds.end(); ++it)
  871. {
  872. if (-204 == it->_nativeError)//(table does not exist)
  873. {
  874. ignoreError = true;
  875. break;
  876. }
  877. }
  878. if (!ignoreError) throw;
  879. }
  880. }
  881. void ODBCDB2Test::recreatePersonTable()
  882. {
  883. dropObject("TABLE", "Person");
  884. try { *_pSession << "CREATE TABLE Person (LastName VARCHAR(30), FirstName VARCHAR(30), Address VARCHAR(30), Age INTEGER)", now; }
  885. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreatePersonTable()"); }
  886. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreatePersonTable()"); }
  887. }
  888. void ODBCDB2Test::recreatePersonBLOBTable()
  889. {
  890. dropObject("TABLE", "Person");
  891. try { *_pSession << "CREATE TABLE Person (LastName VARCHAR(30), FirstName VARCHAR(30), Address VARCHAR(30), Image BLOB)", now; }
  892. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreatePersonBLOBTable()"); }
  893. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreatePersonBLOBTable()"); }
  894. }
  895. void ODBCDB2Test::recreatePersonDateTimeTable()
  896. {
  897. dropObject("TABLE", "Person");
  898. try { *_pSession << "CREATE TABLE Person (LastName VARCHAR(30), FirstName VARCHAR(30), Address VARCHAR(30), Born TIMESTAMP)", now; }
  899. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreatePersonDateTimeTable()"); }
  900. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreatePersonDateTimeTable()"); }
  901. }
  902. void ODBCDB2Test::recreateIntsTable()
  903. {
  904. dropObject("TABLE", "Strings");
  905. try { *_pSession << "CREATE TABLE Strings (str INTEGER)", now; }
  906. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateIntsTable()"); }
  907. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateIntsTable()"); }
  908. }
  909. void ODBCDB2Test::recreateStringsTable()
  910. {
  911. dropObject("TABLE", "Strings");
  912. try { *_pSession << "CREATE TABLE Strings (str VARCHAR(30))", now; }
  913. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateStringsTable()"); }
  914. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateStringsTable()"); }
  915. }
  916. void ODBCDB2Test::recreateFloatsTable()
  917. {
  918. dropObject("TABLE", "Strings");
  919. try { *_pSession << "CREATE TABLE Strings (str FLOAT)", now; }
  920. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateFloatsTable()"); }
  921. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateFloatsTable()"); }
  922. }
  923. void ODBCDB2Test::recreateTuplesTable()
  924. {
  925. dropObject("TABLE", "Tuples");
  926. try { *_pSession << "CREATE TABLE Tuples "
  927. "(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER, "
  928. "int7 INTEGER, int8 INTEGER, int9 INTEGER, int10 INTEGER, int11 INTEGER, int12 INTEGER, int13 INTEGER,"
  929. "int14 INTEGER, int15 INTEGER, int16 INTEGER, int17 INTEGER, int18 INTEGER, int19 INTEGER)", now; }
  930. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateTuplesTable()"); }
  931. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateTuplesTable()"); }
  932. }
  933. void ODBCDB2Test::recreateVectorsTable()
  934. {
  935. dropObject("TABLE", "Vectors");
  936. try { *_pSession << "CREATE TABLE Vectors (i0 INTEGER, flt0 FLOAT, str0 VARCHAR(30))", now; }
  937. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateVectorsTable()"); }
  938. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateVectorsTable()"); }
  939. }
  940. void ODBCDB2Test::recreateNullsTable(const std::string& notNull)
  941. {
  942. dropObject("TABLE", "NullTest");
  943. try { *_pSession << format("CREATE TABLE NullTest (i INTEGER %s, r FLOAT %s, v VARCHAR(30) %s)",
  944. notNull,
  945. notNull,
  946. notNull), now; }
  947. catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateNullsTable()"); }
  948. catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateNullsTable()"); }
  949. }
  950. bool ODBCDB2Test::canConnect(const std::string& driver, const std::string& dsn)
  951. {
  952. Utility::DriverMap::iterator itDrv = _drivers.begin();
  953. for (; itDrv != _drivers.end(); ++itDrv)
  954. {
  955. if (((itDrv->first).find(driver) != std::string::npos))
  956. {
  957. std::cout << "Driver found: " << itDrv->first
  958. << " (" << itDrv->second << ')' << std::endl;
  959. break;
  960. }
  961. }
  962. if (_drivers.end() == itDrv)
  963. {
  964. std::cout << driver << " driver NOT found, tests not available." << std::endl;
  965. return false;
  966. }
  967. Utility::DSNMap dataSources;
  968. Utility::dataSources(dataSources);
  969. Utility::DSNMap::iterator itDSN = dataSources.begin();
  970. for (; itDSN != dataSources.end(); ++itDSN)
  971. {
  972. if (itDSN->first == dsn && itDSN->second == driver)
  973. {
  974. std::cout << "DSN found: " << itDSN->first
  975. << " (" << itDSN->second << ')' << std::endl;
  976. format(_dbConnString, "DSN=%s", dsn);
  977. return true;
  978. }
  979. }
  980. // DSN not found, try connect without it
  981. format(_dbConnString, "Driver=%s;"
  982. "Database=POCOTEST;"
  983. "Hostname=localhost;"
  984. "Port=50000;"
  985. "Protocol=TCPIP;"
  986. "Uid=db2admin;"
  987. "Pwd=db2admin;", driver);
  988. return true;
  989. }
  990. void ODBCDB2Test::setUp()
  991. {
  992. }
  993. void ODBCDB2Test::tearDown()
  994. {
  995. dropObject("TABLE", "Person");
  996. dropObject("TABLE", "Strings");
  997. dropObject("TABLE", "Tuples");
  998. }
  999. bool ODBCDB2Test::init(const std::string& driver, const std::string& dsn)
  1000. {
  1001. Utility::drivers(_drivers);
  1002. if (!canConnect(driver, dsn)) return false;
  1003. ODBC::Connector::registerConnector();
  1004. try
  1005. {
  1006. _pSession = new Session(ODBC::Connector::KEY, _dbConnString);
  1007. }catch (ConnectionException& ex)
  1008. {
  1009. std::cout << ex.toString() << std::endl;
  1010. return false;
  1011. }
  1012. if (_pSession && _pSession->isConnected())
  1013. std::cout << "*** Connected to [" << driver << "] test database." << std::endl;
  1014. _pExecutor = new SQLExecutor(driver + " SQL Executor", _pSession);
  1015. return true;
  1016. }
  1017. CppUnit::Test* ODBCDB2Test::suite()
  1018. {
  1019. if (init("IBM DB2 ODBC DRIVER - DB2COPY1", "PocoDataDB2Test"))
  1020. {
  1021. CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ODBCDB2Test");
  1022. CppUnit_addTest(pSuite, ODBCDB2Test, testBareboneODBC);
  1023. CppUnit_addTest(pSuite, ODBCDB2Test, testSimpleAccess);
  1024. CppUnit_addTest(pSuite, ODBCDB2Test, testComplexType);
  1025. CppUnit_addTest(pSuite, ODBCDB2Test, testSimpleAccessVector);
  1026. CppUnit_addTest(pSuite, ODBCDB2Test, testComplexTypeVector);
  1027. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertVector);
  1028. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertEmptyVector);
  1029. CppUnit_addTest(pSuite, ODBCDB2Test, testSimpleAccessList);
  1030. CppUnit_addTest(pSuite, ODBCDB2Test, testComplexTypeList);
  1031. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertList);
  1032. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertEmptyList);
  1033. CppUnit_addTest(pSuite, ODBCDB2Test, testSimpleAccessDeque);
  1034. CppUnit_addTest(pSuite, ODBCDB2Test, testComplexTypeDeque);
  1035. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertDeque);
  1036. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertEmptyDeque);
  1037. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertSingleBulk);
  1038. CppUnit_addTest(pSuite, ODBCDB2Test, testInsertSingleBulkVec);
  1039. CppUnit_addTest(pSuite, ODBCDB2Test, testLimit);
  1040. CppUnit_addTest(pSuite, ODBCDB2Test, testLimitOnce);
  1041. CppUnit_addTest(pSuite, ODBCDB2Test, testLimitPrepare);
  1042. CppUnit_addTest(pSuite, ODBCDB2Test, testLimitZero);
  1043. CppUnit_addTest(pSuite, ODBCDB2Test, testPrepare);
  1044. CppUnit_addTest(pSuite, ODBCDB2Test, testSetSimple);
  1045. CppUnit_addTest(pSuite, ODBCDB2Test, testSetComplex);
  1046. CppUnit_addTest(pSuite, ODBCDB2Test, testSetComplexUnique);
  1047. CppUnit_addTest(pSuite, ODBCDB2Test, testMultiSetSimple);
  1048. CppUnit_addTest(pSuite, ODBCDB2Test, testMultiSetComplex);
  1049. CppUnit_addTest(pSuite, ODBCDB2Test, testMapComplex);
  1050. CppUnit_addTest(pSuite, ODBCDB2Test, testMapComplexUnique);
  1051. CppUnit_addTest(pSuite, ODBCDB2Test, testMultiMapComplex);
  1052. CppUnit_addTest(pSuite, ODBCDB2Test, testSelectIntoSingle);
  1053. CppUnit_addTest(pSuite, ODBCDB2Test, testSelectIntoSingleStep);
  1054. CppUnit_addTest(pSuite, ODBCDB2Test, testSelectIntoSingleFail);
  1055. CppUnit_addTest(pSuite, ODBCDB2Test, testLowerLimitOk);
  1056. CppUnit_addTest(pSuite, ODBCDB2Test, testLowerLimitFail);
  1057. CppUnit_addTest(pSuite, ODBCDB2Test, testCombinedLimits);
  1058. CppUnit_addTest(pSuite, ODBCDB2Test, testCombinedIllegalLimits);
  1059. CppUnit_addTest(pSuite, ODBCDB2Test, testRange);
  1060. CppUnit_addTest(pSuite, ODBCDB2Test, testIllegalRange);
  1061. CppUnit_addTest(pSuite, ODBCDB2Test, testSingleSelect);
  1062. CppUnit_addTest(pSuite, ODBCDB2Test, testEmptyDB);
  1063. CppUnit_addTest(pSuite, ODBCDB2Test, testBLOB);
  1064. CppUnit_addTest(pSuite, ODBCDB2Test, testBLOBStmt);
  1065. CppUnit_addTest(pSuite, ODBCDB2Test, testDateTime);
  1066. CppUnit_addTest(pSuite, ODBCDB2Test, testFloat);
  1067. CppUnit_addTest(pSuite, ODBCDB2Test, testDouble);
  1068. CppUnit_addTest(pSuite, ODBCDB2Test, testTuple);
  1069. CppUnit_addTest(pSuite, ODBCDB2Test, testTupleVector);
  1070. CppUnit_addTest(pSuite, ODBCDB2Test, testInternalExtraction);
  1071. CppUnit_addTest(pSuite, ODBCDB2Test, testInternalStorageType);
  1072. CppUnit_addTest(pSuite, ODBCDB2Test, testStoredProcedure);
  1073. CppUnit_addTest(pSuite, ODBCDB2Test, testStoredFunction);
  1074. CppUnit_addTest(pSuite, ODBCDB2Test, testNull);
  1075. CppUnit_addTest(pSuite, ODBCDB2Test, testRowIterator);
  1076. return pSuite;
  1077. }
  1078. return 0;
  1079. }