Re: MySQL Function Naming

[prev] [thread] [next] [lurker] [Date index for 2007/03/20]

From: Aaron Crane
Subject: Re: MySQL Function Naming
Date: 14:12 on 20 Mar 2007
Smylers writes:
> MySQL has a couple of functions for extracting a substring from
> a string.  The one in which you specify an index is called
> Substring().  The one in which instead of an index you specify
> a delimiter is called ...  wait for it ... Substring_Index().

Ah, yes.

MySQL: The DBMS Designed To Make Your PHP Programmers Feel At Home.

On the assumption that this is a good moment for MySQL-related hate,
here's one that bit us earlier today:

    mysql> select id, label, concat('[', label, ']') as literal
    mysql> from tag where label = 'gpl' \G
    *************************** 1. row ***************************
         id: 255649
      label: gpl 
    literal: [gpl ]

For the record, the column is of type `varchar(255) character set utf8
collate utf8_bin` -- not `char(N)`, and certainly not `char(4)`.
I don't know how better I can tell MySQL that I really really care about
equality of the actual values I'm trying to store in this column.

I'm prepared to believe that this is merely a bug in our particular
point-release of the server, rather than a fundamental design flaw, but
that doesn't stop it being incredibly hateful: if I'm looking for
something equal to an exemplar, then, no, something vaguely similar is
_not_ sufficient.

-- 
Aaron Crane

Generated at 14:43 on 31 Mar 2007 by mariachi 0.52