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 )'

quanta
  • 51,413
  • 19
  • 159
  • 217
Jayakrishnan T
  • 298
  • 2
  • 8
  • 22

2 Answers2

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?

the-wabbit
  • 40,737
  • 13
  • 111
  • 174
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.

TomKro
  • 136
  • 2