MySQL Forums
Forum List  »  UDF

The udf example functions always return null for me
Posted by: Reid Wilson
Date: March 11, 2009 01:37PM

64 bit MySQL on Fedora 8 (It's actually an Amazon EC2 instance if that suggests anything.) MySQL installed with "yum install mysql" but had to download sources to get sql/udf_example.c

I created the .so file with this:

gcc -shared -o udf_example.so udf_example.c -I/usr/include/mysql/ -fPIC

I then put it in /usr/lib64

Then did this:

mysql> CREATE FUNCTION metaphon RETURNS INT SONAME 'udf_example.so';
Query OK, 0 rows affected (0.00 sec)

However, I always get NULL returned:

mysql> select metaphon('Wilson');
+--------------------+
| metaphon('Wilson') |
+--------------------+
| NULL |
+--------------------+


select lookup('www.yahoo.com');
+-------------------------+
| lookup('www.yahoo.com') |
+-------------------------+
| NULL |
+-------------------------+

Any insight or suggestions anyone can add would be most appreciated!

Thanks,

Reid

Options: ReplyQuote


Subject
Views
Written By
Posted
The udf example functions always return null for me
5807
March 11, 2009 01:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.