summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.local>2006-07-13 00:18:59 +0400
committerunknown <kostja@bodhi.local>2006-07-13 00:18:59 +0400
commit26f0d13d0163beba2ae4f96396302b0c44407c65 (patch)
tree72d131bf20c7f83d51448986e035a8f9cbfb5c73 /sql/field.cc
parente8699b56140571305b898c29bdc45a5bab117a45 (diff)
parentfe4ed2440dad75c005465315199243cdec36a7f4 (diff)
downloadmariadb-git-26f0d13d0163beba2ae4f96396302b0c44407c65.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge sql/ha_ndbcluster.cc: Auto merged sql/ha_partition.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged mysql-test/r/federated.result: Manual merge. mysql-test/t/federated.test: Manual merge. sql/sql_insert.cc: Manual merge.
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc28
1 files changed, 11 insertions, 17 deletions
diff --git a/sql/field.cc b/sql/field.cc
index bb4530dc377..0377d0a62da 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1536,7 +1536,8 @@ bool Field::optimize_range(uint idx, uint part)
}
-Field *Field::new_field(MEM_ROOT *root, struct st_table *new_table)
+Field *Field::new_field(MEM_ROOT *root, struct st_table *new_table,
+ bool keep_type __attribute__((unused)))
{
Field *tmp;
if (!(tmp= (Field*) memdup_root(root,(char*) this,size_of())))
@@ -1561,7 +1562,7 @@ Field *Field::new_key_field(MEM_ROOT *root, struct st_table *new_table,
uint new_null_bit)
{
Field *tmp;
- if ((tmp= new_field(root, new_table)))
+ if ((tmp= new_field(root, new_table, table == new_table)))
{
tmp->ptr= new_ptr;
tmp->null_ptr= new_null_ptr;
@@ -6371,11 +6372,12 @@ uint Field_string::max_packed_col_length(uint max_length)
}
-Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
+Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table,
+ bool keep_type)
{
Field *field;
- if (type() != MYSQL_TYPE_VAR_STRING || table == new_table)
- return Field::new_field(root, new_table);
+ if (type() != MYSQL_TYPE_VAR_STRING || keep_type)
+ return Field::new_field(root, new_table, keep_type);
/*
Old VARCHAR field which should be modified to a VARCHAR on copy
@@ -6384,17 +6386,7 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
*/
if ((field= new Field_varstring(field_length, maybe_null(), field_name,
new_table->s, charset())))
- {
field->init(new_table);
- /*
- delayed_insert::get_local_table() needs a ptr copied from old table.
- This is what other new_field() methods do too. The above method of
- Field_varstring sets ptr to NULL.
- */
- field->ptr= ptr;
- field->null_ptr= null_ptr;
- field->null_bit= null_bit;
- }
return field;
}
@@ -6896,9 +6888,11 @@ int Field_varstring::cmp_binary(const char *a_ptr, const char *b_ptr,
}
-Field *Field_varstring::new_field(MEM_ROOT *root, struct st_table *new_table)
+Field *Field_varstring::new_field(MEM_ROOT *root, struct st_table *new_table,
+ bool keep_type)
{
- Field_varstring *res= (Field_varstring*) Field::new_field(root, new_table);
+ Field_varstring *res= (Field_varstring*) Field::new_field(root, new_table,
+ keep_type);
if (res)
res->length_bytes= length_bytes;
return res;