mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fix error message when creating a non-string field with a display
width beyond the maximum. (Bug #6080) mysql-test/r/errors.result: Update results mysql-test/r/type_bit.result: Update results mysql-test/r/type_bit_innodb.result: Update results mysql-test/t/errors.test: Add new regression test mysql-test/t/type_bit_innodb.test: Update error code in test sql/share/errmsg.txt: Add new error message sql/sql_parse.cc: Display more appropriate error message for column creation that fails due to a non-string field with a display width that is too big.
This commit is contained in:
@@ -5819,7 +5819,7 @@ new_create_field(THD *thd, char *field_name, enum_field_types type,
|
||||
new_field->length= 1;
|
||||
if (new_field->length > MAX_BIT_FIELD_LENGTH)
|
||||
{
|
||||
my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), field_name,
|
||||
my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), field_name,
|
||||
MAX_BIT_FIELD_LENGTH);
|
||||
DBUG_RETURN(NULL);
|
||||
}
|
||||
@@ -5838,7 +5838,10 @@ new_create_field(THD *thd, char *field_name, enum_field_types type,
|
||||
type != MYSQL_TYPE_STRING &&
|
||||
type != MYSQL_TYPE_VARCHAR && type != FIELD_TYPE_GEOMETRY)))
|
||||
{
|
||||
my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0),
|
||||
my_error((type == MYSQL_TYPE_VAR_STRING || type == MYSQL_TYPE_VARCHAR ||
|
||||
type == MYSQL_TYPE_STRING) ? ER_TOO_BIG_FIELDLENGTH :
|
||||
ER_TOO_BIG_DISPLAYWIDTH,
|
||||
MYF(0),
|
||||
field_name, max_field_charlength); /* purecov: inspected */
|
||||
DBUG_RETURN(NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user