summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorChad MILLER <chad@mysql.com>2008-08-15 16:13:27 -0400
committerChad MILLER <chad@mysql.com>2008-08-15 16:13:27 -0400
commit2941024852e7bb761b0a967ebabe05bb436d3674 (patch)
tree5745bf83cb4340a9a6d9cf6535ad31a1af5acda8 /sql/sql_show.cc
parentd0cf2fa6e73fd9987546dc7fca80e2c661b05876 (diff)
downloadmariadb-git-2941024852e7bb761b0a967ebabe05bb436d3674.tar.gz
Bug#37301 Length and Max_length differ with no obvious reason(2nd version)
Length value is the length of the field, Max_length is the length of the field value. So Max_length can not be more than Length. The fix: fixed calculation of the Item_empty_string item length (Patch applied and queued on demand of Trudy/Davi.)
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index a80319785bd..c30e0a00d95 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -3666,12 +3666,10 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
/* Don't let unimplemented types pass through. Could be a grave error. */
DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING);
- /* this should be changed when Item_empty_string is fixed(in 4.1) */
- if (!(item= new Item_empty_string("", 0, cs)))
+ if (!(item= new Item_empty_string("", fields_info->field_length, cs)))
{
DBUG_RETURN(0);
}
- item->max_length= fields_info->field_length * cs->mbmaxlen;
item->set_name(fields_info->field_name,
strlen(fields_info->field_name), cs);
break;