mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
MySQL DateTime support, samples Linux compile
This commit is contained in:
@@ -64,7 +64,7 @@ Poco::SharedPtr<SQLExecutor> MySQLTest::_pExecutor = 0;
|
||||
// Parameters for barebone-test
|
||||
#define MYSQL_USER "root"
|
||||
#define MYSQL_PWD "poco"
|
||||
#define MYSQL_HOST "localhost"
|
||||
#define MYSQL_HOST "192.168.1.33"
|
||||
#define MYSQL_PORT 3306
|
||||
#define MYSQL_DB "test"
|
||||
|
||||
@@ -417,6 +417,15 @@ void MySQLTest::testEmptyDB()
|
||||
}
|
||||
|
||||
|
||||
void MySQLTest::testDateTime()
|
||||
{
|
||||
if (!_pSession) fail ("Test not available.");
|
||||
|
||||
recreatePersonDateTimeTable();
|
||||
_pExecutor->dateTime();
|
||||
}
|
||||
|
||||
|
||||
void MySQLTest::testBLOB()
|
||||
{
|
||||
if (!_pSession) fail ("Test not available.");
|
||||
@@ -697,6 +706,15 @@ void MySQLTest::recreatePersonBLOBTable()
|
||||
}
|
||||
|
||||
|
||||
void MySQLTest::recreatePersonDateTimeTable()
|
||||
{
|
||||
dropTable("Person");
|
||||
try { *_pSession << "CREATE TABLE Person (LastName VARCHAR(30), FirstName VARCHAR(30), Address VARCHAR(30), Birthday DATETIME)", now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail ("recreatePersonDateTimeTable()"); }
|
||||
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail ("recreatePersonDateTimeTable()"); }
|
||||
}
|
||||
|
||||
|
||||
void MySQLTest::recreateIntsTable()
|
||||
{
|
||||
dropTable("Strings");
|
||||
@@ -833,6 +851,7 @@ CppUnit::Test* MySQLTest::suite()
|
||||
CppUnit_addTest(pSuite, MySQLTest, testIllegalRange);
|
||||
CppUnit_addTest(pSuite, MySQLTest, testSingleSelect);
|
||||
CppUnit_addTest(pSuite, MySQLTest, testEmptyDB);
|
||||
CppUnit_addTest(pSuite, MySQLTest, testDateTime);
|
||||
//CppUnit_addTest(pSuite, MySQLTest, testBLOB);
|
||||
CppUnit_addTest(pSuite, MySQLTest, testBLOBStmt);
|
||||
CppUnit_addTest(pSuite, MySQLTest, testFloat);
|
||||
|
||||
Reference in New Issue
Block a user