72123 {
72124
72125 if (lhs.get() == rhs.get()) {
72126 return true;
72127 }
72128
72129 if (lhs == nullptr || rhs == nullptr) {
72130 return true;
72131 }
72132
72133
72134 D_ASSERT(lhs != nullptr && rhs != nullptr);
72135
72136
72137 const auto &lhs_mods = lhs->modifiers;
72138 const auto &rhs_mods = rhs->modifiers;
72139 const auto common_mods = MinValue(lhs_mods.size(), rhs_mods.size());
72140 for (idx_t i = 0; i < common_mods; i++) {
72141
72142 auto &lhs_val = lhs_mods[i].value;
72143 auto &rhs_val = rhs_mods[i].value;
72144
72145 if (lhs_val.type() != rhs_val.type()) {
72146 return false;
72147 }
72148
72149
72150 if (lhs_val.IsNull() && rhs_val.IsNull()) {
72151 continue;
72152 }
72153
72154
72155 if (lhs_val.IsNull() != rhs_val.IsNull()) {
72156 return false;
72157 }
72158
72159 if (lhs_val != rhs_val) {
72160 return false;
72161 }
72162 }
72163
72164
72165 const auto &lhs_props = lhs->properties;
72166 const auto &rhs_props = rhs->properties;
72167
72168 for (const auto &kv : lhs_props) {
72169 auto it = rhs_props.find(kv.first);
72170 if (it == rhs_props.end()) {
72171
72172 continue;
72173 }
72174 if (kv.second != it->second) {
72175
72176 return false;
72177 }
72178 }
72179
72180
72181 return true;
72182}