Using stored procedures on MySQL version < 5.5.3


#1

I am trying to call a stored procedure on mysql version 5.0.77. When I try to do a simple call of the procedure, I get the following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘DATA_TYPE’ in ‘field list’ (SQL: SELECT ROUTINE_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = :type AND ROUTINE_SCHEMA = :schema)",

I believe that this is because my version of MySQL does not have the column ‘DATA_TYPE’ in the ROUTINES table. Is there anyway to get around this? I need to use procedures to fulfill my application’s needs and upgrading the DB is not an easy option right now.


#2

I looked around the source code and it seems that DATA_TYPE is hard-coded into the source with no obvious options for using an older DB schema.

If this is the case, it looks like my only two options are to forget about using DF until I can get the DB upgraded (perhaps never) or resort to some local hackery of DF to make it ignore the DATA_TYPE field. It’s too bad because for store procedures, that field is supposed to always be NULL anyway.


#3

I was able to get this to work by coding my own versions of findRoutineNames and loadParamaters that were specific to MySQL 5.0. They make use of the mysql.proc table to get additional information that is not available in the INFORMATION_SCHEMA table in 5.0.