summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2005-03-30 23:08:03 +0300
committerbell@sanja.is.com.ua <>2005-03-30 23:08:03 +0300
commitdc87075f866fb5e146f92b3b2b87d46f73957c7b (patch)
tree6d5c1ce80d730620d6df04640793e8b791bdb704
parentc64efa6062134675c6cb057fc7412ef1ea3a7a56 (diff)
downloadmariadb-git-dc87075f866fb5e146f92b3b2b87d46f73957c7b.tar.gz
postmerge fixes
-rw-r--r--mysql-test/r/metadata.result8
-rw-r--r--sql/item.cc38
2 files changed, 26 insertions, 20 deletions
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 790c1ec3794..8f25e6b7f4a 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -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
diff --git a/sql/item.cc b/sql/item.cc
index 8bc6b878868..f028e1a2a97 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -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)
+ /*
+ The field functions defines a field to be not null if null_ptr is not 0
+ */
+ uchar *null_ptr= maybe_null ? (uchar*) "" : 0;
+ switch (fld_type)
{
+ case MYSQL_TYPE_ENUM:
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)
- 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
- 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);
+ 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);
+ 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);
}