Troubleshooting the UDF

There are quite a few reasons that your UDF may not have worked. It's common for MySQL to crash if the UDF is not properly implemented, so be careful about implementing an untried UDF on a running, live system. Each system will have its own intricacies, but the following are some of the more common problems:

  • Make sure you've dropped any pre-existing functions of the same name (if you're updating a function) before you upload them or reload them. You may have to manually delete the function from the func table if you've previously added broken UDF that you can't DROP in the normal way.

  • You can also try stopping and restarting MySQL before reloading the function though this is not usually necessary.

  • Make sure the return type when you CREATE FUNCTION matches the type you return from the main function in your code (string, real or integer).

  • You may have to configure MySQL with --with-mysqld-ldflags=-rdynamic in order to implement the UDF.



Mastering MySQL 4
Mastering MySQL 4
ISBN: 0782141625
EAN: 2147483647
Year: 2003
Pages: 230
Authors: Ian Gilfillan

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net