[MDEV-10369] Simple select or explain crashes mariadb with signal 11 with NOT IN ( NULL , 'data' ) Created: 2016-07-13  Updated: 2016-07-14  Resolved: 2016-07-14

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.1.12, 10.1.14
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Lars Mikkelsen Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Oracle Linux 7.2, Mariadb 10.1.12/Mariadb 10.1.14,
Kernel 4.1.12-37.5.1.el7uek.x86_64

Mariadb installed from mariadb.org centos packages.

2 cpu, 32 GB virtual machine


Attachments: Text File error.log     File server.cnf    
Issue Links:
Duplicate
is duplicated by MDEV-10020 InnoDB NOT IN Query Crash When One It... Closed

 Description   

Ran into major problems with a query as it crashed the database.
Tested on Mariadb version 10.1.12 and 10.1.14

Table definition:

CREATE TABLE `field_data_field_computed_family_id` (
  `entity_type` varchar(128) NOT NULL DEFAULT '' COMMENT 'The entity type this data is attached to',
  `bundle` varchar(128) NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance',
  `deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'A boolean indicating whether this data item has been deleted',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'The entity id this data is attached to',
  `revision_id` int(10) unsigned DEFAULT NULL COMMENT 'The entity revision id this data is attached to, or NULL if the entity type is not versioned',
  `language` varchar(32) NOT NULL DEFAULT '' COMMENT 'The language for this data item.',
  `delta` int(10) unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields',
  `field_computed_family_id_value` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`entity_type`,`entity_id`,`deleted`,`delta`,`language`),
  KEY `entity_type` (`entity_type`),
  KEY `bundle` (`bundle`),
  KEY `deleted` (`deleted`),
  KEY `entity_id` (`entity_id`),
  KEY `revision_id` (`revision_id`),
  KEY `language` (`language`),
  KEY `field_computed_family_id_value` (`field_computed_family_id_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
 
10 rows inserted:
MariaDB [test]> select * from field_data_field_computed_family_id ;
+-------------+---------+---------+-----------+-------------+----------+-------+--------------------------------+
| entity_type | bundle  | deleted | entity_id | revision_id | language | delta | field_computed_family_id_value |
+-------------+---------+---------+-----------+-------------+----------+-------+--------------------------------+
| node        | product |       0 |       195 |         195 | und      |     0 | NULL                           |
| node        | product |       0 |       196 |         196 | und      |     0 | 1007261                        |
| node        | product |       0 |       197 |         197 | und      |     0 | 1007261                        |
| node        | product |       0 |       198 |         198 | und      |     0 | 1007261                        |
| node        | product |       0 |       199 |         199 | und      |     0 | 1010901                        |
| node        | product |       0 |       200 |         200 | und      |     0 | 1017561                        |
| node        | product |       0 |       201 |         201 | und      |     0 | 1019562                        |
| node        | product |       0 |       202 |         202 | und      |     0 | 1025560                        |
| node        | product |       0 |       203 |         203 | und      |     0 | 1025561                        |
| node        | product |       0 |       204 |         204 | und      |     0 | 1025561                        |
+-------------+---------+---------+-----------+-------------+----------+-------+--------------------------------+
10 rows in set (0.00 sec)
 
MariaDB [test]> select count(*) from field_data_field_computed_family_id where field_computed_family_id_value NOT IN  ( NULL, '1017561');
ERROR 2013 (HY000): Lost connection to MySQL server during query
MariaDB [test]> \! systemctl start mariadb
MariaDB [test]> select count(*) from field_data_field_computed_family_id where field_computed_family_id_value NOT IN  ( '1017561');
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    3
Current database: test
 
+----------+
| count(*) |
+----------+
|        8 |
+----------+
1 row in set (0.01 sec)

Trying to do an EXPLAIN EXTENDED on the query also crashes mariadb.



 Comments   
Comment by Elena Stepanova [ 2016-07-14 ]

Thanks for the report.
This problem was fixed in scope of MDEV-10020.
Version 10.1.15 which it was fixed in is not available for download, but 10.1.16 should be released in the next few days, and it will contain the fix.

Just for a note, I'm not sure what result you expect to get from the query, but the actual result will be 0, which is somewhat counter-intuitive, but actually fits the specification.

Comment by Lars Mikkelsen [ 2016-07-14 ]

Thnx for the update!

NULL was not expected to show up in the NOT IN (). We allready fixed the code so it cannot happen anymore.
Looking forward to 10.1.16

Generated at Thu Feb 08 07:41:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.