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.
parent 154f7f39
...@@ -3592,7 +3592,16 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) ...@@ -3592,7 +3592,16 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(0); DBUG_RETURN(0);
} }
break; 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: 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) */ /* 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("", 0, cs)))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment