diff options
author | unknown <cmiller@zippy.cornsilk.net> | 2007-07-03 12:20:19 -0400 |
---|---|---|
committer | unknown <cmiller@zippy.cornsilk.net> | 2007-07-03 12:20:19 -0400 |
commit | fd70537309701acc51a0f92ac46e495363221e07 (patch) | |
tree | 0047088e444a1d70a42c9b5ef897efb4af7ee8df /sql/sql_show.cc | |
parent | 83e4f46e4bb0f304878f4a87bf20d5f595bc30e3 (diff) | |
download | mariadb-git-fd70537309701acc51a0f92ac46e495363221e07.tar.gz |
In 5.0, Field_double::val_str uses "%g" to render floating point
numbers, which uses "X.YeZ" notation when the exponent Z would be
less than -4. That behavior at -4 is not exactly what we want, and
our Decimal type offers smarter number representation. By changing
profiling to use Decimal types, we get more readable output.
sql/sql_profile.cc:
Change the DOUBLE I_S types to DECIMAL, so we get a smarter
floating-point number renderer.
sql/sql_show.cc:
Add MYSQL_TYPE_DECIMAL as a string-ish type that INFORMATION_SCHEMA
tables may use.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index d37fb3fb6a9..e1e332ff03d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3657,11 +3657,18 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) fields_info->field_length)) == NULL) DBUG_RETURN(NULL); break; + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_STRING: default: /* Don't let unimplemented types pass through. Could be a grave error. */ - DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING); + DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING || + fields_info->field_type == MYSQL_TYPE_DECIMAL); - /* this should be changed when Item_empty_string is fixed(in 4.1) */ + /** + @todo Change when Item_empty_string is fixed (in 4.1). [Presumably, + this means removing the first of two steps: setting a useless, bogus + value; and then setting the attributes.] + */ if (!(item= new Item_empty_string("", 0, cs))) { DBUG_RETURN(0); |