summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-12-23 02:43:46 +0200
committerunknown <monty@hundin.mysql.fi>2001-12-23 02:43:46 +0200
commit953ac1a5cf2acc464c3214e715679e61c4d18c24 (patch)
treec49964609935e7b3c7d648539cf1122a6b4a39b9 /sql/sql_table.cc
parentf70786085b43200a38b022c517dec14bd1041f54 (diff)
downloadmariadb-git-953ac1a5cf2acc464c3214e715679e61c4d18c24.tar.gz
Limit created keys to MAX_KEY_LENGTH.
Fix problem with query cache and database names mysql-test/mysql-test-run.sh: Portability fixes mysql-test/r/query_cache.result: More tests when using different databases mysql-test/t/query_cache.test: More tests when using different databases sql-bench/test-wisconsin.sh: Portability fix sql/sql_cache.cc: Fix problem with query cache and database names sql/sql_parse.cc: Remove pre and end space in query. sql/sql_table.cc: Limit created keys to MAX_KEY_LENGTH.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index d3c11ab8716..6ded046ccbf 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -558,9 +558,10 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
}
}
key_info->key_length=(uint16) key_length;
- if (key_length > file->max_key_length() && key->type != Key::FULLTEXT)
+ uint max_key_length= max(file->max_key_length(), MAX_KEY_LENGTH);
+ if (key_length > max_key_length && key->type != Key::FULLTEXT)
{
- my_error(ER_TOO_LONG_KEY,MYF(0),file->max_key_length());
+ my_error(ER_TOO_LONG_KEY,MYF(0),max_key_length);
DBUG_RETURN(-1);
}
}