[MDEV-3890] Server crash inserting record on a temporary table after truncating it Created: 2012-11-28 Updated: 2013-01-26 Due: 2013-01-24 Resolved: 2013-01-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.0, 5.5.28 |
| Fix Version/s: | 10.0.1, 5.5.30 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Risato Stefano | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Aria | ||
| Attachments: |
|
| Description |
|
As in summary, the commands below crash the server. I attach my configuration file if it can help. mysql> create temporary table tmp.pippo select * from config; mysql> truncate table tmp.pippo; mysql> insert into tmp.pippo select * from config; |
| Comments |
| Comment by Elena Stepanova [ 2012-11-28 ] |
|
Hi, Could you please also provide SHOW CREATE TABLE for the `config` table? Thanks. |
| Comment by Risato Stefano [ 2012-11-28 ] |
|
I did more tests. Fresh installation of 5.5.28 both in Windows (Seven) and Linux (Ubuntu 12.04). The problem occurs using Aria as default engine, when I add the line [mysqld] in my.ini / my.cnf. MariaDB [(none)]> create database test; MariaDB [(none)]> use test; MariaDB [test]> truncate table test1; MariaDB [test]> insert into test1 select 'ciao' as field1; |
| Comment by Elena Stepanova [ 2012-11-28 ] |
|
Thank you for the report. Reproducible as described. set default_storage_engine = Aria; create temporary table test1 select 'ciao' as field1; No crash on 5.2 and 5.3. |
| Comment by Jani Tolonen [ 2013-01-23 ] |
|
A bit more simple test case to reproduce the problem: CREATE TEMPORARY TABLE t1 ( i int) ENGINE=maria; More information about the problem: segmentation fault happens in ma_loghandler.c because transaction struct TRN is 0x0 (null pointer). TRN is an element of HA_MARIA table handler struct.The same problem does not occur if one does DELETE FROM t1, because it takes a different route in the code and TRN is a valid variable in that case. The problem occurs because truncate sets TRN to a null pointer value and after that insert fails with seg fault because it tries to access the not valid variable in the struct. |
| Comment by Jani Tolonen [ 2013-01-23 ] |
|
Assigned to Monty after discussion. |
| Comment by Michael Widenius [ 2013-01-25 ] |
|
The problem is probably that temporary tables should not be transactional and somehow truncate makes it transactional. |
| Comment by Michael Widenius [ 2013-01-26 ] |
|
Fix pushed into 5.5 tree |