httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torge Riedel <>
Subject [users@httpd] mod_authn_dbd: Stored procedures not supported ... "Commands out of sync; you can't run this command now"
Date Sun, 29 Jun 2014 12:25:44 GMT

I'm having a server installed with Apache 2.2 (Ubuntu LTS 12.04) and I used mod_authn_dbd
as documented here

to check the permissions.

Since I use a MySQL database

DBDriver mysql

is set.
Since there is already an existing user management on a different server with access restrictions,
the only way to use it is via a stored procedure, thus

AuthDBUserPWQuery "CALL queryUser(%s)"

is defined like this.
But this is a problem, since MySQL is - let's say - a little bit special when performing a
query which is a call to a stored procedure. If
you just perform the query and fetch the result, the next query within the same connection
will fail with "Commands out of sync; you can't run this command now" error.

The reason is that when performing a query with a call to a stored procedure you must take
result sets into account like you do when doing a multi-query.


"SELECT * FROM tUsers1; SELECT * FROM tUsers2;"

returns in MySQL two result sets and you have to use


to properly handle the returned data. And in ANY case where stored procedures are involved,
you have to use the methods above otherwise to you get error.
I think the reason is, that in stored procedures you can execute two or more SELECTs.

I already tried to find the location in the httpd sources where a fix is needed, but it seems
to me that httpd is using the apr db driver interface.
Maybe the fix has to be done there and not in httpd source, but I'm not sure.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message