summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorunknown <ingo@production.mysql.com>2005-11-21 23:30:14 +0100
committerunknown <ingo@production.mysql.com>2005-11-21 23:30:14 +0100
commit539e6d882a093772efafafd2e658dbf4eb537fee (patch)
tree70b58e9d2e16b63ef97aee13db9c53739112ecbc /sql/field.cc
parent344dadef77202f08fd481704653847b56c424ca7 (diff)
parenta40510e4a8367557191b9d330daddd7644fcaa80 (diff)
downloadmariadb-git-539e6d882a093772efafafd2e658dbf4eb537fee.tar.gz
Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.0
into production.mysql.com:/usersnfs/istruewing/autopush/mysql-5.0 sql/field.cc: Auto merged
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/sql/field.cc b/sql/field.cc
index f9457886dfb..b70e2a92618 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -6194,6 +6194,8 @@ uint Field_string::max_packed_col_length(uint max_length)
Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
{
+ Field *new_field;
+
if (type() != MYSQL_TYPE_VAR_STRING || table == new_table)
return Field::new_field(root, new_table);
@@ -6202,15 +6204,16 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table)
This is done to ensure that ALTER TABLE will convert old VARCHAR fields
to now VARCHAR fields.
*/
- Field *new_field= new Field_varstring(field_length, maybe_null(),
- field_name, new_table,
- charset());
- /*
- 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.
- */
- new_field->ptr= ptr;
+ if (new_field= new Field_varstring(field_length, maybe_null(),
+ field_name, new_table, charset()))
+ {
+ /*
+ 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.
+ */
+ new_field->ptr= ptr;
+ }
return new_field;
}