Also unescape backslashes

This commit is contained in:
alesapin 2020-03-18 23:23:48 +03:00
parent 20211451ae
commit d060b7111d
2 changed files with 3 additions and 2 deletions

View File

@ -39,8 +39,9 @@ String getUnescapedFieldString(const Field & field)
if (!string.empty() && string.front() == '\'' && string.back() == '\'')
string = string.substr(1, string.size() - 2);
/// Backqouting will be performed on dictionary providers side
/// Escaping will be performed on dictionary providers side
boost::replace_all(string, "\\'", "'");
boost::replace_all(string, "\\\\", "\\");
return string;
}

View File

@ -234,7 +234,7 @@ def test_dictionary_with_where(started_cluster):
DB 'clickhouse'
TABLE 'special_table'
REPLICA(PRIORITY 1 HOST 'mysql1' PORT 3306)
WHERE 'value1 = \\'qweqwe\\''
WHERE 'value1 = \\'qweqwe\\' OR value1 = \\'\\\\u3232\\''
))
LAYOUT(FLAT())
LIFETIME(MIN 1 MAX 3)