SQL set operation equality for named values
(&self, other: &Self)
| 328 | |
| 329 | /// SQL set operation equality for named values |
| 330 | fn sql_set_equal_named(&self, other: &Self) -> bool { |
| 331 | if self.values.len() != other.values.len() { |
| 332 | return false; |
| 333 | } |
| 334 | |
| 335 | for (key, self_val) in &self.values { |
| 336 | if let Some(other_val) = other.values.get(key) { |
| 337 | // In SQL set operations, NULL != NULL |
| 338 | if matches!(self_val, Value::Null) || matches!(other_val, Value::Null) { |
| 339 | return false; |
| 340 | } |
| 341 | if self_val != other_val { |
| 342 | return false; |
| 343 | } |
| 344 | } else { |
| 345 | return false; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | true |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | impl Eq for Row {} |