Bug 334543 - If an apex ( like: ' ) is present in the search term of the address the query fails because the query itself uses the apexes
Summary: If an apex ( like: ' ) is present in the search term of the address the qu...
Status: RESOLVED WORKSFORME
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.7 (KDE 4.12)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-09 07:19 UTC by Renato
Modified: 2017-12-20 19:14 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.