mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
This commit is contained in:
parent
1215b217b5
commit
21f93e3e6a
@ -160,7 +160,9 @@ void ODBCMetaColumn::init()
|
||||
setType(MetaColumn::FDT_DATE); break;
|
||||
|
||||
case SQL_TYPE_TIME:
|
||||
case -154: //MS SQL Server custom type SQL_SS_TIME2
|
||||
#ifdef POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT
|
||||
case SQL_SS_TIME2: // MS SQL Server custom type
|
||||
#endif
|
||||
setType(MetaColumn::FDT_TIME); break;
|
||||
|
||||
case SQL_TYPE_TIMESTAMP:
|
||||
|
@ -836,6 +836,19 @@ void ODBCSQLServerTest::testStoredFunction()
|
||||
}
|
||||
|
||||
|
||||
void ODBCSQLServerTest::testSQLServerTime()
|
||||
{
|
||||
Poco::Data::Time t;
|
||||
dropObject("TABLE", "TimeTestTable");
|
||||
session() << "CREATE TABLE TimeTestTable (t time)", now;
|
||||
session() << "INSERT INTO TimeTestTable (t) VALUES ('12:34:56')", now;
|
||||
session() << "SELECT t FROM TimeTestTable", into(t), now;
|
||||
std::ostringstream os;
|
||||
os << t.hour() << ':' << t.minute() << ':' << t.second();
|
||||
assertEqual(os.str(), "12:34:56"s);
|
||||
}
|
||||
|
||||
|
||||
void ODBCSQLServerTest::dropObject(const std::string& type, const std::string& name)
|
||||
{
|
||||
try
|
||||
@ -1168,6 +1181,7 @@ CppUnit::Test* ODBCSQLServerTest::suite()
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testUnicode);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testEncoding);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testReconnect);
|
||||
CppUnit_addTest(pSuite, ODBCSQLServerTest, testSQLServerTime);
|
||||
|
||||
return pSuite;
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
void testStoredProcedureReturn();
|
||||
void testStoredFunction() override;
|
||||
|
||||
void testSQLServerTime();
|
||||
|
||||
static CppUnit::Test* suite();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user