Bug #6956 Binary IN( NULL ) Crashes MySQL/Server Goes Away
Submitted: 2 Dec 2004 18:05 Modified: 2 Dec 2004 18:30
Reporter: Bill Adams Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.7-standard-log OS:Linux (Linux FC1/7.3)
Assigned to: CPU Architecture:Any

[2 Dec 2004 18:05] Bill Adams
Description:
IN( NULL ) has problems with a column that is binary() NOT NULL

This is with the RPMs from the mysql.com site. Problem happens on both a RH7.3 and a FC1 machine.

How to repeat:
[bill@neon bill]$ rpm -qa |grep MySQL 
MySQL-server-4.1.7-0
MySQL-client-4.1.7-0
MySQL-devel-4.1.7-0
[bill@neon bill]$ mysql -uroot test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 594 to server version: 4.1.7-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table nullcrash ( txt binary(12) BINARY NOT NULL );
Query OK, 0 rows affected (0.03 sec)

mysql> select * from nullcrash where txt IS NULL;
Empty set (0.01 sec)

mysql> select * from nullcrash where txt IN( NULL );
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> 

Suggested fix:
None known.
[2 Dec 2004 18:10] Bill Adams
Ugh, the second BINARY is not needed in the create statement. It is the fact it is a binary column type.

Also, the NOT NULL is required on the create table. If you create the table without it then it will not have problems.
[2 Dec 2004 18:30] MySQL Verification Team
I can't repeat when tested against a server build from latest BK
source. I tried with/without second BINARY:

mysql> create table nullcrash ( txt binary(12)  NOT NULL );
Query OK, 0 rows affected (0.01 sec)

mysql> select * from nullcrash where txt IS NULL;
Empty set (0.00 sec)

mysql> select * from nullcrash where txt IN( NULL );
Empty set (0.00 sec)

mysql> select version();
+-----------------+
| version()       |
+-----------------+
| 4.1.8-debug-log |
+-----------------+
1 row in set (0.03 sec)

Thank you for the bug report.
[3 Dec 2004 18:02] Bill Adams
Happens with date too, probably fixed in next version.

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2323 to server version: 4.1.7-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create table nullcrash ( d date not null);
Query OK, 0 rows affected (0.52 sec)

mysql> select * from nullcrash where d IN( NULL );
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>