| 169 | } |
| 170 | |
| 171 | void TestGetColumnsV3(const std::shared_ptr<Connection>& connection) { |
| 172 | const std::shared_ptr<Statement>& statement = connection->CreateStatement(); |
| 173 | std::string table_name = "test_numeric"; |
| 174 | std::string column_name = "%"; |
| 175 | const std::shared_ptr<ResultSet>& result_set = |
| 176 | statement->GetColumns_V3(nullptr, nullptr, &table_name, &column_name); |
| 177 | |
| 178 | const std::shared_ptr<ResultSetMetadata>& metadata = result_set->GetMetadata(); |
| 179 | size_t column_count = metadata->GetColumnCount(); |
| 180 | |
| 181 | int buffer_length = 1024; |
| 182 | std::vector<char> result(buffer_length); |
| 183 | ssize_t result_length; |
| 184 | |
| 185 | while (result_set->Move(1, 0, 0, nullptr) == 1) { |
| 186 | for (size_t i = 0; i < column_count; ++i) { |
| 187 | result_set->GetData(1 + i, arrow::flight::sql::odbc::CDataType_CHAR, 0, 0, |
| 188 | result.data(), buffer_length, &result_length); |
| 189 | std::cout << (result_length != -1 ? result.data() : "NULL") << '\t'; |
| 190 | } |
| 191 | |
| 192 | std::cout << std::endl; |
| 193 | } |
| 194 | |
| 195 | std::cout << column_count << std::endl; |
| 196 | } |
| 197 | |
| 198 | int main() { |
| 199 | FlightSqlDriver driver; |
nothing calls this directly
no test coverage detected