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 
your C/C++ function is calling the mysql functions
mysql_library_init()
Should be called before any other MySQL function is called, 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 
functions with libmysqld.a
    
(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 external 
methods but we should wait until after the merger for that
implementation
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 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 être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Mon, 18 May 2009 11:55:18 -0400
> Subject: Re: Native Function
> From: alex.kat...@gmail.com
> To: mgai...@hotmail.com
> CC: mysql@lists.mysql.com
> 
> Hello Martin,
> 
>    This sounds great! I am not sure if plugins are supported for the
> embedded mysql applications. Meaning that my application is linked with the
> libmysqld not libmysql. Do you know the answer?
> 
> Thanks,
> Alex
> 
> 
> 
> On Mon, May 18, 2009 at 10:17 AM, Martin Gainty <mgai...@hotmail.com> wrote:
> 
> >  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 the
> > plugin
> > http://dev.mysql.com/doc/refman/5.1-maria/en/install-plugin.html
> >
> > Martin Gainty
> > ______________________________________________
> > Jogi és Bizalmassági kinyilatkoztatás/Verzicht und
> > Vertraulichkeitanmerkung/Note de déni et de confidentialité
> >
> > Ez az üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
> > jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése
> > nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi
> > alkalmazhatósága sincs.  Mivel az electronikus üzenetek könnyen
> > megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet
> > tartalma miatt.
> >
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> > 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 être privilégié. Si vous n'êtes pas le 
> > destinataire prévu, nous te demandons avec bonté que pour satisfaire 
> > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie 
> > de ceci est interdite. Ce message sert à l'information seulement et n'aura 
> > pas n'importe quel effet légalement obligatoire. Étant donné que les email 
> > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> > aucune responsabilité pour le contenu fourni.
> >
> >
> >
> >
> >
> >
> > > Date: Mon, 18 May 2009 09:33:15 -0400
> > > Subject: Native Function
> > > From: alex.kat...@gmail.com
> > > To: mysql@lists.mysql.com
> >
> > >
> > > Hi All,
> > >
> > > I am using the mysql embedded library (libmysqld) in my application. I
> > > am using triggers and calling a C/C++ function in my application. This is
> > > how I convey configuration changes to my application.
> > > I think my only choice is to make a Native Function in the mysql source
> > code
> > > since UDF is not avialable in libmysqld. It would be nice if there were a
> > > generic function for this purpose that would take two string arguments
> > and
> > > return an integer. This way I can use it for anywhere I need to tie in
> > > triggers to my application.
> > >
> > > Is there an easier way to accomplish this. I mean invoking an application
> > > C/C++ function from mysql stored procedures?
> > >
> > > Thanks in andvance!
> > > Alex
> >
> > ------------------------------
> > Hotmail® has a new way to see what's up with your friends. Check it 
> > out.<http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009>
> >

_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009

Reply via email to