Commit 0df22a53 authored by Jan Lindström's avatar Jan Lindström

MDEV-7050: MySQL#74603 - Assertion `comma_length > 0' failed in mysql_prepare_create_table

Incorrect array lenght for comma buffer.
parent d85168e4
...@@ -2477,3 +2477,9 @@ t1 CREATE TABLE `t1` ( ...@@ -2477,3 +2477,9 @@ t1 CREATE TABLE `t1` (
`c` char(32) AS (convert(cast(n as char), char)) PERSISTENT `c` char(32) AS (convert(cast(n as char), char)) PERSISTENT
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
set @@session.collation_server=filename;
create table t1(a enum('',''));
Warnings:
Note 1291 Column 'a' has duplicated value '' in ENUM
drop table t1;
set @@session.collation_server=default;
...@@ -2053,3 +2053,11 @@ select * from t1; ...@@ -2053,3 +2053,11 @@ select * from t1;
show create table t1; show create table t1;
drop table t1; drop table t1;
#
# MDEV-7050: MySQL#74603 - Assertion `comma_length > 0' failed in mysql_prepare_create_table
#
set @@session.collation_server=filename;
create table t1(a enum('',''));
drop table t1;
set @@session.collation_server=default;
...@@ -2986,7 +2986,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -2986,7 +2986,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->interval_list); sql_field->interval_list);
List_iterator<String> int_it(sql_field->interval_list); List_iterator<String> int_it(sql_field->interval_list);
String conv, *tmp; String conv, *tmp;
char comma_buf[4]; /* 4 bytes for utf32 */ char comma_buf[5]; /* 5 bytes for 'filename' charset */
DBUG_ASSERT(sizeof(comma_buf) >= cs->mbmaxlen);
int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf, int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf,
(uchar*) comma_buf + (uchar*) comma_buf +
sizeof(comma_buf)); sizeof(comma_buf));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment