Hi all, I am getting duplicate entry error while inserting data in the table. My table name is TEMP and it contains only one field which is primary key ,nt null as well as auto increment .
050628 16:05:00 Slave: Error 'Duplicate entry '77' for key 1' on query 'INSERT INTO TEMP VALUES ()'. Default database: '<our database name is here>', Error_code: 1062 050628 16:05:00 Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'log-bin.018' position 37918 I have a master slave setup.So slave database has entries upto 77 only but master database has entries upto 114. If I again start inesrting entries then entries in slave database will start from 115 which is really danagerous for me. I couldn't understand the statement Fix the problem, and restart the slave SQL thread with "SLAVE START". Can anybody help me in solving this issue ? Thanks and Regards, Anurag -----Original Message----- From: Johan Höök [mailto:[EMAIL PROTECTED] Sent: Thursday, June 30, 2005 2:01 PM To: [EMAIL PROTECTED] Cc: Siegfried Heintze; mysql@lists.mysql.com Subject: Re: Wanted: Help with 'ON DUPLICATE KEY' syntax Hi Jocelyn, you're right of course. I didn't read the original post closely enough (it's early in the morning here...). I missed that SELECT wasn't used. Regards, /Johan [EMAIL PROTECTED] wrote: > Hi Johan, > > I don't think it's its problem, since MySQL returns a "You have an > error in your SQL syntax." error, and not those specified in this bug > report. This means the SQL parser failed to understand its query. > > Regards, > Jocelyn > > >>Hi Siegfried, >>I think you've run into bug #8732: >>... >>Description: >>if you do a INSERT INTO table (col_list) SELECT ... ON DUPLICATE KEY >>UPDATE and refer to the same column in the col_list and in the UPDATE >>clause, it will bail >>out, doesn't seem like it should, since not listing the column in the >>INSERT >>list will make it work. >>... >> >>I've run into it myself on 4.1.12. >> >>/Johan >> >>Siegfried Heintze wrote: >> >>>Thanks for deciphering that terrible message, Shawn. I accidentally >>>must have hit the paste key too many times. >>> >>>Anyway, here is my new insert statement: >>> >>> >>>INSERT INTO jobtitlecount (fkJobPosting, dtSnapShot, cJobTitle) >>>VALUES >>>(211584,'2005-06-26',2) ON DUPLICATE KEY UPDATE cJobTitle=2 >>> >>> >>>DBD::mysql::st execute failed: You have an error in your SQL syntax. >>>Check the manual that corresponds to your MySQL server version for >>>the right syntax to use near 'ON DUPLICATE KEY UPDATE cJobTitle=2' at >>>line 1 at ./crawl-hot-jobs.pl line 675. >>> >>> >>> >>>I'm looking at the documentation on >>>http://dev.mysql.com/doc/mysql/en/insert.html and I don't see what I >>>am doing wrong. >>> >>>Thanks, >>>Siegfried >>> >>> >> >> >>-- >>MySQL General Mailing List >>For list archives: http://lists.mysql.com/mysql >>To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > > > > Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]