From: Douglas Bagnall Date: Thu, 14 Mar 2024 03:36:07 +0000 (+1300) Subject: pyldb: add a FIXME for a non-transitive compare X-Git-Tag: tdb-1.4.11~1402 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=118b9ec5e075e19c79e8974beeb64dcb0392877f;p=thirdparty%2Fsamba.git pyldb: add a FIXME for a non-transitive compare Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 86f96e4b305..42badbc2e37 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -4018,7 +4018,18 @@ static PyObject *py_ldb_msg_richcmp(PyLdbMessageObject *py_msg1, msg1 = pyldb_Message_AsMessage(py_msg1), msg2 = pyldb_Message_AsMessage(py_msg2); - + /* + * FIXME: this can be a non-transitive compare, unsuitable for + * sorting. + * + * supposing msg1, msg2, and msg3 have 1, 2, and 3 elements + * each. msg2 has a NULL DN, while msg1 has a DN that compares + * higher than msg3. Then: + * + * msg1 < msg2, due to num_elements. + * msg2 < msg3, due to num_elements. + * msg1 > msg3, due to DNs. + */ if ((msg1->dn != NULL) || (msg2->dn != NULL)) { ret = ldb_dn_compare(msg1->dn, msg2->dn); if (ret != 0) {