Re: udf configuration resources

2006-07-20 Thread Eric Bergen

Your udf is executing in a threaded environment so you have the option
of creating a datastrucutre to store options in that will persist
across udf executions. However since you won't be deallocating this
structure ever it's essentially leaked memory.

What are you doing with udfs that you want to store configuration for?
I have a feeling udfs are not he right solution.

On 7/19/06, Yong Lee <[EMAIL PROTECTED]> wrote:

Hi all,



I hope I have hit the right group for this question.



I would like to create a UDF that is configurable at run time.  Similar to
how mysql can use variables defined in the /etc/my.cnf file, I'd like my UDF
to make use of configuration parameters that can be set at run time.



I'm wondering if this is possible and what strategy to take to implement
this, ie: a mechanism to have mysql or the UDF read something once and then
have the UDF able to refer back to it everytime it is run.



I know I could read a file in the _init function, but this seems very
wasteful to read a file every time the function is being used.



Any thoughts on this would be appreciated.



thanks,

Yong.






--
Eric Bergen
[EMAIL PROTECTED]
http://www.ebergen.net

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: udf configuration

2006-07-19 Thread Jimmy Guerrero
Hello,

If you have not already done so, you may also try the MySQL forum for UDFs
at:

http://forums.mysql.com/list.php?118 

Thanks,

Jimmy Guerrero
Sr Product Manager
MySQL, Inc

> -Original Message-
> From: Yong Lee [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 19, 2006 6:10 PM
> To: mysql@lists.mysql.com
> Subject: udf configuration
> 
> Hi all,
> 
>  
> 
> I hope I have hit the right group for this question.
> 
>  
> 
> I would like to create a UDF that is configurable at run 
> time.  Similar to how mysql can use variables defined in the 
> /etc/my.cnf file, I'd like my UDF to make use of 
> configuration parameters that can be set at run time.
> 
>  
> 
> I'm wondering if this is possible and what strategy to take 
> to implement this, ie: a mechanism to have mysql or the UDF 
> read something once and then have the UDF able to refer back 
> to it everytime it is run.
> 
>  
> 
> I know I could read a file in the _init function, but this 
> seems very wasteful to read a file every time the function is 
> being used.  
> 
>  
> 
> Any thoughts on this would be appreciated.
> 
>  
> 
> thanks,
> 
> Yong.
> 
>  
> 
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



udf configuration resources

2006-07-19 Thread Yong Lee
Hi all,

 

I hope I have hit the right group for this question.

 

I would like to create a UDF that is configurable at run time.  Similar to
how mysql can use variables defined in the /etc/my.cnf file, I'd like my UDF
to make use of configuration parameters that can be set at run time.

 

I'm wondering if this is possible and what strategy to take to implement
this, ie: a mechanism to have mysql or the UDF read something once and then
have the UDF able to refer back to it everytime it is run.

 

I know I could read a file in the _init function, but this seems very
wasteful to read a file every time the function is being used.  

 

Any thoughts on this would be appreciated.

 

thanks,

Yong.



udf configuration

2006-07-19 Thread Yong Lee
Hi all,

 

I hope I have hit the right group for this question.

 

I would like to create a UDF that is configurable at run time.  Similar to
how mysql can use variables defined in the /etc/my.cnf file, I'd like my UDF
to make use of configuration parameters that can be set at run time.

 

I'm wondering if this is possible and what strategy to take to implement
this, ie: a mechanism to have mysql or the UDF read something once and then
have the UDF able to refer back to it everytime it is run.

 

I know I could read a file in the _init function, but this seems very
wasteful to read a file every time the function is being used.  

 

Any thoughts on this would be appreciated.

 

thanks,

Yong.