Apache and mod_authn_dbd DBDPrepareSQL error
- by David Brown
I am running Apache 2.2.17 on Suse Linux 11. I have installed the mod_authn_dbd module to allow authentication using a MySQL database. Simple digest authentication works absolutely fine using the following directive:
AuthDBDUserRealmQuery "SELECT loginPassword FROM login WHERE loginUser = %s and loginRealm = %s"
However, I would like to both generalize this statement and prepare it for performance and security reasons. Thus, I used the following directives instead:
DBDPrepareSQL "SELECT loginPassword FROM login WHERE loginUser = %s and loginRealm = %s" digestLogin
AuthDBDUserRealmQuery digestLogin
These directives generate the following errors:
[...] [error] (20014)Internal error: DBD: failed to prepare SQL statements:
[...] [error] (20014)Internal error: DBD: failed to initialise
Why does my actual SQL statement work when used directly, but not when I try to prepare it?
(Note I have tried using '?' and '%%' in place of '%', to no effect.)