Post-review fixes for bug #19089

This commit is contained in:
igor@rurik.mysql.com 2006-05-22 07:57:46 -07:00
parent 4a27cbfd02
commit a6aaca7d6a
4 changed files with 10 additions and 3 deletions

View file

@ -2716,7 +2716,7 @@ SELECT * FROM t2;
a m
xxx 1
yyy 5
NULL 0
xxx 0
DROP VIEW v1;
DROP TABLE t1,t2;
CREATE TABLE t1 (id int PRIMARY KEY, e ENUM('a','b') NOT NULL DEFAULT 'b');

View file

@ -1228,12 +1228,11 @@ Field::Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
field_name(field_name_arg),
query_id(0), key_start(0), part_of_key(0), part_of_sortkey(0),
unireg_check(unireg_check_arg),
field_length(length_arg),null_bit(null_bit_arg)
field_length(length_arg), null_bit(null_bit_arg), dflt_field(0)
{
flags=null_ptr ? 0: NOT_NULL_FLAG;
comment.str= (char*) "";
comment.length=0;
dflt_field= 0;
}
uint Field::offset()

View file

@ -53,6 +53,11 @@ public:
char *ptr; // Position to field in record
uchar *null_ptr; // Byte where null_bit is
/*
dflt_field is used only for the fields of temporary tables.
It points to the default value of the field in another table
from which this field has been created.
*/
Field *dflt_field; // Field to copy default value from
/*
Note that you can use table->in_use as replacement for current_thd member

View file

@ -8697,7 +8697,10 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
if (is_null)
field->set_null();
else
{
field->set_notnull();
memcpy(field->ptr, from, field->pack_length());
}
}
if (from_field[i])