diff options
author | evgen@sunlight.local <> | 2006-04-05 20:12:26 +0400 |
---|---|---|
committer | evgen@sunlight.local <> | 2006-04-05 20:12:26 +0400 |
commit | 368b92390c4e522636799be7078b4c4f961dfee3 (patch) | |
tree | caadf65dd865136ee2466310baad951b9add3fef /sql | |
parent | 139808f0207a23acf4d97add87c8d9330bc02e12 (diff) | |
parent | d07240599d5a26ce10fddf6b942f62dc2293442c (diff) | |
download | mariadb-git-368b92390c4e522636799be7078b4c4f961dfee3.tar.gz |
Manually merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.h | 9 | ||||
-rw-r--r-- | sql/sql_update.cc | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sql/field.h b/sql/field.h index 8829aac65bd..936babdd26a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1000,20 +1000,23 @@ public: class Field_string :public Field_longstr { public: + bool can_alter_field_type; Field_string(char *ptr_arg, uint32 len_arg,uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, CHARSET_INFO *cs) :Field_longstr(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, - unireg_check_arg, field_name_arg, cs) {}; + unireg_check_arg, field_name_arg, cs), + can_alter_field_type(1) {}; Field_string(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg, CHARSET_INFO *cs) :Field_longstr((char*) 0, len_arg, maybe_null_arg ? (uchar*) "": 0, 0, - NONE, field_name_arg, cs) {}; + NONE, field_name_arg, cs), + can_alter_field_type(1) {}; enum_field_types type() const { - return ((orig_table && + return ((can_alter_field_type && orig_table && orig_table->s->db_create_options & HA_OPTION_PACK_RECORD && field_length >= 4) && orig_table->s->frm_version < FRM_VER_TRUE_VARCHAR ? diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b19d6504b2e..75e8db6621f 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1229,6 +1229,11 @@ multi_update::initialize_tables(JOIN *join) Field_string offset(table->file->ref_length, 0, "offset", &my_charset_bin); offset.init(table); + /* + The field will be converted to varstring when creating tmp table if + table to be updated was created by mysql 4.1. Deny this. + */ + offset.can_alter_field_type= 0; if (!(ifield= new Item_field(((Field *) &offset)))) DBUG_RETURN(1); ifield->maybe_null= 0; |