Project

General

Profile

Actions

Defect #4259

closed

Activity feed does not show all changeset activity

Added by Brad Langhorst over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
2009-11-20
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I think it only shows the first commit from the first day in the time window

I think this may be a bug in postgres

Here's the relevant query:

SELECT "changesets"."id" AS t0_r0
FROM 
"changesets" 
LEFT OUTER JOIN "repositories" ON "repositories".id = "changesets".repository_id 
LEFT OUTER JOIN "projects" ON "projects".id = "repositories".project_id 
inner join enabled_modules em on em.name = 'repository' and projects.id = em.project_id
WHERE --(
(1=1 AND changesets.committed_on BETWEEN '2009-10-22' AND '2009-11-21')
AND ((projects.id = 1 OR (projects.lft > 1 AND projects.rgt < 2))) 
AND (projects.status=1 )
--AND projects.id in (SELECT em.project_id FROM enabled_modules em WHERE em.name='repository')

I get the correct number of lines (146 in my database) if I use an inner join to limit the projects to those where the repository is enabled.

If however, I use the subquery that is written by the redmine code, I get only 1 line (commented out here)

I know that pg 8.4 did some optimizations with subqueries
I'm running postgresql-8.4 (8.4.0-2) from debian.

this is with a recent checkout of 0.9pre

Actions #1

Updated by Jean-Philippe Lang over 14 years ago

Found this in the postgres 8.4.1 release notes:

Fix several errors in planning of semi-joins (Tom)
These led to wrong query results in some cases where IN or EXISTS was used together with another join.

It may be related to your problem with 8.4.0.

Actions #2

Updated by Brad Langhorst over 14 years ago

I can confirm that this is fixed in 8.4.1, but I think you probably want to put something into the release notes or requirements docs before closing this bug out....

Actions #3

Updated by Jean-Philippe Lang over 14 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Note added on RedmineInstall. Thanks for the feedback.

Actions

Also available in: Atom PDF