| 353 | } |
| 354 | |
| 355 | TEST_F(StatementRemoteTest, TestSQLExecDirectTimeQuery) { |
| 356 | // Mock server test is skipped due to limitation on the mock server. |
| 357 | // Time type from mock server does not include the fraction |
| 358 | |
| 359 | ASSIGN_SQLWCHAR_ARR_AND_LEN(wsql, |
| 360 | LR"( |
| 361 | SELECT CAST(TIME '00:00:00' AS TIME) AS time_min, |
| 362 | CAST(TIME '23:59:59' AS TIME) AS time_max; |
| 363 | )"); |
| 364 | |
| 365 | ASSERT_EQ(SQL_SUCCESS, SQLExecDirect(this->stmt, wsql, wsql_len)); |
| 366 | |
| 367 | ASSERT_EQ(SQL_SUCCESS, SQLFetch(this->stmt)); |
| 368 | |
| 369 | SQL_TIME_STRUCT time_var{}; |
| 370 | SQLLEN buf_len = sizeof(time_var); |
| 371 | SQLLEN ind; |
| 372 | |
| 373 | ASSERT_EQ(SQL_SUCCESS, |
| 374 | SQLGetData(this->stmt, 1, SQL_C_TYPE_TIME, &time_var, buf_len, &ind)); |
| 375 | // Check min values for time. |
| 376 | EXPECT_EQ(0, time_var.hour); |
| 377 | EXPECT_EQ(0, time_var.minute); |
| 378 | EXPECT_EQ(0, time_var.second); |
| 379 | |
| 380 | ASSERT_EQ(SQL_SUCCESS, |
| 381 | SQLGetData(this->stmt, 2, SQL_C_TYPE_TIME, &time_var, buf_len, &ind)); |
| 382 | // Check max values for time. |
| 383 | EXPECT_EQ(23, time_var.hour); |
| 384 | EXPECT_EQ(59, time_var.minute); |
| 385 | EXPECT_EQ(59, time_var.second); |
| 386 | } |
| 387 | |
| 388 | TEST_F(StatementMockTest, TestSQLExecDirectVarbinaryQuery) { |
| 389 | // Have binary test on mock test base as remote test servers tend to have different |
nothing calls this directly
no test coverage detected