[MDEV-31435] Stored Procedure not sorting correctly Created: 2023-06-08 Updated: 2023-10-16 Resolved: 2023-10-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Stored routines |
| Affects Version/s: | 11.1.1 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Sean Connolly | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 10 Professional 64-bit |
||
| Attachments: |
|
| Description |
|
Just recently, I was advised to upgrade from MySQL to MariaDB for a much faster experience and ended up downloading Version 11.1.1. I am writing some stored procedures that I can pass in parameters and perform a customised query. I have discovered a bug when it comes to the ORDER BY in the stored procedure which is not working correctly, but when I created the same sql select outside of a stored procedure, the ORDER BY is working correctly. Attached is the stored procedure and the manual select alongside two jpegs to show the difference (from row 5 onwards) where the order should be in the order of the "Dayset", followed by "Depart", "Arrive" and "StartDate", but the StartDate is not sorting correctly. |
| Comments |
| Comment by Sergei Golubchik [ 2023-06-29 ] |
|
can you show the table structure for AZResults ? |
| Comment by Sean Connolly [ 2023-07-14 ] |
|
The table AZResults is a temporary table which is created directly inside the SQL code as shown in the attached files. The ORDER BY works when I create a direct query instead of using a stored procedure. It only breaks when it is inside the stored procedure. |
| Comment by Alice Sherepa [ 2023-09-15 ] |
|
CosineCuber Could you please provide the test case to demonstrate the bug? |