Author: jflesch
Date: 2007-05-13 13:53:54 +0000 (Sun, 13 May 2007)
New Revision: 13231

Modified:
   trunk/apps/Thaw/src/thaw/plugins/index/Index.java
Log:
Fix bug #1364 : When Thaw counts the comments, it doesn't count the blacklisted 
ones

Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2007-05-13 13:50:42 UTC 
(rev 13230)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java   2007-05-13 13:53:54 UTC 
(rev 13231)
@@ -2004,9 +2004,16 @@
                        synchronized(db.dbLock) {
                                PreparedStatement st;

-                               st = 
db.getConnection().prepareStatement("SELECT count(id) FROM indexComments WHERE 
indexId = ?");
+                               st = 
db.getConnection().prepareStatement("SELECT count(indexComments.id) "+
+                                                                        "FROM 
indexComments "+
+                                                                        "WHERE 
indexComments.indexId = ? "+
+                                                                        "AND 
indexComments.rev NOT IN "+
+                                                                        " 
(SELECT indexCommentBlackList.rev "+
+                                                                        "  
FROM indexCommentBlackList "+
+                                                                        "  
WHERE indexCommentBlackList.indexId = ?)");

                                st.setInt(1, id);
+                               st.setInt(2, id);

                                ResultSet set = st.executeQuery();



Reply via email to