[MDEV-5869] Crash MariaDB when querying PIVOT table Created: 2014-03-15 Updated: 2014-03-19 Resolved: 2014-03-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.7, 10.0.9 |
| Fix Version/s: | 10.0.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Gerardo Narvaja (Inactive) | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | connect-engine, pivot | ||
| Environment: |
$ lsb_release -a |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
A simple PIVOT table test crashes the server while trying to connect back to execute the pivot query. Started with a clean MariaDB installation from the MariaDB repositories for Ubuntu Precise release. 1. CREATE DATABASE test_pivot The client will show the following error message: See attached error log: bart-05.err |
| Comments |
| Comment by Nobs Wolf [ 2014-03-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
works for me in Debian 7 crashes for me in the described way on Windows 7 64Bit | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2014-03-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The crash was caused by a bug concerning DATE columns that was easily fixed. Meanwhile I found some other problems (no crash) concerning the proper recognition of date/time values. I shall push the fix after I solve them, soon I hope. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2014-03-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
While fixing the crash (a trivial error) I also fixed some issues of bad recognition of some column types and length by discovery. Concerning your example, some remarks:
This is meaningless due to the source tables and the way it is pivoted. However, even changing "GroupBY=6" by "FncCol=amount" will not give an interesting result: CREATE TABLE my_pivot_2 This is because the source table has columns that make the internal grouping still have the same number of rows than the source table (in particular the pk column) More interesting result can be obtain by removing from the pivot table these extra columns. For instance, to have a pivot display of the ALTER TABLE my_pivot_2 drop pk, drop ts, drop wd; Another way is to make the pivot table on a restricted source table: CREATE VIEW test_pivot_1 as select merchant, category, amount from test_pivot_2; Once done, SELECT * FROM my_pivot_2 will display:
|