3

I have two MySQL(5.6) databases D1 and D2 on two different machines.
There is a table T1 on D1 and there are two tables T2A and T2B on D2.
I want to update T2B whenever T1 is updated.

T2A is a federated table and T1 is base table of it.
There is an "After Update" trigger on D2 which updates T2B whenever T2A is updated.

When there is an update on T2A, T2B table is updated by trigger.
When there is an update on T1, T2A table is updated by federation but the trigger to update T2B as well is not triggered.

So when there is an update on T1, T2B table is not updated automatically, only T2A is.
How to solve this?

asked Jan 28, 2016 at 9:21
4
  • 1
    For the future, when you ask a question that gets no response and you want to address it at a different community, you can flag it for migration, no need to cross-post. Commented Jan 28, 2016 at 9:53
  • Related (perhaps not identical) questions: Federated tables and triggers and Create a trigger to update table data on another Server's database. There are more, under the Related tab, on the right ----------------> Related Commented Jan 28, 2016 at 9:59
  • 1
    i think there should be a "federated-table" or "federated-storage-engine" tag here as in stackoverflow.com. Commented Jan 28, 2016 at 10:00
  • @tylerdurden now there is ;) Commented Jan 28, 2016 at 10:01

1 Answer 1

2

Federated tables are not transactional by nature, so you don't want to put a trigger on it. Alternative would be to put a trigger to post to another local table. See: Federated tables and triggers

answered Apr 27, 2016 at 3:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.