Skip to content

incorrect query result using tiflash #56173

@wjhuang2016

Description

@wjhuang2016

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t4f752381` (
  `col_84` double NOT NULL DEFAULT '7963.446089530935',
  PRIMARY KEY (`col_84`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `t4f752381` VALUES(7308.317427630863),(7286.125599800909),(5665.897534377155),(1860.600827669093),(5239.924698492964),(5474.786681302416),(7145.109819918936),(4892.91486481474),(3902.3910726741133),(5543.99967209901),(3269.7484327172638),(2512.243623238321),(3903.5329413232585),(1697.3601667906523),(736.2973285027063),(8501.460124553165),(4041.146836592681),(2517.289387520804),(7662.081285351392),(9914.48608993605),(17.02105052235986),(5845.929962163885),(784.1697107396376),(9382.509995531178),(6228.580145158482),(5725.646685741635),(2523.048623301618),(3398.8160070323447),(7824.684029838521),(7738.620129960638);

CREATE TABLE `t9d8bedfb` (
  `col_4` json DEFAULT NULL,
  `col_5` datetime NOT NULL DEFAULT '2031-03-20 00:00:00',
  `col_6` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  `col_7` date NOT NULL DEFAULT '2021-02-20',
  PRIMARY KEY (`col_6`(2),`col_5`) /*T![clustered_index] CLUSTERED */,
  KEY `idx_5` (`col_5`,`col_6`(5)),
  KEY `idx_6` (`col_6`(5)),
  UNIQUE KEY `idx_7` (`col_6`(4),`col_5`,`col_7`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `t9d8bedfb` VALUES('[3823207007103953128, 3521659414669231622, 603681004249945696]','2008-03-31 00:00:00','%@dQFgiHZq','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','%gKSn','2000-10-23'),('[1258034336034663004, 8519705967827423825, 8440203252631635833, 6777885057568481590]','2029-05-26 00:00:00','&vd','1978-11-30'),('[6124600711957419751, 7435283962184760671, 6955712530425243058]','1974-09-02 00:00:00','(ZuIu~uF%LK!HV+!','2030-10-03'),('[4772518407846627162, 1238027569028631284, 2063390360436765112, 148746451875279651]','2021-12-19 00:00:00','+jUL51X-&L~%$g#p','1971-09-05'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','-37','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','-AMCE9ZxM&u9-3(FoiU','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','3s2zKF+m','2000-10-23'),('[2, 3700628637908574041, 4629163391738847761, 2475065351568534368, 3302061369087435246]','1987-11-05 00:00:00','91nHC#Ceu3l','2019-10-14'),('[2257310573072974120, 5534891517598033450, 749041761366921108]','2003-03-05 00:00:00','=MbjhdMbmU1kur7','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','A(B_lG=UPS^_1!h$1X','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','A+2Opb&(YL!Qzipq','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','ADRYV8B7gMGXc1Wn','2000-10-23'),('[1336585235067508756, 347769040778416317, 1808234183492636802]','1992-06-23 00:00:00','AvY5kIrpq7b_jAXchP2','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','Cb%O7kFLade32ClEo-8','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','El5(+UD3r%Z','2000-10-23'),('[7364323960479768747, 8554247212835118690, -9223372036854775808, 894016727057775158]','1990-02-02 00:00:00','F','2000-10-23'),('[6301734481466030866, 3331061268276480179, 2751705280420411487, 170902329290927303]','1990-12-29 00:00:00','F-fI0+c_HH','2000-10-23'),('[-9223372036854775807, 7341680929414713407, 1]','1984-08-27 00:00:00','GF(!h@X*ag','2000-10-23'),('[1]','2022-08-07 00:00:00','JVBbfk$F','2006-09-13'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','N5LxjU3&WO#@','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','NwNU','2000-10-23'),('[619522859061628475, 5325258998393808522, 3780004921925370218]','2030-05-15 00:00:00','O2A','2000-10-23'),('[6680739630567195494]','2028-02-24 00:00:00','OJ^Fvbku)Z0','1988-07-17'),('[1927916345662391968, 3031157399134681956, 9037265087086485093, 9223372036854775807, 7305829863390571285]','2008-05-22 00:00:00','P9z4A^C=','2000-10-23'),('[4310682512717636261, 3158680371582354758, 6003006996642915917, 1212905306257550674, 3988304947067061314]','1991-02-26 00:00:00','SVPWbP+)','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','SvYcEF2qL7w)yZ63zVq','2000-10-23'),('[8438924761655609198, 6437537405665148658]','2024-01-15 00:00:00','ToYIPQ9_IYbO!5T','2022-09-11'),(NULL,'1988-09-09 00:00:00','i&Tqt*CO#n_tO%3SpX','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','isVmW3%II&2djX','2000-10-23'),('[1471382583821350205, 7473809970765496862, 9127327793696368034, 5057380129306389251, 3374255477286837606]','1997-11-26 00:00:00','kB9!&^Arduea0f','2010-08-04'),('[7392026808512571304, -1, 8383774031805333773, 4166773374314266455]','2006-08-22 00:00:00','lnDP+%NBud*BSTJe','1972-12-02'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','ot_8ioQ#Dx%EAb','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','pFizzPw)_a','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','sUm#m)UP_','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','t6F!xc1bkURAz%','2000-10-23'),('[7258638647232089245, 3865338076838745846, 1401158343473850290]','1988-09-09 00:00:00','zRy$7AK=T2Nw','2000-10-23');

SELECT /*+ read_from_storage(tiflash[ t9d8bedfb ]) */ `t4f752381`.`col_84` AS `r0` FROM (`t4f752381`) JOIN `t9d8bedfb` WHERE `t9d8bedfb`.`col_4`<'[4463142022109750732]';

2. What did you expect to see? (Required)

Empty row.

3. What did you see instead (Required)

mysql> SELECT /*+ read_from_storage(tiflash[ t9d8bedfb ]) */ `t4f752381`.`col_84` AS `r0` FROM (`t4f752381`) JOIN `t9d8bedfb` WHERE `t9d8bedfb`.`col_4`<'[4463142022109750732]';

...

1080 rows in set (0.01 sec)

mysql> SELECT /*+ read_from_storage(tikv[ t9d8bedfb ]) */ `t4f752381`.`col_84` AS `r0` FROM (`t4f752381`) JOIN `t9d8bedfb` WHERE `t9d8bedfb`.`col_4`<'[4463142022109750732]';
Empty set (0.00 sec)

4. What is your TiDB version? (Required)

3d42e34

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.component/tiflashfuzz/randomtestimpact/inconsistencyincorrect/inconsistency/inconsistentseverity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions