Re: [Dovecot] quota dict mysql not working (2.0.beta4)
On Mon, 2010-05-24 at 00:47 +0400, Andrey Melnikov wrote:
after mysql_query() - mysql return right data (affected rows = 1), but there is no result to store (this is UPDATE/DELETE query), next unconditional call to mysql_store_result() return nothing (right, there no result) and reset affected_rows to -1ULL.
You should modify driver_mysql_query_s() to call mysql_field_count() first, to ensure - there is any data to read or no.
But the whole point of the code is to get number of affected rows for previous UPDATE, so that if there is no quota row for user, the quota gets recalculated.
This fixed it for my tests: http://hg.dovecot.org/dovecot-2.0/rev/0c15a760dab8
On 26.05.2010 16:32, wrote Timo Sirainen:
On Mon, 2010-05-24 at 00:47 +0400, Andrey Melnikov wrote:
after mysql_query() - mysql return right data (affected rows = 1), but there is no result to store (this is UPDATE/DELETE query), next unconditional call to mysql_store_result() return nothing (right, there no result) and reset affected_rows to -1ULL.
You should modify driver_mysql_query_s() to call mysql_field_count() first, to ensure - there is any data to read or no.
But the whole point of the code is to get number of affected rows for previous UPDATE, so that if there is no quota row for user, the quota gets recalculated.
This fixed it for my tests: http://hg.dovecot.org/dovecot-2.0/rev/0c15a760dab8
Yes, this fixed it. Thanks Timo!
participants (2)
-
e-frog
-
Timo Sirainen