| 1 | // |
| 2 | // SQLExecutor.h |
| 3 | // |
| 4 | // Definition of the SQLExecutor class. |
| 5 | // |
| 6 | // Copyright (c) 2008, Applied Informatics Software Engineering GmbH. |
| 7 | // and Contributors. |
| 8 | // |
| 9 | // SPDX-License-Identifier: BSL-1.0 |
| 10 | // |
| 11 | |
| 12 | |
| 13 | #ifndef SQLExecutor_INCLUDED |
| 14 | #define SQLExecutor_INCLUDED |
| 15 | |
| 16 | |
| 17 | #include "Poco/SQL/MySQL/MySQL.h" |
| 18 | #include "Poco/SQL/Session.h" |
| 19 | |
| 20 | |
| 21 | class SQLExecutor: public CppUnit::TestCase |
| 22 | { |
| 23 | public: |
| 24 | enum DataBinding |
| 25 | { |
| 26 | PB_IMMEDIATE, |
| 27 | PB_AT_EXEC |
| 28 | }; |
| 29 | |
| 30 | enum |
| 31 | { |
| 32 | DE_MANUAL, |
| 33 | DE_BOUND |
| 34 | }; |
| 35 | |
| 36 | SQLExecutor(const std::string& name, Poco::SQL::Session* _pSession); |
| 37 | ~SQLExecutor(); |
| 38 | |
| 39 | void bareboneMySQLTest(const std::string& host, const std::string& user, const std::string& pwd, const std::string& db, const std::string& port, const char* tableCreateString); |
| 40 | /// This function uses "bare bone" MySQL API calls (i.e. calls are not |
| 41 | /// "wrapped" in PocoData framework structures). |
| 42 | /// The purpose of the function is to verify that driver behaves |
| 43 | /// correctly. If this test passes, subsequent tests failures are likely ours. |
| 44 | |
| 45 | void simpleAccess(); |
| 46 | void complexType(); |
| 47 | void simpleAccessVector(); |
| 48 | void complexTypeVector(); |
| 49 | void insertVector(); |
| 50 | void insertEmptyVector(); |
| 51 | |
| 52 | void insertSingleBulk(); |
| 53 | void insertSingleBulkVec(); |
| 54 | |
| 55 | void limits(); |
| 56 | void limitOnce(); |
| 57 | void limitPrepare(); |
| 58 | void limitZero(); |
| 59 | void prepare(); |
| 60 | |
| 61 | void setSimple(); |
| 62 | void setComplex(); |
| 63 | void setComplexUnique(); |
| 64 | void multiSetSimple(); |
| 65 | void multiSetComplex(); |
| 66 | void mapComplex(); |
| 67 | void mapComplexUnique(); |
| 68 | void multiMapComplex(); |
| 69 | void selectIntoSingle(); |
| 70 | void selectIntoSingleStep(); |
| 71 | void selectIntoSingleFail(); |
| 72 | void lowerLimitOk(); |
| 73 | void lowerLimitFail(); |
| 74 | void combinedLimits(); |
| 75 | void combinedIllegalLimits(); |
| 76 | void ranges(); |
| 77 | void illegalRange(); |
| 78 | void singleSelect(); |
| 79 | void emptyDB(); |
| 80 | |
| 81 | void blob(unsigned int bigSize = ~0); |
| 82 | void blobStmt(); |
| 83 | void longText(); |
| 84 | void dateTime(); |
| 85 | void date(); |
| 86 | void time(); |
| 87 | void unsignedInts(); |
| 88 | void floats(); |
| 89 | void doubles(); |
| 90 | void any(); |
| 91 | void dynamicAny(); |
| 92 | void tuples(); |
| 93 | void tupleVector(); |
| 94 | |
| 95 | void stdTuples(); |
| 96 | void stdTupleVector(); |
| 97 | |
| 98 | void (); |
| 99 | void doNull(); |
| 100 | |
| 101 | void sessionTransaction(const std::string& connect); |
| 102 | void transaction(const std::string& connect); |
| 103 | |
| 104 | void reconnect(); |
| 105 | |
| 106 | private: |
| 107 | void setTransactionIsolation(Poco::SQL::Session& session, Poco::UInt32 ti); |
| 108 | |
| 109 | Poco::SQL::Session* _pSession; |
| 110 | }; |
| 111 | |
| 112 | |
| 113 | #endif // SQLExecutor_INCLUDED |
| 114 | |