Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297938

Possibility of {comment}.thread duplication in the same node

$
0
0

While analyzing issues on drupal.org, I detected that it is possible for multiple comments on a node to have the same {comment}.thread value.

To ensure data integrity, we should have a unique index on (nid, thread).

Drupal.org had 34 instances where duplication had happened. Most of this apparently happened at times where things were especially flaky. (I manually repaired the damage already.)

Detecting duplicate thread values:
(d6 naming, use 'comment' for a d7+ db)
select distinct l.nid from comments l, comments r WHERE l.nid = r.nid and l.thread = r.thread and l.cid < r.cid;

This takes 5 minutes to run on drupal.org slave.


Viewing all articles
Browse latest Browse all 297938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>