﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
307	"Use unicode strings u""bla-bla"" in SQL-queries for compatibility with national languages"	mordaha@…	Adrian Holovaty	"Use unicode string in SQL-queries for compatibility with national languages (when you pass SQL-query as python unicode - database backend (MySQLdb) authomaticaly converts it from python encoding to mysql-connection encoding)


I found it in meta/fields.py (may be in some other places):
{{{
def get_db_prep_lookup(self, lookup_type, value):
        ...skip...

        elif lookup_type in ('contains', 'icontains'):
            return [""%%%s%%"" % prep_for_like_query(value)]
            # above string must be:
            # return [u""%%%s%%"" % prep_for_like_query(value)] # using unicode
        elif lookup_type == 'iexact':
}}}
without that '''u''' queries like field_contains=unicode_string_with_national_characters will returns nothing "	defect	closed	Metasystem		trivial	invalid	unicode strings in sql queries		Unreviewed	0	0	0	0	0	0
