Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8024063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:45:08+00:00 2026-06-04T22:45:08+00:00

I have the following triggers on my users table which copies the value to

  • 0

I have the following triggers on my users table which copies the value to email field from name field.

CREATE TRIGGER copy_name_on_insert BEFORE INSERT ON users
FOR EACH ROW
  SET NEW.email = NEW.name;

CREATE TRIGGER copy_name_on_update BEFORE UPDATE ON users
FOR EACH ROW
  SET NEW.email = NEW.name;

This trigger is working fine in local env, but in production its going into an infinite loop.
Does anyone have any idea about this behaviour?

Local and Production envs are running mysql 5.5.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:45:10+00:00Added an answer on June 4, 2026 at 10:45 pm

    Got this answer from our DBA.

    So, this was not a recursion bug (though the error message was really bad, and looked like one). Rather, it was a memory complexity problem.

    Basically, each statement must run in a limited memory space (128K in this case). While most statements fit in far less than this space, it appears that this trigger has considerably greater memory requirements.

    The reason that this worked in testing is that the tests attempted were not large enough. (And the testing server likely had more memory allocated to it)

    As an example, this worked in testing:

    UPDATE users SET name="j@mail.com" WHERE id=1234;
    

    But what really runs in production is:

    update users set full_name='Jason H', attr1='abc1', attr2='abc', attr3='adad' .... where id=1917;
    

    Basically, the java/hibernate system is UPDATEing every single field… for some reason. This is pretty silly, and hibernate probably should be doing less.

    The considerably greater complexity of the real query pushed it over the memory limits in production.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following trigger: CREATE TRIGGER Users_Delete ON Users AFTER DELETE AS BEGIN
hi i have created a trigger which i want to update a table field
i have USERS TABLE that contains the following fields _id name number_of_posts and i
I have the following table: CREATE TABLE FE_USER ( userid int identity (321,4) CONSTRAINT
I have the following schema: Database: test. Table: per_login_user, Field: username (PK), password Database:
I have created the following trigger for insert in the deleted user table the
I have two tables with the following column names. users ui | email |
I have the following scenario, action in window Window A triggers new window to
I have the following function that is supposed to trigger anytime one of the
I have the following code being run if an iphone/ipad/ipod is detected: $('.tooltip-trigger').tooltip({offset: [20,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.