MCPcopy Create free account
hub / github.com/apache/arrow / TEST_F

Function TEST_F

cpp/src/arrow/flight/sql/odbc/tests/statement_test.cc:345–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345TEST_F(StatementRemoteTest, TestSQLExecDirectTimeQuery) {
346 // Mock server test is skipped due to limitation on the mock server.
347 // Time type from mock server does not include the fraction
348
349 SQLWCHAR wsql[] =
350 LR"(
351 SELECT CAST(TIME '00:00:00' AS TIME) AS time_min,
352 CAST(TIME '23:59:59' AS TIME) AS time_max;
353 )";
354 SQLSMALLINT wsql_len = std::wcslen(wsql);
355
356 ASSERT_EQ(SQL_SUCCESS, SQLExecDirect(stmt, wsql, wsql_len));
357
358 ASSERT_EQ(SQL_SUCCESS, SQLFetch(stmt));
359
360 SQL_TIME_STRUCT time_var{};
361 SQLLEN buf_len = sizeof(time_var);
362 SQLLEN ind;
363
364 ASSERT_EQ(SQL_SUCCESS, SQLGetData(stmt, 1, SQL_C_TYPE_TIME, &time_var, buf_len, &ind));
365 // Check min values for time.
366 EXPECT_EQ(0, time_var.hour);
367 EXPECT_EQ(0, time_var.minute);
368 EXPECT_EQ(0, time_var.second);
369
370 ASSERT_EQ(SQL_SUCCESS, SQLGetData(stmt, 2, SQL_C_TYPE_TIME, &time_var, buf_len, &ind));
371 // Check max values for time.
372 EXPECT_EQ(23, time_var.hour);
373 EXPECT_EQ(59, time_var.minute);
374 EXPECT_EQ(59, time_var.second);
375}
376
377TEST_F(StatementMockTest, TestSQLExecDirectVarbinaryQuery) {
378 // Have binary test on mock test base as remote test servers tend to have different

Callers

nothing calls this directly

Calls 11

GetSqlWCharSizeFunction · 0.85
VerifyOdbcErrorStateFunction · 0.85
GetQueryAllDataTypesMethod · 0.80
SQLExecDirectFunction · 0.50
SQLFetchFunction · 0.50
SQLGetDataFunction · 0.50
SQLBindColFunction · 0.50
SQLExtendedFetchFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected