[Dovecot] quota dict with mysql 4.0

Andre Hübner andre.huebner at gmx.de
Thu Mar 25 13:46:10 EET 2010


>> I am somewhat surprised that the older software is not compatible with
>> the newer version of MySQL. Usually, it is the other way around. Have
>> you checked to see if newer versions of the incompatible software
>> exist? I would be willing to wager that they have been updated to
>> accommodate the newer MySQL versions.

Syntax changed a litte bit and also there are some new protected words which 
are used by older software in sql without backticks etc.
I agree updating would be the better way but we talking about a big number 
of servers and customers still using it. this is not changed over night....

I looked into dovecot-1.2.11/src/lib-dict/dict-sql.c, there seems to be a 
check for "ON DUPLICATE KEY UPDATE"  on line 588.
I recompiled dovecot on mysql 4.0 machine and tried again but there was no 
SQL is successful when dataset in quotatable is existing. in this case 
dovecot triggers an update of the data.
But if no line for user is existing in quotatable and an insert is needed 
there is still the error:

sql dict: commit 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 bytes='12525'' at line

why is the mysql 4.0-recompiled dovecot thinking my mysql is able to do "ON 
DUPLICATE KEY UPDATE"? How to avoid this?


More information about the dovecot mailing list