I disagree; we should let the database do the lowercasing so that it
matches exactly with how the database does the lowercase index.

Uh, unless it's required that headers are US-ASCII < 128? If so, then
it's the old "six of one, half dozen of the other..."

Aaron

On Mon, 2005-12-12 at 21:45 +0100, Paul J Stevens wrote:
> Kevin Brown wrote:
> > Also, since "lower" is also ANSI-standard and supported by all three
> > databases, we should probably use that instead of "upper", since the
> > data will be more readable should we decide to store the data in
> > case-converted form some time in the future.  So, s/upper/lower/g in
> > the diff (and in the functional index, of course).
> 
> Let's do this:
> diff --git a/dm_imaputil.c b/dm_imaputil.c
> --- a/dm_imaputil.c
> +++ b/dm_imaputil.c
> @@ -736,12 +736,13 @@ static GTree * _fetch_headers(const GLis
> 
>         r = g_list_join((GList *)ids,",");
>         h = g_list_join((GList *)headers,"','");
> +       h = g_string_ascii_down(h);
> 
>         g_string_printf(q,"SELECT physmessage_id,headername,headervalue "
>                         "FROM %sheadervalue v "
>                         "JOIN %sheadername n ON v.headername_id=n.id "
>                         "WHERE physmessage_id IN (%s) "
> -                       "AND headername %s IN ('%s')",
> +                       "AND lower(headername) %s IN ('%s')",
>                         DBPFX, DBPFX, r->str, not?"NOT":"", h->str);
> 
>         g_string_free(r,TRUE);
> 
> 

Reply via email to