List:Bugs« Previous MessageNext Message »
From:Thimble Smith Date:April 7 2000 9:47pm
Subject:Re: Bug with concatenated "trim" and "concat"?
View as plain text  
Hi, Ernesto.  I don't see anything wrong with what you're doing.

This e-mail would be a good candidate for the bugs@stripped
list (it should have used 'mysqlbug', but we'll let it slide).

If this is indeed a bug, we will fix it as soon as possible and
as long as it doesn't involve an extensive change in 3.22, a fix
will be made for that branch as well as 3.23.

Tim

On Fri, Apr 07, 2000 at 08:31:29PM +0200, Ernesto Baschny wrote:
>Hi!
>
>I need a query that uses some string functions, but it doesn't seem
>to work, and I guess it is a bug. Its a rather complex query, but I
>managed to single out the piece of code that is causing the trouble.
>Here's how you can try it on your own:
>
>mysql> create table test ( domain char(50) );
>mysql> insert into test VALUES ("hello.de" );
>mysql> insert into test VALUES ("test.de" );
>
>The first query, works as intended:
>
>mysql> select domain from test
>    ->  where concat('@', trim(leading '.' from concat('.', domain))) =
>    ->  '@hello.de';
>+----------+
>| domain   |
>+----------+
>| hello.de |
>+----------+
>1 row in set (0.00 sec)
>
>
>Now here comes a second, almost identical query, but querying for 
>another row:
>
>mysql> select domain from test
>    ->  where concat('@', trim(leading '.' from concat('.', domain)))
>    ->  = '@test.de';
>Empty set (0.00 sec)
>
>WOW! Empty! What now? I can add as much rows as I want to this table,
>but with this query I just can get a positive result for the FIRST
>row.
>
>Very strange, and just simple changes to the query make it work
>again. Removing the '@':
>
>mysql> select domain from test
>    ->  where concat('', trim(leading '.' from concat('.', domain)))
>    ->  = 'test.de';
>+---------+
>| domain  |
>+---------+
>| test.de |
>+---------+
>1 row in set (0.00 sec)
>
>Or the "." from the second concat:
>
>mysql> select domain from test
>    ->  where concat('@', trim(leading '.' from concat('', domain)))
>    ->  = '@test.de';
>+---------+
>| domain  |
>+---------+
>| test.de |
>+---------+
>1 row in set (0.00 sec)
>
>
>Fact is that I *need* this strange concatenation of strings, this is
>just a PART of a bigger query.
>
>I just tested this on two different mySQLs:
>
> Server version          3.23.13a-alpha
> Protocol version        10
>
>(which seems to be the latest alpha) and:
>
> Server version          3.22.30
> Protocol version        10
>
>Both have the same problem, so I guess noone has noticed it yet.
>
>Am I doing something wrong? If not, can I expect some correction
>of this "bug" on the 3.22-series?
>
>Thanks!!
>
>
>--
>Ernesto Baschny <eb@stripped> | PEM Intercomputing GmbH
> Stuttgart - Germany          | www.pemic.de
> PGP: www.baschny.de/pgp.txt  | - SCO Premier Solution Partner
> Private: ernst@stripped    | - Xlink Premium PoP
>
>-- 
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail mysql-thread33573@stripped
>
>To unsubscribe, send a message to:
>    <mysql-unsubscribe-tim=mysql.com@stripped>
>

-- 
Tim Smith   < tim@stripped >  :MySQL Development Team:  Boone, NC  USA.
Thread
Re: Bug with concatenated "trim" and "concat"?Thimble Smith8 Apr
  • Re: Bug with concatenated "trim" and "concat"?Michael Widenius8 Apr