Bug #52348 SELECT * from aTable WHERE Tel LIKE @Tel + '%' !!!!FAILS!!!!!
Submitted: 24 Mar 2010 23:01 Modified: 26 Oct 2011 17:39
Reporter: Ni Angel Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:5.5 OS:Windows (Vista Home )
Assigned to: Reggie Burnett CPU Architecture:Any
Tags: WHERE ... LIKE .... @variable+'%' fails

[24 Mar 2010 23:01] Ni Angel
Description:
Hi there
I am developing a sample of database client using Visual Basic and dataset with winforms following the sample of Beth Massi http://windowsclient.net/learn/video.aspx?v=30442 who uses MSSQL instead
But using MySQL is hard if not impossible to complete the task

I used the query builder to compose the query

"SELECT * FROM theTable WHERE Telephone LIKE @Telephone+'%s'"

The sample works well if I use the string eg: 33333%
By omitting the % at the end the query fails to work producing an error around '+'%'   !!!!    Strange ha?
I would value your opinion 
Thanx a million

How to repeat:
following the sample of Beth Massi http://windowsclient.net/learn/video.aspx?v=30442 who uses MSSQL instead
But using MySQL is hard if not impossible to complete the task

I used the query builder to compose the query

"SELECT * FROM theTable WHERE Telephone LIKE @Telephone+'%s'"

The sample works well if I use the string eg: 33333%
By omitting the % at the end the query fails to work producing an error around '+'%'   !!!!    Strange ha?
I would value your opinion 
Thanx a million
[6 Apr 2010 8:30] Tonci Grgin
Hi Ni and thanks for your report.

Can you please:
  o Clear the version of MySQL server and MySQL c/NET used. I presume 5.5 goes to server version.
  o Attach complete test case, along with DDL/DML statements, connection string etc demonstrating your problem.
[6 May 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[26 Oct 2011 17:39] Reggie Burnett
This is not a bug.  MySQL doesn't support concating strings with +.  If you change your SQL to be like this, it works:

SELECT * FROM aTable WHERE Tel LIKE CONCAT(@Tel, '%s')