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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Drop Trigger Error
Pages: [1]

Author Topic: Drop Trigger Error  (Read 3027 times)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Drop Trigger Error
July 09, 2013, 09:56:30 am
In an attempt to upgrade my CiviCRM database from 4.3.1 to 4.3.4, I get this error:

Code: [Select]
DROP TRIGGER IF EXISTS civicrm_value_spendenbescheinigung_organisationen_2_before_insert [nativecode=1059 ** Identifier name 'civicrm_value_spendenbescheinigung_organisationen_2_before_insert' is too long]
I'm not sure, however, where in the code I can disable this. This trigger of course does not exist, as it was too big to be made to begin with.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Drop Trigger Error
July 09, 2013, 09:57:42 pm
Yes, the script goes through & gets all table names & then attempts to drop triggers with the name + the rest of the trigger. So, if you have a long table name in your database then various things will fail.

I don't think I've ever logged this so it might be worth doing
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drop Trigger Error
July 10, 2013, 04:04:52 am
Logging what? I decided to just remove the group/fields as they were not required. Couldn't even delete the fields via the interface due to similar errors. :(
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Drop Trigger Error
July 10, 2013, 07:10:18 am
If you using trigger related features like adv logging ..etc, might want to disable->upgrade->enable and see how that works, and handle / investigate the error separately ?

Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Drop Trigger Error
July 10, 2013, 02:27:59 pm
No, the drop triggers thing runs whether or not you have logging turned on.

If you have any tables in your database with names  longer than
(`max_trigger_length` - length('_on_insert'))

you will hit the problems Hershel is describing - I'm not sure exactly when. On menu rebuild I think.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Drop Trigger Error
July 10, 2013, 09:34:31 pm
A backtrace might give the idea on where & for what purpose the triggers are running, and could help decide if that part can be disabled / skipped.

OR, If you sure there are no triggers on that table - altering table name along with custom group table (table_name column) shouldn't be difficult ?
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drop Trigger Error
August 27, 2013, 05:44:58 am
This issue is not a logging problem, it appears to be a core CiviCRM bug. Follow this Issue http://issues.civicrm.org/jira/browse/CRM-11794 for more information.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Drop Trigger Error
August 27, 2013, 06:01:01 am

hershel:

can u please submit a patch for this, so we can pull it into 4.4

thx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drop Trigger Error
August 27, 2013, 06:03:24 am
Well, the code I posted just attempts to skip Trigger creation/deletion for large table names. I would think that a proper fix would be to truncate such table names so as to allow Trigger creation/deletion. I think my "fix" is a hack but at least demonstrates what the issue is.

No?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Drop Trigger Error
August 27, 2013, 06:22:14 am

the patch should shorten the trigger names for both the create and delete options

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drop Trigger Error
August 27, 2013, 09:55:35 am
I don't think it's that simple. If you shorten the name then you must review all existing triggers to make sure you're not attempting to use the name of an existing one, and if you are, then you need logic to adjust the new name so as not to conflict with the old one.

Then in reality you must store that name somewhere so you can later delete it.

If I have LongGroup1 and LongGroup2 and the first trigger is called LongGroupTrigger and the second should have been LongGroupTrigger also but we adjust it to LongGroupTrigg_2 and then I later delete LongGroup1 then if I later need to remove the trigger for LongGroup2 we must have recorded somewhere that its trigger is not LongGroupTrigger (as it logically should be) but LongGroupTrigg_2.

That or use some method of marking them so that SHOW TRIGGERS can be used to fetch them.

I think, in short, that this is not a simple matter and will require a bit of thought, and this may be out of my ability to contribute.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Drop Trigger Error
August 27, 2013, 10:34:13 am

our strategy in the past has to shorten long names by using an md5 suffix for part of the name

thus:

longgroup1 becomes longgroutrigger_MD5HASH1 and  longgroup1 becomes longgroutrigger_MD5HASH2

since we never change the "name" of a custom table after creation, this works and the trigger is alwys unique (or uniq as long as md5's are uniq which is super high)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Drop Trigger Error

This forum was archived on 2017-11-26.