mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
BUG#4788 - show create table provides incorrect statement.
Added code to adjust the field_length of user variables in dependence on the field type. Aded new constants for numeric field widths.
This commit is contained in:
@@ -4208,23 +4208,23 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
|
||||
|
||||
switch (type) {
|
||||
case FIELD_TYPE_TINY:
|
||||
if (!length) new_field->length=3+sign_len;
|
||||
if (!length) new_field->length=MAX_TINYINT_WIDTH+sign_len;
|
||||
allowed_type_modifier= AUTO_INCREMENT_FLAG;
|
||||
break;
|
||||
case FIELD_TYPE_SHORT:
|
||||
if (!length) new_field->length=5+sign_len;
|
||||
if (!length) new_field->length=MAX_SMALLINT_WIDTH+sign_len;
|
||||
allowed_type_modifier= AUTO_INCREMENT_FLAG;
|
||||
break;
|
||||
case FIELD_TYPE_INT24:
|
||||
if (!length) new_field->length=8+sign_len;
|
||||
if (!length) new_field->length=MAX_MEDIUMINT_WIDTH+sign_len;
|
||||
allowed_type_modifier= AUTO_INCREMENT_FLAG;
|
||||
break;
|
||||
case FIELD_TYPE_LONG:
|
||||
if (!length) new_field->length=10+sign_len;
|
||||
if (!length) new_field->length=MAX_INT_WIDTH+sign_len;
|
||||
allowed_type_modifier= AUTO_INCREMENT_FLAG;
|
||||
break;
|
||||
case FIELD_TYPE_LONGLONG:
|
||||
if (!length) new_field->length=20;
|
||||
if (!length) new_field->length=MAX_BIGINT_WIDTH;
|
||||
allowed_type_modifier= AUTO_INCREMENT_FLAG;
|
||||
break;
|
||||
case FIELD_TYPE_NULL:
|
||||
|
Reference in New Issue
Block a user