udf return column name not value

2010-03-15 Thread chamila gayan
CREATE FUNCTION getcolumnvalue(id int,columnname varchar(30)) RETURNS varchar(50) DETERMINISTIC READS SQL DATA begin declare retval varchar(50); select columnname into retval from user where ID = id ; return retval; end; I want get value of related column but it return column name. ex:- ('tom' wha

Very slow subselect (parser bug)?

2010-03-15 Thread Pascal Gienger
We're testing a bedework system here with an underlying MySQL Database: Version 5.1.44, Linux x64 (64bit), icc binary from www.mysql.com. This statement uses 1 minute of 100% CPU: select summaries0_.bw_eventid as bw1_1_, summaries0_.bw_strid as bw2_1_, bwstring1_.bw_id as bw1_70_0_, bwstring1_.

Re: Very slow subselect (parser bug)?

2010-03-15 Thread Johan De Meersman
On Mon, Mar 15, 2010 at 4:22 PM, Pascal Gienger < pascal.gien...@uni-konstanz.de> wrote: > Using this result to reconstruct the first left outer join from the initial > statement, I get this result: > Not so much a bug as a missing feature: the parser is currently unable to recognize any subselec

Re: Variable for row number?

2010-03-15 Thread Pavel Gulchouck
On Sun, Mar 14, 2010 at 06:25:31PM -0400, Shawn Green writes: SG> I know it's bad form to reply to yourself but I spotted something I SG> could clarify Thank you very much, it works good enough in this case! SG> Shawn Green wrote: >> ... >> >> One way to do this is to materialize the results of

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

dash was converted o a wierd character

2010-03-15 Thread Néstor
I have an sql file that I dump(mysqldump) and then I installed on a new system and some how the dashes on the file were changed to some wierd character. When I look at the sql file in my windows machine using PUTTY I get stuff like "1.01.A â the second" When I look at the same file from my linux

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

Innodb buffer pool usage

2010-03-15 Thread Machiel Richards
Hi all Maybe someone can assist me with this one. A while back I requested some information relating to the MySQL innodb buffer pool size that seems to fill up rather frequently. The buffer pool is currently set to 3Gb , and it takes about 2-