Bug #29013 Signal 11, MySQL server 5.0.41 crashed: has to do with the (NULL)
Description:
Don' work:
----------
select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6')
order by category desc;
Works:
------
select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6')
order by category asc;
select host_name from nagios_hosts
where category is not null and category not in (select category_name from ncpl_categories where category_filetype='6');
Attention:
----------
When you change the order by catefory from desc to asc it works for:
insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 1',NULL,'HOSTNAME 1');
insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 2','CAT 2','HOSTNAME 2');
When you change the order by catefory from asc to dec it works for:
insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 2','CAT 2','HOSTNAME 2');
insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 1',NULL,'HOSTNAME 1');
This means that there is a difference depending
How to repeat:
/*
SQLyog Pro - MySQL GUI v5.15
Host - 5.0.41-log : Database - yves
*********************************************************************
Server version : 5.0.41-log
*/
SET NAMES utf8;
SET SQL_MODE='';
create database if not exists `yves`;
USE `yves`;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
/*Table structure for table `nagios_hosts` */
DROP TABLE IF EXISTS `nagios_hosts`;
CREATE TABLE `nagios_hosts` (
`server_name` varchar(255) NOT NULL default '',
`category` varchar(64) default NULL,
`host_name` varchar(64) NOT NULL default '',
PRIMARY KEY (`server_name`,`host_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*Data for the table `nagios_hosts` */
insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 1',NULL,'HOSTNAME 1');
insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 2','CAT 2','HOSTNAME 2');
/*Table structure for table `ncpl_categories` */
DROP TABLE IF EXISTS `ncpl_categories`;
CREATE TABLE `ncpl_categories` (
`category_filetype` varchar(11) NOT NULL default '0',
`category_name` varchar(64) NOT NULL default '',
PRIMARY KEY (`category_filetype`,`category_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*Data for the table `ncpl_categories` */
insert into `ncpl_categories` (`category_filetype`,`category_name`) values ('6','CAT 1');
insert into `ncpl_categories` (`category_filetype`,`category_name`) values ('6','CAT 2');
SET SQL_MODE=@OLD_SQL_MODE;
Works:
------
select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6')
order by category asc;
select host_name from nagios_hosts
where category is not null and category not in (select category_name from ncpl_categories where category_filetype='6');
Don' work:
----------
select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6')
order by category desc;
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: Don' work: ---------- select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6') order by category desc; Works: ------ select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6') order by category asc; select host_name from nagios_hosts where category is not null and category not in (select category_name from ncpl_categories where category_filetype='6'); Attention: ---------- When you change the order by catefory from desc to asc it works for: insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 1',NULL,'HOSTNAME 1'); insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 2','CAT 2','HOSTNAME 2'); When you change the order by catefory from asc to dec it works for: insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 2','CAT 2','HOSTNAME 2'); insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 1',NULL,'HOSTNAME 1'); This means that there is a difference depending How to repeat: /* SQLyog Pro - MySQL GUI v5.15 Host - 5.0.41-log : Database - yves ********************************************************************* Server version : 5.0.41-log */ SET NAMES utf8; SET SQL_MODE=''; create database if not exists `yves`; USE `yves`; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'; /*Table structure for table `nagios_hosts` */ DROP TABLE IF EXISTS `nagios_hosts`; CREATE TABLE `nagios_hosts` ( `server_name` varchar(255) NOT NULL default '', `category` varchar(64) default NULL, `host_name` varchar(64) NOT NULL default '', PRIMARY KEY (`server_name`,`host_name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*Data for the table `nagios_hosts` */ insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 1',NULL,'HOSTNAME 1'); insert into `nagios_hosts` (`server_name`,`category`,`host_name`) values ('SERVERNAME 2','CAT 2','HOSTNAME 2'); /*Table structure for table `ncpl_categories` */ DROP TABLE IF EXISTS `ncpl_categories`; CREATE TABLE `ncpl_categories` ( `category_filetype` varchar(11) NOT NULL default '0', `category_name` varchar(64) NOT NULL default '', PRIMARY KEY (`category_filetype`,`category_name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*Data for the table `ncpl_categories` */ insert into `ncpl_categories` (`category_filetype`,`category_name`) values ('6','CAT 1'); insert into `ncpl_categories` (`category_filetype`,`category_name`) values ('6','CAT 2'); SET SQL_MODE=@OLD_SQL_MODE; Works: ------ select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6') order by category asc; select host_name from nagios_hosts where category is not null and category not in (select category_name from ncpl_categories where category_filetype='6'); Don' work: ---------- select host_name from nagios_hosts where category not in (select category_name from ncpl_categories where category_filetype='6') order by category desc;