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

Saved Searches not working with MySQL 4.0

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6
    • Component/s: None
    • Labels:
      None

      Description

      I just tested an upgrade from 1.5 to 1.6.8022 and have found that any search involving a smart group is giving a database error.

      "Database Error Code: Unknown table 'civicrm_group_contact' in where clause, 1109"

      I found that the issue was due to the query generated by CRM/Contact/BAO/Query.php in the 'else' clause of the "if ( $config->mysqlVersion >= 4.1 )" test on line 1689 (this is also about the only place that mysql 4.0 is special cased in the project).

      I changed the WHERE parameters to use the table alias $gcTable = "`civicrm_group_contact-" .implode( ',', array_keys($value) ) ."`"; instead of "civicrm_group_contact" to get rid of the error and everything now seems ok.

      This is pretty easy to reproduce, just change the config to specify mysql 4.0 and do a search involving a smart group to exercise this code path.

        Attachments

          Activity

            People

            • Assignee:
              sameermare Sameer Mare
              Reporter:
              erico Eric Orton
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: