mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
bugs #701 and #783 - old .frm files were read in incorrectly in 4.1 (each field was assigned a charset, BLOBs were converted to TEXT)
This commit is contained in:
@@ -1132,7 +1132,7 @@ bool test_if_int(const char *str, int length, const char *int_end,
|
||||
*/
|
||||
|
||||
#define FIELDFLAG_DECIMAL 1
|
||||
#define FIELDFLAG_BINARY 1 // Shares same flag
|
||||
#define FIELDFLAG_BINARY 1 // Shares same flag
|
||||
#define FIELDFLAG_NUMBER 2
|
||||
#define FIELDFLAG_ZEROFILL 4
|
||||
#define FIELDFLAG_PACK 120 // Bits used for packing
|
||||
@@ -1163,7 +1163,8 @@ bool test_if_int(const char *str, int length, const char *int_end,
|
||||
#define f_packtype(x) (((x) >> FIELDFLAG_PACK_SHIFT) & 15)
|
||||
#define f_decimals(x) ((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC))
|
||||
#define f_is_alpha(x) (!f_is_num(x))
|
||||
#define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL)
|
||||
#define f_is_binary(x) ((x) & FIELDFLAG_BINARY) // 4.0- compatibility
|
||||
#define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL)
|
||||
#define f_is_bitfield(x) ((x) & FIELDFLAG_BITFIELD)
|
||||
#define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB)
|
||||
#define f_is_geom(x) ((x) & FIELDFLAG_GEOM)
|
||||
|
||||
10
sql/table.cc
10
sql/table.cc
@@ -138,7 +138,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
||||
outparam->raid_chunks= head[42];
|
||||
outparam->raid_chunksize= uint4korr(head+43);
|
||||
if (!(outparam->table_charset=get_charset((uint) head[38],MYF(0))))
|
||||
outparam->table_charset=NULL; // QQ display error message?
|
||||
outparam->table_charset=default_charset_info; // QQ display error message?
|
||||
null_field_first=1;
|
||||
}
|
||||
outparam->db_record_offset=1;
|
||||
@@ -398,8 +398,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
||||
if (!strpos[14])
|
||||
charset= &my_charset_bin;
|
||||
else if (!(charset=get_charset((uint) strpos[14], MYF(0))))
|
||||
charset= (outparam->table_charset ? outparam->table_charset:
|
||||
default_charset_info);
|
||||
charset= outparam->table_charset;
|
||||
}
|
||||
if (!comment_length)
|
||||
{
|
||||
@@ -423,8 +422,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
||||
|
||||
/* old frm file */
|
||||
field_type= (enum_field_types) f_packtype(pack_flag);
|
||||
charset=(outparam->table_charset ? outparam->table_charset :
|
||||
default_charset_info);
|
||||
charset=f_is_binary(pack_flag) ? &my_charset_bin : outparam->table_charset;
|
||||
bzero((char*) &comment, sizeof(comment));
|
||||
}
|
||||
*field_ptr=reg_field=
|
||||
@@ -599,7 +597,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
||||
}
|
||||
keyinfo->usable_key_parts=usable_parts; // Filesort
|
||||
}
|
||||
if (primary_key < MAX_KEY &&
|
||||
if (primary_key < MAX_KEY &&
|
||||
(outparam->keys_in_use & ((key_map) 1 << primary_key)))
|
||||
{
|
||||
outparam->primary_key=primary_key;
|
||||
|
||||
Reference in New Issue
Block a user