diff options
author | unknown <andrey@example.com> | 2006-10-23 13:12:30 +0200 |
---|---|---|
committer | unknown <andrey@example.com> | 2006-10-23 13:12:30 +0200 |
commit | 29947efc6257e3348b00363c4a4ab301249588b3 (patch) | |
tree | fa0d5b44da213ce72839a2daf4fe30f2c2fd5061 /sql/sql_show.cc | |
parent | 04c8b8d15c17c2cd0268659c870b1ec078eaf046 (diff) | |
download | mariadb-git-29947efc6257e3348b00363c4a4ab301249588b3.tar.gz |
Fix for bug#23037 Bug in field "Default" of query "SHOW COLUMNS FROM table"
To the documentor: The DEFAULT value in SHOW COLUMNS/SELECT FROM I_S.COLUMNS
was truncated to NAME_LEN (which effectively is 64) characters.
mysql-test/r/information_schema.result:
Update result
Because the length of I_S.COLUMNS.COLUMN_DEFAULT was increased to
65535 the column changed it's type from varchar(64) to longtext
The type is longtext if the length is > 65532 (the max varchar len)
mysql-test/t/information_schema.test:
test case for bug#23037: Bug in field "Default" of
query "SHOW COLUMNS FROM table"
Both SHOW COLUMNS and I_S.COLUMNS is TESTED as well the
value returned by both. Using --replace_regex is unfeasible
as the repetition value cannot be > 255.
--replace_regex /A{256}/VALUE/ doesn't work, not to talk about
/A{65532}/VALUE/
/(A{255}){255}/VALUE/ is awfully slow. Thus, simple function with
cursor is used to extract the value.
sql/sql_show.cc:
Default value can have TIMESTAMP, CHAR, VARCHAR, ENUM
VARCHAR can have the longest value, up to 65535. However, because
of table handler limitations the actual limit is 65532 characters,
latin1 charset. However, here is used MAX_FIELD_VARCHARLENGTH macro,
because there could be a storage engine without such limitation.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index eb78f4fbdae..ba9a089e782 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4044,7 +4044,7 @@ ST_FIELD_INFO columns_fields_info[]= {"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"COLUMN_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Field"}, {"ORDINAL_POSITION", 21 , MYSQL_TYPE_LONG, 0, 0, 0}, - {"COLUMN_DEFAULT", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, "Default"}, + {"COLUMN_DEFAULT", MAX_FIELD_VARCHARLENGTH, MYSQL_TYPE_STRING, 0, 1, "Default"}, {"IS_NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null"}, {"DATA_TYPE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0}, {"CHARACTER_MAXIMUM_LENGTH", 21 , MYSQL_TYPE_LONG, 0, 1, 0}, |