Bug 5230 - Patch for Distinct Query Use
Patch for Distinct Query Use
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: User Interface
3.0
All All
: P5 enhancement
Assigned To: PKP Support
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-17 11:57 PDT by Jacob Sanford
Modified: 2013-01-04 10:45 PST (History)
3 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments
Patch to Streamline EditorSubmission SELECT statement (5.44 KB, patch)
2010-03-17 11:57 PDT, Jacob Sanford
Details | Diff
Patch to Streamline EditorSubmissionDAO SELECT statement (5.94 KB, patch)
2010-03-17 12:17 PDT, Jacob Sanford
Details | Diff
Patch to Streamline EditorSubmissionDAO SELECT statement (4.41 KB, patch)
2010-03-18 06:47 PDT, Jacob Sanford
Details | Diff
Patch to Streamline EditorSubmissionDAO SELECT statement (4.31 KB, patch)
2010-03-18 12:42 PDT, Jacob Sanford
Details | Diff
Patch against OJS pre-2.3.2 CVS (4.38 KB, patch)
2010-07-28 12:04 PDT, Alec Smecher
Details | Diff
Patch against OJS pre-2.3.2 CVS (4.39 KB, patch)
2010-08-10 06:00 PDT, Jacob Sanford
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Sanford 2010-03-17 11:57:05 PDT
Created attachment 3053 [details]
Patch to Streamline EditorSubmission SELECT statement

Enclosed is a patch for the OJS EditorSubmission SELECT statement that calls the DISTINCT switch only when necessary, and also omits many of the joins unless they are specifically needed.
Comment 1 Jacob Sanford 2010-03-17 12:17:45 PDT
Created attachment 3054 [details]
Patch to Streamline EditorSubmissionDAO SELECT statement
Comment 2 Alec Smecher 2010-03-17 16:22:16 PDT
Jacob, a few small things:
- It looks like you're using spaces rather than tabs to indent
- We generally use unified diffs (diff -u); I find them more readable
- Now this is getting really pedantic: For consistency, stick with $lowerCamelCase for variable names rather than $justlowercase.

Otherwise, looking good, thanks!
Alec
Comment 3 Jacob Sanford 2010-03-17 19:32:58 PDT
Hi Alec,

I would usually use tabs over spaces in my code - It must be a transition between Eclipse (Win)/Linux that caused an issue there. Will make sure that is not lost in the next patch.

Will definitely adhere to -u / Camel-Case to keep to standards in the future.

Cheers,

Jake
Comment 4 Jacob Sanford 2010-03-18 06:46:21 PDT
Comment on attachment 3054 [details]
Patch to Streamline EditorSubmissionDAO SELECT statement

Updating with standard-compliant version.
Comment 5 Jacob Sanford 2010-03-18 06:47:46 PDT
Created attachment 3055 [details]
Patch to Streamline EditorSubmissionDAO SELECT statement

New, compliant patch. Cheers Alec,

Jake
Comment 6 Jacob Sanford 2010-03-18 12:42:36 PDT
Created attachment 3056 [details]
Patch to Streamline EditorSubmissionDAO SELECT statement
Comment 7 Alec Smecher 2010-07-28 12:04:59 PDT
Created attachment 3147 [details]
Patch against OJS pre-2.3.2 CVS

Sorry I dropped this for so long, Jake; my penance is to update it to work with current CVS (see attachment). Before this can be committed, it'll also need to be ported to the SectionEditorSubmissionDAO, which should be pretty similar. Any chance you could have a crack at it?
Comment 8 Jacob Sanford 2010-08-04 04:24:49 PDT
Hi Alec,
Sure thing. Just back from a conference but will get at it this week.
Comment 9 Jacob Sanford 2010-08-10 06:00:07 PDT
Created attachment 3153 [details]
Patch against OJS pre-2.3.2 CVS
Comment 10 Jacob Sanford 2010-08-10 06:04:02 PDT
Alec, just noticed a small error in the last patch - new CVS doesn't use INNER join, rather LEFT. Uploaded a fix. Working on the next one now.
Comment 11 Alec Smecher 2010-09-22 10:42:35 PDT
Sorry, Jake -- I dropped the ball on this one and now it's too late to include in this release's testing process. Deferring to the next.
Comment 12 Alec Smecher 2013-01-04 10:43:17 PST
Finally committed to master; a little riskier than I'd like for 2.4.2.
Comment 13 Alec Smecher 2013-01-04 10:45:03 PST
Made DISTINCT optional
https://github.com/pkp/ojs/commit/041efabeb5276f74e3d61331ed07d29b67e7f7d7