Sunday, March 30, 2008

More random MySQL glitches

I ran into the following exception recently when moving an application from one server to another :

at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(
at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(
at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(
at com.mysql.jdbc.CallableStatement.determineParameterTypes(
at com.mysql.jdbc.CallableStatement.(
at com.mysql.jdbc.Connection.parseCallableStatement(
at com.mysql.jdbc.Connection.prepareCall(
at com.mysql.jdbc.Connection.prepareCall(
at org.apache.commons.dbcp.DelegatingConnection.prepareCall(
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareCall(

As it turns out, there was a permissions issue whereby the function was created with a line specifying the definer and this causes the 'SHOW CREATE FUNCTION' call to fail and return null unless the user calling the statement has permissions for select on the 'mysql' database. Some recommended solutions (that I didn't get around to trying) were changing the call to 'prepareStatement' as opposed to 'prepareCall'. The issue is logged as MySQL Bug #24065. Lately it just seems as if I keep hitting every bug out there, and can't get anything done. I hope this helps somebody.

No comments: