Making SqlQueryMaker case-insensitive

Jeff Mitchell mitchell at kde.org
Mon Oct 26 02:25:22 CET 2009


Jeff Mitchell wrote:
> Jeff Mitchell wrote:
>> Maximilian Kossick wrote:
>>> Documentation on MySql collation, but I think I found it myself. If
>>> the database is utf8_bin by default, you'll have to make each column
>>> referenced by addFilter/excludeFilter use utf8_uicode_ci, as these
>>> filters have to be case insensitive, e.g albums.name COLLATE
>>> utf8_unicode_ci like '%foo%' (I'm not sure if this example works, but
>>> all the Sql query makers have to be adapted like this)
>>>
>>> See http://dev.mysql.com/doc/refman/5.0/en/charset-collate.html and
>>> http://dev.mysql.com/doc/refman/5.1/en/charset-collate-tricky.html
>> This is mostly gibberish to me as I know nothing about QueryMakers, much
>> less SqlQueryMakers. Is this something you can tackle?
> 
> Ahh, never mind -- this was easy to follow...done!

Okay, it doesn't entirely work.

It does work to filter in the CB, case insensitively.

I added the COLLATE in likeCondition, which is used by both addFilter
and excludeFilter. However, for some reason, trying to open a tag dialog
on single tracks in the Collection Browser (which creates a queryMaker)
doesn't work (but does for artist/album nodes). It does work to open the
tag dialog from tracks in the playlist (which passes in a Meta::TrackList).

I'm not really sure what could cause this, as I've gone through
SqlQueryMaker and there's only one place where the case-sensitivity
should matter -- in likeCondition. Unless the code building the query is
changing the case of some value in the node before passing it in, and I
missed that.

Any ideas?

Thanks,
Jeff

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20091025/251ff8d1/attachment.sig 


More information about the Amarok-devel mailing list