diff options
author | holyfoot@mysql.com <> | 2006-05-04 02:17:17 +0500 |
---|---|---|
committer | holyfoot@mysql.com <> | 2006-05-04 02:17:17 +0500 |
commit | 2f7ac18f22688ba22e4d4b2082e6b5a957b2ad4f (patch) | |
tree | 182d6f547f5447fed77bc8e8af696e363faba85c /sql/sql_table.cc | |
parent | ec4211923320e398b3ebdef4fdde7f55fe93dd55 (diff) | |
parent | 5b5db01a46acd8e97d1b207913e350511cd975c2 (diff) | |
download | mariadb-git-2f7ac18f22688ba22e4d4b2082e6b5a957b2ad4f.tar.gz |
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.mrg
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7b739798b38..c9e9ce1bba7 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1159,6 +1159,12 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, /* TODO: Add proper checks if handler supports key_type and algorithm */ if (key_info->flags & HA_SPATIAL) { + if (!(file->table_flags() & HA_CAN_RTREEKEYS)) + { + my_message(ER_TABLE_CANT_HANDLE_SPKEYS, ER(ER_TABLE_CANT_HANDLE_SPKEYS), + MYF(0)); + DBUG_RETURN(-1); + } if (key_info->key_parts != 1) { my_error(ER_WRONG_ARGUMENTS, MYF(0), "SPATIAL INDEX"); @@ -2566,11 +2572,16 @@ send_result_message: table->table->s->version=0; // Force close of table else if (open_for_modify) { - pthread_mutex_lock(&LOCK_open); - remove_table_from_cache(thd, table->table->s->db, - table->table->s->table_name, RTFC_NO_FLAG); - pthread_mutex_unlock(&LOCK_open); - /* Something may be modified, that's why we have to invalidate cache */ + if (table->table->s->tmp_table) + table->table->file->info(HA_STATUS_CONST); + else + { + pthread_mutex_lock(&LOCK_open); + remove_table_from_cache(thd, table->table->s->db, + table->table->s->table_name, RTFC_NO_FLAG); + pthread_mutex_unlock(&LOCK_open); + } + /* May be something modified consequently we have to invalidate cache */ query_cache_invalidate3(thd, table->table, 0); } } |