﻿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
507	Make startswith and endswith case-sensitive in MySQL	Simon Willison	Adrian Holovaty	"At the moment, startswith and endswith are not case-sensitive. There are two potential fixes.

In the MySQL manual [http://dev.mysql.com/doc/mysql/en/string-comparison-functions.html it says this]:

----
The following two statements illustrate that string comparisons are not case sensitive unless one of the operands is a binary string:
{{{
mysql> SELECT 'abc' LIKE 'ABC';
        -> 1
mysql> SELECT 'abc' LIKE BINARY 'ABC';
        -> 0
}}}
----

LIKE BINARY could solve the problem (I haven't yet tried it myself) - we would need to check which versions of MySQL it is available in though.

If that doesn't work, how about adding a mechanism to the database layer where a Python function can be defined to perform further processing on a database result set before handing it back? The MySQL backend could then define a function for startswith and endswith that runs a normal case-insesitive search and then filters the results in Python code to find only case-sensitive matches. This would allow missing functionality to be patched in to other database modules as desired."	enhancement	closed	Database layer (models, ORM)		normal	fixed			Unreviewed	0	0	0	0	0	0
