branch-2.1: [improve](variant) only sanitize in debug mode #45689 (#45698)

Cherry-picked from #45689

Co-authored-by: lihangyu <lihangyu@selectdb.com>
This commit is contained in:
github-actions[bot]
2024-12-20 14:25:49 +08:00
committed by GitHub
parent 7e5d880431
commit 37c4de3cbf
2 changed files with 3 additions and 1 deletions

View File

@ -1702,6 +1702,7 @@ std::string ColumnObject::debug_string() const {
}
Status ColumnObject::sanitize() const {
#ifndef NDEBUG
RETURN_IF_CATCH_EXCEPTION(check_consistency());
for (const auto& subcolumn : subcolumns) {
if (subcolumn->data.is_finalized()) {
@ -1716,6 +1717,7 @@ Status ColumnObject::sanitize() const {
}
VLOG_DEBUG << "sanitized " << debug_string();
#endif
return Status::OK();
}

View File

@ -454,7 +454,7 @@ public:
bool empty() const;
// Check if all columns and types are aligned
// Check if all columns and types are aligned, only in debug mode
Status sanitize() const;
std::string debug_string() const;