diff options
author | unknown <serg@serg.mysql.com> | 2000-10-04 17:26:31 +0200 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2000-10-04 17:26:31 +0200 |
commit | 674eea5ff40765898a85a6e8004423095963a2b6 (patch) | |
tree | 574fc49e8c4a7ada06a34ac72e3caf48940377e8 /sql/sql_table.cc | |
parent | cbc817fa0c27a6a2388df1f482c1e66b8e2ec3de (diff) | |
download | mariadb-git-674eea5ff40765898a85a6e8004423095963a2b6.tar.gz |
sql_table.cc key length limit check disabled for FULLTEXT
ft_parser.c Nasty buffer overflow fixed
myisam/ft_parser.c:
Nasty buffer overflow fixed
sql/sql_table.cc:
key length limit check disabled for FULLTEXT
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3cb40d7d9ed..73a06c1a1be 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -469,7 +469,7 @@ 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()) + if (key_length > file->max_key_length() && key->type != Key::FULLTEXT) { my_error(ER_TOO_LONG_KEY,MYF(0),file->max_key_length()); DBUG_RETURN(-1); @@ -725,9 +725,9 @@ bool close_cached_table(THD *thd,TABLE *table) static int send_check_errmsg(THD* thd, TABLE_LIST* table, const char* operator_name, const char* errmsg) - + { - + String* packet = &thd->packet; packet->length(0); net_store_data(packet, table->name); @@ -744,7 +744,7 @@ static int send_check_errmsg(THD* thd, TABLE_LIST* table, static int prepare_for_restore(THD* thd, TABLE_LIST* table) { String *packet = &thd->packet; - + if(table->table) // do not overwrite existing tables on restore { return send_check_errmsg(thd, table, "restore", @@ -757,10 +757,10 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table) char src_path[FN_REFLEN], dst_path[FN_REFLEN]; char* table_name = table->name; char* db = thd->db ? thd->db : table->db; - + if(!fn_format(src_path, table_name, backup_dir, reg_ext, 4 + 64)) return -1; // protect buffer overflow - + sprintf(dst_path, "%s/%s/%s", mysql_real_data_home, db, table_name); int lock_retcode; @@ -770,14 +770,14 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table) pthread_mutex_unlock(&LOCK_open); return -1; } - + if(lock_retcode && wait_for_locked_table_names(thd, table)) { pthread_mutex_unlock(&LOCK_open); return -1; } pthread_mutex_unlock(&LOCK_open); - + if(my_copy(src_path, fn_format(dst_path, dst_path,"", reg_ext, 4), @@ -790,25 +790,25 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table) thd->net.no_send_ok = 1; // generate table will try to send OK which messes up the output // for the client - + if(generate_table(thd, table, 0)) { thd->net.no_send_ok = save_no_send_ok; return send_check_errmsg(thd, table, "restore", "Failed generating table from .frm file"); } - + thd->net.no_send_ok = save_no_send_ok; } - - return 0; + + return 0; } static int mysql_admin_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt, thr_lock_type lock_type, bool open_for_modify, - const char *operator_name, + const char *operator_name, int (handler::*operator_func) (THD *, HA_CHECK_OPT *)) { @@ -849,7 +849,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, // to finish the restore in the handler later on table->table = reopen_name_locked_table(thd, table); } - + if (!table->table) { const char *err_msg; |