summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2004-11-25 13:33:31 +0000
committerunknown <tomas@poseidon.ndb.mysql.com>2004-11-25 13:33:31 +0000
commit3346feb8df7894d80e40c5dbbf64eaf78ad9234f (patch)
treee75ee46033a15986e69f6355f4f36ed7aadcdb5c /sql/table.cc
parenta0f2ecf7fbb0194ed26a8b6dadd4fffa672c46bc (diff)
parent207676814b6f464441498e95ad809498a2948130 (diff)
downloadmariadb-git-3346feb8df7894d80e40c5dbbf64eaf78ad9234f.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0 mysql-test/r/fulltext.result: Auto merged sql/item_func.cc: Auto merged sql/item_sum.h: Auto merged sql/table.cc: Auto merged
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 625f04846a8..63575f30326 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -486,7 +486,26 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
/* old frm file */
field_type= (enum_field_types) f_packtype(pack_flag);
- charset=f_is_binary(pack_flag) ? &my_charset_bin : outparam->table_charset;
+ if (f_is_binary(pack_flag))
+ {
+ /*
+ Try to choose the best 4.1 type:
+ - for 4.0 "CHAR(N) BINARY" or "VARCHAR(N) BINARY"
+ try to find a binary collation for character set.
+ - for other types (e.g. BLOB) just use my_charset_bin.
+ */
+ if (!f_is_blob(pack_flag))
+ {
+ // 3.23 or 4.0 string
+ if (!(charset= get_charset_by_csname(outparam->table_charset->csname,
+ MY_CS_BINSORT, MYF(0))))
+ charset= &my_charset_bin;
+ }
+ else
+ charset= &my_charset_bin;
+ }
+ else
+ charset= outparam->table_charset;
bzero((char*) &comment, sizeof(comment));
}
*field_ptr=reg_field=