Commit 329e0637 authored by unknown's avatar unknown

bugs #701 and #783 - old .frm files were read in incorrectly in 4.1 (each...

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)


parent 683e3ef0
...@@ -1163,6 +1163,7 @@ bool test_if_int(const char *str, int length, const char *int_end, ...@@ -1163,6 +1163,7 @@ bool test_if_int(const char *str, int length, const char *int_end,
#define f_packtype(x) (((x) >> FIELDFLAG_PACK_SHIFT) & 15) #define f_packtype(x) (((x) >> FIELDFLAG_PACK_SHIFT) & 15)
#define f_decimals(x) ((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC)) #define f_decimals(x) ((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC))
#define f_is_alpha(x) (!f_is_num(x)) #define f_is_alpha(x) (!f_is_num(x))
#define f_is_binary(x) ((x) & FIELDFLAG_BINARY) // 4.0- compatibility
#define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL) #define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL)
#define f_is_bitfield(x) ((x) & FIELDFLAG_BITFIELD) #define f_is_bitfield(x) ((x) & FIELDFLAG_BITFIELD)
#define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB) #define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB)
......
...@@ -138,7 +138,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, ...@@ -138,7 +138,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
outparam->raid_chunks= head[42]; outparam->raid_chunks= head[42];
outparam->raid_chunksize= uint4korr(head+43); outparam->raid_chunksize= uint4korr(head+43);
if (!(outparam->table_charset=get_charset((uint) head[38],MYF(0)))) 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; null_field_first=1;
} }
outparam->db_record_offset=1; outparam->db_record_offset=1;
...@@ -398,8 +398,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, ...@@ -398,8 +398,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (!strpos[14]) if (!strpos[14])
charset= &my_charset_bin; charset= &my_charset_bin;
else if (!(charset=get_charset((uint) strpos[14], MYF(0)))) else if (!(charset=get_charset((uint) strpos[14], MYF(0))))
charset= (outparam->table_charset ? outparam->table_charset: charset= outparam->table_charset;
default_charset_info);
} }
if (!comment_length) if (!comment_length)
{ {
...@@ -423,8 +422,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, ...@@ -423,8 +422,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
/* old frm file */ /* old frm file */
field_type= (enum_field_types) f_packtype(pack_flag); field_type= (enum_field_types) f_packtype(pack_flag);
charset=(outparam->table_charset ? outparam->table_charset : charset=f_is_binary(pack_flag) ? &my_charset_bin : outparam->table_charset;
default_charset_info);
bzero((char*) &comment, sizeof(comment)); bzero((char*) &comment, sizeof(comment));
} }
*field_ptr=reg_field= *field_ptr=reg_field=
......
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