mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
Port r125 from branches/5.0:
dict_load_columns(): Set the charset-collation code DATA_MYSQL_BINARY_CHARSET_COLL for those binary string columns that lack a charset-collation code, i.e., the tables were created with an older version of MySQL/InnoDB than 4.1.2. (Bug #16298)
This commit is contained in:
parent
876f0fbd4f
commit
e5d47f6d70
1 changed files with 15 additions and 5 deletions
|
@ -385,13 +385,23 @@ dict_load_columns(
|
|||
field = rec_get_nth_field_old(rec, 6, &len);
|
||||
prtype = mach_read_from_4(field);
|
||||
|
||||
if (dtype_is_non_binary_string_type(mtype, prtype)
|
||||
&& dtype_get_charset_coll(prtype) == 0) {
|
||||
/* This is a non-binary string type, and the table
|
||||
was created with < 4.1.2. Use the default charset. */
|
||||
if (dtype_get_charset_coll(prtype) == 0
|
||||
&& dtype_is_string_type(mtype)) {
|
||||
/* The table was created with < 4.1.2. */
|
||||
|
||||
prtype = dtype_form_prtype(prtype,
|
||||
if (dtype_is_binary_string_type(mtype, prtype)) {
|
||||
/* Use the binary collation for
|
||||
string columns of binary type. */
|
||||
|
||||
prtype = dtype_form_prtype(prtype,
|
||||
DATA_MYSQL_BINARY_CHARSET_COLL);
|
||||
} else {
|
||||
/* Use the default charset for
|
||||
other than binary columns. */
|
||||
|
||||
prtype = dtype_form_prtype(prtype,
|
||||
data_mysql_default_charset_coll);
|
||||
}
|
||||
}
|
||||
|
||||
field = rec_get_nth_field_old(rec, 7, &len);
|
||||
|
|
Loading…
Add table
Reference in a new issue