I think we can do it like this: mysql> select name from dbmail_mailboxes where binary name regexp '[lL][iI][sS][tT][eE][nN]/[uU][bB][uU][nN][tT][uU]'; +---------------------+ | name | +---------------------+ | Listen/Ubuntu | +---------------------+
Horribly ugly, but MySQL doesn't support regular expression transformations. Before sending a mailbox to be looked up, convert it into the self-matching case insensitive form. The same syntax in PostgreSQL uses ~ instead of REGEXP. PostgreSQL also has a regexp_replace function that probably could be used to actually produce the proper lowercase form, skipping whatever's between non greedy pairs of & - ... but whatever. Aaron On Tue, 2006-06-06 at 02:34 -0700, Aaron Stone wrote: > On Tue, 2006-06-06 at 11:30 +0400, Oleg Lapshin wrote: > > > Hello > > > > > > I download and run svn-2154 revision (after 2139) > > > > > > And I can't read all my mailboxes! > > > Some `selects` (from dbmail-logs and my own): > > > > I found my error: > > the `name` field in database was varbinary(100) type > > I dont' know why. > > It's how the column is defined in dbmail/sql/mysql/create_tables.mysql: > > name varchar(100) BINARY NOT NULL default '', > > I'm not sure yet how to work around the case sensitivity issue of the > mailboxes. We need a smart way to get US-ASCII to lowercase itself while > preserving the case of the US-ASCII that is between & - pairs. > > I'm sure you'll notice that any mailboxes with Russian characters are > completely broken... in fact, could you create a mailbox with some > Russian characters and post their rows from the database? > > Aaron > > _______________________________________________ > Dbmail-dev mailing list > Dbmail-dev@dbmail.org > http://twister.fastxs.net/mailman/listinfo/dbmail-dev