CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Creating Relationship gives DB error on civicrm_note
Pages: [1]

Author Topic: Creating Relationship gives DB error on civicrm_note  (Read 675 times)

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Creating Relationship gives DB error on civicrm_note
October 05, 2013, 12:26:44 pm
I'm trying to create a new relationship, and when I do, I get a DB error:

Code: [Select]
INSERT INTO civicrm_note (entity_table , entity_id , note , contact_id , modified_date , privacy ) VALUES ('civicrm_relationship' ,  582566 ,  NULL ,  510492 ,  20131005 , '0' )  [nativecode=1054 ** Unknown column 'entity_table' in 'field list']"]
)

entity_table is DEFINITELY there in the civicrm_note table, but for some reason, I can't do an INSERT INTO on it. I can do a SELECT based on it no problem. So I am stumped.
« Last Edit: October 05, 2013, 02:32:58 pm by bpmccain »

bpmccain

  • I post frequently
  • ***
  • Posts: 255
  • Karma: 5
  • CiviCRM version: 4.1
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Creating Relationship gives DB error on civicrm_note
October 11, 2013, 03:55:32 am
Found the solution to this.

I have logging enabled, which puts a trigger on each table. These triggers usually have a DEFINER that is the mysql user that civicrm operates under.

Somehow, and I have no idea how, the two triggers on civicrm_note for AFTER UPDATE and AFTER INSERT had the root user as their DEFINER, and so were resulting in an error when civicrm tried to execute them (as the civi user didn't have necessary permissions).

I disabled, and renabled logging. The triggers were rebuilt, this time with the correct DEFINER, and everything works

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Creating Relationship gives DB error on civicrm_note
October 11, 2013, 07:53:41 am
Thanks for posting back on this - I actually looked into your error, but couldn't figure out what was going on, I'm glad to know the answer!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Creating Relationship gives DB error on civicrm_note

This forum was archived on 2017-11-26.