UDF in c++ problem

2002-09-06 Thread Fei Chen
Dear list, I have a version of a shared lib, say udf_test.so, written in C, that loads using "mysql> CREATE FUNCTION ..." without a problem. Now say I create another lib, udf_test1.so, that's written in C++ and includes code from udf_test.so (declared using extern "C"{}), MySQL complains ERROR 11

How to Print from UDF to MySQL screen?

2002-07-17 Thread Fei Chen
Dear all, I'm trying to write some UDFs and it will help a lot if I can print debugging information out directly to the screen so I can see what's going on. But printf() etc does not print to the mysql client screen. Is there an easy work around? Thanks for any tips, fei

Newbie: Test for MySQL connection

2002-04-18 Thread Fei Chen
Dear all, I don't know where to look for this information... Couldn't find it in the manual. How do I test whether a connection has been established so I don't need to open a new one again? e.g. MYSQL tmp; void f1(){ mysql_init(&tmp); mysql_real_connect(&tmp,...) } void f2(){ if(!connected(&

Re: MySQL UDF questions

2002-04-11 Thread Fei Chen
Dear Georg, Thanks for replying. I have read the mysql manual but unfortunately have not been able to find the answer. I realize UDFs can have field names as their parameters, as in select my_udf(fld1, fld2, fld10) from myTable; but here the field names have to be specified explicitly. What I'm w

MySQL UDF questions

2002-04-10 Thread Fei Chen
Dear all, I'm new to writing UDFs in MySQL so please bear with my couple of questions. How do I write a UDF to handle a entire tuple, e.g. is it possible to have select my_udf(*) from myTable; ? Also, is there a way for a UDF to return a data structure, say, a multi dimensional array? Or do I n