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) {