[MDEV-12819] order by ordering expression changed to empty string when creatin view with union Created: 2017-05-16 Updated: 2017-08-01 Resolved: 2017-06-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Views |
| Affects Version/s: | 10.1, 10.1.20, 10.1.22, 10.2 |
| Fix Version/s: | 10.1.25, 10.2.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Marc | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Mar 21 12:19:18 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
When creating a view containing union, order by ordering expression is changed to empty string if column position is used. Test case to recreate:
Output shows order by with empty string `` instead of column position and view returns wrong result on execution:
|
| Comments |
| Comment by Elena Stepanova [ 2017-05-16 ] | |||||||||||||
|
Thanks for the report and test case. Reproducible on 10.1 and 10.2.
| |||||||||||||
| Comment by Oleksandr Byelkin [ 2017-05-17 ] | |||||||||||||
|
| |||||||||||||
| Comment by Oleksandr Byelkin [ 2017-05-17 ] | |||||||||||||
|
find_order_in_list() is not called for the union | |||||||||||||
| Comment by Oleksandr Byelkin [ 2017-05-17 ] | |||||||||||||
|
global parameters (and so global ORDER BY) checked only for prepared statements (why!!!). Removing this check fix the issue but lead to crash because of absence of explain information in other UNIONs. |