Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-4710

Table alias in civireport for civicrm_case is a reserved word in SQL

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Blocker
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.2.7
    • Fix Version/s: 2.2.8
    • Component/s: CiviReport
    • Labels:
      None

      Description

      The line in CRM/Report/Form.php that generates the table aliases produces the aliase "case" for table civicrm_case, but "case" is a reserved word in SQL.

      It's this line in preprocess():
      $this->_columns[$tableName]['alias'] = substr( $tableName, 8 );

      Suggest adding a suffix that couldn't possibly conflict, i.e.
      $this->_columns[$tableName]['alias'] = substr( $tableName, 8 ) . '_civireport';

      Since in this situation the aliases are not for human readability or ease of typing, it's not too important that it be a simple alias.

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              demeritcowboy Dave D
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: