| 454 | } |
| 455 | |
| 456 | void DatabaseContext::validateVersion(Version version) const { |
| 457 | // Version could be 0 if the INITIALIZE_NEW_DATABASE option is set. In that case, it is illegal to perform any |
| 458 | // reads. We throw client_invalid_operation because the caller didn't directly set the version, so the |
| 459 | // version_invalid error might be confusing. |
| 460 | if (version == 0) { |
| 461 | throw client_invalid_operation(); |
| 462 | } |
| 463 | if (switchable && version < minAcceptableReadVersion) { |
| 464 | CODE_PROBE(true, "Attempted to read a version lower than any this client has seen from the current cluster"); |
| 465 | throw transaction_too_old(); |
| 466 | } |
| 467 | |
| 468 | ASSERT(version > 0 || version == latestVersion); |
| 469 | } |
| 470 | |
| 471 | void validateOptionValuePresent(Optional<StringRef> value) { |
| 472 | if (!value.present()) { |
no outgoing calls
no test coverage detected