Answers.Body: <p>Yes I think you're right. This one seems to be an issue with the combination of "Merge All Contacts with the Same Address" and using Selected Fields instead of primary fields.</p>
  
  <p>I'll put up another ticket: <a href="https://lab.civicrm.org/dev/core/issues/1302" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/issues/1302</a></p>
  
  <p>Fix looks like it will be in 5.18.2
  <a href="https://github.com/civicrm/civicrm-core/pull/15452" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/15452</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-07T21:13:13.017Z
Answers.LastActivityDate: 2019-10-08T17:39:10.080Z
Answers.LastEditDate: 2019-10-08T17:39:10.080Z
Answers.UserDisplayName: Demerit
Body: <p>I just updated to 5.18.1 to resolve a bug caused when selecting " Exclude contacts with "do not mail" privacy, no street address, or who are deceased." But now I have a new issue:</p>
  
  <p>I set up an export with a saved field mapping. Under Merge Options I select "Merge All Contacts with the Same Address". I then click [Continue], accept my existing saved field mappings, and click [Export]. I then see a fatal error message.</p>
  
  <p>In error logs, I see the following, which I think is failing because of the extra comma after <em>is_deceased VARCHAR(16),</em> :</p>
  
  <pre><code>CREATE TABLE `civicrm_tmp_d_export_e92589f8a1e163117ff1d83e45c03029`(
  id INT UNSIGNED NOT NULL AUTO_INCREMENT,
  prefix_id VARCHAR(255),
  first_name VARCHAR(64),
  last_name VARCHAR(64),
  suffix_id VARCHAR(255),
  street_address VARCHAR(96),
  supplemental_address_1 VARCHAR(96),
  city VARCHAR(64),
  state_province VARCHAR(64),
  postal_code VARCHAR(64),
  country VARCHAR(64),
  preferred_language VARCHAR(5),
  organization_name VARCHAR(128),
  custom_32 VARCHAR(255),
  home_phone_phone VARCHAR(32),
  email VARCHAR(254),
  custom_31 VARCHAR(255),
  groups TEXT,
  middle_name VARCHAR(64),
  nick_name VARCHAR(128),
  display_name VARCHAR(128),
  tags TEXT,
  deceased_date VARCHAR(32),
  do_not_mail VARCHAR(16),
  is_opt_out VARCHAR(16),
  addressee VARCHAR(255),
  postal_greeting VARCHAR(255),
  email_greeting VARCHAR(255),
  street_name VARCHAR(64),
  household_name VARCHAR(128),
  civicrm_primary_id VARCHAR(16),
  master_id VARCHAR(128),
  state_province_id VARCHAR(255),
  postal_greeting_id VARCHAR(16),
  addressee_id VARCHAR(16),
  is_deceased VARCHAR(16),
  ,
  PRIMARY KEY(id),
  INDEX index_street_address(street_address),
  INDEX index_household_name(household_name),
  INDEX index_civicrm_primary_id(civicrm_primary_id) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
  </code></pre>
  
  <p>Anyone else experiencing this? If not, any ideas why I would?</p>
  
Tags: <smartgroups><export>
Title: Fatal error on Export in 5.18.1
ThreadText: # Fatal error on Export in 5.18.1
  
  (Asked by: username_0 on 2019-10-07)
  
  I just updated to 5.18.1 to resolve a bug caused when selecting " Exclude contacts with "do not mail" privacy, no street address, or who are deceased." But now I have a new issue:
  I set up an export with a saved field mapping. Under Merge Options I select "Merge All Contacts with the Same Address". I then click [Continue], accept my existing saved field mappings, and click [Export]. I then see a fatal error message.
  In error logs, I see the following, which I think is failing because of the extra comma after is_deceased VARCHAR(16), :
  CREATE TABLE `civicrm_tmp_d_export_e92589f8a1e163117ff1d83e45c03029`(
  id INT UNSIGNED NOT NULL AUTO_INCREMENT,
  prefix_id VARCHAR(255),
  first_name VARCHAR(64),
  last_name VARCHAR(64),
  suffix_id VARCHAR(255),
  street_address VARCHAR(96),
  supplemental_address_1 VARCHAR(96),
  city VARCHAR(64),
  state_province VARCHAR(64),
  postal_code VARCHAR(64),
  country VARCHAR(64),
  preferred_language VARCHAR(5),
  organization_name VARCHAR(128),
  custom_32 VARCHAR(255),
  home_phone_phone VARCHAR(32),
  email VARCHAR(254),
  custom_31 VARCHAR(255),
  groups TEXT,
  middle_name VARCHAR(64),
  nick_name VARCHAR(128),
  display_name VARCHAR(128),
  tags TEXT,
  deceased_date VARCHAR(32),
  do_not_mail VARCHAR(16),
  is_opt_out VARCHAR(16),
  addressee VARCHAR(255),
  postal_greeting VARCHAR(255),
  email_greeting VARCHAR(255),
  street_name VARCHAR(64),
  household_name VARCHAR(128),
  civicrm_primary_id VARCHAR(16),
  master_id VARCHAR(128),
  state_province_id VARCHAR(255),
  postal_greeting_id VARCHAR(16),
  addressee_id VARCHAR(16),
  is_deceased VARCHAR(16),
  ,
  PRIMARY KEY(id),
  INDEX index_street_address(street_address),
  INDEX index_household_name(household_name),
  INDEX index_civicrm_primary_id(civicrm_primary_id) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
  
  Anyone else experiencing this? If not, any ideas why I would?
  
  **Tags:** smartgroups, export
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-07. Score: 1
  
  Yes I think you're right. This one seems to be an issue with the combination of "Merge All Contacts with the Same Address" and using Selected Fields instead of primary fields.
  
  I'll put up another ticket: <https://lab.civicrm.org/dev/core/issues/1302>
  
  Fix looks like it will be in 5.18.2
  <https://github.com/civicrm/civicrm-core/pull/15452>
  
  
  ---
  
  