List:Internals« Previous MessageNext Message »
From:SGreen Date:January 23 2006 8:33pm
Subject:Re: problem with argument
View as plain text  
"Oliver Block" <oliver.block@stripped> wrote on 01/23/2006 02:03:05 PM:

> Hello,
> 
> I'd like to report the following problem with user defined functions:
> 
> When I implement char *xxx(...) (user defined function) and call
> 
> SELECT xxx('\b(\w+)\b');
> 
> args->args[0] does hold '^H(\w+)^H'. So there must have been 
> occurred some substitution!?
> Otherwise args->args[0] would hold '\b(\w+)\b', wouldn't it?
> 
> What exactly did happen? 
> Does the substitution depend on the character set of the database?
> Is there a predictable way for me to re-substitute, if this is no bug? 
> 
> Or to summarize my questions: How do I call
> 
> SELECT xxx('\b(\w+)\b');
> 
> and get that to
> 
> args->args[0]
> 
> ???
> 
> I appreciate your help.
> 
> bye,
> 
> Oliver Block
> 
> P.S. When I substitute \w with [a-zA-Z_0-9] mysql looses the connection.
> 

\b is the MySQL escape sequence for a backspace (0x08). One way to display 
a backspace is with character control-H (^H). To escape the \ you have to 
double-up \\. Try this instead:

SELECT xxx('\\b(\w+)\\b');

I have no clue why you lose the connection if you substitute \w with 
[a-zA-Z_0-9]. Just not enough information to work from.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine
Thread
problem with argumentOliver Block23 Jan
  • Re: problem with argumentSGreen23 Jan