Bug #18117 not return matches when query contains like and _ (e.g. name like 'ab_ef')
Submitted: 9 Mar 2006 22:06 Modified: 28 May 2013 10:56
Reporter: Elim Qiu Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.01-02 OS:Windows (win2k)
Assigned to: CPU Architecture:Any

[9 Mar 2006 22:06] Elim Qiu
Description:
When query table with like and matching string containing '_' it returns no existing matches.

Below is the same app talking to SQLServerODBC and MyODBC. They has different behaviors:

ODBC Test for MS SQL Server
Mar 09 14:19:12 DbDemoReporter[2968] the qualifier is (title caseInsensitiveLike '2003_*')
Mar 09 14:19:27 DbDemoReporter[2968]  *** [<ODBCChannel: 0xff3f80> evaluateExpression: <ODBCSQLExpression: "SELECT  t0."descript", t0."oid", t0."status", t0."title" FROM "Questionary" t0  WHERE {fn UCASE(t0."title")} like {fn UCASE(?)}" withBindings:(1:2003[_]%(title))>]
Mar 09 14:19:27 DbDemoReporter[2968]  === Begin Internal Transaction
Mar 09 14:19:27 DbDemoReporter[2968]  *** <ODBCChannel: 0xff3f80> 1 rows processed
Mar 09 14:19:27 DbDemoReporter[2968]  === Commit Internal Transaction
Mar 09 14:19:46 DbDemoReporter[2968] the qualifier is (title like '2003_Test')
Mar 09 14:19:48 DbDemoReporter[2968]  *** [<ODBCChannel: 0xff3f80> evaluateExpression: <ODBCSQLExpression: "SELECT  t0."descript", t0."oid", t0."status", t0."title" FROM "Questionary" t0  WHERE t0."title" like ?" withBindings:(1:2003[_]Test(title))>]
Mar 09 14:19:48 DbDemoReporter[2968]  === Begin Internal Transaction
Mar 09 14:19:48 DbDemoReporter[2968]  *** <ODBCChannel: 0xff3f80> 1 rows processed
Mar 09 14:19:48 DbDemoReporter[2968]  === Commit Internal Transaction

ODBC Test for MySQL 5.0.18  (MyODBC 3.51.01-02)
Mar 09 14:24:39 DbDemoReporter[2968] the qualifier is (name caseInsensitiveLike 'CCCJR_*')
Mar 09 14:24:46 DbDemoReporter[2968]  *** [<ODBCChannel: 0x4a07f08> evaluateExpression: <ODBCSQLExpression: "SELECT  t0.`end_date`, t0.`name`, t0.`affair_id`, t0.`owner_id`, t0.`parent_id`, t0.`type_id`, t0.`owner_class`, t0.`path`, t0.`property_dict`, t0.`start_date`, t0.`status_code` FROM `affair` t0  WHERE {fn UCASE(t0.`name`)} like {fn UCASE(?)}" withBindings:(1:CCCJR[_]%(name))>]
Mar 09 14:24:46 DbDemoReporter[2968]  === Begin Internal Transaction
Mar 09 14:24:46 DbDemoReporter[2968]  *** <ODBCChannel: 0x4a07f08> 0 rows processed
Mar 09 14:24:46 DbDemoReporter[2968]  === Commit Internal Transaction
Mar 09 14:26:03 DbDemoReporter[2968] the qualifier is (name like 'CCCJR_2005')
Mar 09 14:26:14 DbDemoReporter[2968]  *** [<ODBCChannel: 0x4a07f08> evaluateExpression: <ODBCSQLExpression: "SELECT  t0.`end_date`, t0.`name`, t0.`affair_id`, t0.`owner_id`, t0.`parent_id`, t0.`type_id`, t0.`owner_class`, t0.`path`, t0.`property_dict`, t0.`start_date`, t0.`status_code` FROM `affair` t0  WHERE t0.`name` like ?" withBindings:(1:CCCJR[_]2005(name))>]
Mar 09 14:26:14 DbDemoReporter[2968]  === Begin Internal Transaction
Mar 09 14:26:14 DbDemoReporter[2968]  *** <ODBCChannel: 0x4a07f08> 0 rows processed
Mar 09 14:26:14 DbDemoReporter[2968]  === Commit Internal Transaction

How to repeat:
I can provide the app DbDemoReporter if needed.

Suggested fix:
Since I have trouble using MyODBC 3.52, I don't  know if this is already fixed in 3.52 or not.

My bug report about 3.52 GUI login trouble is now has status 'verified'. Not exactly know what 'verified' really mean

(1) It verified as a bug or (2) It is verified not a bug
[23 Mar 2006 18:48] Tonci Grgin
Thanks for your bug report. Can you please provide us with sample app?
[23 Apr 2006 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".
[28 May 2013 10:56] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.