Closed (duplicate)
Project:
Drupal core
Version:
5.6
Component:
comment.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2008 at 12:19 UTC
Updated:
17 Nov 2008 at 08:18 UTC
PostgreSQL 8.1 / php5 / apache2 drupal5.x
I think it's not normal.
uid | nid | timestamp | cid | pid | thread
------+-----+------------+-------+-----+----------
1061 | 770 | 1200490680 | 20325 | 0 | 5ffe7v5/
1045 | 770 | 1200491671 | 20332 | 0 | 5ffe7v5/
1063 | 770 | 1200492265 | 20335 | 0 | 5ffe7v5/
1073 | 770 | 1200496741 | 20360 | 0 | 5ffe7v5/
1045 | 770 | 1200497071 | 20365 | 0 | 5ffe7v5/
1073 | 770 | 1200497233 | 20366 | 0 | 5ffe7v5/
1045 | 770 | 1200497371 | 20367 | 0 | 5ffe7v5/
1073 | 770 | 1200497478 | 20368 | 0 | 5ffe7v5/
1139 | 770 | 1200507781 | 20429 | 0 | 5ffe7v5/
1073 | 770 | 1200512739 | 20467 | 0 | 5ffe7v5/
1069 | 770 | 1200528038 | 20568 | 0 | 5ffe7v5/
1185 | 770 | 1200555702 | 20590 | 0 | 5ffe7v5/
1130 | 770 | 1200556266 | 20592 | 0 | 5ffe7v5/
1185 | 770 | 1200563943 | 20611 | 0 | 5ffe7v5/
1045 | 770 | 1200577482 | 20690 | 0 | 5ffe7v5/
1045 | 770 | 1200577643 | 20692 | 0 | 5ffe7v5/
1045 | 770 | 1200577671 | 20693 | 0 | 5ffe7v5/
1180 | 770 | 1200578608 | 20703 | 0 | 5ffe7v5/
1045 | 770 | 1200584306 | 20745 | 0 | 5ffe7v5/
1 | 770 | 1200641028 | 20857 | 0 | 5ffe7v5/
1095 | 770 | 1200651491 | 20872 | 0 | 5ffe7v5/
1134 | 770 | 1200651664 | 20873 | 0 | 5ffe7v5/
1073 | 770 | 1200654066 | 20874 | 0 | 5ffe7v5/
(23 sor)
original code in comment.php
$max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d', $edit['nid']));
I would change it to this, beacuse it's working in mysql and postgres too.
$max = db_result(db_query('SELECT MAX(thread) FROM {comments} WHERE nid = %d and pid=0', $edit['nid']));
I don't understand how does it work in mysql, but in pg, its wrong. look at this:
template1=# select 'abcdef/' < 'abcdef.00.00.00.00/';
?column?
----------
t
(1 sor)
template1=# select '.'<'/';
?column?
----------
f
(1 sor)
template1=# select hashchar('a'),hashchar('á'),hashchar('e'),hashchar('é'),hashchar('.'),hashchar('/');
hashchar | hashchar | hashchar | hashchar | hashchar | hashchar
----------+----------+----------+----------+----------+----------
-98 | 60 | -102 | 60 | -47 | -48
(1 sor)
| Comment | File | Size | Author |
|---|---|---|---|
| multiple_threadfix.5xp1.patch | 938 bytes | gdavid |
Comments
Comment #1
gdavid commentedComment #2
gábor hojtsy#97327: Data corruption in comment IDs (results in broken threading on PostgreSQL) already deals with adding adding "AND pid = 0", please follow up there.