>Description:

   Executing a SELECT DISTINCT statement in conjunction
   with the BINARY cast operator will crash MySQL server
   when the column being cast contains one or more null
   values.



>How-To-Repeat:

Executing the following code from a mysql prompt will
cause the MySQL server to crash and restart.

create temporary table wassup (
   rowid      int not null AUTO_INCREMENT PRIMARY KEY,
   col1       varchar(10) null
)
;

insert into wassup
(col1)
values
('aaa'),
('AAA'),
(NULL)
;

select distinct binary col1 from wassup
;



>Fix:

   Work-arounds: Defining the column as binary during the create
   table statement alleviates the need for the binary cast during
   selects, and thereby eliminates the crashes.  Alternatively,
   adding "where col1 is not null" to the select statement
   will also work.


>Submitter-Id:  <submitter ID>
>Originator:    Steve Severance
>Organization:
>MySQL support: none
>Synopsis:      SELECT DISTINCT BINARY crashes mysql on null values
>Severity:      non-critical
>Priority:      low 
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.23.47 (Official MySQL RPM)

>Environment:
        
System: Linux vexweb1 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
Compilation info: CC='gcc'  CFLAGS='-O6 -fno-omit-frame-pointer -mpentium'  CXX='gcc'  
CXXFLAGS='-O6 -fno-omit-frame-pointer              -felide-constructors 
-fno-exceptions -fno-rtti -mpentium'  LDFLAGS=''
LIBC: 
lrwxrwxrwx    1 root     root           13 Jan  4 16:56 /lib/libc.so.6 -> libc-2.2.2.so
-rwxr-xr-x    1 root     root      1236396 Apr  6  2001 /lib/libc-2.2.2.so
-rw-r--r--    1 root     root     26350254 Apr  6  2001 /usr/lib/libc.a
-rw-r--r--    1 root     root          178 Apr  6  2001 /usr/lib/libc.so
Configure command: ./configure  --disable-shared --with-mysqld-ldflags=-all-static 
--with-client-ldflags=-all-static --without-berkeley-db --without-innodb 
--enable-assembler --with-mysqld-user=mysql 
--with-unix-socket-path=/var/lib/mysql/mysql.sock --prefix=/ 
--with-extra-charsets=complex --exec-prefix=/usr --libexecdir=/usr/sbin 
--sysconfdir=/etc --datadir=/usr/share --localstatedir=/var/lib/mysql 
--infodir=/usr/info --includedir=/usr/include --mandir=/usr/man 
'--with-comment=Official MySQL RPM'


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to