Bug#27047 INFORMATION_SCHEMA table cannot have BIGINT fields

added support for DATE, TIME, BLOB, FLOAT and all *INT variants in I_S tables
parent 07fc4f2a
...@@ -1840,33 +1840,57 @@ public: ...@@ -1840,33 +1840,57 @@ public:
/* for show tables */ /* for show tables */
class Item_partition_func_safe_string: public Item_string
class Item_datetime :public Item_string
{ {
public: public:
Item_datetime(const char *item_name): Item_string(item_name,"",0, Item_partition_func_safe_string(const char *name, uint length,
&my_charset_bin) CHARSET_INFO *cs= NULL):
{ max_length=19;} Item_string(name, length, cs)
enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } {}
bool check_partition_func_processor(byte *int_arg) {return TRUE;} bool check_partition_func_processor(byte *int_arg) {return TRUE;}
}; };
class Item_empty_string :public Item_string
class Item_return_date_time :public Item_partition_func_safe_string
{
enum_field_types date_time_field_type;
public:
Item_return_date_time(const char *name_arg, enum_field_types field_type_arg)
:Item_partition_func_safe_string(name_arg, 0, &my_charset_bin),
date_time_field_type(field_type_arg)
{ }
enum_field_types field_type() const { return date_time_field_type; }
};
class Item_blob :public Item_partition_func_safe_string
{
public:
Item_blob(const char *name, uint length) :
Item_partition_func_safe_string(name, length, &my_charset_bin)
{ max_length= length; }
enum Type type() const { return TYPE_HOLDER; }
enum_field_types field_type() const { return MYSQL_TYPE_BLOB; }
};
class Item_empty_string :public Item_partition_func_safe_string
{ {
public: public:
Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) :
Item_string("",0, cs ? cs : &my_charset_bin) Item_partition_func_safe_string("",0, cs ? cs : &my_charset_bin)
{ name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; }
void make_field(Send_field *field); void make_field(Send_field *field);
}; };
class Item_return_int :public Item_int class Item_return_int :public Item_int
{ {
enum_field_types int_field_type; enum_field_types int_field_type;
public: public:
Item_return_int(const char *name_arg, uint length, Item_return_int(const char *name_arg, uint length,
enum_field_types field_type_arg) enum_field_types field_type_arg, longlong value= 0)
:Item_int(name_arg, 0, length), int_field_type(field_type_arg) :Item_int(name_arg, value, length), int_field_type(field_type_arg)
{ {
unsigned_flag=1; unsigned_flag=1;
} }
......
...@@ -784,7 +784,9 @@ db_show_routine_status(THD *thd, int type, const char *wild) ...@@ -784,7 +784,9 @@ db_show_routine_status(THD *thd, int type, const char *wild)
{ {
switch (used_field->field_type) { switch (used_field->field_type) {
case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_TIMESTAMP:
field_list.push_back(item=new Item_datetime(used_field->field_name)); field_list.push_back(item=
new Item_return_date_time(used_field->field_name,
MYSQL_TYPE_DATETIME));
break; break;
default: default:
field_list.push_back(item=new Item_empty_string(used_field->field_name, field_list.push_back(item=new Item_empty_string(used_field->field_name,
......
This diff is collapsed.
...@@ -554,13 +554,17 @@ enum enum_schema_tables ...@@ -554,13 +554,17 @@ enum enum_schema_tables
}; };
#define MY_I_S_MAYBE_NULL 1
#define MY_I_S_UNSIGNED 2
typedef struct st_field_info typedef struct st_field_info
{ {
const char* field_name; const char* field_name;
uint field_length; uint field_length;
enum enum_field_types field_type; enum enum_field_types field_type;
int value; int value;
bool maybe_null; uint field_flags; // Field atributes(maybe_null, signed, unsigned etc.)
const char* old_name; const char* old_name;
} ST_FIELD_INFO; } ST_FIELD_INFO;
......
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