[MDEV-12680] Crash when CREATE TABLE t1 AS SELECT char(100 using filename) Created: 2017-05-04  Updated: 2017-05-04  Resolved: 2017-05-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.1, 10.2, 10.3
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-7049 MySQL#74585 - InnoDB: Failing asserti... Closed
Relates
relates to MDEV-12681 Wrong VIEW results for CHAR(0xDF USIN... Closed

 Description   

CREATE OR REPLACE TABLE t1 AS SELECT char(100 using filename);

makes the server crash with this stack trace:

InnoDB: Failing assertion: *mbmaxlen < 5

#0  0x00007ffff5b9fa28 in raise () from /lib64/libc.so.6
#1  0x00007ffff5ba162a in abort () from /lib64/libc.so.6
#2  0x0000555555f1e640 in innobase_get_cset_width (cset=17, 
    mbminlen=0x7ffff7f28f20, mbmaxlen=0x7ffff7f28f28)
    at /home/bar/maria-git/server-10.1/storage/xtradb/handler/ha_innodb.cc:2408
#3  0x0000555556177613 in dtype_get_mblen (mtype=12, prtype=1114383, 
    mbminlen=0x7ffff7f28f20, mbmaxlen=0x7ffff7f28f28)
    at /home/bar/maria-git/server-10.1/storage/xtradb/include/data0type.ic:98
#4  0x000055555617971a in dict_mem_fill_column_struct (column=0x7ffecf4aa478, 
    col_pos=0, mtype=12, prtype=1114383, col_len=5)
    at /home/bar/maria-git/server-10.1/storage/xtradb/dict/dict0mem.cc:536
#5  0x0000555556178c9d in dict_mem_table_add_col (table=0x7ffecf480378, 
    heap=0x7ffecf448000, name=0x7ffecf4471e9 "char(100 using filename)", 
    mtype=12, prtype=1114383, len=5)
    at /home/bar/maria-git/server-10.1/storage/xtradb/dict/dict0mem.cc:304
#6  0x0000555555f2fc51 in create_table_def (trx=0x7ffecf42cd78, 
    form=0x7ffff7f29a80, table_name=0x7ffff7f293b0 "test/t1", 
    temp_path=0x7ffff7f295b0 "", remote_path=0x7ffff7f297b0 "", flags=1, 
    flags2=80, mode=FIL_SPACE_ENCRYPTION_DEFAULT, key_id=1)
    at /home/bar/maria-git/server-10.1/storage/xtradb/handler/ha_innodb.cc:11536
#7  0x0000555555f31c4e in ha_innobase::create (this=0x7ffecf489088, 
    name=0x7ffff7f2c2e0 "./test/t1", form=0x7ffff7f29a80, 
    create_info=0x7ffff7f2dcb0)



 Comments   
Comment by Alice Sherepa [ 2017-05-04 ]

Just a note, that it doesn't crash for me. (10.1.22; Ubuntu 16.04)

CREATE OR REPLACE TABLE t1 AS SELECT char(100 using filename)
--------------
Query OK, 1 row affected (0.23 sec)
Records: 1  Duplicates: 0  Warnings: 0
 
--------------
show create table t1
--------------
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `char(100 using filename)` varchar(1) CHARACTER SET filename NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

Comment by Alexander Barkov [ 2017-05-04 ]

Alice, thanks for your comment. It crashes in debug builds only. I updated the bug description to mention debug build.

Comment by Elena Stepanova [ 2017-05-04 ]

Might be a duplicate of, or related to, MDEV-7049.

Generated at Thu Feb 08 07:59:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.