bayes in MySQL with replication
Rick Cooper
rcooper at dwford.com
Fri Feb 22 17:07:59 GMT 2008
_____
From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Jason Ede
Sent: Friday, February 22, 2008 10:47 AM
To: MailScanner discussion
Subject: RE: bayes in MySQL with replication
Many thanks for that... just what I was looking for...
I also saw a
080222 15:38:55 [ERROR] Slave: Error '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 spam_count = GREATEST(spam_count
+ '0', 0),
' at line 2' on query. Default database: 'sa_bayes'. Query:
'INSERT INTO bayes_token
(id ON DUPLICATE KEY UPDATE spam_count =
GREATEST(spam_count + '0', 0),
ham_count = GREATEST(ham_count + '1',
0),
atime = GREATEST(atime,
'1203694258')Ã', Error_code: 1064
080222 15:38:55 [ERROR] Error running query, slave SQL thread aborted. Fix
the problem, and restart the slave SQL thread with "SLAVE START". We stopped
at log 'mysql-bin.000011' position 5334725
error. Im guessing I can add 1064 to that list too although I cant see
what the syntax is wrong
[...]
I have never seen ON DUPLICATE KEY syntax like that?
INSERT INTO bayes_token (id, ham_count, atime) VALUES \
( GREATEST(spam_count + '0', 0),GREATEST(ham_count + '1', 0), \
GREATEST(atime, '1203694258') ) \
ON DUPLICATE KEY UPDATE spam_count = GREATEST(spam_count + '0', 0), \
ham_count = GREATEST(ham_count + '1', 0),
atime = GREATEST(atime, '1203694258');
would be how I would write it.
Rick
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20080222/bd2c5b2c/attachment.html
More information about the MailScanner
mailing list