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

wrong result using the ISNULL in the nested expression #55299

Closed
hawkingrei opened this issue Aug 8, 2024 · 1 comment · Fixed by #55306
Closed

wrong result using the ISNULL in the nested expression #55299

hawkingrei opened this issue Aug 8, 2024 · 1 comment · Fixed by #55306
Labels
fuzz/randomtest severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)


CREATE TABLE `tcd8c2aac` (
  `col_21` char(87) COLLATE utf8mb4_general_ci DEFAULT NULL,
  KEY `idx_12` (`col_21`(1))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `tle50fd846` (
  `col_42` date DEFAULT '1989-10-30',
  `col_43` varbinary(122) NOT NULL DEFAULT 'Vz!3_P0LOdG',
  `col_44` json DEFAULT NULL,
  `col_45` binary(129) DEFAULT NULL,
  `col_46` double NOT NULL DEFAULT '4264.32300782421',
  `col_47` char(251) NOT NULL DEFAULT 'g7uo-dlBEY22!fx3@&',
  `col_48` char(229) NOT NULL,
  `col_49` blob NOT NULL,
  `col_50` blob DEFAULT NULL,
  `col_51` json DEFAULT NULL,
  PRIMARY KEY (`col_48`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


INSERT INTO `tcd8c2aac` VALUES(NULL),(NULL),('u!Vk+9B-3bn@'),('&PpQ*z!kQwj4g*ag#');
INSERT INTO `tle50fd846` VALUES('2029-05-09',x'757640736a42316c384162793124246b','[\"YXt8UJAnVMWeMEZj1CzhNUzTMDJfzsmTWQkyOvVCsciA3eobvH8heH8gtr6ogxXa\"]',x'577340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%gMk','58reJ%D&54',x'39254c48242556737474',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'4c39747933632170244f6f6a','[\"VPibCFA2IUSP7cuVNofvYq9oNGsGHm5PafkdQJTK6Fb3AmLFP9HHKyDOvC2TZdCf\", \"Dt6JTltIvKG4A5A7HX7GBnpcPiV9V7Ag0w1mgWC6ikdWHjnAvt3wRcQd5WZKltK6\", \"drJru4iGi0NXsL9KxeUMo4AYL2XqJanuxKilk3ZyhsHMiKCX9U1OcbkC1Nqcn9Sf\", \"n83OtQJ4mdsyfkcKuOioVQjslSZySo6OTDvd7oehLgHQosEFQmWrKO5fNbPXvnJW\"]',x'6e39696f5730512562293968356d26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2305.560218349852,'%gMk','lOJ^yTVcx=y8IdzTEd@',x'66684f4f215133565e6e41486f284e316e',x'546a5e67643274333d44234433332b6e77','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'74674b7246447535','[\"KaiyntpHLe1K0xQzzp0xbXII6VYiCCFH3IpX9CMGToQLt2QJWFvnZJ45jic7HFU8\", \"FR9dYFq23bexCdFFSiIZYfQrsbsuHEV6HNYLxnSouMtdvmF0JKSADQszuP3sdNXB\", \"kf5NzTM5AzJvufhD57bVxgGNThrYJ2NObTxWTWbEP3OhKXlJTpOkyTdNQ0f7l3vD\", \"i7lXtRCad3f1gAoqVRIKMIxLjbhwwfNWAmntYuY3j708sWuZ7G4gd5uJUvTmsbcB\", \"mMlgr9kjy41MzLFWV832TduF1B7yTqv9OxXiEnvoe0QUDVjJ5DbDaP2pteDRmi0w\"]',x'5172456a4663244531364070695258375000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2305.560218349852,'%gMk','6wue6bpF1)4',x'29386b395e5f797631736b464c',x'546a5e67643274333d44234433332b6e77','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'5f2843354a6a59','[\"0SzHt9Wy1CHZdrFoZYtu1mEnvB8VrqsSMBrQ6CrN57GKz366msCrjvF1iMOpX3FO\", \"WQFvsPbWXPOyjB9zH6VDbg4CdVfDdEj0vUFWlkHeaNZ8j46ZQFU4nBx1GDn2z9nM\", \"SkdvgrJWrmaviExrUYhTlIqE5NIQHv7u5eC9l7HeM7p2n3pkikVKTiWe2lyIJBGf\", \"drq9VLawV6uBbJ2x6fLk3tiVtAqyUYfqQlhJ6n3yyi7hWDZoN7IYyYpbDPjW89LT\", \"YfkCOtT7NLzoKS4GosjetOkDXk4ypAKI2CiYRBXvnd2RkEcmWI0uMhEgPkWOPoXP\"]',x'32436d3850466c4a766c632430474c514a4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2305.560218349852,'%gMk','fU~(U5ae4W)zJeULZ',x'507e43462133584c453879233d57',x'546a5e67643274333d44234433332b6e77','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'5e68565e755851594a2139534b4e','[\"DzjychMgxFeO6sOVNozjYwHjFlhQhX8BsU8HBYF8nwWD1y0nSITWRqrhDwQC3n9X\", \"1BtXyIB0w1hh25PAu8CyAfVJFPC7deJ0KyGmQPQIslhi5cq1uRFFTh8FHbJ4mmFl\", \"wLOo0bWp3GFKugSHr33WEcSw1XCp0OOh0N5lR5mnRRQwteTZ6cSNZCIDbZ88dnq5\", \"CwetVAI79NcizUjYkWPTW4Y2olm6RdsF5i2hMrcqKJ4yNv2ulcAqmT49WV3qdAl9\"]',x'347435000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2305.560218349852,'%gMk','0P==cT',x'4343726f3d572b4c565a615e622b',x'546a5e67643274333d44234433332b6e77','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'7255734a477245734c2d4e744b312928665f','[\"SlTlxIBjtlD2jSfN4e25nEFKE4ikpo7dONmBhXsaqGhl2w8VwJEJPqggHjC62VuM\", \"Gf12HBhvRLyYsiPjTBRCLLNqcpVqsHrklfOvMOhK2qBUxeN1Z9dHQou99yKqeM52\", \"f78D6uI9psSrTBUVSM0ZkZFgHGOkuvdlEYbXstqqcJrGOOZBTIKyDkTUgcXlosai\", \"Vt1tNBlvaQzqjK4W6gRk1sLwkR4Tdn5h3R3ei1z9VTMBBTfVDO2NlAANy3Jt2pB6\"]',x'6270563d49244321544e38647153424f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2305.560218349852,'%gMk','S-JaJJZDivQQbu',x'45765f495170494b634a',x'546a5e67643274333d44234433332b6e77','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'54365f24503d7472434d357e2b5f','[\"yZs0BrxuZhtcdQdH47vrwHmepimlf4mOMDYzRtlh0UP0crWYuRqgAJI8803rCSvM\", \"w8gLu8kJU1WBDgym9Jg19B1BysbEbxPbvburNJecgJUpXcQ4WAwNAdmMPT9qh3QT\", \"LgkF6WARlrLUVfYnvPSVO7bYB444yqWgnC42BHp858ma5IBrISM5w01WwyfM1wBN\", \"k70Mc7seNEQB2Ctdn262p1yWdxQxTodQ8wLVx2MAkCLUFibWO0RoG8VvQk10pix5\"]',x'7738745473625051286f413538535a750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%)^1B=BJD','-7(mD&wa^',x'592a4a71446e30566768595f6c346f6e6d62',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'772d7548533d6e23624131214c6241','[\"pMRxCHNrsFSUzwHBKtYm3XwXxWf7L6iY8B5m9jKDg3QDkSQwMDyRQ6Nxby8Rb4zN\", \"Ht0D9hN93JwtLsKwKiwGCBCufxc5vtSdVtH9ECGMTbmWfIchQEW7A0xIjxgYyiig\", \"ZbRc8pen9kOftQ6U3d9mafNMraCD34DEbUQjRiCo0PBngD10syK8Pxn2SvqhDW98\", \"KF27wuutZLjifpku5V24IoIqpg3P64YFys5ib5yekENkcDtGRjrThHNrMZo8fL5s\", \"mZhuaPFtCem3uGgXJ7KQ8DfPaqarJbAZh9L7vBIJGGKvwvvkZZyRKI4AOJpsh3tw\"]',x'452a7231417977536c5262664b6c79000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%gMk','&9TFhm=d&%4*Y18',x'536d59702157762130565554662823665f544e',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'536157674b53524e6c','[\"xGavQNFfX9hu5iZLYvFug7fda7hCWyJxjKQzz3DLxZN3IFQoXoBNBMdMkKQNs7hn\"]',x'46793d2b5200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%gMk','!X!v-',x'2b33792a2d686d704f244e',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'2443247051262556','[\"lrD5lkpX4u3gHRfgpI5wM2fMDLzbOz9X1mLxALhSEgaHwd3Svje6qRSwMjrOH2cT\"]',x'36664d717a2a283d4045347e33373d690000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2168.38784123883,'%)^1B=BJD','mX&Jk!s!vtra',x'776f4a31423065316b523623347372775a77',x'25365550374a7256','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'43577724734b26767376677a36736d6f5a','[\"nOxnBkQWmFLronRaIz8Hmb0pj3DU9802w6KtFp5OgsYpNsmwMxLfHy0z1z70hl8M\"]',x'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%gMk','5%b#w',x'4261264131707030266163554a403d',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'664e254f383d5f297159','[\"Oz0ZVENsCZ47CCC6RynWoDnzAlOaYoGixjBNVTLJLcU0z8RyJozKFYYogo8Uvkcr\", \"d0YMxiu7j9QslfpUpYMO1Ri0ZM0jdmPocMJOQDitwFxsdhHRC7GSdEHxyHVF5MRo\", \"gcplPpZEKLpO4snwV2raab4wj3XupR7Sg5v2Kh8HqdYKFg0LJobkOS7ckOdelsq7\", \"Rp0DiM8VTyelLBNvjkBz19HDiAWMObHn2QfFCbQbKo5eytbZaRSfhRAdtvMmPuIB\"]',x'4172744e436f542100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2527.6518194093737,'%gMk','G',x'6451395837242553737365',x'4038414a34746b','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'6479614576774350326d5234756965425771','[\"nDPd9c7dCQHblM37uqHeUmF3RUWJ7usp1Piz3Cik1q1VF6DgaRz2z3fENT6JZzvF\", \"PrevynMI8Gv9xp0FQNnKM3NWsQ40pn8i9G1OrIrTkWIqVm6L06Q6oRT7vFG9EQoO\", \"Eeih0UK6AnBBr7V7F5lG3Hn5rV4hRq8PdOx7RyabKAlbovM56lFPbVoTOtDUS7dQ\", \"2LHzc46lym0XoHez0Uf3SVLLtKpM9CMBJtQqr6niRu1xmtXFBgAsAkgJ4UmrZcAw\"]',x'702a2b72435276566425774d743858485000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%gMk','(kdrRbT__G_@$#',x'6c',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'5972505f44435e78','[\"IesPYXem77MhBT0VkSw7mIXD8fbA5Q6WbCHv0vlCf0FnByIV8emIWoa7lIjQ3H8G\", \"XGsQoTINeYG05irOVwSpnCOPQqJlnbYX7pCNCGnXhMtm4m7wVcdERzpRa0ZceYW0\"]',x'752365684e217367512523566a5236520000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',1189.0038590640397,'%gMk','iGKRA~9iTf',x'34354d3024434f6d7550436c4d235f485962',x'4c4459','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'4b67','[\"c7JIwEy0FxHypLKui9dcDBsqJCc1AfENdIYtoHaYeEzskghLUEndkgl6MWPPu8kN\", \"jtJD22EoiF9uhljevOOT2VFWQiWj6zbdyPD86KS8LABkTNUsnCKCt6aHw9WNEk7h\", \"PeVtA91c6WfnXclGLcua8KP31U9JWEIGgv9QjgsEBlbUh00B38y9uS1oNiJdLRYd\", \"QZGKsdmS1CXW2GAFSo6k5FRqCGDnvzGmZJQ0nEo5Efd57WW5Fo9n62Z1QEcQXK77\", \"6E1YdsSKUOorn8Fbl8N25hF6sFtzdxlEbVSBqMj4MniOL5E65RvMpDrponSd9J10\"]',x'5f4900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',6894.394531157209,'%gMk','8nlvcHyDE8(t9h(L',x'312b5f79404e4967',x'43244a','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'546d256b6a','[\"fXSlPnrOEwyHnHy0Vz9NipCXCbC3HpvwxZRh2ejKtPX2JgTNaCBfTcOEIq0G1SqT\"]',x'6673786e2a24683957385342000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%gMk','c-zuF5r(~%b',x'4d5a242d476d78502d4d65746835502b514e',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'397135','[\"nGiGkj8RITfKWeAeAiYH92AsLltpDNGg6nHokhjZggLqlVDJbindlHuYb3n27bcB\", \"y7p8t3KcwGj27TpYamfCGUcYmTwEG4iSoF3Nvr1fWnW0c5MBWiyMat1EAvqgJ4ps\"]',x'2b264f662640762b6a473500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',7465.216964970621,'%)^1B=BJD','r73ClP_a2$RaN*t@Gj6',x'',x'23746471636b344d61237a714242562836','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'665f67575e70594b404b2a59232d54','[\"7ABJ5MbY1JNxSiGSNfPq1vZ0iyZ21t7SUMqRZ7ZsED93Kd62T6kOtAGrxZzAAmt9\", \"52GPanSDwBM2oGYjrNno7yo4NhcNS4bcl8VicEv3bvs90Rx9dzbFky1Gi4K4Y4cf\", \"f7B90eAF4ZC0m0ECvgVnZRhX2wqa2jO8QXdzKN0twBePzFnnFX0VyvyqMQZDwrKI\", \"UuK5Q16nZwpKA4tRTcxml0zH3ClYlk9zzrUX6SYdp6TENg3faVDU6ps60SSodGUU\"]',x'695628706c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',526.0218366710487,'%gMk','_soXz+vlqk3q%Gi',x'7a64462d5059682673714535244a6c',x'6c66762b303567236f4068','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'','[\"E0T9L17Bas4NPmbeIa8H0rrMP1DaCD0pjwQYg8vHipOwdnkluSwwRKOjiuVN31QF\", \"hBkHqVfaidgA3LQqyTnY7jwif43bkdaWMMTQdtaUD0s04lJLDyZUgL7l4SXrj63m\"]',x'65747934347e7846554d393559504e6f706f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',5756.408812508178,'%gMk','i',x'5e4f2a332a423d',x'6257677a31537678693d4838662851493d4e','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'30314c28757a','[\"GFsf9uEsGzhr8fOELMHTSMsZy2OuvBqRjcklxTcRrPfhtyU0XMrbcwgXFbuK4onx\", \"pfTWXOduAYOvgmwTFY3Fok25PdQnx32PaN9Ji6D4FnECTsHGgZw5q2aYCofyb8rl\"]',x'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',5140.807659301442,'%gMk','uR_J!YV1V7Z~J',x'4075454b6f7e68465466',x'433d694f73','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'2b4c486b7a35346e704268735153666338','[\"Aal9LzFiH47ETlm3UcSZDi4caYIOXCpZKJk9ZUXiecc7fx3meKxMBj7C0ziI0GCp\", \"ObP2Fe0U5DObBD5EEWBVGFZdWM9lcqYf4TyugNgf2MCdKnecmDzjzqVZ8sdKGOl5\", \"HJUWAVEl6WAvUFBKcDfrEa2pjmcERulCF6PmUK42jPLkfvtFcD2Ki8d05svsn51r\", \"NMf9YeGQL9SFz6AnMOqUc6Ty1XJY5bKfE8ZAZYCl7cCyYVn6TzPWcs0k3ycISoX2\", \"NAfBbp2kxS8eQ46esg4XQcr6Fibptpxu2DnG3DUaGlRDDceRdqzTH8H8VxlPdGty\"]',x'66576c534c344f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',1173.8455984679724,'%gMk','=DbFO2Wvp*fHBw=JT',x'616c75645554',x'75397a','[2984188985038968170, 2580328438245089106, 4624130652422829118]'),('2029-05-09',x'4a3571433430','[\"ZtG3B5KeJFvJgkJ8ZD5pAU2NVysd1OPU5ENkX1NdI3mk0u7cxStAVWjJoj03llsV\", \"9N8EnzmCGS5WKOZ5LivvXCklWAuZr2YTwcKGHPa22vhnX5MLKSWgV9Qr8vOO6GEv\"]',x'73732d3d6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',80.87546082349974,'%gMk','tj_==&X~Wz',x'4168496278645f576d',x'38534f6b','[2932490716692297863, 2303419055535830389, 7107952597731787650]'),('2029-05-09',x'4c4946296949322674672d4f6143',NULL,x'4b316929774c667459000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',4033.624910136815,'%gMk','BeWk+q',x'747e4c3340592d2572',x'51516e68504328686d79','[5491178656046180821]'),('2029-05-09',x'38655959574b6d25567757','[\"fjzUB8tVLQkWOL0lnHvUSoegn9OIsPW3wEcq0JZ9Lt63nzVmpq0fKQODbKSPd2xB\", \"mUSDe2OzJ26NNRxIrGl93N8lErcrqvas9QQzzq9KHBfdHHVIgdOmiWIGsAwgXOEI\", \"PskLAO4sXaoI6zxmIJwe3chZ6iqTB7TTMASWJHGzZdBRyDUuQxxCsV38wGMvFmsp\"]',x'24504848575926383071734e7441394f384b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',634.7810508638787,'fyz(n6_D7_e*8i*W','RDI4ZYHGcn~R~P_O',x'52503873582477366e5e38',x'4a4a43633d6d247e6629355a75','[6658895126403633542, 3346736523622241225, 620231850372310418, 4552008201419314828, 4376198261069070925]'),('2029-05-09',x'3778285929637e79504a256f','[\"UDwqhMuXcDnR3bQ4elWzofT5mmG8zqZmg1pOn97coMkgMYSFIb0DpciFC3QsBEzd\", \"uRFFEdjSc5JEoZJDlRWpQmqxKvsqEW2q0vVYFOFRlHEtt2jEKKPrQWwpQmtHNihZ\", \"xDn77Kv0NKNvb2sCpShSXgWVgfXZkkwsRDZQhwOt9VugWH7zr82iH0rEXlz99yL2\", \"KXmg9K0J3WQZzTXGf4iYvr4zysGBN3B8LQ3Un4ccptaHdR7OP8F3IbpyB7Ypmv3J\"]',x'7e4077314f2140754847567e4b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',8333.750777984635,'%gMk','p-',x'425172545837466c5253705671586c72307528',x'55576d53596f48522337','[5672303508532349130, 128147400398434239]'),('2029-05-09',x'764f28456f3536303d496148534447','[\"3Jbo7q9yShkjGvofdFt44J4wASLeN5wVwejiwavkSTPnw7h1nLqNQWY7MpNAM7DR\"]',x'620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',772.5762706414138,'L+&ly3PB@','0lqy7+$vKKHdxmP9kS',x'2941374256374071372b62674142',x'784e52582d79797e214944','[2851764810041195492]'),('2029-05-09',x'6f4c2b786166712b4d46464d592b765f293829','[\"F12ITsNeUOT3S1R4aMR6YguhA1tWjSvXQoUHw08RZaDaZ5vvmBELG9m39GsbNgjn\", \"ZfxfpUvVIWfpGlefBWBxLSRwAzmnaiTjfITZhAbuR95fuAR031wCbmU6uwCxEe9o\"]',x'213459316e37575300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',1974.3466123517128,'%gMk','S_dS*vp0$(xb7',x'5e33526a2342677e5a7930582a777a76404b57',x'6b76404554454a362b485030284779','[6970421852201694063, 8776047424579501709]'),('2029-05-09',x'515044696621594d717e467877733d40','[\"ATZQMG3Vk4FAa6irgS2cy1uhC6MzokJysKilkUS10FZlcyG5SGy2Z3cPtlgPSmot\", \"5Ra9ENgmR1nYA42IMiaqLcABuyobG0l9SHTPoYFM1aXIQvpIBiaEmHi5TUdpebV3\"]',x'455a4d59257e48622a3d447e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2259.7619001525927,'','qWtt&afj$QheWDZ~YN',x'455e5133325e296f69',x'235e6e4e623251544371554726322a5e30','[6345778337435607348, 2145889012703089762]'),('2029-05-09',x'2665784c','[\"nNCDksBOLkMni6n0R4yvZfLHGhI8vCgiiMAab5XKaN7gGw3rcOLzzaJtPZ46Nc8J\"]',x'4b2565000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',9771.547178152417,'D)aIM(m','V)!Wnze',x'68674a243331',x'2d3d33612a46792659613d524a2933','[1965104096204479712, 6886216219133270178]'),('2029-05-09',x'5646396332624a5e41435661686742','[\"WJaRkRenBv0OghYQWGqVBRAqSuETh8CQrkWgcWHorD9DTpZz7hlWWn0XbReF4dFf\", \"6PWmzkMC9TI72wB4kbc9dmOpBtD9aaUaESDcfUWAZxnQq1rseU75MYtk8mBYgef1\"]',x'4c2655703d423331296124502b686e216800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',8296.933776083835,'~@^u!(&tpIu6_NYtQ','6MQtn+Qq',x'54384770373444',x'525f314f6449476c2d765451694b6d536d73','[3688428559831793792]'),('2029-05-09',x'50673236','[\"IUzA7uq33th8680ZNOlXbMyRZicHD9sMF1cwi6RS49dGvO2sKP4h2blYpKqzxVhu\"]',x'35386e586c3d2b6d44507700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',2758.977712956617,'$&3DtYUO','03PB%JOvd',x'643d',x'6a252674456a736f6c4276494531','[2671432080982776525]'),('2029-05-09',x'6568','[\"KleGBGdJOX20OK63BCSo1Rkqgxu9alT0fHK4l3XVJVfkc6VlZw1sfZM25df5X39Z\", \"4BgQnIxDPBM3X0jFWzrbNP5zJ0OqSu38Bc0bt6c6jtHfXdhjttT2sUpm7dwsWK1D\"]',NULL,2688.696546778736,'','amE^#7Lw3sidJPm#',x'74',x'2a42245548','[2, 8807439226159456449, 5717524211602694204, 4148255121170474074]'),('2029-05-09',x'6c6b49583559326a6e2b4374','[\"624w6iPuxw6cyCg04QR5RP5tOmfcgCKD58K8wo74UqqxIEn49FfHW8cvW62F0mb8\", \"ySvFhzhg9fLNBV3Jdb7xPHAUrT5QAwxQ8Dmt7v0oF3R8I2c1zMfm02QxBQChvyfS\", \"UCxe1Ytt2yvHG0aDYW85JKKZDyojPlSNCA8fkDRuN1a8Qu1OdwPn0bVDpUrmTj7P\"]',x'6d4e457657772661676b6776000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',6152.5479895060735,')NDM#uH','!8',x'72674d393576212b41544b4e34',x'247e5e','[157709590632393017, 6713775234349015834]'),('2010-11-10',x'7746495f6e785e3166214c34715f76367a','[\"P8OWrzJD8IoOvv6ZIdZ5N9rCGPxpsxp3iaor0gq0soAcnrIIW2B4crPfY1UUCzuO\", \"2mFMwhGd68GGc4so4K7kPFsBXzpTq47TDOncYDG1IRgZGrbn2URCarau5txrVQAm\"]',x'312b335f2d296c3800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',5704.661492410131,'V','',x'70536775',x'67366a42','[8109782303283704653]'),(NULL,x'694a2b357678436b382a32557857','[\"mWIijaioUoayukJQmEaPhg5RjziO7JZ1hGWK56Lddm1nlD29fQsavPKl6fsR5xK3\", \"DOpkW6MViLEkAe6kqtcKuTLtCOV0b0w7A0a6T87F8Rh0fVIt9t7AXVwynenXj88g\", \"rnznRouzLEZZLhlKFtFKKTt0bZv9vix0KaKPkCyhhZNmDFh98Ear2mzuCdrnAZLb\", \"miHOzICKAV0IVEn3zcMoSVULmwK5pyh4ohzHoUYvBBFCsQpniSEpn99pfbAafkrh\"]',x'7331376a6549624873210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',9795.127210262568,'l)Cg','+O#',x'487445614a32734a78647a475e',x'50444b72326879773247794577645f','[2381462974168027078]');

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

> SELECT GROUP_CONCAT(`tcd8c2aac`.`col_21` ORDER BY `tcd8c2aac`.`col_21` SEPARATOR ',') AS `r0` FROM (`tcd8c2aac`) JOIN `tle50fd846` WHERE ISNULL(`tcd8c2aac`.`col_21`) OR `tcd8c2aac`.`col_21`='yJTkLeL5^yJ' GROUP BY `tcd8c2aac`.`col_21` HAVING ISNULL(`tcd8c2aac`.`col_21`) LIMIT 48579914
+--------+
| r0     |
+--------+
| <null> |
+--------+

3. What did you see instead (Required)

> SELECT GROUP_CONCAT(`tcd8c2aac`.`col_21` ORDER BY `tcd8c2aac`.`col_21` SEPARATOR ',') AS `r0` FROM (`tcd8c2aac`) JOIN `tle50fd846` WHERE ISNULL(`tcd8c2aac`.`col_21`) OR `tcd8c2aac`.`col_21`='yJTkLeL5^yJ' GROUP BY `tcd8c2aac`.`col_21` HAVING ISNULL(`tcd8c2aac`.`col_21`) LIMIT 48579914
+--------+
| r0     |
+--------+
|        |
+--------+

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Aug 8, 2024
@hawkingrei
Copy link
Member Author

it is the right planner

+-----------------------------+---------+-----------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| id                          | estRows | task      | access object                           | operator info                                                                                                                     |
+-----------------------------+---------+-----------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| Limit_16                    | 1.00    | root      |                                         | offset:0, count:48579914                                                                                                          |
| └─HashAgg_17                | 1.00    | root      |                                         | group by:test.tcd8c2aac.col_21, funcs:group_concat(test.tcd8c2aac.col_21 order by test.tcd8c2aac.col_21 separator ",")->Column#14 |
|   └─HashJoin_20             | 56.00   | root      |                                         | CARTESIAN inner join                                                                                                              |
|     ├─TableReader_23(Build) | 1.60    | root      |                                         | data:Selection_22                                                                                                                 |
|     │ └─Selection_22        | 1.60    | cop[tikv] |                                         | isnull(test.tcd8c2aac.col_21), or(isnull(test.tcd8c2aac.col_21), eq(test.tcd8c2aac.col_21, "yJTkLeL5^yJ"))                        |
|     │   └─TableFullScan_21  | 4.00    | cop[tikv] | table:tcd8c2aac                         | keep order:false                                                                                                                  |
|     └─IndexReader_31(Probe) | 35.00   | root      |                                         | index:IndexFullScan_30                                                                                                            |
|       └─IndexFullScan_30    | 35.00   | cop[tikv] | table:tle50fd846, index:PRIMARY(col_48) | keep order:false                                                                                                                  |
+-----------------------------+---------+-----------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+

but now it is wrong plan

+-----------------------------+---------+-----------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| id                          | estRows | task      | access object                           | operator info                                                                                                                     |
+-----------------------------+---------+-----------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
| Limit_16                    | 1.00    | root      |                                         | offset:0, count:48579914                                                                                                          |
| └─HashAgg_17                | 1.00    | root      |                                         | group by:test.tcd8c2aac.col_21, funcs:group_concat(test.tcd8c2aac.col_21 order by test.tcd8c2aac.col_21 separator ",")->Column#14 |
|   └─HashJoin_20             | 70.00   | root      |                                         | CARTESIAN inner join                                                                                                              |
|     ├─TableDual_21(Build)   | 2.00    | root      |                                         | rows:0                                                                                                                            |
|     └─IndexReader_25(Probe) | 35.00   | root      |                                         | index:IndexFullScan_24                                                                                                            |
|       └─IndexFullScan_24    | 35.00   | cop[tikv] | table:tle50fd846, index:PRIMARY(col_48) | keep order:false                                                                                                                  |
+-----------------------------+---------+-----------+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+

@hawkingrei hawkingrei changed the title wrong result with using the ISNULL wrong result using the ISNULL in the nested expression Aug 8, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 9a7e5cc Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzz/randomtest severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants