Hi,
one of our users reports that every bibtex export shows up twice or three times. I can't look into the code at the moment (you know why ;-)) but this sounds very similar to http://drupal.org/node/404842, first post. I can look into this when I'm back but maybe you immedately know if of where a distinct might be missing at some place there.

cu,
Frank

Comments

rjerome’s picture

Your supposed to be on vacation!! Stop looking at this ;-)

I did put those distincts back although slightly differently in that it's now DISTINCT(n.nid), n.*, biblio.* bla bla bla... I would have thought that would have the same effect, but perhaps I was wrong.

Ron.

Frank Steiner’s picture

Ok ok ;-) Actually I would also think that the nid should be unique enough... I can test this here next week.

Frank Steiner’s picture

Ok, I couldn't resist to use my ssh account to check this, sorry ;-) It's in biblio_export where I added a "GROUP BY n.nid" (because I wasn't able to use a DISTINCT correctly, always got an empty result):
$query = db_rewrite_sql("SELECT * FROM {node} n left join {biblio} b on n.vid=b.vid WHERE n.nid=%d GROUP BY n.nid");
Then it works. Reason is like before the node_access stuff due to the node_privacy_by_role module.

cu,
Frank

rjerome’s picture

Your as bad as I am!! You just can't leave this stuff alone.

It should only get to that line if there is no SESSION information available, which goes back to our previous discussion I guess. What if you put a DISTINCT (n.nid), n.* FROM ... on that line.

Ron.

Frank Steiner’s picture

DISTINCT (n.nid), n.*, b.* FROM... works, otherwise parts from the biblio table are missing.

Is there a (performance) difference between DISTINCT and GROUP? Or are they just syntactic sugar?

rjerome’s picture

I don't claim to be an SQL guru, but from what I've read it seems the latter is true, for most cases they are more or less the same.

Ron.

liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.