Native Function
am 18.05.2009 15:33:15 von Alex Katebi
--0016363b85b039a8ef046a2fd6c1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
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
--0016363b85b039a8ef046a2fd6c1--
Re: Native Function
am 18.05.2009 17:55:18 von Alex Katebi
--0016363b85b02dc701046a31d226
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
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 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 =E9s Bizalmass=E1gi kinyilatkoztat=E1s/Verzicht und
> Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit=E9
>
> Ez az üzenet bizalmas. Ha nem ön az akinek sz=E1nva volt, akkor k=E9=
rjük, hogy
> jelentse azt nekünk vissza. Semmif=E9le tov=E1bb=EDt=E1sa vagy m=E1sola=
t=E1nak k=E9sz=EDt=E9se
> nem megengedett. Ez az üzenet csak ismeret cser=E9t szolg=E1l =E9s sem=
mif=E9le jogi
> alkalmazhat=F3s=E1ga sincs. Mivel az electronikus üzenetek könnyen
> megv=E1ltoztathat=F3ak, ez=E9rt minket semmi felelös=E9g 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 unbefugt=
e
> 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 =EAtre privil=E9gi=E9. Si vous n'=EAt=
es pas le destinataire pr=E9vu, 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, =
nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni.
>
>
>
>
>
>
> > Date: Mon, 18 May 2009 09:33:15 -0400
> > Subject: Native Function
> > From: alex.katebi@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 applicati=
on
> > 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 out=
..
utorial_WhatsNew1_052009>
>
--0016363b85b02dc701046a31d226--
RE: Native Function
am 18.05.2009 18:10:52 von Martin Gainty
--_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@gmail.com
> To: mgainty@hotmail.com
> CC: mysql@lists.mysql.com
>=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
m> 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 üzenet bizalmas. Ha nem ön az akinek sz=E1nva volt=2C akkor =
k=E9rjük=2C hogy
> > jelentse azt nekünk vissza. Semmif=E9le tov=E1bb=EDt=E1sa vagy m=E1so=
lat=E1nak k=E9sz=EDt=E9se
> > nem megengedett. Ez az üzenet csak ismeret cser=E9t szolg=E1l =E9s s=
emmif=E9le jogi
> > alkalmazhat=F3s=E1ga sincs. Mivel az electronikus üzenetek könnyen
> > megv=E1ltoztathat=F3ak=2C ez=E9rt minket semmi felelös=E9g nem terhel=
het ezen üzenet
> > 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@gmail.com
> > > To: mysql@lists.mysql.com
> >
> > >
> > > 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.
_Tutorial_WhatsNew1_052009>
> >
____________________________________________________________ _____
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_--