Commit 321708d3 authored by unknown's avatar unknown

Post-review fixes for bug #19089


mysql-test/r/view.result:
  Post-review fixes.
sql/field.cc:
  Post-review fixes.
sql/field.h:
  Post-review fixes.
sql/sql_select.cc:
  Post-review fixes.
parent 960578fd
......@@ -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');
......
......@@ -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()
......
......@@ -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
......
......@@ -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])
......
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