Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30215

WITH ROLLUP and HAVING make mysql server coredump

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • None
    • N/A
    • N/A
    • None
    • ubuntu 16.04.4 LTS
      MariaDB 10.4.6

    Description

      I run this script, and then mysql server crashed. But if the last query has no ROLLUP or no HAVING, it is ok.

      ```sql
      CREATE TABLE `t1` (
      `col_int_key` int(11) DEFAULT NULL,
      `col_varchar_10` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
      `col_int` int(11) DEFAULT NULL,
      `col_varchar_10_key` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
      `col_varchar_16` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL,
      `col_varchar_16_key` varchar(16) COLLATE utf8mb4_bin DEFAULT NULL,
      `pk` int(11) NOT NULL AUTO_INCREMENT,
      PRIMARY KEY (`pk`),
      KEY `col_int_key` (`col_int_key`),
      KEY `col_varchar_10_key` (`col_varchar_10_key`),
      KEY `col_varchar_16_key` (`col_varchar_16_key`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

      INSERT INTO `t1` VALUES (NULL,'u',2,'in','yes',NULL,6),
      (6,NULL,0,'b','j','good',11),
      (4,'k',447676416,'be','r','q',12),
      (2,'x',8,NULL,'x','x',14),
      (3,'q',-932839424,'i','going','m',15),
      (9,'about',NULL,'r',NULL,NULL,19),
      (3,'p',6,'she','p','mean',21),
      (3,'g',NULL,'q','something','w',28),
      (8,'z',2,'w','d','could',29),
      (1409941504,'r',7,'c','t',NULL,37),
      (5,'i',4,'p','e','l',62),
      (-1187512320,NULL,7,'are','some','p',65),
      (666959872,'e',1858469888,'didn\'t','e','p',66),
      (2,NULL,-149815296,'e','x','n',68),
      (2,'if',0,'g','from','when',69),
      (7,'y',-396492800,'f',NULL,'u',71),
      (3,NULL,4,NULL,'c','k',75),
      (NULL,'to',5,'e','i','z',92),
      (-1327693824,'q',NULL,'he','d','ok',96),
      (7,'n',3,'g',NULL,'is',100),
      (4,'u',NULL,'u','w','l',105),
      (9,'t',3,'or','n',NULL,108),
      (9,'q',1,'w','q','g',110),
      (5,'ok',359530496,'y','e','o',116),
      (9,NULL,3,'my',NULL,'h',121),
      (5,'q',0,'k','o',NULL,134),
      (NULL,'s',8,'m','b','y',137),
      (NULL,'x',8,'this',NULL,'x',147),
      (2,'o',9,'v','did',NULL,161),
      (-1039925248,'w',-613154816,'k','c','d',163),
      (9,NULL,NULL,NULL,NULL,'w',164),
      (1,'i',NULL,'p','something','n',170),
      (9,'x',9,NULL,'one','a',172),
      (904134656,NULL,3,'x',NULL,'h',175),
      (5,'been',0,'u','when',NULL,178),
      (2,NULL,-1358888960,NULL,'z',NULL,180),
      (1800536064,'you',3,'f','a','w',183),
      (9,'y',-1177288704,'m','y','h',186),
      (4,NULL,-1078001664,'hey','j','d',187),
      (8,NULL,NULL,'something','b','u',189),
      (-2060517376,'e',6,'will','didn\'t','d',194),
      (2,'o',0,'s',NULL,'but',197),
      (NULL,NULL,-1361444864,NULL,'to','would',198),
      (9,'j',-474021888,'from','n',NULL,1),
      (NULL,'a',8,'q',NULL,NULL,3),
      (2,'oh',0,'z','here','j',4),
      (1,'v',1287127040,'r','d',NULL,13),
      (1,'think',3,'now','y','j',18),
      (NULL,'I',9,'her','l','q',20),
      (1,NULL,1,'n','i','out',23),
      (0,'it',2,'p','j','n',24),
      (2,'c',3,'s',NULL,NULL,34),
      (1,'f',5,'t','j','all',38),
      (0,'u',9,'o','her','r',39),
      (NULL,'r',-1029242880,'j',NULL,'v',40),
      (9,'o',NULL,NULL,'the','really',42),
      (NULL,NULL,NULL,'y','b',NULL,45),
      (NULL,'will',NULL,'q','z','o',51),
      (4,'o',3,'y','y','w',53),
      (803799040,'yes',NULL,NULL,'now','b',55),
      (NULL,NULL,8,NULL,'v','t',58),
      (2,'o',4,'f',NULL,'there',59),
      (NULL,'v',NULL,'don\'t',NULL,'l',61),
      (NULL,NULL,NULL,'p','j',NULL,64),
      (-288489472,NULL,NULL,'w','a','o',76),
      (7,'j',3,'i','t','z',79),
      (-1129316352,NULL,NULL,'come','u','m',81),
      (2,'for',NULL,'w','w','could',83),
      (0,'x',7,'p','you\'re',NULL,85),
      (NULL,'but',0,NULL,'q','k',86),
      (5,'s',354484224,'j','go',NULL,87),
      (NULL,'v',-325976064,'but','r','k',89),
      (7,'it',3,'d','z','y',107),
      (1455292416,'v',-1987248128,'i','u','he',113),
      (0,'your',2024996864,NULL,NULL,'k',114),
      (1526530048,'k',1,'p',NULL,'x',117),
      (1,'u',7,'m','now','on',118),
      (1,NULL,7,'m',NULL,'x',139),
      (1178730496,'g',0,'a','p','k',140),
      (6,'d',0,'x','t',NULL,142),
      (NULL,'e',8,NULL,'c','why',145),
      (3,'s',4,'a','z','e',148),
      (7,'q',NULL,'r','s','can\'t',155),
      (6,'q',1,'a',NULL,'k',159),
      (-1988755456,'j',-1333198848,'d',NULL,'b',160),
      (0,NULL,3,'d',NULL,'r',168),
      (-150470656,'f',3,NULL,'w','g',176),
      (1,NULL,-697434112,'r','r','one',177),
      (NULL,NULL,NULL,NULL,'s','e',181),
      (6,NULL,NULL,NULL,'b','r',196),
      (5,'hey',1,'him',NULL,'e',2),
      (-403374080,'f',3,NULL,NULL,'v',7),
      (NULL,'something',4,'u','o','and',10),
      (4,'okay',7,NULL,'now','j',17),
      (8,NULL,-1991376896,NULL,'s','time',22),
      (1611137024,NULL,-1925840896,'y','y','l',31),
      (385417216,'m',-1682702336,'a','r',NULL,32),
      (NULL,'n',8,'f','they','u',33),
      (3,NULL,-2044526592,'e','x','y',41),
      (7,'s',9,'he','x','v',43),
      (NULL,'m',4,'e','l','c',44),
      (9,'j',1,NULL,'y','something',46),
      (NULL,'v',NULL,'m','y','had',47),
      (-1740308480,'e',NULL,'q','w',NULL,49),
      (2,'d',1,'r','b','j',54),
      (NULL,'h',1,'d','right',NULL,57),
      (4,NULL,2,'k','c',NULL,63),
      (8,'u',2066415616,'u','something',NULL,74),
      (-1014300672,'w',9,'h',NULL,'o',78),
      (3,'i',NULL,NULL,'I\'ll','a',88),
      (8,'z',5,'l','s','r',90),
      (7,'who',4,'was',NULL,'k',93),
      (3,NULL,1111687168,'know','s','had',94),
      (9,'r',5,'r','g','d',99),
      (1,'u',4,'i','n','to',103),
      (8,'k',4,'r','x','d',104),
      (5,'been',9,'d','o',NULL,109),
      (4,'s',0,NULL,NULL,NULL,111),
      (8,'d',-154402816,'time','p','would',120),
      (NULL,'o',2,'about','i','q',122),
      (5,'h',2121400320,'d','s','y',123),
      (3,'i',6,'I\'m','say','you',124),
      (303104000,'when',1,'a','k','x',126),
      (2,'really',0,'c','j','c',128),
      (9,'go',0,'o',NULL,'z',129),
      (0,'d',1,'q','u',NULL,132),
      (-609157120,'a',896008192,'e','go','i',138),
      (-983236608,'u',2,'think','o','o',156),
      (-926154752,'h',1,'t','know','p',158),
      (0,NULL,1,'h','a','m',162),
      (3,'x',NULL,'s','b','e',165),
      (4,'good',-24576000,'g','c','b',166),
      (4,'been',NULL,'you\'re',NULL,'w',173),
      (-131858432,'y',NULL,'t','x',NULL,174),
      (7,'f',0,NULL,'k','w',184),
      (1985740800,'a',2059927552,'l',NULL,'with',192),
      (3,'e',1526530048,'v','a','k',195),
      (0,'i',NULL,NULL,NULL,'i',199),
      (NULL,'v',1103495168,NULL,'l',NULL,5),
      (-425918464,'c',2,'q','are','going',8),
      (0,NULL,1453719552,'q',NULL,'c',9),
      (-51904512,'f',4,'his',NULL,'c',16),
      (3,'you',-1464074240,NULL,NULL,'w',25),
      (NULL,'u',NULL,'j','the','k',26),
      (8,NULL,NULL,NULL,NULL,'p',27),
      (629604352,'q',-2067595264,'she','right','go',30),
      (1,NULL,7,'i','her','n',35),
      (8,'i',8,'g','are',NULL,36),
      (9,'q',6,NULL,'f','u',48),
      (NULL,NULL,9,'d',NULL,'j',50),
      (9,'why',0,'q','u','your',52),
      (2,'a',6,'r',NULL,'u',56),
      (5,NULL,2,'s','w','o',60),
      (0,'s',4,'v',NULL,'u',67),
      (NULL,'e',253755392,'have','i','oh',70),
      (1,NULL,NULL,'u','q',NULL,72),
      (NULL,'j',7,'been','why','o',73),
      (-342491136,NULL,-672268288,'w','z','f',77),
      (3,'d',3,'s','d','u',80),
      (5,'s',1,'f','k',NULL,82),
      (1,'because',7,'a','g','did',84),
      (-150798336,'your',7,'one','s',NULL,91),
      (5,'j',9,'l','you\'re',NULL,95),
      (3,NULL,0,'y','as',NULL,97),
      (3,'s',0,'m',NULL,'t',98),
      (9,'they',4,'x','q','f',101),
      (-1284505600,'d',5767168,'h','can','r',102),
      (9,'b',-429522944,'a',NULL,'a',106),
      (4,NULL,NULL,'n','tell','m',112),
      (1044905984,'w',0,'l','x','m',115),
      (-905707520,'I',0,'be','g','what',119),
      (NULL,'e',6,'why','mean',NULL,125),
      (9,'f',4,'m',NULL,'u',127),
      (6,'not',NULL,'c','j','b',130),
      (1520697344,NULL,NULL,'x',NULL,'my',131),
      (NULL,'m',4,'y',NULL,NULL,133),
      (2129854464,NULL,NULL,'i',NULL,'who',135),
      (NULL,'t',7,'l','d','w',136),
      (1843003392,NULL,1156120576,'n',NULL,'g',141),
      (3,'c',NULL,'h',NULL,'g',143),
      (8,'a',230686720,'to','u','come',144),
      (NULL,'a',9,'s','p','r',146),
      (NULL,'something',9,NULL,'q','something',149),
      (3,'l',5,'what',NULL,'or',150),
      (0,'x',-1667563520,'x',NULL,NULL,151),
      (3,'b',3,'l',NULL,NULL,152),
      (NULL,NULL,-908328960,'v','g','c',153),
      (NULL,'v',5,'q',NULL,'w',154),
      (0,'p',7,NULL,NULL,'e',157),
      (3,'that\'s',6,'r',NULL,'y',167),
      (0,'r',1,'hey',NULL,NULL,169),
      (NULL,'i',NULL,'y','your','l',171),
      (NULL,'say',-1810497536,'m','can','x',179),
      (6,'o',9,'k','f',NULL,182),
      (8,'come',2,'f','tell','n',185),
      (0,'c',8,'x','you','m',188),
      (NULL,'k',6,NULL,'h','l',190),
      (6,'w',-1067319296,'don\'t','g','right',191),
      (9,'o',-276758528,'x','m','b',193),
      (0,NULL,9,'h','the','good',200);

      SELECT col_int_key AS cik FROM `t1` WHERE pk = 7 GROUP BY cik WITH ROLLUP HAVING cik = 2 OR cik IS NULL;
      ```

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Suqiang Lin Suqiang Lin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.