From: Martin Gainty Date: May 18 2009 4:10pm Subject: RE: Native Function List-Archive: http://lists.mysql.com/mysql/217591 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_628ac2dd-e429-4659-b3b9-efcf916848d8_" --_628ac2dd-e429-4659-b3b9-efcf916848d8_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable good morning alex the libmysqld is a embedded server library http://dev.mysql.com/doc/refman/5.0/en/libmysqld.html instead of mysql calling your C/C++ function=20 your C/C++ function is calling the mysql functions mysql_library_init() Should be called before any other MySQL function is called=2C preferably early in the main() function. mysql_library_end() Should be called before your program exits. mysql_thread_init() Should be called in each thread you create that accesses MySQL. mysql_thread_end() Should be called before calling pthread_exit() the answer is that you are linking to the server code and calling server fu= nctions with libmysqld.a =20 (instead of linking in client code from libmysqlclient.a) HTH Martin Gainty there is also a way to accomplish this with an Oracle Function calling exte= rnal methods but we should wait until after the merger for that implementation ______________________________________________=20 Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit= =E9 =20 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaeng= er sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiter= leitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient l= ediglich dem Austausch von Informationen und entfaltet keine rechtliche Bin= dungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen w= ir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=EAtes= pas le destinataire pr=E9vu=2C nous te demandons avec bont=E9 que pour sat= isfaire informez l'exp=E9diteur. N'importe quelle diffusion non autoris=E9e= ou la copie de ceci est interdite. Ce message sert =E0 l'information seule= ment et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9tant d= onn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipulation= =2C nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni= . > Date: Mon=2C 18 May 2009 11:55:18 -0400 > Subject: Re: Native Function > From: alex.katebi@stripped > To: mgainty@stripped > CC: mysql@stripped >=20 > Hello Martin=2C >=20 > This sounds great! I am not sure if plugins are supported for the > embedded mysql applications. Meaning that my application is linked with t= he > libmysqld not libmysql. Do you know the answer? >=20 > Thanks=2C > Alex >=20 >=20 >=20 > On Mon=2C May 18=2C 2009 at 10:17 AM=2C Martin Gainty wrote: >=20 > > yes if the library is a plugin > > create the plugin > > http://dev.mysql.com/doc/refman/5.1/en/plugin-api.html > > also make sure the table mysql.plugin is created > > > > compile and run mysqld dynamically is a pre-requisite > > http://dev.mysql.com/doc/refman/5.1/en/plugin-writing.html > > > > once the dynamic lib is created follow these instructions to install th= e > > plugin > > http://dev.mysql.com/doc/refman/5.1-maria/en/install-plugin.html > > > > Martin Gainty > > ______________________________________________ > > Jogi =E9s Bizalmass=E1gi kinyilatkoztat=E1s/Verzicht und > > Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit=E9 > > > > Ez az =FCzenet bizalmas. Ha nem =F6n az akinek sz=E1nva volt=2C akkor = k=E9rj=FCk=2C hogy > > jelentse azt nek=FCnk vissza. Semmif=E9le tov=E1bb=EDt=E1sa vagy m=E1so= lat=E1nak k=E9sz=EDt=E9se > > nem megengedett. Ez az =FCzenet csak ismeret cser=E9t szolg=E1l =E9s s= emmif=E9le jogi > > alkalmazhat=F3s=E1ga sincs. Mivel az electronikus =FCzenetek k=F6nnyen > > megv=E1ltoztathat=F3ak=2C ez=E9rt minket semmi felel=F6s=E9g nem terhel= het ezen =FCzenet > > tartalma miatt. > > > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene > > Empfaenger sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbe= fugte > > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachric= ht > > dient lediglich dem Austausch von Informationen und entfaltet keine > > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von > > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > > > > Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'= =EAtes pas le destinataire pr=E9vu=2C nous te demandons avec bont=E9 que po= ur satisfaire informez l'exp=E9diteur. N'importe quelle diffusion non autor= is=E9e ou la copie de ceci est interdite. Ce message sert =E0 l'information= seulement et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9= tant donn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipula= tion=2C nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fo= urni. > > > > > > > > > > > > > > > Date: Mon=2C 18 May 2009 09:33:15 -0400 > > > Subject: Native Function > > > From: alex.katebi@stripped > > > To: mysql@stripped > > > > > > > > Hi All=2C > > > > > > I am using the mysql embedded library (libmysqld) in my application. = I > > > am using triggers and calling a C/C++ function in my application. Thi= s is > > > how I convey configuration changes to my application. > > > I think my only choice is to make a Native Function in the mysql sour= ce > > code > > > since UDF is not avialable in libmysqld. It would be nice if there we= re a > > > generic function for this purpose that would take two string argument= s > > and > > > return an integer. This way I can use it for anywhere I need to tie i= n > > > triggers to my application. > > > > > > Is there an easier way to accomplish this. I mean invoking an applica= tion > > > C/C++ function from mysql stored procedures? > > > > > > Thanks in andvance! > > > Alex > > > > ------------------------------ > > Hotmail=AE has a new way to see what's up with your friends. Check it o= ut. > > _________________________________________________________________ Hotmail=AE has a new way to see what's up with your friends. http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=3DTXT_TAGLM_WL_HM_Tut= orial_WhatsNew1_052009= --_628ac2dd-e429-4659-b3b9-efcf916848d8_--