[Dovecot] mysql-5.0.26 stored procedure authorization, take 2
Last time I came up with a problem with concernin MySQL authorization with stored procedures. Timo helped me get going by with modified client_flags (MULTISTATEMENT keyword).
Now all it happened again but from another way. My stored proce for MySQL is causing fillowing error:
"Oct 21 12:39:22 haos dovecot: auth-worker(default): sql(user,192.168.X.X): Password query fai led: Commands out of sync; you can't run this command now"
Looks like it is partly mysql-5.0.26 thing because of this: http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html
On the other hand with my previous mysql installation (mysql-5.0.24-r1) this error is gone (I checked by downgrading). My dovecot-sql.conf:
driver = mysql connect = host=/var/run/mysqld/mysqld.sock dbname=mailbase user=mailuser password=******** client_flags=65536 #655536 is equivalent of CLIENT_MULTI_STATEMENTS flag #yes, I still insist on using stored proc for authorization. This gives me few usefull features I like.
password_query = call Authenticat('%u', '%n', '%d')
With this config on mysq-5.0.26 I get "...Commands out of sync; you can't run this command now..." but not on mysql-5.0.24-r1. Personally I think mysql guys changed something; I can't tell what and why (changelog review?) Maybe you guys know what it was?
-- Chaos greets U
On Sat, 2006-10-21 at 20:37 +0200, Chaos Engine wrote:
"Oct 21 12:39:22 haos dovecot: auth-worker(default): sql(user,192.168.X.X): Password query fai led: Commands out of sync; you can't run this command now" .. Looks like it is partly mysql-5.0.26 thing because of this: http://dev.mysql.com/doc/refman/5.0/en/commands-out-of-sync.html .. #655536 is equivalent of CLIENT_MULTI_STATEMENTS flag #yes, I still insist on using stored proc for authorization. This gives me few usefull features I like. password_query = call Authenticat('%u', '%n', '%d')
Since this works only with multi-statements, I guess the authenticat procedure executes multiple statements? Which I guess breaks because of this:
"It can also happen if you try to execute two queries that return data without calling mysql_use_result() or mysql_store_result() in between."
I don't really see why this should be forced though.
participants (2)
-
Chaos Engine
-
Timo Sirainen