Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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?

share|improve this answer

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.

share|improve this answer
    
MySql_5.0.41 is the Mysql version using in both Live and replication DB servers and same database schema also. –  Jayakrishnan T Apr 18 '11 at 7:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.