1

My replication server showing the following error,Please go through the query and tell me your comments.The insert query is working in live DB server Properly , but showing error in replication DB server.

Last_Error: Error 'Subquery returns more than 1 row' on query. Default database: 'Clinical'. Query: 'INSERT INTO document(id, doc_id, pat_id, visit_id,enc_id, f_id, number, ame_yesno, ame_document_id, adyesno, adde_document_id, approved_yesno, active_yesno, last_modified_by, last_modified_date_time, status_id ) VALUES (4722,4722,37745,9293,9513,'754',2,0,'',0,0,'0',1,'VMC0068','2011-04-07 10:55:04', 1 )'

2 Answers 2

1

As you are issuing a simple INSERT INTO without any SELECT statements, check on the constraints defined for your document_master table on your replication slave - is it possible that you have a FOREIGN KEY constraint defined to check on a non-unique column?

1

On your master and slave run the subquery that is returning more than one row on the slave and see if they return the same answer. This could be a data consistency problem. If you are running different versions of MySQL on the master and slave, this could also be an issue. My guess is that the master has one set of data and the slave has another.

1
  • MySql_5.0.41 is the Mysql version using in both Live and replication DB servers and same database schema also. Apr 18, 2011 at 7:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .