summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <tsmith@ramayana.hindu.god>2007-08-01 18:14:50 -0600
committerunknown <tsmith@ramayana.hindu.god>2007-08-01 18:14:50 -0600
commit41ac5d83b228e29345882b28517a0ba6933ecafb (patch)
tree388d81a01a0bea738fcd0d47b69dca3795b38441 /sql/sql_table.cc
parent25723542a1ffcd3365b51a48bbab0e238306ab2a (diff)
parent1b04b4b11382f63b5b276d0f5d046b29adca72d0 (diff)
downloadmariadb-git-41ac5d83b228e29345882b28517a0ba6933ecafb.tar.gz
Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into ramayana.hindu.god:/home/tsmith/m/bk/maint/50 mysql-test/r/federated.result: Auto merged mysql-test/t/federated.test: Auto merged sql/ha_federated.h: Auto merged sql/item_func.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_table.cc: Auto merged mysql-test/r/innodb_mysql.result: Manual merge mysql-test/t/innodb_mysql.test: Manual merge
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index cc786c741c1..49b30aad9e2 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1357,6 +1357,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
+ /* Align key length to multibyte char boundary */
+ length-= length % sql_field->charset->mbmaxlen;
}
else
{
@@ -1387,8 +1389,6 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
{
length= file->max_key_part_length();
- /* Align key length to multibyte char boundary */
- length-= length % sql_field->charset->mbmaxlen;
if (key->type == Key::MULTIPLE)
{
/* not a critical problem */
@@ -1397,6 +1397,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
+ /* Align key length to multibyte char boundary */
+ length-= length % sql_field->charset->mbmaxlen;
}
else
{