I cannot author a UDF using MySQL. I use the MySQL provided udf_example.cc
and compile it using the following command:
sudo gcc -shared -fPIC -I /usr/include/mysql -o
/usr/lib/mysql/plugin/udf_example.so udf_example.cc
Next, I login to mysql, connect to my database, and author one of the provi
Hi everybody,
it looks like the reason for the problem was me not handling string arguments
properly (I did not use the provided lengths, but relied on string being
null-terminated, it's in the doc, but ...). It seems this became a problem
specifically in the parallel situation, misleading me i
On Monday 05 November 2012 18:02:28 h...@tbbs.net wrote:
> 2012/11/04 22:23 +, Stefan Kuhn
>
> select * from table order by udf(column, 'input_value') desc;
> For my understanding, this should give the same result always.
>
> But if for your data function "udf" returns the sa
2012/11/04 22:23 +, Stefan Kuhn
select * from table order by udf(column, 'input_value') desc;
For my understanding, this should give the same result always.
But if for your data function "udf" returns the same for more arguments there
is not enough to fix the order. In that
can you reduce the UDF just to return 1; ?
that should give you a clue what is going on. Random
values usualy point to two suspects
1. mixing 32bit and 64bit
2. using void instead of int
re,
wh
Am 04.11.2012 23:23, schrieb Stefan Kuhn:
> Hi all,
> I have a weired (for me at least) problem with
C is not an inherently thread-safe language. Several of the standard
library functions use static data, which gets stepped on during concurrent
operation. Many of those do have thread-safe equivalents on many platforms
such as strtok/strtok_r (the latter being the safe one).
If you are confident
Hi Dan,
thanks for your answer. The UDF only contains functions (the one called in sql
plus two functions called in it). There are no variables outside them and
nothing is declared static. All variables inside the functions are declared
just like "double x=0;" etc. I am not an expert on C, but
In the last episode (Nov 04), Stefan Kuhn said:
> I have a weired (for me at least) problem with a user defined function,
> written in C. The function seems to return different results in different
> runs (the code of the function does not contain random elements).
> Basically, the function calcu
On Sunday 04 November 2012 22:34:22 Michael Dykman wrote:
> A couple of questions present.
>
> You mention that selecting from the whole table takes 5-10s so I assume you
> have a lot of records.
Yes, and the calculation of the score is fairly complicated. Plust the test
server is slow (Pentium II
A couple of questions present.
You mention that selecting from the whole table takes 5-10s so I assume you
have a lot of records.
is the data not in flux? are you sure?
these conflict queries are all on the same server?
i would have structured the query like so:
select *, udf(column,'value'
Martin Gainty wrote:
> this is pure speculation unless we can get ahold of the source code
> for your specific version of glibc and determine what the maximum
> sizes are .. otherwise anything I suggest would be speculative..lets
> take a look at
>
http://fossies.org/dox/glibc-2.16.0/sysdeps_2mach
ous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> From: p...@computer.org
> Subject: RE: UDF writing to unix socket - segfaults?
> Date: Wed, 8 Aug 2012 15:39:09 +0200
> To: mysql@lists.mysql.com
>
> Martin Gainty wrote:
>
> > assuming you worked out t
Martin Gainty wrote:
> assuming you worked out the access to network by your code permissions
When I open the unix socket, I give it 0777.
> that means memory heap or stack is being overrun...you would be well
> advised to download the connect() and sendto() code from the OS vendor
I'm running
assuming you worked out the access to network by your code permissions
that means memory heap or stack is being overrun...you would be well advised to
download the connect() and sendto() code from the OS vendor and toss in plenty
of codeguard and
debug statements and recompile and rebuild.
Mit
Thank you for your speedy reply.
I tried on your way. But it gives *error* as "*Dynamic SQL is not allowed in
stored function or trigger*". I'm using *MySql 5* as my sever. How can I
solve that.
thank you
On Mon, Mar 15, 2010 at 11:43 PM, Gavin Towey wrote:
> You'll have to do something like t
You'll have to do something like this:
SET @sql := CONCAT('select ',columnname,' into retval from user where ID=',id);
PREPARE mySt FROM @sql;
EXECUTE mySt;
-Original Message-
From: chamila gayan [mailto:cgcham...@gmail.com]
Sent: Monday, March 15, 2010 12:58 AM
To: mysql@lists.mysql.co
After some tinkering around on one of my test database servers with this
sequence table design; I see what you mean.
Defining the table with store_id and seq_id columns allows me to UPDATE
table SET seq_id=LAST_INSERT_ID(seq_id+1) WHERE store_id=N and will block
any further updates on store_id=N t
Others may correct me if I'm wrong, but if you want to maintain your own auto
increment without duplicates like that, then you need to serialize inserts to
your table. Which means either doing an explicit table lock by the process
that's inserting, or using innodb with transactions in the SERIA
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
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
> T
Just figured it out without a UDF(not documented anywhere that I found).
SELECT conv(hex(fdata),16,10) INTO fdata_bigint;
So a double conversion seems to work for me.
You solution looks like it will work, but since I was able to get it to
work without a UDF, I'm not going to test it out. Thanks.
"David Godsey" <[EMAIL PROTECTED]> wrote on 03/22/2006 01:21:07 PM:
> I'm in the process of writing my first UDF and would appreciate some
help.
>
> I am pulling data from a table like:
>
> SELECT payload_time,
> SUBSTR(BINARY(frame_data),
> FLOOR(foffset/8)+1,
>
> Hi Dan,
>
> Dan Bolser wrote:
Who can I prod about setting up a UDF repo at MySQL. I think 'they'
should
do this ;)
>>> Yep it's an existing idea, a very good one, and it's on the todo.
>>> Putting such an infrastructure into place will take some time though.
>>
>> I can imagine it
Hi Dan,
Dan Bolser wrote:
Who can I prod about setting up a UDF repo at MySQL. I think 'they' should
do this ;)
Yep it's an existing idea, a very good one, and it's on the todo.
Putting such an infrastructure into place will take some time though.
I can imagine it isn't trivial to set up.
W
Hello.
> My doubt is: Is it the only way to have UDF server-side in >MySQL(4.1.x)?
> Do I need to learn C/C++ to have a UDF?
In my opinion - yes, because UFDs usually uses includes (say, mysql.h)
which are written in C/C++. Speaking in general - UDF for MySQL is just
a shared library, so p
Looks like you're confusing Prepared Statements with Functions/Stored
Procedures. You don't compile a function, and you're using 4.1, you
need Mysql 5. (specifically 5.0.3 I think, you'd have to look that
up, but you would want 5.0.7 anyway. Maybe I have that confused with
triggers, cant remember
Hello.
>When attempting to load a new function with the mysql cli client the
>client
>complains that the server has gone away and reconnects with connection
Check MySQL error log, server could die while loading the UDF.
Stored procedures appeared only in 5 version. This works fine for me
Dan Bolser <[EMAIL PROTECTED]> wrote on 04/08/2005 06:45:42 PM:
> On Fri, 8 Apr 2005 [EMAIL PROTECTED] wrote:
>
> >Dan Bolser <[EMAIL PROTECTED]> wrote on 04/08/2005 12:41:35 PM:
> >
> >> On Thu, 7 Apr 2005, Sean Nolan wrote:
> >>
> >> >I think you'll find you can do what you want with a cross j
On Mon, 11 Apr 2005, Arjen Lentz wrote:
>Hi Dan,
>
>On Sat, 2005-04-09 at 02:59, Dan Bolser wrote:
>> Who can I prod about setting up a UDF repo at MySQL. I think 'they' should
>> do this ;)
>
>Yep it's an existing idea, a very good one, and it's on the todo.
>Putting such an infrastructure into p
Hi Dan,
On Sat, 2005-04-09 at 02:59, Dan Bolser wrote:
> Who can I prod about setting up a UDF repo at MySQL. I think 'they' should
> do this ;)
Yep it's an existing idea, a very good one, and it's on the todo.
Putting such an infrastructure into place will take some time though.
Would a special
On Fri, 8 Apr 2005 [EMAIL PROTECTED] wrote:
>Dan Bolser <[EMAIL PROTECTED]> wrote on 04/08/2005 12:41:35 PM:
>
>> On Thu, 7 Apr 2005, Sean Nolan wrote:
>>
>> >I think you'll find you can do what you want with a cross join. A cross
>join
>> >will join every row from the first table with every ro
Dan Bolser <[EMAIL PROTECTED]> wrote on 04/08/2005 12:41:35 PM:
> On Thu, 7 Apr 2005, Sean Nolan wrote:
>
> >I think you'll find you can do what you want with a cross join. A cross
join
> >will join every row from the first table with every row from the second
> >table. It will not randomly d
On Thu, 7 Apr 2005, Sean Nolan wrote:
>I think you'll find you can do what you want with a cross join. A cross join
>will join every row from the first table with every row from the second
>table. It will not randomly do this, so you'd have to be creative in
>"randomly" selecting rows in the WH
I think you'll find you can do what you want with a cross join. A cross join
will join every row from the first table with every row from the second
table. It will not randomly do this, so you'd have to be creative in
"randomly" selecting rows in the WHERE clause. Here's how you could do this
w
I think you'll find you can do what you want with a cross join. A cross join
will join every row from the first table with every row from the second
table. It will not randomly do this, so you'd have to be creative in
"randomly" selecting rows in the WHERE clause. Here's how you could do this
w
The problem was solved: it was up to static variable features, not MySQL
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Well that was easy.
After reading your response I went back and used
gcc -fPIC -c xxx.cc
gcc -shared -o xxx.so xxx.o
and all was well again.
Thanks for your help..again.
Ollie
Dan Nelson said:
> In the last episode (Dec 11), Ollie Gallardo said:
>> I'm back with another question. I tried to comp
In the last episode (Dec 11), Ollie Gallardo said:
> I'm back with another question. I tried to compile my UDF with the gcc on
> my Opteron system and I got errors.
> Errors:
> /usr/lib64/gcc-lib/amd64-mandrake-linux-gnu/3.3.1/../../../../lib64/crt1.o(.text+0x21):
> In function `_start':
> ../sysd
I'm back with another question. I tried to compile my UDF with the gcc on
my Opteron system and I got errors.
Errors:
/usr/lib64/gcc-lib/amd64-mandrake-linux-gnu/3.3.1/../../../../lib64/crt1.o(.text+0x21):
In function `_start':
../sysdeps/x86_64/elf/start.S:92: undefined reference to `main'
/root/
Thanks Dan. I will get to it then.
Dan Nelson said:
> In the last episode (Dec 11), Ollie Gallardo said:
>> I just recently built myself a dual Opteron system and installed mysql
>> for AMD64 on it. I previously ran my databases on regular 32 bit
>> systems and had my UDF working fine. The UDF is w
In the last episode (Dec 11), Ollie Gallardo said:
> I just recently built myself a dual Opteron system and installed
> mysql for AMD64 on it. I previously ran my databases on regular 32
> bit systems and had my UDF working fine. The UDF is written in C.
> Before I try and install the UDF on the ne
Jeremy Zawodny wrote:
On Tue, Aug 12, 2003 at 02:32:00PM +0800, Ariz Jacinto wrote:
i've created a simple UDF (for testing) that returns a string.
my problem is that the string that it returns, contain some
of the characters of the longest string in the column.
example:
Table
+
Hello,
>
> extern "C" __declspec(dllexport) char *echo(UDF_INIT *initid, UDF_ARGS *args, char
> *is_null, char *error)
> {
> return args->args[0];
> }
>
args->args[0] is not null terminated. This is how I've been handling
this. please let me know if there is a better approach (i.e. whether
On Tue, Aug 12, 2003 at 02:32:00PM +0800, Ariz Jacinto wrote:
> i've created a simple UDF (for testing) that returns a string.
> my problem is that the string that it returns, contain some
> of the characters of the longest string in the column.
>
> example:
>
> Table
> +-+
> |
Hi,
If you use another library for linking with your code and the library is not
in the right place(after compiling)...this error occur.
Regards,
Gelu
_
G.NET SOFTWARE COMPANY
Permanent e-mail address : [EMAIL PROTECTED]
On Monday, 15. July 2002 15:28, Daniel BI wrote:
> Hola listeros :)
Hola!
please write in english, or use the spanish mailing list
([EMAIL PROTECTED])
Thx
Georg
-
Before posting, please check:
http://www.mysql.com/manual.
Miles Roper
Subject: RE: UDF, Can anyone please help?
Hi Miles,
Then I think that the easiest way is to create a
temporary table from this query:
Create Temporary Table TempTable Select Max(IDField)
>From TheTable Group by Field1;
Then your inner join the temporary table with yours:
Select t
son [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 9 July 2002 05:37
To: 'Miles Roper'; '[EMAIL PROTECTED]'
Subject: RE: UDF, Can anyone please help?
So if below is actually what your data looks like, what about:
Select Field1, Field2, MAX(IDField) From MyTable Group by Field1
Tha
So if below is actually what your data looks like, what about:
Select Field1, Field2, MAX(IDField) From MyTable Group by Field1
That might get the correct answer for you, but it does however have an extra
field in the result (which may or may not be a problem).
cheers,
noel
filter word:mysql
x27;[EMAIL PROTECTED]'
Subject: Re: UDF, Can anyone please help?
Hi Miles,
Could you explain the same thing with a some sample
data? I does not need to be your data. I think that
what you want to do is this but I am not sure.
Field1 Field2
A 1
A 1
A 2
A 3
B 1
B 1
B
Hi Miles,
Could you explain the same thing with a some sample
data? I does not need to be your data. I think that
what you want to do is this but I am not sure.
Field1 Field2
A 1
A 1
A 2
A 3
B 1
B 1
B 2
C 2
C 2
C 4
C 4
When you say last do
I know version 4.0.1 does.
I use Delphi 6 to write my UDF's for it.
mike
-Original Message-
From: Inandjo Taurel [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 23, 2002 9:20 PM
To: [EMAIL PROTECTED]
Subject: UDF on win2k??
hi,
i checked the manual, but i want a confirmation here: Mys
What platform are you running on? Must... Have... Details...
database
> -Original Message-
> From: Pavel Popov [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 20, 2001 6:57 AM
> To: [EMAIL PROTECTED]
> Subject: UDF
>
>
> Hi, All.
>
> I have tried to add UDF, but has received a
Honza Pazdziora writes:
> On Fri, Apr 06, 2001 at 04:52:21PM +0300, Sinisa Milivojevic wrote:
> >
> > To solve the above you have also to malloc a pointer in _init function
> > and free it in _end function.
>
> Great, works like a charm. Just to make sure: is it OK to use
> my_malloc to a
On Fri, Apr 06, 2001 at 04:52:21PM +0300, Sinisa Milivojevic wrote:
>
> To solve the above you have also to malloc a pointer in _init function
> and free it in _end function.
Great, works like a charm. Just to make sure: is it OK to use
my_malloc to allocate and free to free, or should I use som
[EMAIL PROTECTED] writes:
> >Description:
>
> UDF working with strings longer than (I believe) 255 bytes kills
> the server. Even if the initid->max_length is set to the length of
> the string that will be returned, as the manual suggests.
>
> Please not that in this case, no additional m
Aaron Weiss writes:
> Hi,
>
> I wanted to create a UDF for MySQL that can use the ASpell engine to
> generate a string of spelling suggestions, given a single word
> parameter. Thus, select aspell('wrd') should return Aspell's suggested
> spellings.
>
> I don't know C very well at all, s
Thomas Kaester writes:
> Hello Sinisa and everybody who can help me!
>
> I try to develop a UDF which returns a string! But I get only 256 characters of the
>string! I tried to change my alloc function, so that I only use my_malloc and
>my_free! But the result is the same! The necessary me
Thomas Kaester(global) writes:
> Hello everybody,
>
> I have a big UDF problem and I hope that anybody can help me!
>
> In details:
>
> I have developed an UDF which returns a string which is longer than 256
> characters! But the function only returns the first 256 characters and
> not
59 matches
Mail list logo