bayes in MySQL with replication

Rick Cooper rcooper at dwford.com
Sat Feb 23 00:28:50 GMT 2008


 

 > -----Original Message-----
 > From: mailscanner-bounces at lists.mailscanner.info 
 > [mailto:mailscanner-bounces at lists.mailscanner.info] On 
 > Behalf Of Julian Field
 > Sent: Friday, February 22, 2008 11:50 AM
 > To: MailScanner discussion
 > Subject: Re: bayes in MySQL with replication
 > 
 > -----BEGIN PGP SIGNED MESSAGE-----
 > Hash: SHA1
 > 
 > 
 > 
 > Jason Ede wrote:
 > >
 > > 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
 > >
 > That capital A with an accent of some sort right at the end 
 > of the query 
 > it reports looks very suspicious to me...
[...]

The part that mysql is complaining about starts 'ON DUPLICATE KEY UPDATE 
spam_count = 
GREATEST(spam_count + '0', 0)'. It makes sense to me because the entire
Syntax looks wacked. Unless there is something I missed all this time, the
syntax
For that statement goes 

INSERT INTO table (item1,item2,...) VALUES (value1,value2,...) ON DUPLICATE
KEY UPDATE field1='value', field2='value',...

Unless there way it is written is a special mysql short hand I have never
seen before. Could be ;->).

Rick


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the MailScanner mailing list