niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » MySQL
udf configuration resources
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Yong Lee
*nix forums beginner


Joined: 08 Jun 2006
Posts: 5

PostPosted: Wed Jul 19, 2006 10:30 pm    Post subject: udf configuration resources Reply with quote

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.
Back to top
Eric Bergen
*nix forums addict


Joined: 10 Feb 2005
Posts: 73

PostPosted: Fri Jul 21, 2006 5:54 am    Post subject: Re: udf configuration resources Reply with quote

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 <ylee@eqo.com> wrote:
Quote:
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
eric.bergen@gmail.com
http://www.ebergen.net

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql@m.gmane.org
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 12:37 pm | All times are GMT
navigation Forum index » Databases » MySQL
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Sound Configuration problem on clean Sarge install Richard Cookson Debian 0 Fri Jul 21, 2006 2:30 pm
No new posts configuration question for httpd Karl Wang Apache 1 Fri Jul 21, 2006 2:10 pm
No new posts Configuration file shadowed? Manoj Srivastava devel 1 Fri Jul 21, 2006 2:00 am
No new posts Proposal: Allow dict_tcp server to disconnect without cau... Xin LI Postfix 6 Thu Jul 20, 2006 5:21 pm
No new posts udf configuration Yong Lee MySQL 1 Wed Jul 19, 2006 11:09 pm

Loans | Gas Suppliers | Mortgages | Unblock Myspace | Loans
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1011s ][ Queries: 16 (0.0292s) ][ GZIP on - Debug on ]