| 518 | } |
| 519 | |
| 520 | bool FuzzConfig::processServerQuery(const bool outlog, const String & query) |
| 521 | { |
| 522 | bool res = true; |
| 523 | bool caught_exception = false; |
| 524 | |
| 525 | try |
| 526 | { |
| 527 | if (outlog) |
| 528 | { |
| 529 | outf << query << std::endl; |
| 530 | } |
| 531 | res &= this->cb->processTextAsSingleQuery(query); |
| 532 | } |
| 533 | catch (const std::exception &) |
| 534 | { |
| 535 | LOG_ERROR(log, "Error on processing query '{}': {}\n", query, DB::getCurrentExceptionMessage(false)); |
| 536 | res = false; |
| 537 | caught_exception = true; |
| 538 | } |
| 539 | if (!res) |
| 540 | { |
| 541 | if (!caught_exception) |
| 542 | LOG_ERROR(log, "Unknown error on processing query '{}'\n", query); |
| 543 | if (!this->cb->tryToReconnect(max_reconnection_attempts, time_to_sleep_between_reconnects)) |
| 544 | throw DB::Exception(DB::ErrorCodes::NETWORK_ERROR, "Couldn't not reconnect to the server"); |
| 545 | } |
| 546 | return res; |
| 547 | } |
| 548 | |
| 549 | template <typename T, typename ParseFunc> |
| 550 | void FuzzConfig::loadServerSettings(std::vector<T> & out, const String & desc, const String & query, ParseFunc parse) |
no test coverage detected