4 messages in com.mysql.lists.bugsnull safe comparison
FromSent OnAttachments
Paul van den Berg14 Dec 2000 04:54 
Sinisa Milivojevic14 Dec 2000 08:52 
Michael Widenius15 Dec 2000 03:06 
Michael Widenius15 Dec 2000 03:37 
Subject:null safe comparison
From:Paul van den Berg (P.B.@farm.rug.nl)
Date:12/14/2000 04:54:20 AM
List:com.mysql.lists.bugs

SEND-PR: -*- send-pr -*- SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as SEND-PR: will all comments (text enclosed in `<' and `>'). SEND-PR: From: p.b.@farm.rug.nl To: mys@lists.mysql.com Subject:null safe comparison

Description: null safe comparison in table-fields does not work correctly How-To-Repeat:

create table null1 (id int, value int); create table null2 (id int, value int);

insert into null1 values (1,null); insert into null2 values (1,null);

select t1.value<=>t2.value from null1 t1, null2 t2 where t1.id=t2.id and t1.id=1; +---------------------+ | t1.value<=>t2.value | +---------------------+ | 0 | +---------------------+

select null<=>null; +-------------+ | null<=>null | +-------------+ | 1 | +-------------+

Fix:

I don't know!

Submitter-Id: <submitter ID> Originator: paul van den berg Organization: department of pharmacoepidemiology, University of Groningen MySQL support: [none ] Synopsis: problem with null-safe comparison Severity: [ serious ] Priority: [ medium ] Category: mysql Class: [ sw-bug ] Release: mysql-3.23.22-beta (Source distribution) Server: /usr/bin/mysqladmin Ver 8.8 Distrib 3.23.22-beta, for pc-

linux-gnu on i586 TCX Datakonsult AB, by Monty

I use Debian potato (2.2) linux with mysql 3.23 from debian's unstable tree on an Athlon 900 cpu.

Server version 3.23.22-beta-log Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 6 hours 49 min 46 sec

Threads: 2 Questions: 1946 Slow queries: 0 Opens: 212 Flush tables: 1 Open tables: 25 Queries per second avg: 0.079

Environment:

<machine, os, target, libraries (multiple lines)> System: Linux iadb 2.2.17 #1 Tue Oct 3 11:12:12 CEST 2000 i686 unknown Architecture: i686

Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gcc /usr/bin/cc GCC: Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs gcc version 2.95.2 20000220 (Debian GNU/Linux) Compilation info: CC='gcc' CFLAGS='-O2 -fomit-frame-pointer' CXX='g++' CXXFLAGS='-O2 -fomit-frame-pointer -felide- constructors -fno-exceptions -fno-rtti' LDFLAGS='' LIBC: lrwxrwxrwx 1 root root 14 Aug 17 16:20 /lib/libc.so.5 -> libc.so.5.4.46 -rw-r--r-- 1 root root 586720 Feb 9 1999 /lib/libc.so.5.4.46 lrwxrwxrwx 1 root root 13 Sep 11 15:38 /lib/libc.so.6 -> libc-2.1.3.so -rwxr-xr-x 1 root root 887712 Sep 1 18:03 /lib/libc-2.1.3.so -rw-r--r-- 1 root root 2089392 Sep 1 18:05 /usr/lib/libc.a -rw-r--r-- 1 root root 178 Sep 1 18:05 /usr/lib/libc.so /build_unix Perl: This is perl, version 5.005_03 built for i386-linux