MySQL Forums
Forum List  »  UDF

UDF string functions return blob?
Posted by: Charles Bradshaw
Date: March 28, 2013 08:26AM

I have written a simple UDF string function:
char *simple(UDF_INIT *initid, UDF_ARGS *args,
             char *result, unsigned long *length,
             char *is_null, char *error) {
  memcpy(result,"test this",9);
  *length=9;
}
I declare it like so:
CREATE FUNCTION simple RETURNS STRING SONAME 'simple.so';
The function works fine: SELECT simple(); But returns a blob result!
I can use CONVERT(simple() USING utf8), of course!

Is there any way to avoid the CONVERT?



Edited 1 time(s). Last edit at 03/28/2013 08:27AM by Charles Bradshaw.

Options: ReplyQuote


Subject
Views
Written By
Posted
UDF string functions return blob?
3631
March 28, 2013 08:26AM


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.