* Compares to pgbson structures for strict equality: * returns true if they are byte-wise equal. * * Also performs a NULL based equality check */
| 45 | * Also performs a NULL based equality check |
| 46 | */ |
| 47 | bool |
| 48 | PgbsonEquals(const pgbson *left, const pgbson *right) |
| 49 | { |
| 50 | if (left == NULL || right == NULL) |
| 51 | { |
| 52 | if (left == NULL && right == NULL) |
| 53 | { |
| 54 | return true; |
| 55 | } |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | if (VARSIZE_ANY_EXHDR(left) != VARSIZE_ANY_EXHDR(right)) |
| 60 | { |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | return memcmp(VARDATA_ANY(left), VARDATA_ANY(right), VARSIZE_ANY_EXHDR(left)) == 0; |
| 65 | } |
| 66 | |
| 67 | |
| 68 | /* |
no outgoing calls
no test coverage detected