cta-verify-file may fail if cta.verification.mount_policy is not set
Summary
If cta.verification.mount_policy is not set, cta-verify-file fails with the error:
prepareToRetrieveFile: getMountPolicy: bindString failed: paramName=:MOUNT_POLICY_NAME: bindString failed for SQL statement SELECT MOUNT_POLICY_NAME AS MOUNT_POLICY_NAME,ARCHIVE_PRIORITY AS ARCHIVE_PRI...: Optional string parameter :MOUNT_POLICY_NAME is an empty string. An optional string parameter should either have a non-empty string value or no value at all.
Possible causes
Due to using two types of variable i.e std::string and optional<std::string>
if mount_policy is not to defined the value of the std::string var is set to an empty string, as the mount_policy
is type of optional and is set to nullptr
. The empty string value is assigned back to an optional and we have the problem with the binding stmt.bindString(":MOUNT_POLICY_NAME", mountPolicy);