- SQL logging channel and archiving strategy

- row formatting refactored
- affected row count for insert, delete and update returned from Statement::execute()
- internal SQL string formatting capability using Poco::format()
This commit is contained in:
Aleksandar Fabijanic
2008-01-12 18:25:27 +00:00
parent b57f579d16
commit 9e8e627347
63 changed files with 2556 additions and 337 deletions

View File

@@ -373,6 +373,31 @@ void ODBCMySQLTest::recreateMiscTable()
}
void ODBCMySQLTest::recreateLogTable()
{
dropObject("TABLE", "T_POCO_LOG");
dropObject("TABLE", "T_POCO_LOG_ARCHIVE");
try
{
std::string sql = "CREATE TABLE %s "
"(Source VARCHAR(100),"
"Name VARCHAR(100),"
"ProcessId INTEGER,"
"Thread VARCHAR(100), "
"ThreadId INTEGER,"
"Priority INTEGER,"
"Text VARCHAR(100),"
"DateTime DATETIME)";
session() << sql, "T_POCO_LOG", now;
session() << sql, "T_POCO_LOG_ARCHIVE", now;
} catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail ("recreateLogTable()"); }
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail ("recreateLogTable()"); }
}
CppUnit::Test* ODBCMySQLTest::suite()
{
if (_pSession = init(_driver, _dsn, _uid, _pwd, _connectString))
@@ -398,6 +423,7 @@ CppUnit::Test* ODBCMySQLTest::suite()
CppUnit_addTest(pSuite, ODBCMySQLTest, testComplexTypeDeque);
CppUnit_addTest(pSuite, ODBCMySQLTest, testInsertDeque);
CppUnit_addTest(pSuite, ODBCMySQLTest, testInsertEmptyDeque);
CppUnit_addTest(pSuite, ODBCMySQLTest, testAffectedRows);
CppUnit_addTest(pSuite, ODBCMySQLTest, testInsertSingleBulk);
CppUnit_addTest(pSuite, ODBCMySQLTest, testInsertSingleBulkVec);
CppUnit_addTest(pSuite, ODBCMySQLTest, testLimit);
@@ -447,6 +473,8 @@ CppUnit::Test* ODBCMySQLTest::suite()
CppUnit_addTest(pSuite, ODBCMySQLTest, testAny);
CppUnit_addTest(pSuite, ODBCMySQLTest, testDynamicAny);
CppUnit_addTest(pSuite, ODBCMySQLTest, testMultipleResults);
CppUnit_addTest(pSuite, ODBCMySQLTest, testSQLChannel);
CppUnit_addTest(pSuite, ODBCMySQLTest, testSQLLogger);
return pSuite;
}