summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-03-27 11:30:53 -0400
committerunknown <cmiller@zippy.cornsilk.net>2007-03-27 11:30:53 -0400
commit60fb9a03a4e94e651ba459e60bebf38e1de86344 (patch)
tree6e8f648a1d4bc6fc6b40faa16edfb5e116ee9c3b /sql/sql_show.cc
parent9d66be72b0ee079cecc39e09d4f4c0f7e1849dbc (diff)
downloadmariadb-git-60fb9a03a4e94e651ba459e60bebf38e1de86344.tar.gz
Bug#26600: table PROFILING in INFORMATION SCHEMA has wrong data type
Bug#27047[partial]: INFORMATION_SCHEMA table cannot have BIGINT \ fields No Information_schema table has ever needed floating-point data before. Transforming all floating point to a string and back to a number causes a real data problem on Windows, where the libc may pad the exponent with more leading zeroes than we expect and the significant digits are truncated away. This also makes interpreting an unimplemented type as a string into a fatal error in debug builds. Thus, we will catch problems when we try to use those types in new I_S tables. sql/sql_show.cc: Add floating-point types to information_schema output.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 659dd49d537..d9984552048 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -3592,7 +3592,16 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(0);
}
break;
+ case MYSQL_TYPE_FLOAT:
+ case MYSQL_TYPE_DOUBLE:
+ if ((item= new Item_float(fields_info->field_name, 0.0, NOT_FIXED_DEC,
+ fields_info->field_length)) == NULL)
+ DBUG_RETURN(NULL);
+ break;
default:
+ /* 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)))
{