MySQL 5.6 Bug Amazon RDS with replica. AFTER INSERT TRIGGER is not working. Solutions?
I have MasterDB
and ReplicaDB
in Amazon RDS environment. I need to move 1 table (MYTable
) from replica to other external DB (ExternalDB
).
My solution (do not work) was to add a AFTER TRIGGER
listening for UPDATES
and INSERTS
to MYTable (and only add that TRIGGER in ReplicaDB) and copy everything on MyTableLog. Them pooling MyTableLog (and remove already processed records).
Problem: It looks like the RDS replica it is not firing the AFTER INSERT
event (is only firing AFTER UPDATES
). However I tested the solution in 5.7 and it worked.
Any ideas? It is a bug in MySQL
? Any solution?
UPDATES:
1- I'm adding a new trigger on SlaveDB
(it is not a trigger replicated from MasterDB
)
2- It is working in 5.7 -> 5.7 ... the issue is in 5.6 -> 5.6 MySQL
DB
3- Im adding TWO triggers (both works in 5.7 but only 1 works in 5.6)
4- Update Trigger (works in 5.6 and 5.7)
CREATE TRIGGER after_mytable_update
AFTER UPDATE ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 0, is_processed = 0;
END
5- Insert Trigger (DO NOT WORK IN MYSQL 5.6)
CREATE TRIGGER after_mytable_insert
AFTER INSERT ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 1, is_processed = 0;
END
As simple as it is. The INSERT
trigger it **IS NOT being executed in MySQL 5.6
**
(From Comment)
CREATE TABLE mytable_log_replica (
replica_id int(11) unsigned NOT NULL AUTO_INCREMENT,
is_new int(11) DEFAULT '0',
is_processed int(11) DEFAULT '0',
id int(11) unsigned NOT NULL,
stamp datetime DEFAULT NULL,
user_id int(11) DEFAULT NULL,
name varchar(64) DEFAULT NULL,
address varchar(64) DEFAULT NULL,
transaction_status varchar(64) DEFAULT NULL,
ip varchar(64) DEFAULT NULL,
cb_code varchar(16) DEFAULT NULL PRIMARY KEY (replica_id)
) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1
mysql trigger insert amazon-rds
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have MasterDB
and ReplicaDB
in Amazon RDS environment. I need to move 1 table (MYTable
) from replica to other external DB (ExternalDB
).
My solution (do not work) was to add a AFTER TRIGGER
listening for UPDATES
and INSERTS
to MYTable (and only add that TRIGGER in ReplicaDB) and copy everything on MyTableLog. Them pooling MyTableLog (and remove already processed records).
Problem: It looks like the RDS replica it is not firing the AFTER INSERT
event (is only firing AFTER UPDATES
). However I tested the solution in 5.7 and it worked.
Any ideas? It is a bug in MySQL
? Any solution?
UPDATES:
1- I'm adding a new trigger on SlaveDB
(it is not a trigger replicated from MasterDB
)
2- It is working in 5.7 -> 5.7 ... the issue is in 5.6 -> 5.6 MySQL
DB
3- Im adding TWO triggers (both works in 5.7 but only 1 works in 5.6)
4- Update Trigger (works in 5.6 and 5.7)
CREATE TRIGGER after_mytable_update
AFTER UPDATE ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 0, is_processed = 0;
END
5- Insert Trigger (DO NOT WORK IN MYSQL 5.6)
CREATE TRIGGER after_mytable_insert
AFTER INSERT ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 1, is_processed = 0;
END
As simple as it is. The INSERT
trigger it **IS NOT being executed in MySQL 5.6
**
(From Comment)
CREATE TABLE mytable_log_replica (
replica_id int(11) unsigned NOT NULL AUTO_INCREMENT,
is_new int(11) DEFAULT '0',
is_processed int(11) DEFAULT '0',
id int(11) unsigned NOT NULL,
stamp datetime DEFAULT NULL,
user_id int(11) DEFAULT NULL,
name varchar(64) DEFAULT NULL,
address varchar(64) DEFAULT NULL,
transaction_status varchar(64) DEFAULT NULL,
ip varchar(64) DEFAULT NULL,
cb_code varchar(16) DEFAULT NULL PRIMARY KEY (replica_id)
) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1
mysql trigger insert amazon-rds
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Seeing theCREATE TRIGGER
may give us some more clues with which to help you.
– Rick James
Feb 4 '18 at 16:04
Just to clarify: I'm adding a new trigger in Slave DB (It is not a trigger replicated from Martes DB)
– Karel
Feb 5 '18 at 17:35
Let's seeSHOW CREATE TABLE mytable_log
.
– Rick James
Feb 16 '18 at 18:22
CREATE TABLEmytable_log_replica
(replica_id
int(11) unsigned NOT NULL AUTO_INCREMENT,is_new
int(11) DEFAULT '0',is_processed
int(11) DEFAULT '0',id
int(11) unsigned NOT NULL,stamp
datetime DEFAULT NULL,user_id
int(11) DEFAULT NULL,name
varchar(64) DEFAULT NULL,address
varchar(64) DEFAULT NULL,transaction_status
varchar(64) DEFAULT NULL,ip
varchar(64) DEFAULT NULL,cb_code
varchar(16) DEFAULT NULL PRIMARY KEY (replica_id
) ) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1
– Karel
Feb 16 '18 at 19:01
add a comment |
I have MasterDB
and ReplicaDB
in Amazon RDS environment. I need to move 1 table (MYTable
) from replica to other external DB (ExternalDB
).
My solution (do not work) was to add a AFTER TRIGGER
listening for UPDATES
and INSERTS
to MYTable (and only add that TRIGGER in ReplicaDB) and copy everything on MyTableLog. Them pooling MyTableLog (and remove already processed records).
Problem: It looks like the RDS replica it is not firing the AFTER INSERT
event (is only firing AFTER UPDATES
). However I tested the solution in 5.7 and it worked.
Any ideas? It is a bug in MySQL
? Any solution?
UPDATES:
1- I'm adding a new trigger on SlaveDB
(it is not a trigger replicated from MasterDB
)
2- It is working in 5.7 -> 5.7 ... the issue is in 5.6 -> 5.6 MySQL
DB
3- Im adding TWO triggers (both works in 5.7 but only 1 works in 5.6)
4- Update Trigger (works in 5.6 and 5.7)
CREATE TRIGGER after_mytable_update
AFTER UPDATE ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 0, is_processed = 0;
END
5- Insert Trigger (DO NOT WORK IN MYSQL 5.6)
CREATE TRIGGER after_mytable_insert
AFTER INSERT ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 1, is_processed = 0;
END
As simple as it is. The INSERT
trigger it **IS NOT being executed in MySQL 5.6
**
(From Comment)
CREATE TABLE mytable_log_replica (
replica_id int(11) unsigned NOT NULL AUTO_INCREMENT,
is_new int(11) DEFAULT '0',
is_processed int(11) DEFAULT '0',
id int(11) unsigned NOT NULL,
stamp datetime DEFAULT NULL,
user_id int(11) DEFAULT NULL,
name varchar(64) DEFAULT NULL,
address varchar(64) DEFAULT NULL,
transaction_status varchar(64) DEFAULT NULL,
ip varchar(64) DEFAULT NULL,
cb_code varchar(16) DEFAULT NULL PRIMARY KEY (replica_id)
) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1
mysql trigger insert amazon-rds
I have MasterDB
and ReplicaDB
in Amazon RDS environment. I need to move 1 table (MYTable
) from replica to other external DB (ExternalDB
).
My solution (do not work) was to add a AFTER TRIGGER
listening for UPDATES
and INSERTS
to MYTable (and only add that TRIGGER in ReplicaDB) and copy everything on MyTableLog. Them pooling MyTableLog (and remove already processed records).
Problem: It looks like the RDS replica it is not firing the AFTER INSERT
event (is only firing AFTER UPDATES
). However I tested the solution in 5.7 and it worked.
Any ideas? It is a bug in MySQL
? Any solution?
UPDATES:
1- I'm adding a new trigger on SlaveDB
(it is not a trigger replicated from MasterDB
)
2- It is working in 5.7 -> 5.7 ... the issue is in 5.6 -> 5.6 MySQL
DB
3- Im adding TWO triggers (both works in 5.7 but only 1 works in 5.6)
4- Update Trigger (works in 5.6 and 5.7)
CREATE TRIGGER after_mytable_update
AFTER UPDATE ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 0, is_processed = 0;
END
5- Insert Trigger (DO NOT WORK IN MYSQL 5.6)
CREATE TRIGGER after_mytable_insert
AFTER INSERT ON mytable
FOR EACH ROW
BEGIN
INSERT INTO mytable_log
SET is_new = 1, is_processed = 0;
END
As simple as it is. The INSERT
trigger it **IS NOT being executed in MySQL 5.6
**
(From Comment)
CREATE TABLE mytable_log_replica (
replica_id int(11) unsigned NOT NULL AUTO_INCREMENT,
is_new int(11) DEFAULT '0',
is_processed int(11) DEFAULT '0',
id int(11) unsigned NOT NULL,
stamp datetime DEFAULT NULL,
user_id int(11) DEFAULT NULL,
name varchar(64) DEFAULT NULL,
address varchar(64) DEFAULT NULL,
transaction_status varchar(64) DEFAULT NULL,
ip varchar(64) DEFAULT NULL,
cb_code varchar(16) DEFAULT NULL PRIMARY KEY (replica_id)
) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1
mysql trigger insert amazon-rds
mysql trigger insert amazon-rds
edited Feb 16 '18 at 21:28
Rick James
42k22258
42k22258
asked Jan 31 '18 at 16:09
KarelKarel
62
62
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 10 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Seeing theCREATE TRIGGER
may give us some more clues with which to help you.
– Rick James
Feb 4 '18 at 16:04
Just to clarify: I'm adding a new trigger in Slave DB (It is not a trigger replicated from Martes DB)
– Karel
Feb 5 '18 at 17:35
Let's seeSHOW CREATE TABLE mytable_log
.
– Rick James
Feb 16 '18 at 18:22
CREATE TABLEmytable_log_replica
(replica_id
int(11) unsigned NOT NULL AUTO_INCREMENT,is_new
int(11) DEFAULT '0',is_processed
int(11) DEFAULT '0',id
int(11) unsigned NOT NULL,stamp
datetime DEFAULT NULL,user_id
int(11) DEFAULT NULL,name
varchar(64) DEFAULT NULL,address
varchar(64) DEFAULT NULL,transaction_status
varchar(64) DEFAULT NULL,ip
varchar(64) DEFAULT NULL,cb_code
varchar(16) DEFAULT NULL PRIMARY KEY (replica_id
) ) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1
– Karel
Feb 16 '18 at 19:01
add a comment |
Seeing theCREATE TRIGGER
may give us some more clues with which to help you.
– Rick James
Feb 4 '18 at 16:04
Just to clarify: I'm adding a new trigger in Slave DB (It is not a trigger replicated from Martes DB)
– Karel
Feb 5 '18 at 17:35
Let's seeSHOW CREATE TABLE mytable_log
.
– Rick James
Feb 16 '18 at 18:22
CREATE TABLEmytable_log_replica
(replica_id
int(11) unsigned NOT NULL AUTO_INCREMENT,is_new
int(11) DEFAULT '0',is_processed
int(11) DEFAULT '0',id
int(11) unsigned NOT NULL,stamp
datetime DEFAULT NULL,user_id
int(11) DEFAULT NULL,name
varchar(64) DEFAULT NULL,address
varchar(64) DEFAULT NULL,transaction_status
varchar(64) DEFAULT NULL,ip
varchar(64) DEFAULT NULL,cb_code
varchar(16) DEFAULT NULL PRIMARY KEY (replica_id
) ) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1
– Karel
Feb 16 '18 at 19:01
Seeing the
CREATE TRIGGER
may give us some more clues with which to help you.– Rick James
Feb 4 '18 at 16:04
Seeing the
CREATE TRIGGER
may give us some more clues with which to help you.– Rick James
Feb 4 '18 at 16:04
Just to clarify: I'm adding a new trigger in Slave DB (It is not a trigger replicated from Martes DB)
– Karel
Feb 5 '18 at 17:35
Just to clarify: I'm adding a new trigger in Slave DB (It is not a trigger replicated from Martes DB)
– Karel
Feb 5 '18 at 17:35
Let's see
SHOW CREATE TABLE mytable_log
.– Rick James
Feb 16 '18 at 18:22
Let's see
SHOW CREATE TABLE mytable_log
.– Rick James
Feb 16 '18 at 18:22
CREATE TABLE
mytable_log_replica
( replica_id
int(11) unsigned NOT NULL AUTO_INCREMENT, is_new
int(11) DEFAULT '0', is_processed
int(11) DEFAULT '0', id
int(11) unsigned NOT NULL, stamp
datetime DEFAULT NULL, user_id
int(11) DEFAULT NULL, name
varchar(64) DEFAULT NULL, address
varchar(64) DEFAULT NULL, transaction_status
varchar(64) DEFAULT NULL, ip
varchar(64) DEFAULT NULL, cb_code
varchar(16) DEFAULT NULL PRIMARY KEY (replica_id
) ) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1– Karel
Feb 16 '18 at 19:01
CREATE TABLE
mytable_log_replica
( replica_id
int(11) unsigned NOT NULL AUTO_INCREMENT, is_new
int(11) DEFAULT '0', is_processed
int(11) DEFAULT '0', id
int(11) unsigned NOT NULL, stamp
datetime DEFAULT NULL, user_id
int(11) DEFAULT NULL, name
varchar(64) DEFAULT NULL, address
varchar(64) DEFAULT NULL, transaction_status
varchar(64) DEFAULT NULL, ip
varchar(64) DEFAULT NULL, cb_code
varchar(16) DEFAULT NULL PRIMARY KEY (replica_id
) ) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1– Karel
Feb 16 '18 at 19:01
add a comment |
1 Answer
1
active
oldest
votes
According Paragraphs 1-3 of MySQL Documentation Replication and Triggers
With statement-based replication, triggers executed on the master also execute on the slave. With row-based replication, triggers executed on the master do not execute on the slave. Instead, the row changes on the master resulting from trigger execution are replicated and applied on the slave.
This behavior is by design. If under row-based replication the slave applied the triggers as well as the row changes caused by them, the changes would in effect be applied twice on the slave, leading to different data on the master and the slave.
If you want triggers to execute on both the master and the slave—perhaps because you have different triggers on the master and slave—you must use statement-based replication. However, to enable slave-side triggers, it is not necessary to use statement-based replication exclusively. It is sufficient to switch to statement-based replication only for those statements where you want this effect, and to use row-based replication the rest of the time.
MySQL default for binlog_format in 5.6 is STATEMENT
and ROW
in 5.7. You will have to set that in the DB Parameter Group. You may need to convert the binlog_format to STATEMENT
on RDS Master, RDS Slave, and the External Slave. Only the can you configure a trigger on the External Slave.
Interestingly, MariaDB has in its Documentation Running Triggers on the Slave for Row-based Events
. You may have to switch to MariaDB.
Good point Rolando. However in my scenario I don’t have the TRIGGER statement in Master DB. I added the Trigger only on slave DB. In 5.7 works and in 5.6 don’t.
– Karel
Feb 3 '18 at 22:33
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f196739%2fmysql-5-6-bug-amazon-rds-with-replica-after-insert-trigger-is-not-working-solu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
According Paragraphs 1-3 of MySQL Documentation Replication and Triggers
With statement-based replication, triggers executed on the master also execute on the slave. With row-based replication, triggers executed on the master do not execute on the slave. Instead, the row changes on the master resulting from trigger execution are replicated and applied on the slave.
This behavior is by design. If under row-based replication the slave applied the triggers as well as the row changes caused by them, the changes would in effect be applied twice on the slave, leading to different data on the master and the slave.
If you want triggers to execute on both the master and the slave—perhaps because you have different triggers on the master and slave—you must use statement-based replication. However, to enable slave-side triggers, it is not necessary to use statement-based replication exclusively. It is sufficient to switch to statement-based replication only for those statements where you want this effect, and to use row-based replication the rest of the time.
MySQL default for binlog_format in 5.6 is STATEMENT
and ROW
in 5.7. You will have to set that in the DB Parameter Group. You may need to convert the binlog_format to STATEMENT
on RDS Master, RDS Slave, and the External Slave. Only the can you configure a trigger on the External Slave.
Interestingly, MariaDB has in its Documentation Running Triggers on the Slave for Row-based Events
. You may have to switch to MariaDB.
Good point Rolando. However in my scenario I don’t have the TRIGGER statement in Master DB. I added the Trigger only on slave DB. In 5.7 works and in 5.6 don’t.
– Karel
Feb 3 '18 at 22:33
add a comment |
According Paragraphs 1-3 of MySQL Documentation Replication and Triggers
With statement-based replication, triggers executed on the master also execute on the slave. With row-based replication, triggers executed on the master do not execute on the slave. Instead, the row changes on the master resulting from trigger execution are replicated and applied on the slave.
This behavior is by design. If under row-based replication the slave applied the triggers as well as the row changes caused by them, the changes would in effect be applied twice on the slave, leading to different data on the master and the slave.
If you want triggers to execute on both the master and the slave—perhaps because you have different triggers on the master and slave—you must use statement-based replication. However, to enable slave-side triggers, it is not necessary to use statement-based replication exclusively. It is sufficient to switch to statement-based replication only for those statements where you want this effect, and to use row-based replication the rest of the time.
MySQL default for binlog_format in 5.6 is STATEMENT
and ROW
in 5.7. You will have to set that in the DB Parameter Group. You may need to convert the binlog_format to STATEMENT
on RDS Master, RDS Slave, and the External Slave. Only the can you configure a trigger on the External Slave.
Interestingly, MariaDB has in its Documentation Running Triggers on the Slave for Row-based Events
. You may have to switch to MariaDB.
Good point Rolando. However in my scenario I don’t have the TRIGGER statement in Master DB. I added the Trigger only on slave DB. In 5.7 works and in 5.6 don’t.
– Karel
Feb 3 '18 at 22:33
add a comment |
According Paragraphs 1-3 of MySQL Documentation Replication and Triggers
With statement-based replication, triggers executed on the master also execute on the slave. With row-based replication, triggers executed on the master do not execute on the slave. Instead, the row changes on the master resulting from trigger execution are replicated and applied on the slave.
This behavior is by design. If under row-based replication the slave applied the triggers as well as the row changes caused by them, the changes would in effect be applied twice on the slave, leading to different data on the master and the slave.
If you want triggers to execute on both the master and the slave—perhaps because you have different triggers on the master and slave—you must use statement-based replication. However, to enable slave-side triggers, it is not necessary to use statement-based replication exclusively. It is sufficient to switch to statement-based replication only for those statements where you want this effect, and to use row-based replication the rest of the time.
MySQL default for binlog_format in 5.6 is STATEMENT
and ROW
in 5.7. You will have to set that in the DB Parameter Group. You may need to convert the binlog_format to STATEMENT
on RDS Master, RDS Slave, and the External Slave. Only the can you configure a trigger on the External Slave.
Interestingly, MariaDB has in its Documentation Running Triggers on the Slave for Row-based Events
. You may have to switch to MariaDB.
According Paragraphs 1-3 of MySQL Documentation Replication and Triggers
With statement-based replication, triggers executed on the master also execute on the slave. With row-based replication, triggers executed on the master do not execute on the slave. Instead, the row changes on the master resulting from trigger execution are replicated and applied on the slave.
This behavior is by design. If under row-based replication the slave applied the triggers as well as the row changes caused by them, the changes would in effect be applied twice on the slave, leading to different data on the master and the slave.
If you want triggers to execute on both the master and the slave—perhaps because you have different triggers on the master and slave—you must use statement-based replication. However, to enable slave-side triggers, it is not necessary to use statement-based replication exclusively. It is sufficient to switch to statement-based replication only for those statements where you want this effect, and to use row-based replication the rest of the time.
MySQL default for binlog_format in 5.6 is STATEMENT
and ROW
in 5.7. You will have to set that in the DB Parameter Group. You may need to convert the binlog_format to STATEMENT
on RDS Master, RDS Slave, and the External Slave. Only the can you configure a trigger on the External Slave.
Interestingly, MariaDB has in its Documentation Running Triggers on the Slave for Row-based Events
. You may have to switch to MariaDB.
answered Feb 2 '18 at 19:29
RolandoMySQLDBARolandoMySQLDBA
141k24220375
141k24220375
Good point Rolando. However in my scenario I don’t have the TRIGGER statement in Master DB. I added the Trigger only on slave DB. In 5.7 works and in 5.6 don’t.
– Karel
Feb 3 '18 at 22:33
add a comment |
Good point Rolando. However in my scenario I don’t have the TRIGGER statement in Master DB. I added the Trigger only on slave DB. In 5.7 works and in 5.6 don’t.
– Karel
Feb 3 '18 at 22:33
Good point Rolando. However in my scenario I don’t have the TRIGGER statement in Master DB. I added the Trigger only on slave DB. In 5.7 works and in 5.6 don’t.
– Karel
Feb 3 '18 at 22:33
Good point Rolando. However in my scenario I don’t have the TRIGGER statement in Master DB. I added the Trigger only on slave DB. In 5.7 works and in 5.6 don’t.
– Karel
Feb 3 '18 at 22:33
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f196739%2fmysql-5-6-bug-amazon-rds-with-replica-after-insert-trigger-is-not-working-solu%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Seeing the
CREATE TRIGGER
may give us some more clues with which to help you.– Rick James
Feb 4 '18 at 16:04
Just to clarify: I'm adding a new trigger in Slave DB (It is not a trigger replicated from Martes DB)
– Karel
Feb 5 '18 at 17:35
Let's see
SHOW CREATE TABLE mytable_log
.– Rick James
Feb 16 '18 at 18:22
CREATE TABLE
mytable_log_replica
(replica_id
int(11) unsigned NOT NULL AUTO_INCREMENT,is_new
int(11) DEFAULT '0',is_processed
int(11) DEFAULT '0',id
int(11) unsigned NOT NULL,stamp
datetime DEFAULT NULL,user_id
int(11) DEFAULT NULL,name
varchar(64) DEFAULT NULL,address
varchar(64) DEFAULT NULL,transaction_status
varchar(64) DEFAULT NULL,ip
varchar(64) DEFAULT NULL,cb_code
varchar(16) DEFAULT NULL PRIMARY KEY (replica_id
) ) ENGINE=InnoDB AUTO_INCREMENT=240878 DEFAULT CHARSET=latin1– Karel
Feb 16 '18 at 19:01