Loading mysql-test/r/metadata.result +4 −4 Original line number Diff line number Diff line Loading @@ -65,22 +65,22 @@ insert into t1 values (1,'one'); insert into t1 values (2,'two'); set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg00 @arg00 8 20 1 Y 32768 0 63 @arg00 1 select * from (select @arg00) aaa; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def aaa @arg00 @arg00 8 20 1 Y 32768 0 63 @arg00 1 select 1 union select 1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def 1 1 8 20 1 N 32769 0 63 1 1 select * from (select 1 union select 1) aaa; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def aaa 1 1 8 20 1 N 32769 0 63 1 1 Loading sql/item.cc +22 −16 Original line number Diff line number Diff line Loading @@ -2908,24 +2908,30 @@ uint32 Item_type_holder::display_length(Item *item) Field *Item_type_holder::make_field_by_type(TABLE *table) { if (fld_type == MYSQL_TYPE_ENUM || fld_type == MYSQL_TYPE_SET) { DBUG_ASSERT(enum_set_typelib); /* The field functions defines a field to be not null if null_ptr is not 0 */ uchar *null_ptr= maybe_null ? (uchar*) "" : 0; if (fld_type == MYSQL_TYPE_ENUM) switch (fld_type) { case MYSQL_TYPE_ENUM: DBUG_ASSERT(enum_set_typelib); return new Field_enum((char *) 0, max_length, null_ptr, 0, Field::NONE, name, table, get_enum_pack_length(enum_set_typelib->count), enum_set_typelib, collation.collation); else case MYSQL_TYPE_SET: DBUG_ASSERT(enum_set_typelib); return new Field_set((char *) 0, max_length, null_ptr, 0, Field::NONE, name, table, get_set_pack_length(enum_set_typelib->count), enum_set_typelib, collation.collation); case MYSQL_TYPE_VAR_STRING: table->db_create_options|= HA_OPTION_PACK_RECORD; return new Field_string(max_length, maybe_null, name, table, collation.collation); default: break; } return tmp_table_field_from_field_type(table); } Loading Loading
mysql-test/r/metadata.result +4 −4 Original line number Diff line number Diff line Loading @@ -65,22 +65,22 @@ insert into t1 values (1,'one'); insert into t1 values (2,'two'); set @arg00=1 ; select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def @arg00 @arg00 8 20 1 Y 32768 0 63 @arg00 1 select * from (select @arg00) aaa; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def aaa @arg00 @arg00 8 20 1 Y 32768 0 63 @arg00 1 select 1 union select 1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def 1 1 8 20 1 N 32769 0 63 1 1 select * from (select 1 union select 1) aaa; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def aaa 1 1 8 20 1 N 32769 0 63 1 1 Loading
sql/item.cc +22 −16 Original line number Diff line number Diff line Loading @@ -2908,24 +2908,30 @@ uint32 Item_type_holder::display_length(Item *item) Field *Item_type_holder::make_field_by_type(TABLE *table) { if (fld_type == MYSQL_TYPE_ENUM || fld_type == MYSQL_TYPE_SET) { DBUG_ASSERT(enum_set_typelib); /* The field functions defines a field to be not null if null_ptr is not 0 */ uchar *null_ptr= maybe_null ? (uchar*) "" : 0; if (fld_type == MYSQL_TYPE_ENUM) switch (fld_type) { case MYSQL_TYPE_ENUM: DBUG_ASSERT(enum_set_typelib); return new Field_enum((char *) 0, max_length, null_ptr, 0, Field::NONE, name, table, get_enum_pack_length(enum_set_typelib->count), enum_set_typelib, collation.collation); else case MYSQL_TYPE_SET: DBUG_ASSERT(enum_set_typelib); return new Field_set((char *) 0, max_length, null_ptr, 0, Field::NONE, name, table, get_set_pack_length(enum_set_typelib->count), enum_set_typelib, collation.collation); case MYSQL_TYPE_VAR_STRING: table->db_create_options|= HA_OPTION_PACK_RECORD; return new Field_string(max_length, maybe_null, name, table, collation.collation); default: break; } return tmp_table_field_from_field_type(table); } Loading