diff options
-rw-r--r-- | mysql-test/main/period_name.result | 9 | ||||
-rw-r--r-- | mysql-test/main/period_name.test | 11 | ||||
-rw-r--r-- | mysql-test/suite/period/r/create.result | 8 | ||||
-rw-r--r-- | mysql-test/suite/period/t/create.test | 11 | ||||
-rw-r--r-- | sql/sql_const.h | 2 |
5 files changed, 40 insertions, 1 deletions
diff --git a/mysql-test/main/period_name.result b/mysql-test/main/period_name.result new file mode 100644 index 00000000000..85004469cd1 --- /dev/null +++ b/mysql-test/main/period_name.result @@ -0,0 +1,9 @@ +# +# MDEV-29387: Period name with more than 32 symbols crashes the server +# +# test 34 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890` (s,e)); +drop table t2; +# test 64 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890123456789012345678901234567890` (s,e)); +drop table t2; diff --git a/mysql-test/main/period_name.test b/mysql-test/main/period_name.test new file mode 100644 index 00000000000..bc9178350be --- /dev/null +++ b/mysql-test/main/period_name.test @@ -0,0 +1,11 @@ +--echo # +--echo # MDEV-29387: Period name with more than 32 symbols crashes the server +--echo # + +--echo # test 34 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890` (s,e)); +drop table t2; + +--echo # test 64 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890123456789012345678901234567890` (s,e)); +drop table t2; diff --git a/mysql-test/suite/period/r/create.result b/mysql-test/suite/period/r/create.result index 58e0b82d085..eb4e110b1b2 100644 --- a/mysql-test/suite/period/r/create.result +++ b/mysql-test/suite/period/r/create.result @@ -100,3 +100,11 @@ show status like "Feature_application_time_periods"; Variable_name Value Feature_application_time_periods 6 drop table t; +# MDEV-29387: Period name with more than 32 symbols crashes the server +# +# test 34 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890` (s,e)); +drop table t2; +# test 64 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890123456789012345678901234567890` (s,e)); +drop table t2; diff --git a/mysql-test/suite/period/t/create.test b/mysql-test/suite/period/t/create.test index 49dcc6ad3c7..081c37d2e9f 100644 --- a/mysql-test/suite/period/t/create.test +++ b/mysql-test/suite/period/t/create.test @@ -85,3 +85,14 @@ insert t values (2, '2001-01-01', '2001-01-01'); show status like "Feature_application_time_periods"; drop table t; + +--echo # MDEV-29387: Period name with more than 32 symbols crashes the server +--echo # + +--echo # test 34 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890` (s,e)); +drop table t2; + +--echo # test 64 symbols +create table t2 (s date, e date, period for `abcd123456789012345678901234567890123456789012345678901234567890` (s,e)); +drop table t2;
\ No newline at end of file diff --git a/sql/sql_const.h b/sql/sql_const.h index f7c820c727b..acbddcbf76e 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -29,7 +29,7 @@ /* extra 4+4 bytes for slave tmp tables */ #define MAX_DBKEY_LENGTH (NAME_LEN*2+1+1+4+4) #define MAX_ALIAS_NAME 256 -#define MAX_FIELD_NAME 34 /* Max colum name length +2 */ +#define MAX_FIELD_NAME (NAME_LEN+1) /* Max colum name length +2 */ #define MAX_SYS_VAR_LENGTH 32 #define MAX_KEY MAX_INDEXES /* Max used keys */ #define MAX_REF_PARTS 32 /* Max parts used as ref */ |