RE: UDF Not Compiling

2014-07-29 Thread Shahram Ghandeharizadeh
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

Re: UDF behaves non-deterministic

2012-11-07 Thread Stefan Kuhn
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

Re: UDF behaves non-deterministic

2012-11-05 Thread Stefan Kuhn
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

Re: UDF behaves non-deterministic

2012-11-05 Thread hsv
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

Re: UDF behaves non-deterministic

2012-11-05 Thread walter harms
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

Re: Re: UDF behaves non-deterministic

2012-11-05 Thread Michael Dykman
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

Aw: Re: UDF behaves non-deterministic

2012-11-05 Thread Stefan Kuhn
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

Re: UDF behaves non-deterministic

2012-11-04 Thread Dan Nelson
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

Re: UDF behaves non-deterministic

2012-11-04 Thread Stefan Kuhn
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

Re: UDF behaves non-deterministic

2012-11-04 Thread Michael Dykman
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'

RE: UDF writing to unix socket - segfaults?

2012-08-08 Thread Per Jessen
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

RE: UDF writing to unix socket - segfaults?

2012-08-08 Thread Martin Gainty
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

RE: UDF writing to unix socket - segfaults?

2012-08-08 Thread Per Jessen
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

RE: UDF writing to unix socket - segfaults?

2012-08-08 Thread Martin Gainty
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

Re: udf return column name not value

2010-03-15 Thread chamila gayan
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

RE: udf return column name not value

2010-03-15 Thread Gavin Towey
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

Re: UDF - Sequence Numbers

2010-03-09 Thread Johnny Withers
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

RE: UDF - Sequence Numbers

2010-03-08 Thread Gavin Towey
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

Re: udf configuration resources

2006-07-20 Thread Eric Bergen
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

RE: udf configuration

2006-07-19 Thread Jimmy Guerrero
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

Re: UDF help, convert BLOB to BIGINT

2006-03-22 Thread David Godsey
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.

Re: UDF help, convert BLOB to BIGINT

2006-03-22 Thread SGreen
"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, >

Re: UDF Request "AGGLOM()"

2005-12-05 Thread dmb
> 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

Re: UDF Request "AGGLOM()"

2005-12-05 Thread Arjen Lentz
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

Re: UDF

2005-11-22 Thread Gleb Paharenko
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

Re: UDF failure

2005-07-06 Thread Greg Fischer
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

Re: UDF failure

2005-07-06 Thread Gleb Paharenko
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

RE: UDF request?

2005-04-11 Thread SGreen
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

Re: UDF Request "AGGLOM()"

2005-04-11 Thread Dan Bolser
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

Re: UDF Request "AGGLOM()"

2005-04-10 Thread Arjen Lentz
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

RE: UDF request?

2005-04-08 Thread Dan Bolser
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

RE: UDF request?

2005-04-08 Thread SGreen
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

RE: UDF request?

2005-04-08 Thread Dan Bolser
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

RE: UDF request?

2005-04-07 Thread Sean Nolan
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

RE: UDF request?

2005-04-07 Thread Sean Nolan
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

Re: UDF SELECT query spoils the results

2004-01-20 Thread Alexander
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]

Re: UDF on AMD64

2003-12-12 Thread Ollie Gallardo
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

Re: UDF on AMD64

2003-12-11 Thread Dan Nelson
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

Re: UDF on AMD64

2003-12-11 Thread Ollie Gallardo
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/

Re: UDF on AMD64

2003-12-11 Thread Ollie Gallardo
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

Re: UDF on AMD64

2003-12-11 Thread Dan Nelson
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

Re: UDF Programming Problem

2003-08-14 Thread Ariz Jacinto
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 +

Re: UDF Programming Problem

2003-08-14 Thread Murad Nayal
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

Re: UDF Programming Problem

2003-08-14 Thread Jeremy Zawodny
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 > +-+ > |

Re: UDF in c++ problem

2002-09-06 Thread Gelu Gogancea
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]

Re: UDF: Funcion definida por el usuario

2002-07-15 Thread Georg Richter
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.

RE: UDF, Can anyone please help?

2002-07-09 Thread Miles Roper
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

RE: UDF, Can anyone please help?

2002-07-09 Thread Miles Roper
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

RE: UDF, Can anyone please help?

2002-07-08 Thread noel . clarkson
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

RE: UDF, Can anyone please help?

2002-07-08 Thread Miles Roper
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

Re: UDF, Can anyone please help?

2002-07-08 Thread Francisco Reinaldo
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

RE: UDF on win2k??

2002-06-24 Thread Mike Grover
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

RE: UDF

2001-09-20 Thread Will French
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

Re: UDF kills mysqld with longer strings

2001-04-06 Thread Sinisa Milivojevic
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

Re: UDF kills mysqld with longer strings

2001-04-06 Thread Honza Pazdziora
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

Re: UDF kills mysqld with longer strings

2001-04-06 Thread Sinisa Milivojevic
[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

Re: UDF Causing mysqld to crash/restart

2001-03-10 Thread Sinisa Milivojevic
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

Re: UDF - string problem

2001-02-13 Thread Sinisa Milivojevic
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

Re: UDF Problem

2001-02-12 Thread Sinisa Milivojevic
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