mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +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. include/mysql_com.h: BUG#4788 - show create table provides incorrect statement. Introduced definitions for default field width of numeric types. So common values can be used at different places in the code. mysql-test/r/variables.result: BUG#4788 - show create table provides incorrect statement. New test results. mysql-test/t/variables.test: BUG#4788 - show create table provides incorrect statement. Added a test for the bug. sql/item_func.cc: BUG#4788 - show create table provides incorrect statement. Added code to adjust the field_length of user variables in dependence on the field type. sql/sql_parse.cc: BUG#4788 - show create table provides incorrect statement. Changed numeric literals to the new constants.
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