Bug 334543

Summary: If an apex ( like: ' ) is present in the search term of the address the query fails because the query itself uses the apexes
Product: [Applications] marble Reporter: Renato <rfringuello>
Component: generalAssignee: marble-bugs
Status: RESOLVED WORKSFORME    
Severity: normal CC: illya.kovalevskyy, personaltimz
Priority: NOR    
Version: 1.7 (KDE 4.12)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Renato 2014-05-09 07:19:40 UTC
The local-osm-search plugin uses the method:
QString OsmDatabase::wildcardQuery( const QString &term ) const

in order to inglobe the searched place in the query
The problem is that the returned QString uses the single apex and if the QString term already contains an apex the returned value will be wrong because will be interrupted at the first apex of the term.

Reproducible: Always

Steps to Reproduce:
1. Insert an address containing an apex (like: Via Sant'Orsola, Milano).
2. Try to search it and wait the result.
3. Check the result.
Actual Results:  
The results are wrong because marble will search for: "Via Sant, Milano"

Expected Results:  
The software should search for "Via Sant'Orsola, Milano"

the following block:
    if ( term.contains( '*' ) ) {
        return " LIKE '" + result.replace( '*', '%' ) + '\'';
    } else {
        return " = '" + result + '\'';
    }

should be like this:
    if ( term.contains( '*' ) ) {
        return " LIKE \"" + result.replace( '*', '%' ) + "\" ";
    } else {
        return " = \"" + result + "\"";
    }
Comment 1 Illya Kovalevskyy 2014-12-13 20:17:17 UTC
I am doing bug triaging as Google Code-In 2014 student.

Via Sant'Orsola, Milano is being searched properly (latest master). Seems fixed.
Comment 2 Myriam Schweingruber 2014-12-14 11:34:16 UTC
Fixed according to comment #1, please feel free to reopen if this is happening again with current git master or the next release.