← Back to team overview

maria-discuss team mailing list archive

Re: GSOC 2015 :UDFs returning arrays

 

Hi!

On 10.03.15 21:41, Justin Swanhart wrote:
No,

You SAY the UDF can support them, but you neglect to point to a technical way how.

If you want to return a row as an array, well, how do you add an item to a row outside of the UDF, remove one? How do you count the items in the row? How do you get an item by index? If you want to use internal Item_result, well, how do you access item functions without a THD? You can't get a THD in a UDF, except an opaque pointer to one, unless you pull in half the server and it isn't really "legal" to do so. How do you pass an array to a stored routine, how does the routine modify it, can routines return arrays or just UDF? Row as an array is a ludicrous hack. You can't even pass row to other functions.

If you want a new UDF interface that can do those things, use a pluggable item function which I linked to the patch to. You absolutely can't change an unversioned binary interface like the existing UDF without risking server crash.

So, if you want ARRAY to be returned by a UDF, you have to start with a new UDF interface. Again, pluggable item func are the right way to do it.


It looks like you misunderstand me.

I do not want something with UDF at all, I just mentioned that internally there is something array-like and somebody who will do the task can be aware of it.

P.S.: But now I see that UDF interface should be changed due to problems you mentioned.


Follow ups

References