Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect hash join result #55816

Open
wjhuang2016 opened this issue Sep 3, 2024 · 1 comment
Open

incorrect hash join result #55816

wjhuang2016 opened this issue Sep 3, 2024 · 1 comment

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `t9fe6c478` (
  `col_88` tinyint(4) NOT NULL DEFAULT '-25',
  `col_89` tinyint(4) NOT NULL DEFAULT '84',
  `col_90` varbinary(445) NOT NULL,
  PRIMARY KEY (`col_89`,`col_90`(5)) /*T![clustered_index] NONCLUSTERED */,
  UNIQUE KEY `idx_23` (`col_89`,`col_88`,`col_90`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
PARTITION BY RANGE (`col_89`)
(PARTITION `p0` VALUES LESS THAN (-114),
 PARTITION `p1` VALUES LESS THAN (-92),
 PARTITION `p2` VALUES LESS THAN (51),
 PARTITION `p3` VALUES LESS THAN (MAXVALUE));
INSERT INTO `t9fe6c478` VALUES(54,117,x'71774f31754e522655'),(92,77,x'7a6a5128425e23237a40443d69246e55'),(54,117,x'786b6b67593423623659347a53'),(-61,127,x'6f45672d7a5458256e4a757730535f25'),(98,89,x''),(54,117,x'55492a5f4d7a6d2b7a4c495f467e5a506b69'),(54,117,x'62346a62287e306e'),(54,117,x'697e21597859494035562664294b6c37297226'),(54,117,x'4176445e6e7671403d436e5a5944662a67'),(54,117,x'436d5e72595470733d6a43487178617e73'),(54,117,x'68266343625929'),(54,117,x'4f397855703467546b6f25'),(54,117,x'334c33354823'),(54,117,x'726e4442583878533d7948492459'),(54,117,x'4a4d6e374065385272397e5f6b7772707457'),(54,117,x'4f3d633d42'),(54,117,x'617e48466f4e3633'),(54,117,x'266f76252a396f5832745e615674444d4a2d6f'),(54,117,x'452930564a577357432951474373596a54'),(54,117,x'4b3328512b53303872474f7e72642530'),(54,117,x'7e52695e266768504c5972456f72412d424232'),(54,117,x'352b3d772631596428626a2b472d4965'),(54,117,x''),(54,117,x'434e776e235368422d'),(54,117,x'446a5f53746b747465613d694825573268'),(54,117,x'7935342d59702b506a636965'),(91,62,x'414262496d4136595f6a435a40'),(-21,-104,x'53246f68375e25562d51504455722641'),(90,-73,x'48672132'),(-101,127,x'51'),(43,117,x'443943664b4742'),(105,-65,x'25403738582623253d517729'),(81,-92,x'4329646729262d5a2677395369453d4042'),(-94,15,x'53486932566e28352b2a7668634678'),(94,-41,x'376321735947505e507073'),(37,-49,x'506b2a756f616d2832466f2141'),(-62,-128,x'51'),(124,50,x'61556c3d23396a58502979663468625a5144'),(-127,-75,x'7a3d546661772550257437'),(-25,6,x'36365428'),(-8,40,x'6f357a26444a665f5379'),(114,17,x'5337'),(-91,-74,x'767e7671652a2b4f65342b5f475e37534d4f'),(86,56,x'776864542350'),(-65,76,x'57'),(-85,44,x'4b77313d79'),(-31,-121,x'79456e4c364966344f4b334a7e6b366b364e'),(-111,58,x'236a5969'),(-61,-76,x''),(114,65,x'26527937'),(86,-89,x'6247794572334c366e37763150'),(45,0,x'76376a5979614e217e5535792d4d294550'),(-74,-69,x'53'),(-128,78,x'5334325e73'),(75,127,x'584471774e2664626f24727a44'),(-113,-51,x'4b38576d4e5267'),(49,-73,x'77633d24494a2531'),(34,86,x'7a5041445f4d7a74545f70236e'),(2,0,x'6d3854553466616c5239406d58615345'),(20,107,x'4a'),(89,-58,x'5924325175634a285e42686c557a5e'),(-80,-81,x'554e3d237e2166763879704f41'),(78,103,x'716a'),(-82,32,x'74596b662b522a5f7172'),(-119,-46,x'6737'),(0,-38,x'477974256c6477774324356221657152502d'),(-27,81,x'334b575f724352714841625061477169'),(-65,-49,x'4a23'),(108,99,x'536d542b484463476675'),(-20,115,x'397750333d6c516629696d3425316535'),(-41,69,x'302935236b632a37366f2b566d2a6b434f51'),(-99,120,x'685725505043736d546a4f5341424f'),(-127,41,x'5f514d692467485836484f25527e3025'),(90,27,x'33646d596643'),(70,99,x'77422a'),(0,-8,x'53256b462654532826'),(-115,77,x''),(108,79,x'4f7e4b'),(-8,-128,x'555f6c51246357475474322940326a'),(-96,-50,x'502359267025714d58'),(68,91,x'57265455287a4262457037567775574e'),(9,-121,x'3926453d2d'),(74,115,x'484d677a444d'),(-5,-128,x'58737479384b5e7e55234e57'),(-1,56,x'4a45766b3d594c4556'),(13,-10,x'5e3334384f737a585834415474562d4e7e33'),(-127,-96,x'434b2957634f704731'),(-31,61,x'3369'),(-1,1,x'297a33766c215372664d'),(-8,72,x'3477436f66796644636b766d33376542'),(24,-6,x'317175786f5e6b6a7e3968415750'),(45,-9,x'79663071666f2841356b5e31693d'),(112,2,x'6b'),(-25,21,x'467476663d'),(-87,-123,x'766156'),(-80,-128,x'29682d3442453932446c515a37777a5968'),(90,2,x'73466c7353315a6864615556334b'),(83,58,x'43496a5a66524e5250456467'),(29,32,x'5f75466b6f28292b'),(-112,70,x'6e392629614b42'),(-70,-108,x'366875736959745062723d4f2d2b'),(115,109,x'66395028744648214d');

CREATE TABLE `tlcab6ba93` (
  `col_1` tinyint(4) DEFAULT NULL,
  `col_2` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `col_3` json NOT NULL,
  `col_4` float DEFAULT NULL,
  `col_5` varchar(211) COLLATE utf8mb4_bin NOT NULL,
  `col_6` json NOT NULL,
  `col_7` mediumint(9) NOT NULL,
  `col_8` varchar(324) COLLATE utf8mb4_unicode_ci NOT NULL,
  `col_9` int(10) unsigned NOT NULL DEFAULT '4284238705',
  `col_10` timestamp NOT NULL DEFAULT '2020-06-24 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
PARTITION BY HASH (`col_1`) PARTITIONS 7;
INSERT INTO `tlcab6ba93` VALUES(77,3,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'lFuaPXKsJ0#xG(','[7060970018858811551, 14606948945312851102, 6845143735170145610, 11659345294203643863, 1]',-4745772,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(118,18,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'kD9Ef#VhAr#H1ABbkR','[9379384491249884634, 3754855411214213279]',-7573781,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(90,188,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'oSd+zf5w1rkXU','[11336388383968930702, 13979105611786765184, 17514665857711819688]',6791744,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(37,201,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'u8DMpt~dTsKk(^L5','[0, 1976640698621473082]',-3998109,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(-9,233,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'kGfP%52+@CAtI','[18056223234077203041, 2020675413027482411]',-7102456,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(87,31,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'oEw!!*bxMjGXUR3j+ls','[7530198234299318668, 11585443538052146898]',7424590,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(-50,108,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'qB)~aKFpG+','[4423262452828065836]',7107248,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(-87,119,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'motD2)W5*#','[5019423993043206941, 14489574764535099431, 3370580710797700473, 4283101343462827105]',7235130,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(4,142,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'ucAtWsR=','[17865503902468513043]',-7310753,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(1,92,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'yd_wN3FiZ','[13357977074170452120, 15063708380992979440, 10201725148146752152]',-3790669,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(75,115,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'n#o','[7520487931116149729]',4544712,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(115,61,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'pvpZJ','[5286837235001687277, 6853874299338684112, 11266340332312249143]',0,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(-103,122,'[\"mnpCe7Yu7ySXRrxDavk5OuanA7qX3gJEZZFz8saHFl5Ckk7KjntK3fp0Ftv8Bequ\"]',467.6095,'o2~RpygepoN@!#rq$','[12399576291288160190, 5036257119492826923]',176052,'f9Z)sInsgw5IDh',778668877,'2017-04-25 00:00:00'),(-33,255,'[\"WAjngpJ56IjXlUQANQx7crHWa14i4nNnpckAjmXGxY8YTtuCzbd3OoA2cIijPuDu\", \"gDtE0TQe9k2TAQUJGEdWOsRUQWwRevGcZyIaTJVEzrub4gjlmk8XXLajgPIpkrNz\", \"DedYq7D56nwYXAPpCTymnzC0Vuuk7dyth80K4hbtGQlcGAKFDs4F0FcQsrfluKlV\", \"HYuPxj1GGaEPpFkHwBaG14YEspgjVmABmAun2cSyapjmnEeUHsyOTZfwvQzBu2zJ\"]',467.6095,'r4v@dq-d+@gOtC~','[17379938033533255328, 880149080403154188]',-6368034,'%',218028632,'2017-04-25 00:00:00'),(-66,194,'[\"kYWHdsuKAN7lESxPdi7WRwKzPey01PiG3w6nL3vAgYtoZXzjJclcKQ1RkHWKeUs6\", \"ZpajOCKQzKJ1tlnDiZISVt7sQSxc54V80RnkvyORVt0jXNUqRYR82wGAnX6pAVwQ\", \"T9oeAJfOTz57xn1a7vBOVSbqQCRVLQLzqEFCYiNUI1VfUVxCf67L4GUvZ9a0n3cr\"]',467.6095,'k*fWRag','[781179011523313505, 5077952638805215753]',2702429,'K',19984898,'2017-04-25 00:00:00'),(6,134,'[\"RQZMiivV2Z3Y40EMjT3WEmcpJxTfI6PXaXGkMKfvM5d3I8L7GBuQ9PzsSn28HV6l\"]',467.6095,'rdX','[7678921619409862775, 18295825117630744667, 7771409492022364765, 1303333005175640092]',5658604,'jy4f',1005582752,'2017-04-25 00:00:00'),(-47,127,'[\"GDIRQxgR6axZTF0Nq7SbFM7EoDAoQqo9PjUwEqoQqSLXfvtpkP9YYDJJUOiSUwcy\"]',467.6095,'xo!(CXR%1+','[1553127195376265814, 1209173185221716123, 3107995635793143809]',-3839134,'O^~H&ic=^kSC',757840461,'2017-04-25 00:00:00'),(-127,220,'[\"1ownIAB1EWqGvhwdtZ6YU10O6C9fKL1ZtpwXvAjtCbEYmhjTcxeIgdmrYQwVYn00\", \"VQlfPF9vsnVpfIBTcOLqMoAMwkv7iBQW3dQmIk5EkWZ8PoVBFYpuGMQbmqlH9Aa3\", \"ft2tjtub5TE9Zqb49PZBvKBRFzf5wakvza8alQpT2OhYhfsuhHn00hbfjGJU4g3T\"]',467.6095,'#-S&Y&','[7516499933591747634, 16926635960681898165, 9223372036854775808, 10570654751204123189, 18213935036204307411]',3279518,'miCQE(e_12',1798531588,'2017-04-25 00:00:00'),(4,191,'[\"V1qf1kW9FudqC9sQEsdyLVg7NJGQoEJHsZyGxLWQwrFnhuGt3CpqiKg41LSXPHyA\", \"jJubrMIUCQlRNulbuObiP5Nee92eKCdG4PMbWTfq0zDA9cKnQpuS6eDYT2J8Gm7J\"]',467.6095,'2lw=uL)C9ekKlY8','[6028750232230184058, 8615385538709794803, 16489299528530187379, 1825199712315573643]',2,'R',3901589599,'2017-04-25 00:00:00'),(127,154,'[\"yogMiCiaegGD8koZavst3EXMKy23M74fUfZlaFmGtxGhHMkjJZWLRJtrSzhY67iB\", \"w7heqYKXmEUl3G9QWRVGIQk7mfKFzeUW9uzP5c7iNK9WfpFPN0QOgJlLTJA6BUo5\", \"4nLTIkKjXthE4Q5uKMElizGmw14pviYYx6SErchEHe3J4caOJmAx4AFu16NfY13N\", \"kplBejQ7aH0RBSN1Ra4kc6MyoAh4J532szBSqQQdc1IhP3B8BEtOmQ1we7J1zk83\", \"WqbbaEgaGyedzTSo13zFKQSpiYIyfxTmg2rNihIJRi90UPLN3G58XmgnnKq308B7\"]',467.6095,'iAE9AL+XR','[6568345152114710349, 9223372036854775807, 11767922513281730518, 636359139877683634]',3240133,'JZ_w6D',2383193550,'2017-04-25 00:00:00'),(-91,129,'[\"n6LT5ZBsOUoNYSPC6jDE7UDQEOlYY4iMzeosjWZS2yvmBBd3izcI2cPnfnLFvYs1\", \"xwyp4Lv3CSULtruRLPmN8maCkcQt6KjVaxjP5lD9Xbd0WgYFJPi8Y7QXx0USD1NF\"]',467.6095,'DegD@n+REc))','[8540763271449540633, 11750756126653357549, 5501680722468027023, 5103990206957583125]',455894,'CEw6KBR)kmV_',2773739499,'2017-04-25 00:00:00'),(69,124,'[\"IqPX3Zg1rdBqZHVyBtSVJMOKPNNyRie8M7ovkPym1j2etLhyGQTAfTrrsGutGTCa\", \"70ESOQea3D23Zx1jFqKQlmMwwEwvInVbV4fytw1FZgeLdJAxFf1TXeX0eSv8kUfG\", \"kb1tusf18jeqJFKrm9dcebVU0RWCIGCLh321T8W4SLo633oIOAknB8TcGInx8K5u\", \"TaKCNP31DitpXPVAG0TyPt3WuQQiYtjaAgNcBMnkRIxn5MKFWMFpVXJTis6UR6DC\"]',467.6095,'Y7fT1vM','[13610869542257790043, 10589745516275574621, 13308847598961321194]',6543452,'9hF7h9',4252749979,'2017-04-25 00:00:00'),(3,153,'[\"Ea9Xis0Dg9DVKFkgUfe2AmBmQ2eEeq4JV49lH7aPcXpOePbGjiiZ0ATgrXSRZQJL\", \"MJ03BlJL5AOgPwgODEhHDshTB5nBEwIjgT29dLBTgBfDuVD2B3LKOdiUZtjq7aaH\", \"kKSi3YvhjQude0E2APx1XTV5ITktLknLN12A6RO3SWF69NiUb2AKmiAHHGsKYZ1J\"]',467.6095,'j&qxBf9w8(mb','[2, 3593676047800841803]',-8191525,'R2_',800826952,'2017-04-25 00:00:00'),(35,83,'[\"LPH0zWktplpkicWqmYf20ejSW2w0qGLSnQngJLTvCLmeeYuOn2vPFM7MizRIN1Ks\", \"xHTg201yzyM7KGuTAI8S6T72qp4qVlDYC8WYRMZfeWRuTeW1hXa9nOsWlAHc7I8r\", \"8NIyotwxvYzVUK2vPu8jSdh5N2LZAPwN7M853n8QfvLC1a5Y3I5BrcXRWVoQGqRc\", \"XpF6ayb1Z3IDvHuifPQCHLOWd7CvcxNu7ReAK1evHwubNE7a42SjSiq3XhtNCQXe\"]',467.6095,'KZQ!TGV','[10830490418993994568]',-1233230,'gUopcXS66t-',36542769,'2017-04-25 00:00:00'),(NULL,222,'[\"1WxUpiPdH42PMtUl3wmARgKE8Y2hoFLzCx0TYJqgvhEV7TD9osDgQGbR5iGlFQRT\", \"8rnH6AltwaDtc1a5BkUtdYcHpAex3sGdYhyddPBtbmKaWXcnHcF6TA6JzEV6TvoE\", \"3GICfigYUUqPsBEtcolm4AUTQfoxzJNNxkKSMtJqk3SO4NOECHhMWJADnDJWGVQR\"]',2424.005,'zVnSzwbD5','[9223372036854775807, 10729917094579226864, 14521944644553541722]',2594148,'',786364182,'2002-03-13 00:00:00'),(-13,218,'[\"AfEq7La7NATgeZLdRWLbIi7eppfBnQfZpz5jGuUQ3E9AcnR2Bnk5hZ0UkucDvgnP\", \"0E1Y508a5z6Ey71OeRFVZaPH8RmcnrBzgddfOejG3Nu8os5mhqTpk5numFe4cwnW\", \"N3V03bBMJv85YjfC1nKR0fiaXwccfrou0EnAIOD9Pd0hzVLmd9Y6h9yONmiZQBeQ\"]',6810.711,'^mjvaYb+LjG','[12741805671700683348, 5107225255766496957]',1083035,'v',2779943874,'2010-11-01 00:00:00'),(25,0,'[\"bR17bXKDldY7GGGzACe8P2m8aeFWfDGjm1n1PQFeeMOHPwdI6OgXFqQeH1Ok4Tor\", \"i2xWily95ce5Aw2ErHRpUfuaOTieb66GwHzBIGzeOjL0usQCSGKwQGz3MUO5Sjbc\", \"RSJDWojsux2kVZbmNUMOjLm8dSZVb63cSBn2Vc0H9V3QO3DDdcRHWeeNpRxuo5Ty\", \"BkkgLX917RAEVIlUxKVUBqy6Ekl63SDGNCt4NTi66WV6qQAbPvZOGIJjQm3cxGh0\"]',4851.986,'4gd-szq&l5gL','[0, 9223372036854775807, 18446744073709551615, 1749134590474675059, 7299202818311001159]',3750883,'~+-^~53',776712592,'2001-10-01 00:00:00'),(98,154,'[\"BQwQ6wVFtKi7VBVGYrHd2uJtP25bynUMAk0niDjKb0xzcDGt9UIDDyFxRQWldpyU\", \"cLVfyONNLI1tdH6RAAJoal7i7y473MBFWQ16c9mEQxKeBInIcBR7VCassLGOB6bz\"]',3748.0583,'J','[7932723605533923343]',-5242206,'k',1653713959,'2011-07-12 00:00:00'),(-63,169,'[\"HNeW9ghg4hBjhXnXMAycuwG7c45fIyodAdUIxvxJcG3gvTxvYlPAZtbwAhUe8fLH\"]',3055.2366,'','[1232103646125047630, 17535903094115047592]',-4494267,'QSAZ+kyf@',3002480252,'1977-01-29 00:00:00'),(14,130,'[\"RmBH0CzP9wcC1LzMkg71Y7o3LTvfNXc2AXUyRwugR20rxfiWo6tsaZHoH6437uGW\", \"nA7Fc9IoB0TXRBXoggrWzEq2jrGyIZJ2lVXyEv12zAnyU1877WtTtIEkaVY19nBg\", \"fJ3iEKirhaiPkvDQQZLLeFhU4VJBbTzUXMt2BPa2QJpFhNs1cGuaodL6t7xv7Jjs\", \"dYEy71gfqgA49s2Uks3rwSah4anZO3XaCzLWAnF5k9I2cX8ohCUa1vMVnE9BZDHM\", \"D3TQxhVlYJS0pNgWzVeRJuGPmjPPhZmIBBwSK1ayca2fvwAzkg1f2Sgav7Pwu47Y\"]',9763.432,'^vOCgqRldV','[6781071705683374538, 8984708622294631506]',3275368,'KzWRf!6_WKar-',1523317837,'2032-03-25 00:00:00'),(-70,44,'[\"YtMxrzOFA4dyGg0ugP8kgBqnR9MYlT2P5YQH2EbwHdYCVcMswHPfakjh8ebUhvF9\", \"HXfbESPkvY2aJvlplApBBa8mrYEqU3K5inzSoNiLIVhuFAXOltQBfy5IGTst7xWk\", \"Tca8W0sc3vjgnWGfa6f1M3LFKx8g4hUnSjwf5OQF6NzRQ7jt036uLqnubZ5XdC0f\", \"D6oE7aQDwWAMs3ut1pooKElD6CbBJc7PGOL3H8orcIlBJnnhp43sBXSPJpnSHykc\", \"svPbazmr4pPEEbi7QJxLvZ8LqEbtUYgsm3XsM6K7DVM7xtIFEIAd6PjQDbkQ2D73\"]',7315.118,'gsZO2j3!x6K','[2156049577720794915, 6810237245838917687]',7605508,'Or',2408348355,'2010-06-16 00:00:00'),(-16,129,'[\"zeHMtQ1cf5rL0u4iRvWGtoKRsbKUb9umPxu8IFRuvz8RDrTlvPqiuylLXQr4aZTN\"]',4917.5635,'L8POb~#5','[3479722901852579004, 13507914465813581053]',7413600,'IZo=s$oe(N=Z68N)(',485878597,'2024-07-14 00:00:00'),(127,206,'[\"tjgbWv6gA7Yb4tDwUcjY2Wpbpqt8VCtR9XWn88SQWoBcn5Mwvf3szb2tdwBw1P4X\", \"r4MVnwTL9XXq5d5SZQZOUhiUmnFJdtmWDKvuJV5wjiKBim7Y96X5cXcNCoFvPCta\", \"iOdqlI6vJgrCbYGSRNTvTrP7BqIi6KI6ur0LeUVxYMPX7rzPiI63IGttKRk4RIL8\", \"ozm3BhvslSHR4Jvks7mwvoInCsIjOH8lmLw5PVermCUtsipsKUtj3OzuxCFihPaa\"]',1656.0123,'u+qIHo','[4616015700297954040, 2432261401425492763, 6557823454328386609, 11856206866276568636, 4851961344502144551]',2761713,'Nx~~',1487362106,'1979-08-06 00:00:00'),(116,105,'[\"EwUF2eIHjQsQNHkW9LAhiVQsvTMf7UOp69qS7s2UK6UAd2qaVdIXw893lCYaoDJT\", \"ghXvMGH33SCbkOAGKp3IS4ywtyv9YYzzdovMC4eR9hK058Flr5o9dIotxSxjAFs9\", \"R0LbMF6IzSvL3RHgJVfZMCjJ3qYDBhpJBB1EcLp5tCQYRkaytme2cY8yC9XLDP5c\"]',8654.203,'~di7krs','[9439248462999193392, 2206797780779742962, 10431668948603488786, 5598182237124679812, 18446744073709551615]',6632807,'hBsv5l)976*Ai(8#',3284645376,'2021-09-04 00:00:00'),(92,13,'[\"Dy9ghi0X1j28xtg7JUfihjXilBVeRRFYP6AEwCZzOAcEGvO5DwQFSgrt0ceFT4wa\", \"3yCSyyigbeXnU1oTDQLLT7XGSiGc9AdJgfPsXDptVL5rw1b84VPacXDB1Li1ZwDs\", \"8bhReE7W4SsWvICE89aqoJX8shLjiOAeSDJca5yUQCIRxKCbzAisbDPlbTl4V2fR\"]',4002.3818,'g104V2RdkPAno9Z','[13289503904414524349]',-2680160,'1eTl0ukC-OCYAuW',2820365982,'1994-10-02 00:00:00'),(-10,158,'[\"IZm5FrvWUiH6HX0qpmcdqX9AMAtz9H3Qc9j1FyNfsvNdusaX8Qg4z8VnnXMV0sPm\", \"PPWlj7FWZpgxcXv2pNgW2o19gsOo0Lq9pqduv8usctNPXWRr3Kr7Ex3WzKkhF4jP\", \"5qZk7fdWv8e1UnRLXVqiR9x0oz0kJ8dWfJTKovSmP2fUB9AmmSASfXhyAaGfYOtz\"]',4297.007,'S-','[3512010779906060088]',4758415,'LSv#HkMiTbh+dx(urZ',2147483647,'1970-07-08 00:00:00'),(3,142,'[\"kMjd0JCkcPigObdOqVOFUMDslU1q410B5JSdmsH8zTtVuNOD15b2EbVLU8fv4EfK\", \"n2LTQUlNz1YkQhOgHiEsKFjcLmJ6S0KPXqXERSoXMoPXXbkIKeKInF1DJZqKS5RU\", \"5ggo0XVGm2rhkn2dq86gLSr2UZUJhgBA3gGKCjZhQU2szaVQCKxe5rYJPyoteF3M\", \"Ii31yNOomZRyhSlNuFt0ErVLmtGF1RJjjWpISM1Qq8gBio30RtDcAsEIqDeQ2ndI\"]',175.57368,'mMr!26t1t~l1-0','[9751326253905017283, 15577119031381539559, 17218666018028613447, 9787869347991736345]',-2135471,'qwYdYm_Il-sh=fv',3537010959,'2024-11-14 00:00:00'),(-127,0,'[\"pjJ1JI82rF8W9bZsNrjdmGScX7m5UzQ5e1eQvcOWfEtvSz29hxYqGcELKxdKIdZW\", \"YWiYirAHlKnK1NF9jaHxRjiBGCyiufsNBM6mAxSiTrhu6h4lw7ksTxIxbXhUPObb\", \"LQBIR6cSohY3JnoMsbgFDnCJV27Z9ACjRMWwVThNx33RuXIBTkgVCVztCYcvRV5b\", \"AsRrcSUYSsnlk0tZ6NaT8C0MwUV09yTaF1Sohhp9kgdFmr6dnNLQVqaX83wj0y5S\"]',1522.4563,'1l9^@8','[16107304975127552096, 14423753060869840290, 2699247242225446911]',-4370347,'',3075700811,'1985-12-16 00:00:00'),(-74,90,'[\"IJy5LHfIj6Umpv2BKtXe1wi2h4r0RaRagdWCaM2NMXDzTloW92wXgPqSt1QcK7Gw\"]',6528.084,'&n8mjZSzi6Jgk','[15759345823976514207, 6620784495680687297, 8588804599906549970]',1505681,'Lt',1817066510,'1996-05-17 00:00:00'),(113,185,'[\"4yQiGCdGlqNXOAgLrWktrvON3uKBF2O8zWJw1WGfBSw5ar77t122YfXeVXwy90uw\", \"1jFOhCI30ZJf6gWPYfaBNWUFTTRzV6qspFhFgp3NUjAfDwRpOnw5bZpkiP6gugFe\", \"x6AyRslS8zfzuxGOUN56Kw9PrkmSborlzY95TzLpSiITBuOql618rl3UgYQ3aCh2\"]',727.73956,'ct6h','[10981449768525348801, 10630822160649169961]',2232316,'4vHXHc',2347229978,'1977-06-30 00:00:00'),(-128,156,'[\"JsYyDmRqyTFvMKSP4Z0Nch1HuD7b6W2pH8X2mcnrtU4brxUEtrG1VgZYckmYmPfw\", \"pn7i5JKEG31AR9q9MlWMS7uiDaWS51IAOo8Nm3E61ePEburGsIGQAWcLvGmWICNK\", \"YGMVlxz7hxqO14Q9nOZfVVfzC4wT1orRQdJXTsfOtNa1S4HoyywqgQiVNWqqflmg\"]',2644.5884,'a+%','[5161031137924813189, 10131138420396973215, 15228810782982190689]',6780841,'r8R!Ym$Ru14*T',3032371485,'2006-06-21 00:00:00'),(-87,101,'[\"MdX8iy39R8MFuVkPqwftGfiJJnyUaid4hysNgsTZkQLJkxT9E3VXA80qUFxTdeaa\"]',7403.9546,'eTzsi%dUPG)r*Y','[16962526645235868768, 17204764692690358099, 3022306832305138222]',-6243069,'I#Q@GbIf',2135312767,'1986-02-12 00:00:00'),(100,4,'[\"IPlSDSqFhw0kDQyxZQw9wAQha2l3P0b5AsIYysKVeco1RBJ5bAYMDfJ5rPT2fFgi\", \"rm1rwZsJN2z7QLtKvUeBkQb2DwCJQN0xCssUtqazRf9xcybqNCObkKhxSOgfQffX\", \"HIrqp5TxTDPoc0ARtUaC4raLLNmMqUplpgy2Jez5Pe6IOQqKkljhnQxGXOGmil93\"]',8131.4336,'LsUY+f~sHY','[10775226549412927938, 13004755068531263131]',3985181,'nSB',2193083682,'2024-01-09 00:00:00'),(7,30,'[\"wd0k1SETuV4MwWRj1c9aIjMRUsDednOBF5EQoHP7EmOvBJLlZuDAkyDekXOtgfPt\"]',7978.493,'Zk^CQgR6IsroLU&O','[0, 2501797997549769331, 3106389822578135625, 8700848921227018261, 15087943670790657856]',-4575771,'SMQB$$!M',4147245176,'1986-05-16 00:00:00');

SELECT `t9fe6c478`.`col_88` AS `r0`,LOCATE(`t9fe6c478`.`col_90`, `t9fe6c478`.`col_90`) AS `r1`,`t9fe6c478`.`col_90` AS `r2` FROM `t9fe6c478` JOIN (SELECT /*+ USE_INDEX_MERGE(`tlcab6ba93` )*/ ORD(`tlcab6ba93`.`col_8`) AS `r0`,FORMAT(`tlcab6ba93`.`col_8`, 4) AS `r1` FROM `tlcab6ba93` GROUP BY `tlcab6ba93`.`col_8`) AS `st_317` ON `t9fe6c478`.`col_88`=`st_317`.`r0` WHERE `t9fe6c478`.`col_89`!=12 OR `t9fe6c478`.`col_90`=')n0siUC%ywFu9G' ORDER BY `r0`,`r1`,`r2`;

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

mysql> SELECT  `t9fe6c478`.`col_88` AS `r0`,LOCATE(`t9fe6c478`.`col_90`, `t9fe6c478`.`col_90`) AS `r1`,`t9fe6c478`.`col_90` AS `r2`, t9fe6c478._tidb_rowid, st_317.r1, st_317.`r0` as rr FROM `t9fe6c478` JOIN (SELECT /*+ USE_INDEX_MERGE(`tlcab6ba93` )*/ ORD(`tlcab6ba93`.`col_8`) AS `r0`,FORMAT(`tlcab6ba93`.`col_8`, 4) AS `r1` FROM `tlcab6ba93` GROUP BY `tlcab6ba93`.`col_8`) AS `st_317` ON `t9fe6c478`.`col_88`=`st_317`.`r0` WHERE `t9fe6c478`.`col_89`!=12 OR `t9fe6c478`.`col_90`=')n0siU' ORDER BY `r0`,`r1`,`r2`;
+-----+------+----------------------------------------+-------------+--------+------+
| r0  | r1   | r2                                     | _tidb_rowid | r1     | rr   |
+-----+------+----------------------------------------+-------------+--------+------+
|   0 |    1 | 0x477974256C6477774324356221657152502D |          66 | 0.0000 |    0 |
|   0 |    1 | 0x53256B462654532826                   |          76 | 0.0000 |    0 |
|  37 |    1 | 0x506B2A756F616D2832466F2141           |          36 | 0.0000 |   37 |
|  49 |    1 | 0x77633D24494A2531                     |          57 | 1.0000 |   49 |
|  74 |    1 | 0x484D677A444D                         |          83 | 0.0000 |   74 |
|  75 |    1 | 0x584471774E2664626F24727A44           |          55 | 0.0000 |   75 |
|  78 |    1 | 0x716A                                 |          63 | 0.0000 |   78 |
|  81 |    1 | 0x4329646729262D5A2677395369453D4042   |          33 | 0.0000 |   81 |
|  83 |    1 | 0x43496A5A66524E5250456467             |          98 | 0.0000 |   83 |
| 114 |    1 | 0x26527937                             |          50 | 0.0000 |  114 |
| 114 |    1 | 0x5337                                 |          42 | 0.0000 |  114 |
+-----+------+----------------------------------------+-------------+--------+------+
11 rows in set, 31 warnings (0.00 sec)

3. What did you see instead (Required)

mysql> SELECT  `t9fe6c478`.`col_88` AS `r0`,LOCATE(`t9fe6c478`.`col_90`, `t9fe6c478`.`col_90`) AS `r1`,`t9fe6c478`.`col_90` AS `r2`, t9fe6c478._tidb_rowid, st_317.r1, st_317.`r0` as rr FROM `t9fe6c478` JOIN (SELECT /*+ USE_INDEX_MERGE(`tlcab6ba93` )*/ ORD(`tlcab6ba93`.`col_8`) AS `r0`,FORMAT(`tlcab6ba93`.`col_8`, 4) AS `r1` FROM `tlcab6ba93` GROUP BY `tlcab6ba93`.`col_8`) AS `st_317` ON `t9fe6c478`.`col_88`=`st_317`.`r0` WHERE `t9fe6c478`.`col_89`!=12 OR `t9fe6c478`.`col_90`=')n0siU' ORDER BY `r0`,`r1`,`r2`;
+-----+------+----------------------------------------+-------------+--------+------+
| r0  | r1   | r2                                     | _tidb_rowid | r1     | rr   |
+-----+------+----------------------------------------+-------------+--------+------+
|   0 |    1 | 0x477974256C6477774324356221657152502D |          66 | 0.0000 |    0 |
|   0 |    1 | 0x53256B462654532826                   |          76 | 0.0000 |    0 |
|  37 |    1 | 0x506B2A756F616D2832466F2141           |          36 | 0.0000 |   37 |
|  49 |    1 | 0x77633D24494A2531                     |          57 | 1.0000 |   49 |
|  74 |    1 | 0x484D677A444D                         |          83 | 0.0000 |   74 |
|  75 |    1 | 0x584471774E2664626F24727A44           |          55 | 0.0000 |   75 |
|  75 |    1 | 0x584471774E2664626F24727A44           |          55 | 0.0000 |   75 |
|  78 |    1 | 0x716A                                 |          63 | 0.0000 |   78 |
|  81 |    1 | 0x4329646729262D5A2677395369453D4042   |          33 | 0.0000 |   81 |
|  83 |    1 | 0x43496A5A66524E5250456467             |          98 | 0.0000 |   83 |
| 114 |    1 | 0x26527937                             |          50 | 0.0000 |  114 |
| 114 |    1 | 0x5337                                 |          42 | 0.0000 |  114 |
+-----+------+----------------------------------------+-------------+--------+------+
12 rows in set, 31 warnings (0.00 sec)

4. What is your TiDB version? (Required)

3d42e34

@wjhuang2016 wjhuang2016 added type/bug The issue is confirmed as a bug. fuzz/randomtest labels Sep 3, 2024
@hawkingrei hawkingrei assigned hawkingrei and unassigned hawkingrei Sep 3, 2024
@windtalker
Copy link
Contributor

The result set is unstable because of the dataset:
In tlcab6ba93, it contains the following rows:

mysql> select col_8, ord(col_8) from tlcab6ba93 where col_8 like 'k%';
+---------------+------------+
| col_8         | ord(col_8) |
+---------------+------------+
| K             |         75 |
| k             |        107 |
| KzWRf!6_WKar- |         75 |
+---------------+------------+

And in the orginal query, the result of

SELECT /*+ USE_INDEX_MERGE(`tlcab6ba93` )*/ ORD(`tlcab6ba93`.`col_8`) AS `r0`,FORMAT(`tlcab6ba93`.`col_8`, 4) AS `r1` FROM `tlcab6ba93` GROUP BY `tlcab6ba93`.`col_8`

is unstable, because the collation of col_8 is utf8mb4_unicode_ci

mysql> select col_8, ord(col_8) from tlcab6ba93 where col_8 like 'k%' group by col_8;
+---------------+------------+
| col_8         | ord(col_8) |  
+---------------+------------+                             
| k             |        107 |                           
| KzWRf!6_WKar- |         75 |                             
+---------------+------------+                                    
2 rows in set (0.00 sec)                  
                                                                                                                                                                                                                                                                                                 mysql> select col_8, ord(col_8) from tlcab6ba93 where col_8 like 'k%' group by col_8;                                                                                                                                                                                                            +---------------+------------+
| col_8         | ord(col_8) |
+---------------+------------+
| KzWRf!6_WKar- |         75 |
| K             |         75 |
+---------------+------------+
2 rows in set (0.00 sec)

So the unstable result is as expected.
But in theory, since TiDB's sql mode contains ONLY_FULL_GROUP_BY, for sql like select col_8, ord(col_8) from tlcab6ba93 where col_8 like 'k%' group by col_8, it should throw error, I think we need take a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants