Crash MariaDB when querying PIVOT table

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
2. Create the empty table using the file 'test_pivot_2.sql' in the attached tarball.
3. Load the data using LOAD DATA INFILE from the 'test_pivot_2.txt' file in the attached tarball.
4. Create the pivot table using the 'my_pivot_2.sql' file in the tarball.
5. Execute SELECT * FROM my_pivot_2;

The client will show the following error message:
ERROR 2013 (HY000): Lost connection to MySQL server during query

See attached error log: bart-05.err

Environment

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.4 LTS
Release: 12.04
Codename: precise

Status

Assignee

Olivier Bertrand

Reporter

Gerardo Narvaja

External issue ID

None

External issue ID

None

Fix versions

Affects versions

Priority

Major
Configure