Uploaded image for project: 'Reporting Module'
  1. Reporting Module
  2. REPORT-702

SqlDataSetDefinition behaves wrong if you have two columns with the same name

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: Reporting 0.9.2
    • Fix Version/s: Reporting 0.9.3
    • Component/s: None
    • Labels:
    • Complexity:
      Undetermined

      Description

      We have a SqlDataSetDefinition whose SQL contains:

      select ..., encounter_id, ..., adt.encounter_id, ...
      

      This is bad SQL (I'm surprised MySQL doesn't complain).

      It used to be the case that the code behind SqlDataSetEvaluator would handle this "nicely", however since the recent refactoring, it's now the case that the last column value will be displayed in all columns in the output.

      I suggest that the correct behavior should be to fail evaluation if two columns have the same name. I think this would happen in org.openmrs.module.reporting.evaluation.service.EvaluationServiceImpl#getColumns(QueryBuilder)

        Attachments

          Activity

            People

            • Assignee:
              mseaton Mike Seaton
              Reporter:
              darius Darius Jazayeri [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: