| 330 | } |
| 331 | |
| 332 | bool Equal(Tuple* x, Tuple* y) { |
| 333 | const std::vector<SlotDescriptor*>& slots = tuple_desc_->slots(); |
| 334 | for (int i = 0; i < slots.size(); ++i) { |
| 335 | SlotDescriptor* slot = slots[i]; |
| 336 | |
| 337 | if (slot->is_nullable()) { |
| 338 | const NullIndicatorOffset& null_offset = slot->null_indicator_offset(); |
| 339 | if (x->IsNull(null_offset) || y->IsNull(null_offset)) { |
| 340 | if (x->IsNull(null_offset) && y->IsNull(null_offset)) { |
| 341 | continue; |
| 342 | } else { |
| 343 | return false; |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | int tuple_offset = slot->tuple_offset(); |
| 349 | const ColumnType& type = slot->type(); |
| 350 | if (!RawValue::Eq(x->GetSlot(tuple_offset), y->GetSlot(tuple_offset), type)) { |
| 351 | return false; |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | return true; |
| 356 | } |
| 357 | }; |
| 358 | |
| 359 | /// Compares the equality of two TupleRows, going tuple by tuple. |
nothing calls this directly
no test coverage detected