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

Wrong result upon query using index_merge with DESC key (#2)

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t_asc (pk int, a int, b int, primary key (pk), key (a), key (b)) ENGINE=InnoDB;
      CREATE TABLE t_desc (pk int, a int, b int, primary key (pk DESC), key (a), key (b)) ENGINE=InnoDB;
       
      INSERT INTO t_asc VALUES
      (1,0,83),(2,65535,28328),(3,655,211),(4,186,324),(5,80,32767),(6,551,1),
      (7,78,0),(8,8,767),(9,35,62),(10,0,1),(11,NULL,245),(12,16,0),(13,15,0),
      (14,245,4),(15,0,5809),(16,119,32767),(17,0,0),(18,65535,NULL),(19,6,5),
      (20,171,NULL),(21,0,0),(22,65,NULL),(23,1,95),(24,162,0),(25,1700,2767),
      (26,NULL,0),(27,3,0),(28,39,NULL),(29,NULL,255),(30,NULL,0),(31,NULL,0),
      (32,3,154),(33,1,30141),(34,0,70),(35,65535,NULL),(36,2,0),(37,5,32767),
      (38,NULL,NULL),(39,655,80),(40,813,5),(41,7,0),(42,NULL,225),(43,53,96),
      (44,46850,NULL),(45,0,1),(46,0,0),(47,0,32767),(48,49287,2484),(49,0,7),
      (50,18596,0),(51,0,0),(52,5,14813),(53,254,NULL),(54,4,124),(55,0,NULL),
      (56,0,129),(57,238,53),(58,774,11),(59,2662,NULL),(60,0,NULL),(61,0,65),
      (62,NULL,182),(63,029,17796),(64,0,23764),(65,0,212),(66,20,0),(67,0,8),
      (68,443,NULL),(69,5,9),(70,0,5),(71,1,8),(72,6,767),(73,9,0),(74,051,0),
      (75,NULL,7),(76,0,1),(77,0,NULL),(78,3,2),(79,0,3),(80,0,NULL),(81,0,8),
      (82,0,0),(83,08,NULL),(84,0,NULL),(85,8,6),(86,234,6),(87,0,0),(88,0,0),
      (89,6,191),(90,13975,NULL),(91,295,29),(92,35,0),(93,0,8),(94,185,NULL),
      (95,0,81),(96,0,0),(97,123,0),(98,5,0),(99,1,18),(100,0,8),(101,NULL,0),
      (102,0,182),(103,NULL,0),(104,NULL,485),(105,42,2),(106,3,0),(107,35,0),
      (108,NULL,0),(109,68,74),(110,0,0),(111,0,3),(112,NULL,0),(113,NULL,67),
      (114,192,164),(115,65535,0),(116,75,9),(117,0,0),(118,54,53),(119,90,2),
      (120,NULL,NULL),(121,0,205),(122,30187,NULL),(123,65535,0),(124,0,6963),
      (125,8814,9),(126,7,17),(127,6,7),(128,NULL,67),(129,5,6),(130,95,NULL),
      (131,2,0661),(132,0,0),(133,0,NULL),(134,0,8),(135,2,NULL),(136,5,NULL),
      (137,0,0),(138,0,6),(139,NULL,NULL),(140,28,18),(141,7,NULL),(142,62,7),
      (143,NULL,21270),(144,0,NULL),(145,239,8999),(146,65535,2767),(147,0,9),
      (148,42414,32767),(149,0,28865),(150,764,117),(151,01,76),(152,NULL,42),
      (153,8,3),(154,0,799),(155,8,0),(156,NULL,9),(157,33,NULL),(158,1,NULL),
      (159,NULL,0),(160,18,23),(161,4,27602),(162,NULL,29325),(163,NULL,2767),
      (164,0,0),(165,NULL,0),(166,NULL,6),(167,NULL,1),(168,79,76),(169,28,0),
      (170,NULL,30271),(171,49,0),(172,190,32767),(173,NULL,NULL),(174,535,0),
      (175,65535,NULL),(176,9,173),(177,0,8),(178,NULL,3),(179,0,7),(180,7,8),
      (181,583,7),(182,248,214),(183,4,6),(184,0,7),(185,NULL,6),(186,0,NULL),
      (187,173,53),(188,NULL,32767),(189,173,7),(190,NULL,32767),(191,4824,0),
      (192,6,1),(193,9,2),(194,1,95),(195,5,7),(196,0,9),(197,7,0),(198,0,23),
      (199,10591,NULL),(200,NULL,2),(201,NULL,2558),(202,0,27012),(203,925,7),
      (204,9,0),(205,8,8),(206,2,0),(207,3,0),(208,0,1),(209,23,0),(210,53,2),
      (211,8,NULL),(212,1,NULL),(213,7,62),(214,11571,11814),(215,56636,NULL),
      (216,14770,0),(217,3,237),(218,NULL,NULL),(219,6,6),(220,0,0),(221,0,0),
      (222,196,NULL),(223,0,6),(224,91,NULL),(225,1,2767),(226,4,0),(227,7,1),
      (228,65535,66),(229,7,0),(230,NULL,8),(231,NULL,0),(232,0,16),(233,5,1),
      (234,37841,0),(235,5,2),(236,0,8),(237,8610,9),(238,0,NULL),(239,504,0),
      (240,65535,0),(241,0,140),(242,5,7),(243,NULL,6),(244,5,NULL),(245,8,0),
      (246,5,0),(247,5,NULL),(248,7,0),(249,NULL,NULL),(250,8,NULL),(251,8,0),
      (252,11913,14673),(253,0,NULL),(254,19444,0),(255,126,253),(256,5,NULL),
      (257,0,0),(258,1,8),(259,0,4),(260,535,0),(261,7,9),(262,0,7),(263,5,7),
      (264,7,3),(265,NULL,9),(266,7515,0),(267,0,0),(268,NULL,NULL),(269,0,0),
      (270,24,0),(271,5,5),(272,7,2),(273,62977,42),(274,0,0),(275,NULL,NULL),
      (276,0,NULL),(277,0,2),(278,NULL,2),(279,0,5),(280,0,NULL),(281,NULL,0),
      (282,NULL,28551),(283,9,0),(284,0,0),(285,NULL,403),(286,0,2),(287,0,0),
      (288,65535,NULL),(289,NULL,87),(290,68,2),(291,34711,NULL),(292,NULL,0),
      (293,224,5),(294,0,NULL),(295,NULL,8),(296,2,0),(297,NULL,0),(298,1,19),
      (299,7,0),(300,0,20218),(301,65535,67),(302,3,0),(303,NULL,8),(304,6,7),
      (305,8,16836),(306,121,0),(307,7,3),(308,0,2767),(309,5,NULL),(310,3,7),
      (311,0,32767),(312,0,2),(313,0,237),(314,5,0),(315,8,NULL),(316,2,NULL),
      (317,63675,7293),(318,65535,23239),(319,65535,9),(320,6,0),(321,9,NULL),
      (322,0,7),(323,193,61),(324,0,NULL),(325,0,0),(326,NULL,3630),(327,0,0),
      (328,2,4),(329,2,0),(330,180,2767),(331,33,0),(332,6,NULL),(333,6,NULL),
      (334,0,32767),(335,5,26955),(336,4,32767),(337,0,7),(338,0,8),(339,0,4),
      (340,NULL,9),(341,5,0),(342,NULL,0),(343,9,0),(344,NULL,NULL),(345,1,1),
      (346,148,NULL),(347,19,7),(348,6,7),(349,9,0),(350,NULL,9),(351,5,NULL),
      (352,109,NULL),(353,155,NULL),(354,0,25197),(355,195,767),(356,35,NULL),
      (357,0,0),(358,NULL,1815),(359,6,2),(360,2,0),(361,NULL,0),(362,0,NULL),
      (363,0,NULL),(364,NULL,NULL),(365,0,1),(366,234,0),(367,51,3),(368,8,1),
      (369,0,0),(370,65535,NULL),(371,83,5),(372,1,0),(373,9,200),(374,0,345),
      (375,0,0),(376,189,58),(377,0,6),(378,NULL,NULL),(379,NULL,7),(380,6,3),
      (381,3515,NULL),(382,38,NULL),(383,0,17171),(384,21290,2),(385,33,NULL),
      (386,250,4),(387,1,27157),(388,23727,12),(389,29117,14591),(390,6,NULL),
      (391,3046,0),(392,1,0),(393,0,0),(394,9,NULL),(395,NULL,NULL),(396,3,0),
      (397,53,NULL),(398,65535,0),(399,0,0),(400,144,1),(401,0,810),(402,7,8),
      (403,NULL,204),(404,NULL,8),(405,5,0),(406,0,7),(407,69,0),(408,NULL,1),
      (409,174,NULL),(410,0,2),(411,1,0),(412,62,NULL),(413,NULL,0),(414,9,0),
      (415,4,1),(416,NULL,NULL),(417,NULL,NULL),(418,0,7),(419,0,2),(420,0,0),
      (421,NULL,7),(422,NULL,0),(423,6,NULL),(424,4,NULL),(425,0,7),(426,4,6),
      (427,0,1),(428,25844,NULL),(429,112,224),(430,0,32),(431,0,7),(432,3,0),
      (433,7,0),(434,65535,NULL),(435,65535,0),(436,1792,32767),(437,8,32767),
      (438,20,32767),(439,73,2),(440,243,1131),(441,0,22463),(442,47943,NULL),
      (443,18220,2767),(444,35,0),(445,0,8),(446,1,3),(447,9,NULL),(448,35,8),
      (449,0,2254),(450,253,5),(451,NULL,201),(452,43819,NULL),(453,10,32767),
      (454,NULL,5),(455,0,0),(456,0,0),(457,4633,3),(458,140,NULL),(459,0,67),
      (460,05,6),(461,NULL,0),(462,61,0),(463,NULL,NULL),(464,0,0),(465,0,54),
      (466,NULL,0),(467,0,0),(468,174,9),(469,1190,51),(470,0,2),(471,8,NULL),
      (472,NULL,0),(473,NULL,4),(474,NULL,0),(475,1,6),(476,0,NULL),(477,3,0),
      (478,3,0),(479,35,2),(480,0,4),(481,0,0),(482,0,2),(483,47,6),(484,6,7),
      (485,0,32767),(486,0,0),(487,129,48),(488,717,8),(489,NULL,8),(490,0,6),
      (491,65291,0),(492,NULL,7),(493,110,5),(494,4,0),(495,5,0),(496,NULL,7),
      (497,0,NULL),(498,7561,8),(499,1,NULL),(500,2,3),(501,5,NULL),(502,0,7),
      (503,9,34),(504,162,0),(505,0,0),(506,42,1763),(507,154,5),(508,NULL,4),
      (509,0,6),(510,0,0),(511,0,0),(512,6,0),(513,9,0),(514,1,234),(515,3,7),
      (516,0,3769),(517,0,NULL),(518,1,2),(519,3,0),(520,8,NULL),(521,0,NULL),
      (522,0,9),(523,5,NULL),(524,NULL,2),(525,NULL,0),(526,0,NULL),(527,8,8),
      (528,56838,32235),(529,229,0),(530,NULL,4825),(531,5535,7),(532,NULL,0),
      (533,2,32767),(534,62,5327),(535,NULL,0),(536,65535,32767),(537,238,76),
      (538,NULL,24445),(539,0,1),(540,NULL,181),(541,4,5),(542,0,8),(543,4,3),
      (544,10,0),(545,17266,20),(546,44860,NULL),(547,231,205),(548,17,14458),
      (549,3,27596),(550,119,39),(551,65535,45),(552,NULL,27368),(553,7,2767),
      (554,11,NULL),(555,3,545),(556,0,5),(557,0,NULL),(558,0,3),(559,NULL,2),
      (560,0,9),(561,0,0),(562,0,NULL),(563,65535,740),(564,1,NULL),(565,2,6),
      (566,15036,0),(567,933,0),(568,8,NULL),(569,5,0),(570,7,NULL),(571,9,3),
      (572,105,NULL),(573,NULL,75),(574,0,0),(575,0,0),(576,5,9),(577,NULL,0),
      (578,186,2),(579,17970,29403),(580,60773,0),(581,NULL,1),(582,NULL,220),
      (583,5,NULL),(584,5,NULL),(585,0,2),(586,0,6),(587,0,7),(588,NULL,NULL),
      (589,NULL,9),(590,0,234),(591,9,14),(592,NULL,0),(593,1,7),(594,5,NULL),
      (595,3,2),(596,9,7276),(597,5,NULL),(598,NULL,NULL),(599,4,0),(600,5,4),
      (601,65535,23557),(602,65535,32767),(603,0,34),(604,80,4),(605,74,NULL),
      (606,47129,612),(607,9,0),(608,3,NULL),(609,0,NULL),(610,0,0),(611,5,8),
      (612,0,17),(613,0,3386),(614,65535,61),(615,2,5),(616,NULL,1),(617,4,7),
      (618,5,236),(619,0,3),(620,NULL,0),(621,0,4),(622,17849,6016),(623,0,1),
      (624,2,6),(625,11,97),(626,0,0),(627,5,0),(628,9,0),(629,0,0),(630,0,3),
      (631,NULL,32767),(632,32250,8),(633,242,NULL),(634,549,75),(635,NULL,9),
      (636,0,9),(637,NULL,1),(638,0,32767),(639,9,32767),(640,73,0),(641,0,2),
      (642,NULL,0),(643,125,0),(644,9,3),(645,166,1),(646,535,NULL),(647,1,1),
      (648,8,NULL),(649,NULL,135),(650,0,0),(651,149,5),(652,0,0),(653,0,580),
      (654,6712,4),(655,170,2),(656,0,32767),(657,65535,28672),(658,31543,10),
      (659,9958,0),(660,4,0),(661,NULL,NULL),(662,6,9),(663,1,NULL),(664,7,0),
      (665,65535,245),(666,65535,0),(667,44135,NULL),(668,63299,0),(669,0,10),
      (670,0,NULL),(671,NULL,0),(672,106,190),(673,38774,15704),(674,193,127),
      (675,NULL,NULL),(676,190,16),(677,6296,9),(678,8,0),(679,9,0),(680,0,0),
      (681,3633,7),(682,5,NULL),(683,6,1),(684,NULL,1),(685,7,NULL),(686,8,0),
      (687,0,1),(688,0,0),(689,47873,531),(690,NULL,0),(691,NULL,4),(692,7,0),
      (693,NULL,0),(694,0,2248),(695,NULL,NULL),(696,0,0),(697,0,0),(698,5,0),
      (699,0,32767),(700,NULL,32767),(701,6,32767),(702,NULL,8),(703,65535,7),
      (704,NULL,4),(705,6,5),(706,NULL,56),(707,NULL,367),(708,4,9),(709,7,0),
      (710,3,766),(711,5,0),(712,0,NULL),(713,150,756),(714,3,NULL),(715,4,1),
      (716,87,5),(717,21,0),(718,NULL,NULL),(719,0,62),(720,NULL,7),(721,2,2),
      (722,0,0),(723,0,0),(724,1,NULL),(725,7,NULL),(726,8,NULL),(727,NULL,0),
      (728,0,9792),(729,46,109),(730,8,0),(731,0,0),(732,60,120),(733,0,NULL),
      (734,0,6957),(735,NULL,0),(736,0,31718),(737,1,9),(738,0,121),(739,0,3),
      (740,NULL,NULL),(741,7,NULL),(742,535,6),(743,0,0),(744,99,7),(745,0,0),
      (746,9554,3),(747,5,0),(748,16301,4),(749,535,0),(750,9,6),(751,NULL,7),
      (752,0,32767),(753,65535,32767),(754,NULL,7),(755,14739,0),(756,10,123),
      (757,245,NULL),(758,0,13653),(759,3612,76),(760,NULL,NULL),(761,NULL,1),
      (762,154,0),(763,5535,NULL),(764,30,1),(765,3,2),(766,0,NULL),(767,9,2),
      (768,NULL,26980),(769,0,20),(770,15000,225),(771,4669,3),(772,NULL,120),
      (773,14127,6),(774,0,0),(775,0,5),(776,75,6),(777,120,20),(778,249,173),
      (779,0,32767),(780,110,0),(781,0,0),(782,5,NULL),(783,2,NULL),(784,0,0),
      (785,171,0),(786,64,2),(787,NULL,4),(788,NULL,7),(789,0,1),(790,NULL,8),
      (791,9939,NULL),(792,208,50),(793,0,164),(794,56491,7675),(795,813,127),
      (796,140,31328),(797,119,32767),(798,128,NULL),(799,969,0),(800,NULL,4),
      (801,65535,3),(802,0,32767),(803,0,0),(804,47,75),(805,78,40),(806,0,7),
      (807,6259,32767),(808,39672,32767),(809,NULL,0),(810,127,99),(811,10,1),
      (812,7,5),(813,0,212),(814,212,NULL),(815,0,23374),(816,41,0),(817,0,0),
      (818,NULL,231),(819,91,23640),(820,88,NULL),(821,65535,NULL),(822,2,49),
      (823,8,NULL),(824,NULL,NULL),(825,9883,32767),(826,1433,NULL),(827,0,2),
      (828,65535,151),(829,NULL,NULL),(830,225,174),(831,NULL,71),(832,35,74),
      (833,0,22862),(834,NULL,32767),(835,0,32767),(836,0,NULL),(837,NULL,10),
      (838,0,32767),(839,0,0),(840,NULL,0),(841,535,0),(842,0,0),(843,NULL,7),
      (844,4,0),(845,10,NULL),(846,8920,31433),(847,NULL,230),(848,65535,209),
      (849,0,NULL),(850,65535,19224),(851,0,NULL),(852,0,11038),(853,NULL,49),
      (854,2,32767),(855,NULL,NULL),(856,NULL,0),(857,NULL,10),(858,NULL,225),
      (859,0,3),(860,41802,NULL),(861,204,0),(862,NULL,2322),(863,NULL,21014),
      (864,NULL,0),(865,6467,0),(866,9,9),(867,0,NULL),(868,0,NULL),(869,0,8),
      (870,0,NULL),(871,0,0),(872,127,99),(873,0,0),(874,140,47),(875,NULL,0),
      (876,3,3887),(877,244,32767),(878,19638,6998),(879,0,27),(880,0489,192),
      (881,0,140),(882,125,115),(883,NULL,0),(884,8,7),(885,5,9),(886,NULL,3),
      (887,236,24843),(888,6,32767),(889,35796,NULL),(890,9,767),(891,NULL,9),
      (892,14,217),(893,0,32767),(894,31135,7),(895,163,32767),(896,177,2127),
      (897,0,0),(898,82,207),(899,5,NULL),(900,0,6),(901,NULL,0),(902,NULL,7),
      (903,12951,23528),(904,0,8),(905,0,15284),(906,9,228),(907,61098,20907),
      (908,26872,136),(909,29292,14),(910,65535,0),(911,NULL,3),(912,10,NULL),
      (913,16943,36),(914,3,6),(915,65535,15627),(916,149,31158),(917,7,2767),
      (918,535,61),(919,0,0),(920,NULL,NULL),(921,0,NULL),(922,0,8),(923,0,7),
      (924,0,0),(925,236,15926),(926,8,6),(927,8,NULL),(928,0,0),(929,NULL,7),
      (930,NULL,8),(931,2,2),(932,76,229),(933,5,NULL),(934,4,NULL),(935,0,7),
      (936,6580,211),(937,7,NULL),(938,65535,32767),(939,0,NULL),(940,0,8484),
      (941,0,122),(942,234,NULL),(943,4,184),(944,5,6),(945,3187,5),(946,2,0),
      (947,NULL,32767),(948,3,25652),(949,31,NULL),(950,0,11632),(951,46,120),
      (952,31176,5080),(953,NULL,1),(954,194,4),(955,0,7),(956,5,9),(957,0,0),
      (958,0,27380),(959,6,26316),(960,3,67),(961,5,0),(962,0,0),(963,NULL,1),
      (964,65535,0),(965,NULL,364),(966,0,9),(967,4,0),(968,1,0),(969,6,NULL),
      (970,9,130),(971,63,0),(972,13945,0),(973,7,0),(974,124,2),(975,21,238),
      (976,154,2),(977,8,23),(978,5,1),(979,44655,252),(980,0,9),(981,NULL,3),
      (982,6,0),(983,0,32767),(984,0,19246),(985,10,0),(986,9,0),(987,NULL,0),
      (988,119,0),(989,110,32767),(990,0,8),(991,65535,0),(992,0,3),(993,8,1),
      (994,43787,NULL),(995,18717,9888),(996,42055,0),(997,14701,6),(998,0,0),
      (999,0,NULL),(1000,137,0),(1001,0,0),(1002,122,NULL),(1003,65535,30960),
      (1004,0,NULL),(1005,9,32767),(1006,0,32767),(1007,0,230),(1008,120,255),
      (1009,4114,7),(1010,0,0),(1011,3,0),(1012,NULL,0),(1013,0,7),(1014,3,0),
      (1015,2,10499),(1016,35880,0),(1017,65535,0),(1018,0,5),(1019,NULL,723),
      (1020,0,7),(1021,NULL,0),(1022,5,0),(1023,0,9),(1024,1,3),(1025,0,NULL),
      (1026,0,NULL),(1027,247,7),(1028,65535,32767),(1029,NULL,6),(1030,0,42),
      (1031,85,4),(1032,64,0),(1033,7,NULL),(1034,30693,1000),(1035,47450,72),
      (1036,0,21436),(1037,0,5),(1038,65535,NULL),(1039,NULL,NULL),(1040,3,0),
      (1041,NULL,1),(1042,0,NULL),(1043,56929,0),(1044,2152,5),(1045,NULL,10),
      (1046,65535,0),(1047,NULL,23119),(1048,59037,16),(1049,81,0),(1050,0,0),
      (1051,65535,32767),(1052,0,19180),(1053,248,9),(1054,23,6),(1055,35,21),
      (1056,0,8278),(1057,0,155),(1058,NULL,2767),(1059,NULL,NULL),(1060,0,0),
      (1061,NULL,2618),(1062,65535,239),(1063,0,58),(1064,0,2767),(1065,81,4),
      (1066,7,0),(1067,107,0),(1068,0,0),(1069,21363,11259),(1070,NULL,18726),
      (1071,NULL,0),(1072,0,0),(1073,4,24204),(1074,251,32767),(1075,NULL,52),
      (1076,6,3),(1077,NULL,6),(1078,0,530),(1079,10,6),(1080,0,6),(1081,6,7),
      (1082,NULL,114),(1083,0,0),(1084,61,NULL),(1085,0,158),(1086,2340,NULL),
      (1087,NULL,2),(1088,61,0),(1089,2,20583),(1090,0,NULL),(1091,NULL,2767),
      (1092,3,0),(1093,0,0),(1094,9,128),(1095,65535,1),(1096,0,5),(1097,0,6),
      (1098,24836,32767),(1099,NULL,0),(1100,4,NULL),(1101,5,9),(1102,NULL,0),
      (1103,0,2),(1104,34413,6),(1105,64776,NULL),(1106,7,638),(1107,10,1861),
      (1108,128,105),(1109,61156,3),(1110,114,85),(1111,7581,7),(1112,NULL,0),
      (1113,0,1),(1114,0,0),(1115,0,0),(1116,158,67),(1117,5,0),(1118,0,NULL),
      (1119,143,NULL),(1120,729,203),(1121,9,32767),(1122,4,NULL),(1123,0,10),
      (1124,56808,3),(1125,0,15373),(1126,0,32767),(1127,231,9),(1128,32,233),
      (1129,0,251),(1130,0,5),(1131,NULL,0),(1132,NULL,NULL),(1133,21221,230),
      (1134,211,3),(1135,0,95),(1136,0,NULL),(1137,27,NULL),(1138,65535,2320),
      (1139,4,0),(1140,0,8),(1141,30,239),(1142,NULL,NULL),(1143,65535,10725),
      (1144,NULL,16),(1145,NULL,NULL),(1146,3,6),(1147,104,3),(1148,100,NULL),
      (1149,20,8825),(1150,0,244),(1151,47941,0),(1152,8,10410),(1153,72,232),
      (1154,8,20320),(1155,0,145),(1156,226,0),(1157,10,NULL),(1158,236,NULL),
      (1159,NULL,0),(1160,7,0),(1161,NULL,19781),(1162,20,10),(1163,NULL,222),
      (1164,52446,0),(1165,0,1),(1166,74,0),(1167,6,8),(1168,7,34),(1169,5,6),
      (1170,65535,32767),(1171,0,NULL),(1172,0,0),(1173,NULL,3),(1174,3223,0),
      (1175,56,0),(1176,44,112),(1177,9,249),(1178,42057,16666),(1179,NULL,6),
      (1180,158,NULL),(1181,6,0),(1182,0,2),(1183,65535,NULL),(1184,130,NULL),
      (1185,25,NULL),(1186,34,0),(1187,0,0),(1188,35,7),(1189,6,8),(1190,9,7),
      (1191,0,7),(1192,3,29704),(1193,65535,1),(1194,46218,20493),(1195,0,48),
      (1196,NULL,0),(1197,0,31),(1198,0,0),(1199,535,0),(1200,8,0),(1201,0,9),
      (1202,0,32767),(1203,NULL,0),(1204,4,22234),(1205,60040,0),(1206,185,7),
      (1207,428,6),(1208,NULL,2),(1209,221,NULL),(1210,8,4),(1211,NULL,32767),
      (1212,0,NULL),(1213,NULL,8),(1214,65535,NULL),(1215,0,7),(1216,65535,4),
      (1217,0,7),(1218,134,23759),(1219,0,123),(1220,NULL,0),(1221,14533,628),
      (1222,7,11143),(1223,NULL,8),(1224,163,13),(1225,16,NULL),(1226,NULL,0),
      (1227,NULL,0),(1228,NULL,2),(1229,0,NULL),(1230,7,20),(1231,16224,2320),
      (1232,0,7438),(1233,69,0),(1234,1,0),(1235,535,0),(1236,2,7),(1237,3,0),
      (1238,28915,8162),(1239,87,NULL),(1240,14863,17),(1241,70,0),(1242,2,0),
      (1243,0,163),(1244,10,0),(1245,206,3),(1246,NULL,19581),(1247,244,NULL),
      (1248,0,25954),(1249,31,8),(1250,183,32767),(1251,NULL,32),(1252,0,240),
      (1253,63394,32767),(1254,8,NULL),(1255,62,32767),(1256,24,0),(1257,1,4),
      (1258,62023,8254),(1259,NULL,0),(1260,NULL,0),(1261,0,4554),(1262,0,22),
      (1263,NULL,7),(1264,2,0),(1265,9,0),(1266,NULL,0),(1267,6,0),(1268,1,0),
      (1269,65535,0),(1270,65535,22903),(1271,208,0),(1272,0,50),(1273,142,1),
      (1274,NULL,538),(1275,2,NULL),(1276,32267,767),(1277,0,2),(1278,NULL,0),
      (1279,NULL,2),(1280,0,0),(1281,4,7),(1282,6,0),(1283,0,1),(1284,5,NULL),
      (1285,NULL,24758),(1286,53608,67),(1287,243,7),(1288,3,2),(1289,0,NULL),
      (1290,36145,4),(1291,0,5872),(1292,0,898),(1293,50,NULL),(1294,234,230),
      (1295,116,13958),(1296,8,0),(1297,NULL,0),(1298,65535,28),(1299,NULL,0),
      (1300,199,0),(1301,NULL,0),(1302,181,161),(1303,136,5),(1304,NULL,NULL),
      (1305,NULL,NULL),(1306,9,2132),(1307,0,32767),(1308,141,0),(1309,0,621),
      (1310,11766,0),(1311,4,0),(1312,4,32767),(1313,65535,0),(1314,17,26198),
      (1315,61,32767),(1316,80,8),(1317,NULL,0),(1318,8,18139),(1319,124,430),
      (1320,NULL,32767),(1321,74,188),(1322,11845,0),(1323,9,NULL),(1324,0,0),
      (1325,77,4),(1326,NULL,6),(1327,171,7),(1328,0,4),(1329,7,2),(1330,2,6),
      (1331,NULL,22),(1332,65535,32767),(1333,0,4),(1334,5,8),(1335,25283,17),
      (1336,7,3287),(1337,2,NULL),(1338,65535,12676),(1339,0,229),(1340,5,10),
      (1341,17249,114),(1342,0,0),(1343,NULL,133),(1344,NULL,198),(1345,0,14),
      (1346,NULL,3),(1347,45534,8),(1348,16,NULL),(1349,NULL,0),(1350,NULL,0),
      (1351,0,222),(1352,49162,0),(1353,6,0),(1354,1130,9190),(1355,NULL,133),
      (1356,0,NULL),(1357,0,NULL),(1358,NULL,NULL),(1359,58446,0),(1360,88,1),
      (1361,33382,0),(1362,9,0),(1363,7,154),(1364,65535,NULL),(1365,NULL,20),
      (1366,0,22070),(1367,4,12321),(1368,0,61),(1369,63159,NULL),(1370,5,41),
      (1371,41,10772),(1372,0,NULL),(1373,0,32767),(1374,123,3),(1375,18,113),
      (1376,0,25491),(1377,56,16029),(1378,1,564),(1379,NULL,7),(1380,NULL,0),
      (1381,6,221),(1382,NULL,0),(1383,NULL,14),(1384,30237,59),(1385,NULL,0),
      (1386,8,NULL),(1387,3,0),(1388,1,7),(1389,0,0),(1390,NULL,9),(1391,0,8),
      (1392,2,NULL),(1393,5863,5),(1394,0,7),(1395,0,7),(1396,1,0),(1397,5,6),
      (1398,58358,0),(1399,5,0),(1400,NULL,NULL),(1401,4,110),(1402,232,7521),
      (1403,9,5),(1404,NULL,0),(1405,0,0),(1406,0,0),(1407,1,NULL),(1408,2,8),
      (1409,0,105),(1410,0,NULL),(1411,166,32767),(1412,101,21352),(1413,0,0),
      (1414,8,30280),(1415,65535,0),(1416,0,8),(1417,9420,NULL),(1418,NULL,1),
      (1419,65535,0),(1420,NULL,0),(1421,65535,2767),(1422,0,7),(1423,0,NULL),
      (1424,NULL,NULL),(1425,127,32767),(1426,8,7),(1427,NULL,0),(1428,234,0),
      (1429,22188,76),(1430,21,0),(1431,NULL,19296),(1432,53,2),(1433,NULL,3),
      (1434,54,0),(1435,NULL,NULL),(1436,NULL,0),(1437,5,5),(1438,10298,NULL),
      (1439,0,64),(1440,NULL,5),(1441,0,450),(1442,0,4),(1443,4,0),(1444,0,0),
      (1445,9,2),(1446,2,30733),(1447,101,13229),(1448,0,NULL),(1449,10,NULL),
      (1450,7,253),(1451,6,NULL),(1452,NULL,188),(1453,NULL,6374),(1454,0,67),
      (1455,0,0),(1456,0,0),(1457,0,0),(1458,7,0),(1459,0,NULL),(1460,NULL,3),
      (1461,0,0),(1462,0,2767),(1463,0,4),(1464,7,7),(1465,5,NULL),(1466,3,0),
      (1467,183,0),(1468,55684,0),(1469,5,157),(1470,0,NULL),(1471,65535,984),
      (1472,0,13368),(1473,4,246),(1474,51817,117),(1475,35,NULL),(1476,32,9),
      (1477,0,NULL),(1478,0,0),(1479,35391,5),(1480,65535,0),(1481,65535,235),
      (1482,1,4),(1483,196,32767),(1484,4,28617),(1485,0,32767),(1486,6,NULL),
      (1487,60448,166),(1488,130,2314),(1489,9,0),(1490,1,NULL),(1491,7,NULL),
      (1492,NULL,2767),(1493,50868,7),(1494,0,27),(1495,NULL,0),(1496,NULL,2),
      (1497,9,NULL),(1498,NULL,32767),(1499,0,9),(1500,16,NULL);
       
      INSERT INTO t_desc SELECT * FROM t_asc;
       
      SELECT * FROM t_asc WHERE b = 255 AND a IS NULL;
      SELECT * FROM t_desc WHERE b = 255 AND a IS NULL;
       
      DROP TABLE t_desc, t_asc;
      

      The table with ascending PK returns a row. The table with descending PK does not:

      preview-10.8-MDEV-13756-desc-indexes 8c004b8f1d

      SELECT * FROM t_asc WHERE b = 255 AND a IS NULL;
      pk	a	b
      29	NULL	255
      SELECT * FROM t_desc WHERE b = 255 AND a IS NULL;
      pk	a	b
      DROP TABLE t_desc, t_asc;
      

      Not reproducible with index_merge=off.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              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.