List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:August 14 1999 2:58pm
Subject:Re: IS NULL for UNIQUE column is incorrect
View as plain text  
On Sat, 1999-08-14 00:12:21, tommy@stripped wrote:
> Received: from www2.analytikerna.se (www2.analytikerna.se [192.58.197.62])
> 	by sauron.forwiss.uni-passau.de (8.8.8/8.8.8) with SMTP id CAA27757
> 	for <ramsch@stripped>; Sat, 14 Aug 1999 02:14:39 +0200 (MET DST)
> Received: (qmail 358 invoked by uid 7797); 14 Aug 1999 00:13:58 -0000
> Mailing-List: contact mysql-help@stripped; run by ezmlm
> (http://www.ezmlm.org)
> Precedence: bulk
> List-Help: <mailto:mysql-help@stripped>
> List-Unsubscribe:
> <mailto:mysql-unsubscribe-ramsch=forwiss.uni-passau.de@stripped>
> List-Post: <mailto:mysql@stripped>
> List-Subscribe: <mailto:mysql-subscribe@stripped>
> Delivered-To: mailing list mysql@stripped
> X-Ezauth: jnhcglgfjhmidfjephnl
> Received: (qmail 344 invoked from network); 14 Aug 1999 00:13:58 -0000
> Received: from river.valley.ne.jp (202.222.129.2)
>   by www2.analytikerna.se with SMTP; 14 Aug 1999 00:13:58 -0000
> From: tommy@stripped
> Date: 14 Aug 1999 00:12:21 -0000
> Message-ID: <19990814001221.19096.qmail@stripped>
> To: mysql@stripped
> Cc: tommy@stripped
> Subject: IS NULL for UNIQUE column is incorrect

> >Description:
> 	IS NULL for UNIQUE column is incorrect.
> 	For non-UNIQUE column, it work fine.
> 
> >How-To-Repeat:
> 
> 	mysql> create table test5 (id int not null, str char(10), unique(str));
> 	Query OK, 0 rows affected (0.00 sec)

Trying this with MySQL V3.22.19b, I get:
  ERROR 1121: Column 'str' is used with UNIQUE or INDEX
              but is not defined as NOT NULL

This is in accordance to the manual which says
chapter "7.6 CREATE TABLE syntax":
| * Columns that are indexed or part of an index cannot have NULL
|   values. You must declare such columns NOT NULL or an error
|   results.

What version of MySQL do you have?

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
IS NULL for UNIQUE column is incorrecttommy14 Aug
  • Re: IS NULL for UNIQUE column is incorrectMartin Ramsch14 Aug
    • Re: IS NULL for UNIQUE column is incorrectBenjamin Pflugmann14 Aug
      • Re: IS NULL for UNIQUE column is incorrectMartin Ramsch14 Aug
  • IS NULL for UNIQUE column is incorrectMichael Widenius21 Aug
  • IS NULL for UNIQUE column is incorrectMichael Widenius21 Aug