2 messages in com.mysql.lists.bugsBug Report| From | Sent On | Attachments |
|---|---|---|
| Кулаков Сергей | 12 Mar 2002 06:11 | |
| Sinisa Milivojevic | 12 Mar 2002 09:13 |
| Subject: | Bug Report![]() |
|---|---|
| From: | Кулаков Сергей (kula...@rlsnet.ru) |
| Date: | 03/12/2002 06:11:15 AM |
| List: | com.mysql.lists.bugs |
From: kulakov
Description: We run a Russian site (www.rlsnet.ru) that lets people get info on a lot of medicines and we use your MySQL. Names of medicines have become longer and I decided to switch from varchar(255) to text. So I created a table that among others included a field like this: tradename text NOT NULL and an index like this: unique (tradename(200) - I decided to save disk space, so I only used 200 characters. Checking long medicine names, I ran queries like this: Select Distinct substring(tradename,1,255) from tradenames. That query worked OK. But when I changed it to substring(tradename,1,256) it all of a sudden returned me just one row! Mind that it works well without distinct.
How-To-Repeat:
create table tradenames( tradename text NOT NULL, unique (tradename(200)) )
insert into tradenames values ('Tradename 1'), ('Tradename 2'), ('Tradename 3')
Select Distinct substring(tradename,1,256) from tradenames
Originator: Sergey Kulakov Organization: RLS MySQL support: none Severity:non-critical Priority:low Category: mysql Class: sw-bug Release: mysql-3.23.38 (Source distribution) Environment: System: FreeBSD inserv.rlsnet.ru 4.2-RELEASE FreeBSD 4.2-RELEASE #0: Wed Feb 13 12:48:1 5 MSK 2002
______________________________________ Scanned and protected by Inflex




