mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-22 13:35:30 +01:00

* fix(Data::AbstracSessionImpl): protect autocommit feature handlers #4261 * chore(CI): re-enable mysql * MySQL SessionImpl: make sure autocommit mode is on when session is openend or reset. * PostgreSQL SessionImpl: reuse autocommit flag of AbstractSessionImpl. * Github workflow: re-activated linux-gcc-make-postgres * Fixed indentation in ci.yml * Fix for DataTest SQLExecutor: use connector * Data::Session: when parser is not used and autocommit mode is off, assume any SQL statement begins a transaction. * PostgreSQL: don't use SQL parser (it currently cannot handle placeholders). * PostgreSQL: added test sessionTransactionNoAutoCommit * PostgreSQL test suite: removed reference to generic SQLExecutor * PostgreSQL: fixes for sessionTransactionNoAutoCommit. * MySQL: added test sessionPoolAndUnicode (from #2801) * Fixed #define in sql-parser * Data generic testsuite: support numbered placeholders * PostgreSQL test suite: added missing include directory to Makefile. * Attempt to fix PostgreSQL Makefiles * PostgreSQL testsuite: added include path to Makefile * PostgreSQL testsuite: added PocoDataTest library to Makefile * DataTest SQLExecutor::formatSQL: don't use string_view * PostgreSQL test suite: delegated most tests to Poco::Data::Test * Makefile: added dependencies on Data-Tests * Weaken assumptions about async in generic transaction tests * Makefile: added dependency for Prometheus samples * Fix deadlock in DataTest SQLExecutor * PostgreSQL tests SQLExecutor: cleanup * feat(Data::AbstractSessionImpl): add autoCommit property and tests #4261 * Brought MySQL backend in line with _autoCommit flag of AbstractSessionImpl. --------- Co-authored-by: Friedrich Wilckens <frwilckens@gmail.com> Co-authored-by: Friedrich Wilckens <friedrich.wilckens@ingramcontent.com>
116 lines
2.4 KiB
C++
116 lines
2.4 KiB
C++
//
|
|
// SQLExecutor.h
|
|
//
|
|
// Definition of the SQLExecutor class.
|
|
//
|
|
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#ifndef SQLExecutor_INCLUDED
|
|
#define SQLExecutor_INCLUDED
|
|
|
|
|
|
#include "Poco/Data/MySQL/MySQL.h"
|
|
#include "Poco/Data/Session.h"
|
|
|
|
|
|
class SQLExecutor: public CppUnit::TestCase
|
|
{
|
|
public:
|
|
enum DataBinding
|
|
{
|
|
PB_IMMEDIATE,
|
|
PB_AT_EXEC
|
|
};
|
|
|
|
enum DataExtraction
|
|
{
|
|
DE_MANUAL,
|
|
DE_BOUND
|
|
};
|
|
|
|
SQLExecutor(const std::string& name, Poco::Data::Session* _pSession);
|
|
~SQLExecutor();
|
|
|
|
void bareboneMySQLTest(const char* host, const char* user, const char* pwd, const char* db, int port, const char* tableCreateString);
|
|
/// This function uses "bare bone" MySQL API calls (i.e. calls are not
|
|
/// "wrapped" in PocoData framework structures).
|
|
/// The purpose of the function is to verify that driver behaves
|
|
/// correctly. If this test passes, subsequent tests failures are likely ours.
|
|
|
|
void simpleAccess();
|
|
void complexType();
|
|
void simpleAccessVector();
|
|
void complexTypeVector();
|
|
void insertVector();
|
|
void insertEmptyVector();
|
|
|
|
void insertSingleBulk();
|
|
void insertSingleBulkVec();
|
|
|
|
void limits();
|
|
void limitOnce();
|
|
void limitPrepare();
|
|
void limitZero();
|
|
void prepare();
|
|
|
|
void setSimple();
|
|
void setComplex();
|
|
void setComplexUnique();
|
|
void multiSetSimple();
|
|
void multiSetComplex();
|
|
void mapComplex();
|
|
void mapComplexUnique();
|
|
void multiMapComplex();
|
|
void selectIntoSingle();
|
|
void selectIntoSingleStep();
|
|
void selectIntoSingleFail();
|
|
void lowerLimitOk();
|
|
void lowerLimitFail();
|
|
void combinedLimits();
|
|
void combinedIllegalLimits();
|
|
void ranges();
|
|
void illegalRange();
|
|
void singleSelect();
|
|
void emptyDB();
|
|
|
|
void blob(unsigned int bigSize = ~0);
|
|
void blobStmt();
|
|
void dateTime();
|
|
void date();
|
|
void time();
|
|
void timestamp();
|
|
void longBlob();
|
|
void longText();
|
|
#ifdef POCO_MYSQL_JSON
|
|
void json();
|
|
#endif
|
|
void unsignedInts();
|
|
void floats();
|
|
void doubles();
|
|
void uuids();
|
|
void tuples();
|
|
void tupleVector();
|
|
|
|
void internalExtraction();
|
|
void doNull();
|
|
|
|
void sessionTransaction(const std::string& connect);
|
|
void transaction(const std::string& connect);
|
|
|
|
void reconnect();
|
|
void sessionPoolAndUnicode(const std::string& connString);
|
|
|
|
private:
|
|
void setTransactionIsolation(Poco::Data::Session& session, Poco::UInt32 ti);
|
|
|
|
Poco::Data::Session* _pSession;
|
|
};
|
|
|
|
|
|
#endif // SQLExecutor_INCLUDED
|