Bug #113343 | Expression #1 of ORDER BY is not in SELECT / incompatible with DISTINCT (#3065) | ||
---|---|---|---|
Submitted: | 5 Dec 2023 18:12 | Modified: | 15 Dec 2023 14:13 |
Reporter: | Emmanuel Renauld | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.0.32 | OS: | Windows (Windows server 2019 standard) |
Assigned to: | CPU Architecture: | Any | |
Tags: | incompatible with DISTINCT (#3065) |
[5 Dec 2023 18:12]
Emmanuel Renauld
[7 Dec 2023 11:36]
MySQL Verification Team
Hello Emmanuel Renauld, Thank you for the bug report. May I kindly request you to provide the test data along with tables and exact steps to reproduce this issue at our end? Regards, Ashwini Patil
[7 Dec 2023 13:57]
Emmanuel Renauld
Error message
Attachment: Error 3146.jpg (image/jpeg, text), 34.57 KiB.
[7 Dec 2023 13:59]
Emmanuel Renauld
Hello Ashwini Patil, Thanks for looking into this. Unfortunately there are no exact steps to reproduce the error. The error message will pop up once or twice per hour of work on our database. The users report that "even trying the exact same action again does not reproduce the error". Also the data is not easy to transfer... There are two other queries used by the form that I forgot to mention. I will list them for exhausitivity since they may be the queries triggering the error: SELECT DISTINCTROW [Q/Video generation tracking].[Child 0] AS [Video tape SN], Max(Len(IIf([Parent 1] Is Not Null,"x") & IIf([Parent 2] Is Not Null,"x") & IIf([Parent 3] Is Not Null,"x") & IIf([Parent 4] Is Not Null,"x") & IIf([Parent 5] Is Not Null,"x") & IIf([Parent 6] Is Not Null,"x") & IIf([Parent 7] Is Not Null,"x") & IIf([Parent 8] Is Not Null,"x") & IIf([Parent 9] Is Not Null,"x") & IIf([Parent 10] Is Not Null,"x") & IIf([Parent 11] Is Not Null,"x") & IIf([Parent 12] Is Not Null,"x") & IIf([Parent 13] Is Not Null,"x") & IIf([Parent 14] Is Not Null,"x") & IIf([Parent 15] Is Not Null,"x"))) AS [Generation No] FROM [Q/Video generation tracking] GROUP BY [Q/Video generation tracking].[Child 0]; Query [Q/Video generation tracking] is: SELECT DISTINCTROW [ST/Video tape parents-children].[Child video tape ID] AS [Child 0], [ST/Video tape parents-children].[Parent video tape ID] AS [Parent 1], [ST/Video tape parents-children_1].[Parent video tape ID] AS [Parent 2], [ST/Video tape parents-children_2].[Parent video tape ID] AS [Parent 3], [ST/Video tape parents-children_3].[Parent video tape ID] AS [Parent 4], [ST/Video tape parents-children_4].[Parent video tape ID] AS [Parent 5], [ST/Video tape parents-children_5].[Parent video tape ID] AS [Parent 6], [ST/Video tape parents-children_6].[Parent video tape ID] AS [Parent 7], [ST/Video tape parents-children_7].[Parent video tape ID] AS [Parent 8], [ST/Video tape parents-children_8].[Parent video tape ID] AS [Parent 9], [ST/Video tape parents-children_9].[Parent video tape ID] AS [Parent 10], [ST/Video tape parents-children_10].[Parent video tape ID] AS [Parent 11], [ST/Video tape parents-children_11].[Parent video tape ID] AS [Parent 12], [ST/Video tape parents-children_12].[Parent video tape ID] AS [Parent 13], [ST/Video tape parents-children_13].[Parent video tape ID] AS [Parent 14], [ST/Video tape parents-children_14].[Parent video tape ID] AS [Parent 15] FROM ((((((((((((([ST/Video tape parents-children] LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_1] ON [ST/Video tape parents-children].[Parent video tape ID] = [ST/Video tape parents-children_1].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_2] ON [ST/Video tape parents-children_1].[Parent video tape ID] = [ST/Video tape parents-children_2].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_3] ON [ST/Video tape parents-children_2].[Parent video tape ID] = [ST/Video tape parents-children_3].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_4] ON [ST/Video tape parents-children_3].[Parent video tape ID] = [ST/Video tape parents-children_4].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_5] ON [ST/Video tape parents-children_4].[Parent video tape ID] = [ST/Video tape parents-children_5].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_6] ON [ST/Video tape parents-children_5].[Parent video tape ID] = [ST/Video tape parents-children_6].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_7] ON [ST/Video tape parents-children_6].[Parent video tape ID] = [ST/Video tape parents-children_7].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_8] ON [ST/Video tape parents-children_7].[Parent video tape ID] = [ST/Video tape parents-children_8].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_9] ON [ST/Video tape parents-children_8].[Parent video tape ID] = [ST/Video tape parents-children_9].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_10] ON [ST/Video tape parents-children_9].[Parent video tape ID] = [ST/Video tape parents-children_10].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_11] ON [ST/Video tape parents-children_10].[Parent video tape ID] = [ST/Video tape parents-children_11].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_12] ON [ST/Video tape parents-children_11].[Parent video tape ID] = [ST/Video tape parents-children_12].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_13] ON [ST/Video tape parents-children_12].[Parent video tape ID] = [ST/Video tape parents-children_13].[Child video tape ID]) LEFT JOIN [ST/Video tape parents-children] AS [ST/Video tape parents-children_14] ON [ST/Video tape parents-children_13].[Parent video tape ID] = [ST/Video tape parents-children_14].[Child video tape ID] ORDER BY [ST/Video tape parents-children].[Child video tape ID]; A screen copy of the error message is in the file section.
[8 Dec 2023 12:57]
MySQL Verification Team
Hello Emmanuel Renauld, Thank you for the details. We cannot reproduce the issue without proper steps and test case. If you can provide more information, feel free to add it to this bug. Thank you for your interest in MySQL. Regards, Ashwini Patil
[15 Dec 2023 14:13]
Emmanuel Renauld
I removed all the DISTINCTROW keywords from the queries in the database since some of them seemed to trigger the error and actually none seemed necessary to get the same query result. After this, the error still appeared once and pointed to the following query: [Q/Videos parents-children coherence B FINAL] is: SELECT DISTINCT [T/Video tapes].Location AS [Parent location], [T/Video tapes].[No Event] AS [Parent No Event], [ST/Video tape parents-children].[Parent video tape ID], [T/Video tapes_1].Location, [T/Video tapes_1].[No Event] AS [Child No Event], [ST/Video tape parents-children].[Child video tape ID] FROM [T/Video tapes] INNER JOIN (([ST/Video tape parents-children] LEFT JOIN [Q/Videos parents-children coherence B] ON ([ST/Video tape parents-children].[Child video tape ID] = [Q/Videos parents-children coherence B].[Child video tape ID]) AND ([ST/Video tape parents-children].[Parent video tape ID] = [Q/Videos parents-children coherence B].[Parent video tape ID])) INNER JOIN [T/Video tapes] AS [T/Video tapes_1] ON [ST/Video tape parents-children].[Child video tape ID] = [T/Video tapes_1].[Video tape ID]) ON [T/Video tapes].[Video tape ID] = [ST/Video tape parents-children].[Parent video tape ID] WHERE ((([T/Video tapes].[No Event])=False) AND (([T/Video tapes_1].[No Event])=False) AND (([Q/Videos parents-children coherence B].[Parent video tape ID]) Is Null) AND (([Q/Videos parents-children coherence B].[Child video tape ID]) Is Null)) OR ((([T/Video tapes].[No Event])=False) AND (([T/Video tapes_1].[No Event])=True) AND (([Q/Videos parents-children coherence B].[Parent video tape ID]) Is Null) AND (([Q/Videos parents-children coherence B].[Child video tape ID]) Is Null)) OR ((([T/Video tapes].[No Event])=True) AND (([T/Video tapes_1].[No Event])=False) AND (([ST/Video tape parents-children].[Child video tape ID])<>62706) AND (([Q/Videos parents-children coherence B].[Parent video tape ID]) Is Null) AND (([Q/Videos parents-children coherence B].[Child video tape ID]) Is Null)) ORDER BY [T/Video tapes_1].Location, [ST/Video tape parents-children].[Child video tape ID]; [Q/Videos parents-children coherence B] is: SELECT DISTINCT [ST/Video tape parents-children].[Parent video tape ID], [ST/Video tape parents-children].[Child video tape ID] FROM ([ST/Events-Video tapes] INNER JOIN [ST/Events-Video tapes] AS [ST/Events-Video tapes_1] ON [ST/Events-Video tapes].[Event ID] = [ST/Events-Video tapes_1].[Event ID]) INNER JOIN [ST/Video tape parents-children] ON ([ST/Events-Video tapes].[Video tape ID] = [ST/Video tape parents-children].[Parent video tape ID]) AND ([ST/Events-Video tapes_1].[Video tape ID] = [ST/Video tape parents-children].[Child video tape ID]); I ran this [Q/Videos parents-children coherence B FINAL] query manually a few times to test it out of the VBA code and luckily after a while, it did trigger the error. I then ran it again immediately and it worked again without error. Then I wrote a bit of VBA code to run this query in a loop 10000 times but I didn't get the error. So the error needs a context to occur, that I can't reproduce on purpose so far...