| 423 | // GH-49702: TODO Disabled on Linux due to BlockingQueue issue |
| 424 | #ifndef __linux__ |
| 425 | TEST_F(ColumnsMockTest, TestSQLColumnsAllColumns) { |
| 426 | // Check table pattern and column pattern returns all columns |
| 427 | |
| 428 | // Attempt to get all columns |
| 429 | ASSIGN_SQLWCHAR_ARR(table_pattern, L"%"); |
| 430 | ASSIGN_SQLWCHAR_ARR(column_pattern, L"%"); |
| 431 | |
| 432 | ASSERT_EQ(SQL_SUCCESS, SQLColumns(this->stmt, nullptr, SQL_NTS, nullptr, SQL_NTS, |
| 433 | table_pattern, SQL_NTS, column_pattern, SQL_NTS)); |
| 434 | |
| 435 | ASSERT_EQ(SQL_SUCCESS, SQLFetch(this->stmt)); |
| 436 | |
| 437 | // mock limitation: SQLite mock server returns 10 for bigint size when spec indicates |
| 438 | // should be 19 |
| 439 | // DECIMAL_DIGITS should be 0 for bigint type since it is exact |
| 440 | // mock limitation: SQLite mock server returns 10 for bigint decimal digits when spec |
| 441 | // indicates should be 0 |
| 442 | CheckMockSQLColumns(this->stmt, |
| 443 | std::wstring(L"main"), // expected_catalog |
| 444 | std::wstring(L"foreignTable"), // expected_table |
| 445 | std::wstring(L"id"), // expected_column |
| 446 | SQL_BIGINT, // expected_data_type |
| 447 | std::wstring(L"BIGINT"), // expected_type_name |
| 448 | 10, // expected_column_size (mock returns 10 instead of 19) |
| 449 | 8, // expected_buffer_length |
| 450 | 15, // expected_decimal_digits (mock returns 15 instead of 0) |
| 451 | 10, // expected_num_prec_radix |
| 452 | SQL_NULLABLE, // expected_nullable |
| 453 | SQL_BIGINT, // expected_sql_data_type |
| 454 | 0, // expected_date_time_sub |
| 455 | 8, // expected_octet_char_length |
| 456 | 1, // expected_ordinal_position |
| 457 | std::wstring(L"YES")); // expected_is_nullable |
| 458 | |
| 459 | // Check 2nd Column |
| 460 | ASSERT_EQ(SQL_SUCCESS, SQLFetch(this->stmt)); |
| 461 | |
| 462 | CheckMockSQLColumns(this->stmt, |
| 463 | std::wstring(L"main"), // expected_catalog |
| 464 | std::wstring(L"foreignTable"), // expected_table |
| 465 | std::wstring(L"foreignName"), // expected_column |
| 466 | SQL_WVARCHAR, // expected_data_type |
| 467 | std::wstring(L"WVARCHAR"), // expected_type_name |
| 468 | 0, // expected_column_size (mock server limitation: returns 0 for |
| 469 | // varchar(100), the ODBC spec expects 100) |
| 470 | 0, // expected_buffer_length |
| 471 | 15, // expected_decimal_digits |
| 472 | 0, // expected_num_prec_radix |
| 473 | SQL_NULLABLE, // expected_nullable |
| 474 | SQL_WVARCHAR, // expected_sql_data_type |
| 475 | 0, // expected_date_time_sub |
| 476 | 0, // expected_octet_char_length |
| 477 | 2, // expected_ordinal_position |
| 478 | std::wstring(L"YES")); // expected_is_nullable |
| 479 | |
| 480 | // Check 3rd Column |
| 481 | ASSERT_EQ(SQL_SUCCESS, SQLFetch(this->stmt)); |
| 482 |
nothing calls this directly
no test coverage detected