| 272 | } |
| 273 | |
| 274 | Connection::Info GetInfoCache::GetInfo(uint16_t info_type) { |
| 275 | auto it = info_.find(info_type); |
| 276 | |
| 277 | if (info_.end() == it) { |
| 278 | if (LoadInfoFromServer()) { |
| 279 | it = info_.find(info_type); |
| 280 | } |
| 281 | if (info_.end() == it) { |
| 282 | throw DriverException("Unknown GetInfo type: " + std::to_string(info_type)); |
| 283 | } |
| 284 | } |
| 285 | return it->second; |
| 286 | } |
| 287 | |
| 288 | bool GetInfoCache::LoadInfoFromServer() { |
| 289 | if (sql_client_ && !has_server_info_.exchange(true)) { |